@gibme/base58 1.0.6 → 1.0.12
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/dist/base58.min.js +3 -0
- package/dist/base58.min.js.LICENSE.txt +10 -0
- package/dist/base58.min.js.map +1 -0
- package/dist/cryptonote_base58.d.ts +1 -1
- package/dist/cryptonote_base58.js +8 -7
- package/dist/cryptonote_base58.js.map +1 -1
- package/dist/{base58.d.ts → index.d.ts} +2 -2
- package/dist/{base58.js → index.js} +7 -5
- package/dist/index.js.map +1 -0
- package/package.json +14 -5
- package/dist/base58.js.map +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see base58.min.js.LICENSE.txt */
|
|
2
|
+
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(self,(()=>(()=>{var t={38:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Buffer=e.BigInteger=e.Varint=e.Writer=e.Reader=void 0;var i=r(831);Object.defineProperty(e,"Reader",{enumerable:!0,get:function(){return i.Reader}});var o=r(295);Object.defineProperty(e,"Writer",{enumerable:!0,get:function(){return o.Writer}});var s=r(142);Object.defineProperty(e,"Varint",{enumerable:!0,get:function(){return s.Varint}});var a=r(96);Object.defineProperty(e,"BigInteger",{enumerable:!0,get:function(){return n(a).default}});var u=r(287);Object.defineProperty(e,"Buffer",{enumerable:!0,get:function(){return u.Buffer}})},831:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Reader=void 0;const i=n(r(142)),o=n(r(96)),s=n(r(295)),a=r(310),u=r(287);class f extends a.Writable{constructor(t=u.Buffer.alloc(0),e="hex"){super(),this._current_offset=0,this._buffer=u.Buffer.alloc(0),this.append(t,e)}get buffer(){return this._buffer}get length(){return this._buffer.length}get offset(){return this._current_offset}get unreadBytes(){const t=this.length-this.offset;return t>=0?t:0}get unreadBuffer(){return this.buffer.slice(this.offset)}static readUIntBE(t,e,r=0,n=!1){if(t.length<r+e){if(n)return o.default.zero;throw new RangeError("Out of bounds")}const i=t.slice(r,r+e);return(0,o.default)(i.toString("hex"),16)}static readUIntLE(t,e,r=0,n=!1){if(t.length<r+e){if(n)return o.default.zero;throw new RangeError("Out of bounds")}const i=t.slice(r,r+e),s=u.Buffer.alloc(e);let a=e-1;for(const t of i)s[a]=t,a-=1;return(0,o.default)(s.toString("hex"),16)}_write(t,e,r){this.append(t),r()}append(t,e="hex"){let r;if(t instanceof f||t instanceof s.default)r=t.buffer;else if(t instanceof u.Buffer)r=t;else if(t instanceof Uint8Array)r=u.Buffer.from(t);else{if(t.length%2!=0)throw new Error("Unknown data type");r=u.Buffer.from(t,e)}this._buffer=u.Buffer.concat([this._buffer,r])}bytes(t=1){if(this.unreadBytes<t)throw new RangeError(`Requested ${t} bytes but only ${this.unreadBytes} bytes remain`);const e=this.offset;return this._current_offset+=t,this._buffer.slice(e,this.offset)}compact(t=this.offset){this._buffer=this._buffer.slice(t),this._current_offset=0}hash(t=32,e="hex"){return this.bytes(t).toString(e)}hex(t=1,e="hex"){return this.bytes(t).toString(e)}signed_integer(t,e=!1){if(t%8!=0)throw new RangeError("bits must be a multiple of 8");const r=t/8,n=this.bytes(r);switch(r){case 1:return(0,o.default)(n.readInt8());case 2:return(0,o.default)(e?n.readInt16BE():n.readInt16LE());case 4:return(0,o.default)(e?n.readInt32BE():n.readInt32LE());case 8:return(0,o.default)(e?n.readBigInt64BE():n.readBigInt64LE());default:throw new RangeError("Data type")}}int8_t(){return this.signed_integer(8)}int16_t(t=!1){return this.signed_integer(16,t)}int32_t(t=!1){return this.signed_integer(32,t)}int64_t(t=!1){return this.signed_integer(64,t)}reset(t=0){this._current_offset=t}skip(t=1){this._current_offset+=t}string(t="utf-8"){const e=this.varint().toJSNumber();return this.bytes(e).toString(t)}time_t(t=!1){const e=this.uint64_t(!t).toJSNumber();return new Date(1e3*e)}toString(t="hex"){return this._buffer.toString(t)}unsigned_integer(t,e=!1){if(t%8!=0)throw new RangeError("bits must be a multiple of 8");const r=t/8;return e?f.readUIntBE(this.bytes(r),r):f.readUIntLE(this.bytes(r),r)}uint8_t(){return this.unsigned_integer(8)}uint16_t(t=!1){return this.unsigned_integer(16,t)}uint32_t(t=!1){return this.unsigned_integer(32,t)}uint64_t(t=!1){return this.unsigned_integer(64,t)}uint128_t(t=!1){return this.unsigned_integer(128,t)}uint256_t(t=!1){return this.unsigned_integer(256,t)}uint512_t(t=!1){return this.unsigned_integer(512,t)}varint(t=!1,e=!1){const r=this._current_offset;if(e){let t=this.uint8_t().toJSNumber();const e=3&t;t=(0,o.default)(t);let r=0;switch(e){case 0:r=0;break;case 1:r=1;break;case 2:r=3;break;case 3:r=7}for(let e=1;e<=r;++e){const r=this.uint8_t().shiftLeft(8*e);t=t.or(r)}return t.shiftRight(2)}for(;;){if(this.buffer.readUInt8(this._current_offset)<128){this._current_offset++;const e=this.buffer.slice(r,this.offset);return t&&(this._current_offset=r),i.default.decode(e)}this._current_offset++}}}e.default=f,e.Reader=f},142:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Varint=void 0;const i=n(r(96)),o=r(287);class s{static decode(t){let e,r=0,n=0,o=i.default.zero;do{if(r>=t.length)throw new RangeError("Could not decode varint");e=t[r++];const i=n<28?(127&e)<<n:(127&e)*Math.pow(2,n);o=o.add(i),n+=7}while(e>=128);return o}static encode(t){"number"==typeof t&&(t=i.default.zero.add(t));const e=[];let r=0;for(;t.greaterOrEquals(Math.pow(2,31));)e[r++]=t.and(255).or(128).toJSNumber(),t=t.divide(128);for(;t.and(-128).greater(0);)e[r++]=t.and(255).or(128).toJSNumber(),t=t.shiftRight(7);return e[r]=t.or(0).toJSNumber(),o.Buffer.from(e)}}e.default=s,e.Varint=s},295:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Writer=void 0;const i=n(r(142)),o=n(r(96)),s=r(310),a=n(r(831)),u=r(287);class f extends s.Readable{constructor(t=u.Buffer.alloc(0),e="hex"){super(),this._buffer=u.Buffer.alloc(0),this._readIndex=0,this.append(t,e)}get buffer(){return this._buffer}get length(){return this._buffer.length}get readIndex(){return this._readIndex}static determineBits(t){"number"==typeof t&&(t=(0,o.default)(t));const e=[1,2,4,8,16,32,64,128,256,512,1024];for(const r of e){let e=o.default.zero;if(e=t.greater(-1)?(0,o.default)(2).pow(8*r).subtract(1):(0,o.default)(2).pow(8*r-1).subtract(1).abs(),t.compare(e)<=0)return 8*r}throw new RangeError("value is out of range")}static writeUIntBE(t,e){const r=t.toString(16).padStart(2*e,"0");return u.Buffer.from(r,"hex")}static writeUIntLE(t,e){const r=t.toString(16).padStart(2*e,"0"),n=u.Buffer.from(r,"hex"),i=u.Buffer.alloc(e);let o=e-1;for(const t of n)i[o]=t,o-=1;return i}_read(t){let e=!0;for(;e;){let r=u.Buffer.alloc(0);r=this.readIndex+t>this.length?this._buffer.slice(this.readIndex):this._buffer.slice(this.readIndex,this.readIndex+t),r.length>0?this.push(r):(this.push(null),e=!1),this._readIndex+=r.length}}clear(){this._buffer=u.Buffer.alloc(0)}hash(t,e="hex"){if((t instanceof u.Buffer||t instanceof Uint8Array)&&(32===t.length||64===t.length))return this.append(t);if("string"==typeof t&&(64===t.length||128===t.length))return this.append(t,e);throw new TypeError("hash is of wrong size and/or type")}hex(t){if(t instanceof u.Buffer||t instanceof Uint8Array)return this.append(t);if(t.length%2==0)return this.append(t,"hex");throw new TypeError("hex is of the wrong size and/or type")}signed_integer(t,e=f.determineBits(t),r=!1){if(e%8!=0)throw new RangeError("bits must be a multiple of 8");"number"==typeof t&&(t=(0,o.default)(t));const n=e/8,i=u.Buffer.alloc(n);switch(n){case 1:i.writeInt8(t.toJSNumber(),0);break;case 2:(r?i.writeInt16BE:i.writeInt16LE)(t.toJSNumber(),0);break;case 4:(r?i.writeInt32BE:i.writeInt32LE)(t.toJSNumber(),0);break;case 8:(r?i.writeBigInt64BE:i.writeBigInt64LE)(BigInt(t.toString()),0);break;default:throw new TypeError("value bit size is not supported")}return this.append(i)}int8_t(t){return this.signed_integer(t,8)}int16_t(t){return this.signed_integer(t,16)}int32_t(t){return this.signed_integer(t,32)}int64_t(t){return this.signed_integer(t,64)}string(t,e="utf-8"){if(!this.varint(t.length))throw new Error("could not encode string length as varint");const r=u.Buffer.from(t,e);return this.append(r)}time_t(t,e=!1){const r=(0,o.default)(Math.floor(t.getTime()/1e3));return this.uint64_t(r,!e)}toString(t="hex"){return this.buffer.toString(t)}unsigned_integer(t,e=f.determineBits(t),r=!1){if("number"==typeof t&&(t=(0,o.default)(t)),e%8!=0)throw new RangeError("bits must be a multiple of 8");if(t.lesser(0))throw new RangeError("cannot store signed value in unsigned type");const n=e/8,i=r?f.writeUIntBE(t,n):f.writeUIntLE(t,n);return this.append(i)}uint8_t(t,e=!1){return this.unsigned_integer(t,8,e)}uint16_t(t,e=!1){return this.unsigned_integer(t,16,e)}uint32_t(t,e=!1){return this.unsigned_integer(t,32,e)}uint64_t(t,e=!1){return this.unsigned_integer(t,64,e)}uint128_t(t,e=!1){return this.unsigned_integer(t,128,e)}uint256_t(t,e=!1){return this.unsigned_integer(t,256,e)}uint512_t(t,e=!1){return this.unsigned_integer(t,512,e)}varint(t,e=!1){if("number"==typeof t&&(t=(0,o.default)(t)),e){if(t.greater((0,o.default)("1073741823")))throw new RangeError("value out of range");let e=(t=t.toJSNumber())<<2,r=0;t<=63?(e|=0,r=1):t<=16383?(e|=1,r=2):(e|=2,r=4);for(let t=0;t<r;t++)this.uint8_t(e>>8*t&255);return this}return this.append(u.Buffer.from(i.default.encode(t)))}append(t,e="hex"){let r;return r=t instanceof a.default||t instanceof f?t.buffer:t instanceof u.Buffer?t:t instanceof Uint8Array?u.Buffer.from(t):u.Buffer.from(t,e),this._buffer=u.Buffer.concat([this._buffer,r]),this}bytes(t){return this.append(t)}}e.default=f,e.Writer=f},526:(t,e)=>{"use strict";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],u=o[1],f=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,u)),l=0,h=u>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)],f[l++]=e>>16&255,f[l++]=e>>8&255,f[l++]=255&e;return 2===u&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,f[l++]=255&e),1===u&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,f[l++]=e>>8&255,f[l++]=255&e),f},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,f=n-i;a<f;a+=s)o.push(u(t,a,a+s>f?f: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 u(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},96:(t,e,r)=>{var n;t=r.nmd(t);var i=function(t){"use strict";var e=1e7,r=7,n=9007199254740992,o=p(n),s="0123456789abcdefghijklmnopqrstuvwxyz",a="function"==typeof BigInt;function u(t,e,r,n){return void 0===t?u[0]:void 0===e||10==+e&&!r?K(t):H(t,e,r,n)}function f(t,e){this.value=t,this.sign=e,this.isSmall=!1}function l(t){this.value=t,this.sign=t<0,this.isSmall=!0}function h(t){this.value=t}function c(t){return-n<t&&t<n}function p(t){return t<1e7?[t]:t<1e14?[t%1e7,Math.floor(t/1e7)]:[t%1e7,Math.floor(t/1e7)%1e7,Math.floor(t/1e14)]}function d(t){g(t);var r=t.length;if(r<4&&x(t,o)<0)switch(r){case 0:return 0;case 1:return t[0];case 2:return t[0]+t[1]*e;default:return t[0]+(t[1]+t[2]*e)*e}return t}function g(t){for(var e=t.length;0===t[--e];);t.length=e+1}function y(t){for(var e=new Array(t),r=-1;++r<t;)e[r]=0;return e}function b(t){return t>0?Math.floor(t):Math.ceil(t)}function v(t,r){var n,i,o=t.length,s=r.length,a=new Array(o),u=0,f=e;for(i=0;i<s;i++)u=(n=t[i]+r[i]+u)>=f?1:0,a[i]=n-u*f;for(;i<o;)u=(n=t[i]+u)===f?1:0,a[i++]=n-u*f;return u>0&&a.push(u),a}function w(t,e){return t.length>=e.length?v(t,e):v(e,t)}function m(t,r){var n,i,o=t.length,s=new Array(o),a=e;for(i=0;i<o;i++)n=t[i]-a+r,r=Math.floor(n/a),s[i]=n-r*a,r+=1;for(;r>0;)s[i++]=r%a,r=Math.floor(r/a);return s}function _(t,r){var n,i,o=t.length,s=r.length,a=new Array(o),u=0,f=e;for(n=0;n<s;n++)(i=t[n]-u-r[n])<0?(i+=f,u=1):u=0,a[n]=i;for(n=s;n<o;n++){if(!((i=t[n]-u)<0)){a[n++]=i;break}i+=f,a[n]=i}for(;n<o;n++)a[n]=t[n];return g(a),a}function E(t,r,n){var i,o,s=t.length,a=new Array(s),u=-r,h=e;for(i=0;i<s;i++)o=t[i]+u,u=Math.floor(o/h),o%=h,a[i]=o<0?o+h:o;return"number"==typeof(a=d(a))?(n&&(a=-a),new l(a)):new f(a,n)}function S(t,r){var n,i,o,s,a=t.length,u=r.length,f=y(a+u),l=e;for(o=0;o<a;++o){s=t[o];for(var h=0;h<u;++h)n=s*r[h]+f[o+h],i=Math.floor(n/l),f[o+h]=n-i*l,f[o+h+1]+=i}return g(f),f}function B(t,r){var n,i,o=t.length,s=new Array(o),a=e,u=0;for(i=0;i<o;i++)n=t[i]*r+u,u=Math.floor(n/a),s[i]=n-u*a;for(;u>0;)s[i++]=u%a,u=Math.floor(u/a);return s}function R(t,e){for(var r=[];e-- >0;)r.push(0);return r.concat(t)}function O(t,e){var r=Math.max(t.length,e.length);if(r<=30)return S(t,e);r=Math.ceil(r/2);var n=t.slice(r),i=t.slice(0,r),o=e.slice(r),s=e.slice(0,r),a=O(i,s),u=O(n,o),f=O(w(i,n),w(s,o)),l=w(w(a,R(_(_(f,a),u),r)),R(u,2*r));return g(l),l}function A(t,r,n){return new f(t<e?B(r,t):S(r,p(t)),n)}function I(t){var r,n,i,o,s=t.length,a=y(s+s),u=e;for(i=0;i<s;i++){n=0-(o=t[i])*o;for(var f=i;f<s;f++)r=o*t[f]*2+a[i+f]+n,n=Math.floor(r/u),a[i+f]=r-n*u;a[i+s]=n}return g(a),a}function L(t,r){var n,i,o,s,a=t.length,u=y(a),f=e;for(o=0,n=a-1;n>=0;--n)o=(s=o*f+t[n])-(i=b(s/r))*r,u[n]=0|i;return[u,0|o]}function M(t,r){var n,i=K(r);if(a)return[new h(t.value/i.value),new h(t.value%i.value)];var o,s=t.value,c=i.value;if(0===c)throw new Error("Cannot divide by zero");if(t.isSmall)return i.isSmall?[new l(b(s/c)),new l(s%c)]:[u[0],t];if(i.isSmall){if(1===c)return[t,u[0]];if(-1==c)return[t.negate(),u[0]];var v=Math.abs(c);if(v<e){o=d((n=L(s,v))[0]);var w=n[1];return t.sign&&(w=-w),"number"==typeof o?(t.sign!==i.sign&&(o=-o),[new l(o),new l(w)]):[new f(o,t.sign!==i.sign),new l(w)]}c=p(v)}var m=x(s,c);if(-1===m)return[u[0],t];if(0===m)return[u[t.sign===i.sign?1:-1],u[0]];n=s.length+c.length<=200?function(t,r){var n,i,o,s,a,u,f,l=t.length,h=r.length,c=e,p=y(r.length),g=r[h-1],b=Math.ceil(c/(2*g)),v=B(t,b),w=B(r,b);for(v.length<=l&&v.push(0),w.push(0),g=w[h-1],i=l-h;i>=0;i--){for(n=c-1,v[i+h]!==g&&(n=Math.floor((v[i+h]*c+v[i+h-1])/g)),o=0,s=0,u=w.length,a=0;a<u;a++)o+=n*w[a],f=Math.floor(o/c),s+=v[i+a]-(o-f*c),o=f,s<0?(v[i+a]=s+c,s=-1):(v[i+a]=s,s=0);for(;0!==s;){for(n-=1,o=0,a=0;a<u;a++)(o+=v[i+a]-c+w[a])<0?(v[i+a]=o+c,o=0):(v[i+a]=o,o=1);s+=o}p[i]=n}return v=L(v,b)[0],[d(p),d(v)]}(s,c):function(t,r){for(var n,i,o,s,a,u=t.length,f=r.length,l=[],h=[],c=e;u;)if(h.unshift(t[--u]),g(h),x(h,r)<0)l.push(0);else{o=h[(i=h.length)-1]*c+h[i-2],s=r[f-1]*c+r[f-2],i>f&&(o=(o+1)*c),n=Math.ceil(o/s);do{if(x(a=B(r,n),h)<=0)break;n--}while(n);l.push(n),h=_(h,a)}return l.reverse(),[d(l),d(h)]}(s,c),o=n[0];var E=t.sign!==i.sign,S=n[1],R=t.sign;return"number"==typeof o?(E&&(o=-o),o=new l(o)):o=new f(o,E),"number"==typeof S?(R&&(S=-S),S=new l(S)):S=new f(S,R),[o,S]}function x(t,e){if(t.length!==e.length)return t.length>e.length?1:-1;for(var r=t.length-1;r>=0;r--)if(t[r]!==e[r])return t[r]>e[r]?1:-1;return 0}function T(t){var e=t.abs();return!e.isUnit()&&(!!(e.equals(2)||e.equals(3)||e.equals(5))||!(e.isEven()||e.isDivisibleBy(3)||e.isDivisibleBy(5))&&(!!e.lesser(49)||void 0))}function N(t,e){for(var r,n,o,s=t.prev(),a=s,u=0;a.isEven();)a=a.divide(2),u++;t:for(n=0;n<e.length;n++)if(!t.lesser(e[n])&&!(o=i(e[n]).modPow(a,t)).isUnit()&&!o.equals(s)){for(r=u-1;0!=r;r--){if((o=o.square().mod(t)).isUnit())return!1;if(o.equals(s))continue t}return!1}return!0}f.prototype=Object.create(u.prototype),l.prototype=Object.create(u.prototype),h.prototype=Object.create(u.prototype),f.prototype.add=function(t){var e=K(t);if(this.sign!==e.sign)return this.subtract(e.negate());var r=this.value,n=e.value;return e.isSmall?new f(m(r,Math.abs(n)),this.sign):new f(w(r,n),this.sign)},f.prototype.plus=f.prototype.add,l.prototype.add=function(t){var e=K(t),r=this.value;if(r<0!==e.sign)return this.subtract(e.negate());var n=e.value;if(e.isSmall){if(c(r+n))return new l(r+n);n=p(Math.abs(n))}return new f(m(n,Math.abs(r)),r<0)},l.prototype.plus=l.prototype.add,h.prototype.add=function(t){return new h(this.value+K(t).value)},h.prototype.plus=h.prototype.add,f.prototype.subtract=function(t){var e=K(t);if(this.sign!==e.sign)return this.add(e.negate());var r=this.value,n=e.value;return e.isSmall?E(r,Math.abs(n),this.sign):function(t,e,r){var n;return x(t,e)>=0?n=_(t,e):(n=_(e,t),r=!r),"number"==typeof(n=d(n))?(r&&(n=-n),new l(n)):new f(n,r)}(r,n,this.sign)},f.prototype.minus=f.prototype.subtract,l.prototype.subtract=function(t){var e=K(t),r=this.value;if(r<0!==e.sign)return this.add(e.negate());var n=e.value;return e.isSmall?new l(r-n):E(n,Math.abs(r),r>=0)},l.prototype.minus=l.prototype.subtract,h.prototype.subtract=function(t){return new h(this.value-K(t).value)},h.prototype.minus=h.prototype.subtract,f.prototype.negate=function(){return new f(this.value,!this.sign)},l.prototype.negate=function(){var t=this.sign,e=new l(-this.value);return e.sign=!t,e},h.prototype.negate=function(){return new h(-this.value)},f.prototype.abs=function(){return new f(this.value,!1)},l.prototype.abs=function(){return new l(Math.abs(this.value))},h.prototype.abs=function(){return new h(this.value>=0?this.value:-this.value)},f.prototype.multiply=function(t){var r,n,i,o=K(t),s=this.value,a=o.value,l=this.sign!==o.sign;if(o.isSmall){if(0===a)return u[0];if(1===a)return this;if(-1===a)return this.negate();if((r=Math.abs(a))<e)return new f(B(s,r),l);a=p(r)}return new f(-.012*(n=s.length)-.012*(i=a.length)+15e-6*n*i>0?O(s,a):S(s,a),l)},f.prototype.times=f.prototype.multiply,l.prototype._multiplyBySmall=function(t){return c(t.value*this.value)?new l(t.value*this.value):A(Math.abs(t.value),p(Math.abs(this.value)),this.sign!==t.sign)},f.prototype._multiplyBySmall=function(t){return 0===t.value?u[0]:1===t.value?this:-1===t.value?this.negate():A(Math.abs(t.value),this.value,this.sign!==t.sign)},l.prototype.multiply=function(t){return K(t)._multiplyBySmall(this)},l.prototype.times=l.prototype.multiply,h.prototype.multiply=function(t){return new h(this.value*K(t).value)},h.prototype.times=h.prototype.multiply,f.prototype.square=function(){return new f(I(this.value),!1)},l.prototype.square=function(){var t=this.value*this.value;return c(t)?new l(t):new f(I(p(Math.abs(this.value))),!1)},h.prototype.square=function(t){return new h(this.value*this.value)},f.prototype.divmod=function(t){var e=M(this,t);return{quotient:e[0],remainder:e[1]}},h.prototype.divmod=l.prototype.divmod=f.prototype.divmod,f.prototype.divide=function(t){return M(this,t)[0]},h.prototype.over=h.prototype.divide=function(t){return new h(this.value/K(t).value)},l.prototype.over=l.prototype.divide=f.prototype.over=f.prototype.divide,f.prototype.mod=function(t){return M(this,t)[1]},h.prototype.mod=h.prototype.remainder=function(t){return new h(this.value%K(t).value)},l.prototype.remainder=l.prototype.mod=f.prototype.remainder=f.prototype.mod,f.prototype.pow=function(t){var e,r,n,i=K(t),o=this.value,s=i.value;if(0===s)return u[1];if(0===o)return u[0];if(1===o)return u[1];if(-1===o)return i.isEven()?u[1]:u[-1];if(i.sign)return u[0];if(!i.isSmall)throw new Error("The exponent "+i.toString()+" is too large.");if(this.isSmall&&c(e=Math.pow(o,s)))return new l(b(e));for(r=this,n=u[1];!0&s&&(n=n.times(r),--s),0!==s;)s/=2,r=r.square();return n},l.prototype.pow=f.prototype.pow,h.prototype.pow=function(t){var e=K(t),r=this.value,n=e.value,i=BigInt(0),o=BigInt(1),s=BigInt(2);if(n===i)return u[1];if(r===i)return u[0];if(r===o)return u[1];if(r===BigInt(-1))return e.isEven()?u[1]:u[-1];if(e.isNegative())return new h(i);for(var a=this,f=u[1];(n&o)===o&&(f=f.times(a),--n),n!==i;)n/=s,a=a.square();return f},f.prototype.modPow=function(t,e){if(t=K(t),(e=K(e)).isZero())throw new Error("Cannot take modPow with modulus 0");var r=u[1],n=this.mod(e);for(t.isNegative()&&(t=t.multiply(u[-1]),n=n.modInv(e));t.isPositive();){if(n.isZero())return u[0];t.isOdd()&&(r=r.multiply(n).mod(e)),t=t.divide(2),n=n.square().mod(e)}return r},h.prototype.modPow=l.prototype.modPow=f.prototype.modPow,f.prototype.compareAbs=function(t){var e=K(t),r=this.value,n=e.value;return e.isSmall?1:x(r,n)},l.prototype.compareAbs=function(t){var e=K(t),r=Math.abs(this.value),n=e.value;return e.isSmall?r===(n=Math.abs(n))?0:r>n?1:-1:-1},h.prototype.compareAbs=function(t){var e=this.value,r=K(t).value;return(e=e>=0?e:-e)===(r=r>=0?r:-r)?0:e>r?1:-1},f.prototype.compare=function(t){if(t===1/0)return-1;if(t===-1/0)return 1;var e=K(t),r=this.value,n=e.value;return this.sign!==e.sign?e.sign?1:-1:e.isSmall?this.sign?-1:1:x(r,n)*(this.sign?-1:1)},f.prototype.compareTo=f.prototype.compare,l.prototype.compare=function(t){if(t===1/0)return-1;if(t===-1/0)return 1;var e=K(t),r=this.value,n=e.value;return e.isSmall?r==n?0:r>n?1:-1:r<0!==e.sign?r<0?-1:1:r<0?1:-1},l.prototype.compareTo=l.prototype.compare,h.prototype.compare=function(t){if(t===1/0)return-1;if(t===-1/0)return 1;var e=this.value,r=K(t).value;return e===r?0:e>r?1:-1},h.prototype.compareTo=h.prototype.compare,f.prototype.equals=function(t){return 0===this.compare(t)},h.prototype.eq=h.prototype.equals=l.prototype.eq=l.prototype.equals=f.prototype.eq=f.prototype.equals,f.prototype.notEquals=function(t){return 0!==this.compare(t)},h.prototype.neq=h.prototype.notEquals=l.prototype.neq=l.prototype.notEquals=f.prototype.neq=f.prototype.notEquals,f.prototype.greater=function(t){return this.compare(t)>0},h.prototype.gt=h.prototype.greater=l.prototype.gt=l.prototype.greater=f.prototype.gt=f.prototype.greater,f.prototype.lesser=function(t){return this.compare(t)<0},h.prototype.lt=h.prototype.lesser=l.prototype.lt=l.prototype.lesser=f.prototype.lt=f.prototype.lesser,f.prototype.greaterOrEquals=function(t){return this.compare(t)>=0},h.prototype.geq=h.prototype.greaterOrEquals=l.prototype.geq=l.prototype.greaterOrEquals=f.prototype.geq=f.prototype.greaterOrEquals,f.prototype.lesserOrEquals=function(t){return this.compare(t)<=0},h.prototype.leq=h.prototype.lesserOrEquals=l.prototype.leq=l.prototype.lesserOrEquals=f.prototype.leq=f.prototype.lesserOrEquals,f.prototype.isEven=function(){return!(1&this.value[0])},l.prototype.isEven=function(){return!(1&this.value)},h.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},f.prototype.isOdd=function(){return!(1&~this.value[0])},l.prototype.isOdd=function(){return!(1&~this.value)},h.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},f.prototype.isPositive=function(){return!this.sign},l.prototype.isPositive=function(){return this.value>0},h.prototype.isPositive=l.prototype.isPositive,f.prototype.isNegative=function(){return this.sign},l.prototype.isNegative=function(){return this.value<0},h.prototype.isNegative=l.prototype.isNegative,f.prototype.isUnit=function(){return!1},l.prototype.isUnit=function(){return 1===Math.abs(this.value)},h.prototype.isUnit=function(){return this.abs().value===BigInt(1)},f.prototype.isZero=function(){return!1},l.prototype.isZero=function(){return 0===this.value},h.prototype.isZero=function(){return this.value===BigInt(0)},f.prototype.isDivisibleBy=function(t){var e=K(t);return!e.isZero()&&(!!e.isUnit()||(0===e.compareAbs(2)?this.isEven():this.mod(e).isZero()))},h.prototype.isDivisibleBy=l.prototype.isDivisibleBy=f.prototype.isDivisibleBy,f.prototype.isPrime=function(e){var r=T(this);if(r!==t)return r;var n=this.abs(),o=n.bitLength();if(o<=64)return N(n,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var s=Math.log(2)*o.toJSNumber(),a=Math.ceil(!0===e?2*Math.pow(s,2):s),u=[],f=0;f<a;f++)u.push(i(f+2));return N(n,u)},h.prototype.isPrime=l.prototype.isPrime=f.prototype.isPrime,f.prototype.isProbablePrime=function(e,r){var n=T(this);if(n!==t)return n;for(var o=this.abs(),s=e===t?5:e,a=[],u=0;u<s;u++)a.push(i.randBetween(2,o.minus(2),r));return N(o,a)},h.prototype.isProbablePrime=l.prototype.isProbablePrime=f.prototype.isProbablePrime,f.prototype.modInv=function(t){for(var e,r,n,o=i.zero,s=i.one,a=K(t),u=this.abs();!u.isZero();)e=a.divide(u),r=o,n=a,o=s,a=u,s=r.subtract(e.multiply(s)),u=n.subtract(e.multiply(u));if(!a.isUnit())throw new Error(this.toString()+" and "+t.toString()+" are not co-prime");return-1===o.compare(0)&&(o=o.add(t)),this.isNegative()?o.negate():o},h.prototype.modInv=l.prototype.modInv=f.prototype.modInv,f.prototype.next=function(){var t=this.value;return this.sign?E(t,1,this.sign):new f(m(t,1),this.sign)},l.prototype.next=function(){var t=this.value;return t+1<n?new l(t+1):new f(o,!1)},h.prototype.next=function(){return new h(this.value+BigInt(1))},f.prototype.prev=function(){var t=this.value;return this.sign?new f(m(t,1),!0):E(t,1,this.sign)},l.prototype.prev=function(){var t=this.value;return t-1>-n?new l(t-1):new f(o,!0)},h.prototype.prev=function(){return new h(this.value-BigInt(1))};for(var k=[1];2*k[k.length-1]<=e;)k.push(2*k[k.length-1]);var U=k.length,P=k[U-1];function C(t){return Math.abs(t)<=e}function j(t,e,r){e=K(e);for(var n=t.isNegative(),o=e.isNegative(),s=n?t.not():t,a=o?e.not():e,u=0,f=0,l=null,h=null,c=[];!s.isZero()||!a.isZero();)u=(l=M(s,P))[1].toJSNumber(),n&&(u=P-1-u),f=(h=M(a,P))[1].toJSNumber(),o&&(f=P-1-f),s=l[0],a=h[0],c.push(r(u,f));for(var p=0!==r(n?1:0,o?1:0)?i(-1):i(0),d=c.length-1;d>=0;d-=1)p=p.multiply(P).add(i(c[d]));return p}f.prototype.shiftLeft=function(t){var e=K(t).toJSNumber();if(!C(e))throw new Error(String(e)+" is too large for shifting.");if(e<0)return this.shiftRight(-e);var r=this;if(r.isZero())return r;for(;e>=U;)r=r.multiply(P),e-=U-1;return r.multiply(k[e])},h.prototype.shiftLeft=l.prototype.shiftLeft=f.prototype.shiftLeft,f.prototype.shiftRight=function(t){var e,r=K(t).toJSNumber();if(!C(r))throw new Error(String(r)+" is too large for shifting.");if(r<0)return this.shiftLeft(-r);for(var n=this;r>=U;){if(n.isZero()||n.isNegative()&&n.isUnit())return n;n=(e=M(n,P))[1].isNegative()?e[0].prev():e[0],r-=U-1}return(e=M(n,k[r]))[1].isNegative()?e[0].prev():e[0]},h.prototype.shiftRight=l.prototype.shiftRight=f.prototype.shiftRight,f.prototype.not=function(){return this.negate().prev()},h.prototype.not=l.prototype.not=f.prototype.not,f.prototype.and=function(t){return j(this,t,(function(t,e){return t&e}))},h.prototype.and=l.prototype.and=f.prototype.and,f.prototype.or=function(t){return j(this,t,(function(t,e){return t|e}))},h.prototype.or=l.prototype.or=f.prototype.or,f.prototype.xor=function(t){return j(this,t,(function(t,e){return t^e}))},h.prototype.xor=l.prototype.xor=f.prototype.xor;var D=1<<30,q=(e&-e)*(e&-e)|D;function F(t){var r=t.value,n="number"==typeof r?r|D:"bigint"==typeof r?r|BigInt(D):r[0]+r[1]*e|q;return n&-n}function W(t,e){if(e.compareTo(t)<=0){var r=W(t,e.square(e)),n=r.p,o=r.e,s=n.multiply(e);return s.compareTo(t)<=0?{p:s,e:2*o+1}:{p:n,e:2*o}}return{p:i(1),e:0}}function $(t,e){return t=K(t),e=K(e),t.greater(e)?t:e}function J(t,e){return t=K(t),e=K(e),t.lesser(e)?t:e}function z(t,e){if(t=K(t).abs(),e=K(e).abs(),t.equals(e))return t;if(t.isZero())return e;if(e.isZero())return t;for(var r,n,i=u[1];t.isEven()&&e.isEven();)r=J(F(t),F(e)),t=t.divide(r),e=e.divide(r),i=i.multiply(r);for(;t.isEven();)t=t.divide(F(t));do{for(;e.isEven();)e=e.divide(F(e));t.greater(e)&&(n=e,e=t,t=n),e=e.subtract(t)}while(!e.isZero());return i.isUnit()?t:t.multiply(i)}f.prototype.bitLength=function(){var t=this;return t.compareTo(i(0))<0&&(t=t.negate().subtract(i(1))),0===t.compareTo(i(0))?i(0):i(W(t,i(2)).e).add(i(1))},h.prototype.bitLength=l.prototype.bitLength=f.prototype.bitLength;var H=function(t,e,r,n){r=r||s,t=String(t),n||(t=t.toLowerCase(),r=r.toLowerCase());var i,o=t.length,a=Math.abs(e),u={};for(i=0;i<r.length;i++)u[r[i]]=i;for(i=0;i<o;i++)if("-"!==(h=t[i])&&h in u&&u[h]>=a){if("1"===h&&1===a)continue;throw new Error(h+" is not a valid digit in base "+e+".")}e=K(e);var f=[],l="-"===t[0];for(i=l?1:0;i<t.length;i++){var h;if((h=t[i])in u)f.push(K(u[h]));else{if("<"!==h)throw new Error(h+" is not a valid character");var c=i;do{i++}while(">"!==t[i]&&i<t.length);f.push(K(t.slice(c+1,i)))}}return V(f,e,l)};function V(t,e,r){var n,i=u[0],o=u[1];for(n=t.length-1;n>=0;n--)i=i.add(t[n].times(o)),o=o.times(e);return r?i.negate():i}function Z(t,e){if((e=i(e)).isZero()){if(t.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(e.equals(-1)){if(t.isZero())return{value:[0],isNegative:!1};if(t.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-t.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var r=Array.apply(null,Array(t.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return r.unshift([1]),{value:[].concat.apply([],r),isNegative:!1}}var n=!1;if(t.isNegative()&&e.isPositive()&&(n=!0,t=t.abs()),e.isUnit())return t.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(t.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:n};for(var o,s=[],a=t;a.isNegative()||a.compareAbs(e)>=0;){o=a.divmod(e),a=o.quotient;var u=o.remainder;u.isNegative()&&(u=e.minus(u).abs(),a=a.next()),s.push(u.toJSNumber())}return s.push(a.toJSNumber()),{value:s.reverse(),isNegative:n}}function G(t,e,r){var n=Z(t,e);return(n.isNegative?"-":"")+n.value.map((function(t){return function(t,e){return t<(e=e||s).length?e[t]:"<"+t+">"}(t,r)})).join("")}function Y(t){if(c(+t)){var e=+t;if(e===b(e))return a?new h(BigInt(e)):new l(e);throw new Error("Invalid integer: "+t)}var n="-"===t[0];n&&(t=t.slice(1));var i=t.split(/e/i);if(i.length>2)throw new Error("Invalid integer: "+i.join("e"));if(2===i.length){var o=i[1];if("+"===o[0]&&(o=o.slice(1)),(o=+o)!==b(o)||!c(o))throw new Error("Invalid integer: "+o+" is not a valid exponent.");var s=i[0],u=s.indexOf(".");if(u>=0&&(o-=s.length-u-1,s=s.slice(0,u)+s.slice(u+1)),o<0)throw new Error("Cannot include negative exponent part for integers");t=s+=new Array(o+1).join("0")}if(!/^([0-9][0-9]*)$/.test(t))throw new Error("Invalid integer: "+t);if(a)return new h(BigInt(n?"-"+t:t));for(var p=[],d=t.length,y=r,v=d-y;d>0;)p.push(+t.slice(v,d)),(v-=y)<0&&(v=0),d-=y;return g(p),new f(p,n)}function K(t){return"number"==typeof t?function(t){if(a)return new h(BigInt(t));if(c(t)){if(t!==b(t))throw new Error(t+" is not an integer.");return new l(t)}return Y(t.toString())}(t):"string"==typeof t?Y(t):"bigint"==typeof t?new h(t):t}f.prototype.toArray=function(t){return Z(this,t)},l.prototype.toArray=function(t){return Z(this,t)},h.prototype.toArray=function(t){return Z(this,t)},f.prototype.toString=function(e,r){if(e===t&&(e=10),10!==e||r)return G(this,e,r);for(var n,i=this.value,o=i.length,s=String(i[--o]);--o>=0;)n=String(i[o]),s+="0000000".slice(n.length)+n;return(this.sign?"-":"")+s},l.prototype.toString=function(e,r){return e===t&&(e=10),10!=e||r?G(this,e,r):String(this.value)},h.prototype.toString=l.prototype.toString,h.prototype.toJSON=f.prototype.toJSON=l.prototype.toJSON=function(){return this.toString()},f.prototype.valueOf=function(){return parseInt(this.toString(),10)},f.prototype.toJSNumber=f.prototype.valueOf,l.prototype.valueOf=function(){return this.value},l.prototype.toJSNumber=l.prototype.valueOf,h.prototype.valueOf=h.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};for(var X=0;X<1e3;X++)u[X]=K(X),X>0&&(u[-X]=K(-X));return u.one=u[1],u.zero=u[0],u.minusOne=u[-1],u.max=$,u.min=J,u.gcd=z,u.lcm=function(t,e){return t=K(t).abs(),e=K(e).abs(),t.divide(z(t,e)).multiply(e)},u.isInstance=function(t){return t instanceof f||t instanceof l||t instanceof h},u.randBetween=function(t,r,n){t=K(t),r=K(r);var i=n||Math.random,o=J(t,r),s=$(t,r).subtract(o).add(1);if(s.isSmall)return o.add(Math.floor(i()*s));for(var a=Z(s,e).value,f=[],l=!0,h=0;h<a.length;h++){var c=l?a[h]+(h+1<a.length?a[h+1]/e:0):e,p=b(i()*c);f.push(p),p<a[h]&&(l=!1)}return o.add(u.fromArray(f,e,!1))},u.fromArray=function(t,e,r){return V(t.map(K),K(e||10),r)},u}();t.hasOwnProperty("exports")&&(t.exports=i),void 0===(n=function(){return i}.call(e,r,e,t))||(t.exports=n)},287:(t,e,r)=>{"use strict";const n=r(526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.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,u.prototype),e}function u(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 f(t,e,r)}function f(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.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(G(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return c(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(G(t,ArrayBuffer)||t&&G(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(G(t,SharedArrayBuffer)||t&&G(t.buffer,SharedArrayBuffer)))return p(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 u.from(n,e,r);const i=function(t){if(u.isBuffer(t)){const e=0|d(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):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.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 l(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 l(t),a(t<0?0:0|d(t))}function c(t){const e=t.length<0?0:0|d(t.length),r=a(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function p(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,u.prototype),n}function d(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(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||G(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 H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(t).length;default:if(i)return n?-1:H(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 M(this,e,r);case"utf8":case"utf-8":return O(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return L(this,e,r);case"base64":return R(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 b(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function v(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=u.from(e,n)),u.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,u=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,u/=2,r/=2}function f(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;o<a;o++)if(f(t,o)===f(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(f(t,o+n)!==f(e,n)){r=!1;break}if(r)return o}return-1}function m(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 Z(H(e,t.length-r),t,r,n)}function E(t,e,r,n){return Z(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 Z(V(e),t,r,n)}function B(t,e,r,n){return Z(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 R(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function O(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,u;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(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,u.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}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,r){return f(t,e,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,e,r){return function(t,e,r){return l(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)},u.allocUnsafe=function(t){return h(t)},u.allocUnsafeSlow=function(t){return h(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(G(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),G(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.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},u.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}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=u.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(G(e,Uint8Array))i+e.length>n.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},u.byteLength=g,u.prototype._isBuffer=!0,u.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)b(this,e,e+1);return this},u.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)b(this,e,e+3),b(this,e+1,e+2);return this},u.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)b(this,e,e+7),b(this,e+1,e+6),b(this,e+2,e+5),b(this,e+3,e+4);return this},u.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?O(this,0,t):y.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.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&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(G(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.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),f=this.slice(n,i),l=t.slice(e,r);for(let t=0;t<a;++t)if(f[t]!==l[t]){o=f[t],s=l[t];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return v(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return v(this,t,e,r,!1)},u.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 m(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 B(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const A=4096;function I(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 L(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 M(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+=K[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 T(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 N(t,e,r,n,i,o){if(!u.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 k(t,e,r,n,i){W(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 U(t,e,r,n,i){W(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 C(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 j(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}u.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,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=X((function(t){$(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||J(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))})),u.prototype.readBigUInt64BE=X((function(t){$(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||J(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)})),u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||T(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},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||T(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},u.prototype.readInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||T(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||T(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=X((function(t){$(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||J(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)})),u.prototype.readBigInt64BE=X((function(t){$(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||J(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)})),u.prototype.readFloatLE=function(t,e){return t>>>=0,e||T(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||T(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||T(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||T(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||N(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},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||N(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},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(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},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(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},u.prototype.writeBigUInt64LE=X((function(t,e=0){return k(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=X((function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);N(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},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);N(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},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||N(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||N(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},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||N(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},u.prototype.writeBigInt64LE=X((function(t,e=0){return k(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=X((function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return C(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return C(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return j(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return j(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.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},u.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&&!u.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=u.isBuffer(t)?t:u.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 D={};function q(t,e,r){D[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 F(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 W(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 D.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){$(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||J(e,t.length-(r+1))}(n,i,o)}function $(t,e){if("number"!=typeof t)throw new D.ERR_INVALID_ARG_TYPE(e,"number",t)}function J(t,e,r){if(Math.floor(t)!==t)throw $(t,r),new D.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new D.ERR_BUFFER_OUT_OF_BOUNDS;throw new D.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}q("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),q("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),q("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=F(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=F(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const z=/[^+/0-9A-Za-z-_]/g;function H(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 V(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 Z(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 G(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 K=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")}},7:t=>{"use strict";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){"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 u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function f(t,e,r,n){var i,o,s,f;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=u(t))>0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,f=l,console&&console.warn&&console.warn(f)}return t}function l(){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=l.bind(n);return i.listener=r,n.wrapFn=i,i}function c(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):d(i,i.length)}function p(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 d(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 u(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 u=o[t];if(void 0===u)return!1;if("function"==typeof u)n(u,this,e);else{var f=u.length,l=d(u,f);for(r=0;r<f;++r)n(l[r],this,e)}return!0},o.prototype.addListener=function(t,e){return f(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return f(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 c(this,t,!0)},o.prototype.rawListeners=function(t){return c(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},251:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,f=u>>1,l=-7,h=r?i-1:0,c=r?-1:1,p=t[e+h];for(h+=c,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+h],h+=c,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+h],h+=c,l-=8);if(0===o)o=1-f;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=f}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,f=8*o-i-1,l=(1<<f)-1,h=l>>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=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=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+h>=1?c/u:c*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(e*u-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,f+=i;f>0;t[r+p]=255&s,p+=d,s/=256,f-=8);t[r+p-d]|=128*g}},698: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}}},48:t=>{"use strict";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,u;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 f=("number"!=typeof u&&(u=0),u+1>(a=t).length||-1===a.indexOf(".",u)?"argument":"property");s='The "'.concat(t,'" ').concat(f," ").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.F=e},382:(t,e,r)=>{"use strict";var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=f;var i=r(412),o=r(708);r(698)(f,i);for(var s=n(o.prototype),a=0;a<s.length;a++){var u=s[a];f.prototype[u]||(f.prototype[u]=o.prototype[u])}function f(t){if(!(this instanceof f))return new f(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",l)))}function l(){this._writableState.ended||process.nextTick(h,this)}function h(t){t.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(f.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(f.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)}})},600:(t,e,r)=>{"use strict";t.exports=i;var n=r(610);function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r(698)(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},412:(t,e,r)=>{"use strict";var n;t.exports=B,B.ReadableState=S,r(7).EventEmitter;var i,o=function(t,e){return t.listeners(e).length},s=r(345),a=r(287).Buffer,u=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},f=r(838);i=f&&f.debuglog?f.debuglog("stream"):function(){};var l,h,c,p=r(726),d=r(896),g=r(291).getHighWaterMark,y=r(48).F,b=y.ERR_INVALID_ARG_TYPE,v=y.ERR_STREAM_PUSH_AFTER_EOF,w=y.ERR_METHOD_NOT_IMPLEMENTED,m=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(698)(B,s);var _=d.errorOrDestroy,E=["error","close","destroy","pause","resume"];function S(t,e,i){n=n||r(382),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 p,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&&(l||(l=r(141).I),this.decoder=new l(t.encoding),this.encoding=t.encoding)}function B(t){if(n=n||r(382),!(this instanceof B))return new B(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 R(t,e,r,n,o){i("readableAddChunk",e);var s,f=t._readableState;if(null===e)f.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?L(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,M(t)))}}(t,f);else if(o||(s=function(t,e){var r,n;return n=e,a.isBuffer(n)||n instanceof u||"string"==typeof e||void 0===e||t.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],e)),r}(f,e)),s)_(t,s);else if(f.objectMode||e&&e.length>0)if("string"==typeof e||f.objectMode||Object.getPrototypeOf(e)===a.prototype||(e=function(t){return a.from(t)}(e)),n)f.endEmitted?_(t,new m):O(t,f,e,!0);else if(f.ended)_(t,new v);else{if(f.destroyed)return!1;f.reading=!1,f.decoder&&!r?(e=f.decoder.write(e),f.objectMode||0!==e.length?O(t,f,e,!1):x(t,f)):O(t,f,e,!1)}else n||(f.reading=!1,x(t,f));return!f.ended&&(f.length<f.highWaterMark||0===f.length)}function O(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&&L(t)),x(t,e)}Object.defineProperty(B.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),B.prototype.destroy=d.destroy,B.prototype._undestroy=d.undestroy,B.prototype._destroy=function(t,e){e(t)},B.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),R(this,t,e,!1,r)},B.prototype.unshift=function(t){return R(this,t,null,!0,!1)},B.prototype.isPaused=function(){return!1===this._readableState.flowing},B.prototype.setEncoding=function(t){l||(l=r(141).I);var e=new l(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 I(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 L(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(M,t))}function M(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(T,t,e))}function T(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 N(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 k(t){i("readable nexttick read 0"),t.read(0)}function U(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 C(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(D,e,t))}function D(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 q(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}B.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):L(this),null;if(0===(t=I(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=I(r,e))),null===(n=t>0?C(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},B.prototype._read=function(t){_(this,new w("_read()"))},B.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?d: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",c),t.removeListener("finish",p),t.removeListener("drain",u),t.removeListener("error",h),t.removeListener("unpipe",e),r.removeListener("end",a),r.removeListener("end",d),r.removeListener("data",l),f=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}));var u=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",u);var f=!1;function l(e){i("ondata");var o=t.write(e);i("dest.write",o),!1===o&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==q(n.pipes,t))&&!f&&(i("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(e){i("onerror",e),d(),t.removeListener("error",h),0===o(t,"error")&&_(t,e)}function c(){t.removeListener("finish",p),d()}function p(){i("onfinish"),t.removeListener("close",c),d()}function d(){i("unpipe"),r.unpipe(t)}return r.on("data",l),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",c),t.once("finish",p),t.emit("pipe",r),n.flowing||(i("pipe resume"),r.resume()),t},B.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=q(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},B.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?L(this):n.reading||process.nextTick(k,this))),r},B.prototype.addListener=B.prototype.on,B.prototype.removeListener=function(t,e){var r=s.prototype.removeListener.call(this,t,e);return"readable"===t&&process.nextTick(N,this),r},B.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||process.nextTick(N,this),e},B.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(U,t,e))}(this,t)),t.paused=!1,this},B.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},B.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&&(B.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=r(955)),h(this)}),Object.defineProperty(B.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(B.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(B.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),B._fromList=C,Object.defineProperty(B.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(B.from=function(t,e){return void 0===c&&(c=r(157)),c(B,t,e)})},610:(t,e,r)=>{"use strict";t.exports=l;var n=r(48).F,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(382);function f(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 l(t){if(!(this instanceof l))return new l(t);u.call(this,t),this._transformState={afterTransform:f.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?c(this,null,null):this._flush((function(e,r){c(t,e,r)}))}function c(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(698)(l,u),l.prototype.push=function(t,e){return this._transformState.needTransform=!1,u.prototype.push.call(this,t,e)},l.prototype._transform=function(t,e,r){r(new i("_transform()"))},l.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)}},l.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))},l.prototype._destroy=function(t,e){u.prototype._destroy.call(this,t,(function(t){e(t)}))}},708:(t,e,r)=>{"use strict";function n(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e){var r=t.entry;for(t.entry=null;r;){var n=r.callback;e.pendingcb--,n(undefined),r=r.next}e.corkedRequestsFree.next=t}(e,t)}}var i;t.exports=B,B.WritableState=S;var o,s={deprecate:r(643)},a=r(345),u=r(287).Buffer,f=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},l=r(896),h=r(291).getHighWaterMark,c=r(48).F,p=c.ERR_INVALID_ARG_TYPE,d=c.ERR_METHOD_NOT_IMPLEMENTED,g=c.ERR_MULTIPLE_CALLBACK,y=c.ERR_STREAM_CANNOT_PIPE,b=c.ERR_STREAM_DESTROYED,v=c.ERR_STREAM_NULL_VALUES,w=c.ERR_STREAM_WRITE_AFTER_END,m=c.ERR_UNKNOWN_ENCODING,_=l.errorOrDestroy;function E(){}function S(t,e,o){i=i||r(382),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(M,t,e),t._writableState.errorEmitted=!0,_(t,n)):(i(n),t._writableState.errorEmitted=!0,_(t,n),M(t,e))}(t,r,n,e,i);else{var o=I(r)||t.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||A(t,r),n?process.nextTick(O,t,r,o,i):O(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 B(t){var e=this instanceof(i=i||r(382));if(!e&&!o.call(B,this))return new B(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 R(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new b("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function O(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),M(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,u=!0;r;)o[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;o.allBuffers=u,R(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 f=r.chunk,l=r.encoding,h=r.callback;if(R(t,e,!1,e.objectMode?1:f.length,f,l,h),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function I(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function L(t,e){t._final((function(r){e.pendingcb--,r&&_(t,r),e.prefinished=!0,t.emit("prefinish"),M(t,e)}))}function M(t,e){var r=I(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(L,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(698)(B,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(B,Symbol.hasInstance,{value:function(t){return!!o.call(this,t)||this===B&&t&&t._writableState instanceof S}})):o=function(t){return t instanceof this},B.prototype.pipe=function(){_(this,new y)},B.prototype.write=function(t,e,r){var n,i=this._writableState,o=!1,s=!i.objectMode&&(n=t,u.isBuffer(n)||n instanceof f);return s&&!u.isBuffer(t)&&(t=function(t){return u.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 w;_(t,r),process.nextTick(e,r)}(this,r):(s||function(t,e,r,n){var i;return null===r?i=new v:"string"==typeof r||e.objectMode||(i=new p("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=u.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 f=e.length<e.highWaterMark;if(f||(e.needDrain=!0),e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else R(t,e,!1,a,n,i,o);return f}(this,i,s,t,e,r)),o},B.prototype.cork=function(){this._writableState.corked++},B.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||A(this,t))},B.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 m(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(B.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(B.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),B.prototype._write=function(t,e,r){r(new d("_write()"))},B.prototype._writev=null,B.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,M(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(B.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(B.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),B.prototype.destroy=l.destroy,B.prototype._undestroy=l.undestroy,B.prototype._destroy=function(t,e){e(t)}},955:(t,e,r)=>{"use strict";var n;function i(t,e,r){return(e=function(t){var e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=typeof r)return r;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(238),s=Symbol("lastResolve"),a=Symbol("lastReject"),u=Symbol("error"),f=Symbol("ended"),l=Symbol("lastPromise"),h=Symbol("handlePromise"),c=Symbol("stream");function p(t,e){return{value:t,done:e}}function d(t){var e=t[s];if(null!==e){var r=t[c].read();null!==r&&(t[l]=null,t[s]=null,t[a]=null,e(p(r,!1)))}}function g(t){process.nextTick(d,t)}var y=Object.getPrototypeOf((function(){})),b=Object.setPrototypeOf((i(n={get stream(){return this[c]},next:function(){var t=this,e=this[u];if(null!==e)return Promise.reject(e);if(this[f])return Promise.resolve(p(void 0,!0));if(this[c].destroyed)return new Promise((function(e,r){process.nextTick((function(){t[u]?r(t[u]):e(p(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[f]?r(p(void 0,!0)):e[h](r,n)}),n)}}(n,this));else{var i=this[c].read();if(null!==i)return Promise.resolve(p(i,!1));r=new Promise(this[h])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var t=this;return new Promise((function(e,r){t[c].destroy(null,(function(t){t?r(t):e(p(void 0,!0))}))}))})),n),y);t.exports=function(t){var e,r=Object.create(b,(i(e={},c,{value:t,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,a,{value:null,writable:!0}),i(e,u,{value:null,writable:!0}),i(e,f,{value:t._readableState.endEmitted,writable:!0}),i(e,h,{value:function(t,e){var n=r[c].read();n?(r[l]=null,r[s]=null,r[a]=null,t(p(n,!1))):(r[s]=t,r[a]=e)},writable:!0}),e));return r[l]=null,o(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[a];return null!==e&&(r[l]=null,r[s]=null,r[a]=null,e(t)),void(r[u]=t)}var n=r[s];null!==n&&(r[l]=null,r[s]=null,r[a]=null,n(p(void 0,!0))),r[f]=!0})),t.on("readable",g.bind(null,r)),r}},726:(t,e,r)=>{"use strict";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){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}var u=r(287).Buffer,f=r(340).inspect,l=f&&f.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 u.alloc(0);for(var e,r,n,i=u.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=o.data,r=i,n=s,u.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=u.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:l,value:function(t,e){return f(this,i(i({},e),{},{depth:0,customInspect:!1}))}}])&&s(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}()},896:t=>{"use strict";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)}}},238:(t,e,r)=>{"use strict";var n=r(48).F.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,u=function(){e.writable||l()},f=e._writableState&&e._writableState.finished,l=function(){a=!1,f=!0,s||o.call(e)},h=e._readableState&&e._readableState.endEmitted,c=function(){s=!1,h=!0,a||o.call(e)},p=function(t){o.call(e,t)},d=function(){var t;return s&&!h?(e._readableState&&e._readableState.ended||(t=new n),o.call(e,t)):a&&!f?(e._writableState&&e._writableState.ended||(t=new n),o.call(e,t)):void 0},g=function(){e.req.on("finish",l)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",l),e.on("abort",d),e.req?g():e.on("request",g)):a&&!e._writableState&&(e.on("end",u),e.on("close",u)),e.on("end",c),e.on("finish",l),!1!==r.error&&e.on("error",p),e.on("close",d),function(){e.removeListener("complete",l),e.removeListener("abort",d),e.removeListener("request",g),e.req&&e.req.removeListener("finish",l),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",l),e.removeListener("end",c),e.removeListener("error",p),e.removeListener("close",d)}}},157:t=>{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},758:(t,e,r)=>{"use strict";var n,i=r(48).F,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function u(t){t()}function f(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 l,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 c=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(238)),n(t,{readable:e,writable:i},(function(t){if(t)return o(t);a=!0,o()}));var u=!1;return function(e){if(!a&&!u)return u=!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){l||(l=t),t&&c.forEach(u),o||(c.forEach(u),h(l))}))}));return e.reduce(f)}},291:(t,e,r)=>{"use strict";var n=r(48).F.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}}},345:(t,e,r)=>{t.exports=r(7).EventEmitter},861:(t,e,r)=>{var n=r(287),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)}},310:(t,e,r)=>{t.exports=i;var n=r(7).EventEmitter;function i(){n.call(this)}r(698)(i,n),i.Readable=r(412),i.Writable=r(708),i.Duplex=r(382),i.Transform=r(610),i.PassThrough=r(600),i.finished=r(238),i.pipeline=r(758),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",u));var s=!1;function a(){s||(s=!0,t.end())}function u(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function f(t){if(l(),0===n.listenerCount(this,"error"))throw t}function l(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",u),r.removeListener("error",f),t.removeListener("error",f),r.removeListener("end",l),r.removeListener("close",l),t.removeListener("close",l)}return r.on("error",f),t.on("error",f),r.on("end",l),r.on("close",l),t.on("close",l),t.emit("pipe",r),t}},141:(t,e,r)=>{"use strict";var n=r(861).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=u,this.end=f,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=l,this.end=h,e=3;break;default:return this.write=c,void(this.end=p)}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){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 u(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 f(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 l(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 c(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.I=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}},380:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.binary_to_base58=e.base58_to_binary=void 0;const r="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",n=(()=>{const t=Array(256).fill(-1);for(let e=0;e<58;++e)t[r.charCodeAt(e)]=e;return t})();e.base58_to_binary=t=>{if(t.match(/[IOl0]/gmu))throw new Error(`Invalid base58 character “${t.match(/[IOl0]/gmu)}”`);const e=t.match(/^1+/gmu),n=e?e[0].length:0,i=(t.length-n)*(Math.log(58)/Math.log(256))+1>>>0,o=t.match(/./gmu),s=new Uint8Array(n);let a=new Uint8Array;var u;return o&&(a=o.map((t=>r.indexOf(t))).reduce(((t,e)=>t.map((t=>{const r=58*t+e;return e=r>>8,r}))),new Uint8Array(i)).reverse().filter((u=!1,t=>u=u||t))),new Uint8Array([...s,...a])},e.binary_to_base58=t=>{const e=[];for(const i of t){let t=i;for(let i=0;i<e.length;++i){const o=(n[e[i]]<<8)+t;e[i]=r.charCodeAt(o%58),t=o/58|0}for(;t;)e.push(r.charCodeAt(t%58)),t=t/58|0}for(const r of t){if(r)break;e.push("1".charCodeAt(0))}return e.reverse(),String.fromCharCode(...e)},e.default={binary_to_base58:e.binary_to_base58,base58_to_binary:e.base58_to_binary}},702:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CryptoNoteBase58=void 0;const n=r(38),i=r(287),o="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".split("").map((t=>t.charCodeAt(0))),s=[0,2,3,5,6,7,9,10,11],a=11,u=(0,n.BigInteger)(2).pow(64);class f{static cn_decode(t){const e=i.Buffer.from(t).valueOf();if(0===e.length)return i.Buffer.alloc(0);const r=Math.floor(e.length/a),n=e.length%a,o=s.indexOf(n);if(o<0)throw new Error("Invalid encoded length");let u=new Uint8Array(8*r+o);for(let t=0;t<r;t++)u=f.decodeBlock(e.subarray(t*a,t*a+a),u,8*t);return n>0&&(u=f.decodeBlock(e.subarray(r*a,r*a+n),u,8*r)),i.Buffer.from(u)}static cn_encode(t){t instanceof i.Buffer?t=t.toString("hex"):t instanceof Uint8Array&&(t=i.Buffer.from(t).toString("hex"));const e=i.Buffer.from(t,"hex").valueOf();if(0===e.length)return"";const r=Math.floor(e.length/8),n=e.length%8,u=r*a+s[n];let l=new Uint8Array(u);for(let t=0;t<u;++t)l[t]=o[0];for(let t=0;t<r;t++)l=f.encodeBlock(e.subarray(8*t,8*t+8),l,t*a);return n>0&&(l=f.encodeBlock(e.subarray(8*r,8*r+n),l,r*a)),i.Buffer.from(l).toString()}static decodeBlock(t,e,r){if(t.length<1||t.length>a)throw new Error("Invalid block length: "+t.length);const i=s.indexOf(t.length);if(i<=0)throw new Error("Invalid block size");let f=n.BigInteger.zero,l=n.BigInteger.one;for(let e=t.length-1;e>=0;e--){const r=o.indexOf(t[e]);if(r<0)throw new Error("Invalid symbol");const n=l.multiply(r).add(f);if(1===n.compare(u))throw new Error("Overflow");f=n,l=l.multiply(o.length)}if(i<8&&(0,n.BigInteger)(2).pow(8*i).compare(f)<=0)throw new Error("Overflow 2");const h=(new n.Writer).uint64_t(f,!0).buffer.valueOf();return e.set(h,r),e}static encodeBlock(t,e,r){if(t.length<1||t.length>a)throw new Error("Invalid block length: "+t.length);let i=new n.Reader(t).uint64_t(!0),u=s[t.length]-1;for(;1===i.compare(0);){const t=i.divmod(o.length),n=t.remainder;i=t.quotient,e[r+u]=o[n.toJSNumber()],u--}return e}}e.default=f,e.CryptoNoteBase58=f},156:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Buffer=e.Base58=void 0;const i=n(r(702)),o=r(380),s=r(287);Object.defineProperty(e,"Buffer",{enumerable:!0,get:function(){return s.Buffer}});class a extends i.default{static decode(t){return s.Buffer.from((0,o.base58_to_binary)(t))}static encode(t){return t instanceof s.Buffer?t=t.valueOf():"string"==typeof t&&(t=s.Buffer.from(t,"hex").valueOf()),(0,o.binary_to_base58)(t)}}e.default=a,e.Base58=a},643:(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)}}},340:()=>{},838:()=>{}},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].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return 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.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),r(156)})()));
|
|
3
|
+
//# sourceMappingURL=base58.min.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* The buffer module from node.js, for the browser.
|
|
3
|
+
*
|
|
4
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
9
|
+
|
|
10
|
+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|