@aztec/aztec.js 0.1.0-alpha29 → 0.1.0-alpha30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dest/main.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see main.js.LICENSE.txt */
2
- var t={4782:(t,e)=>{e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=a(t),s=o[0],c=o[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,c)),f=0,h=c>0?s-4:s;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[f++]=e>>16&255,u[f++]=e>>8&255,u[f++]=255&e;return 2===c&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[f++]=255&e),1===c&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(c(t,a,a+s>u?u:a+s));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<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(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,n){for(var i,o,s=[],a=e;a<n;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[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},238:(t,e,r)=>{var n=r(7172).Buffer;function i(t){n.isBuffer(t)||(t=n.from(t));for(var e=t.length/4|0,r=new Array(e),i=0;i<e;i++)r[i]=t.readUInt32BE(4*i);return r}function o(t){for(;0<t.length;t++)t[0]=0}function s(t,e,r,n,i){for(var o,s,a,c,u=r[0],f=r[1],h=r[2],l=r[3],d=t[0]^e[0],p=t[1]^e[1],g=t[2]^e[2],y=t[3]^e[3],m=4,w=1;w<i;w++)o=u[d>>>24]^f[p>>>16&255]^h[g>>>8&255]^l[255&y]^e[m++],s=u[p>>>24]^f[g>>>16&255]^h[y>>>8&255]^l[255&d]^e[m++],a=u[g>>>24]^f[y>>>16&255]^h[d>>>8&255]^l[255&p]^e[m++],c=u[y>>>24]^f[d>>>16&255]^h[p>>>8&255]^l[255&g]^e[m++],d=o,p=s,g=a,y=c;return o=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[g>>>8&255]<<8|n[255&y])^e[m++],s=(n[p>>>24]<<24|n[g>>>16&255]<<16|n[y>>>8&255]<<8|n[255&d])^e[m++],a=(n[g>>>24]<<24|n[y>>>16&255]<<16|n[d>>>8&255]<<8|n[255&p])^e[m++],c=(n[y>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[255&g])^e[m++],[o>>>=0,s>>>=0,a>>>=0,c>>>=0]}var a=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],s=0,a=0,c=0;c<256;++c){var u=a^a<<1^a<<2^a<<3^a<<4;u=u>>>8^255&u^99,r[s]=u,n[u]=s;var f=t[s],h=t[f],l=t[h],d=257*t[u]^16843008*u;i[0][s]=d<<24|d>>>8,i[1][s]=d<<16|d>>>16,i[2][s]=d<<8|d>>>24,i[3][s]=d,d=16843009*l^65537*h^257*f^16843008*s,o[0][u]=d<<24|d>>>8,o[1][u]=d<<16|d>>>16,o[2][u]=d<<8|d>>>24,o[3][u]=d,0===s?s=a=1:(s=f^t[t[t[l^f]]],a^=t[t[a]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function u(t){this._key=i(t),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,n=4*(r+1),i=[],o=0;o<e;o++)i[o]=t[o];for(o=e;o<n;o++){var s=i[o-1];o%e==0?(s=s<<8|s>>>24,s=c.SBOX[s>>>24]<<24|c.SBOX[s>>>16&255]<<16|c.SBOX[s>>>8&255]<<8|c.SBOX[255&s],s^=a[o/e|0]<<24):e>6&&o%e==4&&(s=c.SBOX[s>>>24]<<24|c.SBOX[s>>>16&255]<<16|c.SBOX[s>>>8&255]<<8|c.SBOX[255&s]),i[o]=i[o-e]^s}for(var u=[],f=0;f<n;f++){var h=n-f,l=i[h-(f%4?0:4)];u[f]=f<4||h<=4?l:c.INV_SUB_MIX[0][c.SBOX[l>>>24]]^c.INV_SUB_MIX[1][c.SBOX[l>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[l>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&l]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=u},u.prototype.encryptBlockRaw=function(t){return s(t=i(t),this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},u.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=n.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},u.prototype.decryptBlock=function(t){var e=(t=i(t))[1];t[1]=t[3],t[3]=e;var r=s(t,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},u.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=u},8587:(t,e,r)=>{var n=r(238),i=r(7172).Buffer,o=r(3081),s=r(87),a=r(1219),c=r(7752),u=r(3480);function f(t,e,r,s){o.call(this);var c=i.alloc(4,0);this._cipher=new n.AES(e);var f=this._cipher.encryptBlock(c);this._ghash=new a(f),r=function(t,e,r){if(12===e.length)return t._finID=i.concat([e,i.from([0,0,0,1])]),i.concat([e,i.from([0,0,0,2])]);var n=new a(r),o=e.length,s=o%16;n.update(e),s&&(s=16-s,n.update(i.alloc(s,0))),n.update(i.alloc(8,0));var c=8*o,f=i.alloc(8);f.writeUIntBE(c,0,8),n.update(f),t._finID=n.state;var h=i.from(t._finID);return u(h),h}(this,r,f),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}s(f,o),f.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=i.alloc(e,0),this._ghash.update(e))}this._called=!0;var r=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(r),this._len+=t.length,r},f.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=c(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(t,e){var r=0;t.length!==e.length&&r++;for(var n=Math.min(t.length,e.length),i=0;i<n;++i)r+=t[i]^e[i];return r}(t,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=t,this._cipher.scrub()},f.prototype.getAuthTag=function(){if(this._decrypt||!i.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},f.prototype.setAuthTag=function(t){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=t},f.prototype.setAAD=function(t){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length},t.exports=f},8901:(t,e,r)=>{var n=r(3615),i=r(2576),o=r(4636);e.createCipher=e.Cipher=n.createCipher,e.createCipheriv=e.Cipheriv=n.createCipheriv,e.createDecipher=e.Decipher=i.createDecipher,e.createDecipheriv=e.Decipheriv=i.createDecipheriv,e.listCiphers=e.getCiphers=function(){return Object.keys(o)}},2576:(t,e,r)=>{var n=r(8587),i=r(7172).Buffer,o=r(3834),s=r(2385),a=r(3081),c=r(238),u=r(5883);function f(t,e,r){a.call(this),this._cache=new h,this._last=void 0,this._cipher=new c.AES(e),this._prev=i.from(r),this._mode=t,this._autopadding=!0}function h(){this.cache=i.allocUnsafe(0)}function l(t,e,r){var a=o[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof e&&(e=i.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);return"stream"===a.type?new s(a.module,e,r,!0):"auth"===a.type?new n(a.module,e,r,!0):new f(a.module,e,r)}r(87)(f,a),f.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,e),n.push(r);return i.concat(n)},f.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");for(var r=-1;++r<e;)if(t[r+(16-e)]!==e)throw new Error("unable to decrypt data");if(16!==e)return t.slice(0,16-e)}(this._mode.decrypt(this,t));if(t)throw new Error("data not multiple of block length")},f.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},h.prototype.add=function(t){this.cache=i.concat([this.cache,t])},h.prototype.get=function(t){var e;if(t){if(this.cache.length>16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},h.prototype.flush=function(){if(this.cache.length)return this.cache},e.createDecipher=function(t,e){var r=o[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=u(e,!1,r.key,r.iv);return l(t,n.key,n.iv)},e.createDecipheriv=l},3615:(t,e,r)=>{var n=r(3834),i=r(8587),o=r(7172).Buffer,s=r(2385),a=r(3081),c=r(238),u=r(5883);function f(t,e,r){a.call(this),this._cache=new l,this._cipher=new c.AES(e),this._prev=o.from(r),this._mode=t,this._autopadding=!0}r(87)(f,a),f.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get();)r=this._mode.encrypt(this,e),n.push(r);return o.concat(n)};var h=o.alloc(16,16);function l(){this.cache=o.allocUnsafe(0)}function d(t,e,r){var a=n[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=o.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===a.type?new s(a.module,e,r):"auth"===a.type?new i(a.module,e,r):new f(a.module,e,r)}f.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(h))throw this._cipher.scrub(),new Error("data not multiple of block length")},f.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},l.prototype.add=function(t){this.cache=o.concat([this.cache,t])},l.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},l.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),r=-1;++r<t;)e.writeUInt8(t,r);return o.concat([this.cache,e])},e.createCipheriv=d,e.createCipher=function(t,e){var r=n[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=u(e,!1,r.key,r.iv);return d(t,i.key,i.iv)}},1219:(t,e,r)=>{var n=r(7172).Buffer,i=n.alloc(16,0);function o(t){var e=n.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function s(t){this.h=t,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}s.prototype.ghash=function(t){for(var e=-1;++e<t.length;)this.state[e]^=t[e];this._multiply()},s.prototype._multiply=function(){for(var t,e,r,n=[(t=this.h).readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)],i=[0,0,0,0],s=-1;++s<128;){for(0!=(this.state[~~(s/8)]&1<<7-s%8)&&(i[0]^=n[0],i[1]^=n[1],i[2]^=n[2],i[3]^=n[3]),r=0!=(1&n[3]),e=3;e>0;e--)n[e]=n[e]>>>1|(1&n[e-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},s.prototype.update=function(t){var e;for(this.cache=n.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},s.prototype.final=function(t,e){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,t,0,e])),this.state},t.exports=s},3480:t=>{t.exports=function(t){for(var e,r=t.length;r--;){if(255!==(e=t.readUInt8(r))){e++,t.writeUInt8(e,r);break}t.writeUInt8(0,r)}}},6280:(t,e,r)=>{var n=r(7752);e.encrypt=function(t,e){var r=n(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev},e.decrypt=function(t,e){var r=t._prev;t._prev=e;var i=t._cipher.decryptBlock(e);return n(i,r)}},392:(t,e,r)=>{var n=r(7172).Buffer,i=r(7752);function o(t,e,r){var o=e.length,s=i(e,t._cache);return t._cache=t._cache.slice(o),t._prev=n.concat([t._prev,r?e:s]),s}e.encrypt=function(t,e,r){for(var i,s=n.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=n.allocUnsafe(0)),!(t._cache.length<=e.length)){s=n.concat([s,o(t,e,r)]);break}i=t._cache.length,s=n.concat([s,o(t,e.slice(0,i),r)]),e=e.slice(i)}return s}},5739:(t,e,r)=>{var n=r(7172).Buffer;function i(t,e,r){for(var n,i,s=-1,a=0;++s<8;)n=e&1<<7-s?128:0,a+=(128&(i=t._cipher.encryptBlock(t._prev)[0]^n))>>s%8,t._prev=o(t._prev,r?n:i);return a}function o(t,e){var r=t.length,i=-1,o=n.allocUnsafe(t.length);for(t=n.concat([t,n.from([e])]);++i<r;)o[i]=t[i]<<1|t[i+1]>>7;return o}e.encrypt=function(t,e,r){for(var o=e.length,s=n.allocUnsafe(o),a=-1;++a<o;)s[a]=i(t,e[a],r);return s}},2228:(t,e,r)=>{var n=r(7172).Buffer;function i(t,e,r){var i=t._cipher.encryptBlock(t._prev)[0]^e;return t._prev=n.concat([t._prev.slice(1),n.from([r?e:i])]),i}e.encrypt=function(t,e,r){for(var o=e.length,s=n.allocUnsafe(o),a=-1;++a<o;)s[a]=i(t,e[a],r);return s}},2751:(t,e,r)=>{var n=r(7752),i=r(7172).Buffer,o=r(3480);function s(t){var e=t._cipher.encryptBlockRaw(t._prev);return o(t._prev),e}e.encrypt=function(t,e){var r=Math.ceil(e.length/16),o=t._cache.length;t._cache=i.concat([t._cache,i.allocUnsafe(16*r)]);for(var a=0;a<r;a++){var c=s(t),u=o+16*a;t._cache.writeUInt32BE(c[0],u+0),t._cache.writeUInt32BE(c[1],u+4),t._cache.writeUInt32BE(c[2],u+8),t._cache.writeUInt32BE(c[3],u+12)}var f=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),n(e,f)}},2437:(t,e)=>{e.encrypt=function(t,e){return t._cipher.encryptBlock(e)},e.decrypt=function(t,e){return t._cipher.decryptBlock(e)}},3834:(t,e,r)=>{var n={ECB:r(2437),CBC:r(6280),CFB:r(392),CFB8:r(2228),CFB1:r(5739),OFB:r(8428),CTR:r(2751),GCM:r(2751)},i=r(4636);for(var o in i)i[o].module=n[i[o].mode];t.exports=i},8428:(t,e,r)=>{var n=r(816).Buffer,i=r(7752);function o(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}e.encrypt=function(t,e){for(;t._cache.length<e.length;)t._cache=n.concat([t._cache,o(t)]);var r=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),i(e,r)}},2385:(t,e,r)=>{var n=r(238),i=r(7172).Buffer,o=r(3081);function s(t,e,r,s){o.call(this),this._cipher=new n.AES(e),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._mode=t}r(87)(s,o),s.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)},s.prototype._final=function(){this._cipher.scrub()},t.exports=s},1240:(t,e,r)=>{r(5681),r(8901),r(3834),r(1035),r(5883)},5681:(t,e,r)=>{var n=r(3081),i=r(7191),o=r(87),s=r(7172).Buffer,a={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function c(t){n.call(this);var e,r=t.mode.toLowerCase(),i=a[r];e=t.decrypt?"decrypt":"encrypt";var o=t.key;s.isBuffer(o)||(o=s.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=s.concat([o,o.slice(0,8)]));var c=t.iv;s.isBuffer(c)||(c=s.from(c)),this._des=i.create({key:o,iv:c,type:e})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],t.exports=c,o(c,n),c.prototype._update=function(t){return s.from(this._des.update(t))},c.prototype._final=function(){return s.from(this._des.final())}},1035:(t,e)=>{e["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}},7752:(t,e,r)=>{var n=r(816).Buffer;t.exports=function(t,e){for(var r=Math.min(t.length,e.length),i=new n(r),o=0;o<r;++o)i[o]=t[o]^e[o];return i}},816:(t,e,r)=>{const n=r(4782),i=r(8898),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|g(t,e);let n=a(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(K(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return l(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(K(t,ArrayBuffer)||t&&K(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(K(t,SharedArrayBuffer)||t&&K(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return c.from(n,e,r);const i=function(t){if(c.isBuffer(t)){const e=0|p(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Y(t.length)?a(0):l(t):"Buffer"===t.type&&Array.isArray(t.data)?l(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return f(t),a(t<0?0:0|p(t))}function l(t){const e=t.length<0?0:0|p(t.length),r=a(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function d(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,c.prototype),n}function p(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function g(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||K(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return V(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(t).length;default:if(i)return n?-1:V(t).length;e=(""+e).toLowerCase(),i=!0}}function y(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return L(this,e,r);case"utf8":case"utf-8":return R(this,e,r);case"ascii":return C(this,e,r);case"latin1":case"binary":return O(this,e,r);case"base64":return B(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function w(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){let o,s=1,a=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;o<a;o++)if(u(t,o)===u(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===c)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+c>a&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;n<c;n++)if(u(t,o+n)!==u(e,n)){r=!1;break}if(r)return o}return-1}function v(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(e.substr(2*s,2),16);if(Y(n))return s;t[r+s]=n}return s}function _(t,e,r,n){return G(V(e,t.length-r),t,r,n)}function E(t,e,r,n){return G(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function S(t,e,r,n){return G(W(e),t,r,n)}function T(t,e,r,n){return G(function(t,e){let r,n,i;const o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function B(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function R(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let o=null,s=e>239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(c=(31&e)<<6|63&r,c>127&&(o=c));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(c=(15&e)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}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(t){const e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=A));return r}(n)}e.kMaxLength=s,c.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),c.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(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(t,e,r){return function(t,e,r){return f(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},c.allocUnsafe=function(t){return h(t)},c.allocUnsafeSlow=function(t){return h(t)},c.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==c.prototype},c.compare=function(t,e){if(K(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),K(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).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}},c.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=c.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(K(e,Uint8Array))i+e.length>n.length?(c.isBuffer(e)||(e=c.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},c.byteLength=g,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},c.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},c.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},c.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?R(this,0,t):y.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(t,e,r,n,i){if(K(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(o,s),u=this.slice(n,i),f=t.slice(e,r);for(let t=0;t<a;++t)if(u[t]!==f[t]){o=u[t],s=f[t];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return w(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return w(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":case"latin1":case"binary":return E(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const A=4096;function C(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function O(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function L(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=J[t[n]];return i}function x(t,e,r){const n=t.slice(e,r);let i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function I(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function k(t,e,r,n,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function N(t,e,r,n,i){H(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function M(t,e,r,n,i){H(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function P(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,o){return e=+e,r>>>=0,o||P(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function U(t,e,r,n,o){return e=+e,r>>>=0,o||P(t,0,r,8),i.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=X((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),c.prototype.readBigUInt64BE=X((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),c.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||I(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){t>>>=0,e||I(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=X((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),c.prototype.readBigInt64BE=X((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),c.prototype.readFloatLE=function(t,e){return t>>>=0,e||I(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||I(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||I(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||I(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||k(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||k(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigUInt64LE=X((function(t,e=0){return N(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=X((function(t,e=0){return M(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigInt64LE=X((function(t,e=0){return N(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=X((function(t,e=0){return M(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return U(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<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),t.length-e<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=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&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{const o=c.isBuffer(t)?t:c.from(t,n),s=o.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%s]}return this};const F={};function j(t,e,r){F[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function $(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function H(t,e,r,n,i,o){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===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}`:`>= ${e}${n} and <= ${r}${n}`,new F.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){q(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||z(e,t.length-(r+1))}(n,i,o)}function q(t,e){if("number"!=typeof t)throw new F.ERR_INVALID_ARG_TYPE(e,"number",t)}function z(t,e,r){if(Math.floor(t)!==t)throw q(t,r),new F.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}j("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),j("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),j("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=$(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=$(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const Z=/[^+/0-9A-Za-z-_]/g;function V(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=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((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function W(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(Z,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function G(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function K(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}const J=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function X(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},3081:(t,e,r)=>{var n=r(7172).Buffer,i=r(3424).Transform,o=r(4361).s;function s(t){i.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(87)(s,i),s.prototype.update=function(t,e,r){"string"==typeof t&&(t=n.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},s.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},s.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return t&&(e=this._toString(e,t,!0)),e},s.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},t.exports=s},5862:t=>{var e=1e3,r=60*e,n=60*r,i=24*n;function o(t,e,r,n){var i=e>=1.5*r;return Math.round(t/r)+" "+n+(i?"s":"")}t.exports=function(t,s){s=s||{};var a,c,u=typeof t;if("string"===u&&t.length>0)return function(t){if(!((t=String(t)).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(t);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*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(t);if("number"===u&&isFinite(t))return s.long?(a=t,(c=Math.abs(a))>=i?o(a,c,i,"day"):c>=n?o(a,c,n,"hour"):c>=r?o(a,c,r,"minute"):c>=e?o(a,c,e,"second"):a+" ms"):function(t){var o=Math.abs(t);return o>=i?Math.round(t/i)+"d":o>=n?Math.round(t/n)+"h":o>=r?Math.round(t/r)+"m":o>=e?Math.round(t/e)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},6292:(t,e,r)=>{e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;e.splice(1,0,r,"color: inherit");let n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(n++,"%c"===t&&(i=n))})),e.splice(i,0,r)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t={NODE_ENV:"production"}.DEBUG),t},e.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+)/))},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!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`."))}})(),e.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"],e.log=console.debug||console.log||(()=>{}),t.exports=r(9374)(e);const{formatters:n}=t.exports;n.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},9374:(t,e,r)=>{t.exports=function(t){function e(t){let r,i,o,s=null;function a(...t){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,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";s++;const o=e.formatters[i];if("function"==typeof o){const e=t[s];r=o.call(n,e),t.splice(s,1),s--}return r})),e.formatArgs.call(n,t),(n.log||e.log).apply(n,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=n,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==e.namespaces&&(i=e.namespaces,o=e.enabled(t)),o),set:t=>{s=t}}),"function"==typeof e.init&&e.init(a),a}function n(t,r){const n=e(this.namespace+(void 0===r?":":r)+t);return n.log=this.log,n}function i(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){const t=[...e.names.map(i),...e.skips.map(i).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let r;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const n=("string"==typeof t?t:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(t=n[r].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.slice(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let r,n;for(r=0,n=e.skips.length;r<n;r++)if(e.skips[r].test(t))return!1;for(r=0,n=e.names.length;r<n;r++)if(e.names[r].test(t))return!0;return!1},e.humanize=r(5862),e.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(t).forEach((r=>{e[r]=t[r]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let r=0;for(let e=0;e<t.length;e++)r=(r<<5)-r+t.charCodeAt(e),r|=0;return e.colors[Math.abs(r)%e.colors.length]},e.enable(e.load()),e}},7191:(t,e,r)=>{e.utils=r(5516),e.Cipher=r(4923),e.DES=r(225),e.CBC=r(8701),e.EDE=r(6540)},8701:(t,e,r)=>{var n=r(7859),i=r(87),o={};function s(t){n.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=t[e]}e.instantiate=function(t){function e(e){t.call(this,e),this._cbcInit()}i(e,t);for(var r=Object.keys(o),n=0;n<r.length;n++){var s=r[n];e.prototype[s]=o[s]}return e.create=function(t){return new e(t)},e},o._cbcInit=function(){var t=new s(this.options.iv);this._cbcState=t},o._update=function(t,e,r,n){var i=this._cbcState,o=this.constructor.super_.prototype,s=i.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)s[a]^=t[e+a];for(o._update.call(this,s,0,r,n),a=0;a<this.blockSize;a++)s[a]=r[n+a]}else{for(o._update.call(this,t,e,r,n),a=0;a<this.blockSize;a++)r[n+a]^=s[a];for(a=0;a<this.blockSize;a++)s[a]=t[e+a]}}},4923:(t,e,r)=>{var n=r(7859);function i(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=!1!==t.padding}t.exports=i,i.prototype._init=function(){},i.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},i.prototype._buffer=function(t,e){for(var r=Math.min(this.buffer.length-this.bufferOff,t.length-e),n=0;n<r;n++)this.buffer[this.bufferOff+n]=t[e+n];return this.bufferOff+=r,r},i.prototype._flushBuffer=function(t,e){return this._update(this.buffer,0,t,e),this.bufferOff=0,this.blockSize},i.prototype._updateEncrypt=function(t){var e=0,r=0,n=(this.bufferOff+t.length)/this.blockSize|0,i=new Array(n*this.blockSize);0!==this.bufferOff&&(e+=this._buffer(t,e),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(i,r)));for(var o=t.length-(t.length-e)%this.blockSize;e<o;e+=this.blockSize)this._update(t,e,i,r),r+=this.blockSize;for(;e<t.length;e++,this.bufferOff++)this.buffer[this.bufferOff]=t[e];return i},i.prototype._updateDecrypt=function(t){for(var e=0,r=0,n=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,i=new Array(n*this.blockSize);n>0;n--)e+=this._buffer(t,e),r+=this._flushBuffer(i,r);return e+=this._buffer(t,e),i},i.prototype.final=function(t){var e,r;return t&&(e=this.update(t)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},i.prototype._pad=function(t,e){if(0===e)return!1;for(;e<t.length;)t[e++]=0;return!0},i.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var t=new Array(this.blockSize);return this._update(this.buffer,0,t,0),t},i.prototype._unpad=function(t){return t},i.prototype._finalDecrypt=function(){n.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)}},225:(t,e,r)=>{var n=r(7859),i=r(87),o=r(5516),s=r(4923);function a(){this.tmp=new Array(2),this.keys=null}function c(t){s.call(this,t);var e=new a;this._desState=e,this.deriveKeys(e,t.key)}i(c,s),t.exports=c,c.create=function(t){return new c(t)};var u=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];c.prototype.deriveKeys=function(t,e){t.keys=new Array(32),n.equal(e.length,this.blockSize,"Invalid key length");var r=o.readUInt32BE(e,0),i=o.readUInt32BE(e,4);o.pc1(r,i,t.tmp,0),r=t.tmp[0],i=t.tmp[1];for(var s=0;s<t.keys.length;s+=2){var a=u[s>>>1];r=o.r28shl(r,a),i=o.r28shl(i,a),o.pc2(r,i,t.keys,s)}},c.prototype._update=function(t,e,r,n){var i=this._desState,s=o.readUInt32BE(t,e),a=o.readUInt32BE(t,e+4);o.ip(s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],"encrypt"===this.type?this._encrypt(i,s,a,i.tmp,0):this._decrypt(i,s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],o.writeUInt32BE(r,s,n),o.writeUInt32BE(r,a,n+4)},c.prototype._pad=function(t,e){if(!1===this.padding)return!1;for(var r=t.length-e,n=e;n<t.length;n++)t[n]=r;return!0},c.prototype._unpad=function(t){if(!1===this.padding)return t;for(var e=t[t.length-1],r=t.length-e;r<t.length;r++)n.equal(t[r],e);return t.slice(0,t.length-e)},c.prototype._encrypt=function(t,e,r,n,i){for(var s=e,a=r,c=0;c<t.keys.length;c+=2){var u=t.keys[c],f=t.keys[c+1];o.expand(a,t.tmp,0),u^=t.tmp[0],f^=t.tmp[1];var h=o.substitute(u,f),l=a;a=(s^o.permute(h))>>>0,s=l}o.rip(a,s,n,i)},c.prototype._decrypt=function(t,e,r,n,i){for(var s=r,a=e,c=t.keys.length-2;c>=0;c-=2){var u=t.keys[c],f=t.keys[c+1];o.expand(s,t.tmp,0),u^=t.tmp[0],f^=t.tmp[1];var h=o.substitute(u,f),l=s;s=(a^o.permute(h))>>>0,a=l}o.rip(s,a,n,i)}},6540:(t,e,r)=>{var n=r(7859),i=r(87),o=r(4923),s=r(225);function a(t,e){n.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),i=e.slice(8,16),o=e.slice(16,24);this.ciphers="encrypt"===t?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:o})]:[s.create({type:"decrypt",key:o}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function c(t){o.call(this,t);var e=new a(this.type,this.options.key);this._edeState=e}i(c,o),t.exports=c,c.create=function(t){return new c(t)},c.prototype._update=function(t,e,r,n){var i=this._edeState;i.ciphers[0]._update(t,e,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},c.prototype._pad=s.prototype._pad,c.prototype._unpad=s.prototype._unpad},5516:(t,e)=>{e.readUInt32BE=function(t,e){return(t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e])>>>0},e.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},e.ip=function(t,e,r,n){for(var i=0,o=0,s=6;s>=0;s-=2){for(var a=0;a<=24;a+=8)i<<=1,i|=e>>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=t>>>a+s&1}for(s=6;s>=0;s-=2){for(a=1;a<=25;a+=8)o<<=1,o|=e>>>a+s&1;for(a=1;a<=25;a+=8)o<<=1,o|=t>>>a+s&1}r[n+0]=i>>>0,r[n+1]=o>>>0},e.rip=function(t,e,r,n){for(var i=0,o=0,s=0;s<4;s++)for(var a=24;a>=0;a-=8)i<<=1,i|=e>>>a+s&1,i<<=1,i|=t>>>a+s&1;for(s=4;s<8;s++)for(a=24;a>=0;a-=8)o<<=1,o|=e>>>a+s&1,o<<=1,o|=t>>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.pc1=function(t,e,r,n){for(var i=0,o=0,s=7;s>=5;s--){for(var a=0;a<=24;a+=8)i<<=1,i|=e>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=t>>a+s&1}for(a=0;a<=24;a+=8)i<<=1,i|=e>>a+s&1;for(s=1;s<=3;s++){for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1;for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1}for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.r28shl=function(t,e){return t<<e&268435455|t>>>28-e};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];e.pc2=function(t,e,n,i){for(var o=0,s=0,a=r.length>>>1,c=0;c<a;c++)o<<=1,o|=t>>>r[c]&1;for(c=a;c<r.length;c++)s<<=1,s|=e>>>r[c]&1;n[i+0]=o>>>0,n[i+1]=s>>>0},e.expand=function(t,e,r){var n=0,i=0;n=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=t>>>o&63;for(o=11;o>=3;o-=4)i|=t>>>o&63,i<<=6;i|=(31&t)<<1|t>>>31,e[r+0]=n>>>0,e[r+1]=i>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];e.substitute=function(t,e){for(var r=0,i=0;i<4;i++)r<<=4,r|=n[64*i+(t>>>18-6*i&63)];for(i=0;i<4;i++)r<<=4,r|=n[256+64*i+(e>>>18-6*i&63)];return r>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];e.permute=function(t){for(var e=0,r=0;r<i.length;r++)e<<=1,e|=t>>>i[r]&1;return e>>>0},e.padSplit=function(t,e,r){for(var n=t.toString(2);n.length<e;)n="0"+n;for(var i=[],o=0;o<e;o+=r)i.push(n.slice(o,o+r));return i.join(" ")}},3302:t=>{t.exports=!1},343:t=>{var e,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}g(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&g(t,"error",e,{once:!0})}(t,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function u(t,e,r,n){var i,o,s,u;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=c(t))>0&&s.length>i&&!s.warned){s.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=s.length,u=f,console&&console.warn&&console.warn(u)}return t}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 h(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function l(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):p(i,i.length)}function d(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function g(t,e,r,n){if("function"==typeof t.on)n.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(o){n.once&&t.removeEventListener(e,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");s=t}}),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(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var i="error"===t,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[t];if(void 0===c)return!1;if("function"==typeof c)n(c,this,e);else{var u=c.length,f=p(c,u);for(r=0;r<u;++r)n(f[r],this,e)}return!0},o.prototype.addListener=function(t,e){return u(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return u(this,t,e,!0)},o.prototype.once=function(t,e){return a(e),this.on(t,h(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,h(this,t,e)),this},o.prototype.removeListener=function(t,e){var r,n,i,o,s;if(a(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(t){var e,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[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),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(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return l(this,t,!0)},o.prototype.rawListeners=function(t){return l(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},5883:(t,e,r)=>{var n=r(7172).Buffer,i=r(9500);t.exports=function(t,e,r,o){if(n.isBuffer(t)||(t=n.from(t,"binary")),e&&(n.isBuffer(e)||(e=n.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=r/8,a=n.alloc(s),c=n.alloc(o||0),u=n.alloc(0);s>0||o>0;){var f=new i;f.update(u),f.update(t),e&&f.update(e),u=f.digest();var h=0;if(s>0){var l=a.length-s;h=Math.min(s,u.length),u.copy(a,l,0,h),s-=h}if(h<u.length&&o>0){var d=c.length-o,p=Math.min(o,u.length-h);u.copy(c,d,h,h+p),o-=p}}return u.fill(0),{key:a,iv:c}}},6883:(t,e,r)=>{var n=r(7172).Buffer,i=r(8310).Transform;function o(t){i.call(this),this._block=n.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(87)(o,i),o.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!n.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer")}(t),this._finalized)throw new Error("Digest already called");n.isBuffer(t)||(t=n.from(t,e));for(var r=this._block,i=0;this._blockOffset+t.length-i>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)r[o++]=t[i++];this._update(),this._blockOffset=0}for(;i<t.length;)r[this._blockOffset++]=t[i++];for(var s=0,a=8*t.length;a>0;++s)this._length[s]+=a,(a=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*a);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},5294:(t,e,r)=>{var n=e;n.utils=r(8626),n.common=r(8717),n.sha=r(2589),n.ripemd=r(8494),n.hmac=r(2750),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},8717:(t,e,r)=>{var n=r(8626),i=r(7859);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=o,o.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},o.prototype.digest=function(t){return this.update(this._pad()),i(null===this.pending),this._digest(t)},o.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},2750:(t,e,r)=>{var n=r(8626),i=r(7859);function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}t.exports=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},8494:(t,e,r)=>{var n=r(8626),i=r(8717),o=n.rotl32,s=n.sum32,a=n.sum32_3,c=n.sum32_4,u=i.BlockHash;function f(){if(!(this instanceof f))return new f;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function h(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function l(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function d(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(f,u),e.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],u=this.h[3],f=this.h[4],w=r,b=n,v=i,_=u,E=f,S=0;S<80;S++){var T=s(o(c(r,h(S,n,i,u),t[p[S]+e],l(S)),y[S]),f);r=f,f=u,u=o(i,10),i=n,n=T,T=s(o(c(w,h(79-S,b,v,_),t[g[S]+e],d(S)),m[S]),E),w=E,E=_,_=o(v,10),v=b,b=T}T=a(this.h[1],i,_),this.h[1]=a(this.h[2],u,E),this.h[2]=a(this.h[3],f,w),this.h[3]=a(this.h[4],r,b),this.h[4]=a(this.h[0],n,v),this.h[0]=T},f.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],g=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],y=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],m=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},2589:(t,e,r)=>{e.sha1=r(9330),e.sha224=r(5168),e.sha256=r(375),e.sha384=r(8899),e.sha512=r(790)},9330:(t,e,r)=>{var n=r(8626),i=r(8717),o=r(8156),s=n.rotl32,a=n.sum32,c=n.sum32_5,u=o.ft_1,f=i.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(l,f),t.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],f=this.h[2],l=this.h[3],d=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),g=c(s(i,5),u(p,o,f,l),d,r[n],h[p]);d=l,l=f,f=s(o,30),o=i,i=g}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],f),this.h[3]=a(this.h[3],l),this.h[4]=a(this.h[4],d)},l.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},5168:(t,e,r)=>{var n=r(8626),i=r(375);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},375:(t,e,r)=>{var n=r(8626),i=r(8717),o=r(8156),s=r(7859),a=n.sum32,c=n.sum32_4,u=n.sum32_5,f=o.ch32,h=o.maj32,l=o.s0_256,d=o.s1_256,p=o.g0_256,g=o.g1_256,y=i.BlockHash,m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function w(){if(!(this instanceof w))return new w;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}n.inherits(w,y),t.exports=w,w.blockSize=512,w.outSize=256,w.hmacStrength=192,w.padLength=64,w.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=c(g(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],y=this.h[2],m=this.h[3],w=this.h[4],b=this.h[5],v=this.h[6],_=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var E=u(_,d(w),f(w,b,v),this.k[n],r[n]),S=a(l(i),h(i,o,y));_=v,v=b,b=w,w=a(m,E),m=y,y=o,o=i,i=a(E,S)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],y),this.h[3]=a(this.h[3],m),this.h[4]=a(this.h[4],w),this.h[5]=a(this.h[5],b),this.h[6]=a(this.h[6],v),this.h[7]=a(this.h[7],_)},w.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},8899:(t,e,r)=>{var n=r(8626),i=r(790);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},790:(t,e,r)=>{var n=r(8626),i=r(8717),o=r(7859),s=n.rotr64_hi,a=n.rotr64_lo,c=n.shr64_hi,u=n.shr64_lo,f=n.sum64,h=n.sum64_hi,l=n.sum64_lo,d=n.sum64_4_hi,p=n.sum64_4_lo,g=n.sum64_5_hi,y=n.sum64_5_lo,m=i.BlockHash,w=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function b(){if(!(this instanceof b))return new b;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=w,this.W=new Array(160)}function v(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function _(t,e,r,n,i,o){var s=e&n^~e&o;return s<0&&(s+=4294967296),s}function E(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function S(t,e,r,n,i,o){var s=e&n^e&o^n&o;return s<0&&(s+=4294967296),s}function T(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function B(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function R(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function A(t,e){var r=s(t,e,1)^s(t,e,8)^c(t,e,7);return r<0&&(r+=4294967296),r}function C(t,e){var r=a(t,e,1)^a(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function O(t,e){var r=a(t,e,19)^a(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(b,m),t.exports=b,b.blockSize=1024,b.outSize=512,b.hmacStrength=192,b.padLength=128,b.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=(y=r[n-4],m=r[n-3],w=void 0,(w=s(y,m,19)^s(m,y,29)^c(y,m,6))<0&&(w+=4294967296),w),o=O(r[n-4],r[n-3]),a=r[n-14],u=r[n-13],f=A(r[n-30],r[n-29]),h=C(r[n-30],r[n-29]),l=r[n-32],g=r[n-31];r[n]=d(i,o,a,u,f,h,l,g),r[n+1]=p(i,o,a,u,f,h,l,g)}var y,m,w},b.prototype._update=function(t,e){this._prepareBlock(t,e);var r,n,i,a=this.W,c=this.h[0],u=this.h[1],d=this.h[2],p=this.h[3],m=this.h[4],w=this.h[5],b=this.h[6],A=this.h[7],C=this.h[8],O=this.h[9],L=this.h[10],x=this.h[11],I=this.h[12],k=this.h[13],N=this.h[14],M=this.h[15];o(this.k.length===a.length);for(var P=0;P<a.length;P+=2){var D=N,U=M,F=(i=void 0,(i=s(r=C,n=O,14)^s(r,n,18)^s(n,r,9))<0&&(i+=4294967296),i),j=R(C,O),$=v(C,0,L,0,I),H=_(0,O,0,x,0,k),q=this.k[P],z=this.k[P+1],Z=a[P],V=a[P+1],W=g(D,U,F,j,$,H,q,z,Z,V),G=y(D,U,F,j,$,H,q,z,Z,V);D=T(c,u),U=B(c,u),F=E(c,0,d,0,m),j=S(0,u,0,p,0,w);var K=h(D,U,F,j),Y=l(D,U,F,j);N=I,M=k,I=L,k=x,L=C,x=O,C=h(b,A,W,G),O=l(A,A,W,G),b=m,A=w,m=d,w=p,d=c,p=u,c=h(W,G,K,Y),u=l(W,G,K,Y)}f(this.h,0,c,u),f(this.h,2,d,p),f(this.h,4,m,w),f(this.h,6,b,A),f(this.h,8,C,O),f(this.h,10,L,x),f(this.h,12,I,k),f(this.h,14,N,M)},b.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},8156:(t,e,r)=>{var n=r(8626).rotr32;function i(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function s(t,e,r){return t^e^r}e.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?s(e,r,n):2===t?o(e,r,n):void 0},e.ch32=i,e.maj32=o,e.p32=s,e.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},e.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},e.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},8626:(t,e,r)=>{var n=r(7859),i=r(87);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function s(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function c(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var s=t.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):o(t,i)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i<t.length;i++)r[i]=0|t[i];return r},e.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=a(t[r].toString(16));return e},e.htonl=s,e.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=s(i)),r+=c(i.toString(16))}return r},e.zero2=a,e.zero8=c,e.join32=function(t,e,r,i){var o=r-e;n(o%4==0);for(var s=new Array(o/4),a=0,c=e;a<s.length;a++,c+=4){var u;u="big"===i?t[c]<<24|t[c+1]<<16|t[c+2]<<8|t[c+3]:t[c+3]<<24|t[c+2]<<16|t[c+1]<<8|t[c],s[a]=u>>>0}return s},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var o=t[n];"big"===e?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,s=(o<n?1:0)+r+i;t[e]=s>>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,o,s,a){var c=0,u=e;return c+=(u=u+n>>>0)<e?1:0,c+=(u=u+o>>>0)<o?1:0,t+r+i+s+(c+=(u=u+a>>>0)<a?1:0)>>>0},e.sum64_4_lo=function(t,e,r,n,i,o,s,a){return e+n+o+a>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,s,a,c,u){var f=0,h=e;return f+=(h=h+n>>>0)<e?1:0,f+=(h=h+o>>>0)<o?1:0,f+=(h=h+a>>>0)<a?1:0,t+r+i+s+c+(f+=(h=h+u>>>0)<u?1:0)>>>0},e.sum64_5_lo=function(t,e,r,n,i,o,s,a,c,u){return e+n+o+a+u>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},8898:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,c=(1<<a)-1,u=c>>1,f=-7,h=r?i-1:0,l=r?-1:1,d=t[e+h];for(h+=l,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+t[e+h],h+=l,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+h],h+=l,f-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=u}return(d?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,c,u=8*o-i-1,f=(1<<u)-1,h=f>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+h>=1?l/c:l*Math.pow(2,1-h))*c>=2&&(s++,c/=2),s+h>=f?(a=0,s=f):s+h>=1?(a=(e*c-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[r+d]=255&s,d+=p,s/=256,u-=8);t[r+d-p]|=128*g}},87:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},3261:t=>{var e=1/0,r=9007199254740991,n=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=/^(?:0|[1-9]\d*)$/,c=parseInt,u=Object.prototype.toString,f=Math.ceil,h=Math.max;function l(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o}function d(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}t.exports=function(t,p,g){p=(g?function(t,e,n){if(!d(n))return!1;var i=typeof e;return!!("number"==i?function(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=r}(t.length)&&!function(t){var e=d(t)?u.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}(t)}(n)&&function(t,e){return!!(e=null==e?r:e)&&("number"==typeof t||a.test(t))&&t>-1&&t%1==0&&t<e}(e,n.length):"string"==i&&e in n)&&function(t,e){return t===e||t!=t&&e!=e}(n[e],t)}(t,p,g):void 0===p)?1:h(function(t){var r=function(t){return t?(t=function(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==u.call(t)}(t))return NaN;if(d(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=d(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(n,"");var r=o.test(t);return r||s.test(t)?c(t.slice(2),r?2:8):i.test(t)?NaN:+t}(t))===e||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}(t),a=r%1;return r==r?a?r-a:r:0}(p),0);var y=t?t.length:0;if(!y||p<1)return[];for(var m=0,w=0,b=Array(f(y/p));m<y;)b[w++]=l(t,m,m+=p);return b}},1328:(t,e,r)=>{t=r.nmd(t);var n="__lodash_hash_undefined__",i=1,o=2,s=1/0,a=9007199254740991,c="[object Arguments]",u="[object Array]",f="[object Boolean]",h="[object Date]",l="[object Error]",d="[object Function]",p="[object GeneratorFunction]",g="[object Map]",y="[object Number]",m="[object Object]",w="[object Promise]",b="[object RegExp]",v="[object Set]",_="[object String]",E="[object Symbol]",S="[object WeakMap]",T="[object ArrayBuffer]",B="[object DataView]",R=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,A=/^\w*$/,C=/^\./,O=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,L=/\\(\\)?/g,x=/^\[object .+?Constructor\]$/,I=/^(?:0|[1-9]\d*)$/,k={};k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k[c]=k[u]=k[T]=k[f]=k[B]=k[h]=k[l]=k[d]=k[g]=k[y]=k[m]=k[b]=k[v]=k[_]=k[S]=!1;var N="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,M="object"==typeof self&&self&&self.Object===Object&&self,P=N||M||Function("return this")(),D=e&&!e.nodeType&&e,U=D&&t&&!t.nodeType&&t,F=U&&U.exports===D&&N.process,j=function(){try{return F&&F.binding("util")}catch(t){}}(),$=j&&j.isTypedArray;function H(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function q(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function z(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function Z(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var V,W,G,K=Array.prototype,Y=Function.prototype,J=Object.prototype,X=P["__core-js_shared__"],Q=(V=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||""))?"Symbol(src)_1."+V:"",tt=Y.toString,et=J.hasOwnProperty,rt=J.toString,nt=RegExp("^"+tt.call(et).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),it=P.Symbol,ot=P.Uint8Array,st=J.propertyIsEnumerable,at=K.splice,ct=(W=Object.keys,G=Object,function(t){return W(G(t))}),ut=Mt(P,"DataView"),ft=Mt(P,"Map"),ht=Mt(P,"Promise"),lt=Mt(P,"Set"),dt=Mt(P,"WeakMap"),pt=Mt(Object,"create"),gt=qt(ut),yt=qt(ft),mt=qt(ht),wt=qt(lt),bt=qt(dt),vt=it?it.prototype:void 0,_t=vt?vt.valueOf:void 0,Et=vt?vt.toString:void 0;function St(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Tt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Bt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Rt(t){var e=-1,r=t?t.length:0;for(this.__data__=new Bt;++e<r;)this.add(t[e])}function At(t){this.__data__=new Tt(t)}function Ct(t,e){for(var r=t.length;r--;)if(Zt(t[r][0],e))return r;return-1}St.prototype.clear=function(){this.__data__=pt?pt(null):{}},St.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},St.prototype.get=function(t){var e=this.__data__;if(pt){var r=e[t];return r===n?void 0:r}return et.call(e,t)?e[t]:void 0},St.prototype.has=function(t){var e=this.__data__;return pt?void 0!==e[t]:et.call(e,t)},St.prototype.set=function(t,e){return this.__data__[t]=pt&&void 0===e?n:e,this},Tt.prototype.clear=function(){this.__data__=[]},Tt.prototype.delete=function(t){var e=this.__data__,r=Ct(e,t);return!(r<0||(r==e.length-1?e.pop():at.call(e,r,1),0))},Tt.prototype.get=function(t){var e=this.__data__,r=Ct(e,t);return r<0?void 0:e[r][1]},Tt.prototype.has=function(t){return Ct(this.__data__,t)>-1},Tt.prototype.set=function(t,e){var r=this.__data__,n=Ct(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Bt.prototype.clear=function(){this.__data__={hash:new St,map:new(ft||Tt),string:new St}},Bt.prototype.delete=function(t){return Nt(this,t).delete(t)},Bt.prototype.get=function(t){return Nt(this,t).get(t)},Bt.prototype.has=function(t){return Nt(this,t).has(t)},Bt.prototype.set=function(t,e){return Nt(this,t).set(t,e),this},Rt.prototype.add=Rt.prototype.push=function(t){return this.__data__.set(t,n),this},Rt.prototype.has=function(t){return this.__data__.has(t)},At.prototype.clear=function(){this.__data__=new Tt},At.prototype.delete=function(t){return this.__data__.delete(t)},At.prototype.get=function(t){return this.__data__.get(t)},At.prototype.has=function(t){return this.__data__.has(t)},At.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Tt){var n=r.__data__;if(!ft||n.length<199)return n.push([t,e]),this;r=this.__data__=new Bt(n)}return r.set(t,e),this};function Ot(t,e){for(var r=0,n=(e=Ut(e,t)?[e]:It(e)).length;null!=t&&r<n;)t=t[Ht(e[r++])];return r&&r==n?t:void 0}function Lt(t,e){return null!=t&&e in Object(t)}function xt(t,e,r,n,s){return t===e||(null==t||null==e||!Jt(t)&&!Xt(e)?t!=t&&e!=e:function(t,e,r,n,s,a){var d=Wt(t),p=Wt(e),w=u,S=u;d||(w=(w=Pt(t))==c?m:w),p||(S=(S=Pt(e))==c?m:S);var R=w==m&&!q(t),A=S==m&&!q(e),C=w==S;if(C&&!R)return a||(a=new At),d||te(t)?kt(t,e,r,n,s,a):function(t,e,r,n,s,a,c){switch(r){case B:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case T:return!(t.byteLength!=e.byteLength||!n(new ot(t),new ot(e)));case f:case h:case y:return Zt(+t,+e);case l:return t.name==e.name&&t.message==e.message;case b:case _:return t==e+"";case g:var u=z;case v:var d=a&o;if(u||(u=Z),t.size!=e.size&&!d)return!1;var p=c.get(t);if(p)return p==e;a|=i,c.set(t,e);var m=kt(u(t),u(e),n,s,a,c);return c.delete(t),m;case E:if(_t)return _t.call(t)==_t.call(e)}return!1}(t,e,w,r,n,s,a);if(!(s&o)){var O=R&&et.call(t,"__wrapped__"),L=A&&et.call(e,"__wrapped__");if(O||L){var x=O?t.value():t,I=L?e.value():e;return a||(a=new At),r(x,I,n,s,a)}}return!!C&&(a||(a=new At),function(t,e,r,n,i,s){var a=i&o,c=ee(t),u=c.length;if(u!=ee(e).length&&!a)return!1;for(var f=u;f--;){var h=c[f];if(!(a?h in e:et.call(e,h)))return!1}var l=s.get(t);if(l&&s.get(e))return l==e;var d=!0;s.set(t,e),s.set(e,t);for(var p=a;++f<u;){var g=t[h=c[f]],y=e[h];if(n)var m=a?n(y,g,h,e,t,s):n(g,y,h,t,e,s);if(!(void 0===m?g===y||r(g,y,n,i,s):m)){d=!1;break}p||(p="constructor"==h)}if(d&&!p){var w=t.constructor,b=e.constructor;w==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof w&&w instanceof w&&"function"==typeof b&&b instanceof b||(d=!1)}return s.delete(t),s.delete(e),d}(t,e,r,n,s,a))}(t,e,xt,r,n,s))}function It(t){return Wt(t)?t:$t(t)}function kt(t,e,r,n,s,a){var c=s&o,u=t.length,f=e.length;if(u!=f&&!(c&&f>u))return!1;var h=a.get(t);if(h&&a.get(e))return h==e;var l=-1,d=!0,p=s&i?new Rt:void 0;for(a.set(t,e),a.set(e,t);++l<u;){var g=t[l],y=e[l];if(n)var m=c?n(y,g,l,e,t,a):n(g,y,l,t,e,a);if(void 0!==m){if(m)continue;d=!1;break}if(p){if(!H(e,(function(t,e){if(!p.has(e)&&(g===t||r(g,t,n,s,a)))return p.add(e)}))){d=!1;break}}else if(g!==y&&!r(g,y,n,s,a)){d=!1;break}}return a.delete(t),a.delete(e),d}function Nt(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Mt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Jt(t)||function(t){return!!Q&&Q in t}(t))&&(Kt(t)||q(t)?nt:x).test(qt(t))}(r)?r:void 0}var Pt=function(t){return rt.call(t)};function Dt(t,e){return!!(e=null==e?a:e)&&("number"==typeof t||I.test(t))&&t>-1&&t%1==0&&t<e}function Ut(t,e){if(Wt(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!Qt(t))||A.test(t)||!R.test(t)||null!=e&&t in Object(e)}function Ft(t){return t==t&&!Jt(t)}function jt(t,e){return function(r){return null!=r&&r[t]===e&&(void 0!==e||t in Object(r))}}(ut&&Pt(new ut(new ArrayBuffer(1)))!=B||ft&&Pt(new ft)!=g||ht&&Pt(ht.resolve())!=w||lt&&Pt(new lt)!=v||dt&&Pt(new dt)!=S)&&(Pt=function(t){var e=rt.call(t),r=e==m?t.constructor:void 0,n=r?qt(r):void 0;if(n)switch(n){case gt:return B;case yt:return g;case mt:return w;case wt:return v;case bt:return S}return e});var $t=zt((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(Qt(t))return Et?Et.call(t):"";var e=t+"";return"0"==e&&1/t==-s?"-0":e}(e);var r=[];return C.test(t)&&r.push(""),t.replace(O,(function(t,e,n,i){r.push(n?i.replace(L,"$1"):e||t)})),r}));function Ht(t){if("string"==typeof t||Qt(t))return t;var e=t+"";return"0"==e&&1/t==-s?"-0":e}function qt(t){if(null!=t){try{return tt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function zt(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(zt.Cache||Bt),r}function Zt(t,e){return t===e||t!=t&&e!=e}function Vt(t){return function(t){return Xt(t)&&Gt(t)}(t)&&et.call(t,"callee")&&(!st.call(t,"callee")||rt.call(t)==c)}zt.Cache=Bt;var Wt=Array.isArray;function Gt(t){return null!=t&&Yt(t.length)&&!Kt(t)}function Kt(t){var e=Jt(t)?rt.call(t):"";return e==d||e==p}function Yt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function Jt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Xt(t){return!!t&&"object"==typeof t}function Qt(t){return"symbol"==typeof t||Xt(t)&&rt.call(t)==E}var te=$?function(t){return function(e){return t(e)}}($):function(t){return Xt(t)&&Yt(t.length)&&!!k[rt.call(t)]};function ee(t){return Gt(t)?function(t,e){var r=Wt(t)||Vt(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,i=!!n;for(var o in t)!e&&!et.call(t,o)||i&&("length"==o||Dt(o,n))||r.push(o);return r}(t):function(t){if(r=(e=t)&&e.constructor,e!==("function"==typeof r&&r.prototype||J))return ct(t);var e,r,n=[];for(var i in Object(t))et.call(t,i)&&"constructor"!=i&&n.push(i);return n}(t)}function re(t){return t}t.exports=function(t,e){var r,n,s,a,c,u={};return e="function"==typeof(r=e)?r:null==r?re:"object"==typeof r?Wt(r)?function(t,e){return Ut(t)&&Ft(e)?jt(Ht(t),e):function(r){var n=function(t,e,r){var n=null==t?void 0:Ot(t,e);return void 0===n?void 0:n}(r,t);return void 0===n&&n===e?function(t,e){return null!=t&&function(t,e,r){for(var n,i=-1,o=(e=Ut(e,t)?[e]:It(e)).length;++i<o;){var s=Ht(e[i]);if(!(n=null!=t&&r(t,s)))break;t=t[s]}return n||!!(o=t?t.length:0)&&Yt(o)&&Dt(s,o)&&(Wt(t)||Vt(t))}(t,e,Lt)}(r,t):xt(e,n,void 0,i|o)}}(r[0],r[1]):(s=function(t){for(var e=ee(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,Ft(i)]}return e}(n=r),1==s.length&&s[0][2]?jt(s[0][0],s[0][1]):function(t){return t===n||function(t,e,r,n){var s=r.length,a=s;if(null==t)return!a;for(t=Object(t);s--;){var c=r[s];if(c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++s<a;){var u=(c=r[s])[0],f=t[u],h=c[1];if(c[2]){if(void 0===f&&!(u in t))return!1}else{var l,d=new At;if(!(void 0===l?xt(h,f,n,i|o,d):l))return!1}}return!0}(t,0,s)}):Ut(a=r)?(c=Ht(a),function(t){return null==t?void 0:t[c]}):function(t){return function(e){return Ot(e,t)}}(a),function(t,e){t&&function(t,e,r){for(var n=-1,i=Object(t),o=r(t),s=o.length;s--;){var a=o[++n];if(!1===e(i[a],a,i))break}}(t,e,ee)}(t,(function(t,r,n){u[r]=e(t,r,n)})),u}},107:(t,e,r)=>{t=r.nmd(t);var n="__lodash_hash_undefined__",i=1,o=2,s=1/0,a=9007199254740991,c="[object Arguments]",u="[object Array]",f="[object Boolean]",h="[object Date]",l="[object Error]",d="[object Function]",p="[object GeneratorFunction]",g="[object Map]",y="[object Number]",m="[object Object]",w="[object Promise]",b="[object RegExp]",v="[object Set]",_="[object String]",E="[object Symbol]",S="[object WeakMap]",T="[object ArrayBuffer]",B="[object DataView]",R=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,A=/^\w*$/,C=/^\./,O=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,L=/\\(\\)?/g,x=/^\[object .+?Constructor\]$/,I=/^(?:0|[1-9]\d*)$/,k={};k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k[c]=k[u]=k[T]=k[f]=k[B]=k[h]=k[l]=k[d]=k[g]=k[y]=k[m]=k[b]=k[v]=k[_]=k[S]=!1;var N="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,M="object"==typeof self&&self&&self.Object===Object&&self,P=N||M||Function("return this")(),D=e&&!e.nodeType&&e,U=D&&t&&!t.nodeType&&t,F=U&&U.exports===D&&N.process,j=function(){try{return F&&F.binding("util")}catch(t){}}(),$=j&&j.isTypedArray;function H(t,e,r,n){for(var i=-1,o=t?t.length:0;++i<o;){var s=t[i];e(n,s,r(s),t)}return n}function q(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function z(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function Z(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function V(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var W,G,K,Y=Array.prototype,J=Function.prototype,X=Object.prototype,Q=P["__core-js_shared__"],tt=(W=/[^.]+$/.exec(Q&&Q.keys&&Q.keys.IE_PROTO||""))?"Symbol(src)_1."+W:"",et=J.toString,rt=X.hasOwnProperty,nt=X.toString,it=RegExp("^"+et.call(rt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ot=P.Symbol,st=P.Uint8Array,at=X.propertyIsEnumerable,ct=Y.splice,ut=(G=Object.keys,K=Object,function(t){return G(K(t))}),ft=jt(P,"DataView"),ht=jt(P,"Map"),lt=jt(P,"Promise"),dt=jt(P,"Set"),pt=jt(P,"WeakMap"),gt=jt(Object,"create"),yt=Gt(ft),mt=Gt(ht),wt=Gt(lt),bt=Gt(dt),vt=Gt(pt),_t=ot?ot.prototype:void 0,Et=_t?_t.valueOf:void 0,St=_t?_t.toString:void 0;function Tt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Bt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Rt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function At(t){var e=-1,r=t?t.length:0;for(this.__data__=new Rt;++e<r;)this.add(t[e])}function Ct(t){this.__data__=new Bt(t)}function Ot(t,e){for(var r=t.length;r--;)if(Qt(t[r][0],e))return r;return-1}function Lt(t,e,r,n){return It(t,(function(t,i,o){e(n,t,r(t),o)})),n}Tt.prototype.clear=function(){this.__data__=gt?gt(null):{}},Tt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Tt.prototype.get=function(t){var e=this.__data__;if(gt){var r=e[t];return r===n?void 0:r}return rt.call(e,t)?e[t]:void 0},Tt.prototype.has=function(t){var e=this.__data__;return gt?void 0!==e[t]:rt.call(e,t)},Tt.prototype.set=function(t,e){return this.__data__[t]=gt&&void 0===e?n:e,this},Bt.prototype.clear=function(){this.__data__=[]},Bt.prototype.delete=function(t){var e=this.__data__,r=Ot(e,t);return!(r<0||(r==e.length-1?e.pop():ct.call(e,r,1),0))},Bt.prototype.get=function(t){var e=this.__data__,r=Ot(e,t);return r<0?void 0:e[r][1]},Bt.prototype.has=function(t){return Ot(this.__data__,t)>-1},Bt.prototype.set=function(t,e){var r=this.__data__,n=Ot(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Rt.prototype.clear=function(){this.__data__={hash:new Tt,map:new(ht||Bt),string:new Tt}},Rt.prototype.delete=function(t){return Ft(this,t).delete(t)},Rt.prototype.get=function(t){return Ft(this,t).get(t)},Rt.prototype.has=function(t){return Ft(this,t).has(t)},Rt.prototype.set=function(t,e){return Ft(this,t).set(t,e),this},At.prototype.add=At.prototype.push=function(t){return this.__data__.set(t,n),this},At.prototype.has=function(t){return this.__data__.has(t)},Ct.prototype.clear=function(){this.__data__=new Bt},Ct.prototype.delete=function(t){return this.__data__.delete(t)},Ct.prototype.get=function(t){return this.__data__.get(t)},Ct.prototype.has=function(t){return this.__data__.has(t)},Ct.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Bt){var n=r.__data__;if(!ht||n.length<199)return n.push([t,e]),this;r=this.__data__=new Rt(n)}return r.set(t,e),this};var xt,It=(xt=function(t,e){return t&&kt(t,e,ue)},function(t,e){if(null==t)return t;if(!re(t))return xt(t,e);for(var r=t.length,n=-1,i=Object(t);++n<r&&!1!==e(i[n],n,i););return t}),kt=function(t,e,r){for(var n=-1,i=Object(t),o=r(t),s=o.length;s--;){var a=o[++n];if(!1===e(i[a],a,i))break}return t};function Nt(t,e){for(var r=0,n=(e=qt(e,t)?[e]:Dt(e)).length;null!=t&&r<n;)t=t[Wt(e[r++])];return r&&r==n?t:void 0}function Mt(t,e){return null!=t&&e in Object(t)}function Pt(t,e,r,n,s){return t===e||(null==t||null==e||!oe(t)&&!se(e)?t!=t&&e!=e:function(t,e,r,n,s,a){var d=ee(t),p=ee(e),w=u,S=u;d||(w=(w=$t(t))==c?m:w),p||(S=(S=$t(e))==c?m:S);var R=w==m&&!z(t),A=S==m&&!z(e),C=w==S;if(C&&!R)return a||(a=new Ct),d||ce(t)?Ut(t,e,r,n,s,a):function(t,e,r,n,s,a,c){switch(r){case B:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case T:return!(t.byteLength!=e.byteLength||!n(new st(t),new st(e)));case f:case h:case y:return Qt(+t,+e);case l:return t.name==e.name&&t.message==e.message;case b:case _:return t==e+"";case g:var u=Z;case v:var d=a&o;if(u||(u=V),t.size!=e.size&&!d)return!1;var p=c.get(t);if(p)return p==e;a|=i,c.set(t,e);var m=Ut(u(t),u(e),n,s,a,c);return c.delete(t),m;case E:if(Et)return Et.call(t)==Et.call(e)}return!1}(t,e,w,r,n,s,a);if(!(s&o)){var O=R&&rt.call(t,"__wrapped__"),L=A&&rt.call(e,"__wrapped__");if(O||L){var x=O?t.value():t,I=L?e.value():e;return a||(a=new Ct),r(x,I,n,s,a)}}return!!C&&(a||(a=new Ct),function(t,e,r,n,i,s){var a=i&o,c=ue(t),u=c.length;if(u!=ue(e).length&&!a)return!1;for(var f=u;f--;){var h=c[f];if(!(a?h in e:rt.call(e,h)))return!1}var l=s.get(t);if(l&&s.get(e))return l==e;var d=!0;s.set(t,e),s.set(e,t);for(var p=a;++f<u;){var g=t[h=c[f]],y=e[h];if(n)var m=a?n(y,g,h,e,t,s):n(g,y,h,t,e,s);if(!(void 0===m?g===y||r(g,y,n,i,s):m)){d=!1;break}p||(p="constructor"==h)}if(d&&!p){var w=t.constructor,b=e.constructor;w==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof w&&w instanceof w&&"function"==typeof b&&b instanceof b||(d=!1)}return s.delete(t),s.delete(e),d}(t,e,r,n,s,a))}(t,e,Pt,r,n,s))}function Dt(t){return ee(t)?t:Vt(t)}function Ut(t,e,r,n,s,a){var c=s&o,u=t.length,f=e.length;if(u!=f&&!(c&&f>u))return!1;var h=a.get(t);if(h&&a.get(e))return h==e;var l=-1,d=!0,p=s&i?new At:void 0;for(a.set(t,e),a.set(e,t);++l<u;){var g=t[l],y=e[l];if(n)var m=c?n(y,g,l,e,t,a):n(g,y,l,t,e,a);if(void 0!==m){if(m)continue;d=!1;break}if(p){if(!q(e,(function(t,e){if(!p.has(e)&&(g===t||r(g,t,n,s,a)))return p.add(e)}))){d=!1;break}}else if(g!==y&&!r(g,y,n,s,a)){d=!1;break}}return a.delete(t),a.delete(e),d}function Ft(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function jt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!oe(t)||function(t){return!!tt&&tt in t}(t))&&(ne(t)||z(t)?it:x).test(Gt(t))}(r)?r:void 0}var $t=function(t){return nt.call(t)};function Ht(t,e){return!!(e=null==e?a:e)&&("number"==typeof t||I.test(t))&&t>-1&&t%1==0&&t<e}function qt(t,e){if(ee(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!ae(t))||A.test(t)||!R.test(t)||null!=e&&t in Object(e)}function zt(t){return t==t&&!oe(t)}function Zt(t,e){return function(r){return null!=r&&r[t]===e&&(void 0!==e||t in Object(r))}}(ft&&$t(new ft(new ArrayBuffer(1)))!=B||ht&&$t(new ht)!=g||lt&&$t(lt.resolve())!=w||dt&&$t(new dt)!=v||pt&&$t(new pt)!=S)&&($t=function(t){var e=nt.call(t),r=e==m?t.constructor:void 0,n=r?Gt(r):void 0;if(n)switch(n){case yt:return B;case mt:return g;case wt:return w;case bt:return v;case vt:return S}return e});var Vt=Xt((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(ae(t))return St?St.call(t):"";var e=t+"";return"0"==e&&1/t==-s?"-0":e}(e);var r=[];return C.test(t)&&r.push(""),t.replace(O,(function(t,e,n,i){r.push(n?i.replace(L,"$1"):e||t)})),r}));function Wt(t){if("string"==typeof t||ae(t))return t;var e=t+"";return"0"==e&&1/t==-s?"-0":e}function Gt(t){if(null!=t){try{return et.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var Kt,Yt,Jt=(Kt=function(t,e,r){t[r?0:1].push(e)},Yt=function(){return[[],[]]},function(t,e){var r,n,s,a,c,u=ee(t)?H:Lt,f=Yt?[[],[]]:{};return u(t,Kt,"function"==typeof(r=e)?r:null==r?fe:"object"==typeof r?ee(r)?function(t,e){return qt(t)&&zt(e)?Zt(Wt(t),e):function(r){var n=function(t,e,r){var n=null==t?void 0:Nt(t,e);return void 0===n?void 0:n}(r,t);return void 0===n&&n===e?function(t,e){return null!=t&&function(t,e,r){for(var n,i=-1,o=(e=qt(e,t)?[e]:Dt(e)).length;++i<o;){var s=Wt(e[i]);if(!(n=null!=t&&r(t,s)))break;t=t[s]}return n||!!(o=t?t.length:0)&&ie(o)&&Ht(s,o)&&(ee(t)||te(t))}(t,e,Mt)}(r,t):Pt(e,n,void 0,i|o)}}(r[0],r[1]):1==(s=function(t){for(var e=ue(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,zt(i)]}return e}(n=r)).length&&s[0][2]?Zt(s[0][0],s[0][1]):function(t){return t===n||function(t,e,r,n){var s=r.length,a=s;if(null==t)return!a;for(t=Object(t);s--;){var c=r[s];if(c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++s<a;){var u=(c=r[s])[0],f=t[u],h=c[1];if(c[2]){if(void 0===f&&!(u in t))return!1}else{var l,d=new Ct;if(!(void 0===l?Pt(h,f,n,i|o,d):l))return!1}}return!0}(t,0,s)}:qt(a=r)?(c=Wt(a),function(t){return null==t?void 0:t[c]}):function(t){return function(e){return Nt(e,t)}}(a),f)});function Xt(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(Xt.Cache||Rt),r}function Qt(t,e){return t===e||t!=t&&e!=e}function te(t){return function(t){return se(t)&&re(t)}(t)&&rt.call(t,"callee")&&(!at.call(t,"callee")||nt.call(t)==c)}Xt.Cache=Rt;var ee=Array.isArray;function re(t){return null!=t&&ie(t.length)&&!ne(t)}function ne(t){var e=oe(t)?nt.call(t):"";return e==d||e==p}function ie(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function oe(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function se(t){return!!t&&"object"==typeof t}function ae(t){return"symbol"==typeof t||se(t)&&nt.call(t)==E}var ce=$?function(t){return function(e){return t(e)}}($):function(t){return se(t)&&ie(t.length)&&!!k[nt.call(t)]};function ue(t){return re(t)?function(t,e){var r=ee(t)||te(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,i=!!n;for(var o in t)!e&&!rt.call(t,o)||i&&("length"==o||Ht(o,n))||r.push(o);return r}(t):function(t){if(r=(e=t)&&e.constructor,e!==("function"==typeof r&&r.prototype||X))return ut(t);var e,r,n=[];for(var i in Object(t))rt.call(t,i)&&"constructor"!=i&&n.push(i);return n}(t)}function fe(t){return t}t.exports=Jt},3545:t=>{var e=1/0,r=4294967295,n=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt,c=Object.prototype.toString,u=Math.min;function f(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function h(t){return t}t.exports=function(t,l){if((t=function(t){var r=function(t){return t?(t=function(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==c.call(t)}(t))return NaN;if(f(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=f(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(n,"");var r=o.test(t);return r||s.test(t)?a(t.slice(2),r?2:8):i.test(t)?NaN:+t}(t))===e||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}(t),u=r%1;return r==r?u?r-u:r:0}(t))<1||t>9007199254740991)return[];var d=r,p=u(t,r);t-=r;for(var g=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(p,l="function"==typeof l?l:h);++d<t;)l(d);return g}},9500:(t,e,r)=>{var n=r(87),i=r(6883),o=r(7172).Buffer,s=new Array(16);function a(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(t,e){return t<<e|t>>>32-e}function u(t,e,r,n,i,o,s){return c(t+(e&r|~e&n)+i+o|0,s)+e|0}function f(t,e,r,n,i,o,s){return c(t+(e&n|r&~n)+i+o|0,s)+e|0}function h(t,e,r,n,i,o,s){return c(t+(e^r^n)+i+o|0,s)+e|0}function l(t,e,r,n,i,o,s){return c(t+(r^(e|~n))+i+o|0,s)+e|0}n(a,i),a.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,o=this._d;r=u(r,n,i,o,t[0],3614090360,7),o=u(o,r,n,i,t[1],3905402710,12),i=u(i,o,r,n,t[2],606105819,17),n=u(n,i,o,r,t[3],3250441966,22),r=u(r,n,i,o,t[4],4118548399,7),o=u(o,r,n,i,t[5],1200080426,12),i=u(i,o,r,n,t[6],2821735955,17),n=u(n,i,o,r,t[7],4249261313,22),r=u(r,n,i,o,t[8],1770035416,7),o=u(o,r,n,i,t[9],2336552879,12),i=u(i,o,r,n,t[10],4294925233,17),n=u(n,i,o,r,t[11],2304563134,22),r=u(r,n,i,o,t[12],1804603682,7),o=u(o,r,n,i,t[13],4254626195,12),i=u(i,o,r,n,t[14],2792965006,17),r=f(r,n=u(n,i,o,r,t[15],1236535329,22),i,o,t[1],4129170786,5),o=f(o,r,n,i,t[6],3225465664,9),i=f(i,o,r,n,t[11],643717713,14),n=f(n,i,o,r,t[0],3921069994,20),r=f(r,n,i,o,t[5],3593408605,5),o=f(o,r,n,i,t[10],38016083,9),i=f(i,o,r,n,t[15],3634488961,14),n=f(n,i,o,r,t[4],3889429448,20),r=f(r,n,i,o,t[9],568446438,5),o=f(o,r,n,i,t[14],3275163606,9),i=f(i,o,r,n,t[3],4107603335,14),n=f(n,i,o,r,t[8],1163531501,20),r=f(r,n,i,o,t[13],2850285829,5),o=f(o,r,n,i,t[2],4243563512,9),i=f(i,o,r,n,t[7],1735328473,14),r=h(r,n=f(n,i,o,r,t[12],2368359562,20),i,o,t[5],4294588738,4),o=h(o,r,n,i,t[8],2272392833,11),i=h(i,o,r,n,t[11],1839030562,16),n=h(n,i,o,r,t[14],4259657740,23),r=h(r,n,i,o,t[1],2763975236,4),o=h(o,r,n,i,t[4],1272893353,11),i=h(i,o,r,n,t[7],4139469664,16),n=h(n,i,o,r,t[10],3200236656,23),r=h(r,n,i,o,t[13],681279174,4),o=h(o,r,n,i,t[0],3936430074,11),i=h(i,o,r,n,t[3],3572445317,16),n=h(n,i,o,r,t[6],76029189,23),r=h(r,n,i,o,t[9],3654602809,4),o=h(o,r,n,i,t[12],3873151461,11),i=h(i,o,r,n,t[15],530742520,16),r=l(r,n=h(n,i,o,r,t[2],3299628645,23),i,o,t[0],4096336452,6),o=l(o,r,n,i,t[7],1126891415,10),i=l(i,o,r,n,t[14],2878612391,15),n=l(n,i,o,r,t[5],4237533241,21),r=l(r,n,i,o,t[12],1700485571,6),o=l(o,r,n,i,t[3],2399980690,10),i=l(i,o,r,n,t[10],4293915773,15),n=l(n,i,o,r,t[1],2240044497,21),r=l(r,n,i,o,t[8],1873313359,6),o=l(o,r,n,i,t[15],4264355552,10),i=l(i,o,r,n,t[6],2734768916,15),n=l(n,i,o,r,t[13],1309151649,21),r=l(r,n,i,o,t[4],4149444226,6),o=l(o,r,n,i,t[11],3174756917,10),i=l(i,o,r,n,t[2],718787259,15),n=l(n,i,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=a},7859:t=>{function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},6938:t=>{var e={};function r(t,r,n){n||(n=Error);var i=function(t){var e,n;function i(e,n,i){return t.call(this,function(t,e,n){return"string"==typeof r?r:r(t,e,n)}(e,n,i))||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function n(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,o,s,a,c;if("string"==typeof e&&(o="not ",e.substr(0,4)===o)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-9,r)===e}(t," argument"))s="The ".concat(t," ").concat(i," ").concat(n(e,"type"));else{var u=("number"!=typeof c&&(c=0),c+1>(a=t).length||-1===a.indexOf(".",c)?"argument":"property");s='The "'.concat(t,'" ').concat(u," ").concat(i," ").concat(n(e,"type"))}return s+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},4439:(t,e,r)=>{var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=u;var i=r(5327),o=r(4567);r(87)(u,i);for(var s=n(o.prototype),a=0;a<s.length;a++){var c=s[a];u.prototype[c]||(u.prototype[c]=o.prototype[c])}function u(t){if(!(this instanceof u))return new u(t);i.call(this,t),o.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||process.nextTick(h,this)}function h(t){t.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})},3754:(t,e,r)=>{t.exports=i;var n=r(2175);function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r(87)(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},5327:(t,e,r)=>{var n;t.exports=T,T.ReadableState=S,r(343).EventEmitter;var i,o=function(t,e){return t.listeners(e).length},s=r(6052),a=r(816).Buffer,c=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},u=r(1632);i=u&&u.debuglog?u.debuglog("stream"):function(){};var f,h,l,d=r(7712),p=r(7640),g=r(5985).getHighWaterMark,y=r(6938).q,m=y.ERR_INVALID_ARG_TYPE,w=y.ERR_STREAM_PUSH_AFTER_EOF,b=y.ERR_METHOD_NOT_IMPLEMENTED,v=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(87)(T,s);var _=p.errorOrDestroy,E=["error","close","destroy","pause","resume"];function S(t,e,i){n=n||r(4439),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(f||(f=r(4361).s),this.decoder=new f(t.encoding),this.encoding=t.encoding)}function T(t){if(n=n||r(4439),!(this instanceof T))return new T(t);var e=this instanceof n;this._readableState=new S(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function B(t,e,r,n,o){i("readableAddChunk",e);var s,u=t._readableState;if(null===e)u.reading=!1,function(t,e){if(i("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?O(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,L(t)))}}(t,u);else if(o||(s=function(t,e){var r,n;return n=e,a.isBuffer(n)||n instanceof c||"string"==typeof e||void 0===e||t.objectMode||(r=new m("chunk",["string","Buffer","Uint8Array"],e)),r}(u,e)),s)_(t,s);else if(u.objectMode||e&&e.length>0)if("string"==typeof e||u.objectMode||Object.getPrototypeOf(e)===a.prototype||(e=function(t){return a.from(t)}(e)),n)u.endEmitted?_(t,new v):R(t,u,e,!0);else if(u.ended)_(t,new w);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(e=u.decoder.write(e),u.objectMode||0!==e.length?R(t,u,e,!1):x(t,u)):R(t,u,e,!1)}else n||(u.reading=!1,x(t,u));return!u.ended&&(u.length<u.highWaterMark||0===u.length)}function R(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&O(t)),x(t,e)}Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),T.prototype.destroy=p.destroy,T.prototype._undestroy=p.undestroy,T.prototype._destroy=function(t,e){e(t)},T.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=a.from(t,e),e=""),r=!0),B(this,t,e,!1,r)},T.prototype.unshift=function(t){return B(this,t,null,!0,!1)},T.prototype.isPaused=function(){return!1===this._readableState.flowing},T.prototype.setEncoding=function(t){f||(f=r(4361).s);var e=new f(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=e.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var A=1073741824;function C(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=A?t=A:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function O(t){var e=t._readableState;i("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(i("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(L,t))}function L(t){var e=t._readableState;i("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,P(t)}function x(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(I,t,e))}function I(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(i("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function k(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function N(t){i("readable nexttick read 0"),t.read(0)}function M(t,e){i("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),P(t),e.flowing&&!e.reading&&t.read(0)}function P(t){var e=t._readableState;for(i("flow",e.flowing);e.flowing&&null!==t.read(););}function D(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function U(t){var e=t._readableState;i("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(F,e,t))}function F(t,e){if(i("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function j(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}T.prototype.read=function(t){i("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return i("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?U(this):O(this),null;if(0===(t=C(t,e))&&e.ended)return 0===e.length&&U(this),null;var n,o=e.needReadable;return i("need readable",o),(0===e.length||e.length-t<e.highWaterMark)&&i("length less than watermark",o=!0),e.ended||e.reading?i("reading or ended",o=!1):o&&(i("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=C(r,e))),null===(n=t>0?D(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&U(this)),null!==n&&this.emit("data",n),n},T.prototype._read=function(t){_(this,new b("_read()"))},T.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,i("pipe count=%d opts=%j",n.pipesCount,e);var s=e&&!1===e.end||t===process.stdout||t===process.stderr?p:a;function a(){i("onend"),t.end()}n.endEmitted?process.nextTick(s):r.once("end",s),t.on("unpipe",(function e(o,s){i("onunpipe"),o===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,i("cleanup"),t.removeListener("close",l),t.removeListener("finish",d),t.removeListener("drain",c),t.removeListener("error",h),t.removeListener("unpipe",e),r.removeListener("end",a),r.removeListener("end",p),r.removeListener("data",f),u=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}));var c=function(t){return function(){var e=t._readableState;i("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,P(t))}}(r);t.on("drain",c);var u=!1;function f(e){i("ondata");var o=t.write(e);i("dest.write",o),!1===o&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==j(n.pipes,t))&&!u&&(i("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(e){i("onerror",e),p(),t.removeListener("error",h),0===o(t,"error")&&_(t,e)}function l(){t.removeListener("finish",d),p()}function d(){i("onfinish"),t.removeListener("close",l),p()}function p(){i("unpipe"),r.unpipe(t)}return r.on("data",f),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",h),t.once("close",l),t.once("finish",d),t.emit("pipe",r),n.flowing||(i("pipe resume"),r.resume()),t},T.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=j(e.pipes,t);return-1===s||(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},T.prototype.on=function(t,e){var r=s.prototype.on.call(this,t,e),n=this._readableState;return"data"===t?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,i("on readable",n.length,n.reading),n.length?O(this):n.reading||process.nextTick(N,this))),r},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(t,e){var r=s.prototype.removeListener.call(this,t,e);return"readable"===t&&process.nextTick(k,this),r},T.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||process.nextTick(k,this),e},T.prototype.resume=function(){var t=this._readableState;return t.flowing||(i("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(M,t,e))}(this,t)),t.paused=!1,this},T.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},T.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var o in t.on("end",(function(){if(i("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(o){i("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o||(r.objectMode||o&&o.length)&&(e.push(o)||(n=!0,t.pause()))})),t)void 0===this[o]&&"function"==typeof t[o]&&(this[o]=function(e){return function(){return t[e].apply(t,arguments)}}(o));for(var s=0;s<E.length;s++)t.on(E[s],this.emit.bind(this,E[s]));return this._read=function(e){i("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"==typeof Symbol&&(T.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=r(4157)),h(this)}),Object.defineProperty(T.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(T.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(T.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),T._fromList=D,Object.defineProperty(T.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(T.from=function(t,e){return void 0===l&&(l=r(5800)),l(T,t,e)})},2175:(t,e,r)=>{t.exports=f;var n=r(6938).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,c=r(4439);function u(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function f(t){if(!(this instanceof f))return new f(t);c.call(this,t),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",h)}function h(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?l(this,null,null):this._flush((function(e,r){l(t,e,r)}))}function l(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new a;if(t._transformState.transforming)throw new s;return t.push(null)}r(87)(f,c),f.prototype.push=function(t,e){return this._transformState.needTransform=!1,c.prototype.push.call(this,t,e)},f.prototype._transform=function(t,e,r){r(new i("_transform()"))},f.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},f.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},f.prototype._destroy=function(t,e){c.prototype._destroy.call(this,t,(function(t){e(t)}))}},4567:(t,e,r)=>{function n(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(undefined),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var i;t.exports=T,T.WritableState=S;var o,s={deprecate:r(7451)},a=r(6052),c=r(816).Buffer,u=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},f=r(7640),h=r(5985).getHighWaterMark,l=r(6938).q,d=l.ERR_INVALID_ARG_TYPE,p=l.ERR_METHOD_NOT_IMPLEMENTED,g=l.ERR_MULTIPLE_CALLBACK,y=l.ERR_STREAM_CANNOT_PIPE,m=l.ERR_STREAM_DESTROYED,w=l.ERR_STREAM_NULL_VALUES,b=l.ERR_STREAM_WRITE_AFTER_END,v=l.ERR_UNKNOWN_ENCODING,_=f.errorOrDestroy;function E(){}function S(t,e,o){i=i||r(4439),t=t||{},"boolean"!=typeof o&&(o=e instanceof i),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(L,t,e),t._writableState.errorEmitted=!0,_(t,n)):(i(n),t._writableState.errorEmitted=!0,_(t,n),L(t,e))}(t,r,n,e,i);else{var o=C(r)||t.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||A(t,r),n?process.nextTick(R,t,r,o,i):R(t,r,o,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}function T(t){var e=this instanceof(i=i||r(4439));if(!e&&!o.call(T,this))return new T(t);this._writableState=new S(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),a.call(this)}function B(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new m("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function R(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),L(t,e)}function A(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,o=new Array(i),s=e.corkedRequestsFree;s.entry=r;for(var a=0,c=!0;r;)o[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;o.allBuffers=c,B(t,e,!0,e.length,o,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new n(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,f=r.encoding,h=r.callback;if(B(t,e,!1,e.objectMode?1:u.length,u,f,h),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function C(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function O(t,e){t._final((function(r){e.pendingcb--,r&&_(t,r),e.prefinished=!0,t.emit("prefinish"),L(t,e)}))}function L(t,e){var r=C(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,process.nextTick(O,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}r(87)(T,a),S.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(S.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(t){return!!o.call(this,t)||this===T&&t&&t._writableState instanceof S}})):o=function(t){return t instanceof this},T.prototype.pipe=function(){_(this,new y)},T.prototype.write=function(t,e,r){var n,i=this._writableState,o=!1,s=!i.objectMode&&(n=t,c.isBuffer(n)||n instanceof u);return s&&!c.isBuffer(t)&&(t=function(t){return c.from(t)}(t)),"function"==typeof e&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=E),i.ending?function(t,e){var r=new b;_(t,r),process.nextTick(e,r)}(this,r):(s||function(t,e,r,n){var i;return null===r?i=new w:"string"==typeof r||e.objectMode||(i=new d("chunk",["string","Buffer"],r)),!i||(_(t,i),process.nextTick(n,i),!1)}(this,i,t,r))&&(i.pendingcb++,o=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=c.from(e,r)),e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var f=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},f?f.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else B(t,e,!1,a,n,i,o);return u}(this,i,s,t,e,r)),o},T.prototype.cork=function(){this._writableState.corked++},T.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||A(this,t))},T.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new v(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(t,e,r){r(new p("_write()"))},T.prototype._writev=null,T.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,L(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),T.prototype.destroy=f.destroy,T.prototype._undestroy=f.undestroy,T.prototype._destroy=function(t,e){e(t)}},4157:(t,e,r)=>{var n;function i(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o=r(5027),s=Symbol("lastResolve"),a=Symbol("lastReject"),c=Symbol("error"),u=Symbol("ended"),f=Symbol("lastPromise"),h=Symbol("handlePromise"),l=Symbol("stream");function d(t,e){return{value:t,done:e}}function p(t){var e=t[s];if(null!==e){var r=t[l].read();null!==r&&(t[f]=null,t[s]=null,t[a]=null,e(d(r,!1)))}}function g(t){process.nextTick(p,t)}var y=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((i(n={get stream(){return this[l]},next:function(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[u])return Promise.resolve(d(void 0,!0));if(this[l].destroyed)return new Promise((function(e,r){process.nextTick((function(){t[c]?r(t[c]):e(d(void 0,!0))}))}));var r,n=this[f];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[u]?r(d(void 0,!0)):e[h](r,n)}),n)}}(n,this));else{var i=this[l].read();if(null!==i)return Promise.resolve(d(i,!1));r=new Promise(this[h])}return this[f]=r,r}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var t=this;return new Promise((function(e,r){t[l].destroy(null,(function(t){t?r(t):e(d(void 0,!0))}))}))})),n),y);t.exports=function(t){var e,r=Object.create(m,(i(e={},l,{value:t,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,a,{value:null,writable:!0}),i(e,c,{value:null,writable:!0}),i(e,u,{value:t._readableState.endEmitted,writable:!0}),i(e,h,{value:function(t,e){var n=r[l].read();n?(r[f]=null,r[s]=null,r[a]=null,t(d(n,!1))):(r[s]=t,r[a]=e)},writable:!0}),e));return r[f]=null,o(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[a];return null!==e&&(r[f]=null,r[s]=null,r[a]=null,e(t)),void(r[c]=t)}var n=r[s];null!==n&&(r[f]=null,r[s]=null,r[a]=null,n(d(void 0,!0))),r[u]=!0})),t.on("readable",g.bind(null,r)),r}},7712:(t,e,r)=>{function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){o(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function o(t,e,r){return(e=a(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function a(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}var c=r(816).Buffer,u=r(471).inspect,f=u&&u.custom||"inspect";t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,r;return e=t,(r=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return c.alloc(0);for(var e,r,n,i=c.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=o.data,r=i,n=s,c.prototype.copy.call(e,r,n),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,o=t>i.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=c.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:f,value:function(t,e){return u(this,i(i({},e),{},{depth:0,customInspect:!1}))}}])&&s(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}()},7640:t=>{function e(t,e){n(t,e),r(t)}function r(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function n(t,e){t.emit("error",e)}t.exports={destroy:function(t,i){var o=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(i?i(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(n,this,t)):process.nextTick(n,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!i&&t?o._writableState?o._writableState.errorEmitted?process.nextTick(r,o):(o._writableState.errorEmitted=!0,process.nextTick(e,o,t)):process.nextTick(e,o,t):i?(process.nextTick(r,o),i(t)):process.nextTick(r,o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}},5027:(t,e,r)=>{var n=r(6938).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&e.readable,a=r.writable||!1!==r.writable&&e.writable,c=function(){e.writable||f()},u=e._writableState&&e._writableState.finished,f=function(){a=!1,u=!0,s||o.call(e)},h=e._readableState&&e._readableState.endEmitted,l=function(){s=!1,h=!0,a||o.call(e)},d=function(t){o.call(e,t)},p=function(){var t;return s&&!h?(e._readableState&&e._readableState.ended||(t=new n),o.call(e,t)):a&&!u?(e._writableState&&e._writableState.ended||(t=new n),o.call(e,t)):void 0},g=function(){e.req.on("finish",f)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",f),e.on("abort",p),e.req?g():e.on("request",g)):a&&!e._writableState&&(e.on("end",c),e.on("close",c)),e.on("end",l),e.on("finish",f),!1!==r.error&&e.on("error",d),e.on("close",p),function(){e.removeListener("complete",f),e.removeListener("abort",p),e.removeListener("request",g),e.req&&e.req.removeListener("finish",f),e.removeListener("end",c),e.removeListener("close",c),e.removeListener("finish",f),e.removeListener("end",l),e.removeListener("error",d),e.removeListener("close",p)}}},5800:t=>{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},410:(t,e,r)=>{var n,i=r(6938).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function c(t){t()}function u(t,e){return t.pipe(e)}t.exports=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];var f,h=function(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new o("streams");var l=e.map((function(t,i){var o=i<e.length-1;return function(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var a=!1;t.on("close",(function(){a=!0})),void 0===n&&(n=r(5027)),n(t,{readable:e,writable:i},(function(t){if(t)return o(t);a=!0,o()}));var c=!1;return function(e){if(!a&&!c)return c=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}(t,o,i>0,(function(t){f||(f=t),t&&l.forEach(c),o||(l.forEach(c),h(f))}))}));return e.reduce(u)}},5985:(t,e,r)=>{var n=r(6938).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},6052:(t,e,r)=>{t.exports=r(343).EventEmitter},8310:(t,e,r)=>{(e=t.exports=r(5327)).Stream=e,e.Readable=e,e.Writable=r(4567),e.Duplex=r(4439),e.Transform=r(2175),e.PassThrough=r(3754),e.finished=r(5027),e.pipeline=r(410)},7172:(t,e,r)=>{var n=r(816),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},3573:(t,e,r)=>{e.C4=void 0;var n,i=r(816),o=(n=r(350))&&n.__esModule?n:{default:n},s=function(t){var e=t.allowedSizes,r=t.defaultSize,n=t.padding;return function t(){var s=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;if(!this||this.constructor!==t)return new t(a);if(e&&!e.includes(a))throw new Error("Unsupported hash length");var c=new o.default({capacity:a});return this.update=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";if(i.Buffer.isBuffer(t))return c.absorb(t),s;if("string"==typeof t)return s.update(i.Buffer.from(t,e));throw new TypeError("Not a string or buffer")},this.digest=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"binary",e="string"==typeof t?{format:t}:t,r=c.squeeze({buffer:e.buffer,padding:e.padding||n});return e.format&&"binary"!==e.format?r.toString(e.format):r},this.reset=function(){return c.reset(),s},this}},a=s({allowedSizes:[224,256,384,512],defaultSize:512,padding:1});e.C4=a;var c=s({allowedSizes:[224,256,384,512],defaultSize:512,padding:6});s({allowedSizes:[128,256],defaultSize:256,padding:31});var u=a;c.SHA3Hash=u},350:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=r(816),o=(n=r(5037))&&n.__esModule?n:{default:n},s=function(t,e){for(var r=0;r<t.length;r+=8){var n=r/4;e[n]^=t[r+7]<<24|t[r+6]<<16|t[r+5]<<8|t[r+4],e[n+1]^=t[r+3]<<24|t[r+2]<<16|t[r+1]<<8|t[r]}return e},a=function(t,e){for(var r=0;r<e.length;r+=8){var n=r/4;e[r]=t[n+1],e[r+1]=t[n+1]>>>8,e[r+2]=t[n+1]>>>16,e[r+3]=t[n+1]>>>24,e[r+4]=t[n],e[r+5]=t[n]>>>8,e[r+6]=t[n]>>>16,e[r+7]=t[n]>>>24}return e};e.default=function(t){var e=this,r=t.capacity,n=t.padding,c=(0,o.default)(),u=r/8,f=200-r/4,h=0,l=new Uint32Array(50),d=i.Buffer.allocUnsafe(f);return this.absorb=function(t){for(var r=0;r<t.length;r++)d[h]=t[r],(h+=1)>=f&&(s(d,l),c(l),h=0);return e},this.squeeze=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={buffer:t.buffer||i.Buffer.allocUnsafe(u),padding:t.padding||n,queue:i.Buffer.allocUnsafe(d.length),state:new Uint32Array(l.length)};d.copy(e.queue);for(var r=0;r<l.length;r++)e.state[r]=l[r];e.queue.fill(0,h),e.queue[h]|=e.padding,e.queue[f-1]|=128,s(e.queue,e.state);for(var o=0;o<e.buffer.length;o+=f)c(e.state),a(e.state,e.buffer.slice(o,o+f));return e.buffer},this.reset=function(){return d.fill(0),l.fill(0),h=0,e},this}},9940:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(2196))&&n.__esModule?n:{default:n};e.default=function(t){for(var e=t.A,r=t.C,n=0;n<25;n+=5){for(var o=0;o<5;o++)(0,i.default)(e,n+o)(r,o);for(var s=0;s<5;s++){var a=2*(n+s),c=(s+1)%5*2,u=(s+2)%5*2;e[a]^=~r[c]&r[u],e[a+1]^=~r[c+1]&r[u+1]}}}},2196:t=>{t.exports=function(t,e){return function(r,n){var i=2*n,o=2*e;r[i]=t[o],r[i+1]=t[o+1]}}},5037:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(r(9940)),i=a(r(1909)),o=a(r(6021)),s=a(r(4421));function a(t){return t&&t.__esModule?t:{default:t}}e.default=function(){var t=new Uint32Array(10),e=new Uint32Array(10),r=new Uint32Array(2);return function(a){for(var c=0;c<24;c++)(0,s.default)({A:a,C:t,D:e,W:r}),(0,o.default)({A:a,C:t,W:r}),(0,n.default)({A:a,C:t}),(0,i.default)({A:a,roundIndex:c});t.fill(0),e.fill(0),r.fill(0)}}},1909:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(3408))&&n.__esModule?n:{default:n};e.default=function(t){var e=t.A,r=2*t.roundIndex;e[0]^=i.default[r],e[1]^=i.default[r+1]}},3408:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=new Uint32Array([0,1,0,32898,2147483648,32906,2147483648,2147516416,0,32907,0,2147483649,2147483648,2147516545,2147483648,32777,0,138,0,136,0,2147516425,0,2147483658,0,2147516555,2147483648,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,0,32778,2147483648,2147483658,2147483648,2147516545,2147483648,32896,0,2147483649,2147483648,2147516424]);e.default=r},6021:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=s(r(2773)),i=s(r(4728)),o=s(r(2196));function s(t){return t&&t.__esModule?t:{default:t}}e.default=function(t){var e=t.A,r=t.C,s=t.W;(0,o.default)(e,1)(s,0);for(var a=0,c=0,u=0,f=32,h=0;h<24;h++){var l=n.default[h],d=i.default[h];(0,o.default)(e,l)(r,0),a=s[0],c=s[1],f=32-d,s[u=d<32?0:1]=a<<d|c>>>f,s[(u+1)%2]=c<<d|a>>>f,(0,o.default)(s,0)(e,l),(0,o.default)(r,0)(s,0)}}},2773:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=[10,7,11,17,18,3,5,16,8,21,24,4,15,23,19,13,12,2,20,14,22,9,6,1]},4728:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=[1,3,6,10,15,21,28,36,45,55,2,14,27,41,56,8,25,43,62,18,39,61,20,44]},4421:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(2196))&&n.__esModule?n:{default:n};e.default=function(t){for(var e=t.A,r=t.C,n=t.D,o=t.W,s=0,a=0,c=0;c<5;c++){var u=2*c,f=2*(c+5),h=2*(c+10),l=2*(c+15),d=2*(c+20);r[u]=e[u]^e[f]^e[h]^e[l]^e[d],r[u+1]=e[u+1]^e[f+1]^e[h+1]^e[l+1]^e[d+1]}for(var p=0;p<5;p++){(0,i.default)(r,(p+1)%5)(o,0),s=o[0],a=o[1],o[0]=s<<1|a>>>31,o[1]=a<<1|s>>>31,n[2*p]=r[(p+4)%5*2]^o[0],n[2*p+1]=r[(p+4)%5*2+1]^o[1];for(var g=0;g<25;g+=5)e[2*(g+p)]^=n[2*p],e[2*(g+p)+1]^=n[2*p+1]}}},3424:(t,e,r)=>{t.exports=i;var n=r(343).EventEmitter;function i(){n.call(this)}r(87)(i,n),i.Readable=r(5327),i.Writable=r(4567),i.Duplex=r(4439),i.Transform=r(2175),i.PassThrough=r(3754),i.finished=r(5027),i.pipeline=r(410),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",c));var s=!1;function a(){s||(s=!0,t.end())}function c(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function u(t){if(f(),0===n.listenerCount(this,"error"))throw t}function f(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",c),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),t.removeListener("close",f)}return r.on("error",u),t.on("error",u),r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t}},4361:(t,e,r)=>{var n=r(7172).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=c,this.end=u,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=f,this.end=h,e=3;break;default:return this.write=l,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function c(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},o.prototype.text=function(t,e){var r=function(t,e,r){var n=e.length-1;if(n<r)return 0;var i=s(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||-2===i?0:(i=s(e[n]))>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||-2===i?0:(i=s(e[n]))>=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},3118:(t,e)=>{e.VB=function(){return!1}},7451:(t,e,r)=>{function n(t){try{if(!r.g.localStorage)return!1}catch(t){return!1}var e=r.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}},6534:()=>{},1856:()=>{},6014:()=>{},717:()=>{},6963:()=>{},9190:()=>{},3240:()=>{},6721:()=>{},394:()=>{},471:()=>{},1632:()=>{},8517:()=>{},4636:t=>{t.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={id:n,loaded:!1,exports:{}};return t[n](o,o.exports,r),o.loaded=!0,o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var n={};(()=>{r.d(n,{LJ:()=>bi,bG:()=>qn,xz:()=>ht,cC:()=>Hn,CH:()=>$n,xq:()=>jn,vp:()=>Pe,Ag:()=>Wn,W_:()=>Ln,g2:()=>Fn,v4:()=>Me,Y8:()=>Vn,jF:()=>dt,Fr:()=>_,$h:()=>vn,pP:()=>Mn,E9:()=>C,_q:()=>Oe,a5:()=>Un,x6:()=>yi,Xo:()=>wi,Tx:()=>On,qd:()=>Dn,f1:()=>Rn,EY:()=>kn,bH:()=>xn,qx:()=>Gn,ig:()=>Kn,_$:()=>ui,g$:()=>re,W$:()=>De,ir:()=>Jn,CF:()=>Yn,nW:()=>Xn,kw:()=>ai});var t,e,i,o={};r.r(o),r.d(o,{dQ:()=>br,ci:()=>fr,bytesToNumberBE:()=>dr,ty:()=>pr,eV:()=>wr,n$:()=>Er,ql:()=>mr,hexToBytes:()=>lr,tL:()=>gr,S5:()=>yr,FF:()=>Tr}),function(t){t.PUBLIC="public",t.SECRET="secret"}(t||(t={})),(i=e||(e={})).SECRET="secret",i.OPEN="open",i.UNCONSTRAINED="unconstrained";var s=r(3573);function a(t){const e=new s.C4(256);return e.reset(),e.update(t),e.digest("hex")}var c=r(394),u=r(3302),f=r(816).Buffer;const h=65536,l=t=>{if(u)return c.randomBytes(t);const e="undefined"!=typeof window&&window.crypto?window.crypto:"undefined"!=typeof self&&self.crypto?self.crypto:void 0;if(!e)throw new Error("randomBytes UnsupportedEnvironment");const r=f.allocUnsafe(t);if(t>h)for(let n=0;n<t;n+=h)e.getRandomValues(r.slice(n,n+h));else e.getRandomValues(r);return r};var d=r(5294),p=r(816).Buffer;function g(t){const e=t.toString("hex");return 0===e.length?BigInt(0):BigInt(`0x${e}`)}function y(t,e){if(t<BigInt(0))throw new Error(`Cannot convert negative bigint ${t.toString()} to buffer with toBufferBE.`);const r=t.toString(16),n=p.from(r.padStart(2*e,"0").slice(0,2*e),"hex");if(n.length>e)throw new Error(`Number ${t.toString(16)} does not fit in ${e}`);return n}function m(t,e=!1){const r=t.toString(16),n=r.length%2==0?r.length:r.length+1;return`0x${r.padStart(e?64:n,"0")}`}var w=r(816).Buffer;class b{constructor(t,e=0){this.buffer=t,this.index=e}static asReader(t){return w.isBuffer(t)?new b(t):t}readNumber(){return this.index+=4,this.buffer.readUint32BE(this.index-4)}readUInt16(){return this.index+=2,this.buffer.readUInt16BE(this.index-2)}readBoolean(){return this.index+=1,Boolean(this.buffer.at(this.index-1))}readBytes(t){return this.index+=t,w.from(this.buffer.subarray(this.index-t,this.index))}readFr(){return _.fromBuffer(this)}readFq(){return E.fromBuffer(this)}readNumberVector(){return this.readVector({fromBuffer:t=>t.readNumber()})}readVector(t){const e=this.readNumber(),r=new Array(e);for(let n=0;n<e;n++)r[n]=t.fromBuffer(this);return r}readArray(t,e){return Array.from({length:t},(()=>e.fromBuffer(this)))}readBufferArray(t=-1){const e=[],r=t>=0?this.index+t:this.buffer.length;for(;this.index<r;){const t=this.readBuffer();e.push(t)}if(this.index!==r)throw new Error(`Reader buffer was not fully consumed. Consumed up to ${this.index} bytes. End of data: ${r} bytes.`);return e}readObject(t){return t.fromBuffer(this)}peekBytes(t){return this.buffer.subarray(this.index,t?this.index+t:void 0)}readString(){return this.readBuffer().toString()}readBuffer(){const t=this.readNumber();return this.readBytes(t)}readMap(t){const e=this.readNumber(),r={};for(let n=0;n<e;n++){const e=this.readString(),n=this.readObject(t);r[e]=n}return r}getLength(){return this.buffer.length}}var v=r(816).Buffer;class _{constructor(t){if(this.value=BigInt(t),t>_.MAX_VALUE)throw new Error(`Fr out of range ${t}.`)}static random(){const t=g(l(_.SIZE_IN_BYTES))%_.MODULUS;return new _(t)}static zero(){return new _(0n)}static fromBuffer(t){const e=b.asReader(t);return new _(g(e.readBytes(_.SIZE_IN_BYTES)))}static fromString(t){return _.fromBuffer(v.from(t.replace(/^0x/i,""),"hex"))}toBuffer(){return y(this.value,_.SIZE_IN_BYTES)}toString(t=!1){return m(this.value,t)}toBigInt(){return this.value}toShortString(){const t=this.toString();return`${t.slice(0,10)}...${t.slice(-4)}`}equals(t){return this.value===t.value}isZero(){return 0n===this.value}toFriendlyJSON(){return this.toString()}}_.ZERO=new _(0n),_.MODULUS=0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001n,_.MAX_VALUE=_.MODULUS-1n,_.SIZE_IN_BYTES=32;class E{constructor(t){if(this.value=t,t>E.MAX_VALUE)throw new Error(`Fq out of range ${t}.`)}static random(){return new this(g(l(64))%E.MODULUS)}static fromBuffer(t){return new this(g(b.asReader(t).readBytes(this.SIZE_IN_BYTES)))}toBuffer(){return y(this.value,E.SIZE_IN_BYTES)}toString(){return m(this.value)}isZero(){return 0n===this.value}toFriendlyJSON(){return this.toString()}}E.MODULUS=0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47n,E.MAX_VALUE=_.MODULUS-1n,E.SIZE_IN_BYTES=32;var S=r(816).Buffer;const T=t=>S.from(d.sha256().update(t).digest());var B=r(816).Buffer;function R(t,e){const r=function(t,e){return"constructor"===t?t:`${t}(${e.map((t=>t.type.kind)).join(",")})`}(t,e);return(n=B.from(r),new s.C4(256).update(n).digest()).slice(0,4);var n}var A=r(816).Buffer;class C{constructor(t,e){this.x=t,this.y=e,this.kind="point"}static random(){return new C(_.random(),_.random())}static fromBuffer(t){const e=b.asReader(t);return new this(_.fromBuffer(e.readBytes(32)),_.fromBuffer(e.readBytes(32)))}static fromString(t){return this.fromBuffer(A.from(t.replace(/^0x/i,""),"hex"))}toFields(){return[this.x,this.y]}toBigInts(){return{x:this.x.value,y:this.y.value}}toBuffer(){return A.concat([this.x.toBuffer(),this.y.toBuffer()])}toString(){return"0x"+this.toBuffer().toString("hex")}toShortString(){const t=this.toString();return`${t.slice(0,10)}...${t.slice(-4)}`}equals(t){return this.x.equals(t.x)&&this.y.equals(t.y)}}C.ZERO=new C(_.ZERO,_.ZERO),C.SIZE_IN_BYTES=2*_.SIZE_IN_BYTES;var O=r(816).Buffer;class L{constructor(t){this.fields=t}toFields(){return this.fields}static random(){return this.fromField(_.random())}toFieldsBuffer(){return O.concat([this.fields[0].toBuffer(),this.fields[1].toBuffer()])}toBuffer(){const t=this.fields[0].toBuffer(),e=this.fields[1].toBuffer();return t[0]=e[31],t}equals(t){return this.toBigInt()===t.toBigInt()}toBigInt(){return g(this.toBuffer())}static fromBuffer(t){if(32!=t.length)throw new Error("Invalid size of coordinate buffer");const e=O.alloc(32);t.copy(e,0,0,32);const r=O.alloc(32);return r[31]=e[0],e[0]=0,new L([_.fromBuffer(e),_.fromBuffer(r)])}static fromField(t){const e=t.toBuffer(),r=O.alloc(32);return r[31]=e[0],e[0]=0,new L([_.fromBuffer(e),_.fromBuffer(r)])}}L.ZERO=new L([_.ZERO,_.ZERO]);class x{constructor(t,e){this.abi=t,this.args=e,this.flattened=[]}encodeArgument(t,e,r){if(void 0===e||null==e)throw new Error(`Undefined argument ${r??"unnamed"} of type ${t.kind}`);switch(t.kind){case"field":if("number"==typeof e)this.flattened.push(new _(BigInt(e)));else if("bigint"==typeof e)this.flattened.push(new _(e));else{if("object"!=typeof e)throw new Error(`Invalid argument "${e}" of type ${t.kind}`);if("function"==typeof e.toField)this.flattened.push(e.toField());else{if(!(e instanceof _))throw new Error("Argument cannot be serialised to a field");this.flattened.push(e)}}break;case"boolean":this.flattened.push(new _(e?1n:0n));break;case"array":for(let n=0;n<t.length;n+=1)this.encodeArgument(t.type,e[n],`${r}[${n}]`);break;case"struct":for(const n of t.fields)this.encodeArgument(n.type,e[n.name],`${r}.${n.name}`);break;case"integer":this.flattened.push(new _(e));break;default:throw new Error(`Unsupported type: ${t.kind}`)}}encode(){for(let t=0;t<this.abi.parameters.length;t+=1){const e=this.abi.parameters[t];this.encodeArgument(e.type,this.args[t],e.name)}return this.flattened}}function I(t,e){return new x(t,e).encode()}var k=r(816).Buffer;function N(t,e=4){const r=k.alloc(e);return r.writeUInt32BE(t,e-4),r}function M(t,e=4){const r=k.alloc(e);return r.writeInt32BE(t,e-4),r}function P(t){const e=k.alloc(4);return e.writeUInt32BE(t.length,0),k.concat([e,t])}r(816).Buffer;var D=r(816).Buffer;function U(t,e=4){const r=D.alloc(e);return r.writeUInt32BE(t,e-4),r}function F(t){return!!t.toBuffer32}function j(...t){let e=[];for(const n of t)Array.isArray(n)?e=[...e,...j(...n)]:D.isBuffer(n)?e.push(n):"boolean"==typeof n?e.push((r=n,D.from([r?1:0]))):"number"==typeof n?e.push(U(n)):"string"==typeof n?(e.push(U(n.length)),e.push(D.from(n))):F(n)?e.push(n.toBuffer32()):e.push(n.toBuffer());var r;return e}function $(...t){return D.concat(j(...t))}class H{constructor(t,e,r,n){this.chainId=t,this.version=e,this.blockNumber=r,this.timestamp=n}static from(t){return new H(...H.getFields(t))}static empty(){return new H(_.zero(),_.zero(),_.zero(),_.zero())}static fromBuffer(t){const e=b.asReader(t);return new H(e.readFr(),e.readFr(),e.readFr(),e.readFr())}static getFields(t){return[t.chainId,t.version,t.blockNumber,t.timestamp]}toBuffer(){return $(...H.getFields(this))}}const q=16,z=16,Z=16,V=32;var W,G,K,Y;function J(t,e,r=0){return Array.from({length:t},((t,n)=>e(n+r)))}function X(t,e,r){if(t[e].length!==r)throw new Error(`Expected ${e} to have length ${r} but was ${t[e].length}`)}function Q(t,e,r){const n=t[e];for(let t=0;t<n.length;t++)if(n[t].length!==r)throw new Error(`Expected ${e}[${t}] to have length ${r} but was ${n[t].length}`)}!function(t){t[t.COMMITMENT=1]="COMMITMENT",t[t.COMMITMENT_NONCE=2]="COMMITMENT_NONCE",t[t.UNIQUE_COMMITMENT=3]="UNIQUE_COMMITMENT",t[t.OUTER_COMMITMENT=4]="OUTER_COMMITMENT",t[t.NULLIFIER=5]="NULLIFIER",t[t.INITIALISATION_NULLIFIER=6]="INITIALISATION_NULLIFIER",t[t.OUTER_NULLIFIER=7]="OUTER_NULLIFIER",t[t.PUBLIC_DATA_READ=8]="PUBLIC_DATA_READ",t[t.PUBLIC_DATA_UPDATE_REQUEST=9]="PUBLIC_DATA_UPDATE_REQUEST",t[t.FUNCTION_DATA=10]="FUNCTION_DATA",t[t.FUNCTION_LEAF=11]="FUNCTION_LEAF",t[t.CONTRACT_DEPLOYMENT_DATA=12]="CONTRACT_DEPLOYMENT_DATA",t[t.CONSTRUCTOR=13]="CONSTRUCTOR",t[t.CONSTRUCTOR_ARGS=14]="CONSTRUCTOR_ARGS",t[t.CONTRACT_ADDRESS=15]="CONTRACT_ADDRESS",t[t.CONTRACT_LEAF=16]="CONTRACT_LEAF",t[t.CALL_CONTEXT=17]="CALL_CONTEXT",t[t.CALL_STACK_ITEM=18]="CALL_STACK_ITEM",t[t.CALL_STACK_ITEM_2=19]="CALL_STACK_ITEM_2",t[t.L1_TO_L2_MESSAGE_SECRET=20]="L1_TO_L2_MESSAGE_SECRET",t[t.L2_TO_L1_MSG=21]="L2_TO_L1_MSG",t[t.TX_CONTEXT=22]="TX_CONTEXT",t[t.PUBLIC_LEAF_INDEX=23]="PUBLIC_LEAF_INDEX",t[t.PUBLIC_DATA_LEAF=24]="PUBLIC_DATA_LEAF",t[t.SIGNED_TX_REQUEST=25]="SIGNED_TX_REQUEST",t[t.GLOBAL_VARIABLES=26]="GLOBAL_VARIABLES",t[t.PARTIAL_CONTRACT_ADDRESS=27]="PARTIAL_CONTRACT_ADDRESS",t[t.TX_REQUEST=33]="TX_REQUEST",t[t.VK=41]="VK",t[t.PRIVATE_CIRCUIT_PUBLIC_INPUTS=42]="PRIVATE_CIRCUIT_PUBLIC_INPUTS",t[t.PUBLIC_CIRCUIT_PUBLIC_INPUTS=43]="PUBLIC_CIRCUIT_PUBLIC_INPUTS",t[t.FUNCTION_ARGS=44]="FUNCTION_ARGS"}(W||(W={})),function(t){t[t.BASE_SLOT=0]="BASE_SLOT",t[t.MAPPING_SLOT=1]="MAPPING_SLOT",t[t.MAPPING_SLOT_PLACEHOLDER=2]="MAPPING_SLOT_PLACEHOLDER"}(G||(G={})),function(t){t[t.VALUE=1]="VALUE",t[t.OWNER=2]="OWNER",t[t.CREATOR=3]="CREATOR",t[t.SALT=4]="SALT",t[t.NONCE=5]="NONCE",t[t.MEMO=6]="MEMO",t[t.IS_DUMMY=7]="IS_DUMMY"}(K||(K={})),function(t){t[t.PARTITIONED=1]="PARTITIONED",t[t.WHOLE=2]="WHOLE"}(Y||(Y={}));class tt{constructor(t,e){this.root=t,this.nextAvailableLeafIndex=e}toBuffer(){return $(this.root,this.nextAvailableLeafIndex)}static fromBuffer(t){const e=b.asReader(t);return new tt(e.readFr(),e.readNumber())}static empty(){return new tt(_.ZERO,0)}}class et{constructor(t,e,r,n,i,o,s,a,c,u,f,h,l,d,p,g,y,m){this.kernelData=t,this.startPrivateDataTreeSnapshot=e,this.startNullifierTreeSnapshot=r,this.startContractTreeSnapshot=n,this.startPublicDataTreeRoot=i,this.startHistoricBlocksTreeSnapshot=o,this.lowNullifierLeafPreimages=s,this.lowNullifierMembershipWitness=a,this.newCommitmentsSubtreeSiblingPath=c,this.newNullifiersSubtreeSiblingPath=u,this.newContractsSubtreeSiblingPath=f,this.newPublicDataUpdateRequestsSiblingPaths=h,this.newPublicDataReadsSiblingPaths=l,this.historicPrivateDataTreeRootMembershipWitnesses=d,this.historicContractsTreeRootMembershipWitnesses=p,this.historicL1ToL2MsgTreeRootMembershipWitnesses=g,this.historicBlocksTreeRootMembershipWitnesses=y,this.constants=m,X(this,"lowNullifierLeafPreimages",32),X(this,"lowNullifierMembershipWitness",32),X(this,"newCommitmentsSubtreeSiblingPath",V-et.PRIVATE_DATA_SUBTREE_HEIGHT),X(this,"newNullifiersSubtreeSiblingPath",16-et.NULLIFIER_SUBTREE_HEIGHT),X(this,"newContractsSubtreeSiblingPath",16-et.CONTRACT_SUBTREE_HEIGHT),X(this,"newPublicDataUpdateRequestsSiblingPaths",16),X(this,"newPublicDataReadsSiblingPaths",16),Q(this,"newPublicDataUpdateRequestsSiblingPaths",254),Q(this,"newPublicDataReadsSiblingPaths",254)}static from(t){return new et(...et.getFields(t))}static getFields(t){return[t.kernelData,t.startPrivateDataTreeSnapshot,t.startNullifierTreeSnapshot,t.startContractTreeSnapshot,t.startPublicDataTreeRoot,t.startHistoricBlocksTreeSnapshot,t.lowNullifierLeafPreimages,t.lowNullifierMembershipWitness,t.newCommitmentsSubtreeSiblingPath,t.newNullifiersSubtreeSiblingPath,t.newContractsSubtreeSiblingPath,t.newPublicDataUpdateRequestsSiblingPaths,t.newPublicDataReadsSiblingPaths,t.historicPrivateDataTreeRootMembershipWitnesses,t.historicContractsTreeRootMembershipWitnesses,t.historicL1ToL2MsgTreeRootMembershipWitnesses,t.historicBlocksTreeRootMembershipWitnesses,t.constants]}toBuffer(){return $(...et.getFields(this))}}et.PRIVATE_DATA_SUBTREE_HEIGHT=Math.log2(32),et.CONTRACT_SUBTREE_HEIGHT=Math.log2(2),et.NULLIFIER_SUBTREE_HEIGHT=Math.log2(32);var rt,nt,it,ot,st=r(3545);class at{constructor(t){this.items=t}toBuffer(){return $(this.items.length,this.items)}toFriendlyJSON(){return this.items}}(ot=rt||(rt={}))[ot.STANDARD=0]="STANDARD",ot[ot.TURBO=1]="TURBO",ot[ot.ULTRA=2]="ULTRA",(it=nt||(nt={}))[it.Base=0]="Base",it[it.Merge=1]="Merge",it[it.Root=2]="Root";class ct{constructor(t,e){this.x="bigint"==typeof t?new E(t):t,this.y="bigint"==typeof e?new E(e):e}toBuffer(){return $(this.x,this.y)}static fromBuffer(t){const e=b.asReader(t);return new ct(e.readFr(),e.readFr())}}class ut{constructor(t,e,r,n,i=!1){this.p0=t,this.p1=e,this.publicInputs=r,this.proofWitnessIndices=n,this.hasData=i}toBuffer(){return $(this.p0,this.p1,new at(this.publicInputs),new at(this.proofWitnessIndices),this.hasData)}static fromBuffer(t){const e=b.asReader(t);return new ut(e.readObject(ct),e.readObject(ct),e.readVector(_),e.readNumberVector(),e.readBoolean())}static makeFake(){return new ut(new ct(new E(1n),new E(2n)),new ct(new E(1n),new E(2n)),[],st(16,(t=>3027+t)),!1)}}r(816).Buffer;var ft=r(816).Buffer;class ht{constructor(t){this.buffer=t;const e=g(t);if(e>ht.MAX_VALUE)throw new Error(`AztecAddress out of range ${e}.`)}static random(){return new ht(y(_.random().value,ht.SIZE_IN_BYTES))}static fromBuffer(t){return new this(b.asReader(t).readBytes(this.SIZE_IN_BYTES))}static fromString(t){const e=ft.from(t.replace(/^0x/i,""),"hex");if(e.length!==ht.SIZE_IN_BYTES)throw new Error(`Invalid length ${e.length}.`);return new ht(e)}static fromBigInt(t){return new ht(y(t,ht.SIZE_IN_BYTES))}toBuffer(){return this.buffer}toString(){return`0x${this.buffer.toString("hex")}`}toShortString(){const t=this.toString();return`${t.slice(0,10)}...${t.slice(-4)}`}toField(){return _.fromBuffer(this.toBuffer())}toBigInt(){return g(this.buffer)}equals(t){return this.buffer.equals(t.buffer)}isZero(){return this.equals(ht.ZERO)}toFriendlyJSON(){return this.toString()}}ht.SIZE_IN_BYTES=32,ht.ZERO=new ht(ft.alloc(ht.SIZE_IN_BYTES)),ht.MODULUS=0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001n,ht.MAX_VALUE=ht.MODULUS-1n;var lt=r(816).Buffer;class dt{constructor(t){if(this.buffer=t,32===t.length){if(!t.slice(0,12).equals(lt.alloc(12)))throw new Error(`Invalid address buffer: ${t.toString("hex")}`);this.buffer=t.slice(12)}else if(t.length!==dt.SIZE_IN_BYTES)throw new Error(`Expect buffer size to be ${dt.SIZE_IN_BYTES}. Got ${t.length}.`)}static fromString(t){if(!dt.isAddress(t))throw new Error(`Invalid address string: ${t}`);return new dt(lt.from(t.replace(/^0x/i,""),"hex"))}static random(){return new dt(l(20))}static isAddress(t){return!!/^(0x)?[0-9a-f]{40}$/i.test(t)&&(!(!/^(0x|0X)?[0-9a-f]{40}$/.test(t)&&!/^(0x|0X)?[0-9A-F]{40}$/.test(t))||dt.checkAddressChecksum(t))}isZero(){return this.equals(dt.ZERO)}static checkAddressChecksum(t){const e=a((t=t.replace(/^0x/i,"")).toLowerCase());for(let r=0;r<40;r++)if(parseInt(e[r],16)>7&&t[r].toUpperCase()!==t[r]||parseInt(e[r],16)<=7&&t[r].toLowerCase()!==t[r])return!1;return!0}static toChecksumAddress(t){if(!dt.isAddress(t))throw new Error("Invalid address string.");const e=a(t=t.toLowerCase().replace(/^0x/i,""));let r="0x";for(let n=0;n<t.length;n++)parseInt(e[n],16)>7?r+=t[n].toUpperCase():r+=t[n];return r}equals(t){return this.buffer.equals(t.buffer)}toString(){return`0x${this.buffer.toString("hex")}`}toChecksumString(){return dt.toChecksumAddress(this.buffer.toString("hex"))}toBuffer(){return this.toBuffer32()}toBuffer20(){return this.buffer}toBuffer32(){const t=lt.alloc(32);return this.buffer.copy(t,12),t}toField(){return _.fromBuffer(this.toBuffer32())}static fromField(t){return new dt(t.toBuffer().slice(-dt.SIZE_IN_BYTES))}static fromBuffer(t){const e=b.asReader(t);return new dt(e.readBuffer())}toFriendlyJSON(){return this.toString()}}dt.SIZE_IN_BYTES=20,dt.ZERO=new dt(lt.alloc(dt.SIZE_IN_BYTES));class pt{constructor(t,e,r,n,i,o){this.msgSender=t,this.storageContractAddress=e,this.isDelegateCall=n,this.isStaticCall=i,this.isContractDeployment=o,this.portalContractAddress=r instanceof dt?r:dt.fromField(r)}static empty(){return new pt(ht.ZERO,ht.ZERO,_.ZERO,!1,!1,!1)}isEmpty(){return this.msgSender.isZero()&&this.storageContractAddress.isZero()&&this.portalContractAddress.isZero()}static from(t){return new pt(...pt.getFields(t))}static getFields(t){return[t.msgSender,t.storageContractAddress,t.portalContractAddress,t.isDelegateCall,t.isStaticCall,t.isContractDeployment]}toBuffer(){return $(...pt.getFields(this))}static fromBuffer(t){const e=b.asReader(t);return new pt(new ht(e.readBytes(32)),new ht(e.readBytes(32)),new dt(e.readBytes(32)),e.readBoolean(),e.readBoolean(),e.readBoolean())}}var gt=r(816).Buffer;class yt{constructor(t,e,r,n){if(this.isInternal=e,this.isPrivate=r,this.isConstructor=n,t instanceof gt){if(4!==t.byteLength)throw new Error(`Function selector must be 4 bytes long, got ${t.byteLength} bytes.`);this.functionSelectorBuffer=t}else this.functionSelectorBuffer=N(t)}static fromAbi(t){return new yt(R(t.name,t.parameters),t.isInternal,t.functionType===e.SECRET,"constructor"===t.name)}get functionSelector(){return function(t,e=0){return{elem:t.readUInt32BE(e),adv:4}}(this.functionSelectorBuffer).elem}toBuffer(){return $(this.functionSelectorBuffer,this.isInternal,this.isPrivate,this.isConstructor)}isEmpty(){return this.functionSelectorBuffer.equals(gt.alloc(4,0))}static empty(t){return new yt(gt.alloc(4,0),t?.isInternal??!1,t?.isPrivate??!1,t?.isConstructor??!1)}static fromBuffer(t){const e=b.asReader(t);return new yt(e.readBytes(4),e.readBoolean(),e.readBoolean(),e.readBoolean())}}var mt=r(816).Buffer;class wt{constructor(t,e,r){this.contractAddress=t,this.functionTreeRoot=r,this.portalContractAddress=new dt(e.toBuffer())}toBuffer(){return $(this.contractAddress,this.portalContractAddress,this.functionTreeRoot)}static fromBuffer(t){const e=b.asReader(t);return new wt(e.readObject(ht),new dt(e.readBytes(32)),e.readFr())}static empty(){return new wt(ht.ZERO,dt.ZERO,_.ZERO)}}class bt{constructor(t,e,r,n,i,o,s,a){this.callStackItemHash=t,this.functionData=e,this.vkHash=r,this.payFeeFromL1=i,this.payFeeFromPublicL2=o,this.calledFromL1=s,this.calledFromPublicL2=a,this.portalContractAddress=dt.fromField(n.toField())}toBuffer(){return $(this.callStackItemHash,this.functionData,this.vkHash,this.portalContractAddress,this.payFeeFromL1,this.payFeeFromPublicL2,this.calledFromL1,this.calledFromPublicL2)}static fromBuffer(t){const e=b.asReader(t);return new bt(e.readFr(),e.readObject(yt),e.readFr(),new dt(e.readBytes(32)),e.readBoolean(),e.readBoolean(),e.readBoolean(),e.readBoolean())}static empty(){return new bt(_.ZERO,yt.empty(),_.ZERO,dt.ZERO,!1,!1,!1,!1)}}class vt{constructor(t,e){this.leafIndex=t,this.value=e}static from(t){return new vt(t.leafIndex,t.value)}toBuffer(){return $(this.leafIndex,this.value)}static fromBuffer(t){const e=b.asReader(t);return new vt(e.readFr(),e.readFr())}static empty(){return new vt(_.ZERO,_.ZERO)}toFriendlyJSON(){return`Leaf=${this.leafIndex.toFriendlyJSON()}: ${this.value.toFriendlyJSON()}`}}class _t{constructor(t,e,r){this.leafIndex=t,this.oldValue=e,this.newValue=r}static from(t){return new _t(t.leafIndex,t.oldValue,t.newValue)}toBuffer(){return $(this.leafIndex,this.oldValue,this.newValue)}static fromBuffer(t){const e=b.asReader(t);return new _t(e.readFr(),e.readFr(),e.readFr())}static empty(){return new _t(_.ZERO,_.ZERO,_.ZERO)}toFriendlyJSON(){return`Leaf=${this.leafIndex.toFriendlyJSON()}: ${this.oldValue.toFriendlyJSON()} => ${this.newValue.toFriendlyJSON()}`}}class Et{constructor(t,e,r,n,i,o,s,a,c,u,f,h,l,d,p,g){this.aggregationObject=t,this.readRequests=e,this.readRequestMembershipWitnesses=r,this.newCommitments=n,this.newNullifiers=i,this.privateCallStack=o,this.publicCallStack=s,this.newL2ToL1Msgs=a,this.encryptedLogsHash=c,this.unencryptedLogsHash=u,this.encryptedLogPreimagesLength=f,this.unencryptedLogPreimagesLength=h,this.newContracts=l,this.optionallyRevealedData=d,this.publicDataUpdateRequests=p,this.publicDataReads=g,X(this,"readRequests",Z),X(this,"readRequestMembershipWitnesses",Z),X(this,"newCommitments",q),X(this,"newNullifiers",z),X(this,"privateCallStack",8),X(this,"publicCallStack",8),X(this,"newL2ToL1Msgs",2),X(this,"encryptedLogsHash",2),X(this,"unencryptedLogsHash",2),X(this,"newContracts",1),X(this,"optionallyRevealedData",4),X(this,"publicDataUpdateRequests",8),X(this,"publicDataReads",8)}toBuffer(){return $(this.aggregationObject,this.readRequests,this.readRequestMembershipWitnesses,this.newCommitments,this.newNullifiers,this.privateCallStack,this.publicCallStack,this.newL2ToL1Msgs,this.encryptedLogsHash,this.unencryptedLogsHash,this.encryptedLogPreimagesLength,this.unencryptedLogPreimagesLength,this.newContracts,this.optionallyRevealedData,this.publicDataUpdateRequests,this.publicDataReads)}toString(){return this.toBuffer().toString()}static fromBuffer(t){const e=b.asReader(t);return new Et(e.readObject(ut),e.readArray(Z,_),e.readArray(Z,Ft),e.readArray(q,_),e.readArray(z,_),e.readArray(8,_),e.readArray(8,_),e.readArray(2,_),e.readArray(2,_),e.readArray(2,_),e.readFr(),e.readFr(),e.readArray(1,wt),e.readArray(4,bt),e.readArray(8,_t),e.readArray(8,vt))}static fromString(t){return Et.fromBuffer(mt.from(t,"hex"))}static empty(){return new Et(ut.makeFake(),J(Z,_.zero),J(Z,(()=>Ft.empty(BigInt(0)))),J(q,_.zero),J(z,_.zero),J(8,_.zero),J(8,_.zero),J(2,_.zero),J(2,_.zero),J(2,_.zero),_.zero(),_.zero(),J(1,wt.empty),J(4,bt.empty),J(8,_t.empty),J(8,vt.empty))}}class St{constructor(t,e,r,n,i){this.deployerPublicKey=t,this.constructorVkHash=e,this.functionTreeRoot=r,this.contractAddressSalt=n,this.portalContractAddress=dt.fromField(i.toField())}toBuffer(){return $(this.deployerPublicKey,this.constructorVkHash,this.functionTreeRoot,this.contractAddressSalt,this.portalContractAddress)}static empty(){return new St(C.ZERO,_.ZERO,_.ZERO,_.ZERO,dt.ZERO)}static fromBuffer(t){const e=b.asReader(t);return new St(e.readObject(C),e.readFr(),e.readFr(),e.readFr(),new dt(e.readBytes(32)))}}class Tt{constructor(t,e,r,n,i,o){this.isFeePaymentTx=t,this.isRebatePaymentTx=e,this.isContractDeploymentTx=r,this.contractDeploymentData=n,this.chainId=i,this.version=o}toBuffer(){return $(this.isFeePaymentTx,this.isRebatePaymentTx,this.isContractDeploymentTx,this.contractDeploymentData,this.chainId,this.version)}static fromBuffer(t){const e=b.asReader(t);return new Tt(e.readBoolean(),e.readBoolean(),e.readBoolean(),e.readObject(St),e.readFr(),e.readFr())}static empty(t=_.ZERO,e=_.ZERO){return new Tt(!1,!1,!1,St.empty(),t,e)}static from(t){return new Tt(...Tt.getFields(t))}static getFields(t){return[t.isFeePaymentTx,t.isRebatePaymentTx,t.isContractDeploymentTx,t.contractDeploymentData,t.chainId,t.version]}}var Bt=r(816).Buffer;class Rt{constructor(t,e,r,n,i,o){this.privateDataTreeRoot=t,this.nullifierTreeRoot=e,this.contractTreeRoot=r,this.l1ToL2MessagesTreeRoot=n,this.blocksTreeRoot=i,this.privateKernelVkTreeRoot=o}static from(t){return new Rt(...Rt.getFields(t))}static getFields(t){return[t.privateDataTreeRoot,t.nullifierTreeRoot,t.contractTreeRoot,t.l1ToL2MessagesTreeRoot,t.blocksTreeRoot,t.privateKernelVkTreeRoot]}toBuffer(){return $(...Rt.getFields(this))}toString(){return this.toBuffer().toString()}isEmpty(){return this.privateDataTreeRoot.isZero()&&this.nullifierTreeRoot.isZero()&&this.contractTreeRoot.isZero()&&this.l1ToL2MessagesTreeRoot.isZero()&&this.blocksTreeRoot.isZero()&&this.privateKernelVkTreeRoot.isZero()}static fromBuffer(t){const e=b.asReader(t);return new Rt(e.readFr(),e.readFr(),e.readFr(),e.readFr(),e.readFr(),e.readFr())}static fromString(t){return Rt.fromBuffer(Bt.from(t,"hex"))}static empty(){return new Rt(_.ZERO,_.ZERO,_.ZERO,_.ZERO,_.ZERO,_.ZERO)}}class At{constructor(t){this.privateHistoricTreeRoots=t}toBuffer(){return $(this.privateHistoricTreeRoots)}toString(){return this.toBuffer().toString()}static fromBuffer(t){const e=b.asReader(t);return new At(e.readObject(Rt))}isEmpty(){return this.privateHistoricTreeRoots.isEmpty()}static empty(){return new At(Rt.empty())}}class Ct{constructor(t,e){this.historicTreeRoots=t,this.txContext=e}toBuffer(){return $(this.historicTreeRoots,this.txContext)}static fromBuffer(t){const e=b.asReader(t);return new Ct(e.readObject(At),e.readObject(Tt))}static empty(){return new Ct(At.empty(),Tt.empty())}}r(1328),r(816).Buffer,r(816).Buffer,r(816).Buffer;class Ot{constructor(t){this.buffer=t}static fromMsgpackBuffer(t){return new Ot(t)}static fromBuffer(t){const e=b.asReader(t),r=e.readNumber(),n=e.readBytes(r);return new Ot(n)}toMsgpackBuffer(){return this.buffer}toBuffer(){return $(this.buffer.length,this.buffer)}}class Lt{constructor(t,e,r){this.end=t,this.constants=e,this.isPrivate=r}toBuffer(){return $(this.end,this.constants,this.isPrivate)}static fromBuffer(t){const e=b.asReader(t);return new Lt(e.readObject(Et),e.readObject(Ct),e.readBoolean())}static empty(){return new Lt(Et.empty(),Ct.empty(),!0)}}function xt(t,e,r){if(t.length>r)throw new Error("Array size exceeds target length");return[...t,...Array(r-t.length).fill(e)]}function It(t,e){for(const r of t)if(!e(r))return!1;return!0}class kt{constructor(t,e){this.storageSlot=t,this.currentValue=e}static from(t){return new kt(t.storageSlot,t.currentValue)}toBuffer(){return $(this.storageSlot,this.currentValue)}static fromBuffer(t){const e=b.asReader(t);return new kt(e.readFr(),e.readFr())}static empty(){return new kt(_.ZERO,_.ZERO)}isEmpty(){return this.storageSlot.isZero()&&this.currentValue.isZero()}toFriendlyJSON(){return`Slot=${this.storageSlot.toFriendlyJSON()}: ${this.currentValue.toFriendlyJSON()}`}}class Nt{constructor(t,e,r){this.storageSlot=t,this.oldValue=e,this.newValue=r}static from(t){return new Nt(t.storageSlot,t.oldValue,t.newValue)}toBuffer(){return $(this.storageSlot,this.oldValue,this.newValue)}static fromBuffer(t){const e=b.asReader(t);return new Nt(e.readFr(),e.readFr(),e.readFr())}static empty(){return new Nt(_.ZERO,_.ZERO,_.ZERO)}isEmpty(){return this.storageSlot.isZero()&&this.oldValue.isZero()&&this.newValue.isZero()}toFriendlyJSON(){return`Slot=${this.storageSlot.toFriendlyJSON()}: ${this.oldValue.toFriendlyJSON()} => ${this.newValue.toFriendlyJSON()}`}}class Mt{constructor(t,e,r,n,i,o,s,a,c,u,f,h,l){this.callContext=t,this.argsHash=e,this.returnValues=r,this.contractStorageUpdateRequests=n,this.contractStorageReads=i,this.publicCallStack=o,this.newCommitments=s,this.newNullifiers=a,this.newL2ToL1Msgs=c,this.unencryptedLogsHash=u,this.unencryptedLogPreimagesLength=f,this.historicPublicDataTreeRoot=h,this.proverAddress=l,X(this,"returnValues",4),X(this,"publicCallStack",4),X(this,"newCommitments",4),X(this,"newNullifiers",4),X(this,"newL2ToL1Msgs",2),X(this,"contractStorageUpdateRequests",8),X(this,"contractStorageReads",8),X(this,"unencryptedLogsHash",2)}static from(t){return new Mt(...Mt.getFields(t))}static empty(){return new Mt(pt.empty(),_.ZERO,J(4,_.zero),J(8,Nt.empty),J(8,kt.empty),J(4,_.zero),J(4,_.zero),J(4,_.zero),J(2,_.zero),J(2,_.zero),_.ZERO,_.ZERO,ht.ZERO)}isEmpty(){const t=t=>It(t,(t=>t.isZero()));return this.callContext.isEmpty()&&this.argsHash.isZero()&&t(this.returnValues)&&It(this.contractStorageUpdateRequests,(t=>t.isEmpty()))&&It(this.contractStorageReads,(t=>t.isEmpty()))&&t(this.publicCallStack)&&t(this.newCommitments)&&t(this.newNullifiers)&&t(this.newL2ToL1Msgs)&&t(this.unencryptedLogsHash)&&this.unencryptedLogPreimagesLength.isZero()&&this.historicPublicDataTreeRoot.isZero()&&this.proverAddress.isZero()}static getFields(t){return[t.callContext,t.argsHash,t.returnValues,t.contractStorageUpdateRequests,t.contractStorageReads,t.publicCallStack,t.newCommitments,t.newNullifiers,t.newL2ToL1Msgs,t.unencryptedLogsHash,t.unencryptedLogPreimagesLength,t.historicPublicDataTreeRoot,t.proverAddress]}toBuffer(){return $(...Mt.getFields(this))}}class Pt{constructor(t,e,r,n){this.contractAddress=t,this.functionData=e,this.publicInputs=r,this.isExecutionRequest=n}toBuffer(){return $(this.contractAddress,this.functionData,this.publicInputs,this.isExecutionRequest)}static empty(){return new Pt(ht.ZERO,yt.empty({isPrivate:!1}),Mt.empty(),!1)}isEmpty(){return this.contractAddress.isZero()&&this.functionData.isEmpty()&&this.publicInputs.isEmpty()}}class Dt{constructor(t,e,r,n){this.origin=t,this.functionData=e,this.argsHash=r,this.txContext=n}static getFields(t){return[t.origin,t.functionData,t.argsHash,t.txContext]}static from(t){return new Dt(...Dt.getFields(t))}toBuffer(){return $([...Dt.getFields(this)])}static fromBuffer(t){const e=b.asReader(t);return new Dt(e.readObject(ht),e.readObject(yt),e.readFr(),e.readObject(Tt))}}class Ut{constructor(t,e,r,n,i){this.functionSelector=t,this.isInternal=e,this.isPrivate=r,this.vkHash=n,this.acirHash=i,this.FUNCTION_SELECTOR_LENGTH=4,this.assertFunctionSelectorLength(t)}assertFunctionSelectorLength(t){if(t.byteLength!==this.FUNCTION_SELECTOR_LENGTH)throw new Error(`Function selector must be ${this.FUNCTION_SELECTOR_LENGTH} bytes long, got ${t.byteLength} bytes.`)}toBuffer(){return this.assertFunctionSelectorLength(this.functionSelector),$(this.functionSelector,this.isInternal,this.isPrivate,this.vkHash,this.acirHash)}static fromBuffer(t){const e=b.asReader(t);return new Ut(e.readBytes(4),e.readBoolean(),e.readBoolean(),e.readFr(),e.readFr())}}class Ft{constructor(t,e,r=!1,n){if(this.leafIndex=t,this.siblingPath=e,this.isTransient=r,this.hintToCommitment=n,X(this,"siblingPath",V),n.value>4)throw new Error(`Expected ReadRequestMembershipWitness' hintToCommitment(${n}) to be <= NEW_COMMITMENTS_LENGTH(4)`)}toBuffer(){return $(y(this.leafIndex.toBigInt(),32),...this.siblingPath,this.isTransient,this.hintToCommitment)}static mock(t,e){return new Ft(new _(e),function(t,e=0){const r=[];for(let n=0;n<t;n++)r.push(e+n);return r}(t,e).map((t=>new _(BigInt(t)))),!1,new _(0))}static random(){return new Ft(new _(0n),J(V,(()=>_.random())),!1,new _(0))}static empty(t){const e=J(V,(()=>_.ZERO));return new Ft(new _(t),e,!1,new _(0))}static emptyTransient(){const t=J(V,(()=>_.ZERO));return new Ft(new _(0),t,!0,new _(0))}static fromBufferArray(t,e,r,n){return new Ft(t,e.map((t=>_.fromBuffer(t))),r,n)}static fromMembershipWitness(t,e,r){return new Ft(new _(t.leafIndex),t.siblingPath,e,r)}static fromBuffer(t){const e=b.asReader(t),r=e.readFr(),n=e.readArray(V,_),i=e.readBoolean(),o=e.readFr();return new Ft(r,n,i,o)}}var jt=r(816),$t=r(3261);function Ht(t,e,r,n){const i=r instanceof jt.Buffer?r:r.toBuffer(),o=t.call("bbmalloc",n),s=t.call("bbmalloc",i.length);t.writeMemory(s,i),t.call(e,s,o);const a=jt.Buffer.from(t.getMemorySlice(o,o+n));return t.call("bbfree",o),t.call("bbfree",s),a}function qt(t,e,r,n){const i=[],o=r.reduce(((t,e)=>(i.push(t),t+e.length)),0),s=t.call("bbmalloc",n),a=t.call("bbmalloc",o);t.writeMemory(a,jt.Buffer.concat(r));const c=i.map((t=>a+t));t.call(e,...c,s);const u=jt.Buffer.from(t.getMemorySlice(s,s+n));return t.call("bbfree",a),t.call("bbfree",s),u}function zt(t,e){return t.call("pedersen__init"),_.fromBuffer(Ht(t,"abis__compute_function_leaf",e,32))}const Zt=32,Vt=16;function Wt(t,e){if(0===e.length)return Promise.resolve(_.ZERO);if(e.length>Zt*Vt)throw new Error(`Cannot hash more than ${Zt*Vt} arguments`);t.call("pedersen__init");const r=e=>_.fromBuffer(Ht(t,"abis__compute_var_args_hash",new at(e),32));let n=$t(e,Zt).map((t=>(t.length<Zt&&(t=xt(t,_.ZERO,Zt)),r(t))));return n.length<Vt&&(n=xt(n,_.ZERO,Vt)),Promise.resolve(r(n))}class Gt{constructor(t,e,r,n){this.contractAddress=t,this.functionData=e,this.callContext=r,this.args=n}toBuffer(){return $(this.contractAddress,this.functionData,this.callContext,new at(this.args))}static fromBuffer(t){const e=b.asReader(t);return new Gt(new ht(e.readBytes(32)),yt.fromBuffer(e),pt.fromBuffer(e),e.readVector(_))}static from(t){return new Gt(...Gt.getFields(t))}static getFields(t){return[t.contractAddress,t.functionData,t.callContext,t.args]}async toPublicCallStackItem(){const t=Mt.empty();return t.callContext=this.callContext,t.argsHash=await this.getArgsHash(),new Pt(this.contractAddress,this.functionData,t,!0)}async getArgsHash(){return Wt(await Ee.get(),this.args)}}var Kt=r(6292);let Yt;function Jt(t){const e=Kt(t);return(...t)=>function(t,...e){Kt.enabled(t.namespace)&&(Yt&&Yt(t.namespace,...e),t(...e))}(e,...t)}var Xt=r(3118);const Qt=["silent","fatal","error","warn","info","debug"],te={NODE_ENV:"production"}.LOG_LEVEL?.toLowerCase(),ee=Qt.includes(te)?te:"info";function re(t){const e=Kt(t);"debug"===ee&&(e.enabled=!0);const r={silent:()=>{},fatal:(...t)=>ne(e,"fatal",t),error:(...t)=>ne(e,"error",t),warn:(...t)=>ne(e,"warn",t),info:(...t)=>ne(e,"info",t),debug:(...t)=>ne(e,"debug",t)};return Object.assign(e,r)}function ne(t,e,r){t.enabled?t(r[0],...r.slice(1)):Qt.indexOf(e)<=Qt.indexOf(ee)&&function(t){console.error(...t)}([ie(t,e),...r])}function ie(t,e){const r=ee!==e?` ${e.toUpperCase}`:"",n=`${t.namespace.replace(/^aztec:/,"")}${r}`;if(!u||!(0,Xt.VB)(process.stderr.fd))return n;const i=Kt.selectColor(t.namespace);return` ${"[3"+(i<8?i:"8;5;"+i)};1m${n}`}new class{constructor(){this.logs=[]}enable(){Yt=(...t)=>{this.logs.push([(new Date).toISOString(),...t])}}getLogs(t=0){return t?this.logs.slice(-t):this.logs}clear(t=this.logs.length){this.logs=this.logs.slice(t)}};class oe{constructor(t=re("aztec:foundation:memory_fifo")){this.log=t,this.waiting=[],this.items=[],this.flushing=!1}length(){return this.items.length}get(t){return this.items.length?Promise.resolve(this.items.shift()):0===this.items.length&&this.flushing?Promise.resolve(null):new Promise(((e,r)=>{this.waiting.push(e),t&&setTimeout((()=>{const t=this.waiting.findIndex((t=>t===e));if(t>-1){this.waiting.splice(t,1);const e=new Error("Timeout getting item from queue.");r(e)}}),1e3*t)}))}put(t){this.flushing||(this.waiting.length?this.waiting.shift()(t):this.items.push(t))}end(){this.flushing=!0,this.waiting.forEach((t=>t(null)))}cancel(){this.flushing=!0,this.items=[],this.waiting.forEach((t=>t(null)))}async process(t){try{for(;;){const e=await this.get();if(null===e)break;await t(e)}}catch(t){this.log("Queue handler exception:",t)}}}const se=(t=Jt("wasm:empty_wasi_sdk"))=>({clock_time_get(){t("clock_time_get")},environ_get(){t("environ_get")},environ_sizes_get(){t("environ_sizes_get")},fd_close(){t("fd_close")},fd_read(){t("fd_read")},fd_write(){t("fd_write")},fd_seek(){t("fd_seek")},fd_fdstat_get(){t("fd_fdstat_get")},fd_fdstat_set_flags(){t("fd_fdstat_set_flags")},fd_prestat_get:()=>(t("fd_prestat_get"),8),fd_prestat_dir_name:()=>(t("fd_prestat_dir_name"),28),path_open(){t("path_open")},path_filestat_get(){t("path_filestat_get")},proc_exit:()=>(t("proc_exit"),52),random_get:()=>(t("random_get"),1)});class ae{constructor(t,e,r="wasm"){this.module=t,this.importFn=e,this.mutexQ=new oe,this.debug=Jt(r),this.mutexQ.put(!0)}getModule(){return this.module}async init(t=30,e=8192,r="_initialize"){this.debug(`initial mem: ${t} pages, ${65536*t/1048576}mb. max mem: ${e} pages, ${65536*e/1048576}mb`),this.memory=new WebAssembly.Memory({initial:t,maximum:e}),this.heap=new Uint8Array(this.memory.buffer);const n={wasi_snapshot_preview1:{...se(this.debug),random_get:(t,e)=>{t>>>=0;const r=this.getMemory(),n=l(e);for(let i=t;i<t+e;++i)r[i]=n[i-t]}},env:this.importFn(this)};if(this.module instanceof WebAssembly.Module)this.instance=await WebAssembly.instantiate(this.module,n);else{const{instance:t}=await WebAssembly.instantiate(this.module,n);this.instance=t}r&&this.call(r)}exports(){if(!this.instance)throw new Error("WasmModule: not initialized!");return this.instance.exports}getLogger(){return this.debug}addLogger(t){const e=this.debug;this.debug=(...r)=>{t(...r),e(...r)}}call(t,...e){if(!this.exports()[t])throw new Error(`WASM function ${t} not found.`);try{return this.exports()[t](...e)>>>0}catch(e){const r=`WASM function ${t} aborted, error: ${e}\n${e.stack}`;throw new Error(r)}}getRawMemory(){return this.memory}getMemory(){return 0===this.heap.length&&(this.heap=new Uint8Array(this.memory.buffer)),this.heap}memSize(){return this.getMemory().length}getMemorySlice(t,e){return this.getMemory().slice(t,e)}writeMemory(t,e){const r=this.getMemory();for(let n=0;n<e.length;n++)r[n+t]=e[n]}getMemoryAsString(t){t>>>=0;const e=this.getMemory();let r=t;for(;0!==e[r];++r);return jt.Buffer.from(e.slice(t,r)).toString("ascii")}async acquire(){await this.mutexQ.get()}release(){if(0!==this.mutexQ.length())throw new Error("Release called but not acquired.");this.mutexQ.put(!0)}}var ce=r(9190),ue=r(3240),fe=r(6721),he=r(1856),le=r(6014),de=r(717),pe=r(6963),ge=r(816).Buffer;class ye{constructor(t){this.numPoints=t}async init(){const t=28+64*this.numPoints-1,e=await fetch("https://aztec-ignition.s3.amazonaws.com/MAIN%20IGNITION/sealed/transcript00.dat",{headers:{Range:`bytes=28-${t}`}});this.data=new Uint8Array(await e.arrayBuffer()),await this.downloadG2Data()}async downloadG2Data(){const t=await fetch("https://aztec-ignition.s3.amazonaws.com/MAIN%20IGNITION/sealed/transcript00.dat",{headers:{Range:"bytes=322560028-322560155"}});this.g2Data=new Uint8Array(await t.arrayBuffer())}getG1Data(){return this.data}getG2Data(){return this.g2Data}}class me{constructor(t,e){this.numPoints=t,this.path=e}async init(){const t=64*this.numPoints,e=await(0,le.open)(this.path,"r");try{this.data=ge.alloc(t),await e.read(this.data,0,t,28),this.g2Data=ge.alloc(128),await e.read(this.g2Data,0,128,322560028)}finally{await e.close()}}getG1Data(){return this.data}getG2Data(){return this.g2Data}}class we{constructor(t){if(this.numPoints=t,u){const e=(0,de.dirname)((0,pe.fileURLToPath)("file:///usr/src/yarn-project/circuits.js/dest/crs/index.js"))+"/../../../../circuits/cpp/barretenberg/cpp/srs_db/ignition/monomial/transcript00.dat";this.crs=(0,he.existsSync)(e)?new me(t,e):new ye(t)}else this.crs=new ye(t)}async init(){await this.crs.init()}getG1Data(){return this.crs.getG1Data()}getG2Data(){return this.crs.getG2Data()}}var be=r(816).Buffer;const ve="/aztec3-circuits",_e=u?(0,ue.join)((0,ue.dirname)((0,fe.fileURLToPath)("file:///usr/src/yarn-project/circuits.js/dest/wasm/circuits_wasm.js")),`../../resources/${ve}.wasm`):`${ve}.wasm`;class Ee{constructor(t){this.wasm=t}static get(){return this.instance||(this.instance=Ee.new()),this.instance}static async new(t=30,e=8192,r="wasm"){const n=new ae(await async function(t){if(u)return await(0,ce.readFile)(t);{const e=await fetch(t);return be.from(await e.arrayBuffer())}}(_e),(t=>({logstr(t){const e=`${n.getMemoryAsString(t)} (mem: ${(n.getMemory().length/1048576).toFixed(2)}MB)`;e.startsWith("abort: ")&&console.log(e),n.getLogger()(e)},memory:t.getRawMemory(),set_data:()=>{n.getLogger()("set_data: NYI")},get_data:()=>{throw new Error("NOT YET IMPLEMENTED - needed for proofs, plan is to use barretenberg.js from NPM for proofs. See https://github.com/AztecProtocol/aztec-packages/issues/781")}})),r);return await n.init(t,e),await Ee.initializeSrs(n),new Ee(n)}static async initializeSrs(t){const e=new we(5e4);await e.init();const r=t.call("bbmalloc",e.getG1Data().length);t.writeMemory(r,e.getG1Data());const n=t.call("bbmalloc",4);t.writeMemory(n,N(e.numPoints));const i=t.call("bbmalloc",e.getG2Data().length);t.writeMemory(i,e.getG2Data()),t.call("srs_init_srs",r,n,i),t.call("bbfree",r),t.call("bbfree",n),t.call("bbfree",i)}exports(){return this.wasm.exports()}getMemorySlice(t,e){return this.wasm.getMemorySlice(t,e)}writeMemory(t,e){this.wasm.writeMemory(t,e)}getMemoryAsString(t){return this.wasm.getMemoryAsString(t)}call(t,...e){return this.wasm.call(t,...e)}}r(816).Buffer;var Se=r(816).Buffer;function Te(t,e){return function(t,e){return t.call("pedersen__init"),Ht(t,"abis__hash_vk",e,32)}(e,Se.from(t,"hex"))}function Be({name:t}){return"constructor"===t}function Re({name:t,functionType:r}){return r!==e.UNCONSTRAINED&&!Be({name:t})}async function Ae(t,r,n,i){const o=t.functions.find(Be);if(!o)throw new Error("Cannot find constructor in the ABI.");if(!o.verificationKey)throw new Error("Missing verification key for the constructor.");const s=await Ee.get(),a=Te(o.verificationKey,s),c=_.fromBuffer(a),u=function(t,r){const n=t.filter(Re),i=[];for(let t=0;t<n.length;t++){const o=n[t],s=R(o.name,o.parameters),a=o.isInternal,c=o.functionType===e.SECRET,u=Te(o.verificationKey,r),f=Se.alloc(32,0),h=zt(r,new Ut(s,a,c,_.fromBuffer(u),_.fromBuffer(f)));i.push(h)}return i}(t.functions.map((t=>({...t,selector:R(t.name,t.parameters)}))),s),f=function(t,e){const r=function(t){const e=D.alloc(4);return e.writeUInt32BE(t.length,0),D.concat([e,...t])}(e.map((t=>t.toBuffer())));t.call("pedersen__init");const n=Ht(t,"abis__compute_function_tree_root",r,32);return _.fromBuffer(n)}(s,u),h=yt.fromAbi(o),l=I(o,r),d=function(t,e,r,n){t.call("pedersen__init");const i=qt(t,"abis__hash_constructor",[e.toBuffer(),r.toBuffer(),n],32);return _.fromBuffer(i)}(s,h,await Wt(s,l),c.toBuffer()),p=function(t,e,r,n){t.call("pedersen__init");const i=qt(t,"abis__compute_partial_contract_address",[e.toBuffer(),r.toBuffer(),n.toBuffer()],32);return _.fromBuffer(i)}(s,n,f,d),g=function(t,e,r,n,i){t.call("pedersen__init");const o=qt(t,"abis__compute_contract_address",[e.toBuffer(),r.toBuffer(),n.toBuffer(),i.toBuffer()],32);return new ht(o)}(s,i,n,f,d);return{address:g,partialAddress:p,constructorHash:c,functionTreeRoot:f,publicKey:i}}var Ce=r(816).Buffer;class Oe{constructor(t){if(this.value=t,32!=t.length)throw new Error(`Invalid private key length. Got ${t.length}, expected 32.`)}toString(){return this.value.toString("hex")}static fromString(t){if(t.startsWith("0x")&&(t=t.slice(2)),64!=t.length)throw new Error(`Invalid private key string length. Got ${t.length}, expected 64.`);return new Oe(Ce.from(t,"hex"))}static random(){return new Oe(l(32))}}function Le(t){return new Promise((e=>setTimeout(e,t)))}class xe{constructor(){this.start=(new Date).getTime()}ms(){return(new Date).getTime()-this.start}s(){return((new Date).getTime()-this.start)/1e3}}async function Ie(t,e="",r=0,n=1){const i=new xe;for(;;){const o=await t();if(o)return o;if(await Le(1e3*n),r&&i.s()>r)throw new Error(e?`Timeout awaiting ${e}`:"Timeout")}}var ke=r(816).Buffer;class Ne{constructor(t,e,r){this.functionSelector=t,this.isInternal=e,this.bytecode=r}toBuffer(){const t=ke.concat([M(this.bytecode.length),this.bytecode]);return $(this.functionSelector,this.isInternal,t)}static fromBuffer(t){const e=b.asReader(t),r=e.readBytes(4),n=e.readBoolean();return new Ne(r,n,e.readBuffer())}static random(){return new Ne(l(4),!1,l(64))}}class Me{constructor(t,e){if(this.contractData=t,this.publicFunctions=e,!e.length)throw Error("No public functions provided for ContractPublicData.");this.bytecode=function(t){const e=k.alloc(4);return e.writeUInt32BE(t.length,0),k.concat([e,...t])}(e.map((t=>t.toBuffer())))}toBuffer(){return $(this.contractData.toBuffer(),this.bytecode)}toString(){return this.toBuffer().toString("hex")}static fromBuffer(t){const e=b.asReader(t),r=e.readObject(Pe),n=e.readVector(Ne);return new Me(r,n)}static fromString(t){return Me.fromBuffer(ke.from(t,"hex"))}static random(){return new Me(Pe.random(),[Ne.random(),Ne.random()])}}class Pe{constructor(t,e){this.contractAddress=t,this.portalContractAddress=e}toBuffer(){return $(this.contractAddress,this.portalContractAddress.toBuffer20())}toString(){return this.toBuffer().toString("hex")}static fromBuffer(t){const e=b.asReader(t),r=ht.fromBuffer(e),n=new dt(e.readBytes(dt.SIZE_IN_BYTES));return new Pe(r,n)}static fromString(t){return Pe.fromBuffer(ke.from(t,"hex"))}static random(){return new Pe(ht.random(),dt.random())}}function De(){return{from:ht.ZERO,to:ht.ZERO,functionData:yt.empty(),args:[]}}r(816).Buffer;var Ue=r(816).Buffer;class Fe{static async new(){return new this(await Ee.get())}constructor(t){this.wasm=t}generator(){return Fe.generator}mul(t,e){return this.wasm.writeMemory(0,t.toBuffer()),this.wasm.writeMemory(64,e.value),this.wasm.call("ecc_grumpkin__mul",0,64,96),C.fromBuffer(Ue.from(this.wasm.getMemorySlice(96,160)))}batchMul(t,e){const r=Ue.concat(t.map((t=>t.toBuffer()))),n=t.length*C.SIZE_IN_BYTES,i=this.wasm.call("bbmalloc",2*n);this.wasm.writeMemory(i,r),this.wasm.writeMemory(0,e.value),this.wasm.call("ecc_grumpkin__batch_mul",i,0,t.length,i+n);const o=Ue.from(this.wasm.getMemorySlice(i+n,i+n+n));this.wasm.call("bbfree",i);const s=[];for(let t=0;t<n;t+=64)s.push(C.fromBuffer(o.slice(t,t+64)));return s}getRandomFr(){return this.wasm.call("ecc_grumpkin__get_random_scalar_mod_circuit_modulus",0),_.fromBuffer(Ue.from(this.wasm.getMemorySlice(0,32)))}reduce512BufferToFr(t){return this.wasm.writeMemory(0,t),this.wasm.call("ecc_grumpkin__reduce512_buffer_mod_circuit_modulus",0,64),_.fromBuffer(Ue.from(this.wasm.getMemorySlice(64,96)))}}function je(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function $e(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}Fe.generator=C.fromBuffer(Ue.from([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,2,207,19,94,117,6,164,93,99,45,39,13,69,241,24,18,148,131,63,196,141,130,63,39,44]));const He={number:je,bool:function(t){if("boolean"!=typeof t)throw new Error(`Expected boolean, not ${t}`)},bytes:$e,hash:function(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");je(t.outputLen),je(t.blockLen)},exists:function(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")},output:function(t,e){$e(t);const r=e.outputLen;if(t.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}},qe=He,ze="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,Ze=t=>t instanceof Uint8Array,Ve=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),We=(t,e)=>t<<32-e|t>>>e;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");function Ge(t){if("string"==typeof t&&(t=function(t){if("string"!=typeof t)throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array((new TextEncoder).encode(t))}(t)),!Ze(t))throw new Error("expected Uint8Array, got "+typeof t);return t}Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));class Ke{clone(){return this._cloneInto()}}function Ye(t){const e=e=>t().update(Ge(e)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function Je(t=32){if(ze&&"function"==typeof ze.getRandomValues)return ze.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class Xe extends Ke{constructor(t,e,r,n){super(),this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Ve(this.buffer)}update(t){qe.exists(this);const{view:e,buffer:r,blockLen:n}=this,i=(t=Ge(t)).length;for(let o=0;o<i;){const s=Math.min(n-this.pos,i-o);if(s!==n)r.set(t.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===n&&(this.process(e,0),this.pos=0);else{const e=Ve(t);for(;n<=i-o;o+=n)this.process(e,o)}}return this.length+=t.length,this.roundClean(),this}digestInto(t){qe.exists(this),qe.output(t,this),this.finished=!0;const{buffer:e,view:r,blockLen:n,isLE:i}=this;let{pos:o}=this;e[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>n-o&&(this.process(r,0),o=0);for(let t=o;t<n;t++)e[t]=0;!function(t,e,r,n){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,n);const i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),c=n?4:0,u=n?0:4;t.setUint32(e+c,s,n),t.setUint32(e+u,a,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);const s=Ve(t),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<c;t++)s.setUint32(4*t,u[t],i)}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:e,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return t.length=n,t.pos=s,t.finished=i,t.destroyed=o,n%e&&t.buffer.set(r),t}}const Qe=(t,e,r)=>t&e^t&r^e&r,tr=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),er=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),rr=new Uint32Array(64);class nr extends Xe{constructor(){super(64,32,8,!1),this.A=0|er[0],this.B=0|er[1],this.C=0|er[2],this.D=0|er[3],this.E=0|er[4],this.F=0|er[5],this.G=0|er[6],this.H=0|er[7]}get(){const{A:t,B:e,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[t,e,r,n,i,o,s,a]}set(t,e,r,n,i,o,s,a){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(t,e){for(let r=0;r<16;r++,e+=4)rr[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=rr[t-15],r=rr[t-2],n=We(e,7)^We(e,18)^e>>>3,i=We(r,17)^We(r,19)^r>>>10;rr[t]=i+rr[t-7]+n+rr[t-16]|0}let{A:r,B:n,C:i,D:o,E:s,F:a,G:c,H:u}=this;for(let t=0;t<64;t++){const e=u+(We(s,6)^We(s,11)^We(s,25))+((f=s)&a^~f&c)+tr[t]+rr[t]|0,h=(We(r,2)^We(r,13)^We(r,22))+Qe(r,n,i)|0;u=c,c=a,a=s,s=o+e|0,o=i,i=n,n=r,r=e+h|0}var f;r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,n,i,o,s,a,c,u)}roundClean(){rr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class ir extends nr{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const or=Ye((()=>new nr)),sr=(Ye((()=>new ir)),BigInt(0),BigInt(1)),ar=BigInt(2),cr=t=>t instanceof Uint8Array,ur=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function fr(t){if(!cr(t))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=ur[t[r]];return e}function hr(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);return BigInt(""===t?"0":`0x${t}`)}function lr(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);const e=t.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(e/2);for(let e=0;e<r.length;e++){const n=2*e,i=t.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");r[e]=o}return r}function dr(t){return hr(fr(t))}function pr(t){if(!cr(t))throw new Error("Uint8Array expected");return hr(fr(Uint8Array.from(t).reverse()))}function gr(t,e){return lr(t.toString(16).padStart(2*e,"0"))}function yr(t,e){return gr(t,e).reverse()}function mr(t,e,r){let n;if("string"==typeof e)try{n=lr(e)}catch(r){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${r}`)}else{if(!cr(e))throw new Error(`${t} must be hex string or Uint8Array`);n=Uint8Array.from(e)}const i=n.length;if("number"==typeof r&&i!==r)throw new Error(`${t} expected ${r} bytes, got ${i}`);return n}function wr(...t){const e=new Uint8Array(t.reduce(((t,e)=>t+e.length),0));let r=0;return t.forEach((t=>{if(!cr(t))throw new Error("Uint8Array expected");e.set(t,r),r+=t.length})),e}const br=t=>(ar<<BigInt(t-1))-sr,vr=t=>new Uint8Array(t),_r=t=>Uint8Array.from(t);function Er(t,e,r){if("number"!=typeof t||t<2)throw new Error("hashLen must be a number");if("number"!=typeof e||e<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let n=vr(t),i=vr(t),o=0;const s=()=>{n.fill(1),i.fill(0),o=0},a=(...t)=>r(i,n,...t),c=(t=vr())=>{i=a(_r([0]),t),n=a(),0!==t.length&&(i=a(_r([1]),t),n=a())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let t=0;const r=[];for(;t<e;){n=a();const e=n.slice();r.push(e),t+=n.length}return wr(...r)};return(t,e)=>{let r;for(s(),c(t);!(r=e(u()));)c();return s(),r}}const Sr={bigint:t=>"bigint"==typeof t,function:t=>"function"==typeof t,boolean:t=>"boolean"==typeof t,string:t=>"string"==typeof t,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>"function"==typeof t&&Number.isSafeInteger(t.outputLen)};function Tr(t,e,r={}){const n=(e,r,n)=>{const i=Sr[r];if("function"!=typeof i)throw new Error(`Invalid validator "${r}", expected function`);const o=t[e];if(!(n&&void 0===o||i(o,t)))throw new Error(`Invalid param ${String(e)}=${o} (${typeof o}), expected ${r}`)};for(const[t,r]of Object.entries(e))n(t,r,!1);for(const[t,e]of Object.entries(r))n(t,e,!0);return t}const Br=BigInt(0),Rr=BigInt(1),Ar=BigInt(2),Cr=BigInt(3),Or=BigInt(4),Lr=BigInt(5),xr=BigInt(8);function Ir(t,e){const r=t%e;return r>=Br?r:e+r}function kr(t,e,r){if(r<=Br||e<Br)throw new Error("Expected power/modulo > 0");if(r===Rr)return Br;let n=Rr;for(;e>Br;)e&Rr&&(n=n*t%r),t=t*t%r,e>>=Rr;return n}function Nr(t,e,r){let n=t;for(;e-- >Br;)n*=n,n%=r;return n}function Mr(t,e){if(t===Br||e<=Br)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=Ir(t,e),n=e,i=Br,o=Rr,s=Rr,a=Br;for(;r!==Br;){const t=n/r,e=n%r,c=i-s*t,u=o-a*t;n=r,r=e,i=s,o=a,s=c,a=u}if(n!==Rr)throw new Error("invert: does not exist");return Ir(i,e)}BigInt(9),BigInt(16);const Pr=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Dr(t,e){const r=void 0!==e?e:t.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}const Ur=BigInt(0),Fr=BigInt(1);function jr(t){return Tr(t.Fp,Pr.reduce(((t,e)=>(t[e]="function",t)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),Tr(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Dr(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}const{bytesToNumberBE:$r,hexToBytes:Hr}=o,qr={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(t){const{Err:e}=qr;if(t.length<2||2!==t[0])throw new e("Invalid signature integer tag");const r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(128&n[0])throw new e("Invalid signature integer: negative");if(0===n[0]&&!(128&n[1]))throw new e("Invalid signature integer: unnecessary leading zero");return{d:$r(n),l:t.subarray(r+2)}},toSig(t){const{Err:e}=qr,r="string"==typeof t?Hr(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||48!=r[0])throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");const{d:i,l:o}=qr._parseInt(r.subarray(2)),{d:s,l:a}=qr._parseInt(o);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s}},hexFromSig(t){const e=t=>8&Number.parseInt(t[0],16)?"00"+t:t,r=t=>{const e=t.toString(16);return 1&e.length?`0${e}`:e},n=e(r(t.s)),i=e(r(t.r)),o=n.length/2,s=i.length/2,a=r(o),c=r(s);return`30${r(s+o+4)}02${c}${i}02${a}${n}`}},zr=BigInt(0),Zr=BigInt(1),Vr=(BigInt(2),BigInt(3));function Wr(t){const e=function(t){const e=jr(t);return Tr(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}(t),{Fp:r,n}=e,i=r.BYTES+1,o=2*r.BYTES+1;function s(t){return Ir(t,n)}function a(t){return Mr(t,n)}const{ProjectivePoint:c,normPrivateKeyToScalar:u,weierstrassEquation:f,isWithinCurveOrder:h}=function(t){const e=function(t){const e=jr(t);Tr(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}(t),{Fp:r}=e,n=e.toBytes||((t,e,n)=>{const i=e.toAffine();return wr(Uint8Array.from([4]),r.toBytes(i.x),r.toBytes(i.y))}),i=e.fromBytes||(t=>{const e=t.subarray(1);return{x:r.fromBytes(e.subarray(0,r.BYTES)),y:r.fromBytes(e.subarray(r.BYTES,2*r.BYTES))}});function o(t){const{a:n,b:i}=e,o=r.sqr(t),s=r.mul(o,t);return r.add(r.add(s,r.mul(t,n)),i)}if(!r.eql(r.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function s(t){return"bigint"==typeof t&&zr<t&&t<e.n}function a(t){if(!s(t))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(t){const{allowedPrivateKeyLengths:r,nByteLength:n,wrapPrivateKey:i,n:o}=e;if(r&&"bigint"!=typeof t){if(t instanceof Uint8Array&&(t=fr(t)),"string"!=typeof t||!r.includes(t.length))throw new Error("Invalid key");t=t.padStart(2*n,"0")}let s;try{s="bigint"==typeof t?t:dr(mr("private key",t,n))}catch(e){throw new Error(`private key must be ${n} bytes, hex or bigint, not ${typeof t}`)}return i&&(s=Ir(s,o)),a(s),s}const u=new Map;function f(t){if(!(t instanceof h))throw new Error("ProjectivePoint expected")}class h{constructor(t,e,n){if(this.px=t,this.py=e,this.pz=n,null==t||!r.isValid(t))throw new Error("x required");if(null==e||!r.isValid(e))throw new Error("y required");if(null==n||!r.isValid(n))throw new Error("z required")}static fromAffine(t){const{x:e,y:n}=t||{};if(!t||!r.isValid(e)||!r.isValid(n))throw new Error("invalid affine point");if(t instanceof h)throw new Error("projective point not allowed");const i=t=>r.eql(t,r.ZERO);return i(e)&&i(n)?h.ZERO:new h(e,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(t){const e=r.invertBatch(t.map((t=>t.pz)));return t.map(((t,r)=>t.toAffine(e[r]))).map(h.fromAffine)}static fromHex(t){const e=h.fromAffine(i(mr("pointHex",t)));return e.assertValidity(),e}static fromPrivateKey(t){return h.BASE.multiply(c(t))}_setWindowSize(t){this._WINDOW_SIZE=t,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:t,y:n}=this.toAffine();if(!r.isValid(t)||!r.isValid(n))throw new Error("bad point: x or y not FE");const i=r.sqr(n),s=o(t);if(!r.eql(i,s))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:t}=this.toAffine();if(r.isOdd)return!r.isOdd(t);throw new Error("Field doesn't support isOdd")}equals(t){f(t);const{px:e,py:n,pz:i}=this,{px:o,py:s,pz:a}=t,c=r.eql(r.mul(e,a),r.mul(o,i)),u=r.eql(r.mul(n,a),r.mul(s,i));return c&&u}negate(){return new h(this.px,r.neg(this.py),this.pz)}double(){const{a:t,b:n}=e,i=r.mul(n,Vr),{px:o,py:s,pz:a}=this;let c=r.ZERO,u=r.ZERO,f=r.ZERO,l=r.mul(o,o),d=r.mul(s,s),p=r.mul(a,a),g=r.mul(o,s);return g=r.add(g,g),f=r.mul(o,a),f=r.add(f,f),c=r.mul(t,f),u=r.mul(i,p),u=r.add(c,u),c=r.sub(d,u),u=r.add(d,u),u=r.mul(c,u),c=r.mul(g,c),f=r.mul(i,f),p=r.mul(t,p),g=r.sub(l,p),g=r.mul(t,g),g=r.add(g,f),f=r.add(l,l),l=r.add(f,l),l=r.add(l,p),l=r.mul(l,g),u=r.add(u,l),p=r.mul(s,a),p=r.add(p,p),l=r.mul(p,g),c=r.sub(c,l),f=r.mul(p,d),f=r.add(f,f),f=r.add(f,f),new h(c,u,f)}add(t){f(t);const{px:n,py:i,pz:o}=this,{px:s,py:a,pz:c}=t;let u=r.ZERO,l=r.ZERO,d=r.ZERO;const p=e.a,g=r.mul(e.b,Vr);let y=r.mul(n,s),m=r.mul(i,a),w=r.mul(o,c),b=r.add(n,i),v=r.add(s,a);b=r.mul(b,v),v=r.add(y,m),b=r.sub(b,v),v=r.add(n,o);let _=r.add(s,c);return v=r.mul(v,_),_=r.add(y,w),v=r.sub(v,_),_=r.add(i,o),u=r.add(a,c),_=r.mul(_,u),u=r.add(m,w),_=r.sub(_,u),d=r.mul(p,v),u=r.mul(g,w),d=r.add(u,d),u=r.sub(m,d),d=r.add(m,d),l=r.mul(u,d),m=r.add(y,y),m=r.add(m,y),w=r.mul(p,w),v=r.mul(g,v),m=r.add(m,w),w=r.sub(y,w),w=r.mul(p,w),v=r.add(v,w),y=r.mul(m,v),l=r.add(l,y),y=r.mul(_,v),u=r.mul(b,u),u=r.sub(u,y),y=r.mul(b,m),d=r.mul(_,d),d=r.add(d,y),new h(u,l,d)}subtract(t){return this.add(t.negate())}is0(){return this.equals(h.ZERO)}wNAF(t){return d.wNAFCached(this,u,t,(t=>{const e=r.invertBatch(t.map((t=>t.pz)));return t.map(((t,r)=>t.toAffine(e[r]))).map(h.fromAffine)}))}multiplyUnsafe(t){const n=h.ZERO;if(t===zr)return n;if(a(t),t===Zr)return this;const{endo:i}=e;if(!i)return d.unsafeLadder(this,t);let{k1neg:o,k1:s,k2neg:c,k2:u}=i.splitScalar(t),f=n,l=n,p=this;for(;s>zr||u>zr;)s&Zr&&(f=f.add(p)),u&Zr&&(l=l.add(p)),p=p.double(),s>>=Zr,u>>=Zr;return o&&(f=f.negate()),c&&(l=l.negate()),l=new h(r.mul(l.px,i.beta),l.py,l.pz),f.add(l)}multiply(t){a(t);let n,i,o=t;const{endo:s}=e;if(s){const{k1neg:t,k1:e,k2neg:a,k2:c}=s.splitScalar(o);let{p:u,f}=this.wNAF(e),{p:l,f:p}=this.wNAF(c);u=d.constTimeNegate(t,u),l=d.constTimeNegate(a,l),l=new h(r.mul(l.px,s.beta),l.py,l.pz),n=u.add(l),i=f.add(p)}else{const{p:t,f:e}=this.wNAF(o);n=t,i=e}return h.normalizeZ([n,i])[0]}multiplyAndAddUnsafe(t,e,r){const n=h.BASE,i=(t,e)=>e!==zr&&e!==Zr&&t.equals(n)?t.multiply(e):t.multiplyUnsafe(e),o=i(this,e).add(i(t,r));return o.is0()?void 0:o}toAffine(t){const{px:e,py:n,pz:i}=this,o=this.is0();null==t&&(t=o?r.ONE:r.inv(i));const s=r.mul(e,t),a=r.mul(n,t),c=r.mul(i,t);if(o)return{x:r.ZERO,y:r.ZERO};if(!r.eql(c,r.ONE))throw new Error("invZ was invalid");return{x:s,y:a}}isTorsionFree(){const{h:t,isTorsionFree:r}=e;if(t===Zr)return!0;if(r)return r(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:t,clearCofactor:r}=e;return t===Zr?this:r?r(h,this):this.multiplyUnsafe(e.h)}toRawBytes(t=!0){return this.assertValidity(),n(h,this,t)}toHex(t=!0){return fr(this.toRawBytes(t))}}h.BASE=new h(e.Gx,e.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);const l=e.nBitLength,d=function(t,e){const r=(t,e)=>{const r=e.negate();return t?r:e},n=t=>({windows:Math.ceil(e/t)+1,windowSize:2**(t-1)});return{constTimeNegate:r,unsafeLadder(e,r){let n=t.ZERO,i=e;for(;r>Ur;)r&Fr&&(n=n.add(i)),i=i.double(),r>>=Fr;return n},precomputeWindow(t,e){const{windows:r,windowSize:i}=n(e),o=[];let s=t,a=s;for(let t=0;t<r;t++){a=s,o.push(a);for(let t=1;t<i;t++)a=a.add(s),o.push(a);s=a.double()}return o},wNAF(e,i,o){const{windows:s,windowSize:a}=n(e);let c=t.ZERO,u=t.BASE;const f=BigInt(2**e-1),h=2**e,l=BigInt(e);for(let t=0;t<s;t++){const e=t*a;let n=Number(o&f);o>>=l,n>a&&(n-=h,o+=Fr);const s=e,d=e+Math.abs(n)-1,p=t%2!=0,g=n<0;0===n?u=u.add(r(p,i[s])):c=c.add(r(g,i[d]))}return{p:c,f:u}},wNAFCached(t,e,r,n){const i=t._WINDOW_SIZE||1;let o=e.get(t);return o||(o=this.precomputeWindow(t,i),1!==i&&e.set(t,n(o))),this.wNAF(i,o,r)}}}(h,e.endo?Math.ceil(l/2):l);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:s}}({...e,toBytes(t,e,n){const i=e.toAffine(),o=r.toBytes(i.x),s=wr;return n?s(Uint8Array.from([e.hasEvenY()?2:3]),o):s(Uint8Array.from([4]),o,r.toBytes(i.y))},fromBytes(t){const e=t.length,n=t[0],s=t.subarray(1);if(e!==i||2!==n&&3!==n){if(e===o&&4===n)return{x:r.fromBytes(s.subarray(0,r.BYTES)),y:r.fromBytes(s.subarray(r.BYTES,2*r.BYTES))};throw new Error(`Point of length ${e} was invalid. Expected ${i} compressed bytes or ${o} uncompressed bytes`)}{const t=dr(s);if(!(zr<(a=t)&&a<r.ORDER))throw new Error("Point is not on curve");const e=f(t);let i=r.sqrt(e);return 1==(1&n)!=((i&Zr)===Zr)&&(i=r.neg(i)),{x:t,y:i}}var a}}),l=t=>fr(gr(t,e.nByteLength));function d(t){return t>n>>Zr}const p=(t,e,r)=>dr(t.slice(e,r));class g{constructor(t,e,r){this.r=t,this.s=e,this.recovery=r,this.assertValidity()}static fromCompact(t){const r=e.nByteLength;return t=mr("compactSignature",t,2*r),new g(p(t,0,r),p(t,r,2*r))}static fromDER(t){const{r:e,s:r}=qr.toSig(mr("DER",t));return new g(e,r)}assertValidity(){if(!h(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(t){return new g(this.r,this.s,t)}recoverPublicKey(t){const{r:n,s:i,recovery:o}=this,u=b(mr("msgHash",t));if(null==o||![0,1,2,3].includes(o))throw new Error("recovery id invalid");const f=2===o||3===o?n+e.n:n;if(f>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const h=0==(1&o)?"02":"03",d=c.fromHex(h+l(f)),p=a(f),g=s(-u*p),y=s(i*p),m=c.BASE.multiplyAndAddUnsafe(d,g,y);if(!m)throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return d(this.s)}normalizeS(){return this.hasHighS()?new g(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return lr(this.toDERHex())}toDERHex(){return qr.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return lr(this.toCompactHex())}toCompactHex(){return l(this.r)+l(this.s)}}const y={isValidPrivateKey(t){try{return u(t),!0}catch(t){return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const t=function(t,e,r=!1){const n=(t=mr("privateHash",t)).length,i=Dr(e).nByteLength+8;if(i<24||n<i||n>1024)throw new Error(`hashToPrivateScalar: expected ${i}-1024 bytes of input, got ${n}`);return Ir(r?pr(t):dr(t),e-Rr)+Rr}(e.randomBytes(r.BYTES+8),n);return gr(t,e.nByteLength)},precompute:(t=8,e=c.BASE)=>(e._setWindowSize(t),e.multiply(BigInt(3)),e)};function m(t){const e=t instanceof Uint8Array,r="string"==typeof t,n=(e||r)&&t.length;return e?n===i||n===o:r?n===2*i||n===2*o:t instanceof c}const w=e.bits2int||function(t){const r=dr(t),n=8*t.length-e.nBitLength;return n>0?r>>BigInt(n):r},b=e.bits2int_modN||function(t){return s(w(t))},v=br(e.nBitLength);function _(t){if("bigint"!=typeof t)throw new Error("bigint expected");if(!(zr<=t&&t<v))throw new Error(`bigint expected < 2^${e.nBitLength}`);return gr(t,e.nByteLength)}const E={lowS:e.lowS,prehash:!1},S={lowS:e.lowS,prehash:!1};return c.BASE._setWindowSize(8),{CURVE:e,getPublicKey:function(t,e=!0){return c.fromPrivateKey(t).toRawBytes(e)},getSharedSecret:function(t,e,r=!0){if(m(t))throw new Error("first arg must be private key");if(!m(e))throw new Error("second arg must be public key");return c.fromHex(e).multiply(u(t)).toRawBytes(r)},sign:function(t,n,i=E){const{seed:o,k2sig:f}=function(t,n,i=E){if(["recovered","canonical"].some((t=>t in i)))throw new Error("sign() legacy options not supported");const{hash:o,randomBytes:f}=e;let{lowS:l,prehash:p,extraEntropy:y}=i;null==l&&(l=!0),t=mr("msgHash",t),p&&(t=mr("prehashed msgHash",o(t)));const m=b(t),v=u(n),S=[_(v),_(m)];if(null!=y){const t=!0===y?f(r.BYTES):y;S.push(mr("extraEntropy",t,r.BYTES))}const T=wr(...S),B=m;return{seed:T,k2sig:function(t){const e=w(t);if(!h(e))return;const r=a(e),n=c.BASE.multiply(e).toAffine(),i=s(n.x);if(i===zr)return;const o=s(r*s(B+i*v));if(o===zr)return;let u=(n.x===i?0:2)|Number(n.y&Zr),f=o;return l&&d(o)&&(f=function(t){return d(t)?s(-t):t}(o),u^=1),new g(i,f,u)}}}(t,n,i),l=e;return Er(l.hash.outputLen,l.nByteLength,l.hmac)(o,f)},verify:function(t,r,n,i=S){const o=t;if(r=mr("msgHash",r),n=mr("publicKey",n),"strict"in i)throw new Error("options.strict was renamed to lowS");const{lowS:u,prehash:f}=i;let h,l;try{if("string"==typeof o||o instanceof Uint8Array)try{h=g.fromDER(o)}catch(t){if(!(t instanceof qr.Err))throw t;h=g.fromCompact(o)}else{if("object"!=typeof o||"bigint"!=typeof o.r||"bigint"!=typeof o.s)throw new Error("PARSE");{const{r:t,s:e}=o;h=new g(t,e)}}l=c.fromHex(n)}catch(t){if("PARSE"===t.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(u&&h.hasHighS())return!1;f&&(r=e.hash(r));const{r:d,s:p}=h,y=b(r),m=a(p),w=s(y*m),v=s(d*m),_=c.BASE.multiplyAndAddUnsafe(l,w,v)?.toAffine();return!!_&&s(_.x)===d},ProjectivePoint:c,Signature:g,utils:y}}BigInt(4);class Gr extends Ke{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,qe.hash(t);const r=Ge(e);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const n=this.blockLen,i=new Uint8Array(n);i.set(r.length>n?t.create().update(r).digest():r);for(let t=0;t<i.length;t++)i[t]^=54;this.iHash.update(i),this.oHash=t.create();for(let t=0;t<i.length;t++)i[t]^=106;this.oHash.update(i),i.fill(0)}update(t){return qe.exists(this),this.iHash.update(t),this}digestInto(t){qe.exists(this),qe.bytes(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:r,finished:n,destroyed:i,blockLen:o,outputLen:s}=this;return t.finished=n,t.destroyed=i,t.blockLen=o,t.outputLen=s,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Kr=(t,e,r)=>new Gr(t,e).update(r).digest();function Yr(t){return{hash:t,hmac:(e,...r)=>Kr(t,e,function(...t){const e=new Uint8Array(t.reduce(((t,e)=>t+e.length),0));let r=0;return t.forEach((t=>{if(!Ze(t))throw new Error("Uint8Array expected");e.set(t,r),r+=t.length})),e}(...r)),randomBytes:Je}}Kr.create=(t,e)=>new Gr(t,e);const Jr=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Xr=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Qr=BigInt(1),tn=BigInt(2),en=(t,e)=>(t+e/tn)/e;const rn=function(t,e,r=!1,n={}){if(t<=Br)throw new Error(`Expected Fp ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:o}=Dr(t,e);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const s=function(t){if(t%Or===Cr){const e=(t+Rr)/Or;return function(t,r){const n=t.pow(r,e);if(!t.eql(t.sqr(n),r))throw new Error("Cannot find square root");return n}}if(t%xr===Lr){const e=(t-Lr)/xr;return function(t,r){const n=t.mul(r,Ar),i=t.pow(n,e),o=t.mul(r,i),s=t.mul(t.mul(o,Ar),i),a=t.mul(o,t.sub(s,t.ONE));if(!t.eql(t.sqr(a),r))throw new Error("Cannot find square root");return a}}return function(t){const e=(t-Rr)/Ar;let r,n,i;for(r=t-Rr,n=0;r%Ar===Br;r/=Ar,n++);for(i=Ar;i<t&&kr(i,e,t)!==t-Rr;i++);if(1===n){const e=(t+Rr)/Or;return function(t,r){const n=t.pow(r,e);if(!t.eql(t.sqr(n),r))throw new Error("Cannot find square root");return n}}const o=(r+Rr)/Ar;return function(t,s){if(t.pow(s,e)===t.neg(t.ONE))throw new Error("Cannot find square root");let a=n,c=t.pow(t.mul(t.ONE,i),r),u=t.pow(s,o),f=t.pow(s,r);for(;!t.eql(f,t.ONE);){if(t.eql(f,t.ZERO))return t.ZERO;let e=1;for(let r=t.sqr(f);e<a&&!t.eql(r,t.ONE);e++)r=t.sqr(r);const r=t.pow(c,Rr<<BigInt(a-e-1));c=t.sqr(r),u=t.mul(u,r),f=t.mul(f,c),a=e}return u}}(t)}(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:o,MASK:br(i),ZERO:Br,ONE:Rr,create:e=>Ir(e,t),isValid:e=>{if("bigint"!=typeof e)throw new Error("Invalid field element: expected bigint, got "+typeof e);return Br<=e&&e<t},is0:t=>t===Br,isOdd:t=>(t&Rr)===Rr,neg:e=>Ir(-e,t),eql:(t,e)=>t===e,sqr:e=>Ir(e*e,t),add:(e,r)=>Ir(e+r,t),sub:(e,r)=>Ir(e-r,t),mul:(e,r)=>Ir(e*r,t),pow:(t,e)=>function(t,e,r){if(r<Br)throw new Error("Expected power > 0");if(r===Br)return t.ONE;if(r===Rr)return e;let n=t.ONE,i=e;for(;r>Br;)r&Rr&&(n=t.mul(n,i)),i=t.sqr(i),r>>=Rr;return n}(a,t,e),div:(e,r)=>Ir(e*Mr(r,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>Mr(e,t),sqrt:n.sqrt||(t=>s(a,t)),invertBatch:t=>function(t,e){const r=new Array(e.length),n=e.reduce(((e,n,i)=>t.is0(n)?e:(r[i]=e,t.mul(e,n))),t.ONE),i=t.inv(n);return e.reduceRight(((e,n,i)=>t.is0(n)?e:(r[i]=t.mul(e,r[i]),t.mul(e,n))),i),r}(a,t),cmov:(t,e,r)=>r?e:t,toBytes:t=>r?yr(t,o):gr(t,o),fromBytes:t=>{if(t.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${t.length}`);return r?pr(t):dr(t)}});return Object.freeze(a)}(Jr,void 0,void 0,{sqrt:function(t){const e=Jr,r=BigInt(3),n=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),c=BigInt(88),u=t*t*t%e,f=u*u*t%e,h=Nr(f,r,e)*f%e,l=Nr(h,r,e)*f%e,d=Nr(l,tn,e)*u%e,p=Nr(d,i,e)*d%e,g=Nr(p,o,e)*p%e,y=Nr(g,a,e)*g%e,m=Nr(y,c,e)*y%e,w=Nr(m,a,e)*g%e,b=Nr(w,r,e)*f%e,v=Nr(b,s,e)*p%e,_=Nr(v,n,e)*u%e,E=Nr(_,tn,e);if(!rn.eql(rn.sqr(E),t))throw new Error("Cannot find square root");return E}}),nn=function(t,e){const r=e=>Wr({...t,...Yr(e)});return Object.freeze({...r(e),create:r})}({a:BigInt(0),b:BigInt(7),Fp:rn,n:Xr,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=Xr,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-Qr*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,s=BigInt("0x100000000000000000000000000000000"),a=en(o*t,e),c=en(-n*t,e);let u=Ir(t-a*r-c*i,e),f=Ir(-a*n-c*o,e);const h=u>s,l=f>s;if(h&&(u=e-u),l&&(f=e-f),u>s||f>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:h,k1:u,k2neg:l,k2:f}}}},or);BigInt(0),nn.ProjectivePoint,r(6534),r(816).Buffer,r(816).Buffer;var on=r(816).Buffer;class sn{static async new(){return new this(await Ee.get())}constructor(t){this.wasm=t}generator(){return sn.generator}mul(t,e){return this.wasm.writeMemory(0,t),this.wasm.writeMemory(64,e),this.wasm.call("ecc_secp256k1__mul",0,64,96),on.from(this.wasm.getMemorySlice(96,160))}getRandomFr(){return this.wasm.call("ecc_secp256k1__get_random_scalar_mod_circuit_modulus",0),on.from(this.wasm.getMemorySlice(0,32))}reduce512BufferToFr(t){return this.wasm.writeMemory(0,t),this.wasm.call("ecc_secp256k1__reduce512_buffer_mod_circuit_modulus",0,64),on.from(this.wasm.getMemorySlice(64,96))}}sn.generator=on.from([121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184]);var an=r(816).Buffer;class cn{constructor(t){if(this.buffer=t,t.length!==cn.SIZE)throw new Error(`Invalid signature buffer of length ${t.length}.`)}static isSignature(t){return/^(0x)?[0-9a-f]{128}$/i.test(t)}static fromString(t){if(!cn.isSignature(t))throw new Error(`Invalid signature string: ${t}`);return new cn(an.from(t.replace(/^0x/i,""),"hex"))}static random(){return new cn(l(64))}get s(){return this.buffer.subarray(0,32)}get e(){return this.buffer.subarray(32)}toBuffer(){return this.buffer}static fromBuffer(t){const e=b.asReader(t);return new cn(e.readBytes(cn.SIZE))}toString(){return`0x${this.buffer.toString("hex")}`}toFields(){const t=this.toBuffer(),e=an.alloc(32),r=an.alloc(32),n=an.alloc(32);return t.copy(e,1,0,31),t.copy(r,1,31,62),t.copy(n,1,62,64),i=[e,r,n],o=_.fromBuffer,i.map(o);var i,o}}cn.SIZE=64,cn.EMPTY=new cn(an.alloc(64));var un=r(816).Buffer;class fn{static async new(){return new this(await Ee.get())}constructor(t){this.wasm=t}computePublicKey(t){return this.wasm.writeMemory(0,t.value),this.wasm.call("schnorr_compute_public_key",0,32),C.fromBuffer(un.from(this.wasm.getMemorySlice(32,96)))}constructSignature(t,e){const r=this.wasm.call("bbmalloc",t.length+4);return this.wasm.writeMemory(0,e.value),this.wasm.writeMemory(r,un.concat([N(t.length),t])),this.wasm.call("schnorr_construct_signature",r,0,32,64),new cn(un.from(this.wasm.getMemorySlice(32,96)))}verifySignature(t,e,r){const n=this.wasm.call("bbmalloc",t.length+4);this.wasm.writeMemory(0,e.toBuffer()),this.wasm.writeMemory(64,r.s),this.wasm.writeMemory(96,r.e),this.wasm.writeMemory(n,un.concat([N(t.length),t])),this.wasm.call("schnorr_verify_signature",n,0,64,96,128);const i=this.wasm.getMemorySlice(128,129);return!un.alloc(1,0).equals(i)}}function hn(t=1,e=void 0){return new H(dn(t),dn(t+1),dn(void 0!==e?e:t+2),dn(t+3))}function ln(t=1){return new tt(dn(t),t)}function dn(t){return new _(BigInt(t))}r(816).Buffer;var pn=r(8517),gn=r(816).Buffer;class yn{constructor(t){this.logs=t}toBuffer(){const t=this.logs.map((t=>P(t)));return P(gn.concat(t))}getSerializedLength(){return this.logs.reduce(((t,e)=>t+e.length+4),0)+4}hash(){const t=this.toBuffer().subarray(4);return T(t)}static fromBuffer(t,e=!0){const r=new b(t,0),n=e?r.readNumber():-1,i=r.readBufferArray(n);return new yn(i)}static random(t){const e=[];for(let r=0;r<t;r++)e.push((0,pn.randomBytes)(144));return new yn(e)}static empty(){return new yn([])}}var mn=r(816).Buffer;class wn{constructor(t){this.functionLogs=t}toBuffer(){const t=this.functionLogs.map((t=>t.toBuffer()));return P(mn.concat(t))}getSerializedLength(){return this.functionLogs.reduce(((t,e)=>t+e.getSerializedLength()),0)+4}addFunctionLogs(t){this.functionLogs.push(...t)}static fromBuffer(t,e=!0){const r=b.asReader(t),n=e?r.readNumber():-1,i=r.readBufferArray(n).map((t=>yn.fromBuffer(t,!1)));return new wn(i)}static random(t,e){const r=[];for(let n=0;n<t;n++)r.push(yn.random(e));return new wn(r)}}var bn=r(816).Buffer;class vn{constructor(t){this.txLogs=t}toBuffer(){const t=this.txLogs.map((t=>t.toBuffer()));return P(bn.concat(t))}getSerializedLength(){return this.txLogs.reduce(((t,e)=>t+e.getSerializedLength()),0)+4}static fromBuffer(t){const e=b.asReader(t),r=e.readNumber(),n=e.readBufferArray(r).map((t=>wn.fromBuffer(t,!1)));return new vn(n)}static random(t,e,r){const n=[];for(let i=0;i<t;i++)n.push(wn.random(e,r));return new vn(n)}static unrollLogs(t){const e=[];for(const r of t)for(const t of r.txLogs)for(const r of t.functionLogs)e.push(...r.logs);return e}}var _n=r(816).Buffer;class En{constructor(t,e,r,n,i,o,s,a,c,u,f,h,l,d,p,g,y,m,w,b,v,_,E,S,T,B,R=[],A,C){if(this.number=t,this.globalVariables=e,this.startPrivateDataTreeSnapshot=r,this.startNullifierTreeSnapshot=n,this.startContractTreeSnapshot=i,this.startTreeOfHistoricPrivateDataTreeRootsSnapshot=o,this.startTreeOfHistoricContractTreeRootsSnapshot=s,this.startPublicDataTreeRoot=a,this.startL1ToL2MessageTreeSnapshot=c,this.startTreeOfHistoricL1ToL2MessageTreeRootsSnapshot=u,this.startHistoricBlocksTreeSnapshot=f,this.endPrivateDataTreeSnapshot=h,this.endNullifierTreeSnapshot=l,this.endContractTreeSnapshot=d,this.endTreeOfHistoricPrivateDataTreeRootsSnapshot=p,this.endTreeOfHistoricContractTreeRootsSnapshot=g,this.endPublicDataTreeRoot=y,this.endL1ToL2MessageTreeSnapshot=m,this.endTreeOfHistoricL1ToL2MessageTreeRootsSnapshot=w,this.endHistoricBlocksTreeSnapshot=b,this.newCommitments=v,this.newNullifiers=_,this.newPublicDataWrites=E,this.newL2ToL1Msgs=S,this.newContracts=T,this.newContractData=B,this.newL1ToL2Messages=R,v.length%q!=0)throw new Error("The number of new commitments must be a multiple of 16.");A&&this.attachLogs(A,Sn.ENCRYPTED),C&&this.attachLogs(C,Sn.UNENCRYPTED)}static random(t,e=4,r=2,n=3,i=2,o=1){const s=st(z*e,_.random),a=st(q*e,_.random),c=st(1*e,_.random),u=st(1*e,Pe.random),f=st(8*e,Nn.random),h=st(16,_.random),l=st(2,_.random),d=vn.random(e,r,i),p=vn.random(e,n,o);return En.fromFields({number:t,globalVariables:hn(0,t),startPrivateDataTreeSnapshot:ln(0),startNullifierTreeSnapshot:ln(0),startContractTreeSnapshot:ln(0),startPublicDataTreeRoot:_.random(),startL1ToL2MessageTreeSnapshot:ln(0),startTreeOfHistoricL1ToL2MessageTreeRootsSnapshot:ln(0),startTreeOfHistoricPrivateDataTreeRootsSnapshot:ln(0),startTreeOfHistoricContractTreeRootsSnapshot:ln(0),startHistoricBlocksTreeSnapshot:ln(0),endPrivateDataTreeSnapshot:ln(a.length),endNullifierTreeSnapshot:ln(s.length),endContractTreeSnapshot:ln(c.length),endPublicDataTreeRoot:_.random(),endL1ToL2MessageTreeSnapshot:ln(1),endTreeOfHistoricL1ToL2MessageTreeRootsSnapshot:ln(1),endTreeOfHistoricPrivateDataTreeRootsSnapshot:ln(1),endTreeOfHistoricContractTreeRootsSnapshot:ln(1),endHistoricBlocksTreeSnapshot:ln(1),newCommitments:a,newNullifiers:s,newContracts:c,newContractData:u,newPublicDataWrites:f,newL1ToL2Messages:h,newL2ToL1Msgs:l,newEncryptedLogs:d,newUnencryptedLogs:p})}static fromFields(t){return new this(t.number,t.globalVariables,t.startPrivateDataTreeSnapshot,t.startNullifierTreeSnapshot,t.startContractTreeSnapshot,t.startTreeOfHistoricPrivateDataTreeRootsSnapshot,t.startTreeOfHistoricContractTreeRootsSnapshot,t.startPublicDataTreeRoot,t.startL1ToL2MessageTreeSnapshot,t.startTreeOfHistoricL1ToL2MessageTreeRootsSnapshot,t.startHistoricBlocksTreeSnapshot,t.endPrivateDataTreeSnapshot,t.endNullifierTreeSnapshot,t.endContractTreeSnapshot,t.endTreeOfHistoricPrivateDataTreeRootsSnapshot,t.endTreeOfHistoricContractTreeRootsSnapshot,t.endPublicDataTreeRoot,t.endL1ToL2MessageTreeSnapshot,t.endTreeOfHistoricL1ToL2MessageTreeRootsSnapshot,t.endHistoricBlocksTreeSnapshot,t.newCommitments,t.newNullifiers,t.newPublicDataWrites,t.newL2ToL1Msgs,t.newContracts,t.newContractData,t.newL1ToL2Messages,t.newEncryptedLogs,t.newUnencryptedLogs)}encode(){if(void 0===this.newEncryptedLogs||void 0===this.newUnencryptedLogs)throw new Error("newEncryptedLogs and newUnencryptedLogs must be defined when encoding L2BlockData");return $(this.globalVariables,this.startPrivateDataTreeSnapshot,this.startNullifierTreeSnapshot,this.startContractTreeSnapshot,this.startTreeOfHistoricPrivateDataTreeRootsSnapshot,this.startTreeOfHistoricContractTreeRootsSnapshot,this.startPublicDataTreeRoot,this.startL1ToL2MessageTreeSnapshot,this.startTreeOfHistoricL1ToL2MessageTreeRootsSnapshot,this.startHistoricBlocksTreeSnapshot,this.endPrivateDataTreeSnapshot,this.endNullifierTreeSnapshot,this.endContractTreeSnapshot,this.endTreeOfHistoricPrivateDataTreeRootsSnapshot,this.endTreeOfHistoricContractTreeRootsSnapshot,this.endPublicDataTreeRoot,this.endL1ToL2MessageTreeSnapshot,this.endTreeOfHistoricL1ToL2MessageTreeRootsSnapshot,this.endHistoricBlocksTreeSnapshot,this.newCommitments.length,this.newCommitments,this.newNullifiers.length,this.newNullifiers,this.newPublicDataWrites.length,this.newPublicDataWrites,this.newL2ToL1Msgs.length,this.newL2ToL1Msgs,this.newContracts.length,this.newContracts,this.newContractData,this.newL1ToL2Messages.length,this.newL1ToL2Messages,this.newEncryptedLogs,this.newUnencryptedLogs)}toBuffer(){return this.encode()}static decode(t){const e=b.asReader(t),r=e.readObject(H),n=Number(r.blockNumber.value),i=e.readObject(tt),o=e.readObject(tt),s=e.readObject(tt),a=e.readObject(tt),c=e.readObject(tt),u=e.readObject(_),f=e.readObject(tt),h=e.readObject(tt),l=e.readObject(tt),d=e.readObject(tt),p=e.readObject(tt),g=e.readObject(tt),y=e.readObject(tt),m=e.readObject(tt),w=e.readObject(_),v=e.readObject(tt),E=e.readObject(tt),S=e.readObject(tt),T=e.readVector(_),B=e.readVector(_),R=e.readVector(Nn),A=e.readVector(_),C=e.readVector(_),O=e.readArray(C.length,Pe),L=e.readVector(_),x=e.readObject(vn),I=e.readObject(vn);return En.fromFields({number:n,globalVariables:r,startPrivateDataTreeSnapshot:i,startNullifierTreeSnapshot:o,startContractTreeSnapshot:s,startTreeOfHistoricPrivateDataTreeRootsSnapshot:a,startTreeOfHistoricContractTreeRootsSnapshot:c,startPublicDataTreeRoot:u,startL1ToL2MessageTreeSnapshot:f,startTreeOfHistoricL1ToL2MessageTreeRootsSnapshot:h,startHistoricBlocksTreeSnapshot:l,endPrivateDataTreeSnapshot:d,endNullifierTreeSnapshot:p,endContractTreeSnapshot:g,endTreeOfHistoricPrivateDataTreeRootsSnapshot:y,endTreeOfHistoricContractTreeRootsSnapshot:m,endPublicDataTreeRoot:w,endL1ToL2MessageTreeSnapshot:v,endTreeOfHistoricL1ToL2MessageTreeRootsSnapshot:E,endHistoricBlocksTreeSnapshot:S,newCommitments:T,newNullifiers:B,newPublicDataWrites:R,newL2ToL1Msgs:A,newContracts:C,newContractData:O,newL1ToL2Messages:L,newEncryptedLogs:x,newUnencryptedLogs:I})}attachLogs(t,e){const r=e===Sn.ENCRYPTED?"newEncryptedLogs":"newUnencryptedLogs";if(this[r]){if(this[r]===t)return void En.logger(`${r} logs already attached`);throw new Error(`Trying to attach different ${r} logs to block ${this.number}.`)}En.logger(`Attaching ${r} logs`);const n=this.newCommitments.length/q;if(n!==t.txLogs.length)throw new Error(`Number of txLogs within ${r} does not match number of transactions. Expected: ${n} Got: ${t.txLogs.length}`);this[r]=t}getPublicInputsHash(){return t=$(this.globalVariables,this.startPrivateDataTreeSnapshot,this.startNullifierTreeSnapshot,this.startContractTreeSnapshot,this.startTreeOfHistoricPrivateDataTreeRootsSnapshot,this.startTreeOfHistoricContractTreeRootsSnapshot,this.startPublicDataTreeRoot,this.startL1ToL2MessageTreeSnapshot,this.startTreeOfHistoricL1ToL2MessageTreeRootsSnapshot,this.startHistoricBlocksTreeSnapshot,this.endPrivateDataTreeSnapshot,this.endNullifierTreeSnapshot,this.endContractTreeSnapshot,this.endTreeOfHistoricPrivateDataTreeRootsSnapshot,this.endTreeOfHistoricContractTreeRootsSnapshot,this.endPublicDataTreeRoot,this.endL1ToL2MessageTreeSnapshot,this.endTreeOfHistoricL1ToL2MessageTreeRootsSnapshot,this.endHistoricBlocksTreeSnapshot,this.getCalldataHash(),this.getL1ToL2MessagesHash()),_.fromBuffer(y(g(T(t))%_.MODULUS,32));var t}getStartStateHash(){const t=$(new _(this.number-1),this.startPrivateDataTreeSnapshot,this.startNullifierTreeSnapshot,this.startContractTreeSnapshot,this.startTreeOfHistoricPrivateDataTreeRootsSnapshot,this.startTreeOfHistoricContractTreeRootsSnapshot,this.startPublicDataTreeRoot,this.startL1ToL2MessageTreeSnapshot,this.startTreeOfHistoricL1ToL2MessageTreeRootsSnapshot,this.startHistoricBlocksTreeSnapshot);return T(t)}getEndStateHash(){const t=$(this.globalVariables.blockNumber,this.endPrivateDataTreeSnapshot,this.endNullifierTreeSnapshot,this.endContractTreeSnapshot,this.endTreeOfHistoricPrivateDataTreeRootsSnapshot,this.endTreeOfHistoricContractTreeRootsSnapshot,this.endPublicDataTreeRoot,this.endL1ToL2MessageTreeSnapshot,this.endTreeOfHistoricL1ToL2MessageTreeRootsSnapshot,this.endHistoricBlocksTreeSnapshot);return T(t)}getCalldataHash(){if(void 0===this.newEncryptedLogs)throw new Error('Encrypted logs has to be attached before calling "getCalldataHash"');if(void 0===this.newUnencryptedLogs)throw new Error('Unencrypted logs has to be attached before calling "getCalldataHash"');const t=this.newCommitments.length/32,e=[];for(let r=0;r<t;r++){const t=32,n=32,i=16,o=4,s=_n.concat(this.newCommitments.slice(r*t,(r+1)*t).map((t=>t.toBuffer()))),a=_n.concat(this.newNullifiers.slice(r*n,(r+1)*n).map((t=>t.toBuffer()))),c=_n.concat(this.newPublicDataWrites.slice(r*i,(r+1)*i).map((t=>t.toBuffer()))),u=_n.concat(this.newL2ToL1Msgs.slice(r*o,(r+1)*o).map((t=>t.toBuffer()))),f=En.computeKernelLogsHash(this.newEncryptedLogs.txLogs[2*r]),h=En.computeKernelLogsHash(this.newEncryptedLogs.txLogs[2*r+1]),l=En.computeKernelLogsHash(this.newUnencryptedLogs.txLogs[2*r]),d=En.computeKernelLogsHash(this.newUnencryptedLogs.txLogs[2*r+1]),p=_n.concat([s,a,c,u,this.newContracts[2*r].toBuffer(),this.newContracts[2*r+1].toBuffer(),this.newContractData[2*r].contractAddress.toBuffer(),this.newContractData[2*r].portalContractAddress.toBuffer32(),this.newContractData[2*r+1].contractAddress.toBuffer(),this.newContractData[2*r+1].portalContractAddress.toBuffer32(),f,h,l,d]);e.push(T(p))}return(t=>{const e=[t];let r=0;for(;e[r].length>1;){const t=[],n=e[r].length;for(let i=0;i<n;i+=2){const n=e[r][i],o=e[r][i+1];t.push(T(_n.concat([n,o])))}e.push(t),r++}return e[e.length-1][0]})(e)}getL1ToL2MessagesHash(){const t=_n.concat(this.newL1ToL2Messages.map((t=>t.toBuffer())));return T(t)}getTx(t){const e=Math.floor(this.newCommitments.length/q);if(t>=e)throw new Error(`Failed to get tx ${t}. Block ${this.globalVariables.blockNumber} only has ${e} txs.`);const r=this.newCommitments.slice(q*t,q*(t+1)),n=this.newNullifiers.slice(z*t,z*(t+1)),i=this.newPublicDataWrites.slice(8*t,8*(t+1)),o=this.newL2ToL1Msgs.slice(2*t,2*(t+1)),s=this.newContracts.slice(1*t,1*(t+1)),a=this.newContractData.slice(1*t,1*(t+1));return new An(r,n,i,o,s,a)}inspect(t=4){const e=e=>`0x${e.toBuffer().subarray(0,t).toString("hex")}`,r=(t,e)=>"["+t.map(e).join(", ")+"]",n=t=>`(${t.nextAvailableLeafIndex}, ${e(t.root)})`,i=t=>r(t,e),o=t=>r(t,(t=>`(${e(t.leafIndex)}, ${e(t.newValue)})`));return["L2Block",`number: ${this.number}`,"globalVariables: "+(a=this.globalVariables,`(${a.chainId}, ${a.version}, ${a.blockNumber}, ${a.timestamp}))`),`startPrivateDataTreeSnapshot: ${n(this.startPrivateDataTreeSnapshot)}`,`startNullifierTreeSnapshot: ${n(this.startNullifierTreeSnapshot)}`,`startContractTreeSnapshot: ${n(this.startContractTreeSnapshot)}`,`startTreeOfHistoricPrivateDataTreeRootsSnapshot: ${n(this.startTreeOfHistoricPrivateDataTreeRootsSnapshot)}`,`startTreeOfHistoricContractTreeRootsSnapshot: ${n(this.startTreeOfHistoricContractTreeRootsSnapshot)}`,`startPublicDataTreeRoot: ${this.startPublicDataTreeRoot.toString()}`,`startL1ToL2MessageTreeSnapshot: ${n(this.startL1ToL2MessageTreeSnapshot)}`,`startTreeOfHistoricL1ToL2MessageTreeRootsSnapshot: ${n(this.startTreeOfHistoricL1ToL2MessageTreeRootsSnapshot)}`,`startHistoricBlocksTreeSnapshot: ${n(this.startHistoricBlocksTreeSnapshot)}`,`endPrivateDataTreeSnapshot: ${n(this.endPrivateDataTreeSnapshot)}`,`endNullifierTreeSnapshot: ${n(this.endNullifierTreeSnapshot)}`,`endContractTreeSnapshot: ${n(this.endContractTreeSnapshot)}`,`endPublicDataTreeRoot: ${this.endPublicDataTreeRoot.toString()}`,`endTreeOfHistoricPrivateDataTreeRootsSnapshot: ${n(this.endTreeOfHistoricPrivateDataTreeRootsSnapshot)}`,`endTreeOfHistoricContractTreeRootsSnapshot: ${n(this.endTreeOfHistoricContractTreeRootsSnapshot)}`,`endPublicDataTreeRoot: ${this.endPublicDataTreeRoot.toString()}`,`endL1ToL2MessageTreeSnapshot: ${n(this.endL1ToL2MessageTreeSnapshot)}`,`endTreeOfHistoricL1ToL2MessageTreeRootsSnapshot: ${n(this.endTreeOfHistoricL1ToL2MessageTreeRootsSnapshot)}`,`endHistoricBlocksTreeSnapshot: ${n(this.endHistoricBlocksTreeSnapshot)}`,`newCommitments: ${i(this.newCommitments)}`,`newNullifiers: ${i(this.newNullifiers)}`,`newPublicDataWrite: ${o(this.newPublicDataWrites)}`,`newL2ToL1Msgs: ${i(this.newL2ToL1Msgs)}`,`newContracts: ${i(this.newContracts)}`,`newContractData: ${s=this.newContractData,r(s,(t=>`(${e(t.contractAddress)}, ${e(t.portalContractAddress)})`))}`,`newPublicDataWrite: ${o(this.newPublicDataWrites)}`,`newL1ToL2Messages: ${i(this.newL1ToL2Messages)}`].join("\n");var s,a}static computeKernelLogsHash(t){const e=[_n.alloc(32),_n.alloc(32)];let r=_n.alloc(32);for(const n of t.functionLogs)e[0]=r,e[1]=n.hash(),r=T(_n.concat(e));return r}}En.logger=re("aztec:l2_block"),re("aztec:l2_block_downloader");var Sn,Tn,Bn=r(816).Buffer;class Rn{constructor(t){this.buffer=t,X(this,"buffer",Rn.SIZE)}equals(t){return this.buffer.equals(t.buffer)}isZero(){return this.buffer.equals(Bn.alloc(32,0))}toString(){return this.buffer.toString("hex")}toBigInt(){return function(t,e=0,r=32){return{elem:g(t.subarray(e,e+r)),adv:r}}(this.buffer,0,Rn.SIZE).elem}static fromBigInt(t){return new Rn(function(t,e=32){return y(t,e)}(t,Rn.SIZE))}static fromBuffer28(t){if(28!=t.length)throw new Error("Expected TxHash input buffer to be 28 bytes");const e=Bn.concat([Bn.alloc(this.SIZE-28),t]);return new Rn(e)}static fromString(t){return new Rn(Bn.from(t,"hex"))}}Rn.SIZE=32,Rn.ZERO=new Rn(Bn.alloc(Rn.SIZE));class An{constructor(t,e,r,n,i,o){this.newCommitments=t,this.newNullifiers=e,this.newPublicDataWrites=r,this.newL2ToL1Msgs=n,this.newContracts=i,this.newContractData=o,this.txHash=new Rn(this.newNullifiers[0].toBuffer())}}!function(t){t[t.ENCRYPTED=0]="ENCRYPTED",t[t.UNENCRYPTED=1]="UNENCRYPTED"}(Sn||(Sn={})),r(1240),r(816).Buffer,function(t){t[t.CONTRACT_TREE=0]="CONTRACT_TREE",t[t.CONTRACT_TREE_ROOTS_TREE=1]="CONTRACT_TREE_ROOTS_TREE",t[t.NULLIFIER_TREE=2]="NULLIFIER_TREE",t[t.PRIVATE_DATA_TREE=3]="PRIVATE_DATA_TREE",t[t.PRIVATE_DATA_TREE_ROOTS_TREE=4]="PRIVATE_DATA_TREE_ROOTS_TREE",t[t.PUBLIC_DATA_TREE=5]="PUBLIC_DATA_TREE",t[t.L1_TO_L2_MESSAGES_TREE=6]="L1_TO_L2_MESSAGES_TREE",t[t.L1_TO_L2_MESSAGES_ROOTS_TREE=7]="L1_TO_L2_MESSAGES_ROOTS_TREE",t[t.BLOCKS_TREE=8]="BLOCKS_TREE"}(Tn||(Tn={}));var Cn=r(816).Buffer;class On{constructor(t,e,r,n,i,o){if(this.data=t,this.proof=e,this.encryptedLogs=r,this.unencryptedLogs=n,this.newContractPublicFunctions=i,this.enqueuedPublicFunctionCalls=o,this.unencryptedLogs.functionLogs.length<this.encryptedLogs.functionLogs.length)throw new Error(`Number of function logs in unencrypted logs (${this.unencryptedLogs.functionLogs.length}) has to be equal\n or larger than number function logs in encrypted logs (${this.encryptedLogs.functionLogs.length})`);const s=t?.end.publicCallStack&&(a=t.end.publicCallStack,c=t=>t.isZero(),a.reduce(((t,e)=>c(e)?t:t+1),0));var a,c;if(s&&s>(o?.length??0))throw new Error(`Missing preimages for enqueued public function calls in kernel circuit public inputs (expected\n ${s}, got ${o?.length})`)}static fromBuffer(t){const e=b.asReader(t);return new On(e.readObject(Lt),e.readObject(Ot),e.readObject(wn),e.readObject(wn),e.readArray(e.readNumber(),Ne),e.readArray(8,Gt))}toBuffer(){return $([this.data,this.proof,this.encryptedLogs,this.unencryptedLogs,N(this.newContractPublicFunctions.length),this.newContractPublicFunctions,this.enqueuedPublicFunctionCalls])}toJSON(){return{data:this.data.toBuffer().toString("hex"),encryptedLogs:this.encryptedLogs.toBuffer().toString("hex"),unencryptedLogs:this.unencryptedLogs.toBuffer().toString("hex"),proof:this.proof.toBuffer().toString("hex"),newContractPublicFunctions:this.newContractPublicFunctions.map((t=>t.toBuffer().toString("hex")))??[],enqueuedPublicFunctions:this.enqueuedPublicFunctionCalls.map((t=>t.toBuffer().toString("hex")))??[]}}static fromJSON(t){const e=Lt.fromBuffer(Cn.from(t.data,"hex")),r=wn.fromBuffer(Cn.from(t.encryptedLogs,"hex")),n=wn.fromBuffer(Cn.from(t.unencryptedLogs,"hex")),i=Cn.from(t.proof,"hex"),o=t.newContractPublicFunctions?t.newContractPublicFunctions.map((t=>Ne.fromBuffer(Cn.from(t,"hex")))):[],s=t.enqueuedPublicFunctions?t.enqueuedPublicFunctions.map((t=>Gt.fromBuffer(Cn.from(t,"hex")))):[];return new On(e,Ot.fromBuffer(i),r,n,o,s)}getTxHash(){const t=this.data?.end.newNullifiers[0];if(!t)throw new Error("Cannot get tx hash since first nullifier is missing");return Promise.resolve(new Rn(t.toBuffer()))}static async getHashes(t){return await Promise.all(t.map((t=>t.getTxHash())))}static clone(t){const e=Lt.fromBuffer(t.data.toBuffer()),r=Ot.fromBuffer(t.proof.toBuffer()),n=wn.fromBuffer(t.encryptedLogs.toBuffer()),i=wn.fromBuffer(t.unencryptedLogs.toBuffer()),o=t.newContractPublicFunctions.map((t=>Ne.fromBuffer(t.toBuffer()))),s=t.enqueuedPublicFunctionCalls.map((t=>Gt.fromBuffer(t.toBuffer())));return new On(e,r,n,i,o,s)}}class Ln{constructor(t,e,r){this.tx=t,this.partialContractAddress=e,this.contractAddress=r}toJSON(){return{tx:this.tx.toJSON(),partialContractAddress:this.partialContractAddress.toBuffer().toString(),contractAddress:this.contractAddress.toBuffer().toString()}}static fromJSON(t){return new Ln(On.fromJSON(t.tx),_.fromBuffer(Cn.from(t.partialContractAddress,"hex")),ht.fromBuffer(Cn.from(t.contractAddress,"hex")))}}var xn,In=r(816).Buffer;!function(t){t.DROPPED="dropped",t.MINED="mined",t.PENDING="pending"}(xn||(xn={}));class kn{constructor(t,e,r,n,i,o,s){this.txHash=t,this.status=e,this.error=r,this.blockHash=n,this.blockNumber=i,this.origin=o,this.contractAddress=s}toJSON(){return{txHash:this.txHash.toString(),status:this.status.toString(),error:this.error,blockHash:this.blockHash?.toString("hex"),blockNumber:this.blockNumber,origin:this.origin?.toString(),contractAddress:this.contractAddress?.toString()}}static fromJSON(t){const e=Rn.fromString(t.txHash),r=t.status,n=t.error,i=t.blockHash?In.from(t.blockHash,"hex"):void 0,o=t.blockNumber?Number(t.blockNumber):void 0,s=t.origin?ht.fromString(t.origin):void 0,a=t.contractAddress?ht.fromString(t.contractAddress):void 0;return new kn(e,r,n,i,o,s,a)}}r(816).Buffer;class Nn{constructor(t,e){this.leafIndex=t,this.newValue=e}static from(t){return new Nn(t.leafIndex,t.newValue)}toBuffer(){return $(this.leafIndex,this.newValue)}isEmpty(){return this.leafIndex.isZero()&&this.newValue.isZero()}static fromBuffer(t){const e=b.asReader(t);return new Nn(e.readFr(),e.readFr())}static empty(){return new Nn(_.ZERO,_.ZERO)}static random(){return new Nn(_.random(),_.random())}}class Mn{constructor(t,e){this.args=t,this.hash=e}static getFields(t){return[t.args,t.hash]}static from(t){return new Mn(...Mn.getFields(t))}static async fromArgs(t,e){return new Mn(t,await Wt(e,t))}toBuffer(){return $(new at(this.args),this.hash)}static fromBuffer(t){const e=b.asReader(t);return new Mn(e.readVector(_),e.readFr())}}var Pn=r(816).Buffer;class Dn{constructor(t,e,r,n,i){this.origin=t,this.functionData=e,this.argsHash=r,this.txContext=n,this.packedArguments=i}toTxRequest(){return new Dt(this.origin,this.functionData,this.argsHash,this.txContext)}static getFields(t){return[t.origin,t.functionData,t.argsHash,t.txContext,t.packedArguments]}static from(t){return new Dn(...Dn.getFields(t))}toBuffer(){return $(this.origin,this.functionData,this.argsHash,this.txContext,new at(this.packedArguments))}toString(){return this.toBuffer().toString("hex")}static fromBuffer(t){const e=b.asReader(t);return new Dn(e.readObject(ht),e.readObject(yt),e.readFr(),e.readObject(Tt),e.readVector(Mn))}static fromString(t){return Dn.fromBuffer(Pn.from(t,"hex"))}}r(816).Buffer;class Un{constructor(t,e){this.arc=t,this.txHashPromise=e}async getTxHash(){return await this.txHashPromise}async getReceipt(){const t=await this.getTxHash();return await this.arc.getTxReceipt(t)}async wait(t){const e=await this.waitForReceipt(t);if(e.status!==xn.MINED)throw new Error(`Transaction ${await this.getTxHash()} was ${e.status}`);return e}async isMined(t){return(await this.waitForReceipt(t)).status===xn.MINED}async waitForReceipt(t){const e=await this.getTxHash();return await Ie((async()=>{const t=await this.arc.getTxReceipt(e);return t.status!=xn.PENDING?t:void 0}),"isMined",t?.timeout??0,t?.interval??1)}}class Fn{constructor(t,e,r,n){if(this.wallet=t,this.contractAddress=e,this.functionDao=r,this.args=n,n.some((t=>null==t)))throw new Error("All function interaction arguments must be defined and not null. Received: "+n)}async create(t={}){if(this.functionDao.functionType===e.UNCONSTRAINED)throw new Error("Can't call `create` on an unconstrained function.");if(!this.txRequest){const e=this.getExecutionRequest(this.contractAddress,t.origin),r=await this.wallet.getNodeInfo(),n=Tt.empty(new _(r.chainId),new _(r.version)),i=await this.wallet.createAuthenticatedTxRequest([e],n);this.txRequest=i}return this.txRequest}async simulate(t={}){const e=this.txRequest??await this.create(t);return this.tx=await this.wallet.simulateTx(e),this.tx}request(t={}){return this.getExecutionRequest(this.contractAddress,t.origin)}getExecutionRequest(t,e){const r=I(this.functionDao,this.args);return e=e??this.wallet.getAddress(),{args:r,functionData:yt.fromAbi(this.functionDao),to:t,from:e}}send(t={}){if(this.functionDao.functionType===e.UNCONSTRAINED)throw new Error("Can't call `send` on an unconstrained function.");const r=(async()=>{const e=this.tx??await this.simulate(t);return this.wallet.sendTx(e)})();return new Un(this.wallet,r)}view(t={}){if(this.functionDao.functionType!==e.UNCONSTRAINED)throw new Error("Can only call `view` on an unconstrained function.");const{from:r}=t;return this.wallet.viewTx(this.functionDao.name,this.args,this.contractAddress,r)}}class jn{constructor(t,e,r){this.address=t,this.abi=e,this.wallet=r,this.methods={},e.functions.forEach((t=>{this.methods[t.name]=Object.assign(((...e)=>new Fn(this.wallet,this.address,t,e)),{get selector(){return R(t.name,t.parameters)}})}))}attach(t,e=[]){const r={abi:this.abi,address:this.address,portalContract:t};return this.wallet.addContracts([r,...e])}}class $n extends jn{static async create(t,e,r){if(!await r.isContractDeployed(t))throw new Error("Contract "+t.toString()+" is not deployed");return new $n(t,e,r)}}class Hn{constructor(t){this.rpc=t}addAccount(t,e,r){return this.rpc.addAccount(t,e,r)}addPublicKeyAndPartialAddress(t,e,r){return this.rpc.addPublicKeyAndPartialAddress(t,e,r)}getAccounts(){return this.rpc.getAccounts()}getPublicKey(t){return this.rpc.getPublicKey(t)}addContracts(t){return this.rpc.addContracts(t)}isContractDeployed(t){return this.rpc.isContractDeployed(t)}simulateTx(t){return this.rpc.simulateTx(t)}sendTx(t){return this.rpc.sendTx(t)}getTxReceipt(t){return this.rpc.getTxReceipt(t)}getPreimagesAt(t,e){return this.rpc.getPreimagesAt(t,e)}getPublicStorageAt(t,e){return this.rpc.getPublicStorageAt(t,e)}viewTx(t,e,r,n){return this.rpc.viewTx(t,e,r,n)}getContractData(t){return this.rpc.getContractData(t)}getContractInfo(t){return this.rpc.getContractInfo(t)}getUnencryptedLogs(t,e){return this.rpc.getUnencryptedLogs(t,e)}getBlockNum(){return this.rpc.getBlockNum()}getNodeInfo(){return this.rpc.getNodeInfo()}getPublicKeyAndPartialAddress(t){return this.rpc.getPublicKeyAndPartialAddress(t)}isSynchronised(){return this.rpc.isSynchronised()}isAccountSynchronised(t){return this.rpc.isAccountSynchronised(t)}}class qn extends Hn{constructor(t,e){super(t),this.accountImpl=e}getAddress(){return this.accountImpl.getAddress()}createAuthenticatedTxRequest(t,e){return this.accountImpl.createAuthenticatedTxRequest(t,e)}}class zn extends Un{constructor(t,e,r){super(e,r),this.abi=t}async deployed(t){return(await this.wait(t)).contract}async wait(t){const e=await super.wait(t),r=await this.getContractInstance(t?.wallet,e.contractAddress);return{...e,contract:r}}getContractInstance(t,e){const r=t??(!!this.arc.createAuthenticatedTxRequest&&this.arc);if(!r)throw new Error("A wallet is required for creating a contract instance");if(!e)throw new Error("Contract address is missing from transaction receipt");return $n.create(e,this.abi,r)}}class Zn extends Hn{getAddress(){return ht.ZERO}async createAuthenticatedTxRequest(t,e){if(1!==t.length)throw new Error(`Deployer wallet can only run one execution at a time (requested ${t.length})`);const[r]=t,n=await Ee.get(),i=await Mn.fromArgs(r.args,n);return Promise.resolve(new Dn(r.to,r.functionData,i.hash,e,[i]))}}class Vn extends Fn{constructor(t,e,r,n=[]){const i=r.functions.find((t=>"constructor"===t.name));if(!i)throw new Error("Cannot find constructor in the ABI.");super(new Zn(e),ht.ZERO,i,n),this.publicKey=t,this.arc=e,this.abi=r,this.partialContractAddress=void 0,this.completeContractAddress=void 0}async create(t={}){const e=t.portalContract??dt.ZERO,r=t.contractAddressSalt??_.random(),{chainId:n,version:i}=await this.wallet.getNodeInfo(),{address:o,constructorHash:s,functionTreeRoot:a,partialAddress:c}=await Ae(this.abi,this.args,r,this.publicKey),u=new St(this.publicKey,s,a,r,e),f=new Tt(!1,!1,!0,u,new _(n),new _(i)),h=this.getExecutionRequest(o,ht.ZERO),l=await this.wallet.createAuthenticatedTxRequest([h],f);return this.txRequest=l,this.partialContractAddress=c,this.completeContractAddress=o,await this.wallet.addContracts([{abi:this.abi,address:o,portalContract:e}]),this.txRequest}send(t={}){const e=super.send(t).getTxHash();return new zn(this.abi,this.arc,e)}async simulate(t){const e=this.txRequest??await this.create(t);return this.tx=await this.wallet.simulateTx(e),this.tx}async getContract(t){if(!this.completeContractAddress)throw new Error("Cannot get a contract instance for a contract not yet deployed");return await $n.create(this.completeContractAddress,this.abi,t)}}class Wn{constructor(t,e,r){this.abi=t,this.arc=e,this.publicKey=r}deploy(...t){return new Vn(this.publicKey??C.ZERO,this.arc,this.abi,t)}}async function Gn(t){return function(t,e){t.call("pedersen__init");const r=Ht(t,"abis__compute_message_secret_hash",e,32);return _.fromBuffer(r)}(await Ee.get(),t)}async function Kn(t,e,r,n=_.random(),i=1,o=re("aztec:aztec.js:accounts")){const s=new bi;for(let a=0;a<i;++a){const i=0==a&&r?r:Oe.random(),c=await Jn(i),u=await Ae(e,[],n,c);await t.addAccount(i,u.address,u.partialAddress);const f=new Wn(e,t,c).deploy().send({contractAddressSalt:n});await f.isMined({interval:.5});const h=await f.getReceipt();if(h.status!==xn.MINED)throw new Error(`Deployment tx not mined (status is ${h.status})`);const l=h.contractAddress;if(!l.equals(u.address))throw new Error(`Deployment address does not match for account contract (expected ${u.address.toString()} got ${l.toString()})`);o(`Created account ${l.toString()} with public key ${c.toString()}`),s.registerAccount(l,new yi(l,u.partialAddress,i,await fn.new()))}return new qn(t,s)}async function Yn(t,e,r,n){const i=new bi,o=await Jn(r),s=await Ae(e,[],n,o),a=s.address;return i.registerAccount(a,new yi(a,s.partialAddress,r,await fn.new())),new qn(t,i)}async function Jn(t){const e=await Fe.new();return e.mul(e.generator(),t)}const Xn=async t=>{const e=new URL(`${t}/api/l1-contract-addresses`),r=await Ie((async()=>{try{return await(await fetch(e.toString())).json()}catch(t){}}),"isSandboxReady",120,1);return Object.fromEntries(Object.entries(r).map((([t,e])=>[t,dt.fromString(e)])))},Qn=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);function ti(t,e){if(!t)throw new Error(e)}class ei{constructor(t,e){if(this.toClass=new Map,this.toName=new Map,t)for(const e of Object.keys(t))this.register(e,t[e],"string");if(e)for(const t of Object.keys(e))this.register(t,e[t],"object")}register(t,e,r){ti("Buffer"!==t,"'Buffer' handling is hardcoded. Cannot use as name."),ti(Qn(e.prototype,"toString")||Qn(e.prototype,"toJSON"),`Class ${t} must define a toString() OR toJSON() method.`),ti(e.fromString||e.fromJSON,`Class ${t} must define a fromString() OR fromJSON() static method.`),this.toName.set(e,[t,r]),this.toClass.set(t,[e,r])}isRegisteredClassName(t){return this.toClass.has(t)}isRegisteredClass(t){return this.toName.has(t)}toClassObj(t){const e=this.toClass.get(t.type);ti(e,"Could not find type in lookup.");const[r,n]=e;return"string"===n&&"string"==typeof t.data?r.fromString(t.data):r.fromJSON(t.data)}toJsonObj(t){const e=this.toName.get(t.constructor);ti(e,"Could not find class in lookup.");const[r,n]=e;return{type:r,data:"string"===n?t.toString():t.toJSON()}}}function ri(t,e){return JSON.stringify(t,((t,e)=>"bigint"==typeof e?JSON.stringify({type:"bigint",data:e.toString()}):e),e?2:0)}function ni(t,e){if(null!==e){if(!e)return e;if("Buffer"===e.type&&"string"==typeof e.data)return jt.Buffer.from(e.data,"base64");if("bigint"===e.type&&"string"==typeof e.data)return BigInt(e.data);if("string"==typeof e.type&&t.isRegisteredClassName(e.type))return t.toClassObj(e);if(Array.isArray(e))return e.map((e=>ni(t,e)));if(e.constructor===Object){const r={};for(const n of Object.keys(e))r[n]=ni(t,e[n]);return r}return e}}function ii(t,e){if(!e)return e;if(e instanceof jt.Buffer)return{type:"Buffer",data:e.toString("base64")};if("bigint"==typeof e)return{type:"bigint",data:e.toString()};if(t.isRegisteredClass(e.constructor))return t.toJsonObj(e);if(Array.isArray(e))return e.map((e=>ii(t,e)));if(e.constructor===Object){const r={};for(const n of Object.keys(e))r[n]=ii(t,e[n]);return r}return e}const oi=re("json-rpc:json_rpc_client");async function si(t,e,r,n){let i;if(oi("JsonRpcClient.fetch",t,e,"->",r),i=n?await fetch(`${t}/${e}`,{method:"POST",body:ri(r),headers:{"content-type":"application/json"}}):await fetch(t,{method:"POST",body:ri({...r,method:e}),headers:{"content-type":"application/json"}}),!i.ok)throw new Error(i.statusText);try{return await i.json()}catch(t){throw new Error(`Failed to parse body as JSON: ${i.text()}`)}}async function ai(t,e,r,n){return await async function(t,e="Operation",r=function*(){const t=[1,1,1,2,4,8,16,32,64];let e=0;for(;;)yield t[Math.min(e++,t.length-1)]}(),n=re("aztec:foundation:retry")){for(;;)try{return await t()}catch(t){const i=r.next().value;if(void 0===i)throw t;n(`${e} failed. Will retry in ${i}s...`),n(t),await Le(1e3*i);continue}}((()=>si(t,e,r,n)),"JsonRpcClient request")}function ci(t,e,r,n,i=si){const o=new ei(e,r);let s=0;const a=async(e,r)=>{const a={jsonrpc:"2.0",id:s++,method:e,params:r.map((t=>ii(o,t)))};oi("JsonRpcClient.request",e,"<-",r);const c=await i(t,e,a,n);if(oi("JsonRpcClient.result",e,"->",c),c.error)throw c.error;if(![null,void 0,"null","undefined"].includes(c.result))return ni(o,c.result)};return new Proxy({},{get:(t,e)=>["then","catch"].includes(e)?Reflect.get(t,e):(...t)=>(oi("JsonRpcClient.constructor","proxy",e,"<-",t),a(e,t))})}const ui=(t,e=si)=>ci(t,{AztecAddress:ht,TxExecutionRequest:Dn,ContractData:Pe,ContractPublicData:Me,TxHash:Rn,EthAddress:dt,Point:C,PrivateKey:Oe,Fr:_},{Tx:On,ContractDeploymentTx:Ln,TxReceipt:kn},!1,e);var fi=r(107),hi=r.n(fi);const li=JSON.parse('{"w":[{"name":"constructor","functionType":"secret","isInternal":false,"parameters":[],"returnTypes":[]},{"name":"entrypoint","functionType":"secret","isInternal":false,"parameters":[{"name":"payload","type":{"kind":"struct","fields":[{"name":"flattened_args_hashes","type":{"kind":"array","length":4,"type":{"kind":"field"}}},{"name":"flattened_selectors","type":{"kind":"array","length":4,"type":{"kind":"field"}}},{"name":"flattened_targets","type":{"kind":"array","length":4,"type":{"kind":"field"}}},{"name":"nonce","type":{"kind":"field"}}]},"visibility":"public"},{"name":"owner","type":{"kind":"array","length":64,"type":{"kind":"integer","sign":"unsigned","width":8}},"visibility":"public"},{"name":"signature","type":{"kind":"array","length":64,"type":{"kind":"integer","sign":"unsigned","width":8}},"visibility":"public"},{"name":"partial_address","type":{"kind":"field"},"visibility":"public"}],"returnTypes":[]}]}');var di=r(816).Buffer;async function pi(t,e){const r=_.random(),n=[...xt(t,De(),2),...xt(e,De(),2)],i=[],o=await Ee.get();for(const t of n)i.push(await Mn.fromArgs(t.args,o));return{payload:{flattened_args_hashes:i.map((t=>t.hash)),flattened_selectors:n.map((t=>_.fromBuffer(t.functionData.functionSelectorBuffer))),flattened_targets:n.map((t=>t.to.toField())),nonce:r},packedArguments:i}}function gi(t){return T(di.concat(function(t){return[...t.flattened_args_hashes,...t.flattened_selectors,...t.flattened_targets,t.nonce]}(t).map((t=>t.toBuffer()))))}class yi{constructor(t,e,r,n){this.address=t,this.partialContractAddress=e,this.privateKey=r,this.signer=n}getAddress(){return this.address}async createAuthenticatedTxRequest(t,e){this.checkSender(t),this.checkIsNotDeployment(e);const[r,n]=hi()(t,(t=>t.functionData.isPrivate)),i=await Ee.get(),{payload:o,packedArguments:s}=await pi(r,n),a=gi(o),c=this.signer.constructSignature(a,this.privateKey).toBuffer(),u=[o,(await Jn(this.privateKey)).toBuffer(),c,this.partialContractAddress],f=this.getEntrypointAbi(),h=await Mn.fromArgs(I(f,u),i);return Dn.from({argsHash:h.hash,origin:this.address,functionData:yt.fromAbi(f),txContext:e,packedArguments:[...s,h]})}getEntrypointAbi(){const t=li.w.find((t=>"entrypoint"===t.name));if(!t)throw new Error("Entrypoint abi for account contract not found");return t}checkIsNotDeployment(t){if(t.isContractDeploymentTx)throw new Error("Cannot yet deploy contracts from an account contract")}checkSender(t){const e=t.find((t=>!t.from.equals(this.address)));if(e)throw new Error(`Sender ${e.from.toString()} does not match account address ${this.address.toString()}`)}}const mi=JSON.parse('{"w":[{"name":"compute_note_hash_and_nullifier","functionType":"unconstrained","isInternal":false,"parameters":[{"name":"contract_address","type":{"kind":"field"},"visibility":"private"},{"name":"nonce","type":{"kind":"field"},"visibility":"private"},{"name":"storage_slot","type":{"kind":"field"},"visibility":"private"},{"name":"preimage","type":{"kind":"array","length":5,"type":{"kind":"field"}},"visibility":"private"}],"returnTypes":[{"kind":"array","length":4,"type":{"kind":"field"}}]},{"name":"constructor","functionType":"secret","isInternal":false,"parameters":[{"name":"signing_pub_key_x","type":{"kind":"array","length":32,"type":{"kind":"integer","sign":"unsigned","width":8}},"visibility":"public"},{"name":"signing_pub_key_y","type":{"kind":"array","length":32,"type":{"kind":"integer","sign":"unsigned","width":8}},"visibility":"public"}],"returnTypes":[]},{"name":"entrypoint","functionType":"secret","isInternal":false,"parameters":[{"name":"payload","type":{"kind":"struct","fields":[{"name":"flattened_args_hashes","type":{"kind":"array","length":4,"type":{"kind":"field"}}},{"name":"flattened_selectors","type":{"kind":"array","length":4,"type":{"kind":"field"}}},{"name":"flattened_targets","type":{"kind":"array","length":4,"type":{"kind":"field"}}},{"name":"nonce","type":{"kind":"field"}}]},"visibility":"public"},{"name":"signature","type":{"kind":"array","length":64,"type":{"kind":"integer","sign":"unsigned","width":8}},"visibility":"public"}],"returnTypes":[]}]}');class wi{constructor(t,e,r){this.address=t,this.privateKey=e,this.signer=r,this.log=re("aztec:client:accounts:stored_key")}getAddress(){return this.address}async createAuthenticatedTxRequest(t,e){this.checkSender(t),this.checkIsNotDeployment(e);const[r,n]=hi()(t,(t=>t.functionData.isPrivate)),i=await Ee.get(),{payload:o,packedArguments:s}=await pi(r,n),a=gi(o),c=this.signer.constructSignature(a,this.privateKey).toBuffer();this.log(`Signed challenge ${a.toString("hex")} as ${c.toString("hex")}`);const u=[o,c],f=this.getEntrypointAbi(),h=await Mn.fromArgs(I(f,u),i);return Dn.from({argsHash:h.hash,origin:this.address,functionData:yt.fromAbi(f),txContext:e,packedArguments:[...s,h]})}getEntrypointAbi(){const t=mi.w.find((t=>"entrypoint"===t.name));if(!t)throw new Error("Entrypoint abi for account contract not found");return t}checkIsNotDeployment(t){if(t.isContractDeploymentTx)throw new Error("Cannot yet deploy contracts from an account contract")}checkSender(t){const e=t.find((t=>!t.from.equals(this.address)));if(e)throw new Error(`Sender ${e.from.toString()} does not match account address ${this.address.toString()}`)}}class bi{constructor(){this.accounts=new Map}registerAccount(t,e){this.accounts.set(t.toString(),e)}getAddress(){if(!this.accounts)throw new Error("No accounts registered");return ht.fromString(this.accounts.keys().next().value)}createAuthenticatedTxRequest(t,e){const r=t[0].from,n=this.accounts.get(r.toString());if(!n)throw new Error(`No account implementation registered for ${r}`);return n.createAuthenticatedTxRequest(t,e)}}})();var i=n.LJ,o=n.bG,s=n.xz,a=n.cC,c=n.CH,u=n.xq,f=n.vp,h=n.Ag,l=n.W_,d=n.g2,p=n.v4,g=n.Y8,y=n.jF,m=n.Fr,w=n.$h,b=n.pP,v=n.E9,_=n._q,E=n.a5,S=n.x6,T=n.Xo,B=n.Tx,R=n.qd,A=n.f1,C=n.EY,O=n.bH,L=n.qx,x=n.ig,I=n._$,k=n.g$,N=n.W$,M=n.ir,P=n.CF,D=n.nW,U=n.kw;export{i as AccountCollection,o as AccountWallet,s as AztecAddress,a as BaseWallet,c as Contract,u as ContractBase,f as ContractData,h as ContractDeployer,l as ContractDeploymentTx,d as ContractFunctionInteraction,p as ContractPublicData,g as DeployMethod,y as EthAddress,m as Fr,w as L2BlockL2Logs,b as PackedArguments,v as Point,_ as PrivateKey,E as SentTx,S as SingleKeyAccountContract,T as StoredKeyAccountContract,B as Tx,R as TxExecutionRequest,A as TxHash,C as TxReceipt,O as TxStatus,L as computeMessageSecretHash,x as createAccounts,I as createAztecRpcClient,k as createDebugLogger,N as emptyExecutionRequest,M as generatePublicKey,P as getAccountWallet,D as getL1ContractAddresses,U as mustSucceedFetch};
2
+ var t={4782:(t,e)=>{e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=a(t),s=o[0],c=o[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,c)),f=0,h=c>0?s-4:s;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[f++]=e>>16&255,u[f++]=e>>8&255,u[f++]=255&e;return 2===c&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[f++]=255&e),1===c&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(c(t,a,a+s>u?u:a+s));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<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(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,n){for(var i,o,s=[],a=e;a<n;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[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},238:(t,e,r)=>{var n=r(7172).Buffer;function i(t){n.isBuffer(t)||(t=n.from(t));for(var e=t.length/4|0,r=new Array(e),i=0;i<e;i++)r[i]=t.readUInt32BE(4*i);return r}function o(t){for(;0<t.length;t++)t[0]=0}function s(t,e,r,n,i){for(var o,s,a,c,u=r[0],f=r[1],h=r[2],l=r[3],d=t[0]^e[0],p=t[1]^e[1],g=t[2]^e[2],y=t[3]^e[3],m=4,b=1;b<i;b++)o=u[d>>>24]^f[p>>>16&255]^h[g>>>8&255]^l[255&y]^e[m++],s=u[p>>>24]^f[g>>>16&255]^h[y>>>8&255]^l[255&d]^e[m++],a=u[g>>>24]^f[y>>>16&255]^h[d>>>8&255]^l[255&p]^e[m++],c=u[y>>>24]^f[d>>>16&255]^h[p>>>8&255]^l[255&g]^e[m++],d=o,p=s,g=a,y=c;return o=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[g>>>8&255]<<8|n[255&y])^e[m++],s=(n[p>>>24]<<24|n[g>>>16&255]<<16|n[y>>>8&255]<<8|n[255&d])^e[m++],a=(n[g>>>24]<<24|n[y>>>16&255]<<16|n[d>>>8&255]<<8|n[255&p])^e[m++],c=(n[y>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[255&g])^e[m++],[o>>>=0,s>>>=0,a>>>=0,c>>>=0]}var a=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],s=0,a=0,c=0;c<256;++c){var u=a^a<<1^a<<2^a<<3^a<<4;u=u>>>8^255&u^99,r[s]=u,n[u]=s;var f=t[s],h=t[f],l=t[h],d=257*t[u]^16843008*u;i[0][s]=d<<24|d>>>8,i[1][s]=d<<16|d>>>16,i[2][s]=d<<8|d>>>24,i[3][s]=d,d=16843009*l^65537*h^257*f^16843008*s,o[0][u]=d<<24|d>>>8,o[1][u]=d<<16|d>>>16,o[2][u]=d<<8|d>>>24,o[3][u]=d,0===s?s=a=1:(s=f^t[t[t[l^f]]],a^=t[t[a]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function u(t){this._key=i(t),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,n=4*(r+1),i=[],o=0;o<e;o++)i[o]=t[o];for(o=e;o<n;o++){var s=i[o-1];o%e==0?(s=s<<8|s>>>24,s=c.SBOX[s>>>24]<<24|c.SBOX[s>>>16&255]<<16|c.SBOX[s>>>8&255]<<8|c.SBOX[255&s],s^=a[o/e|0]<<24):e>6&&o%e==4&&(s=c.SBOX[s>>>24]<<24|c.SBOX[s>>>16&255]<<16|c.SBOX[s>>>8&255]<<8|c.SBOX[255&s]),i[o]=i[o-e]^s}for(var u=[],f=0;f<n;f++){var h=n-f,l=i[h-(f%4?0:4)];u[f]=f<4||h<=4?l:c.INV_SUB_MIX[0][c.SBOX[l>>>24]]^c.INV_SUB_MIX[1][c.SBOX[l>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[l>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&l]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=u},u.prototype.encryptBlockRaw=function(t){return s(t=i(t),this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},u.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=n.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},u.prototype.decryptBlock=function(t){var e=(t=i(t))[1];t[1]=t[3],t[3]=e;var r=s(t,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},u.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=u},8587:(t,e,r)=>{var n=r(238),i=r(7172).Buffer,o=r(3081),s=r(87),a=r(1219),c=r(7752),u=r(3480);function f(t,e,r,s){o.call(this);var c=i.alloc(4,0);this._cipher=new n.AES(e);var f=this._cipher.encryptBlock(c);this._ghash=new a(f),r=function(t,e,r){if(12===e.length)return t._finID=i.concat([e,i.from([0,0,0,1])]),i.concat([e,i.from([0,0,0,2])]);var n=new a(r),o=e.length,s=o%16;n.update(e),s&&(s=16-s,n.update(i.alloc(s,0))),n.update(i.alloc(8,0));var c=8*o,f=i.alloc(8);f.writeUIntBE(c,0,8),n.update(f),t._finID=n.state;var h=i.from(t._finID);return u(h),h}(this,r,f),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}s(f,o),f.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=i.alloc(e,0),this._ghash.update(e))}this._called=!0;var r=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(r),this._len+=t.length,r},f.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=c(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(t,e){var r=0;t.length!==e.length&&r++;for(var n=Math.min(t.length,e.length),i=0;i<n;++i)r+=t[i]^e[i];return r}(t,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=t,this._cipher.scrub()},f.prototype.getAuthTag=function(){if(this._decrypt||!i.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},f.prototype.setAuthTag=function(t){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=t},f.prototype.setAAD=function(t){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length},t.exports=f},8901:(t,e,r)=>{var n=r(3615),i=r(2576),o=r(4636);e.createCipher=e.Cipher=n.createCipher,e.createCipheriv=e.Cipheriv=n.createCipheriv,e.createDecipher=e.Decipher=i.createDecipher,e.createDecipheriv=e.Decipheriv=i.createDecipheriv,e.listCiphers=e.getCiphers=function(){return Object.keys(o)}},2576:(t,e,r)=>{var n=r(8587),i=r(7172).Buffer,o=r(3834),s=r(2385),a=r(3081),c=r(238),u=r(5883);function f(t,e,r){a.call(this),this._cache=new h,this._last=void 0,this._cipher=new c.AES(e),this._prev=i.from(r),this._mode=t,this._autopadding=!0}function h(){this.cache=i.allocUnsafe(0)}function l(t,e,r){var a=o[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof e&&(e=i.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);return"stream"===a.type?new s(a.module,e,r,!0):"auth"===a.type?new n(a.module,e,r,!0):new f(a.module,e,r)}r(87)(f,a),f.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,e),n.push(r);return i.concat(n)},f.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");for(var r=-1;++r<e;)if(t[r+(16-e)]!==e)throw new Error("unable to decrypt data");if(16!==e)return t.slice(0,16-e)}(this._mode.decrypt(this,t));if(t)throw new Error("data not multiple of block length")},f.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},h.prototype.add=function(t){this.cache=i.concat([this.cache,t])},h.prototype.get=function(t){var e;if(t){if(this.cache.length>16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},h.prototype.flush=function(){if(this.cache.length)return this.cache},e.createDecipher=function(t,e){var r=o[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=u(e,!1,r.key,r.iv);return l(t,n.key,n.iv)},e.createDecipheriv=l},3615:(t,e,r)=>{var n=r(3834),i=r(8587),o=r(7172).Buffer,s=r(2385),a=r(3081),c=r(238),u=r(5883);function f(t,e,r){a.call(this),this._cache=new l,this._cipher=new c.AES(e),this._prev=o.from(r),this._mode=t,this._autopadding=!0}r(87)(f,a),f.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get();)r=this._mode.encrypt(this,e),n.push(r);return o.concat(n)};var h=o.alloc(16,16);function l(){this.cache=o.allocUnsafe(0)}function d(t,e,r){var a=n[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=o.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===a.type?new s(a.module,e,r):"auth"===a.type?new i(a.module,e,r):new f(a.module,e,r)}f.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(h))throw this._cipher.scrub(),new Error("data not multiple of block length")},f.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},l.prototype.add=function(t){this.cache=o.concat([this.cache,t])},l.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},l.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),r=-1;++r<t;)e.writeUInt8(t,r);return o.concat([this.cache,e])},e.createCipheriv=d,e.createCipher=function(t,e){var r=n[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=u(e,!1,r.key,r.iv);return d(t,i.key,i.iv)}},1219:(t,e,r)=>{var n=r(7172).Buffer,i=n.alloc(16,0);function o(t){var e=n.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function s(t){this.h=t,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}s.prototype.ghash=function(t){for(var e=-1;++e<t.length;)this.state[e]^=t[e];this._multiply()},s.prototype._multiply=function(){for(var t,e,r,n=[(t=this.h).readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)],i=[0,0,0,0],s=-1;++s<128;){for(0!=(this.state[~~(s/8)]&1<<7-s%8)&&(i[0]^=n[0],i[1]^=n[1],i[2]^=n[2],i[3]^=n[3]),r=0!=(1&n[3]),e=3;e>0;e--)n[e]=n[e]>>>1|(1&n[e-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},s.prototype.update=function(t){var e;for(this.cache=n.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},s.prototype.final=function(t,e){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,t,0,e])),this.state},t.exports=s},3480:t=>{t.exports=function(t){for(var e,r=t.length;r--;){if(255!==(e=t.readUInt8(r))){e++,t.writeUInt8(e,r);break}t.writeUInt8(0,r)}}},6280:(t,e,r)=>{var n=r(7752);e.encrypt=function(t,e){var r=n(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev},e.decrypt=function(t,e){var r=t._prev;t._prev=e;var i=t._cipher.decryptBlock(e);return n(i,r)}},392:(t,e,r)=>{var n=r(7172).Buffer,i=r(7752);function o(t,e,r){var o=e.length,s=i(e,t._cache);return t._cache=t._cache.slice(o),t._prev=n.concat([t._prev,r?e:s]),s}e.encrypt=function(t,e,r){for(var i,s=n.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=n.allocUnsafe(0)),!(t._cache.length<=e.length)){s=n.concat([s,o(t,e,r)]);break}i=t._cache.length,s=n.concat([s,o(t,e.slice(0,i),r)]),e=e.slice(i)}return s}},5739:(t,e,r)=>{var n=r(7172).Buffer;function i(t,e,r){for(var n,i,s=-1,a=0;++s<8;)n=e&1<<7-s?128:0,a+=(128&(i=t._cipher.encryptBlock(t._prev)[0]^n))>>s%8,t._prev=o(t._prev,r?n:i);return a}function o(t,e){var r=t.length,i=-1,o=n.allocUnsafe(t.length);for(t=n.concat([t,n.from([e])]);++i<r;)o[i]=t[i]<<1|t[i+1]>>7;return o}e.encrypt=function(t,e,r){for(var o=e.length,s=n.allocUnsafe(o),a=-1;++a<o;)s[a]=i(t,e[a],r);return s}},2228:(t,e,r)=>{var n=r(7172).Buffer;function i(t,e,r){var i=t._cipher.encryptBlock(t._prev)[0]^e;return t._prev=n.concat([t._prev.slice(1),n.from([r?e:i])]),i}e.encrypt=function(t,e,r){for(var o=e.length,s=n.allocUnsafe(o),a=-1;++a<o;)s[a]=i(t,e[a],r);return s}},2751:(t,e,r)=>{var n=r(7752),i=r(7172).Buffer,o=r(3480);function s(t){var e=t._cipher.encryptBlockRaw(t._prev);return o(t._prev),e}e.encrypt=function(t,e){var r=Math.ceil(e.length/16),o=t._cache.length;t._cache=i.concat([t._cache,i.allocUnsafe(16*r)]);for(var a=0;a<r;a++){var c=s(t),u=o+16*a;t._cache.writeUInt32BE(c[0],u+0),t._cache.writeUInt32BE(c[1],u+4),t._cache.writeUInt32BE(c[2],u+8),t._cache.writeUInt32BE(c[3],u+12)}var f=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),n(e,f)}},2437:(t,e)=>{e.encrypt=function(t,e){return t._cipher.encryptBlock(e)},e.decrypt=function(t,e){return t._cipher.decryptBlock(e)}},3834:(t,e,r)=>{var n={ECB:r(2437),CBC:r(6280),CFB:r(392),CFB8:r(2228),CFB1:r(5739),OFB:r(8428),CTR:r(2751),GCM:r(2751)},i=r(4636);for(var o in i)i[o].module=n[i[o].mode];t.exports=i},8428:(t,e,r)=>{var n=r(816).Buffer,i=r(7752);function o(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}e.encrypt=function(t,e){for(;t._cache.length<e.length;)t._cache=n.concat([t._cache,o(t)]);var r=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),i(e,r)}},2385:(t,e,r)=>{var n=r(238),i=r(7172).Buffer,o=r(3081);function s(t,e,r,s){o.call(this),this._cipher=new n.AES(e),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._mode=t}r(87)(s,o),s.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)},s.prototype._final=function(){this._cipher.scrub()},t.exports=s},1240:(t,e,r)=>{r(5681),r(8901),r(3834),r(1035),r(5883)},5681:(t,e,r)=>{var n=r(3081),i=r(7191),o=r(87),s=r(7172).Buffer,a={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function c(t){n.call(this);var e,r=t.mode.toLowerCase(),i=a[r];e=t.decrypt?"decrypt":"encrypt";var o=t.key;s.isBuffer(o)||(o=s.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=s.concat([o,o.slice(0,8)]));var c=t.iv;s.isBuffer(c)||(c=s.from(c)),this._des=i.create({key:o,iv:c,type:e})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],t.exports=c,o(c,n),c.prototype._update=function(t){return s.from(this._des.update(t))},c.prototype._final=function(){return s.from(this._des.final())}},1035:(t,e)=>{e["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}},7752:(t,e,r)=>{var n=r(816).Buffer;t.exports=function(t,e){for(var r=Math.min(t.length,e.length),i=new n(r),o=0;o<r;++o)i[o]=t[o]^e[o];return i}},816:(t,e,r)=>{const n=r(4782),i=r(8898),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|g(t,e);let n=a(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(K(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return l(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(K(t,ArrayBuffer)||t&&K(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(K(t,SharedArrayBuffer)||t&&K(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return c.from(n,e,r);const i=function(t){if(c.isBuffer(t)){const e=0|p(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Y(t.length)?a(0):l(t):"Buffer"===t.type&&Array.isArray(t.data)?l(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return f(t),a(t<0?0:0|p(t))}function l(t){const e=t.length<0?0:0|p(t.length),r=a(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function d(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,c.prototype),n}function p(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function g(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||K(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return V(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(t).length;default:if(i)return n?-1:V(t).length;e=(""+e).toLowerCase(),i=!0}}function y(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return L(this,e,r);case"utf8":case"utf-8":return C(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return O(this,e,r);case"base64":return B(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:w(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):w(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(t,e,r,n,i){let o,s=1,a=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;o<a;o++)if(u(t,o)===u(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===c)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+c>a&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;n<c;n++)if(u(t,o+n)!==u(e,n)){r=!1;break}if(r)return o}return-1}function _(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(e.substr(2*s,2),16);if(Y(n))return s;t[r+s]=n}return s}function v(t,e,r,n){return G(V(e,t.length-r),t,r,n)}function S(t,e,r,n){return G(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function E(t,e,r,n){return G(W(e),t,r,n)}function T(t,e,r,n){return G(function(t,e){let r,n,i;const o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function B(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function C(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let o=null,s=e>239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(c=(31&e)<<6|63&r,c>127&&(o=c));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(c=(15&e)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}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(t){const e=t.length;if(e<=R)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=R));return r}(n)}e.kMaxLength=s,c.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),c.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(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(t,e,r){return u(t,e,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(t,e,r){return function(t,e,r){return f(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},c.allocUnsafe=function(t){return h(t)},c.allocUnsafeSlow=function(t){return h(t)},c.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==c.prototype},c.compare=function(t,e){if(K(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),K(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).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}},c.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=c.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(K(e,Uint8Array))i+e.length>n.length?(c.isBuffer(e)||(e=c.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},c.byteLength=g,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},c.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},c.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},c.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?C(this,0,t):y.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(t,e,r,n,i){if(K(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(o,s),u=this.slice(n,i),f=t.slice(e,r);for(let t=0;t<a;++t)if(u[t]!==f[t]){o=u[t],s=f[t];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return _(this,t,e,r);case"utf8":case"utf-8":return v(this,t,e,r);case"ascii":case"latin1":case"binary":return S(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const R=4096;function A(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function O(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function L(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=J[t[n]];return i}function k(t,e,r){const n=t.slice(e,r);let i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function x(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function I(t,e,r,n,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function M(t,e,r,n,i){H(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function N(t,e,r,n,i){H(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function D(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(t,e,r,n,o){return e=+e,r>>>=0,o||D(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function j(t,e,r,n,o){return e=+e,r>>>=0,o||D(t,0,r,8),i.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=X((function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),c.prototype.readBigUInt64BE=X((function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),c.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||x(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){t>>>=0,e||x(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=X((function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),c.prototype.readBigInt64BE=X((function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),c.prototype.readFloatLE=function(t,e){return t>>>=0,e||x(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||x(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||x(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||x(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||I(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||I(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigUInt64LE=X((function(t,e=0){return M(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=X((function(t,e=0){return N(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);I(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);I(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigInt64LE=X((function(t,e=0){return M(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=X((function(t,e=0){return N(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(t,e,r){return P(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return j(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return j(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<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),t.length-e<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=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&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{const o=c.isBuffer(t)?t:c.from(t,n),s=o.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%s]}return this};const U={};function F(t,e,r){U[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function $(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function H(t,e,r,n,i,o){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===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}`:`>= ${e}${n} and <= ${r}${n}`,new U.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){z(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||q(e,t.length-(r+1))}(n,i,o)}function z(t,e){if("number"!=typeof t)throw new U.ERR_INVALID_ARG_TYPE(e,"number",t)}function q(t,e,r){if(Math.floor(t)!==t)throw z(t,r),new U.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=$(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=$(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const Z=/[^+/0-9A-Za-z-_]/g;function V(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=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((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function W(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(Z,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function G(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function K(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}const J=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function X(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},3081:(t,e,r)=>{var n=r(7172).Buffer,i=r(3424).Transform,o=r(4361).s;function s(t){i.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(87)(s,i),s.prototype.update=function(t,e,r){"string"==typeof t&&(t=n.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},s.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},s.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return t&&(e=this._toString(e,t,!0)),e},s.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},t.exports=s},5862:t=>{var e=1e3,r=60*e,n=60*r,i=24*n;function o(t,e,r,n){var i=e>=1.5*r;return Math.round(t/r)+" "+n+(i?"s":"")}t.exports=function(t,s){s=s||{};var a,c,u=typeof t;if("string"===u&&t.length>0)return function(t){if(!((t=String(t)).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(t);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*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(t);if("number"===u&&isFinite(t))return s.long?(a=t,(c=Math.abs(a))>=i?o(a,c,i,"day"):c>=n?o(a,c,n,"hour"):c>=r?o(a,c,r,"minute"):c>=e?o(a,c,e,"second"):a+" ms"):function(t){var o=Math.abs(t);return o>=i?Math.round(t/i)+"d":o>=n?Math.round(t/n)+"h":o>=r?Math.round(t/r)+"m":o>=e?Math.round(t/e)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},6292:(t,e,r)=>{e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;e.splice(1,0,r,"color: inherit");let n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(n++,"%c"===t&&(i=n))})),e.splice(i,0,r)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t={NODE_ENV:"production"}.DEBUG),t},e.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+)/))},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!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`."))}})(),e.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"],e.log=console.debug||console.log||(()=>{}),t.exports=r(9374)(e);const{formatters:n}=t.exports;n.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},9374:(t,e,r)=>{t.exports=function(t){function e(t){let r,i,o,s=null;function a(...t){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,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";s++;const o=e.formatters[i];if("function"==typeof o){const e=t[s];r=o.call(n,e),t.splice(s,1),s--}return r})),e.formatArgs.call(n,t),(n.log||e.log).apply(n,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=n,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==e.namespaces&&(i=e.namespaces,o=e.enabled(t)),o),set:t=>{s=t}}),"function"==typeof e.init&&e.init(a),a}function n(t,r){const n=e(this.namespace+(void 0===r?":":r)+t);return n.log=this.log,n}function i(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){const t=[...e.names.map(i),...e.skips.map(i).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let r;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const n=("string"==typeof t?t:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(t=n[r].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.slice(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let r,n;for(r=0,n=e.skips.length;r<n;r++)if(e.skips[r].test(t))return!1;for(r=0,n=e.names.length;r<n;r++)if(e.names[r].test(t))return!0;return!1},e.humanize=r(5862),e.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(t).forEach((r=>{e[r]=t[r]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let r=0;for(let e=0;e<t.length;e++)r=(r<<5)-r+t.charCodeAt(e),r|=0;return e.colors[Math.abs(r)%e.colors.length]},e.enable(e.load()),e}},7191:(t,e,r)=>{e.utils=r(5516),e.Cipher=r(4923),e.DES=r(225),e.CBC=r(8701),e.EDE=r(6540)},8701:(t,e,r)=>{var n=r(7859),i=r(87),o={};function s(t){n.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=t[e]}e.instantiate=function(t){function e(e){t.call(this,e),this._cbcInit()}i(e,t);for(var r=Object.keys(o),n=0;n<r.length;n++){var s=r[n];e.prototype[s]=o[s]}return e.create=function(t){return new e(t)},e},o._cbcInit=function(){var t=new s(this.options.iv);this._cbcState=t},o._update=function(t,e,r,n){var i=this._cbcState,o=this.constructor.super_.prototype,s=i.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)s[a]^=t[e+a];for(o._update.call(this,s,0,r,n),a=0;a<this.blockSize;a++)s[a]=r[n+a]}else{for(o._update.call(this,t,e,r,n),a=0;a<this.blockSize;a++)r[n+a]^=s[a];for(a=0;a<this.blockSize;a++)s[a]=t[e+a]}}},4923:(t,e,r)=>{var n=r(7859);function i(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=!1!==t.padding}t.exports=i,i.prototype._init=function(){},i.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},i.prototype._buffer=function(t,e){for(var r=Math.min(this.buffer.length-this.bufferOff,t.length-e),n=0;n<r;n++)this.buffer[this.bufferOff+n]=t[e+n];return this.bufferOff+=r,r},i.prototype._flushBuffer=function(t,e){return this._update(this.buffer,0,t,e),this.bufferOff=0,this.blockSize},i.prototype._updateEncrypt=function(t){var e=0,r=0,n=(this.bufferOff+t.length)/this.blockSize|0,i=new Array(n*this.blockSize);0!==this.bufferOff&&(e+=this._buffer(t,e),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(i,r)));for(var o=t.length-(t.length-e)%this.blockSize;e<o;e+=this.blockSize)this._update(t,e,i,r),r+=this.blockSize;for(;e<t.length;e++,this.bufferOff++)this.buffer[this.bufferOff]=t[e];return i},i.prototype._updateDecrypt=function(t){for(var e=0,r=0,n=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,i=new Array(n*this.blockSize);n>0;n--)e+=this._buffer(t,e),r+=this._flushBuffer(i,r);return e+=this._buffer(t,e),i},i.prototype.final=function(t){var e,r;return t&&(e=this.update(t)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},i.prototype._pad=function(t,e){if(0===e)return!1;for(;e<t.length;)t[e++]=0;return!0},i.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var t=new Array(this.blockSize);return this._update(this.buffer,0,t,0),t},i.prototype._unpad=function(t){return t},i.prototype._finalDecrypt=function(){n.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)}},225:(t,e,r)=>{var n=r(7859),i=r(87),o=r(5516),s=r(4923);function a(){this.tmp=new Array(2),this.keys=null}function c(t){s.call(this,t);var e=new a;this._desState=e,this.deriveKeys(e,t.key)}i(c,s),t.exports=c,c.create=function(t){return new c(t)};var u=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];c.prototype.deriveKeys=function(t,e){t.keys=new Array(32),n.equal(e.length,this.blockSize,"Invalid key length");var r=o.readUInt32BE(e,0),i=o.readUInt32BE(e,4);o.pc1(r,i,t.tmp,0),r=t.tmp[0],i=t.tmp[1];for(var s=0;s<t.keys.length;s+=2){var a=u[s>>>1];r=o.r28shl(r,a),i=o.r28shl(i,a),o.pc2(r,i,t.keys,s)}},c.prototype._update=function(t,e,r,n){var i=this._desState,s=o.readUInt32BE(t,e),a=o.readUInt32BE(t,e+4);o.ip(s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],"encrypt"===this.type?this._encrypt(i,s,a,i.tmp,0):this._decrypt(i,s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],o.writeUInt32BE(r,s,n),o.writeUInt32BE(r,a,n+4)},c.prototype._pad=function(t,e){if(!1===this.padding)return!1;for(var r=t.length-e,n=e;n<t.length;n++)t[n]=r;return!0},c.prototype._unpad=function(t){if(!1===this.padding)return t;for(var e=t[t.length-1],r=t.length-e;r<t.length;r++)n.equal(t[r],e);return t.slice(0,t.length-e)},c.prototype._encrypt=function(t,e,r,n,i){for(var s=e,a=r,c=0;c<t.keys.length;c+=2){var u=t.keys[c],f=t.keys[c+1];o.expand(a,t.tmp,0),u^=t.tmp[0],f^=t.tmp[1];var h=o.substitute(u,f),l=a;a=(s^o.permute(h))>>>0,s=l}o.rip(a,s,n,i)},c.prototype._decrypt=function(t,e,r,n,i){for(var s=r,a=e,c=t.keys.length-2;c>=0;c-=2){var u=t.keys[c],f=t.keys[c+1];o.expand(s,t.tmp,0),u^=t.tmp[0],f^=t.tmp[1];var h=o.substitute(u,f),l=s;s=(a^o.permute(h))>>>0,a=l}o.rip(s,a,n,i)}},6540:(t,e,r)=>{var n=r(7859),i=r(87),o=r(4923),s=r(225);function a(t,e){n.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),i=e.slice(8,16),o=e.slice(16,24);this.ciphers="encrypt"===t?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:o})]:[s.create({type:"decrypt",key:o}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function c(t){o.call(this,t);var e=new a(this.type,this.options.key);this._edeState=e}i(c,o),t.exports=c,c.create=function(t){return new c(t)},c.prototype._update=function(t,e,r,n){var i=this._edeState;i.ciphers[0]._update(t,e,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},c.prototype._pad=s.prototype._pad,c.prototype._unpad=s.prototype._unpad},5516:(t,e)=>{e.readUInt32BE=function(t,e){return(t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e])>>>0},e.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},e.ip=function(t,e,r,n){for(var i=0,o=0,s=6;s>=0;s-=2){for(var a=0;a<=24;a+=8)i<<=1,i|=e>>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=t>>>a+s&1}for(s=6;s>=0;s-=2){for(a=1;a<=25;a+=8)o<<=1,o|=e>>>a+s&1;for(a=1;a<=25;a+=8)o<<=1,o|=t>>>a+s&1}r[n+0]=i>>>0,r[n+1]=o>>>0},e.rip=function(t,e,r,n){for(var i=0,o=0,s=0;s<4;s++)for(var a=24;a>=0;a-=8)i<<=1,i|=e>>>a+s&1,i<<=1,i|=t>>>a+s&1;for(s=4;s<8;s++)for(a=24;a>=0;a-=8)o<<=1,o|=e>>>a+s&1,o<<=1,o|=t>>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.pc1=function(t,e,r,n){for(var i=0,o=0,s=7;s>=5;s--){for(var a=0;a<=24;a+=8)i<<=1,i|=e>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=t>>a+s&1}for(a=0;a<=24;a+=8)i<<=1,i|=e>>a+s&1;for(s=1;s<=3;s++){for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1;for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1}for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.r28shl=function(t,e){return t<<e&268435455|t>>>28-e};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];e.pc2=function(t,e,n,i){for(var o=0,s=0,a=r.length>>>1,c=0;c<a;c++)o<<=1,o|=t>>>r[c]&1;for(c=a;c<r.length;c++)s<<=1,s|=e>>>r[c]&1;n[i+0]=o>>>0,n[i+1]=s>>>0},e.expand=function(t,e,r){var n=0,i=0;n=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=t>>>o&63;for(o=11;o>=3;o-=4)i|=t>>>o&63,i<<=6;i|=(31&t)<<1|t>>>31,e[r+0]=n>>>0,e[r+1]=i>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];e.substitute=function(t,e){for(var r=0,i=0;i<4;i++)r<<=4,r|=n[64*i+(t>>>18-6*i&63)];for(i=0;i<4;i++)r<<=4,r|=n[256+64*i+(e>>>18-6*i&63)];return r>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];e.permute=function(t){for(var e=0,r=0;r<i.length;r++)e<<=1,e|=t>>>i[r]&1;return e>>>0},e.padSplit=function(t,e,r){for(var n=t.toString(2);n.length<e;)n="0"+n;for(var i=[],o=0;o<e;o+=r)i.push(n.slice(o,o+r));return i.join(" ")}},3302:t=>{t.exports=!1},343:t=>{var e,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}g(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&g(t,"error",e,{once:!0})}(t,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function u(t,e,r,n){var i,o,s,u;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=c(t))>0&&s.length>i&&!s.warned){s.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=s.length,u=f,console&&console.warn&&console.warn(u)}return t}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 h(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function l(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):p(i,i.length)}function d(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function g(t,e,r,n){if("function"==typeof t.on)n.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(o){n.once&&t.removeEventListener(e,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");s=t}}),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(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var i="error"===t,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[t];if(void 0===c)return!1;if("function"==typeof c)n(c,this,e);else{var u=c.length,f=p(c,u);for(r=0;r<u;++r)n(f[r],this,e)}return!0},o.prototype.addListener=function(t,e){return u(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return u(this,t,e,!0)},o.prototype.once=function(t,e){return a(e),this.on(t,h(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,h(this,t,e)),this},o.prototype.removeListener=function(t,e){var r,n,i,o,s;if(a(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(t){var e,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[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),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(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return l(this,t,!0)},o.prototype.rawListeners=function(t){return l(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},5883:(t,e,r)=>{var n=r(7172).Buffer,i=r(9500);t.exports=function(t,e,r,o){if(n.isBuffer(t)||(t=n.from(t,"binary")),e&&(n.isBuffer(e)||(e=n.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=r/8,a=n.alloc(s),c=n.alloc(o||0),u=n.alloc(0);s>0||o>0;){var f=new i;f.update(u),f.update(t),e&&f.update(e),u=f.digest();var h=0;if(s>0){var l=a.length-s;h=Math.min(s,u.length),u.copy(a,l,0,h),s-=h}if(h<u.length&&o>0){var d=c.length-o,p=Math.min(o,u.length-h);u.copy(c,d,h,h+p),o-=p}}return u.fill(0),{key:a,iv:c}}},6883:(t,e,r)=>{var n=r(7172).Buffer,i=r(8310).Transform;function o(t){i.call(this),this._block=n.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(87)(o,i),o.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!n.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer")}(t),this._finalized)throw new Error("Digest already called");n.isBuffer(t)||(t=n.from(t,e));for(var r=this._block,i=0;this._blockOffset+t.length-i>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)r[o++]=t[i++];this._update(),this._blockOffset=0}for(;i<t.length;)r[this._blockOffset++]=t[i++];for(var s=0,a=8*t.length;a>0;++s)this._length[s]+=a,(a=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*a);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},5294:(t,e,r)=>{var n=e;n.utils=r(8626),n.common=r(8717),n.sha=r(2589),n.ripemd=r(8494),n.hmac=r(2750),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},8717:(t,e,r)=>{var n=r(8626),i=r(7859);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=o,o.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},o.prototype.digest=function(t){return this.update(this._pad()),i(null===this.pending),this._digest(t)},o.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},2750:(t,e,r)=>{var n=r(8626),i=r(7859);function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}t.exports=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},8494:(t,e,r)=>{var n=r(8626),i=r(8717),o=n.rotl32,s=n.sum32,a=n.sum32_3,c=n.sum32_4,u=i.BlockHash;function f(){if(!(this instanceof f))return new f;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function h(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function l(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function d(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(f,u),e.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],u=this.h[3],f=this.h[4],b=r,w=n,_=i,v=u,S=f,E=0;E<80;E++){var T=s(o(c(r,h(E,n,i,u),t[p[E]+e],l(E)),y[E]),f);r=f,f=u,u=o(i,10),i=n,n=T,T=s(o(c(b,h(79-E,w,_,v),t[g[E]+e],d(E)),m[E]),S),b=S,S=v,v=o(_,10),_=w,w=T}T=a(this.h[1],i,v),this.h[1]=a(this.h[2],u,S),this.h[2]=a(this.h[3],f,b),this.h[3]=a(this.h[4],r,w),this.h[4]=a(this.h[0],n,_),this.h[0]=T},f.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],g=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],y=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],m=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},2589:(t,e,r)=>{e.sha1=r(9330),e.sha224=r(5168),e.sha256=r(375),e.sha384=r(8899),e.sha512=r(790)},9330:(t,e,r)=>{var n=r(8626),i=r(8717),o=r(8156),s=n.rotl32,a=n.sum32,c=n.sum32_5,u=o.ft_1,f=i.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(l,f),t.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],f=this.h[2],l=this.h[3],d=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),g=c(s(i,5),u(p,o,f,l),d,r[n],h[p]);d=l,l=f,f=s(o,30),o=i,i=g}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],f),this.h[3]=a(this.h[3],l),this.h[4]=a(this.h[4],d)},l.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},5168:(t,e,r)=>{var n=r(8626),i=r(375);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},375:(t,e,r)=>{var n=r(8626),i=r(8717),o=r(8156),s=r(7859),a=n.sum32,c=n.sum32_4,u=n.sum32_5,f=o.ch32,h=o.maj32,l=o.s0_256,d=o.s1_256,p=o.g0_256,g=o.g1_256,y=i.BlockHash,m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}n.inherits(b,y),t.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=c(g(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],y=this.h[2],m=this.h[3],b=this.h[4],w=this.h[5],_=this.h[6],v=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var S=u(v,d(b),f(b,w,_),this.k[n],r[n]),E=a(l(i),h(i,o,y));v=_,_=w,w=b,b=a(m,S),m=y,y=o,o=i,i=a(S,E)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],y),this.h[3]=a(this.h[3],m),this.h[4]=a(this.h[4],b),this.h[5]=a(this.h[5],w),this.h[6]=a(this.h[6],_),this.h[7]=a(this.h[7],v)},b.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},8899:(t,e,r)=>{var n=r(8626),i=r(790);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},790:(t,e,r)=>{var n=r(8626),i=r(8717),o=r(7859),s=n.rotr64_hi,a=n.rotr64_lo,c=n.shr64_hi,u=n.shr64_lo,f=n.sum64,h=n.sum64_hi,l=n.sum64_lo,d=n.sum64_4_hi,p=n.sum64_4_lo,g=n.sum64_5_hi,y=n.sum64_5_lo,m=i.BlockHash,b=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function w(){if(!(this instanceof w))return new w;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function _(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function v(t,e,r,n,i,o){var s=e&n^~e&o;return s<0&&(s+=4294967296),s}function S(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function E(t,e,r,n,i,o){var s=e&n^e&o^n&o;return s<0&&(s+=4294967296),s}function T(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function B(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function C(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function R(t,e){var r=s(t,e,1)^s(t,e,8)^c(t,e,7);return r<0&&(r+=4294967296),r}function A(t,e){var r=a(t,e,1)^a(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function O(t,e){var r=a(t,e,19)^a(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(w,m),t.exports=w,w.blockSize=1024,w.outSize=512,w.hmacStrength=192,w.padLength=128,w.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=(y=r[n-4],m=r[n-3],b=void 0,(b=s(y,m,19)^s(m,y,29)^c(y,m,6))<0&&(b+=4294967296),b),o=O(r[n-4],r[n-3]),a=r[n-14],u=r[n-13],f=R(r[n-30],r[n-29]),h=A(r[n-30],r[n-29]),l=r[n-32],g=r[n-31];r[n]=d(i,o,a,u,f,h,l,g),r[n+1]=p(i,o,a,u,f,h,l,g)}var y,m,b},w.prototype._update=function(t,e){this._prepareBlock(t,e);var r,n,i,a=this.W,c=this.h[0],u=this.h[1],d=this.h[2],p=this.h[3],m=this.h[4],b=this.h[5],w=this.h[6],R=this.h[7],A=this.h[8],O=this.h[9],L=this.h[10],k=this.h[11],x=this.h[12],I=this.h[13],M=this.h[14],N=this.h[15];o(this.k.length===a.length);for(var D=0;D<a.length;D+=2){var P=M,j=N,U=(i=void 0,(i=s(r=A,n=O,14)^s(r,n,18)^s(n,r,9))<0&&(i+=4294967296),i),F=C(A,O),$=_(A,0,L,0,x),H=v(0,O,0,k,0,I),z=this.k[D],q=this.k[D+1],Z=a[D],V=a[D+1],W=g(P,j,U,F,$,H,z,q,Z,V),G=y(P,j,U,F,$,H,z,q,Z,V);P=T(c,u),j=B(c,u),U=S(c,0,d,0,m),F=E(0,u,0,p,0,b);var K=h(P,j,U,F),Y=l(P,j,U,F);M=x,N=I,x=L,I=k,L=A,k=O,A=h(w,R,W,G),O=l(R,R,W,G),w=m,R=b,m=d,b=p,d=c,p=u,c=h(W,G,K,Y),u=l(W,G,K,Y)}f(this.h,0,c,u),f(this.h,2,d,p),f(this.h,4,m,b),f(this.h,6,w,R),f(this.h,8,A,O),f(this.h,10,L,k),f(this.h,12,x,I),f(this.h,14,M,N)},w.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},8156:(t,e,r)=>{var n=r(8626).rotr32;function i(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function s(t,e,r){return t^e^r}e.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?s(e,r,n):2===t?o(e,r,n):void 0},e.ch32=i,e.maj32=o,e.p32=s,e.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},e.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},e.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},8626:(t,e,r)=>{var n=r(7859),i=r(87);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function s(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function c(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var s=t.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):o(t,i)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i<t.length;i++)r[i]=0|t[i];return r},e.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=a(t[r].toString(16));return e},e.htonl=s,e.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=s(i)),r+=c(i.toString(16))}return r},e.zero2=a,e.zero8=c,e.join32=function(t,e,r,i){var o=r-e;n(o%4==0);for(var s=new Array(o/4),a=0,c=e;a<s.length;a++,c+=4){var u;u="big"===i?t[c]<<24|t[c+1]<<16|t[c+2]<<8|t[c+3]:t[c+3]<<24|t[c+2]<<16|t[c+1]<<8|t[c],s[a]=u>>>0}return s},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var o=t[n];"big"===e?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,s=(o<n?1:0)+r+i;t[e]=s>>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,o,s,a){var c=0,u=e;return c+=(u=u+n>>>0)<e?1:0,c+=(u=u+o>>>0)<o?1:0,t+r+i+s+(c+=(u=u+a>>>0)<a?1:0)>>>0},e.sum64_4_lo=function(t,e,r,n,i,o,s,a){return e+n+o+a>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,s,a,c,u){var f=0,h=e;return f+=(h=h+n>>>0)<e?1:0,f+=(h=h+o>>>0)<o?1:0,f+=(h=h+a>>>0)<a?1:0,t+r+i+s+c+(f+=(h=h+u>>>0)<u?1:0)>>>0},e.sum64_5_lo=function(t,e,r,n,i,o,s,a,c,u){return e+n+o+a+u>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},8898:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,c=(1<<a)-1,u=c>>1,f=-7,h=r?i-1:0,l=r?-1:1,d=t[e+h];for(h+=l,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+t[e+h],h+=l,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+h],h+=l,f-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=u}return(d?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,c,u=8*o-i-1,f=(1<<u)-1,h=f>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+h>=1?l/c:l*Math.pow(2,1-h))*c>=2&&(s++,c/=2),s+h>=f?(a=0,s=f):s+h>=1?(a=(e*c-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[r+d]=255&s,d+=p,s/=256,u-=8);t[r+d-p]|=128*g}},87:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},3261:t=>{var e=1/0,r=9007199254740991,n=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=/^(?:0|[1-9]\d*)$/,c=parseInt,u=Object.prototype.toString,f=Math.ceil,h=Math.max;function l(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o}function d(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}t.exports=function(t,p,g){p=(g?function(t,e,n){if(!d(n))return!1;var i=typeof e;return!!("number"==i?function(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=r}(t.length)&&!function(t){var e=d(t)?u.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}(t)}(n)&&function(t,e){return!!(e=null==e?r:e)&&("number"==typeof t||a.test(t))&&t>-1&&t%1==0&&t<e}(e,n.length):"string"==i&&e in n)&&function(t,e){return t===e||t!=t&&e!=e}(n[e],t)}(t,p,g):void 0===p)?1:h(function(t){var r=function(t){return t?(t=function(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==u.call(t)}(t))return NaN;if(d(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=d(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(n,"");var r=o.test(t);return r||s.test(t)?c(t.slice(2),r?2:8):i.test(t)?NaN:+t}(t))===e||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}(t),a=r%1;return r==r?a?r-a:r:0}(p),0);var y=t?t.length:0;if(!y||p<1)return[];for(var m=0,b=0,w=Array(f(y/p));m<y;)w[b++]=l(t,m,m+=p);return w}},9467:(t,e,r)=>{t=r.nmd(t);var n="__lodash_hash_undefined__",i=1,o=2,s=1/0,a=9007199254740991,c="[object Arguments]",u="[object Array]",f="[object Boolean]",h="[object Date]",l="[object Error]",d="[object Function]",p="[object GeneratorFunction]",g="[object Map]",y="[object Number]",m="[object Object]",b="[object Promise]",w="[object RegExp]",_="[object Set]",v="[object String]",S="[object Symbol]",E="[object WeakMap]",T="[object ArrayBuffer]",B="[object DataView]",C=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,R=/^\w*$/,A=/^\./,O=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,L=/\\(\\)?/g,k=/^\[object .+?Constructor\]$/,x=/^(?:0|[1-9]\d*)$/,I={};I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I[c]=I[u]=I[T]=I[f]=I[B]=I[h]=I[l]=I[d]=I[g]=I[y]=I[m]=I[w]=I[_]=I[v]=I[E]=!1;var M="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,N="object"==typeof self&&self&&self.Object===Object&&self,D=M||N||Function("return this")(),P=e&&!e.nodeType&&e,j=P&&t&&!t.nodeType&&t,U=j&&j.exports===P&&M.process,F=function(){try{return U&&U.binding("util")}catch(t){}}(),$=F&&F.isTypedArray;function H(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(!e(t[r],r,t))return!1;return!0}function z(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function q(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function Z(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function V(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var W,G,K,Y=Array.prototype,J=Function.prototype,X=Object.prototype,Q=D["__core-js_shared__"],tt=(W=/[^.]+$/.exec(Q&&Q.keys&&Q.keys.IE_PROTO||""))?"Symbol(src)_1."+W:"",et=J.toString,rt=X.hasOwnProperty,nt=X.toString,it=RegExp("^"+et.call(rt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ot=D.Symbol,st=D.Uint8Array,at=X.propertyIsEnumerable,ct=Y.splice,ut=(G=Object.keys,K=Object,function(t){return G(K(t))}),ft=Ft(D,"DataView"),ht=Ft(D,"Map"),lt=Ft(D,"Promise"),dt=Ft(D,"Set"),pt=Ft(D,"WeakMap"),gt=Ft(Object,"create"),yt=Gt(ft),mt=Gt(ht),bt=Gt(lt),wt=Gt(dt),_t=Gt(pt),vt=ot?ot.prototype:void 0,St=vt?vt.valueOf:void 0,Et=vt?vt.toString:void 0;function Tt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Bt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Ct(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Rt(t){var e=-1,r=t?t.length:0;for(this.__data__=new Ct;++e<r;)this.add(t[e])}function At(t){this.__data__=new Bt(t)}function Ot(t,e){for(var r=t.length;r--;)if(Yt(t[r][0],e))return r;return-1}Tt.prototype.clear=function(){this.__data__=gt?gt(null):{}},Tt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Tt.prototype.get=function(t){var e=this.__data__;if(gt){var r=e[t];return r===n?void 0:r}return rt.call(e,t)?e[t]:void 0},Tt.prototype.has=function(t){var e=this.__data__;return gt?void 0!==e[t]:rt.call(e,t)},Tt.prototype.set=function(t,e){return this.__data__[t]=gt&&void 0===e?n:e,this},Bt.prototype.clear=function(){this.__data__=[]},Bt.prototype.delete=function(t){var e=this.__data__,r=Ot(e,t);return!(r<0||(r==e.length-1?e.pop():ct.call(e,r,1),0))},Bt.prototype.get=function(t){var e=this.__data__,r=Ot(e,t);return r<0?void 0:e[r][1]},Bt.prototype.has=function(t){return Ot(this.__data__,t)>-1},Bt.prototype.set=function(t,e){var r=this.__data__,n=Ot(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Ct.prototype.clear=function(){this.__data__={hash:new Tt,map:new(ht||Bt),string:new Tt}},Ct.prototype.delete=function(t){return Ut(this,t).delete(t)},Ct.prototype.get=function(t){return Ut(this,t).get(t)},Ct.prototype.has=function(t){return Ut(this,t).has(t)},Ct.prototype.set=function(t,e){return Ut(this,t).set(t,e),this},Rt.prototype.add=Rt.prototype.push=function(t){return this.__data__.set(t,n),this},Rt.prototype.has=function(t){return this.__data__.has(t)},At.prototype.clear=function(){this.__data__=new Bt},At.prototype.delete=function(t){return this.__data__.delete(t)},At.prototype.get=function(t){return this.__data__.get(t)},At.prototype.has=function(t){return this.__data__.has(t)},At.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Bt){var n=r.__data__;if(!ht||n.length<199)return n.push([t,e]),this;r=this.__data__=new Ct(n)}return r.set(t,e),this};var Lt,kt=(Lt=function(t,e){return t&&It(t,e,se)},function(t,e){if(null==t)return t;if(!Qt(t))return Lt(t,e);for(var r=t.length,n=-1,i=Object(t);++n<r&&!1!==e(i[n],n,i););return t});function xt(t,e){var r=!0;return kt(t,(function(t,n,i){return r=!!e(t,n,i)})),r}var It=function(t,e,r){for(var n=-1,i=Object(t),o=r(t),s=o.length;s--;){var a=o[++n];if(!1===e(i[a],a,i))break}return t};function Mt(t,e){for(var r=0,n=(e=zt(e,t)?[e]:Pt(e)).length;null!=t&&r<n;)t=t[Wt(e[r++])];return r&&r==n?t:void 0}function Nt(t,e){return null!=t&&e in Object(t)}function Dt(t,e,r,n,s){return t===e||(null==t||null==e||!re(t)&&!ne(e)?t!=t&&e!=e:function(t,e,r,n,s,a){var d=Xt(t),p=Xt(e),b=u,E=u;d||(b=(b=$t(t))==c?m:b),p||(E=(E=$t(e))==c?m:E);var C=b==m&&!q(t),R=E==m&&!q(e),A=b==E;if(A&&!C)return a||(a=new At),d||oe(t)?jt(t,e,r,n,s,a):function(t,e,r,n,s,a,c){switch(r){case B:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case T:return!(t.byteLength!=e.byteLength||!n(new st(t),new st(e)));case f:case h:case y:return Yt(+t,+e);case l:return t.name==e.name&&t.message==e.message;case w:case v:return t==e+"";case g:var u=Z;case _:var d=a&o;if(u||(u=V),t.size!=e.size&&!d)return!1;var p=c.get(t);if(p)return p==e;a|=i,c.set(t,e);var m=jt(u(t),u(e),n,s,a,c);return c.delete(t),m;case S:if(St)return St.call(t)==St.call(e)}return!1}(t,e,b,r,n,s,a);if(!(s&o)){var O=C&&rt.call(t,"__wrapped__"),L=R&&rt.call(e,"__wrapped__");if(O||L){var k=O?t.value():t,x=L?e.value():e;return a||(a=new At),r(k,x,n,s,a)}}return!!A&&(a||(a=new At),function(t,e,r,n,i,s){var a=i&o,c=se(t),u=c.length;if(u!=se(e).length&&!a)return!1;for(var f=u;f--;){var h=c[f];if(!(a?h in e:rt.call(e,h)))return!1}var l=s.get(t);if(l&&s.get(e))return l==e;var d=!0;s.set(t,e),s.set(e,t);for(var p=a;++f<u;){var g=t[h=c[f]],y=e[h];if(n)var m=a?n(y,g,h,e,t,s):n(g,y,h,t,e,s);if(!(void 0===m?g===y||r(g,y,n,i,s):m)){d=!1;break}p||(p="constructor"==h)}if(d&&!p){var b=t.constructor,w=e.constructor;b==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(d=!1)}return s.delete(t),s.delete(e),d}(t,e,r,n,s,a))}(t,e,Dt,r,n,s))}function Pt(t){return Xt(t)?t:Vt(t)}function jt(t,e,r,n,s,a){var c=s&o,u=t.length,f=e.length;if(u!=f&&!(c&&f>u))return!1;var h=a.get(t);if(h&&a.get(e))return h==e;var l=-1,d=!0,p=s&i?new Rt:void 0;for(a.set(t,e),a.set(e,t);++l<u;){var g=t[l],y=e[l];if(n)var m=c?n(y,g,l,e,t,a):n(g,y,l,t,e,a);if(void 0!==m){if(m)continue;d=!1;break}if(p){if(!z(e,(function(t,e){if(!p.has(e)&&(g===t||r(g,t,n,s,a)))return p.add(e)}))){d=!1;break}}else if(g!==y&&!r(g,y,n,s,a)){d=!1;break}}return a.delete(t),a.delete(e),d}function Ut(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Ft(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!re(t)||function(t){return!!tt&&tt in t}(t))&&(te(t)||q(t)?it:k).test(Gt(t))}(r)?r:void 0}var $t=function(t){return nt.call(t)};function Ht(t,e){return!!(e=null==e?a:e)&&("number"==typeof t||x.test(t))&&t>-1&&t%1==0&&t<e}function zt(t,e){if(Xt(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!ie(t))||R.test(t)||!C.test(t)||null!=e&&t in Object(e)}function qt(t){return t==t&&!re(t)}function Zt(t,e){return function(r){return null!=r&&r[t]===e&&(void 0!==e||t in Object(r))}}(ft&&$t(new ft(new ArrayBuffer(1)))!=B||ht&&$t(new ht)!=g||lt&&$t(lt.resolve())!=b||dt&&$t(new dt)!=_||pt&&$t(new pt)!=E)&&($t=function(t){var e=nt.call(t),r=e==m?t.constructor:void 0,n=r?Gt(r):void 0;if(n)switch(n){case yt:return B;case mt:return g;case bt:return b;case wt:return _;case _t:return E}return e});var Vt=Kt((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(ie(t))return Et?Et.call(t):"";var e=t+"";return"0"==e&&1/t==-s?"-0":e}(e);var r=[];return A.test(t)&&r.push(""),t.replace(O,(function(t,e,n,i){r.push(n?i.replace(L,"$1"):e||t)})),r}));function Wt(t){if("string"==typeof t||ie(t))return t;var e=t+"";return"0"==e&&1/t==-s?"-0":e}function Gt(t){if(null!=t){try{return et.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Kt(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(Kt.Cache||Ct),r}function Yt(t,e){return t===e||t!=t&&e!=e}function Jt(t){return function(t){return ne(t)&&Qt(t)}(t)&&rt.call(t,"callee")&&(!at.call(t,"callee")||nt.call(t)==c)}Kt.Cache=Ct;var Xt=Array.isArray;function Qt(t){return null!=t&&ee(t.length)&&!te(t)}function te(t){var e=re(t)?nt.call(t):"";return e==d||e==p}function ee(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function re(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function ne(t){return!!t&&"object"==typeof t}function ie(t){return"symbol"==typeof t||ne(t)&&nt.call(t)==S}var oe=$?function(t){return function(e){return t(e)}}($):function(t){return ne(t)&&ee(t.length)&&!!I[nt.call(t)]};function se(t){return Qt(t)?function(t,e){var r=Xt(t)||Jt(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,i=!!n;for(var o in t)!e&&!rt.call(t,o)||i&&("length"==o||Ht(o,n))||r.push(o);return r}(t):function(t){if(r=(e=t)&&e.constructor,e!==("function"==typeof r&&r.prototype||X))return ut(t);var e,r,n=[];for(var i in Object(t))rt.call(t,i)&&"constructor"!=i&&n.push(i);return n}(t)}function ae(t){return t}t.exports=function(t,e,r){var n,s,a,c,u,f=Xt(t)?H:xt;return r&&function(t,e,r){if(!re(r))return!1;var n=typeof e;return!!("number"==n?Qt(r)&&Ht(e,r.length):"string"==n&&e in r)&&Yt(r[e],t)}(t,e,r)&&(e=void 0),f(t,"function"==typeof(n=e)?n:null==n?ae:"object"==typeof n?Xt(n)?function(t,e){return zt(t)&&qt(e)?Zt(Wt(t),e):function(r){var n=function(t,e,r){var n=null==t?void 0:Mt(t,e);return void 0===n?void 0:n}(r,t);return void 0===n&&n===e?function(t,e){return null!=t&&function(t,e,r){for(var n,i=-1,o=(e=zt(e,t)?[e]:Pt(e)).length;++i<o;){var s=Wt(e[i]);if(!(n=null!=t&&r(t,s)))break;t=t[s]}return n||!!(o=t?t.length:0)&&ee(o)&&Ht(s,o)&&(Xt(t)||Jt(t))}(t,e,Nt)}(r,t):Dt(e,n,void 0,i|o)}}(n[0],n[1]):1==(a=function(t){for(var e=se(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,qt(i)]}return e}(s=n)).length&&a[0][2]?Zt(a[0][0],a[0][1]):function(t){return t===s||function(t,e,r,n){var s=r.length,a=s;if(null==t)return!a;for(t=Object(t);s--;){var c=r[s];if(c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++s<a;){var u=(c=r[s])[0],f=t[u],h=c[1];if(c[2]){if(void 0===f&&!(u in t))return!1}else{var l,d=new At;if(!(void 0===l?Dt(h,f,n,i|o,d):l))return!1}}return!0}(t,0,a)}:zt(c=n)?(u=Wt(c),function(t){return null==t?void 0:t[u]}):function(t){return function(e){return Mt(e,t)}}(c))}},1328:(t,e,r)=>{t=r.nmd(t);var n="__lodash_hash_undefined__",i=1,o=2,s=1/0,a=9007199254740991,c="[object Arguments]",u="[object Array]",f="[object Boolean]",h="[object Date]",l="[object Error]",d="[object Function]",p="[object GeneratorFunction]",g="[object Map]",y="[object Number]",m="[object Object]",b="[object Promise]",w="[object RegExp]",_="[object Set]",v="[object String]",S="[object Symbol]",E="[object WeakMap]",T="[object ArrayBuffer]",B="[object DataView]",C=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,R=/^\w*$/,A=/^\./,O=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,L=/\\(\\)?/g,k=/^\[object .+?Constructor\]$/,x=/^(?:0|[1-9]\d*)$/,I={};I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I[c]=I[u]=I[T]=I[f]=I[B]=I[h]=I[l]=I[d]=I[g]=I[y]=I[m]=I[w]=I[_]=I[v]=I[E]=!1;var M="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,N="object"==typeof self&&self&&self.Object===Object&&self,D=M||N||Function("return this")(),P=e&&!e.nodeType&&e,j=P&&t&&!t.nodeType&&t,U=j&&j.exports===P&&M.process,F=function(){try{return U&&U.binding("util")}catch(t){}}(),$=F&&F.isTypedArray;function H(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function z(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function q(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function Z(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var V,W,G,K=Array.prototype,Y=Function.prototype,J=Object.prototype,X=D["__core-js_shared__"],Q=(V=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||""))?"Symbol(src)_1."+V:"",tt=Y.toString,et=J.hasOwnProperty,rt=J.toString,nt=RegExp("^"+tt.call(et).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),it=D.Symbol,ot=D.Uint8Array,st=J.propertyIsEnumerable,at=K.splice,ct=(W=Object.keys,G=Object,function(t){return W(G(t))}),ut=Nt(D,"DataView"),ft=Nt(D,"Map"),ht=Nt(D,"Promise"),lt=Nt(D,"Set"),dt=Nt(D,"WeakMap"),pt=Nt(Object,"create"),gt=zt(ut),yt=zt(ft),mt=zt(ht),bt=zt(lt),wt=zt(dt),_t=it?it.prototype:void 0,vt=_t?_t.valueOf:void 0,St=_t?_t.toString:void 0;function Et(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Tt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Bt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Ct(t){var e=-1,r=t?t.length:0;for(this.__data__=new Bt;++e<r;)this.add(t[e])}function Rt(t){this.__data__=new Tt(t)}function At(t,e){for(var r=t.length;r--;)if(Zt(t[r][0],e))return r;return-1}Et.prototype.clear=function(){this.__data__=pt?pt(null):{}},Et.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Et.prototype.get=function(t){var e=this.__data__;if(pt){var r=e[t];return r===n?void 0:r}return et.call(e,t)?e[t]:void 0},Et.prototype.has=function(t){var e=this.__data__;return pt?void 0!==e[t]:et.call(e,t)},Et.prototype.set=function(t,e){return this.__data__[t]=pt&&void 0===e?n:e,this},Tt.prototype.clear=function(){this.__data__=[]},Tt.prototype.delete=function(t){var e=this.__data__,r=At(e,t);return!(r<0||(r==e.length-1?e.pop():at.call(e,r,1),0))},Tt.prototype.get=function(t){var e=this.__data__,r=At(e,t);return r<0?void 0:e[r][1]},Tt.prototype.has=function(t){return At(this.__data__,t)>-1},Tt.prototype.set=function(t,e){var r=this.__data__,n=At(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Bt.prototype.clear=function(){this.__data__={hash:new Et,map:new(ft||Tt),string:new Et}},Bt.prototype.delete=function(t){return Mt(this,t).delete(t)},Bt.prototype.get=function(t){return Mt(this,t).get(t)},Bt.prototype.has=function(t){return Mt(this,t).has(t)},Bt.prototype.set=function(t,e){return Mt(this,t).set(t,e),this},Ct.prototype.add=Ct.prototype.push=function(t){return this.__data__.set(t,n),this},Ct.prototype.has=function(t){return this.__data__.has(t)},Rt.prototype.clear=function(){this.__data__=new Tt},Rt.prototype.delete=function(t){return this.__data__.delete(t)},Rt.prototype.get=function(t){return this.__data__.get(t)},Rt.prototype.has=function(t){return this.__data__.has(t)},Rt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Tt){var n=r.__data__;if(!ft||n.length<199)return n.push([t,e]),this;r=this.__data__=new Bt(n)}return r.set(t,e),this};function Ot(t,e){for(var r=0,n=(e=jt(e,t)?[e]:xt(e)).length;null!=t&&r<n;)t=t[Ht(e[r++])];return r&&r==n?t:void 0}function Lt(t,e){return null!=t&&e in Object(t)}function kt(t,e,r,n,s){return t===e||(null==t||null==e||!Jt(t)&&!Xt(e)?t!=t&&e!=e:function(t,e,r,n,s,a){var d=Wt(t),p=Wt(e),b=u,E=u;d||(b=(b=Dt(t))==c?m:b),p||(E=(E=Dt(e))==c?m:E);var C=b==m&&!z(t),R=E==m&&!z(e),A=b==E;if(A&&!C)return a||(a=new Rt),d||te(t)?It(t,e,r,n,s,a):function(t,e,r,n,s,a,c){switch(r){case B:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case T:return!(t.byteLength!=e.byteLength||!n(new ot(t),new ot(e)));case f:case h:case y:return Zt(+t,+e);case l:return t.name==e.name&&t.message==e.message;case w:case v:return t==e+"";case g:var u=q;case _:var d=a&o;if(u||(u=Z),t.size!=e.size&&!d)return!1;var p=c.get(t);if(p)return p==e;a|=i,c.set(t,e);var m=It(u(t),u(e),n,s,a,c);return c.delete(t),m;case S:if(vt)return vt.call(t)==vt.call(e)}return!1}(t,e,b,r,n,s,a);if(!(s&o)){var O=C&&et.call(t,"__wrapped__"),L=R&&et.call(e,"__wrapped__");if(O||L){var k=O?t.value():t,x=L?e.value():e;return a||(a=new Rt),r(k,x,n,s,a)}}return!!A&&(a||(a=new Rt),function(t,e,r,n,i,s){var a=i&o,c=ee(t),u=c.length;if(u!=ee(e).length&&!a)return!1;for(var f=u;f--;){var h=c[f];if(!(a?h in e:et.call(e,h)))return!1}var l=s.get(t);if(l&&s.get(e))return l==e;var d=!0;s.set(t,e),s.set(e,t);for(var p=a;++f<u;){var g=t[h=c[f]],y=e[h];if(n)var m=a?n(y,g,h,e,t,s):n(g,y,h,t,e,s);if(!(void 0===m?g===y||r(g,y,n,i,s):m)){d=!1;break}p||(p="constructor"==h)}if(d&&!p){var b=t.constructor,w=e.constructor;b==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(d=!1)}return s.delete(t),s.delete(e),d}(t,e,r,n,s,a))}(t,e,kt,r,n,s))}function xt(t){return Wt(t)?t:$t(t)}function It(t,e,r,n,s,a){var c=s&o,u=t.length,f=e.length;if(u!=f&&!(c&&f>u))return!1;var h=a.get(t);if(h&&a.get(e))return h==e;var l=-1,d=!0,p=s&i?new Ct:void 0;for(a.set(t,e),a.set(e,t);++l<u;){var g=t[l],y=e[l];if(n)var m=c?n(y,g,l,e,t,a):n(g,y,l,t,e,a);if(void 0!==m){if(m)continue;d=!1;break}if(p){if(!H(e,(function(t,e){if(!p.has(e)&&(g===t||r(g,t,n,s,a)))return p.add(e)}))){d=!1;break}}else if(g!==y&&!r(g,y,n,s,a)){d=!1;break}}return a.delete(t),a.delete(e),d}function Mt(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Nt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Jt(t)||function(t){return!!Q&&Q in t}(t))&&(Kt(t)||z(t)?nt:k).test(zt(t))}(r)?r:void 0}var Dt=function(t){return rt.call(t)};function Pt(t,e){return!!(e=null==e?a:e)&&("number"==typeof t||x.test(t))&&t>-1&&t%1==0&&t<e}function jt(t,e){if(Wt(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!Qt(t))||R.test(t)||!C.test(t)||null!=e&&t in Object(e)}function Ut(t){return t==t&&!Jt(t)}function Ft(t,e){return function(r){return null!=r&&r[t]===e&&(void 0!==e||t in Object(r))}}(ut&&Dt(new ut(new ArrayBuffer(1)))!=B||ft&&Dt(new ft)!=g||ht&&Dt(ht.resolve())!=b||lt&&Dt(new lt)!=_||dt&&Dt(new dt)!=E)&&(Dt=function(t){var e=rt.call(t),r=e==m?t.constructor:void 0,n=r?zt(r):void 0;if(n)switch(n){case gt:return B;case yt:return g;case mt:return b;case bt:return _;case wt:return E}return e});var $t=qt((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(Qt(t))return St?St.call(t):"";var e=t+"";return"0"==e&&1/t==-s?"-0":e}(e);var r=[];return A.test(t)&&r.push(""),t.replace(O,(function(t,e,n,i){r.push(n?i.replace(L,"$1"):e||t)})),r}));function Ht(t){if("string"==typeof t||Qt(t))return t;var e=t+"";return"0"==e&&1/t==-s?"-0":e}function zt(t){if(null!=t){try{return tt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function qt(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(qt.Cache||Bt),r}function Zt(t,e){return t===e||t!=t&&e!=e}function Vt(t){return function(t){return Xt(t)&&Gt(t)}(t)&&et.call(t,"callee")&&(!st.call(t,"callee")||rt.call(t)==c)}qt.Cache=Bt;var Wt=Array.isArray;function Gt(t){return null!=t&&Yt(t.length)&&!Kt(t)}function Kt(t){var e=Jt(t)?rt.call(t):"";return e==d||e==p}function Yt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function Jt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Xt(t){return!!t&&"object"==typeof t}function Qt(t){return"symbol"==typeof t||Xt(t)&&rt.call(t)==S}var te=$?function(t){return function(e){return t(e)}}($):function(t){return Xt(t)&&Yt(t.length)&&!!I[rt.call(t)]};function ee(t){return Gt(t)?function(t,e){var r=Wt(t)||Vt(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,i=!!n;for(var o in t)!e&&!et.call(t,o)||i&&("length"==o||Pt(o,n))||r.push(o);return r}(t):function(t){if(r=(e=t)&&e.constructor,e!==("function"==typeof r&&r.prototype||J))return ct(t);var e,r,n=[];for(var i in Object(t))et.call(t,i)&&"constructor"!=i&&n.push(i);return n}(t)}function re(t){return t}t.exports=function(t,e){var r,n,s,a,c,u={};return e="function"==typeof(r=e)?r:null==r?re:"object"==typeof r?Wt(r)?function(t,e){return jt(t)&&Ut(e)?Ft(Ht(t),e):function(r){var n=function(t,e,r){var n=null==t?void 0:Ot(t,e);return void 0===n?void 0:n}(r,t);return void 0===n&&n===e?function(t,e){return null!=t&&function(t,e,r){for(var n,i=-1,o=(e=jt(e,t)?[e]:xt(e)).length;++i<o;){var s=Ht(e[i]);if(!(n=null!=t&&r(t,s)))break;t=t[s]}return n||!!(o=t?t.length:0)&&Yt(o)&&Pt(s,o)&&(Wt(t)||Vt(t))}(t,e,Lt)}(r,t):kt(e,n,void 0,i|o)}}(r[0],r[1]):(s=function(t){for(var e=ee(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,Ut(i)]}return e}(n=r),1==s.length&&s[0][2]?Ft(s[0][0],s[0][1]):function(t){return t===n||function(t,e,r,n){var s=r.length,a=s;if(null==t)return!a;for(t=Object(t);s--;){var c=r[s];if(c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++s<a;){var u=(c=r[s])[0],f=t[u],h=c[1];if(c[2]){if(void 0===f&&!(u in t))return!1}else{var l,d=new Rt;if(!(void 0===l?kt(h,f,n,i|o,d):l))return!1}}return!0}(t,0,s)}):jt(a=r)?(c=Ht(a),function(t){return null==t?void 0:t[c]}):function(t){return function(e){return Ot(e,t)}}(a),function(t,e){t&&function(t,e,r){for(var n=-1,i=Object(t),o=r(t),s=o.length;s--;){var a=o[++n];if(!1===e(i[a],a,i))break}}(t,e,ee)}(t,(function(t,r,n){u[r]=e(t,r,n)})),u}},107:(t,e,r)=>{t=r.nmd(t);var n="__lodash_hash_undefined__",i=1,o=2,s=1/0,a=9007199254740991,c="[object Arguments]",u="[object Array]",f="[object Boolean]",h="[object Date]",l="[object Error]",d="[object Function]",p="[object GeneratorFunction]",g="[object Map]",y="[object Number]",m="[object Object]",b="[object Promise]",w="[object RegExp]",_="[object Set]",v="[object String]",S="[object Symbol]",E="[object WeakMap]",T="[object ArrayBuffer]",B="[object DataView]",C=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,R=/^\w*$/,A=/^\./,O=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,L=/\\(\\)?/g,k=/^\[object .+?Constructor\]$/,x=/^(?:0|[1-9]\d*)$/,I={};I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I[c]=I[u]=I[T]=I[f]=I[B]=I[h]=I[l]=I[d]=I[g]=I[y]=I[m]=I[w]=I[_]=I[v]=I[E]=!1;var M="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,N="object"==typeof self&&self&&self.Object===Object&&self,D=M||N||Function("return this")(),P=e&&!e.nodeType&&e,j=P&&t&&!t.nodeType&&t,U=j&&j.exports===P&&M.process,F=function(){try{return U&&U.binding("util")}catch(t){}}(),$=F&&F.isTypedArray;function H(t,e,r,n){for(var i=-1,o=t?t.length:0;++i<o;){var s=t[i];e(n,s,r(s),t)}return n}function z(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function q(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function Z(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function V(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var W,G,K,Y=Array.prototype,J=Function.prototype,X=Object.prototype,Q=D["__core-js_shared__"],tt=(W=/[^.]+$/.exec(Q&&Q.keys&&Q.keys.IE_PROTO||""))?"Symbol(src)_1."+W:"",et=J.toString,rt=X.hasOwnProperty,nt=X.toString,it=RegExp("^"+et.call(rt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ot=D.Symbol,st=D.Uint8Array,at=X.propertyIsEnumerable,ct=Y.splice,ut=(G=Object.keys,K=Object,function(t){return G(K(t))}),ft=Ft(D,"DataView"),ht=Ft(D,"Map"),lt=Ft(D,"Promise"),dt=Ft(D,"Set"),pt=Ft(D,"WeakMap"),gt=Ft(Object,"create"),yt=Gt(ft),mt=Gt(ht),bt=Gt(lt),wt=Gt(dt),_t=Gt(pt),vt=ot?ot.prototype:void 0,St=vt?vt.valueOf:void 0,Et=vt?vt.toString:void 0;function Tt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Bt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Ct(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Rt(t){var e=-1,r=t?t.length:0;for(this.__data__=new Ct;++e<r;)this.add(t[e])}function At(t){this.__data__=new Bt(t)}function Ot(t,e){for(var r=t.length;r--;)if(Qt(t[r][0],e))return r;return-1}function Lt(t,e,r,n){return xt(t,(function(t,i,o){e(n,t,r(t),o)})),n}Tt.prototype.clear=function(){this.__data__=gt?gt(null):{}},Tt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Tt.prototype.get=function(t){var e=this.__data__;if(gt){var r=e[t];return r===n?void 0:r}return rt.call(e,t)?e[t]:void 0},Tt.prototype.has=function(t){var e=this.__data__;return gt?void 0!==e[t]:rt.call(e,t)},Tt.prototype.set=function(t,e){return this.__data__[t]=gt&&void 0===e?n:e,this},Bt.prototype.clear=function(){this.__data__=[]},Bt.prototype.delete=function(t){var e=this.__data__,r=Ot(e,t);return!(r<0||(r==e.length-1?e.pop():ct.call(e,r,1),0))},Bt.prototype.get=function(t){var e=this.__data__,r=Ot(e,t);return r<0?void 0:e[r][1]},Bt.prototype.has=function(t){return Ot(this.__data__,t)>-1},Bt.prototype.set=function(t,e){var r=this.__data__,n=Ot(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Ct.prototype.clear=function(){this.__data__={hash:new Tt,map:new(ht||Bt),string:new Tt}},Ct.prototype.delete=function(t){return Ut(this,t).delete(t)},Ct.prototype.get=function(t){return Ut(this,t).get(t)},Ct.prototype.has=function(t){return Ut(this,t).has(t)},Ct.prototype.set=function(t,e){return Ut(this,t).set(t,e),this},Rt.prototype.add=Rt.prototype.push=function(t){return this.__data__.set(t,n),this},Rt.prototype.has=function(t){return this.__data__.has(t)},At.prototype.clear=function(){this.__data__=new Bt},At.prototype.delete=function(t){return this.__data__.delete(t)},At.prototype.get=function(t){return this.__data__.get(t)},At.prototype.has=function(t){return this.__data__.has(t)},At.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Bt){var n=r.__data__;if(!ht||n.length<199)return n.push([t,e]),this;r=this.__data__=new Ct(n)}return r.set(t,e),this};var kt,xt=(kt=function(t,e){return t&&It(t,e,ue)},function(t,e){if(null==t)return t;if(!re(t))return kt(t,e);for(var r=t.length,n=-1,i=Object(t);++n<r&&!1!==e(i[n],n,i););return t}),It=function(t,e,r){for(var n=-1,i=Object(t),o=r(t),s=o.length;s--;){var a=o[++n];if(!1===e(i[a],a,i))break}return t};function Mt(t,e){for(var r=0,n=(e=zt(e,t)?[e]:Pt(e)).length;null!=t&&r<n;)t=t[Wt(e[r++])];return r&&r==n?t:void 0}function Nt(t,e){return null!=t&&e in Object(t)}function Dt(t,e,r,n,s){return t===e||(null==t||null==e||!oe(t)&&!se(e)?t!=t&&e!=e:function(t,e,r,n,s,a){var d=ee(t),p=ee(e),b=u,E=u;d||(b=(b=$t(t))==c?m:b),p||(E=(E=$t(e))==c?m:E);var C=b==m&&!q(t),R=E==m&&!q(e),A=b==E;if(A&&!C)return a||(a=new At),d||ce(t)?jt(t,e,r,n,s,a):function(t,e,r,n,s,a,c){switch(r){case B:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case T:return!(t.byteLength!=e.byteLength||!n(new st(t),new st(e)));case f:case h:case y:return Qt(+t,+e);case l:return t.name==e.name&&t.message==e.message;case w:case v:return t==e+"";case g:var u=Z;case _:var d=a&o;if(u||(u=V),t.size!=e.size&&!d)return!1;var p=c.get(t);if(p)return p==e;a|=i,c.set(t,e);var m=jt(u(t),u(e),n,s,a,c);return c.delete(t),m;case S:if(St)return St.call(t)==St.call(e)}return!1}(t,e,b,r,n,s,a);if(!(s&o)){var O=C&&rt.call(t,"__wrapped__"),L=R&&rt.call(e,"__wrapped__");if(O||L){var k=O?t.value():t,x=L?e.value():e;return a||(a=new At),r(k,x,n,s,a)}}return!!A&&(a||(a=new At),function(t,e,r,n,i,s){var a=i&o,c=ue(t),u=c.length;if(u!=ue(e).length&&!a)return!1;for(var f=u;f--;){var h=c[f];if(!(a?h in e:rt.call(e,h)))return!1}var l=s.get(t);if(l&&s.get(e))return l==e;var d=!0;s.set(t,e),s.set(e,t);for(var p=a;++f<u;){var g=t[h=c[f]],y=e[h];if(n)var m=a?n(y,g,h,e,t,s):n(g,y,h,t,e,s);if(!(void 0===m?g===y||r(g,y,n,i,s):m)){d=!1;break}p||(p="constructor"==h)}if(d&&!p){var b=t.constructor,w=e.constructor;b==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(d=!1)}return s.delete(t),s.delete(e),d}(t,e,r,n,s,a))}(t,e,Dt,r,n,s))}function Pt(t){return ee(t)?t:Vt(t)}function jt(t,e,r,n,s,a){var c=s&o,u=t.length,f=e.length;if(u!=f&&!(c&&f>u))return!1;var h=a.get(t);if(h&&a.get(e))return h==e;var l=-1,d=!0,p=s&i?new Rt:void 0;for(a.set(t,e),a.set(e,t);++l<u;){var g=t[l],y=e[l];if(n)var m=c?n(y,g,l,e,t,a):n(g,y,l,t,e,a);if(void 0!==m){if(m)continue;d=!1;break}if(p){if(!z(e,(function(t,e){if(!p.has(e)&&(g===t||r(g,t,n,s,a)))return p.add(e)}))){d=!1;break}}else if(g!==y&&!r(g,y,n,s,a)){d=!1;break}}return a.delete(t),a.delete(e),d}function Ut(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Ft(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!oe(t)||function(t){return!!tt&&tt in t}(t))&&(ne(t)||q(t)?it:k).test(Gt(t))}(r)?r:void 0}var $t=function(t){return nt.call(t)};function Ht(t,e){return!!(e=null==e?a:e)&&("number"==typeof t||x.test(t))&&t>-1&&t%1==0&&t<e}function zt(t,e){if(ee(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!ae(t))||R.test(t)||!C.test(t)||null!=e&&t in Object(e)}function qt(t){return t==t&&!oe(t)}function Zt(t,e){return function(r){return null!=r&&r[t]===e&&(void 0!==e||t in Object(r))}}(ft&&$t(new ft(new ArrayBuffer(1)))!=B||ht&&$t(new ht)!=g||lt&&$t(lt.resolve())!=b||dt&&$t(new dt)!=_||pt&&$t(new pt)!=E)&&($t=function(t){var e=nt.call(t),r=e==m?t.constructor:void 0,n=r?Gt(r):void 0;if(n)switch(n){case yt:return B;case mt:return g;case bt:return b;case wt:return _;case _t:return E}return e});var Vt=Xt((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(ae(t))return Et?Et.call(t):"";var e=t+"";return"0"==e&&1/t==-s?"-0":e}(e);var r=[];return A.test(t)&&r.push(""),t.replace(O,(function(t,e,n,i){r.push(n?i.replace(L,"$1"):e||t)})),r}));function Wt(t){if("string"==typeof t||ae(t))return t;var e=t+"";return"0"==e&&1/t==-s?"-0":e}function Gt(t){if(null!=t){try{return et.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var Kt,Yt,Jt=(Kt=function(t,e,r){t[r?0:1].push(e)},Yt=function(){return[[],[]]},function(t,e){var r,n,s,a,c,u=ee(t)?H:Lt,f=Yt?[[],[]]:{};return u(t,Kt,"function"==typeof(r=e)?r:null==r?fe:"object"==typeof r?ee(r)?function(t,e){return zt(t)&&qt(e)?Zt(Wt(t),e):function(r){var n=function(t,e,r){var n=null==t?void 0:Mt(t,e);return void 0===n?void 0:n}(r,t);return void 0===n&&n===e?function(t,e){return null!=t&&function(t,e,r){for(var n,i=-1,o=(e=zt(e,t)?[e]:Pt(e)).length;++i<o;){var s=Wt(e[i]);if(!(n=null!=t&&r(t,s)))break;t=t[s]}return n||!!(o=t?t.length:0)&&ie(o)&&Ht(s,o)&&(ee(t)||te(t))}(t,e,Nt)}(r,t):Dt(e,n,void 0,i|o)}}(r[0],r[1]):1==(s=function(t){for(var e=ue(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,qt(i)]}return e}(n=r)).length&&s[0][2]?Zt(s[0][0],s[0][1]):function(t){return t===n||function(t,e,r,n){var s=r.length,a=s;if(null==t)return!a;for(t=Object(t);s--;){var c=r[s];if(c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++s<a;){var u=(c=r[s])[0],f=t[u],h=c[1];if(c[2]){if(void 0===f&&!(u in t))return!1}else{var l,d=new At;if(!(void 0===l?Dt(h,f,n,i|o,d):l))return!1}}return!0}(t,0,s)}:zt(a=r)?(c=Wt(a),function(t){return null==t?void 0:t[c]}):function(t){return function(e){return Mt(e,t)}}(a),f)});function Xt(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(Xt.Cache||Ct),r}function Qt(t,e){return t===e||t!=t&&e!=e}function te(t){return function(t){return se(t)&&re(t)}(t)&&rt.call(t,"callee")&&(!at.call(t,"callee")||nt.call(t)==c)}Xt.Cache=Ct;var ee=Array.isArray;function re(t){return null!=t&&ie(t.length)&&!ne(t)}function ne(t){var e=oe(t)?nt.call(t):"";return e==d||e==p}function ie(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function oe(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function se(t){return!!t&&"object"==typeof t}function ae(t){return"symbol"==typeof t||se(t)&&nt.call(t)==S}var ce=$?function(t){return function(e){return t(e)}}($):function(t){return se(t)&&ie(t.length)&&!!I[nt.call(t)]};function ue(t){return re(t)?function(t,e){var r=ee(t)||te(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,i=!!n;for(var o in t)!e&&!rt.call(t,o)||i&&("length"==o||Ht(o,n))||r.push(o);return r}(t):function(t){if(r=(e=t)&&e.constructor,e!==("function"==typeof r&&r.prototype||X))return ut(t);var e,r,n=[];for(var i in Object(t))rt.call(t,i)&&"constructor"!=i&&n.push(i);return n}(t)}function fe(t){return t}t.exports=Jt},3545:t=>{var e=1/0,r=4294967295,n=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt,c=Object.prototype.toString,u=Math.min;function f(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function h(t){return t}t.exports=function(t,l){if((t=function(t){var r=function(t){return t?(t=function(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==c.call(t)}(t))return NaN;if(f(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=f(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(n,"");var r=o.test(t);return r||s.test(t)?a(t.slice(2),r?2:8):i.test(t)?NaN:+t}(t))===e||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}(t),u=r%1;return r==r?u?r-u:r:0}(t))<1||t>9007199254740991)return[];var d=r,p=u(t,r);t-=r;for(var g=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(p,l="function"==typeof l?l:h);++d<t;)l(d);return g}},9500:(t,e,r)=>{var n=r(87),i=r(6883),o=r(7172).Buffer,s=new Array(16);function a(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(t,e){return t<<e|t>>>32-e}function u(t,e,r,n,i,o,s){return c(t+(e&r|~e&n)+i+o|0,s)+e|0}function f(t,e,r,n,i,o,s){return c(t+(e&n|r&~n)+i+o|0,s)+e|0}function h(t,e,r,n,i,o,s){return c(t+(e^r^n)+i+o|0,s)+e|0}function l(t,e,r,n,i,o,s){return c(t+(r^(e|~n))+i+o|0,s)+e|0}n(a,i),a.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,o=this._d;r=u(r,n,i,o,t[0],3614090360,7),o=u(o,r,n,i,t[1],3905402710,12),i=u(i,o,r,n,t[2],606105819,17),n=u(n,i,o,r,t[3],3250441966,22),r=u(r,n,i,o,t[4],4118548399,7),o=u(o,r,n,i,t[5],1200080426,12),i=u(i,o,r,n,t[6],2821735955,17),n=u(n,i,o,r,t[7],4249261313,22),r=u(r,n,i,o,t[8],1770035416,7),o=u(o,r,n,i,t[9],2336552879,12),i=u(i,o,r,n,t[10],4294925233,17),n=u(n,i,o,r,t[11],2304563134,22),r=u(r,n,i,o,t[12],1804603682,7),o=u(o,r,n,i,t[13],4254626195,12),i=u(i,o,r,n,t[14],2792965006,17),r=f(r,n=u(n,i,o,r,t[15],1236535329,22),i,o,t[1],4129170786,5),o=f(o,r,n,i,t[6],3225465664,9),i=f(i,o,r,n,t[11],643717713,14),n=f(n,i,o,r,t[0],3921069994,20),r=f(r,n,i,o,t[5],3593408605,5),o=f(o,r,n,i,t[10],38016083,9),i=f(i,o,r,n,t[15],3634488961,14),n=f(n,i,o,r,t[4],3889429448,20),r=f(r,n,i,o,t[9],568446438,5),o=f(o,r,n,i,t[14],3275163606,9),i=f(i,o,r,n,t[3],4107603335,14),n=f(n,i,o,r,t[8],1163531501,20),r=f(r,n,i,o,t[13],2850285829,5),o=f(o,r,n,i,t[2],4243563512,9),i=f(i,o,r,n,t[7],1735328473,14),r=h(r,n=f(n,i,o,r,t[12],2368359562,20),i,o,t[5],4294588738,4),o=h(o,r,n,i,t[8],2272392833,11),i=h(i,o,r,n,t[11],1839030562,16),n=h(n,i,o,r,t[14],4259657740,23),r=h(r,n,i,o,t[1],2763975236,4),o=h(o,r,n,i,t[4],1272893353,11),i=h(i,o,r,n,t[7],4139469664,16),n=h(n,i,o,r,t[10],3200236656,23),r=h(r,n,i,o,t[13],681279174,4),o=h(o,r,n,i,t[0],3936430074,11),i=h(i,o,r,n,t[3],3572445317,16),n=h(n,i,o,r,t[6],76029189,23),r=h(r,n,i,o,t[9],3654602809,4),o=h(o,r,n,i,t[12],3873151461,11),i=h(i,o,r,n,t[15],530742520,16),r=l(r,n=h(n,i,o,r,t[2],3299628645,23),i,o,t[0],4096336452,6),o=l(o,r,n,i,t[7],1126891415,10),i=l(i,o,r,n,t[14],2878612391,15),n=l(n,i,o,r,t[5],4237533241,21),r=l(r,n,i,o,t[12],1700485571,6),o=l(o,r,n,i,t[3],2399980690,10),i=l(i,o,r,n,t[10],4293915773,15),n=l(n,i,o,r,t[1],2240044497,21),r=l(r,n,i,o,t[8],1873313359,6),o=l(o,r,n,i,t[15],4264355552,10),i=l(i,o,r,n,t[6],2734768916,15),n=l(n,i,o,r,t[13],1309151649,21),r=l(r,n,i,o,t[4],4149444226,6),o=l(o,r,n,i,t[11],3174756917,10),i=l(i,o,r,n,t[2],718787259,15),n=l(n,i,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=a},7859:t=>{function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},6938:t=>{var e={};function r(t,r,n){n||(n=Error);var i=function(t){var e,n;function i(e,n,i){return t.call(this,function(t,e,n){return"string"==typeof r?r:r(t,e,n)}(e,n,i))||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function n(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,o,s,a,c;if("string"==typeof e&&(o="not ",e.substr(0,4)===o)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-9,r)===e}(t," argument"))s="The ".concat(t," ").concat(i," ").concat(n(e,"type"));else{var u=("number"!=typeof c&&(c=0),c+1>(a=t).length||-1===a.indexOf(".",c)?"argument":"property");s='The "'.concat(t,'" ').concat(u," ").concat(i," ").concat(n(e,"type"))}return s+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},4439:(t,e,r)=>{var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=u;var i=r(5327),o=r(4567);r(87)(u,i);for(var s=n(o.prototype),a=0;a<s.length;a++){var c=s[a];u.prototype[c]||(u.prototype[c]=o.prototype[c])}function u(t){if(!(this instanceof u))return new u(t);i.call(this,t),o.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||process.nextTick(h,this)}function h(t){t.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})},3754:(t,e,r)=>{t.exports=i;var n=r(2175);function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r(87)(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},5327:(t,e,r)=>{var n;t.exports=T,T.ReadableState=E,r(343).EventEmitter;var i,o=function(t,e){return t.listeners(e).length},s=r(6052),a=r(816).Buffer,c=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},u=r(1632);i=u&&u.debuglog?u.debuglog("stream"):function(){};var f,h,l,d=r(7712),p=r(7640),g=r(5985).getHighWaterMark,y=r(6938).q,m=y.ERR_INVALID_ARG_TYPE,b=y.ERR_STREAM_PUSH_AFTER_EOF,w=y.ERR_METHOD_NOT_IMPLEMENTED,_=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(87)(T,s);var v=p.errorOrDestroy,S=["error","close","destroy","pause","resume"];function E(t,e,i){n=n||r(4439),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(f||(f=r(4361).s),this.decoder=new f(t.encoding),this.encoding=t.encoding)}function T(t){if(n=n||r(4439),!(this instanceof T))return new T(t);var e=this instanceof n;this._readableState=new E(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function B(t,e,r,n,o){i("readableAddChunk",e);var s,u=t._readableState;if(null===e)u.reading=!1,function(t,e){if(i("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?O(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,L(t)))}}(t,u);else if(o||(s=function(t,e){var r,n;return n=e,a.isBuffer(n)||n instanceof c||"string"==typeof e||void 0===e||t.objectMode||(r=new m("chunk",["string","Buffer","Uint8Array"],e)),r}(u,e)),s)v(t,s);else if(u.objectMode||e&&e.length>0)if("string"==typeof e||u.objectMode||Object.getPrototypeOf(e)===a.prototype||(e=function(t){return a.from(t)}(e)),n)u.endEmitted?v(t,new _):C(t,u,e,!0);else if(u.ended)v(t,new b);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(e=u.decoder.write(e),u.objectMode||0!==e.length?C(t,u,e,!1):k(t,u)):C(t,u,e,!1)}else n||(u.reading=!1,k(t,u));return!u.ended&&(u.length<u.highWaterMark||0===u.length)}function C(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&O(t)),k(t,e)}Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),T.prototype.destroy=p.destroy,T.prototype._undestroy=p.undestroy,T.prototype._destroy=function(t,e){e(t)},T.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=a.from(t,e),e=""),r=!0),B(this,t,e,!1,r)},T.prototype.unshift=function(t){return B(this,t,null,!0,!1)},T.prototype.isPaused=function(){return!1===this._readableState.flowing},T.prototype.setEncoding=function(t){f||(f=r(4361).s);var e=new f(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=e.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var R=1073741824;function A(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=R?t=R:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function O(t){var e=t._readableState;i("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(i("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(L,t))}function L(t){var e=t._readableState;i("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,D(t)}function k(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(x,t,e))}function x(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(i("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function I(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function M(t){i("readable nexttick read 0"),t.read(0)}function N(t,e){i("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),D(t),e.flowing&&!e.reading&&t.read(0)}function D(t){var e=t._readableState;for(i("flow",e.flowing);e.flowing&&null!==t.read(););}function P(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function j(t){var e=t._readableState;i("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(U,e,t))}function U(t,e){if(i("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function F(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}T.prototype.read=function(t){i("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return i("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?j(this):O(this),null;if(0===(t=A(t,e))&&e.ended)return 0===e.length&&j(this),null;var n,o=e.needReadable;return i("need readable",o),(0===e.length||e.length-t<e.highWaterMark)&&i("length less than watermark",o=!0),e.ended||e.reading?i("reading or ended",o=!1):o&&(i("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=A(r,e))),null===(n=t>0?P(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&j(this)),null!==n&&this.emit("data",n),n},T.prototype._read=function(t){v(this,new w("_read()"))},T.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,i("pipe count=%d opts=%j",n.pipesCount,e);var s=e&&!1===e.end||t===process.stdout||t===process.stderr?p:a;function a(){i("onend"),t.end()}n.endEmitted?process.nextTick(s):r.once("end",s),t.on("unpipe",(function e(o,s){i("onunpipe"),o===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,i("cleanup"),t.removeListener("close",l),t.removeListener("finish",d),t.removeListener("drain",c),t.removeListener("error",h),t.removeListener("unpipe",e),r.removeListener("end",a),r.removeListener("end",p),r.removeListener("data",f),u=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}));var c=function(t){return function(){var e=t._readableState;i("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,D(t))}}(r);t.on("drain",c);var u=!1;function f(e){i("ondata");var o=t.write(e);i("dest.write",o),!1===o&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==F(n.pipes,t))&&!u&&(i("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(e){i("onerror",e),p(),t.removeListener("error",h),0===o(t,"error")&&v(t,e)}function l(){t.removeListener("finish",d),p()}function d(){i("onfinish"),t.removeListener("close",l),p()}function p(){i("unpipe"),r.unpipe(t)}return r.on("data",f),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",h),t.once("close",l),t.once("finish",d),t.emit("pipe",r),n.flowing||(i("pipe resume"),r.resume()),t},T.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=F(e.pipes,t);return-1===s||(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},T.prototype.on=function(t,e){var r=s.prototype.on.call(this,t,e),n=this._readableState;return"data"===t?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,i("on readable",n.length,n.reading),n.length?O(this):n.reading||process.nextTick(M,this))),r},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(t,e){var r=s.prototype.removeListener.call(this,t,e);return"readable"===t&&process.nextTick(I,this),r},T.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||process.nextTick(I,this),e},T.prototype.resume=function(){var t=this._readableState;return t.flowing||(i("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(N,t,e))}(this,t)),t.paused=!1,this},T.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},T.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var o in t.on("end",(function(){if(i("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(o){i("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o||(r.objectMode||o&&o.length)&&(e.push(o)||(n=!0,t.pause()))})),t)void 0===this[o]&&"function"==typeof t[o]&&(this[o]=function(e){return function(){return t[e].apply(t,arguments)}}(o));for(var s=0;s<S.length;s++)t.on(S[s],this.emit.bind(this,S[s]));return this._read=function(e){i("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"==typeof Symbol&&(T.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=r(4157)),h(this)}),Object.defineProperty(T.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(T.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(T.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),T._fromList=P,Object.defineProperty(T.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(T.from=function(t,e){return void 0===l&&(l=r(5800)),l(T,t,e)})},2175:(t,e,r)=>{t.exports=f;var n=r(6938).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,c=r(4439);function u(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function f(t){if(!(this instanceof f))return new f(t);c.call(this,t),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",h)}function h(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?l(this,null,null):this._flush((function(e,r){l(t,e,r)}))}function l(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new a;if(t._transformState.transforming)throw new s;return t.push(null)}r(87)(f,c),f.prototype.push=function(t,e){return this._transformState.needTransform=!1,c.prototype.push.call(this,t,e)},f.prototype._transform=function(t,e,r){r(new i("_transform()"))},f.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},f.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},f.prototype._destroy=function(t,e){c.prototype._destroy.call(this,t,(function(t){e(t)}))}},4567:(t,e,r)=>{function n(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(undefined),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var i;t.exports=T,T.WritableState=E;var o,s={deprecate:r(7451)},a=r(6052),c=r(816).Buffer,u=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},f=r(7640),h=r(5985).getHighWaterMark,l=r(6938).q,d=l.ERR_INVALID_ARG_TYPE,p=l.ERR_METHOD_NOT_IMPLEMENTED,g=l.ERR_MULTIPLE_CALLBACK,y=l.ERR_STREAM_CANNOT_PIPE,m=l.ERR_STREAM_DESTROYED,b=l.ERR_STREAM_NULL_VALUES,w=l.ERR_STREAM_WRITE_AFTER_END,_=l.ERR_UNKNOWN_ENCODING,v=f.errorOrDestroy;function S(){}function E(t,e,o){i=i||r(4439),t=t||{},"boolean"!=typeof o&&(o=e instanceof i),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(L,t,e),t._writableState.errorEmitted=!0,v(t,n)):(i(n),t._writableState.errorEmitted=!0,v(t,n),L(t,e))}(t,r,n,e,i);else{var o=A(r)||t.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||R(t,r),n?process.nextTick(C,t,r,o,i):C(t,r,o,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}function T(t){var e=this instanceof(i=i||r(4439));if(!e&&!o.call(T,this))return new T(t);this._writableState=new E(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),a.call(this)}function B(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new m("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function C(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),L(t,e)}function R(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,o=new Array(i),s=e.corkedRequestsFree;s.entry=r;for(var a=0,c=!0;r;)o[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;o.allBuffers=c,B(t,e,!0,e.length,o,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new n(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,f=r.encoding,h=r.callback;if(B(t,e,!1,e.objectMode?1:u.length,u,f,h),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function A(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function O(t,e){t._final((function(r){e.pendingcb--,r&&v(t,r),e.prefinished=!0,t.emit("prefinish"),L(t,e)}))}function L(t,e){var r=A(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,process.nextTick(O,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}r(87)(T,a),E.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(E.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(t){return!!o.call(this,t)||this===T&&t&&t._writableState instanceof E}})):o=function(t){return t instanceof this},T.prototype.pipe=function(){v(this,new y)},T.prototype.write=function(t,e,r){var n,i=this._writableState,o=!1,s=!i.objectMode&&(n=t,c.isBuffer(n)||n instanceof u);return s&&!c.isBuffer(t)&&(t=function(t){return c.from(t)}(t)),"function"==typeof e&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=S),i.ending?function(t,e){var r=new w;v(t,r),process.nextTick(e,r)}(this,r):(s||function(t,e,r,n){var i;return null===r?i=new b:"string"==typeof r||e.objectMode||(i=new d("chunk",["string","Buffer"],r)),!i||(v(t,i),process.nextTick(n,i),!1)}(this,i,t,r))&&(i.pendingcb++,o=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=c.from(e,r)),e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var f=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},f?f.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else B(t,e,!1,a,n,i,o);return u}(this,i,s,t,e,r)),o},T.prototype.cork=function(){this._writableState.corked++},T.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||R(this,t))},T.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(t,e,r){r(new p("_write()"))},T.prototype._writev=null,T.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,L(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),T.prototype.destroy=f.destroy,T.prototype._undestroy=f.undestroy,T.prototype._destroy=function(t,e){e(t)}},4157:(t,e,r)=>{var n;function i(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o=r(5027),s=Symbol("lastResolve"),a=Symbol("lastReject"),c=Symbol("error"),u=Symbol("ended"),f=Symbol("lastPromise"),h=Symbol("handlePromise"),l=Symbol("stream");function d(t,e){return{value:t,done:e}}function p(t){var e=t[s];if(null!==e){var r=t[l].read();null!==r&&(t[f]=null,t[s]=null,t[a]=null,e(d(r,!1)))}}function g(t){process.nextTick(p,t)}var y=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((i(n={get stream(){return this[l]},next:function(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[u])return Promise.resolve(d(void 0,!0));if(this[l].destroyed)return new Promise((function(e,r){process.nextTick((function(){t[c]?r(t[c]):e(d(void 0,!0))}))}));var r,n=this[f];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[u]?r(d(void 0,!0)):e[h](r,n)}),n)}}(n,this));else{var i=this[l].read();if(null!==i)return Promise.resolve(d(i,!1));r=new Promise(this[h])}return this[f]=r,r}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var t=this;return new Promise((function(e,r){t[l].destroy(null,(function(t){t?r(t):e(d(void 0,!0))}))}))})),n),y);t.exports=function(t){var e,r=Object.create(m,(i(e={},l,{value:t,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,a,{value:null,writable:!0}),i(e,c,{value:null,writable:!0}),i(e,u,{value:t._readableState.endEmitted,writable:!0}),i(e,h,{value:function(t,e){var n=r[l].read();n?(r[f]=null,r[s]=null,r[a]=null,t(d(n,!1))):(r[s]=t,r[a]=e)},writable:!0}),e));return r[f]=null,o(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[a];return null!==e&&(r[f]=null,r[s]=null,r[a]=null,e(t)),void(r[c]=t)}var n=r[s];null!==n&&(r[f]=null,r[s]=null,r[a]=null,n(d(void 0,!0))),r[u]=!0})),t.on("readable",g.bind(null,r)),r}},7712:(t,e,r)=>{function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){o(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function o(t,e,r){return(e=a(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function a(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}var c=r(816).Buffer,u=r(471).inspect,f=u&&u.custom||"inspect";t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,r;return e=t,(r=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return c.alloc(0);for(var e,r,n,i=c.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=o.data,r=i,n=s,c.prototype.copy.call(e,r,n),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,o=t>i.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=c.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:f,value:function(t,e){return u(this,i(i({},e),{},{depth:0,customInspect:!1}))}}])&&s(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}()},7640:t=>{function e(t,e){n(t,e),r(t)}function r(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function n(t,e){t.emit("error",e)}t.exports={destroy:function(t,i){var o=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(i?i(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(n,this,t)):process.nextTick(n,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!i&&t?o._writableState?o._writableState.errorEmitted?process.nextTick(r,o):(o._writableState.errorEmitted=!0,process.nextTick(e,o,t)):process.nextTick(e,o,t):i?(process.nextTick(r,o),i(t)):process.nextTick(r,o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}},5027:(t,e,r)=>{var n=r(6938).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&e.readable,a=r.writable||!1!==r.writable&&e.writable,c=function(){e.writable||f()},u=e._writableState&&e._writableState.finished,f=function(){a=!1,u=!0,s||o.call(e)},h=e._readableState&&e._readableState.endEmitted,l=function(){s=!1,h=!0,a||o.call(e)},d=function(t){o.call(e,t)},p=function(){var t;return s&&!h?(e._readableState&&e._readableState.ended||(t=new n),o.call(e,t)):a&&!u?(e._writableState&&e._writableState.ended||(t=new n),o.call(e,t)):void 0},g=function(){e.req.on("finish",f)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",f),e.on("abort",p),e.req?g():e.on("request",g)):a&&!e._writableState&&(e.on("end",c),e.on("close",c)),e.on("end",l),e.on("finish",f),!1!==r.error&&e.on("error",d),e.on("close",p),function(){e.removeListener("complete",f),e.removeListener("abort",p),e.removeListener("request",g),e.req&&e.req.removeListener("finish",f),e.removeListener("end",c),e.removeListener("close",c),e.removeListener("finish",f),e.removeListener("end",l),e.removeListener("error",d),e.removeListener("close",p)}}},5800:t=>{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},410:(t,e,r)=>{var n,i=r(6938).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function c(t){t()}function u(t,e){return t.pipe(e)}t.exports=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];var f,h=function(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new o("streams");var l=e.map((function(t,i){var o=i<e.length-1;return function(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var a=!1;t.on("close",(function(){a=!0})),void 0===n&&(n=r(5027)),n(t,{readable:e,writable:i},(function(t){if(t)return o(t);a=!0,o()}));var c=!1;return function(e){if(!a&&!c)return c=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}(t,o,i>0,(function(t){f||(f=t),t&&l.forEach(c),o||(l.forEach(c),h(f))}))}));return e.reduce(u)}},5985:(t,e,r)=>{var n=r(6938).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},6052:(t,e,r)=>{t.exports=r(343).EventEmitter},8310:(t,e,r)=>{(e=t.exports=r(5327)).Stream=e,e.Readable=e,e.Writable=r(4567),e.Duplex=r(4439),e.Transform=r(2175),e.PassThrough=r(3754),e.finished=r(5027),e.pipeline=r(410)},7172:(t,e,r)=>{var n=r(816),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},3573:(t,e,r)=>{e.C4=void 0;var n,i=r(816),o=(n=r(350))&&n.__esModule?n:{default:n},s=function(t){var e=t.allowedSizes,r=t.defaultSize,n=t.padding;return function t(){var s=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;if(!this||this.constructor!==t)return new t(a);if(e&&!e.includes(a))throw new Error("Unsupported hash length");var c=new o.default({capacity:a});return this.update=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";if(i.Buffer.isBuffer(t))return c.absorb(t),s;if("string"==typeof t)return s.update(i.Buffer.from(t,e));throw new TypeError("Not a string or buffer")},this.digest=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"binary",e="string"==typeof t?{format:t}:t,r=c.squeeze({buffer:e.buffer,padding:e.padding||n});return e.format&&"binary"!==e.format?r.toString(e.format):r},this.reset=function(){return c.reset(),s},this}},a=s({allowedSizes:[224,256,384,512],defaultSize:512,padding:1});e.C4=a;var c=s({allowedSizes:[224,256,384,512],defaultSize:512,padding:6});s({allowedSizes:[128,256],defaultSize:256,padding:31});var u=a;c.SHA3Hash=u},350:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=r(816),o=(n=r(5037))&&n.__esModule?n:{default:n},s=function(t,e){for(var r=0;r<t.length;r+=8){var n=r/4;e[n]^=t[r+7]<<24|t[r+6]<<16|t[r+5]<<8|t[r+4],e[n+1]^=t[r+3]<<24|t[r+2]<<16|t[r+1]<<8|t[r]}return e},a=function(t,e){for(var r=0;r<e.length;r+=8){var n=r/4;e[r]=t[n+1],e[r+1]=t[n+1]>>>8,e[r+2]=t[n+1]>>>16,e[r+3]=t[n+1]>>>24,e[r+4]=t[n],e[r+5]=t[n]>>>8,e[r+6]=t[n]>>>16,e[r+7]=t[n]>>>24}return e};e.default=function(t){var e=this,r=t.capacity,n=t.padding,c=(0,o.default)(),u=r/8,f=200-r/4,h=0,l=new Uint32Array(50),d=i.Buffer.allocUnsafe(f);return this.absorb=function(t){for(var r=0;r<t.length;r++)d[h]=t[r],(h+=1)>=f&&(s(d,l),c(l),h=0);return e},this.squeeze=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={buffer:t.buffer||i.Buffer.allocUnsafe(u),padding:t.padding||n,queue:i.Buffer.allocUnsafe(d.length),state:new Uint32Array(l.length)};d.copy(e.queue);for(var r=0;r<l.length;r++)e.state[r]=l[r];e.queue.fill(0,h),e.queue[h]|=e.padding,e.queue[f-1]|=128,s(e.queue,e.state);for(var o=0;o<e.buffer.length;o+=f)c(e.state),a(e.state,e.buffer.slice(o,o+f));return e.buffer},this.reset=function(){return d.fill(0),l.fill(0),h=0,e},this}},9940:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(2196))&&n.__esModule?n:{default:n};e.default=function(t){for(var e=t.A,r=t.C,n=0;n<25;n+=5){for(var o=0;o<5;o++)(0,i.default)(e,n+o)(r,o);for(var s=0;s<5;s++){var a=2*(n+s),c=(s+1)%5*2,u=(s+2)%5*2;e[a]^=~r[c]&r[u],e[a+1]^=~r[c+1]&r[u+1]}}}},2196:t=>{t.exports=function(t,e){return function(r,n){var i=2*n,o=2*e;r[i]=t[o],r[i+1]=t[o+1]}}},5037:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(r(9940)),i=a(r(1909)),o=a(r(6021)),s=a(r(4421));function a(t){return t&&t.__esModule?t:{default:t}}e.default=function(){var t=new Uint32Array(10),e=new Uint32Array(10),r=new Uint32Array(2);return function(a){for(var c=0;c<24;c++)(0,s.default)({A:a,C:t,D:e,W:r}),(0,o.default)({A:a,C:t,W:r}),(0,n.default)({A:a,C:t}),(0,i.default)({A:a,roundIndex:c});t.fill(0),e.fill(0),r.fill(0)}}},1909:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(3408))&&n.__esModule?n:{default:n};e.default=function(t){var e=t.A,r=2*t.roundIndex;e[0]^=i.default[r],e[1]^=i.default[r+1]}},3408:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=new Uint32Array([0,1,0,32898,2147483648,32906,2147483648,2147516416,0,32907,0,2147483649,2147483648,2147516545,2147483648,32777,0,138,0,136,0,2147516425,0,2147483658,0,2147516555,2147483648,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,0,32778,2147483648,2147483658,2147483648,2147516545,2147483648,32896,0,2147483649,2147483648,2147516424]);e.default=r},6021:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=s(r(2773)),i=s(r(4728)),o=s(r(2196));function s(t){return t&&t.__esModule?t:{default:t}}e.default=function(t){var e=t.A,r=t.C,s=t.W;(0,o.default)(e,1)(s,0);for(var a=0,c=0,u=0,f=32,h=0;h<24;h++){var l=n.default[h],d=i.default[h];(0,o.default)(e,l)(r,0),a=s[0],c=s[1],f=32-d,s[u=d<32?0:1]=a<<d|c>>>f,s[(u+1)%2]=c<<d|a>>>f,(0,o.default)(s,0)(e,l),(0,o.default)(r,0)(s,0)}}},2773:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=[10,7,11,17,18,3,5,16,8,21,24,4,15,23,19,13,12,2,20,14,22,9,6,1]},4728:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=[1,3,6,10,15,21,28,36,45,55,2,14,27,41,56,8,25,43,62,18,39,61,20,44]},4421:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(2196))&&n.__esModule?n:{default:n};e.default=function(t){for(var e=t.A,r=t.C,n=t.D,o=t.W,s=0,a=0,c=0;c<5;c++){var u=2*c,f=2*(c+5),h=2*(c+10),l=2*(c+15),d=2*(c+20);r[u]=e[u]^e[f]^e[h]^e[l]^e[d],r[u+1]=e[u+1]^e[f+1]^e[h+1]^e[l+1]^e[d+1]}for(var p=0;p<5;p++){(0,i.default)(r,(p+1)%5)(o,0),s=o[0],a=o[1],o[0]=s<<1|a>>>31,o[1]=a<<1|s>>>31,n[2*p]=r[(p+4)%5*2]^o[0],n[2*p+1]=r[(p+4)%5*2+1]^o[1];for(var g=0;g<25;g+=5)e[2*(g+p)]^=n[2*p],e[2*(g+p)+1]^=n[2*p+1]}}},3424:(t,e,r)=>{t.exports=i;var n=r(343).EventEmitter;function i(){n.call(this)}r(87)(i,n),i.Readable=r(5327),i.Writable=r(4567),i.Duplex=r(4439),i.Transform=r(2175),i.PassThrough=r(3754),i.finished=r(5027),i.pipeline=r(410),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",c));var s=!1;function a(){s||(s=!0,t.end())}function c(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function u(t){if(f(),0===n.listenerCount(this,"error"))throw t}function f(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",c),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),t.removeListener("close",f)}return r.on("error",u),t.on("error",u),r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t}},4361:(t,e,r)=>{var n=r(7172).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=c,this.end=u,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=f,this.end=h,e=3;break;default:return this.write=l,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function c(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},o.prototype.text=function(t,e){var r=function(t,e,r){var n=e.length-1;if(n<r)return 0;var i=s(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||-2===i?0:(i=s(e[n]))>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||-2===i?0:(i=s(e[n]))>=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},3118:(t,e)=>{e.VB=function(){return!1}},7451:(t,e,r)=>{function n(t){try{if(!r.g.localStorage)return!1}catch(t){return!1}var e=r.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}},6534:()=>{},1856:()=>{},6014:()=>{},717:()=>{},6963:()=>{},9190:()=>{},3240:()=>{},6721:()=>{},394:()=>{},471:()=>{},1632:()=>{},8517:()=>{},4636:t=>{t.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={id:n,loaded:!1,exports:{}};return t[n](o,o.exports,r),o.loaded=!0,o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var n={};(()=>{var t,e,i;r.d(n,{LJ:()=>en,bG:()=>Br,xz:()=>ft,cC:()=>Tr,CH:()=>Er,xq:()=>Sr,vp:()=>Ne,Ag:()=>Or,W_:()=>fr,g2:()=>vr,v4:()=>Me,Y8:()=>Ar,jF:()=>lt,Fr:()=>_,$h:()=>tr,pP:()=>gr,E9:()=>R,_q:()=>Ae,a5:()=>_r,x6:()=>Xr,Xo:()=>tn,Tx:()=>ur,qd:()=>mr,f1:()=>sr,EY:()=>dr,bH:()=>hr,qx:()=>Lr,ig:()=>kr,_$:()=>Zr,g$:()=>ee,W$:()=>De,ir:()=>Ir,CF:()=>xr,nW:()=>Mr,kw:()=>zr}),function(t){t.PUBLIC="public",t.SECRET="secret"}(t||(t={})),(i=e||(e={})).SECRET="secret",i.OPEN="open",i.UNCONSTRAINED="unconstrained";var o=r(3573);function s(t){const e=new o.C4(256);return e.reset(),e.update(t),e.digest("hex")}var a=r(394),c=r(3302),u=r(816).Buffer;const f=65536,h=t=>{if(c)return a.randomBytes(t);const e="undefined"!=typeof window&&window.crypto?window.crypto:"undefined"!=typeof self&&self.crypto?self.crypto:void 0;if(!e)throw new Error("randomBytes UnsupportedEnvironment");const r=u.allocUnsafe(t);if(t>f)for(let n=0;n<t;n+=f)e.getRandomValues(r.slice(n,n+f));else e.getRandomValues(r);return r};var l=r(5294),d=r(816).Buffer;function p(t){const e=t.toString("hex");return 0===e.length?BigInt(0):BigInt(`0x${e}`)}function g(t,e){if(t<BigInt(0))throw new Error(`Cannot convert negative bigint ${t.toString()} to buffer with toBufferBE.`);const r=t.toString(16),n=d.from(r.padStart(2*e,"0").slice(0,2*e),"hex");if(n.length>e)throw new Error(`Number ${t.toString(16)} does not fit in ${e}`);return n}function y(t,e=!1){const r=t.toString(16),n=r.length%2==0?r.length:r.length+1;return`0x${r.padStart(e?64:n,"0")}`}var m=r(816).Buffer;class b{constructor(t,e=0){this.buffer=t,this.index=e}static asReader(t){return m.isBuffer(t)?new b(t):t}readNumber(){return this.index+=4,this.buffer.readUint32BE(this.index-4)}readUInt16(){return this.index+=2,this.buffer.readUInt16BE(this.index-2)}readBoolean(){return this.index+=1,Boolean(this.buffer.at(this.index-1))}readBytes(t){return this.index+=t,m.from(this.buffer.subarray(this.index-t,this.index))}readFr(){return _.fromBuffer(this)}readFq(){return v.fromBuffer(this)}readNumberVector(){return this.readVector({fromBuffer:t=>t.readNumber()})}readVector(t){const e=this.readNumber(),r=new Array(e);for(let n=0;n<e;n++)r[n]=t.fromBuffer(this);return r}readArray(t,e){return Array.from({length:t},(()=>e.fromBuffer(this)))}readBufferArray(t=-1){const e=[],r=t>=0?this.index+t:this.buffer.length;for(;this.index<r;){const t=this.readBuffer();e.push(t)}if(this.index!==r)throw new Error(`Reader buffer was not fully consumed. Consumed up to ${this.index} bytes. End of data: ${r} bytes.`);return e}readObject(t){return t.fromBuffer(this)}peekBytes(t){return this.buffer.subarray(this.index,t?this.index+t:void 0)}readString(){return this.readBuffer().toString()}readBuffer(){const t=this.readNumber();return this.readBytes(t)}readMap(t){const e=this.readNumber(),r={};for(let n=0;n<e;n++){const e=this.readString(),n=this.readObject(t);r[e]=n}return r}getLength(){return this.buffer.length}}var w=r(816).Buffer;class _{constructor(t){if(this.value=BigInt(t),t>_.MAX_VALUE)throw new Error(`Fr out of range ${t}.`)}static random(){const t=p(h(_.SIZE_IN_BYTES))%_.MODULUS;return new _(t)}static zero(){return new _(0n)}static fromBuffer(t){const e=b.asReader(t);return new _(p(e.readBytes(_.SIZE_IN_BYTES)))}static fromString(t){return _.fromBuffer(w.from(t.replace(/^0x/i,""),"hex"))}toBuffer(){return g(this.value,_.SIZE_IN_BYTES)}toString(t=!1){return y(this.value,t)}toBigInt(){return this.value}toShortString(){const t=this.toString();return`${t.slice(0,10)}...${t.slice(-4)}`}equals(t){return this.value===t.value}isZero(){return 0n===this.value}toFriendlyJSON(){return this.toString()}}_.ZERO=new _(0n),_.MODULUS=0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001n,_.MAX_VALUE=_.MODULUS-1n,_.SIZE_IN_BYTES=32;class v{constructor(t){if(this.value=t,t>v.MAX_VALUE)throw new Error(`Fq out of range ${t}.`)}static random(){return new this(p(h(64))%v.MODULUS)}static fromBuffer(t){return new this(p(b.asReader(t).readBytes(this.SIZE_IN_BYTES)))}toBuffer(){return g(this.value,v.SIZE_IN_BYTES)}toString(){return y(this.value)}isZero(){return 0n===this.value}toFriendlyJSON(){return this.toString()}}v.MODULUS=0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47n,v.MAX_VALUE=_.MODULUS-1n,v.SIZE_IN_BYTES=32;var S=r(816).Buffer;const E=t=>S.from(l.sha256().update(t).digest());var T=r(816).Buffer;function B(t,e){const r=function(t,e){return"constructor"===t?t:`${t}(${e.map((t=>t.type.kind)).join(",")})`}(t,e);return(n=T.from(r),new o.C4(256).update(n).digest()).slice(0,4);var n}var C=r(816).Buffer;class R{constructor(t,e){this.x=t,this.y=e,this.kind="point"}static random(){return new R(_.random(),_.random())}static fromBuffer(t){const e=b.asReader(t);return new this(_.fromBuffer(e.readBytes(32)),_.fromBuffer(e.readBytes(32)))}static fromString(t){return this.fromBuffer(C.from(t.replace(/^0x/i,""),"hex"))}toFields(){return[this.x,this.y]}toBigInts(){return{x:this.x.value,y:this.y.value}}toBuffer(){return C.concat([this.x.toBuffer(),this.y.toBuffer()])}toString(){return"0x"+this.toBuffer().toString("hex")}toShortString(){const t=this.toString();return`${t.slice(0,10)}...${t.slice(-4)}`}equals(t){return this.x.equals(t.x)&&this.y.equals(t.y)}}R.ZERO=new R(_.ZERO,_.ZERO),R.SIZE_IN_BYTES=2*_.SIZE_IN_BYTES;var A=r(816).Buffer;class O{constructor(t){this.fields=t}toFields(){return this.fields}static random(){return this.fromField(_.random())}toFieldsBuffer(){return A.concat([this.fields[0].toBuffer(),this.fields[1].toBuffer()])}toBuffer(){const t=this.fields[0].toBuffer(),e=this.fields[1].toBuffer();return t[0]=e[31],t}equals(t){return this.toBigInt()===t.toBigInt()}toBigInt(){return p(this.toBuffer())}static fromBuffer(t){if(32!=t.length)throw new Error("Invalid size of coordinate buffer");const e=A.alloc(32);t.copy(e,0,0,32);const r=A.alloc(32);return r[31]=e[0],e[0]=0,new O([_.fromBuffer(e),_.fromBuffer(r)])}static fromField(t){const e=t.toBuffer(),r=A.alloc(32);return r[31]=e[0],e[0]=0,new O([_.fromBuffer(e),_.fromBuffer(r)])}}O.ZERO=new O([_.ZERO,_.ZERO]);class L{constructor(t,e){this.abi=t,this.args=e,this.flattened=[]}encodeArgument(t,e,r){if(void 0===e||null==e)throw new Error(`Undefined argument ${r??"unnamed"} of type ${t.kind}`);switch(t.kind){case"field":if("number"==typeof e)this.flattened.push(new _(BigInt(e)));else if("bigint"==typeof e)this.flattened.push(new _(e));else{if("object"!=typeof e)throw new Error(`Invalid argument "${e}" of type ${t.kind}`);if("function"==typeof e.toField)this.flattened.push(e.toField());else{if(!(e instanceof _))throw new Error("Argument cannot be serialised to a field");this.flattened.push(e)}}break;case"boolean":this.flattened.push(new _(e?1n:0n));break;case"array":for(let n=0;n<t.length;n+=1)this.encodeArgument(t.type,e[n],`${r}[${n}]`);break;case"struct":for(const n of t.fields)this.encodeArgument(n.type,e[n.name],`${r}.${n.name}`);break;case"integer":this.flattened.push(new _(e));break;default:throw new Error(`Unsupported type: ${t.kind}`)}}encode(){for(let t=0;t<this.abi.parameters.length;t+=1){const e=this.abi.parameters[t];this.encodeArgument(e.type,this.args[t],e.name)}return this.flattened}}function k(t,e){return new L(t,e).encode()}var x=r(816).Buffer;function I(t,e=4){const r=x.alloc(e);return r.writeUInt32BE(t,e-4),r}function M(t,e=4){const r=x.alloc(e);return r.writeInt32BE(t,e-4),r}function N(t){const e=x.alloc(4);return e.writeUInt32BE(t.length,0),x.concat([e,t])}r(816).Buffer;var D=r(816).Buffer;function P(t,e=4){const r=D.alloc(e);return r.writeUInt32BE(t,e-4),r}function j(t){return!!t.toBuffer32}function U(...t){let e=[];for(const n of t)Array.isArray(n)?e=[...e,...U(...n)]:D.isBuffer(n)?e.push(n):"boolean"==typeof n?e.push((r=n,D.from([r?1:0]))):"number"==typeof n?e.push(P(n)):"string"==typeof n?(e.push(P(n.length)),e.push(D.from(n))):j(n)?e.push(n.toBuffer32()):e.push(n.toBuffer());var r;return e}function F(...t){return D.concat(U(...t))}class ${constructor(t,e,r,n){this.chainId=t,this.version=e,this.blockNumber=r,this.timestamp=n}static from(t){return new $(...$.getFields(t))}static empty(){return new $(_.zero(),_.zero(),_.zero(),_.zero())}static fromBuffer(t){const e=b.asReader(t);return new $(e.readFr(),e.readFr(),e.readFr(),e.readFr())}static getFields(t){return[t.chainId,t.version,t.blockNumber,t.timestamp]}toBuffer(){return F(...$.getFields(this))}}const H=16,z=16,q=16,Z=32;var V,W,G,K;function Y(t,e,r=0){return Array.from({length:t},((t,n)=>e(n+r)))}function J(t,e,r){if(t[e].length!==r)throw new Error(`Expected ${e} to have length ${r} but was ${t[e].length}`)}function X(t,e,r){const n=t[e];for(let t=0;t<n.length;t++)if(n[t].length!==r)throw new Error(`Expected ${e}[${t}] to have length ${r} but was ${n[t].length}`)}!function(t){t[t.COMMITMENT=1]="COMMITMENT",t[t.COMMITMENT_NONCE=2]="COMMITMENT_NONCE",t[t.UNIQUE_COMMITMENT=3]="UNIQUE_COMMITMENT",t[t.OUTER_COMMITMENT=4]="OUTER_COMMITMENT",t[t.NULLIFIER=5]="NULLIFIER",t[t.INITIALISATION_NULLIFIER=6]="INITIALISATION_NULLIFIER",t[t.OUTER_NULLIFIER=7]="OUTER_NULLIFIER",t[t.PUBLIC_DATA_READ=8]="PUBLIC_DATA_READ",t[t.PUBLIC_DATA_UPDATE_REQUEST=9]="PUBLIC_DATA_UPDATE_REQUEST",t[t.FUNCTION_DATA=10]="FUNCTION_DATA",t[t.FUNCTION_LEAF=11]="FUNCTION_LEAF",t[t.CONTRACT_DEPLOYMENT_DATA=12]="CONTRACT_DEPLOYMENT_DATA",t[t.CONSTRUCTOR=13]="CONSTRUCTOR",t[t.CONSTRUCTOR_ARGS=14]="CONSTRUCTOR_ARGS",t[t.CONTRACT_ADDRESS=15]="CONTRACT_ADDRESS",t[t.CONTRACT_LEAF=16]="CONTRACT_LEAF",t[t.CALL_CONTEXT=17]="CALL_CONTEXT",t[t.CALL_STACK_ITEM=18]="CALL_STACK_ITEM",t[t.CALL_STACK_ITEM_2=19]="CALL_STACK_ITEM_2",t[t.L1_TO_L2_MESSAGE_SECRET=20]="L1_TO_L2_MESSAGE_SECRET",t[t.L2_TO_L1_MSG=21]="L2_TO_L1_MSG",t[t.TX_CONTEXT=22]="TX_CONTEXT",t[t.PUBLIC_LEAF_INDEX=23]="PUBLIC_LEAF_INDEX",t[t.PUBLIC_DATA_LEAF=24]="PUBLIC_DATA_LEAF",t[t.SIGNED_TX_REQUEST=25]="SIGNED_TX_REQUEST",t[t.GLOBAL_VARIABLES=26]="GLOBAL_VARIABLES",t[t.PARTIAL_CONTRACT_ADDRESS=27]="PARTIAL_CONTRACT_ADDRESS",t[t.TX_REQUEST=33]="TX_REQUEST",t[t.VK=41]="VK",t[t.PRIVATE_CIRCUIT_PUBLIC_INPUTS=42]="PRIVATE_CIRCUIT_PUBLIC_INPUTS",t[t.PUBLIC_CIRCUIT_PUBLIC_INPUTS=43]="PUBLIC_CIRCUIT_PUBLIC_INPUTS",t[t.FUNCTION_ARGS=44]="FUNCTION_ARGS"}(V||(V={})),function(t){t[t.BASE_SLOT=0]="BASE_SLOT",t[t.MAPPING_SLOT=1]="MAPPING_SLOT",t[t.MAPPING_SLOT_PLACEHOLDER=2]="MAPPING_SLOT_PLACEHOLDER"}(W||(W={})),function(t){t[t.VALUE=1]="VALUE",t[t.OWNER=2]="OWNER",t[t.CREATOR=3]="CREATOR",t[t.SALT=4]="SALT",t[t.NONCE=5]="NONCE",t[t.MEMO=6]="MEMO",t[t.IS_DUMMY=7]="IS_DUMMY"}(G||(G={})),function(t){t[t.PARTITIONED=1]="PARTITIONED",t[t.WHOLE=2]="WHOLE"}(K||(K={}));class Q{constructor(t,e){this.root=t,this.nextAvailableLeafIndex=e}toBuffer(){return F(this.root,this.nextAvailableLeafIndex)}static fromBuffer(t){const e=b.asReader(t);return new Q(e.readFr(),e.readNumber())}static empty(){return new Q(_.ZERO,0)}}class tt{constructor(t,e,r,n,i,o,s,a,c,u,f,h,l,d,p,g,y,m){this.kernelData=t,this.startPrivateDataTreeSnapshot=e,this.startNullifierTreeSnapshot=r,this.startContractTreeSnapshot=n,this.startPublicDataTreeRoot=i,this.startHistoricBlocksTreeSnapshot=o,this.lowNullifierLeafPreimages=s,this.lowNullifierMembershipWitness=a,this.newCommitmentsSubtreeSiblingPath=c,this.newNullifiersSubtreeSiblingPath=u,this.newContractsSubtreeSiblingPath=f,this.newPublicDataUpdateRequestsSiblingPaths=h,this.newPublicDataReadsSiblingPaths=l,this.historicPrivateDataTreeRootMembershipWitnesses=d,this.historicContractsTreeRootMembershipWitnesses=p,this.historicL1ToL2MsgTreeRootMembershipWitnesses=g,this.historicBlocksTreeRootMembershipWitnesses=y,this.constants=m,J(this,"lowNullifierLeafPreimages",32),J(this,"lowNullifierMembershipWitness",32),J(this,"newCommitmentsSubtreeSiblingPath",Z-tt.PRIVATE_DATA_SUBTREE_HEIGHT),J(this,"newNullifiersSubtreeSiblingPath",16-tt.NULLIFIER_SUBTREE_HEIGHT),J(this,"newContractsSubtreeSiblingPath",16-tt.CONTRACT_SUBTREE_HEIGHT),J(this,"newPublicDataUpdateRequestsSiblingPaths",16),J(this,"newPublicDataReadsSiblingPaths",16),X(this,"newPublicDataUpdateRequestsSiblingPaths",254),X(this,"newPublicDataReadsSiblingPaths",254)}static from(t){return new tt(...tt.getFields(t))}static getFields(t){return[t.kernelData,t.startPrivateDataTreeSnapshot,t.startNullifierTreeSnapshot,t.startContractTreeSnapshot,t.startPublicDataTreeRoot,t.startHistoricBlocksTreeSnapshot,t.lowNullifierLeafPreimages,t.lowNullifierMembershipWitness,t.newCommitmentsSubtreeSiblingPath,t.newNullifiersSubtreeSiblingPath,t.newContractsSubtreeSiblingPath,t.newPublicDataUpdateRequestsSiblingPaths,t.newPublicDataReadsSiblingPaths,t.historicPrivateDataTreeRootMembershipWitnesses,t.historicContractsTreeRootMembershipWitnesses,t.historicL1ToL2MsgTreeRootMembershipWitnesses,t.historicBlocksTreeRootMembershipWitnesses,t.constants]}toBuffer(){return F(...tt.getFields(this))}}tt.PRIVATE_DATA_SUBTREE_HEIGHT=Math.log2(32),tt.CONTRACT_SUBTREE_HEIGHT=Math.log2(2),tt.NULLIFIER_SUBTREE_HEIGHT=Math.log2(32);var et,rt,nt,it,ot=r(3545);class st{constructor(t){this.items=t}toBuffer(){return F(this.items.length,this.items)}toFriendlyJSON(){return this.items}}(it=et||(et={}))[it.STANDARD=0]="STANDARD",it[it.TURBO=1]="TURBO",it[it.ULTRA=2]="ULTRA",(nt=rt||(rt={}))[nt.Base=0]="Base",nt[nt.Merge=1]="Merge",nt[nt.Root=2]="Root";class at{constructor(t,e){this.x="bigint"==typeof t?new v(t):t,this.y="bigint"==typeof e?new v(e):e}toBuffer(){return F(this.x,this.y)}static fromBuffer(t){const e=b.asReader(t);return new at(e.readFr(),e.readFr())}}class ct{constructor(t,e,r,n,i=!1){this.p0=t,this.p1=e,this.publicInputs=r,this.proofWitnessIndices=n,this.hasData=i}toBuffer(){return F(this.p0,this.p1,new st(this.publicInputs),new st(this.proofWitnessIndices),this.hasData)}static fromBuffer(t){const e=b.asReader(t);return new ct(e.readObject(at),e.readObject(at),e.readVector(_),e.readNumberVector(),e.readBoolean())}static makeFake(){return new ct(new at(new v(1n),new v(2n)),new at(new v(1n),new v(2n)),[],ot(16,(t=>3027+t)),!1)}}r(816).Buffer;var ut=r(816).Buffer;class ft{constructor(t){this.buffer=t;const e=p(t);if(e>ft.MAX_VALUE)throw new Error(`AztecAddress out of range ${e}.`)}static random(){return new ft(g(_.random().value,ft.SIZE_IN_BYTES))}static fromBuffer(t){return new this(b.asReader(t).readBytes(this.SIZE_IN_BYTES))}static fromString(t){const e=ut.from(t.replace(/^0x/i,""),"hex");if(e.length!==ft.SIZE_IN_BYTES)throw new Error(`Invalid length ${e.length}.`);return new ft(e)}static fromBigInt(t){return new ft(g(t,ft.SIZE_IN_BYTES))}toBuffer(){return this.buffer}toString(){return`0x${this.buffer.toString("hex")}`}toShortString(){const t=this.toString();return`${t.slice(0,10)}...${t.slice(-4)}`}toField(){return _.fromBuffer(this.toBuffer())}toBigInt(){return p(this.buffer)}equals(t){return this.buffer.equals(t.buffer)}isZero(){return this.equals(ft.ZERO)}toFriendlyJSON(){return this.toString()}}ft.SIZE_IN_BYTES=32,ft.ZERO=new ft(ut.alloc(ft.SIZE_IN_BYTES)),ft.MODULUS=0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001n,ft.MAX_VALUE=ft.MODULUS-1n;var ht=r(816).Buffer;class lt{constructor(t){if(this.buffer=t,32===t.length){if(!t.slice(0,12).equals(ht.alloc(12)))throw new Error(`Invalid address buffer: ${t.toString("hex")}`);this.buffer=t.slice(12)}else if(t.length!==lt.SIZE_IN_BYTES)throw new Error(`Expect buffer size to be ${lt.SIZE_IN_BYTES}. Got ${t.length}.`)}static fromString(t){if(!lt.isAddress(t))throw new Error(`Invalid address string: ${t}`);return new lt(ht.from(t.replace(/^0x/i,""),"hex"))}static random(){return new lt(h(20))}static isAddress(t){return!!/^(0x)?[0-9a-f]{40}$/i.test(t)&&(!(!/^(0x|0X)?[0-9a-f]{40}$/.test(t)&&!/^(0x|0X)?[0-9A-F]{40}$/.test(t))||lt.checkAddressChecksum(t))}isZero(){return this.equals(lt.ZERO)}static checkAddressChecksum(t){const e=s((t=t.replace(/^0x/i,"")).toLowerCase());for(let r=0;r<40;r++)if(parseInt(e[r],16)>7&&t[r].toUpperCase()!==t[r]||parseInt(e[r],16)<=7&&t[r].toLowerCase()!==t[r])return!1;return!0}static toChecksumAddress(t){if(!lt.isAddress(t))throw new Error("Invalid address string.");const e=s(t=t.toLowerCase().replace(/^0x/i,""));let r="0x";for(let n=0;n<t.length;n++)parseInt(e[n],16)>7?r+=t[n].toUpperCase():r+=t[n];return r}equals(t){return this.buffer.equals(t.buffer)}toString(){return`0x${this.buffer.toString("hex")}`}toChecksumString(){return lt.toChecksumAddress(this.buffer.toString("hex"))}toBuffer(){return this.toBuffer32()}toBuffer20(){return this.buffer}toBuffer32(){const t=ht.alloc(32);return this.buffer.copy(t,12),t}toField(){return _.fromBuffer(this.toBuffer32())}static fromField(t){return new lt(t.toBuffer().slice(-lt.SIZE_IN_BYTES))}static fromBuffer(t){const e=b.asReader(t);return new lt(e.readBuffer())}toFriendlyJSON(){return this.toString()}}lt.SIZE_IN_BYTES=20,lt.ZERO=new lt(ht.alloc(lt.SIZE_IN_BYTES));class dt{constructor(t,e,r,n,i,o){this.msgSender=t,this.storageContractAddress=e,this.isDelegateCall=n,this.isStaticCall=i,this.isContractDeployment=o,this.portalContractAddress=r instanceof lt?r:lt.fromField(r)}static empty(){return new dt(ft.ZERO,ft.ZERO,_.ZERO,!1,!1,!1)}isEmpty(){return this.msgSender.isZero()&&this.storageContractAddress.isZero()&&this.portalContractAddress.isZero()}static from(t){return new dt(...dt.getFields(t))}static getFields(t){return[t.msgSender,t.storageContractAddress,t.portalContractAddress,t.isDelegateCall,t.isStaticCall,t.isContractDeployment]}toBuffer(){return F(...dt.getFields(this))}static fromBuffer(t){const e=b.asReader(t);return new dt(new ft(e.readBytes(32)),new ft(e.readBytes(32)),new lt(e.readBytes(32)),e.readBoolean(),e.readBoolean(),e.readBoolean())}}var pt=r(816).Buffer;class gt{constructor(t,e,r,n){if(this.isInternal=e,this.isPrivate=r,this.isConstructor=n,t instanceof pt){if(4!==t.byteLength)throw new Error(`Function selector must be 4 bytes long, got ${t.byteLength} bytes.`);this.functionSelectorBuffer=t}else this.functionSelectorBuffer=I(t)}static fromAbi(t){return new gt(B(t.name,t.parameters),t.isInternal,t.functionType===e.SECRET,"constructor"===t.name)}get functionSelector(){return function(t,e=0){return{elem:t.readUInt32BE(e),adv:4}}(this.functionSelectorBuffer).elem}toBuffer(){return F(this.functionSelectorBuffer,this.isInternal,this.isPrivate,this.isConstructor)}isEmpty(){return this.functionSelectorBuffer.equals(pt.alloc(4,0))}static empty(t){return new gt(pt.alloc(4,0),t?.isInternal??!1,t?.isPrivate??!1,t?.isConstructor??!1)}static fromBuffer(t){const e=b.asReader(t);return new gt(e.readBytes(4),e.readBoolean(),e.readBoolean(),e.readBoolean())}}var yt=r(816).Buffer;class mt{constructor(t,e,r){this.contractAddress=t,this.functionTreeRoot=r,this.portalContractAddress=new lt(e.toBuffer())}toBuffer(){return F(this.contractAddress,this.portalContractAddress,this.functionTreeRoot)}static fromBuffer(t){const e=b.asReader(t);return new mt(e.readObject(ft),new lt(e.readBytes(32)),e.readFr())}static empty(){return new mt(ft.ZERO,lt.ZERO,_.ZERO)}}class bt{constructor(t,e,r,n,i,o,s,a){this.callStackItemHash=t,this.functionData=e,this.vkHash=r,this.payFeeFromL1=i,this.payFeeFromPublicL2=o,this.calledFromL1=s,this.calledFromPublicL2=a,this.portalContractAddress=lt.fromField(n.toField())}toBuffer(){return F(this.callStackItemHash,this.functionData,this.vkHash,this.portalContractAddress,this.payFeeFromL1,this.payFeeFromPublicL2,this.calledFromL1,this.calledFromPublicL2)}static fromBuffer(t){const e=b.asReader(t);return new bt(e.readFr(),e.readObject(gt),e.readFr(),new lt(e.readBytes(32)),e.readBoolean(),e.readBoolean(),e.readBoolean(),e.readBoolean())}static empty(){return new bt(_.ZERO,gt.empty(),_.ZERO,lt.ZERO,!1,!1,!1,!1)}}class wt{constructor(t,e){this.leafIndex=t,this.value=e}static from(t){return new wt(t.leafIndex,t.value)}toBuffer(){return F(this.leafIndex,this.value)}static fromBuffer(t){const e=b.asReader(t);return new wt(e.readFr(),e.readFr())}static empty(){return new wt(_.ZERO,_.ZERO)}toFriendlyJSON(){return`Leaf=${this.leafIndex.toFriendlyJSON()}: ${this.value.toFriendlyJSON()}`}}class _t{constructor(t,e,r){this.leafIndex=t,this.oldValue=e,this.newValue=r}static from(t){return new _t(t.leafIndex,t.oldValue,t.newValue)}toBuffer(){return F(this.leafIndex,this.oldValue,this.newValue)}static fromBuffer(t){const e=b.asReader(t);return new _t(e.readFr(),e.readFr(),e.readFr())}static empty(){return new _t(_.ZERO,_.ZERO,_.ZERO)}toFriendlyJSON(){return`Leaf=${this.leafIndex.toFriendlyJSON()}: ${this.oldValue.toFriendlyJSON()} => ${this.newValue.toFriendlyJSON()}`}}class vt{constructor(t,e,r,n,i,o,s,a,c,u,f,h,l,d,p,g){this.aggregationObject=t,this.readRequests=e,this.readRequestMembershipWitnesses=r,this.newCommitments=n,this.newNullifiers=i,this.privateCallStack=o,this.publicCallStack=s,this.newL2ToL1Msgs=a,this.encryptedLogsHash=c,this.unencryptedLogsHash=u,this.encryptedLogPreimagesLength=f,this.unencryptedLogPreimagesLength=h,this.newContracts=l,this.optionallyRevealedData=d,this.publicDataUpdateRequests=p,this.publicDataReads=g,J(this,"readRequests",q),J(this,"readRequestMembershipWitnesses",q),J(this,"newCommitments",H),J(this,"newNullifiers",z),J(this,"privateCallStack",8),J(this,"publicCallStack",8),J(this,"newL2ToL1Msgs",2),J(this,"encryptedLogsHash",2),J(this,"unencryptedLogsHash",2),J(this,"newContracts",1),J(this,"optionallyRevealedData",4),J(this,"publicDataUpdateRequests",8),J(this,"publicDataReads",8)}toBuffer(){return F(this.aggregationObject,this.readRequests,this.readRequestMembershipWitnesses,this.newCommitments,this.newNullifiers,this.privateCallStack,this.publicCallStack,this.newL2ToL1Msgs,this.encryptedLogsHash,this.unencryptedLogsHash,this.encryptedLogPreimagesLength,this.unencryptedLogPreimagesLength,this.newContracts,this.optionallyRevealedData,this.publicDataUpdateRequests,this.publicDataReads)}toString(){return this.toBuffer().toString()}static fromBuffer(t){const e=b.asReader(t);return new vt(e.readObject(ct),e.readArray(q,_),e.readArray(q,jt),e.readArray(H,_),e.readArray(z,_),e.readArray(8,_),e.readArray(8,_),e.readArray(2,_),e.readArray(2,_),e.readArray(2,_),e.readFr(),e.readFr(),e.readArray(1,mt),e.readArray(4,bt),e.readArray(8,_t),e.readArray(8,wt))}static fromString(t){return vt.fromBuffer(yt.from(t,"hex"))}static empty(){return new vt(ct.makeFake(),Y(q,_.zero),Y(q,(()=>jt.empty(BigInt(0)))),Y(H,_.zero),Y(z,_.zero),Y(8,_.zero),Y(8,_.zero),Y(2,_.zero),Y(2,_.zero),Y(2,_.zero),_.zero(),_.zero(),Y(1,mt.empty),Y(4,bt.empty),Y(8,_t.empty),Y(8,wt.empty))}}class St{constructor(t,e,r,n,i){this.deployerPublicKey=t,this.constructorVkHash=e,this.functionTreeRoot=r,this.contractAddressSalt=n,this.portalContractAddress=lt.fromField(i.toField())}toBuffer(){return F(this.deployerPublicKey,this.constructorVkHash,this.functionTreeRoot,this.contractAddressSalt,this.portalContractAddress)}static empty(){return new St(R.ZERO,_.ZERO,_.ZERO,_.ZERO,lt.ZERO)}static fromBuffer(t){const e=b.asReader(t);return new St(e.readObject(R),e.readFr(),e.readFr(),e.readFr(),new lt(e.readBytes(32)))}}class Et{constructor(t,e,r,n,i,o){this.isFeePaymentTx=t,this.isRebatePaymentTx=e,this.isContractDeploymentTx=r,this.contractDeploymentData=n,this.chainId=i,this.version=o}toBuffer(){return F(this.isFeePaymentTx,this.isRebatePaymentTx,this.isContractDeploymentTx,this.contractDeploymentData,this.chainId,this.version)}static fromBuffer(t){const e=b.asReader(t);return new Et(e.readBoolean(),e.readBoolean(),e.readBoolean(),e.readObject(St),e.readFr(),e.readFr())}static empty(t=_.ZERO,e=_.ZERO){return new Et(!1,!1,!1,St.empty(),t,e)}static from(t){return new Et(...Et.getFields(t))}static getFields(t){return[t.isFeePaymentTx,t.isRebatePaymentTx,t.isContractDeploymentTx,t.contractDeploymentData,t.chainId,t.version]}}var Tt=r(816).Buffer;class Bt{constructor(t,e,r,n,i,o){this.privateDataTreeRoot=t,this.nullifierTreeRoot=e,this.contractTreeRoot=r,this.l1ToL2MessagesTreeRoot=n,this.blocksTreeRoot=i,this.privateKernelVkTreeRoot=o}static from(t){return new Bt(...Bt.getFields(t))}static getFields(t){return[t.privateDataTreeRoot,t.nullifierTreeRoot,t.contractTreeRoot,t.l1ToL2MessagesTreeRoot,t.blocksTreeRoot,t.privateKernelVkTreeRoot]}toBuffer(){return F(...Bt.getFields(this))}toString(){return this.toBuffer().toString()}isEmpty(){return this.privateDataTreeRoot.isZero()&&this.nullifierTreeRoot.isZero()&&this.contractTreeRoot.isZero()&&this.l1ToL2MessagesTreeRoot.isZero()&&this.blocksTreeRoot.isZero()&&this.privateKernelVkTreeRoot.isZero()}static fromBuffer(t){const e=b.asReader(t);return new Bt(e.readFr(),e.readFr(),e.readFr(),e.readFr(),e.readFr(),e.readFr())}static fromString(t){return Bt.fromBuffer(Tt.from(t,"hex"))}static empty(){return new Bt(_.ZERO,_.ZERO,_.ZERO,_.ZERO,_.ZERO,_.ZERO)}}class Ct{constructor(t){this.privateHistoricTreeRoots=t}toBuffer(){return F(this.privateHistoricTreeRoots)}toString(){return this.toBuffer().toString()}static fromBuffer(t){const e=b.asReader(t);return new Ct(e.readObject(Bt))}isEmpty(){return this.privateHistoricTreeRoots.isEmpty()}static empty(){return new Ct(Bt.empty())}}class Rt{constructor(t,e){this.historicTreeRoots=t,this.txContext=e}toBuffer(){return F(this.historicTreeRoots,this.txContext)}static fromBuffer(t){const e=b.asReader(t);return new Rt(e.readObject(Ct),e.readObject(Et))}static empty(){return new Rt(Ct.empty(),Et.empty())}}r(1328),r(816).Buffer,r(816).Buffer,r(816).Buffer;class At{constructor(t){this.buffer=t}static fromMsgpackBuffer(t){return new At(t)}static fromBuffer(t){const e=b.asReader(t),r=e.readNumber(),n=e.readBytes(r);return new At(n)}toMsgpackBuffer(){return this.buffer}toBuffer(){return F(this.buffer.length,this.buffer)}}class Ot{constructor(t,e,r){this.end=t,this.constants=e,this.isPrivate=r}toBuffer(){return F(this.end,this.constants,this.isPrivate)}static fromBuffer(t){const e=b.asReader(t);return new Ot(e.readObject(vt),e.readObject(Rt),e.readBoolean())}static empty(){return new Ot(vt.empty(),Rt.empty(),!0)}}function Lt(t,e,r){if(t.length>r)throw new Error("Array size exceeds target length");return[...t,...Array(r-t.length).fill(e)]}function kt(t,e){for(const r of t)if(!e(r))return!1;return!0}class xt{constructor(t,e){this.storageSlot=t,this.currentValue=e}static from(t){return new xt(t.storageSlot,t.currentValue)}toBuffer(){return F(this.storageSlot,this.currentValue)}static fromBuffer(t){const e=b.asReader(t);return new xt(e.readFr(),e.readFr())}static empty(){return new xt(_.ZERO,_.ZERO)}isEmpty(){return this.storageSlot.isZero()&&this.currentValue.isZero()}toFriendlyJSON(){return`Slot=${this.storageSlot.toFriendlyJSON()}: ${this.currentValue.toFriendlyJSON()}`}}class It{constructor(t,e,r){this.storageSlot=t,this.oldValue=e,this.newValue=r}static from(t){return new It(t.storageSlot,t.oldValue,t.newValue)}toBuffer(){return F(this.storageSlot,this.oldValue,this.newValue)}static fromBuffer(t){const e=b.asReader(t);return new It(e.readFr(),e.readFr(),e.readFr())}static empty(){return new It(_.ZERO,_.ZERO,_.ZERO)}isEmpty(){return this.storageSlot.isZero()&&this.oldValue.isZero()&&this.newValue.isZero()}toFriendlyJSON(){return`Slot=${this.storageSlot.toFriendlyJSON()}: ${this.oldValue.toFriendlyJSON()} => ${this.newValue.toFriendlyJSON()}`}}class Mt{constructor(t,e,r,n,i,o,s,a,c,u,f,h,l){this.callContext=t,this.argsHash=e,this.returnValues=r,this.contractStorageUpdateRequests=n,this.contractStorageReads=i,this.publicCallStack=o,this.newCommitments=s,this.newNullifiers=a,this.newL2ToL1Msgs=c,this.unencryptedLogsHash=u,this.unencryptedLogPreimagesLength=f,this.historicPublicDataTreeRoot=h,this.proverAddress=l,J(this,"returnValues",4),J(this,"publicCallStack",4),J(this,"newCommitments",4),J(this,"newNullifiers",4),J(this,"newL2ToL1Msgs",2),J(this,"contractStorageUpdateRequests",8),J(this,"contractStorageReads",8),J(this,"unencryptedLogsHash",2)}static from(t){return new Mt(...Mt.getFields(t))}static empty(){return new Mt(dt.empty(),_.ZERO,Y(4,_.zero),Y(8,It.empty),Y(8,xt.empty),Y(4,_.zero),Y(4,_.zero),Y(4,_.zero),Y(2,_.zero),Y(2,_.zero),_.ZERO,_.ZERO,ft.ZERO)}isEmpty(){const t=t=>kt(t,(t=>t.isZero()));return this.callContext.isEmpty()&&this.argsHash.isZero()&&t(this.returnValues)&&kt(this.contractStorageUpdateRequests,(t=>t.isEmpty()))&&kt(this.contractStorageReads,(t=>t.isEmpty()))&&t(this.publicCallStack)&&t(this.newCommitments)&&t(this.newNullifiers)&&t(this.newL2ToL1Msgs)&&t(this.unencryptedLogsHash)&&this.unencryptedLogPreimagesLength.isZero()&&this.historicPublicDataTreeRoot.isZero()&&this.proverAddress.isZero()}static getFields(t){return[t.callContext,t.argsHash,t.returnValues,t.contractStorageUpdateRequests,t.contractStorageReads,t.publicCallStack,t.newCommitments,t.newNullifiers,t.newL2ToL1Msgs,t.unencryptedLogsHash,t.unencryptedLogPreimagesLength,t.historicPublicDataTreeRoot,t.proverAddress]}toBuffer(){return F(...Mt.getFields(this))}}class Nt{constructor(t,e,r,n){this.contractAddress=t,this.functionData=e,this.publicInputs=r,this.isExecutionRequest=n}toBuffer(){return F(this.contractAddress,this.functionData,this.publicInputs,this.isExecutionRequest)}static empty(){return new Nt(ft.ZERO,gt.empty({isPrivate:!1}),Mt.empty(),!1)}isEmpty(){return this.contractAddress.isZero()&&this.functionData.isEmpty()&&this.publicInputs.isEmpty()}}class Dt{constructor(t,e,r,n){this.origin=t,this.functionData=e,this.argsHash=r,this.txContext=n}static getFields(t){return[t.origin,t.functionData,t.argsHash,t.txContext]}static from(t){return new Dt(...Dt.getFields(t))}toBuffer(){return F([...Dt.getFields(this)])}static fromBuffer(t){const e=b.asReader(t);return new Dt(e.readObject(ft),e.readObject(gt),e.readFr(),e.readObject(Et))}}class Pt{constructor(t,e,r,n,i){this.functionSelector=t,this.isInternal=e,this.isPrivate=r,this.vkHash=n,this.acirHash=i,this.FUNCTION_SELECTOR_LENGTH=4,this.assertFunctionSelectorLength(t)}assertFunctionSelectorLength(t){if(t.byteLength!==this.FUNCTION_SELECTOR_LENGTH)throw new Error(`Function selector must be ${this.FUNCTION_SELECTOR_LENGTH} bytes long, got ${t.byteLength} bytes.`)}toBuffer(){return this.assertFunctionSelectorLength(this.functionSelector),F(this.functionSelector,this.isInternal,this.isPrivate,this.vkHash,this.acirHash)}static fromBuffer(t){const e=b.asReader(t);return new Pt(e.readBytes(4),e.readBoolean(),e.readBoolean(),e.readFr(),e.readFr())}}class jt{constructor(t,e,r=!1,n){if(this.leafIndex=t,this.siblingPath=e,this.isTransient=r,this.hintToCommitment=n,J(this,"siblingPath",Z),n.value>4)throw new Error(`Expected ReadRequestMembershipWitness' hintToCommitment(${n}) to be <= NEW_COMMITMENTS_LENGTH(4)`)}toBuffer(){return F(g(this.leafIndex.toBigInt(),32),...this.siblingPath,this.isTransient,this.hintToCommitment)}static mock(t,e){return new jt(new _(e),function(t,e=0){const r=[];for(let n=0;n<t;n++)r.push(e+n);return r}(t,e).map((t=>new _(BigInt(t)))),!1,new _(0))}static random(){return new jt(new _(0n),Y(Z,(()=>_.random())),!1,new _(0))}static empty(t){const e=Y(Z,(()=>_.ZERO));return new jt(new _(t),e,!1,new _(0))}static emptyTransient(){const t=Y(Z,(()=>_.ZERO));return new jt(new _(0),t,!0,new _(0))}static fromBufferArray(t,e,r,n){return new jt(t,e.map((t=>_.fromBuffer(t))),r,n)}static fromMembershipWitness(t,e,r){return new jt(new _(t.leafIndex),t.siblingPath,e,r)}static fromBuffer(t){const e=b.asReader(t),r=e.readFr(),n=e.readArray(Z,_),i=e.readBoolean(),o=e.readFr();return new jt(r,n,i,o)}}var Ut=r(816),Ft=r(3261);function $t(t,e,r,n){const i=r instanceof Ut.Buffer?r:r.toBuffer(),o=t.call("bbmalloc",n),s=t.call("bbmalloc",i.length);t.writeMemory(s,i),t.call(e,s,o);const a=Ut.Buffer.from(t.getMemorySlice(o,o+n));return t.call("bbfree",o),t.call("bbfree",s),a}function Ht(t,e,r,n){const i=[],o=r.reduce(((t,e)=>(i.push(t),t+e.length)),0),s=t.call("bbmalloc",n),a=t.call("bbmalloc",o);t.writeMemory(a,Ut.Buffer.concat(r));const c=i.map((t=>a+t));t.call(e,...c,s);const u=Ut.Buffer.from(t.getMemorySlice(s,s+n));return t.call("bbfree",a),t.call("bbfree",s),u}function zt(t,e){return t.call("pedersen__init"),_.fromBuffer($t(t,"abis__compute_function_leaf",e,32))}const qt=32,Zt=16;function Vt(t,e){if(0===e.length)return Promise.resolve(_.ZERO);if(e.length>qt*Zt)throw new Error(`Cannot hash more than ${qt*Zt} arguments`);t.call("pedersen__init");const r=e=>_.fromBuffer($t(t,"abis__compute_var_args_hash",new st(e),32));let n=Ft(e,qt).map((t=>(t.length<qt&&(t=Lt(t,_.ZERO,qt)),r(t))));return n.length<Zt&&(n=Lt(n,_.ZERO,Zt)),Promise.resolve(r(n))}class Wt{constructor(t,e,r,n){this.contractAddress=t,this.functionData=e,this.callContext=r,this.args=n}toBuffer(){return F(this.contractAddress,this.functionData,this.callContext,new st(this.args))}static fromBuffer(t){const e=b.asReader(t);return new Wt(new ft(e.readBytes(32)),gt.fromBuffer(e),dt.fromBuffer(e),e.readVector(_))}static from(t){return new Wt(...Wt.getFields(t))}static getFields(t){return[t.contractAddress,t.functionData,t.callContext,t.args]}async toPublicCallStackItem(){const t=Mt.empty();return t.callContext=this.callContext,t.argsHash=await this.getArgsHash(),new Nt(this.contractAddress,this.functionData,t,!0)}async getArgsHash(){return Vt(await ve.get(),this.args)}}var Gt=r(6292);let Kt;function Yt(t){const e=Gt(t);return(...t)=>function(t,...e){Gt.enabled(t.namespace)&&(Kt&&Kt(t.namespace,...e),t(...e))}(e,...t)}var Jt=r(3118);const Xt=["silent","fatal","error","warn","info","debug"],Qt={NODE_ENV:"production"}.LOG_LEVEL?.toLowerCase(),te=Xt.includes(Qt)?Qt:"info";function ee(t){const e=Gt(t);"debug"===te&&(e.enabled=!0);const r={silent:()=>{},fatal:(...t)=>re(e,"fatal",t),error:(...t)=>re(e,"error",t),warn:(...t)=>re(e,"warn",t),info:(...t)=>re(e,"info",t),debug:(...t)=>re(e,"debug",t)};return Object.assign(e,r)}function re(t,e,r){t.enabled?t(r[0],...r.slice(1)):Xt.indexOf(e)<=Xt.indexOf(te)&&function(t){console.error(...t)}([ne(t,e),...r])}function ne(t,e){const r=te!==e?` ${e.toUpperCase}`:"",n=`${t.namespace.replace(/^aztec:/,"")}${r}`;if(!c||!(0,Jt.VB)(process.stderr.fd))return n;const i=Gt.selectColor(t.namespace);return` ${"[3"+(i<8?i:"8;5;"+i)};1m${n}`}new class{constructor(){this.logs=[]}enable(){Kt=(...t)=>{this.logs.push([(new Date).toISOString(),...t])}}getLogs(t=0){return t?this.logs.slice(-t):this.logs}clear(t=this.logs.length){this.logs=this.logs.slice(t)}};class ie{constructor(t=ee("aztec:foundation:memory_fifo")){this.log=t,this.waiting=[],this.items=[],this.flushing=!1}length(){return this.items.length}get(t){return this.items.length?Promise.resolve(this.items.shift()):0===this.items.length&&this.flushing?Promise.resolve(null):new Promise(((e,r)=>{this.waiting.push(e),t&&setTimeout((()=>{const t=this.waiting.findIndex((t=>t===e));if(t>-1){this.waiting.splice(t,1);const e=new Error("Timeout getting item from queue.");r(e)}}),1e3*t)}))}put(t){this.flushing||(this.waiting.length?this.waiting.shift()(t):this.items.push(t))}end(){this.flushing=!0,this.waiting.forEach((t=>t(null)))}cancel(){this.flushing=!0,this.items=[],this.waiting.forEach((t=>t(null)))}async process(t){try{for(;;){const e=await this.get();if(null===e)break;await t(e)}}catch(t){this.log("Queue handler exception:",t)}}}const oe=(t=Yt("wasm:empty_wasi_sdk"))=>({clock_time_get(){t("clock_time_get")},environ_get(){t("environ_get")},environ_sizes_get(){t("environ_sizes_get")},fd_close(){t("fd_close")},fd_read(){t("fd_read")},fd_write(){t("fd_write")},fd_seek(){t("fd_seek")},fd_fdstat_get(){t("fd_fdstat_get")},fd_fdstat_set_flags(){t("fd_fdstat_set_flags")},fd_prestat_get:()=>(t("fd_prestat_get"),8),fd_prestat_dir_name:()=>(t("fd_prestat_dir_name"),28),path_open(){t("path_open")},path_filestat_get(){t("path_filestat_get")},proc_exit:()=>(t("proc_exit"),52),random_get:()=>(t("random_get"),1)});class se{constructor(t,e,r="wasm"){this.module=t,this.importFn=e,this.mutexQ=new ie,this.debug=Yt(r),this.mutexQ.put(!0)}getModule(){return this.module}async init(t=30,e=8192,r="_initialize"){this.debug(`initial mem: ${t} pages, ${65536*t/1048576}mb. max mem: ${e} pages, ${65536*e/1048576}mb`),this.memory=new WebAssembly.Memory({initial:t,maximum:e}),this.heap=new Uint8Array(this.memory.buffer);const n={wasi_snapshot_preview1:{...oe(this.debug),random_get:(t,e)=>{t>>>=0;const r=this.getMemory(),n=h(e);for(let i=t;i<t+e;++i)r[i]=n[i-t]}},env:this.importFn(this)};if(this.module instanceof WebAssembly.Module)this.instance=await WebAssembly.instantiate(this.module,n);else{const{instance:t}=await WebAssembly.instantiate(this.module,n);this.instance=t}r&&this.call(r)}exports(){if(!this.instance)throw new Error("WasmModule: not initialized!");return this.instance.exports}getLogger(){return this.debug}addLogger(t){const e=this.debug;this.debug=(...r)=>{t(...r),e(...r)}}call(t,...e){if(!this.exports()[t])throw new Error(`WASM function ${t} not found.`);try{return this.exports()[t](...e)>>>0}catch(e){const r=`WASM function ${t} aborted, error: ${e}\n${e.stack}`;throw new Error(r)}}getRawMemory(){return this.memory}getMemory(){return 0===this.heap.length&&(this.heap=new Uint8Array(this.memory.buffer)),this.heap}memSize(){return this.getMemory().length}getMemorySlice(t,e){return this.getMemory().slice(t,e)}writeMemory(t,e){const r=this.getMemory();for(let n=0;n<e.length;n++)r[n+t]=e[n]}getMemoryAsString(t){t>>>=0;const e=this.getMemory();let r=t;for(;0!==e[r];++r);return Ut.Buffer.from(e.slice(t,r)).toString("ascii")}async acquire(){await this.mutexQ.get()}release(){if(0!==this.mutexQ.length())throw new Error("Release called but not acquired.");this.mutexQ.put(!0)}}var ae=r(9190),ce=r(3240),ue=r(6721),fe=r(1856),he=r(6014),le=r(717),de=r(6963),pe=r(816).Buffer;class ge{constructor(t){this.numPoints=t}async init(){const t=28+64*this.numPoints-1,e=await fetch("https://aztec-ignition.s3.amazonaws.com/MAIN%20IGNITION/sealed/transcript00.dat",{headers:{Range:`bytes=28-${t}`}});this.data=new Uint8Array(await e.arrayBuffer()),await this.downloadG2Data()}async downloadG2Data(){const t=await fetch("https://aztec-ignition.s3.amazonaws.com/MAIN%20IGNITION/sealed/transcript00.dat",{headers:{Range:"bytes=322560028-322560155"}});this.g2Data=new Uint8Array(await t.arrayBuffer())}getG1Data(){return this.data}getG2Data(){return this.g2Data}}class ye{constructor(t,e){this.numPoints=t,this.path=e}async init(){const t=64*this.numPoints,e=await(0,he.open)(this.path,"r");try{this.data=pe.alloc(t),await e.read(this.data,0,t,28),this.g2Data=pe.alloc(128),await e.read(this.g2Data,0,128,322560028)}finally{await e.close()}}getG1Data(){return this.data}getG2Data(){return this.g2Data}}class me{constructor(t){if(this.numPoints=t,c){const e=(0,le.dirname)((0,de.fileURLToPath)("file:///usr/src/yarn-project/circuits.js/dest/crs/index.js"))+"/../../../../circuits/cpp/barretenberg/cpp/srs_db/ignition/monomial/transcript00.dat";this.crs=(0,fe.existsSync)(e)?new ye(t,e):new ge(t)}else this.crs=new ge(t)}async init(){await this.crs.init()}getG1Data(){return this.crs.getG1Data()}getG2Data(){return this.crs.getG2Data()}}var be=r(816).Buffer;const we="/aztec3-circuits",_e=c?(0,ce.join)((0,ce.dirname)((0,ue.fileURLToPath)("file:///usr/src/yarn-project/circuits.js/dest/wasm/circuits_wasm.js")),`../../resources/${we}.wasm`):`${we}.wasm`;class ve{constructor(t){this.wasm=t}static get(){return this.instance||(this.instance=ve.new()),this.instance}static async new(t=30,e=8192,r="wasm"){const n=new se(await async function(t){if(c)return await(0,ae.readFile)(t);{const e=await fetch(t);return be.from(await e.arrayBuffer())}}(_e),(t=>({logstr(t){const e=`${n.getMemoryAsString(t)} (mem: ${(n.getMemory().length/1048576).toFixed(2)}MB)`;e.startsWith("abort: ")&&console.log(e),n.getLogger()(e)},memory:t.getRawMemory(),set_data:()=>{n.getLogger()("set_data: NYI")},get_data:()=>{throw new Error("NOT YET IMPLEMENTED - needed for proofs, plan is to use barretenberg.js from NPM for proofs. See https://github.com/AztecProtocol/aztec-packages/issues/781")}})),r);return await n.init(t,e),await ve.initializeSrs(n),new ve(n)}static async initializeSrs(t){const e=new me(5e4);await e.init();const r=t.call("bbmalloc",e.getG1Data().length);t.writeMemory(r,e.getG1Data());const n=t.call("bbmalloc",4);t.writeMemory(n,I(e.numPoints));const i=t.call("bbmalloc",e.getG2Data().length);t.writeMemory(i,e.getG2Data()),t.call("srs_init_srs",r,n,i),t.call("bbfree",r),t.call("bbfree",n),t.call("bbfree",i)}exports(){return this.wasm.exports()}getMemorySlice(t,e){return this.wasm.getMemorySlice(t,e)}writeMemory(t,e){this.wasm.writeMemory(t,e)}getMemoryAsString(t){return this.wasm.getMemoryAsString(t)}call(t,...e){return this.wasm.call(t,...e)}}r(816).Buffer;var Se=r(816).Buffer;function Ee(t,e){return function(t,e){return t.call("pedersen__init"),$t(t,"abis__hash_vk",e,32)}(e,Se.from(t,"hex"))}function Te({name:t}){return"constructor"===t}function Be({name:t,functionType:r}){return r!==e.UNCONSTRAINED&&!Te({name:t})}async function Ce(t,r,n,i){const o=t.functions.find(Te);if(!o)throw new Error("Cannot find constructor in the ABI.");if(!o.verificationKey)throw new Error("Missing verification key for the constructor.");const s=await ve.get(),a=Ee(o.verificationKey,s),c=_.fromBuffer(a),u=function(t,r){const n=t.filter(Be),i=[];for(let t=0;t<n.length;t++){const o=n[t],s=B(o.name,o.parameters),a=o.isInternal,c=o.functionType===e.SECRET,u=Ee(o.verificationKey,r),f=Se.alloc(32,0),h=zt(r,new Pt(s,a,c,_.fromBuffer(u),_.fromBuffer(f)));i.push(h)}return i}(t.functions.map((t=>({...t,selector:B(t.name,t.parameters)}))),s),f=function(t,e){const r=function(t){const e=D.alloc(4);return e.writeUInt32BE(t.length,0),D.concat([e,...t])}(e.map((t=>t.toBuffer())));t.call("pedersen__init");const n=$t(t,"abis__compute_function_tree_root",r,32);return _.fromBuffer(n)}(s,u),h=gt.fromAbi(o),l=k(o,r),d=function(t,e,r,n){t.call("pedersen__init");const i=Ht(t,"abis__hash_constructor",[e.toBuffer(),r.toBuffer(),n],32);return _.fromBuffer(i)}(s,h,await Vt(s,l),c.toBuffer()),p=function(t,e,r,n){t.call("pedersen__init");const i=Ht(t,"abis__compute_partial_contract_address",[e.toBuffer(),r.toBuffer(),n.toBuffer()],32);return _.fromBuffer(i)}(s,n,f,d),g=function(t,e,r,n,i){t.call("pedersen__init");const o=Ht(t,"abis__compute_contract_address",[e.toBuffer(),r.toBuffer(),n.toBuffer(),i.toBuffer()],32);return new ft(o)}(s,i,n,f,d);return{address:g,partialAddress:p,constructorHash:c,functionTreeRoot:f,publicKey:i}}var Re=r(816).Buffer;class Ae{constructor(t){if(this.value=t,32!=t.length)throw new Error(`Invalid private key length. Got ${t.length}, expected 32.`)}toString(){return this.value.toString("hex")}static fromString(t){if(t.startsWith("0x")&&(t=t.slice(2)),64!=t.length)throw new Error(`Invalid private key string length. Got ${t.length}, expected 64.`);return new Ae(Re.from(t,"hex"))}static random(){return new Ae(h(32))}}function Oe(t){return new Promise((e=>setTimeout(e,t)))}class Le{constructor(){this.start=(new Date).getTime()}ms(){return(new Date).getTime()-this.start}s(){return((new Date).getTime()-this.start)/1e3}}async function ke(t,e="",r=0,n=1){const i=new Le;for(;;){const o=await t();if(o)return o;if(await Oe(1e3*n),r&&i.s()>r)throw new Error(e?`Timeout awaiting ${e}`:"Timeout")}}var xe=r(816).Buffer;class Ie{constructor(t,e,r){this.functionSelector=t,this.isInternal=e,this.bytecode=r}toBuffer(){const t=xe.concat([M(this.bytecode.length),this.bytecode]);return F(this.functionSelector,this.isInternal,t)}static fromBuffer(t){const e=b.asReader(t),r=e.readBytes(4),n=e.readBoolean();return new Ie(r,n,e.readBuffer())}static random(){return new Ie(h(4),!1,h(64))}}class Me{constructor(t,e){if(this.contractData=t,this.publicFunctions=e,!e.length)throw Error("No public functions provided for ContractPublicData.");this.bytecode=function(t){const e=x.alloc(4);return e.writeUInt32BE(t.length,0),x.concat([e,...t])}(e.map((t=>t.toBuffer())))}toBuffer(){return F(this.contractData.toBuffer(),this.bytecode)}toString(){return this.toBuffer().toString("hex")}static fromBuffer(t){const e=b.asReader(t),r=e.readObject(Ne),n=e.readVector(Ie);return new Me(r,n)}static fromString(t){return Me.fromBuffer(xe.from(t,"hex"))}static random(){return new Me(Ne.random(),[Ie.random(),Ie.random()])}}class Ne{constructor(t,e){this.contractAddress=t,this.portalContractAddress=e}toBuffer(){return F(this.contractAddress,this.portalContractAddress.toBuffer20())}toString(){return this.toBuffer().toString("hex")}static fromBuffer(t){const e=b.asReader(t),r=ft.fromBuffer(e),n=new lt(e.readBytes(lt.SIZE_IN_BYTES));return new Ne(r,n)}static fromString(t){return Ne.fromBuffer(xe.from(t,"hex"))}static random(){return new Ne(ft.random(),lt.random())}}function De(){return{from:ft.ZERO,to:ft.ZERO,functionData:gt.empty(),args:[]}}r(816).Buffer;var Pe=r(816).Buffer;class je{static async new(){return new this(await ve.get())}constructor(t){this.wasm=t}generator(){return je.generator}mul(t,e){return this.wasm.writeMemory(0,t.toBuffer()),this.wasm.writeMemory(64,e.value),this.wasm.call("ecc_grumpkin__mul",0,64,96),R.fromBuffer(Pe.from(this.wasm.getMemorySlice(96,160)))}batchMul(t,e){const r=Pe.concat(t.map((t=>t.toBuffer()))),n=t.length*R.SIZE_IN_BYTES,i=this.wasm.call("bbmalloc",2*n);this.wasm.writeMemory(i,r),this.wasm.writeMemory(0,e.value),this.wasm.call("ecc_grumpkin__batch_mul",i,0,t.length,i+n);const o=Pe.from(this.wasm.getMemorySlice(i+n,i+n+n));this.wasm.call("bbfree",i);const s=[];for(let t=0;t<n;t+=64)s.push(R.fromBuffer(o.slice(t,t+64)));return s}getRandomFr(){return this.wasm.call("ecc_grumpkin__get_random_scalar_mod_circuit_modulus",0),_.fromBuffer(Pe.from(this.wasm.getMemorySlice(0,32)))}reduce512BufferToFr(t){return this.wasm.writeMemory(0,t),this.wasm.call("ecc_grumpkin__reduce512_buffer_mod_circuit_modulus",0,64),_.fromBuffer(Pe.from(this.wasm.getMemorySlice(64,96)))}}je.generator=R.fromBuffer(Pe.from([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,2,207,19,94,117,6,164,93,99,45,39,13,69,241,24,18,148,131,63,196,141,130,63,39,44])),r(6534),r(816).Buffer,r(816).Buffer;var Ue=r(816).Buffer;class Fe{static async new(){return new this(await ve.get())}constructor(t){this.wasm=t}generator(){return Fe.generator}mul(t,e){return this.wasm.writeMemory(0,t),this.wasm.writeMemory(64,e),this.wasm.call("ecc_secp256k1__mul",0,64,96),Ue.from(this.wasm.getMemorySlice(96,160))}getRandomFr(){return this.wasm.call("ecc_secp256k1__get_random_scalar_mod_circuit_modulus",0),Ue.from(this.wasm.getMemorySlice(0,32))}reduce512BufferToFr(t){return this.wasm.writeMemory(0,t),this.wasm.call("ecc_secp256k1__reduce512_buffer_mod_circuit_modulus",0,64),Ue.from(this.wasm.getMemorySlice(64,96))}}Fe.generator=Ue.from([121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184]);var $e=r(816).Buffer;class He{constructor(t){if(this.buffer=t,t.length!==He.SIZE)throw new Error(`Invalid signature buffer of length ${t.length}.`)}static isSignature(t){return/^(0x)?[0-9a-f]{128}$/i.test(t)}static fromString(t){if(!He.isSignature(t))throw new Error(`Invalid signature string: ${t}`);return new He($e.from(t.replace(/^0x/i,""),"hex"))}static random(){return new He(h(64))}get s(){return this.buffer.subarray(0,32)}get e(){return this.buffer.subarray(32)}toBuffer(){return this.buffer}static fromBuffer(t){const e=b.asReader(t);return new He(e.readBytes(He.SIZE))}toString(){return`0x${this.buffer.toString("hex")}`}toFields(){const t=this.toBuffer(),e=$e.alloc(32),r=$e.alloc(32),n=$e.alloc(32);return t.copy(e,1,0,31),t.copy(r,1,31,62),t.copy(n,1,62,64),i=[e,r,n],o=_.fromBuffer,i.map(o);var i,o}}He.SIZE=64,He.EMPTY=new He($e.alloc(64));var ze=r(816).Buffer;class qe{static async new(){return new this(await ve.get())}constructor(t){this.wasm=t}computePublicKey(t){return this.wasm.writeMemory(0,t.value),this.wasm.call("schnorr_compute_public_key",0,32),R.fromBuffer(ze.from(this.wasm.getMemorySlice(32,96)))}constructSignature(t,e){const r=this.wasm.call("bbmalloc",t.length+4);return this.wasm.writeMemory(0,e.value),this.wasm.writeMemory(r,ze.concat([I(t.length),t])),this.wasm.call("schnorr_construct_signature",r,0,32,64),new He(ze.from(this.wasm.getMemorySlice(32,96)))}verifySignature(t,e,r){const n=this.wasm.call("bbmalloc",t.length+4);this.wasm.writeMemory(0,e.toBuffer()),this.wasm.writeMemory(64,r.s),this.wasm.writeMemory(96,r.e),this.wasm.writeMemory(n,ze.concat([I(t.length),t])),this.wasm.call("schnorr_verify_signature",n,0,64,96,128);const i=this.wasm.getMemorySlice(128,129);return!ze.alloc(1,0).equals(i)}}function Ze(t=1,e=void 0){return new $(We(t),We(t+1),We(void 0!==e?e:t+2),We(t+3))}function Ve(t=1){return new Q(We(t),t)}function We(t){return new _(BigInt(t))}r(816).Buffer;var Ge=r(8517),Ke=r(816).Buffer;class Ye{constructor(t){this.logs=t}toBuffer(){const t=this.logs.map((t=>N(t)));return N(Ke.concat(t))}getSerializedLength(){return this.logs.reduce(((t,e)=>t+e.length+4),0)+4}hash(){const t=this.toBuffer().subarray(4);return E(t)}static fromBuffer(t,e=!0){const r=new b(t,0),n=e?r.readNumber():-1,i=r.readBufferArray(n);return new Ye(i)}static random(t){const e=[];for(let r=0;r<t;r++)e.push((0,Ge.randomBytes)(144));return new Ye(e)}static empty(){return new Ye([])}}var Je=r(816).Buffer;class Xe{constructor(t){this.functionLogs=t}toBuffer(){const t=this.functionLogs.map((t=>t.toBuffer()));return N(Je.concat(t))}getSerializedLength(){return this.functionLogs.reduce(((t,e)=>t+e.getSerializedLength()),0)+4}addFunctionLogs(t){this.functionLogs.push(...t)}static fromBuffer(t,e=!0){const r=b.asReader(t),n=e?r.readNumber():-1,i=r.readBufferArray(n).map((t=>Ye.fromBuffer(t,!1)));return new Xe(i)}static random(t,e){const r=[];for(let n=0;n<t;n++)r.push(Ye.random(e));return new Xe(r)}}var Qe=r(816).Buffer;class tr{constructor(t){this.txLogs=t}toBuffer(){const t=this.txLogs.map((t=>t.toBuffer()));return N(Qe.concat(t))}getSerializedLength(){return this.txLogs.reduce(((t,e)=>t+e.getSerializedLength()),0)+4}static fromBuffer(t){const e=b.asReader(t),r=e.readNumber(),n=e.readBufferArray(r).map((t=>Xe.fromBuffer(t,!1)));return new tr(n)}static random(t,e,r){const n=[];for(let i=0;i<t;i++)n.push(Xe.random(e,r));return new tr(n)}static unrollLogs(t){const e=[];for(const r of t)for(const t of r.txLogs)for(const r of t.functionLogs)e.push(...r.logs);return e}}var er=r(816).Buffer;class rr{constructor(t,e,r,n,i,o,s,a,c,u,f,h,l,d,p,g,y,m,b,w,_,v,S,E,T,B,C=[],R,A){if(this.number=t,this.globalVariables=e,this.startPrivateDataTreeSnapshot=r,this.startNullifierTreeSnapshot=n,this.startContractTreeSnapshot=i,this.startTreeOfHistoricPrivateDataTreeRootsSnapshot=o,this.startTreeOfHistoricContractTreeRootsSnapshot=s,this.startPublicDataTreeRoot=a,this.startL1ToL2MessageTreeSnapshot=c,this.startTreeOfHistoricL1ToL2MessageTreeRootsSnapshot=u,this.startHistoricBlocksTreeSnapshot=f,this.endPrivateDataTreeSnapshot=h,this.endNullifierTreeSnapshot=l,this.endContractTreeSnapshot=d,this.endTreeOfHistoricPrivateDataTreeRootsSnapshot=p,this.endTreeOfHistoricContractTreeRootsSnapshot=g,this.endPublicDataTreeRoot=y,this.endL1ToL2MessageTreeSnapshot=m,this.endTreeOfHistoricL1ToL2MessageTreeRootsSnapshot=b,this.endHistoricBlocksTreeSnapshot=w,this.newCommitments=_,this.newNullifiers=v,this.newPublicDataWrites=S,this.newL2ToL1Msgs=E,this.newContracts=T,this.newContractData=B,this.newL1ToL2Messages=C,_.length%H!=0)throw new Error("The number of new commitments must be a multiple of 16.");R&&this.attachLogs(R,nr.ENCRYPTED),A&&this.attachLogs(A,nr.UNENCRYPTED)}static random(t,e=4,r=2,n=3,i=2,o=1){const s=ot(z*e,_.random),a=ot(H*e,_.random),c=ot(1*e,_.random),u=ot(1*e,Ne.random),f=ot(8*e,pr.random),h=ot(16,_.random),l=ot(2,_.random),d=tr.random(e,r,i),p=tr.random(e,n,o);return rr.fromFields({number:t,globalVariables:Ze(0,t),startPrivateDataTreeSnapshot:Ve(0),startNullifierTreeSnapshot:Ve(0),startContractTreeSnapshot:Ve(0),startPublicDataTreeRoot:_.random(),startL1ToL2MessageTreeSnapshot:Ve(0),startTreeOfHistoricL1ToL2MessageTreeRootsSnapshot:Ve(0),startTreeOfHistoricPrivateDataTreeRootsSnapshot:Ve(0),startTreeOfHistoricContractTreeRootsSnapshot:Ve(0),startHistoricBlocksTreeSnapshot:Ve(0),endPrivateDataTreeSnapshot:Ve(a.length),endNullifierTreeSnapshot:Ve(s.length),endContractTreeSnapshot:Ve(c.length),endPublicDataTreeRoot:_.random(),endL1ToL2MessageTreeSnapshot:Ve(1),endTreeOfHistoricL1ToL2MessageTreeRootsSnapshot:Ve(1),endTreeOfHistoricPrivateDataTreeRootsSnapshot:Ve(1),endTreeOfHistoricContractTreeRootsSnapshot:Ve(1),endHistoricBlocksTreeSnapshot:Ve(1),newCommitments:a,newNullifiers:s,newContracts:c,newContractData:u,newPublicDataWrites:f,newL1ToL2Messages:h,newL2ToL1Msgs:l,newEncryptedLogs:d,newUnencryptedLogs:p})}static fromFields(t){return new this(t.number,t.globalVariables,t.startPrivateDataTreeSnapshot,t.startNullifierTreeSnapshot,t.startContractTreeSnapshot,t.startTreeOfHistoricPrivateDataTreeRootsSnapshot,t.startTreeOfHistoricContractTreeRootsSnapshot,t.startPublicDataTreeRoot,t.startL1ToL2MessageTreeSnapshot,t.startTreeOfHistoricL1ToL2MessageTreeRootsSnapshot,t.startHistoricBlocksTreeSnapshot,t.endPrivateDataTreeSnapshot,t.endNullifierTreeSnapshot,t.endContractTreeSnapshot,t.endTreeOfHistoricPrivateDataTreeRootsSnapshot,t.endTreeOfHistoricContractTreeRootsSnapshot,t.endPublicDataTreeRoot,t.endL1ToL2MessageTreeSnapshot,t.endTreeOfHistoricL1ToL2MessageTreeRootsSnapshot,t.endHistoricBlocksTreeSnapshot,t.newCommitments,t.newNullifiers,t.newPublicDataWrites,t.newL2ToL1Msgs,t.newContracts,t.newContractData,t.newL1ToL2Messages,t.newEncryptedLogs,t.newUnencryptedLogs)}encode(){if(void 0===this.newEncryptedLogs||void 0===this.newUnencryptedLogs)throw new Error("newEncryptedLogs and newUnencryptedLogs must be defined when encoding L2BlockData");return F(this.globalVariables,this.startPrivateDataTreeSnapshot,this.startNullifierTreeSnapshot,this.startContractTreeSnapshot,this.startTreeOfHistoricPrivateDataTreeRootsSnapshot,this.startTreeOfHistoricContractTreeRootsSnapshot,this.startPublicDataTreeRoot,this.startL1ToL2MessageTreeSnapshot,this.startTreeOfHistoricL1ToL2MessageTreeRootsSnapshot,this.startHistoricBlocksTreeSnapshot,this.endPrivateDataTreeSnapshot,this.endNullifierTreeSnapshot,this.endContractTreeSnapshot,this.endTreeOfHistoricPrivateDataTreeRootsSnapshot,this.endTreeOfHistoricContractTreeRootsSnapshot,this.endPublicDataTreeRoot,this.endL1ToL2MessageTreeSnapshot,this.endTreeOfHistoricL1ToL2MessageTreeRootsSnapshot,this.endHistoricBlocksTreeSnapshot,this.newCommitments.length,this.newCommitments,this.newNullifiers.length,this.newNullifiers,this.newPublicDataWrites.length,this.newPublicDataWrites,this.newL2ToL1Msgs.length,this.newL2ToL1Msgs,this.newContracts.length,this.newContracts,this.newContractData,this.newL1ToL2Messages.length,this.newL1ToL2Messages,this.newEncryptedLogs,this.newUnencryptedLogs)}toBuffer(){return this.encode()}static decode(t){const e=b.asReader(t),r=e.readObject($),n=Number(r.blockNumber.value),i=e.readObject(Q),o=e.readObject(Q),s=e.readObject(Q),a=e.readObject(Q),c=e.readObject(Q),u=e.readObject(_),f=e.readObject(Q),h=e.readObject(Q),l=e.readObject(Q),d=e.readObject(Q),p=e.readObject(Q),g=e.readObject(Q),y=e.readObject(Q),m=e.readObject(Q),w=e.readObject(_),v=e.readObject(Q),S=e.readObject(Q),E=e.readObject(Q),T=e.readVector(_),B=e.readVector(_),C=e.readVector(pr),R=e.readVector(_),A=e.readVector(_),O=e.readArray(A.length,Ne),L=e.readVector(_),k=e.readObject(tr),x=e.readObject(tr);return rr.fromFields({number:n,globalVariables:r,startPrivateDataTreeSnapshot:i,startNullifierTreeSnapshot:o,startContractTreeSnapshot:s,startTreeOfHistoricPrivateDataTreeRootsSnapshot:a,startTreeOfHistoricContractTreeRootsSnapshot:c,startPublicDataTreeRoot:u,startL1ToL2MessageTreeSnapshot:f,startTreeOfHistoricL1ToL2MessageTreeRootsSnapshot:h,startHistoricBlocksTreeSnapshot:l,endPrivateDataTreeSnapshot:d,endNullifierTreeSnapshot:p,endContractTreeSnapshot:g,endTreeOfHistoricPrivateDataTreeRootsSnapshot:y,endTreeOfHistoricContractTreeRootsSnapshot:m,endPublicDataTreeRoot:w,endL1ToL2MessageTreeSnapshot:v,endTreeOfHistoricL1ToL2MessageTreeRootsSnapshot:S,endHistoricBlocksTreeSnapshot:E,newCommitments:T,newNullifiers:B,newPublicDataWrites:C,newL2ToL1Msgs:R,newContracts:A,newContractData:O,newL1ToL2Messages:L,newEncryptedLogs:k,newUnencryptedLogs:x})}attachLogs(t,e){const r=e===nr.ENCRYPTED?"newEncryptedLogs":"newUnencryptedLogs";if(this[r]){if(this[r]===t)return void rr.logger(`${r} logs already attached`);throw new Error(`Trying to attach different ${r} logs to block ${this.number}.`)}rr.logger(`Attaching ${r} logs`);const n=this.newCommitments.length/H;if(n!==t.txLogs.length)throw new Error(`Number of txLogs within ${r} does not match number of transactions. Expected: ${n} Got: ${t.txLogs.length}`);this[r]=t}getPublicInputsHash(){return t=F(this.globalVariables,this.startPrivateDataTreeSnapshot,this.startNullifierTreeSnapshot,this.startContractTreeSnapshot,this.startTreeOfHistoricPrivateDataTreeRootsSnapshot,this.startTreeOfHistoricContractTreeRootsSnapshot,this.startPublicDataTreeRoot,this.startL1ToL2MessageTreeSnapshot,this.startTreeOfHistoricL1ToL2MessageTreeRootsSnapshot,this.startHistoricBlocksTreeSnapshot,this.endPrivateDataTreeSnapshot,this.endNullifierTreeSnapshot,this.endContractTreeSnapshot,this.endTreeOfHistoricPrivateDataTreeRootsSnapshot,this.endTreeOfHistoricContractTreeRootsSnapshot,this.endPublicDataTreeRoot,this.endL1ToL2MessageTreeSnapshot,this.endTreeOfHistoricL1ToL2MessageTreeRootsSnapshot,this.endHistoricBlocksTreeSnapshot,this.getCalldataHash(),this.getL1ToL2MessagesHash()),_.fromBuffer(g(p(E(t))%_.MODULUS,32));var t}getStartStateHash(){const t=F(new _(this.number-1),this.startPrivateDataTreeSnapshot,this.startNullifierTreeSnapshot,this.startContractTreeSnapshot,this.startTreeOfHistoricPrivateDataTreeRootsSnapshot,this.startTreeOfHistoricContractTreeRootsSnapshot,this.startPublicDataTreeRoot,this.startL1ToL2MessageTreeSnapshot,this.startTreeOfHistoricL1ToL2MessageTreeRootsSnapshot,this.startHistoricBlocksTreeSnapshot);return E(t)}getEndStateHash(){const t=F(this.globalVariables.blockNumber,this.endPrivateDataTreeSnapshot,this.endNullifierTreeSnapshot,this.endContractTreeSnapshot,this.endTreeOfHistoricPrivateDataTreeRootsSnapshot,this.endTreeOfHistoricContractTreeRootsSnapshot,this.endPublicDataTreeRoot,this.endL1ToL2MessageTreeSnapshot,this.endTreeOfHistoricL1ToL2MessageTreeRootsSnapshot,this.endHistoricBlocksTreeSnapshot);return E(t)}getCalldataHash(){if(void 0===this.newEncryptedLogs)throw new Error('Encrypted logs has to be attached before calling "getCalldataHash"');if(void 0===this.newUnencryptedLogs)throw new Error('Unencrypted logs has to be attached before calling "getCalldataHash"');const t=this.newCommitments.length/32,e=[];for(let r=0;r<t;r++){const t=32,n=32,i=16,o=4,s=er.concat(this.newCommitments.slice(r*t,(r+1)*t).map((t=>t.toBuffer()))),a=er.concat(this.newNullifiers.slice(r*n,(r+1)*n).map((t=>t.toBuffer()))),c=er.concat(this.newPublicDataWrites.slice(r*i,(r+1)*i).map((t=>t.toBuffer()))),u=er.concat(this.newL2ToL1Msgs.slice(r*o,(r+1)*o).map((t=>t.toBuffer()))),f=rr.computeKernelLogsHash(this.newEncryptedLogs.txLogs[2*r]),h=rr.computeKernelLogsHash(this.newEncryptedLogs.txLogs[2*r+1]),l=rr.computeKernelLogsHash(this.newUnencryptedLogs.txLogs[2*r]),d=rr.computeKernelLogsHash(this.newUnencryptedLogs.txLogs[2*r+1]),p=er.concat([s,a,c,u,this.newContracts[2*r].toBuffer(),this.newContracts[2*r+1].toBuffer(),this.newContractData[2*r].contractAddress.toBuffer(),this.newContractData[2*r].portalContractAddress.toBuffer32(),this.newContractData[2*r+1].contractAddress.toBuffer(),this.newContractData[2*r+1].portalContractAddress.toBuffer32(),f,h,l,d]);e.push(E(p))}return(t=>{const e=[t];let r=0;for(;e[r].length>1;){const t=[],n=e[r].length;for(let i=0;i<n;i+=2){const n=e[r][i],o=e[r][i+1];t.push(E(er.concat([n,o])))}e.push(t),r++}return e[e.length-1][0]})(e)}getL1ToL2MessagesHash(){const t=er.concat(this.newL1ToL2Messages.map((t=>t.toBuffer())));return E(t)}getTx(t){const e=Math.floor(this.newCommitments.length/H);if(t>=e)throw new Error(`Failed to get tx ${t}. Block ${this.globalVariables.blockNumber} only has ${e} txs.`);const r=this.newCommitments.slice(H*t,H*(t+1)),n=this.newNullifiers.slice(z*t,z*(t+1)),i=this.newPublicDataWrites.slice(8*t,8*(t+1)),o=this.newL2ToL1Msgs.slice(2*t,2*(t+1)),s=this.newContracts.slice(1*t,1*(t+1)),a=this.newContractData.slice(1*t,1*(t+1));return new ar(r,n,i,o,s,a)}inspect(t=4){const e=e=>`0x${e.toBuffer().subarray(0,t).toString("hex")}`,r=(t,e)=>"["+t.map(e).join(", ")+"]",n=t=>`(${t.nextAvailableLeafIndex}, ${e(t.root)})`,i=t=>r(t,e),o=t=>r(t,(t=>`(${e(t.leafIndex)}, ${e(t.newValue)})`));return["L2Block",`number: ${this.number}`,"globalVariables: "+(a=this.globalVariables,`(${a.chainId}, ${a.version}, ${a.blockNumber}, ${a.timestamp}))`),`startPrivateDataTreeSnapshot: ${n(this.startPrivateDataTreeSnapshot)}`,`startNullifierTreeSnapshot: ${n(this.startNullifierTreeSnapshot)}`,`startContractTreeSnapshot: ${n(this.startContractTreeSnapshot)}`,`startTreeOfHistoricPrivateDataTreeRootsSnapshot: ${n(this.startTreeOfHistoricPrivateDataTreeRootsSnapshot)}`,`startTreeOfHistoricContractTreeRootsSnapshot: ${n(this.startTreeOfHistoricContractTreeRootsSnapshot)}`,`startPublicDataTreeRoot: ${this.startPublicDataTreeRoot.toString()}`,`startL1ToL2MessageTreeSnapshot: ${n(this.startL1ToL2MessageTreeSnapshot)}`,`startTreeOfHistoricL1ToL2MessageTreeRootsSnapshot: ${n(this.startTreeOfHistoricL1ToL2MessageTreeRootsSnapshot)}`,`startHistoricBlocksTreeSnapshot: ${n(this.startHistoricBlocksTreeSnapshot)}`,`endPrivateDataTreeSnapshot: ${n(this.endPrivateDataTreeSnapshot)}`,`endNullifierTreeSnapshot: ${n(this.endNullifierTreeSnapshot)}`,`endContractTreeSnapshot: ${n(this.endContractTreeSnapshot)}`,`endPublicDataTreeRoot: ${this.endPublicDataTreeRoot.toString()}`,`endTreeOfHistoricPrivateDataTreeRootsSnapshot: ${n(this.endTreeOfHistoricPrivateDataTreeRootsSnapshot)}`,`endTreeOfHistoricContractTreeRootsSnapshot: ${n(this.endTreeOfHistoricContractTreeRootsSnapshot)}`,`endPublicDataTreeRoot: ${this.endPublicDataTreeRoot.toString()}`,`endL1ToL2MessageTreeSnapshot: ${n(this.endL1ToL2MessageTreeSnapshot)}`,`endTreeOfHistoricL1ToL2MessageTreeRootsSnapshot: ${n(this.endTreeOfHistoricL1ToL2MessageTreeRootsSnapshot)}`,`endHistoricBlocksTreeSnapshot: ${n(this.endHistoricBlocksTreeSnapshot)}`,`newCommitments: ${i(this.newCommitments)}`,`newNullifiers: ${i(this.newNullifiers)}`,`newPublicDataWrite: ${o(this.newPublicDataWrites)}`,`newL2ToL1Msgs: ${i(this.newL2ToL1Msgs)}`,`newContracts: ${i(this.newContracts)}`,`newContractData: ${s=this.newContractData,r(s,(t=>`(${e(t.contractAddress)}, ${e(t.portalContractAddress)})`))}`,`newPublicDataWrite: ${o(this.newPublicDataWrites)}`,`newL1ToL2Messages: ${i(this.newL1ToL2Messages)}`].join("\n");var s,a}static computeKernelLogsHash(t){const e=[er.alloc(32),er.alloc(32)];let r=er.alloc(32);for(const n of t.functionLogs)e[0]=r,e[1]=n.hash(),r=E(er.concat(e));return r}}rr.logger=ee("aztec:l2_block"),ee("aztec:l2_block_downloader");var nr,ir,or=r(816).Buffer;class sr{constructor(t){this.buffer=t,J(this,"buffer",sr.SIZE)}equals(t){return this.buffer.equals(t.buffer)}isZero(){return this.buffer.equals(or.alloc(32,0))}toString(){return this.buffer.toString("hex")}toBigInt(){return function(t,e=0,r=32){return{elem:p(t.subarray(e,e+r)),adv:r}}(this.buffer,0,sr.SIZE).elem}static fromBigInt(t){return new sr(function(t,e=32){return g(t,e)}(t,sr.SIZE))}static fromBuffer28(t){if(28!=t.length)throw new Error("Expected TxHash input buffer to be 28 bytes");const e=or.concat([or.alloc(this.SIZE-28),t]);return new sr(e)}static fromString(t){return new sr(or.from(t,"hex"))}}sr.SIZE=32,sr.ZERO=new sr(or.alloc(sr.SIZE));class ar{constructor(t,e,r,n,i,o){this.newCommitments=t,this.newNullifiers=e,this.newPublicDataWrites=r,this.newL2ToL1Msgs=n,this.newContracts=i,this.newContractData=o,this.txHash=new sr(this.newNullifiers[0].toBuffer())}}!function(t){t[t.ENCRYPTED=0]="ENCRYPTED",t[t.UNENCRYPTED=1]="UNENCRYPTED"}(nr||(nr={})),r(1240),r(816).Buffer,function(t){t[t.CONTRACT_TREE=0]="CONTRACT_TREE",t[t.CONTRACT_TREE_ROOTS_TREE=1]="CONTRACT_TREE_ROOTS_TREE",t[t.NULLIFIER_TREE=2]="NULLIFIER_TREE",t[t.PRIVATE_DATA_TREE=3]="PRIVATE_DATA_TREE",t[t.PRIVATE_DATA_TREE_ROOTS_TREE=4]="PRIVATE_DATA_TREE_ROOTS_TREE",t[t.PUBLIC_DATA_TREE=5]="PUBLIC_DATA_TREE",t[t.L1_TO_L2_MESSAGES_TREE=6]="L1_TO_L2_MESSAGES_TREE",t[t.L1_TO_L2_MESSAGES_ROOTS_TREE=7]="L1_TO_L2_MESSAGES_ROOTS_TREE",t[t.BLOCKS_TREE=8]="BLOCKS_TREE"}(ir||(ir={}));var cr=r(816).Buffer;class ur{constructor(t,e,r,n,i,o){if(this.data=t,this.proof=e,this.encryptedLogs=r,this.unencryptedLogs=n,this.newContractPublicFunctions=i,this.enqueuedPublicFunctionCalls=o,this.unencryptedLogs.functionLogs.length<this.encryptedLogs.functionLogs.length)throw new Error(`Number of function logs in unencrypted logs (${this.unencryptedLogs.functionLogs.length}) has to be equal\n or larger than number function logs in encrypted logs (${this.encryptedLogs.functionLogs.length})`);const s=t?.end.publicCallStack&&(a=t.end.publicCallStack,c=t=>t.isZero(),a.reduce(((t,e)=>c(e)?t:t+1),0));var a,c;if(s&&s>(o?.length??0))throw new Error(`Missing preimages for enqueued public function calls in kernel circuit public inputs (expected\n ${s}, got ${o?.length})`)}static fromBuffer(t){const e=b.asReader(t);return new ur(e.readObject(Ot),e.readObject(At),e.readObject(Xe),e.readObject(Xe),e.readArray(e.readNumber(),Ie),e.readArray(8,Wt))}toBuffer(){return F([this.data,this.proof,this.encryptedLogs,this.unencryptedLogs,I(this.newContractPublicFunctions.length),this.newContractPublicFunctions,this.enqueuedPublicFunctionCalls])}toJSON(){return{data:this.data.toBuffer().toString("hex"),encryptedLogs:this.encryptedLogs.toBuffer().toString("hex"),unencryptedLogs:this.unencryptedLogs.toBuffer().toString("hex"),proof:this.proof.toBuffer().toString("hex"),newContractPublicFunctions:this.newContractPublicFunctions.map((t=>t.toBuffer().toString("hex")))??[],enqueuedPublicFunctions:this.enqueuedPublicFunctionCalls.map((t=>t.toBuffer().toString("hex")))??[]}}static fromJSON(t){const e=Ot.fromBuffer(cr.from(t.data,"hex")),r=Xe.fromBuffer(cr.from(t.encryptedLogs,"hex")),n=Xe.fromBuffer(cr.from(t.unencryptedLogs,"hex")),i=cr.from(t.proof,"hex"),o=t.newContractPublicFunctions?t.newContractPublicFunctions.map((t=>Ie.fromBuffer(cr.from(t,"hex")))):[],s=t.enqueuedPublicFunctions?t.enqueuedPublicFunctions.map((t=>Wt.fromBuffer(cr.from(t,"hex")))):[];return new ur(e,At.fromBuffer(i),r,n,o,s)}getTxHash(){const t=this.data?.end.newNullifiers[0];if(!t)throw new Error("Cannot get tx hash since first nullifier is missing");return Promise.resolve(new sr(t.toBuffer()))}static async getHashes(t){return await Promise.all(t.map((t=>t.getTxHash())))}static clone(t){const e=Ot.fromBuffer(t.data.toBuffer()),r=At.fromBuffer(t.proof.toBuffer()),n=Xe.fromBuffer(t.encryptedLogs.toBuffer()),i=Xe.fromBuffer(t.unencryptedLogs.toBuffer()),o=t.newContractPublicFunctions.map((t=>Ie.fromBuffer(t.toBuffer()))),s=t.enqueuedPublicFunctionCalls.map((t=>Wt.fromBuffer(t.toBuffer())));return new ur(e,r,n,i,o,s)}}class fr{constructor(t,e,r){this.tx=t,this.partialContractAddress=e,this.contractAddress=r}toJSON(){return{tx:this.tx.toJSON(),partialContractAddress:this.partialContractAddress.toBuffer().toString(),contractAddress:this.contractAddress.toBuffer().toString()}}static fromJSON(t){return new fr(ur.fromJSON(t.tx),_.fromBuffer(cr.from(t.partialContractAddress,"hex")),ft.fromBuffer(cr.from(t.contractAddress,"hex")))}}var hr,lr=r(816).Buffer;!function(t){t.DROPPED="dropped",t.MINED="mined",t.PENDING="pending"}(hr||(hr={}));class dr{constructor(t,e,r,n,i,o,s){this.txHash=t,this.status=e,this.error=r,this.blockHash=n,this.blockNumber=i,this.origin=o,this.contractAddress=s}toJSON(){return{txHash:this.txHash.toString(),status:this.status.toString(),error:this.error,blockHash:this.blockHash?.toString("hex"),blockNumber:this.blockNumber,origin:this.origin?.toString(),contractAddress:this.contractAddress?.toString()}}static fromJSON(t){const e=sr.fromString(t.txHash),r=t.status,n=t.error,i=t.blockHash?lr.from(t.blockHash,"hex"):void 0,o=t.blockNumber?Number(t.blockNumber):void 0,s=t.origin?ft.fromString(t.origin):void 0,a=t.contractAddress?ft.fromString(t.contractAddress):void 0;return new dr(e,r,n,i,o,s,a)}}r(816).Buffer;class pr{constructor(t,e){this.leafIndex=t,this.newValue=e}static from(t){return new pr(t.leafIndex,t.newValue)}toBuffer(){return F(this.leafIndex,this.newValue)}isEmpty(){return this.leafIndex.isZero()&&this.newValue.isZero()}static fromBuffer(t){const e=b.asReader(t);return new pr(e.readFr(),e.readFr())}static empty(){return new pr(_.ZERO,_.ZERO)}static random(){return new pr(_.random(),_.random())}}class gr{constructor(t,e){this.args=t,this.hash=e}static getFields(t){return[t.args,t.hash]}static from(t){return new gr(...gr.getFields(t))}static async fromArgs(t,e){return new gr(t,await Vt(e,t))}toBuffer(){return F(new st(this.args),this.hash)}static fromBuffer(t){const e=b.asReader(t);return new gr(e.readVector(_),e.readFr())}}var yr=r(816).Buffer;class mr{constructor(t,e,r,n,i){this.origin=t,this.functionData=e,this.argsHash=r,this.txContext=n,this.packedArguments=i}toTxRequest(){return new Dt(this.origin,this.functionData,this.argsHash,this.txContext)}static getFields(t){return[t.origin,t.functionData,t.argsHash,t.txContext,t.packedArguments]}static from(t){return new mr(...mr.getFields(t))}toBuffer(){return F(this.origin,this.functionData,this.argsHash,this.txContext,new st(this.packedArguments))}toString(){return this.toBuffer().toString("hex")}static fromBuffer(t){const e=b.asReader(t);return new mr(e.readObject(ft),e.readObject(gt),e.readFr(),e.readObject(Et),e.readVector(gr))}static fromString(t){return mr.fromBuffer(yr.from(t,"hex"))}}r(816).Buffer;var br=r(9467),wr=r.n(br);class _r{constructor(t,e){this.arc=t,this.txHashPromise=e}async getTxHash(){return await this.txHashPromise}async getReceipt(){const t=await this.getTxHash();return await this.arc.getTxReceipt(t)}async wait(t){const e=await this.waitForReceipt(t);if(e.status!==hr.MINED)throw new Error(`Transaction ${await this.getTxHash()} was ${e.status}`);return e}async isMined(t){return(await this.waitForReceipt(t)).status===hr.MINED}async waitForReceipt(t){const e=await this.getTxHash();return await ke((async()=>{const r=await this.arc.getTxReceipt(e);if(r.status===hr.PENDING)return;if(r.status===hr.DROPPED)return r;if(!(t?.waitForNotesSync??true))return r;const{blocks:n,notes:i}=await this.arc.getSyncStatus(),o=r.blockNumber;return n>=o&&wr()(i,(t=>t>=o))?r:void 0}),"isMined",t?.timeout??60,t?.interval??1)}}class vr{constructor(t,e,r,n){if(this.wallet=t,this.contractAddress=e,this.functionDao=r,this.args=n,n.some((t=>null==t)))throw new Error("All function interaction arguments must be defined and not null. Received: "+n)}async create(t={}){if(this.functionDao.functionType===e.UNCONSTRAINED)throw new Error("Can't call `create` on an unconstrained function.");if(!this.txRequest){const e=this.getExecutionRequest(this.contractAddress,t.origin),r=await this.wallet.getNodeInfo(),n=Et.empty(new _(r.chainId),new _(r.version)),i=await this.wallet.createAuthenticatedTxRequest([e],n);this.txRequest=i}return this.txRequest}async simulate(t={}){const e=this.txRequest??await this.create(t);return this.tx=await this.wallet.simulateTx(e),this.tx}request(t={}){return this.getExecutionRequest(this.contractAddress,t.origin)}getExecutionRequest(t,e){const r=k(this.functionDao,this.args);return e=e??this.wallet.getAddress(),{args:r,functionData:gt.fromAbi(this.functionDao),to:t,from:e}}send(t={}){if(this.functionDao.functionType===e.UNCONSTRAINED)throw new Error("Can't call `send` on an unconstrained function.");const r=(async()=>{const e=this.tx??await this.simulate(t);return this.wallet.sendTx(e)})();return new _r(this.wallet,r)}view(t={}){if(this.functionDao.functionType!==e.UNCONSTRAINED)throw new Error("Can only call `view` on an unconstrained function.");const{from:r}=t;return this.wallet.viewTx(this.functionDao.name,this.args,this.contractAddress,r)}}class Sr{constructor(t,e,r){this.address=t,this.abi=e,this.wallet=r,this.methods={},e.functions.forEach((t=>{this.methods[t.name]=Object.assign(((...e)=>new vr(this.wallet,this.address,t,e)),{get selector(){return B(t.name,t.parameters)}})}))}attach(t,e=[]){const r={abi:this.abi,address:this.address,portalContract:t};return this.wallet.addContracts([r,...e])}}class Er extends Sr{static async create(t,e,r){if(!await r.isContractDeployed(t))throw new Error("Contract "+t.toString()+" is not deployed");return new Er(t,e,r)}}class Tr{constructor(t){this.rpc=t}addAccount(t,e,r){return this.rpc.addAccount(t,e,r)}addPublicKeyAndPartialAddress(t,e,r){return this.rpc.addPublicKeyAndPartialAddress(t,e,r)}getAccounts(){return this.rpc.getAccounts()}getPublicKey(t){return this.rpc.getPublicKey(t)}addContracts(t){return this.rpc.addContracts(t)}isContractDeployed(t){return this.rpc.isContractDeployed(t)}simulateTx(t){return this.rpc.simulateTx(t)}sendTx(t){return this.rpc.sendTx(t)}getTxReceipt(t){return this.rpc.getTxReceipt(t)}getPreimagesAt(t,e){return this.rpc.getPreimagesAt(t,e)}getPublicStorageAt(t,e){return this.rpc.getPublicStorageAt(t,e)}viewTx(t,e,r,n){return this.rpc.viewTx(t,e,r,n)}getContractData(t){return this.rpc.getContractData(t)}getContractInfo(t){return this.rpc.getContractInfo(t)}getUnencryptedLogs(t,e){return this.rpc.getUnencryptedLogs(t,e)}getBlockNum(){return this.rpc.getBlockNum()}getNodeInfo(){return this.rpc.getNodeInfo()}getPublicKeyAndPartialAddress(t){return this.rpc.getPublicKeyAndPartialAddress(t)}isSynchronised(){return this.rpc.isSynchronised()}isAccountSynchronised(t){return this.rpc.isAccountSynchronised(t)}getSyncStatus(){return this.rpc.getSyncStatus()}}class Br extends Tr{constructor(t,e){super(t),this.accountImpl=e}getAddress(){return this.accountImpl.getAddress()}createAuthenticatedTxRequest(t,e){return this.accountImpl.createAuthenticatedTxRequest(t,e)}}class Cr extends _r{constructor(t,e,r){super(e,r),this.abi=t}async deployed(t){return(await this.wait(t)).contract}async wait(t){const e=await super.wait(t),r=await this.getContractInstance(t?.wallet,e.contractAddress);return{...e,contract:r}}getContractInstance(t,e){const r=t??(!!this.arc.createAuthenticatedTxRequest&&this.arc);if(!r)throw new Error("A wallet is required for creating a contract instance");if(!e)throw new Error("Contract address is missing from transaction receipt");return Er.create(e,this.abi,r)}}class Rr extends Tr{getAddress(){return ft.ZERO}async createAuthenticatedTxRequest(t,e){if(1!==t.length)throw new Error(`Deployer wallet can only run one execution at a time (requested ${t.length})`);const[r]=t,n=await ve.get(),i=await gr.fromArgs(r.args,n);return Promise.resolve(new mr(r.to,r.functionData,i.hash,e,[i]))}}class Ar extends vr{constructor(t,e,r,n=[]){const i=r.functions.find((t=>"constructor"===t.name));if(!i)throw new Error("Cannot find constructor in the ABI.");super(new Rr(e),ft.ZERO,i,n),this.publicKey=t,this.arc=e,this.abi=r,this.partialContractAddress=void 0,this.completeContractAddress=void 0}async create(t={}){const e=t.portalContract??lt.ZERO,r=t.contractAddressSalt??_.random(),{chainId:n,version:i}=await this.wallet.getNodeInfo(),{address:o,constructorHash:s,functionTreeRoot:a,partialAddress:c}=await Ce(this.abi,this.args,r,this.publicKey),u=new St(this.publicKey,s,a,r,e),f=new Et(!1,!1,!0,u,new _(n),new _(i)),h=this.getExecutionRequest(o,ft.ZERO),l=await this.wallet.createAuthenticatedTxRequest([h],f);return this.txRequest=l,this.partialContractAddress=c,this.completeContractAddress=o,await this.wallet.addContracts([{abi:this.abi,address:o,portalContract:e}]),this.txRequest}send(t={}){const e=super.send(t).getTxHash();return new Cr(this.abi,this.arc,e)}async simulate(t){const e=this.txRequest??await this.create(t);return this.tx=await this.wallet.simulateTx(e),this.tx}async getContract(t){if(!this.completeContractAddress)throw new Error("Cannot get a contract instance for a contract not yet deployed");return await Er.create(this.completeContractAddress,this.abi,t)}}class Or{constructor(t,e,r){this.abi=t,this.arc=e,this.publicKey=r}deploy(...t){return new Ar(this.publicKey??R.ZERO,this.arc,this.abi,t)}}async function Lr(t){return function(t,e){t.call("pedersen__init");const r=$t(t,"abis__compute_message_secret_hash",e,32);return _.fromBuffer(r)}(await ve.get(),t)}async function kr(t,e,r,n=_.random(),i=1,o=ee("aztec:aztec.js:accounts")){const s=new en;for(let a=0;a<i;++a){const i=0==a&&r?r:Ae.random(),c=await Ir(i),u=await Ce(e,[],n,c);await t.addAccount(i,u.address,u.partialAddress);const f=new Or(e,t,c).deploy().send({contractAddressSalt:n});await f.isMined({interval:.5});const h=await f.getReceipt();if(h.status!==hr.MINED)throw new Error(`Deployment tx not mined (status is ${h.status})`);const l=h.contractAddress;if(!l.equals(u.address))throw new Error(`Deployment address does not match for account contract (expected ${u.address.toString()} got ${l.toString()})`);o(`Created account ${l.toString()} with public key ${c.toString()}`),s.registerAccount(l,new Xr(l,u.partialAddress,i,await qe.new()))}return new Br(t,s)}async function xr(t,e,r,n){const i=new en,o=await Ir(r),s=await Ce(e,[],n,o),a=s.address;return i.registerAccount(a,new Xr(a,s.partialAddress,r,await qe.new())),new Br(t,i)}async function Ir(t){const e=await je.new();return e.mul(e.generator(),t)}const Mr=async t=>{const e=new URL(`${t}/api/l1-contract-addresses`),r=await ke((async()=>{try{return await(await fetch(e.toString())).json()}catch(t){}}),"isSandboxReady",120,1);return Object.fromEntries(Object.entries(r).map((([t,e])=>[t,lt.fromString(e)])))},Nr=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);function Dr(t,e){if(!t)throw new Error(e)}class Pr{constructor(t,e){if(this.toClass=new Map,this.toName=new Map,t)for(const e of Object.keys(t))this.register(e,t[e],"string");if(e)for(const t of Object.keys(e))this.register(t,e[t],"object")}register(t,e,r){Dr("Buffer"!==t,"'Buffer' handling is hardcoded. Cannot use as name."),Dr(Nr(e.prototype,"toString")||Nr(e.prototype,"toJSON"),`Class ${t} must define a toString() OR toJSON() method.`),Dr(e.fromString||e.fromJSON,`Class ${t} must define a fromString() OR fromJSON() static method.`),this.toName.set(e,[t,r]),this.toClass.set(t,[e,r])}isRegisteredClassName(t){return this.toClass.has(t)}isRegisteredClass(t){return this.toName.has(t)}toClassObj(t){const e=this.toClass.get(t.type);Dr(e,"Could not find type in lookup.");const[r,n]=e;return"string"===n&&"string"==typeof t.data?r.fromString(t.data):r.fromJSON(t.data)}toJsonObj(t){const e=this.toName.get(t.constructor);Dr(e,"Could not find class in lookup.");const[r,n]=e;return{type:r,data:"string"===n?t.toString():t.toJSON()}}}function jr(t,e){return JSON.stringify(t,((t,e)=>"bigint"==typeof e?JSON.stringify({type:"bigint",data:e.toString()}):e),e?2:0)}function Ur(t,e){if(null!==e){if(!e)return e;if("Buffer"===e.type&&"string"==typeof e.data)return Ut.Buffer.from(e.data,"base64");if("bigint"===e.type&&"string"==typeof e.data)return BigInt(e.data);if("string"==typeof e.type&&t.isRegisteredClassName(e.type))return t.toClassObj(e);if(Array.isArray(e))return e.map((e=>Ur(t,e)));if(e.constructor===Object){const r={};for(const n of Object.keys(e))r[n]=Ur(t,e[n]);return r}return e}}function Fr(t,e){if(!e)return e;if(e instanceof Ut.Buffer)return{type:"Buffer",data:e.toString("base64")};if("bigint"==typeof e)return{type:"bigint",data:e.toString()};if(t.isRegisteredClass(e.constructor))return t.toJsonObj(e);if(Array.isArray(e))return e.map((e=>Fr(t,e)));if(e.constructor===Object){const r={};for(const n of Object.keys(e))r[n]=Fr(t,e[n]);return r}return e}const $r=ee("json-rpc:json_rpc_client");async function Hr(t,e,r,n){let i;if($r("JsonRpcClient.fetch",t,e,"->",r),i=n?await fetch(`${t}/${e}`,{method:"POST",body:jr(r),headers:{"content-type":"application/json"}}):await fetch(t,{method:"POST",body:jr({...r,method:e}),headers:{"content-type":"application/json"}}),!i.ok)throw new Error(i.statusText);try{return await i.json()}catch(t){throw new Error(`Failed to parse body as JSON: ${i.text()}`)}}async function zr(t,e,r,n){return await async function(t,e="Operation",r=function*(){const t=[1,1,1,2,4,8,16,32,64];let e=0;for(;;)yield t[Math.min(e++,t.length-1)]}(),n=ee("aztec:foundation:retry")){for(;;)try{return await t()}catch(t){const i=r.next().value;if(void 0===i)throw t;n(`${e} failed. Will retry in ${i}s...`),n(t),await Oe(1e3*i);continue}}((()=>Hr(t,e,r,n)),"JsonRpcClient request")}function qr(t,e,r,n,i=Hr){const o=new Pr(e,r);let s=0;const a=async(e,r)=>{const a={jsonrpc:"2.0",id:s++,method:e,params:r.map((t=>Fr(o,t)))};$r("JsonRpcClient.request",e,"<-",r);const c=await i(t,e,a,n);if($r("JsonRpcClient.result",e,"->",c),c.error)throw c.error;if(![null,void 0,"null","undefined"].includes(c.result))return Ur(o,c.result)};return new Proxy({},{get:(t,e)=>["then","catch"].includes(e)?Reflect.get(t,e):(...t)=>($r("JsonRpcClient.constructor","proxy",e,"<-",t),a(e,t))})}const Zr=(t,e=Hr)=>qr(t,{AztecAddress:ft,TxExecutionRequest:mr,ContractData:Ne,ContractPublicData:Me,TxHash:sr,EthAddress:lt,Point:R,PrivateKey:Ae,Fr:_},{Tx:ur,ContractDeploymentTx:fr,TxReceipt:dr},!1,e);var Vr=r(107),Wr=r.n(Vr);const Gr=JSON.parse('{"w":[{"name":"constructor","functionType":"secret","isInternal":false,"parameters":[],"returnTypes":[]},{"name":"entrypoint","functionType":"secret","isInternal":false,"parameters":[{"name":"payload","type":{"kind":"struct","fields":[{"name":"flattened_args_hashes","type":{"kind":"array","length":4,"type":{"kind":"field"}}},{"name":"flattened_selectors","type":{"kind":"array","length":4,"type":{"kind":"field"}}},{"name":"flattened_targets","type":{"kind":"array","length":4,"type":{"kind":"field"}}},{"name":"nonce","type":{"kind":"field"}}]},"visibility":"public"},{"name":"owner","type":{"kind":"array","length":64,"type":{"kind":"integer","sign":"unsigned","width":8}},"visibility":"public"},{"name":"signature","type":{"kind":"array","length":64,"type":{"kind":"integer","sign":"unsigned","width":8}},"visibility":"public"},{"name":"partial_address","type":{"kind":"field"},"visibility":"public"}],"returnTypes":[]}]}');var Kr=r(816).Buffer;async function Yr(t,e){const r=_.random(),n=[...Lt(t,De(),2),...Lt(e,De(),2)],i=[],o=await ve.get();for(const t of n)i.push(await gr.fromArgs(t.args,o));return{payload:{flattened_args_hashes:i.map((t=>t.hash)),flattened_selectors:n.map((t=>_.fromBuffer(t.functionData.functionSelectorBuffer))),flattened_targets:n.map((t=>t.to.toField())),nonce:r},packedArguments:i}}function Jr(t){return E(Kr.concat(function(t){return[...t.flattened_args_hashes,...t.flattened_selectors,...t.flattened_targets,t.nonce]}(t).map((t=>t.toBuffer()))))}class Xr{constructor(t,e,r,n){this.address=t,this.partialContractAddress=e,this.privateKey=r,this.signer=n}getAddress(){return this.address}async createAuthenticatedTxRequest(t,e){this.checkSender(t),this.checkIsNotDeployment(e);const[r,n]=Wr()(t,(t=>t.functionData.isPrivate)),i=await ve.get(),{payload:o,packedArguments:s}=await Yr(r,n),a=Jr(o),c=this.signer.constructSignature(a,this.privateKey).toBuffer(),u=[o,(await Ir(this.privateKey)).toBuffer(),c,this.partialContractAddress],f=this.getEntrypointAbi(),h=await gr.fromArgs(k(f,u),i);return mr.from({argsHash:h.hash,origin:this.address,functionData:gt.fromAbi(f),txContext:e,packedArguments:[...s,h]})}getEntrypointAbi(){const t=Gr.w.find((t=>"entrypoint"===t.name));if(!t)throw new Error("Entrypoint abi for account contract not found");return t}checkIsNotDeployment(t){if(t.isContractDeploymentTx)throw new Error("Cannot yet deploy contracts from an account contract")}checkSender(t){const e=t.find((t=>!t.from.equals(this.address)));if(e)throw new Error(`Sender ${e.from.toString()} does not match account address ${this.address.toString()}`)}}const Qr=JSON.parse('{"w":[{"name":"compute_note_hash_and_nullifier","functionType":"unconstrained","isInternal":false,"parameters":[{"name":"contract_address","type":{"kind":"field"},"visibility":"private"},{"name":"nonce","type":{"kind":"field"},"visibility":"private"},{"name":"storage_slot","type":{"kind":"field"},"visibility":"private"},{"name":"preimage","type":{"kind":"array","length":5,"type":{"kind":"field"}},"visibility":"private"}],"returnTypes":[{"kind":"array","length":4,"type":{"kind":"field"}}]},{"name":"constructor","functionType":"secret","isInternal":false,"parameters":[{"name":"signing_pub_key_x","type":{"kind":"array","length":32,"type":{"kind":"integer","sign":"unsigned","width":8}},"visibility":"public"},{"name":"signing_pub_key_y","type":{"kind":"array","length":32,"type":{"kind":"integer","sign":"unsigned","width":8}},"visibility":"public"}],"returnTypes":[]},{"name":"entrypoint","functionType":"secret","isInternal":false,"parameters":[{"name":"payload","type":{"kind":"struct","fields":[{"name":"flattened_args_hashes","type":{"kind":"array","length":4,"type":{"kind":"field"}}},{"name":"flattened_selectors","type":{"kind":"array","length":4,"type":{"kind":"field"}}},{"name":"flattened_targets","type":{"kind":"array","length":4,"type":{"kind":"field"}}},{"name":"nonce","type":{"kind":"field"}}]},"visibility":"public"},{"name":"signature","type":{"kind":"array","length":64,"type":{"kind":"integer","sign":"unsigned","width":8}},"visibility":"public"}],"returnTypes":[]}]}');class tn{constructor(t,e,r){this.address=t,this.privateKey=e,this.signer=r,this.log=ee("aztec:client:accounts:stored_key")}getAddress(){return this.address}async createAuthenticatedTxRequest(t,e){this.checkSender(t),this.checkIsNotDeployment(e);const[r,n]=Wr()(t,(t=>t.functionData.isPrivate)),i=await ve.get(),{payload:o,packedArguments:s}=await Yr(r,n),a=Jr(o),c=this.signer.constructSignature(a,this.privateKey).toBuffer();this.log(`Signed challenge ${a.toString("hex")} as ${c.toString("hex")}`);const u=[o,c],f=this.getEntrypointAbi(),h=await gr.fromArgs(k(f,u),i);return mr.from({argsHash:h.hash,origin:this.address,functionData:gt.fromAbi(f),txContext:e,packedArguments:[...s,h]})}getEntrypointAbi(){const t=Qr.w.find((t=>"entrypoint"===t.name));if(!t)throw new Error("Entrypoint abi for account contract not found");return t}checkIsNotDeployment(t){if(t.isContractDeploymentTx)throw new Error("Cannot yet deploy contracts from an account contract")}checkSender(t){const e=t.find((t=>!t.from.equals(this.address)));if(e)throw new Error(`Sender ${e.from.toString()} does not match account address ${this.address.toString()}`)}}class en{constructor(){this.accounts=new Map}registerAccount(t,e){this.accounts.set(t.toString(),e)}getAddress(){if(!this.accounts)throw new Error("No accounts registered");return ft.fromString(this.accounts.keys().next().value)}createAuthenticatedTxRequest(t,e){const r=t[0].from,n=this.accounts.get(r.toString());if(!n)throw new Error(`No account implementation registered for ${r}`);return n.createAuthenticatedTxRequest(t,e)}}})();var i=n.LJ,o=n.bG,s=n.xz,a=n.cC,c=n.CH,u=n.xq,f=n.vp,h=n.Ag,l=n.W_,d=n.g2,p=n.v4,g=n.Y8,y=n.jF,m=n.Fr,b=n.$h,w=n.pP,_=n.E9,v=n._q,S=n.a5,E=n.x6,T=n.Xo,B=n.Tx,C=n.qd,R=n.f1,A=n.EY,O=n.bH,L=n.qx,k=n.ig,x=n._$,I=n.g$,M=n.W$,N=n.ir,D=n.CF,P=n.nW,j=n.kw;export{i as AccountCollection,o as AccountWallet,s as AztecAddress,a as BaseWallet,c as Contract,u as ContractBase,f as ContractData,h as ContractDeployer,l as ContractDeploymentTx,d as ContractFunctionInteraction,p as ContractPublicData,g as DeployMethod,y as EthAddress,m as Fr,b as L2BlockL2Logs,w as PackedArguments,_ as Point,v as PrivateKey,S as SentTx,E as SingleKeyAccountContract,T as StoredKeyAccountContract,B as Tx,C as TxExecutionRequest,R as TxHash,A as TxReceipt,O as TxStatus,L as computeMessageSecretHash,k as createAccounts,x as createAztecRpcClient,I as createDebugLogger,M as emptyExecutionRequest,N as generatePublicKey,D as getAccountWallet,P as getL1ContractAddresses,j as mustSucceedFetch};