mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-26 15:41:29 +01:00
23 lines
No EOL
276 KiB
JavaScript
23 lines
No EOL
276 KiB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.URlib=e():t.URlib=e()}(this,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=33)}([function(t,e,r){"use strict";(function(t){
|
||
/*!
|
||
* The buffer module from node.js, for the browser.
|
||
*
|
||
* @author Feross Aboukhadijeh <http://feross.org>
|
||
* @license MIT
|
||
*/
|
||
var n=r(57),i=r(58),o=r(34);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return f(this,t,e,r)}function f(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=h(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(e,r),i=(t=s(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(u.isBuffer(e)){var r=0|d(e.length);return 0===(t=s(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?s(t,0):h(t,e);if("Buffer"===e.type&&o(e.data))return h(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,e){if(c(e),t=s(t,e<0?0:0|d(e)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function h(t,e){var r=e.length<0?0:0|d(e.length);t=s(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function d(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(t).length;default:if(n)return F(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var 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 T(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return R(this,e,r);case"latin1":case"binary":return k(this,e,r);case"base64":return B(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function _(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(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),r=+r,isNaN(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:b(t,e,r,n,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){var o,a=1,s=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;a=2,s/=2,u/=2,r/=2}function f(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var c=-1;for(o=r;o<s;o++)if(f(t,o)===f(e,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){for(var l=!0,h=0;h<u;h++)if(f(t,o+h)!==f(e,h)){l=!1;break}if(l)return o}return-1}function v(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[r+a]=s}return a}function m(t,e,r,n){return z(F(e,t.length-r),t,r,n)}function w(t,e,r,n){return z(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function E(t,e,r,n){return w(t,e,r,n)}function S(t,e,r,n){return z(q(e),t,r,n)}function O(t,e,r,n){return z(function(t,e){for(var r,n,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function B(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,a,s,u,f=t[i],c=null,l=f>239?4:f>223?3:f>191?2:1;if(i+l<=r)switch(l){case 1:f<128&&(c=f);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&f)<<6|63&o)>127&&(c=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&f)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&f)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,l=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=l}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,r){return f(null,t,e,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,r){return function(t,e,r,n){return c(e),e<=0?s(t,e):void 0!==r?"string"==typeof n?s(t,e).fill(r,n):s(t,e).fill(r):s(t,e)}(null,t,e,r)},u.allocUnsafe=function(t){return l(null,t)},u.allocUnsafeSlow=function(t){return l(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,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(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=u.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var a=t[r];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)_(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)_(this,e,e+3),_(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)_(this,e,e+7),_(this,e+1,e+6),_(this,e+2,e+5),_(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?x(this,0,t):g.apply(this,arguments)},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(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,r,n,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");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;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(o,a),f=this.slice(n,i),c=t.slice(e,r),l=0;l<s;++l)if(f[l]!==c[l]){o=f[l],a=c[l];break}return o<a?-1:a<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 y(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return y(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)}var 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");for(var o=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return w(this,t,e,r);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 O(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)}};function R(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function k(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function T(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=N(t[o]);return i}function P(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function I(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(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 D(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function A(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function j(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 M(t,e,r,n,o){return o||j(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function L(t,e,r,n,o){return o||j(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=u.prototype;else{var i=e-t;r=new u(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},u.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||I(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 e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||C(this,t,e,r,Math.pow(2,8*r)-1,0);var 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=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||C(this,t,e,r,Math.pow(2,8*r)-1,0);var 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=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):D(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):D(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):A(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):A(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);C(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o<r&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);C(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),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||C(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):D(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):D(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):A(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):A(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return L(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return L(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){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("sourceStart out of bounds");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);var i,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;i>=0;--i)t[i+e]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},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),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(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)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var a=u.isBuffer(t)?t:F(new u(t,n).toString()),s=a.length;for(o=0;o<r-e;++o)this[o+e]=a[o%s]}return this};var U=/[^+\/0-9A-Za-z-_]/g;function N(t){return t<16?"0"+t.toString(16):t.toString(16)}function F(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+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 q(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(U,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(6))},function(t,e,r){"use strict";var n=r(10);r.d(e,"g",(function(){return n.encodeDataItem})),r.d(e,"f",(function(){return n.decodeToDataItem})),r.d(e,"c",(function(){return n.addSemanticDecode})),r.d(e,"d",(function(){return n.addSemanticEncode})),r.d(e,"b",(function(){return n.addReader})),r.d(e,"e",(function(){return n.addWriter}));var i=r(22);r.d(e,"a",(function(){return i.DataItem}))},function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.d(e,"a",(function(){return i})),r.d(e,"b",(function(){return o}));var i=function t(e,r){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n(this,"getTag",(function(){return i.tag})),n(this,"getType",(function(){return i.type})),this.type=e,this.tag=r},o={UUID:new i("uuid",37),BYTES:new i("bytes",void 0),CRYPTO_HDKEY:new i("crypto-hdkey",303),CRYPTO_KEYPATH:new i("crypto-keypath",304),CRYPTO_COIN_INFO:new i("crypto-coin-info",305),CRYPTO_ECKEY:new i("crypto-eckey",306),CRYPTO_OUTPUT:new i("crypto-output",308),CRYPTO_PSBT:new i("crypto-psbt",310),CRYPTO_ACCOUNT:new i("crypto-account",311)}},function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));var n=r(23),i=r(1);function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a=function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),o(this,"toCBOR",(function(){if(void 0===e.toDataItem())throw new Error("#[ur-registry][RegistryItem][fn.toCBOR]: registry ".concat(e.getRegistryType(),"'s method toDataItem returns undefined"));return Object(i.g)(e.toDataItem())})),o(this,"toUR",(function(){return new n.UR(e.toCBOR(),e.getRegistryType().getType())})),o(this,"toUREncoder",(function(t,r,i){var o=e.toUR();return new n.UREncoder(o,t,r,i)}))}},function(t,e){"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}}},function(t,e,r){
|
||
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||
var n=r(0),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.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},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var u,f=[],c=!1,l=-1;function h(){c&&u&&(c=!1,u.length?f=u.concat(f):l=-1,f.length&&d())}function d(){if(!c){var t=s(h);c=!0;for(var e=f.length;e;){for(u=f,f=[];++l<e;)u&&u[l].run();l=-1,e=f.length}u=null,c=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];f.push(new p(t,e)),1!==f.length||c||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,r){"use strict";r.d(e,"c",(function(){return i})),r.d(e,"b",(function(){return o})),r.d(e,"a",(function(){return _}));var n,i,o,a=r(1),s=r(3),u=r(2);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function l(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return h(this,r)}}function h(t,e){return!e||"object"!==f(e)&&"function"!=typeof e?d(t):e}function d(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function g(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}!function(t){t.type="1",t.network="2"}(n||(n={})),function(t){t[t.bitcoin=0]="bitcoin"}(i||(i={})),function(t){t[t.mainnet=0]="mainnet",t[t.testnet=1]="testnet"}(o||(o={}));var _=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}(r,t);var e=l(r);function r(t,s){var f;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),g(d(f=e.call(this)),"getRegistryType",(function(){return u.b.CRYPTO_COIN_INFO})),g(d(f),"getType",(function(){return f.type||i.bitcoin})),g(d(f),"getNetwork",(function(){return f.network||o.mainnet})),g(d(f),"toDataItem",(function(){var t={};return f.type&&(t[n.type]=f.type),f.network&&(t[n.network]=f.network),new a.a(t)})),f.type=t,f.network=s,f}return r}(s.a);g(_,"fromDataItem",(function(t){var e=t.getData(),r=e[n.type],i=e[n.network];return new _(r,i)})),g(_,"fromCBOR",(function(t){var e=Object(a.f)(t);return _.fromDataItem(e)}))},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return y}));var n,i=r(56),o=r(8),a=r(16),s=r(1),u=r(3),f=r(2);function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=g(t);if(e){var i=g(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d(this,r)}}function d(t,e){return!e||"object"!==c(e)&&"function"!=typeof e?p(t):e}function p(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function g(t){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}!function(t){t[t.is_master=1]="is_master",t[t.is_private=2]="is_private",t[t.key_data=3]="key_data",t[t.chain_code=4]="chain_code",t[t.use_info=5]="use_info",t[t.origin=6]="origin",t[t.children=7]="children",t[t.parent_fingerprint=8]="parent_fingerprint",t[t.name=9]="name",t[t.note=10]="note"}(n||(n={}));var y=function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}(o,e);var r=h(o);function o(e){var a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),_(p(a=r.call(this)),"isECKey",(function(){return!1})),_(p(a),"getKey",(function(){return a.key})),_(p(a),"getChainCode",(function(){return a.chainCode})),_(p(a),"isMaster",(function(){return a.master})),_(p(a),"isPrivateKey",(function(){return!!a.privateKey})),_(p(a),"getUseInfo",(function(){return a.useInfo})),_(p(a),"getOrigin",(function(){return a.origin})),_(p(a),"getChildren",(function(){return a.children})),_(p(a),"getParentFingerprint",(function(){return a.parentFingerprint})),_(p(a),"getName",(function(){return a.name})),_(p(a),"getNote",(function(){return a.note})),_(p(a),"getBip32Key",(function(){var e,r,n,o=t.alloc(4).fill(0);if(a.isMaster())e=t.from("0488ADE4","hex"),r=0,n=0;else{r=a.getOrigin().getComponents().length||a.getOrigin().getDepth();var s=a.getOrigin().getComponents(),u=s[s.length-1];u&&(n=u.isHardened()?u.getIndex()+2147483648:u.getIndex(),a.getParentFingerprint()&&(o=a.getParentFingerprint())),e=a.isPrivateKey()?t.from("0488ADE4","hex"):t.from("0488B21E","hex")}var f=t.alloc(1);f.writeUInt8(r,0);var c=t.alloc(4);c.writeUInt32BE(n,0);var l=a.getChainCode(),h=a.getKey();return Object(i.encode)(t.concat([e,f,o,c,l,h]))})),_(p(a),"getRegistryType",(function(){return f.b.CRYPTO_HDKEY})),_(p(a),"getOutputDescriptorContent",(function(){var t="";return a.getOrigin()&&a.getOrigin().getSourceFingerprint()&&a.getOrigin().getPath()&&(t+="".concat(a.getOrigin().getSourceFingerprint().toString("hex"),"/").concat(a.getOrigin().getPath())),t+=a.getBip32Key(),a.getChildren()&&a.getChildren().getPath()&&(t+="/".concat(a.getChildren().getPath())),t})),_(p(a),"setupMasterKey",(function(t){a.master=!0,a.key=t.key,a.chainCode=t.chainCode})),_(p(a),"setupDeriveKey",(function(t){a.master=!1,a.privateKey=t.isPrivateKey,a.key=t.key,a.chainCode=t.chainCode,a.useInfo=t.useInfo,a.origin=t.origin,a.children=t.children,a.parentFingerprint=t.parentFingerprint,a.name=t.name,a.note=t.note})),_(p(a),"toDataItem",(function(){var t={};if(a.master)t[n.is_master]=!0,t[n.key_data]=a.key,t[n.chain_code]=a.chainCode;else{if(void 0!==a.privateKey&&(t[n.is_private]=a.privateKey),t[n.key_data]=a.key,a.chainCode&&(t[n.chain_code]=a.chainCode),a.useInfo){var e=a.useInfo.toDataItem();e.setTag(a.useInfo.getRegistryType().getTag()),t[n.use_info]=e}if(a.origin){var r=a.origin.toDataItem();r.setTag(a.origin.getRegistryType().getTag()),t[n.origin]=r}if(a.children){var i=a.children.toDataItem();i.setTag(a.children.getRegistryType().getTag()),t[n.children]=i}a.parentFingerprint&&(t[n.parent_fingerprint]=a.parentFingerprint.readUInt32BE(0)),void 0!==a.name&&(t[n.name]=a.name),void 0!==a.note&&(t[n.note]=a.note)}return new s.a(t)})),e.isMaster?a.setupMasterKey(e):a.setupDeriveKey(e),a}return o}(u.a);_(y,"fromDataItem",(function(e){var r,i=e.getData(),s=!!i[n.is_master],u=i[n.is_private],f=i[n.key_data],c=i[n.chain_code],l=i[n.use_info]?o.a.fromDataItem(i[n.use_info]):void 0,h=i[n.origin]?a.a.fromDataItem(i[n.origin]):void 0,d=i[n.children]?a.a.fromDataItem(i[n.children]):void 0,p=i[n.parent_fingerprint];p&&(r=t.alloc(4)).writeUInt32BE(p,0);var g=i[n.name],_=i[n.note];return new y({isMaster:s,isPrivateKey:u,key:f,chainCode:c,useInfo:l,origin:h,children:d,parentFingerprint:r,name:g,note:_})})),_(y,"fromCBOR",(function(t){var e=Object(s.f)(t);return y.fromDataItem(e)}))}).call(this,r(0).Buffer)},function(t,e,r){(function(n){var i,o,a;o=[],void 0===(a="function"==typeof(i=function(){const{DataItem:t}=r(22);var e=function(){function e(t){this.$hex=t}e.prototype={length:function(){return this.$hex.length/2},toString:function(t){if(!t||"hex"===t||16===t)return this.$hex;if("utf-8"===t){for(var e="",r=0;r<this.$hex.length;r+=2)e+="%"+this.$hex.substring(r,r+2);return decodeURIComponent(e)}if("latin"===t){for(e=[],r=0;r<this.$hex.length;r+=2)e.push(parseInt(this.$hex.substring(r,r+2),16));return String.fromCharCode.apply(String,e)}throw new Error("Unrecognised format: "+t)}},e.fromLatinString=function(t){for(var r="",n=0;n<t.length;n++){var i=t.charCodeAt(n).toString(16);1===i.length&&(i="0"+i),r+=i}return new e(r)},e.fromUtf8String=function(t){for(var r=encodeURIComponent(t),n="",i=0;i<r.length;i++)if("%"===r.charAt(i))n+=r.substring(i+1,i+3),i+=2;else{var o=r.charCodeAt(i).toString(16);o.length<2&&(o="0"+o),n+=o}return new e(n)};var r=[],i={},o=function(t){return function(){throw new Error(t+" not implemented")}};function a(){}function s(){}function u(t,e){var r=t.value;return r<24?r:24==r?e.readByte():25==r?e.readUint16():26==r?e.readUint32():27==r?e.readUint64():31==r?null:void o("Additional info: "+r)()}function f(t,e,r){var n=t<<5;e<24?r.writeByte(n|e):e<256?(r.writeByte(24|n),r.writeByte(e)):e<65536?(r.writeByte(25|n),r.writeUint16(e)):e<4294967296?(r.writeByte(26|n),r.writeUint32(e)):(r.writeByte(27|n),r.writeUint64(e))}a.prototype={peekByte:o("peekByte"),readByte:o("readByte"),readChunk:o("readChunk"),readFloat16:function(){var t=this.readUint16(),e=(32767&t)>>10,r=1023&t,n=32768&t;if(31===e)return 0===r?n?-1/0:1/0:NaN;var i=e?Math.pow(2,e-25)*(1024+r):Math.pow(2,-24)*r;return n?-i:i},readFloat32:function(){var t=this.readUint32(),e=(2147483647&t)>>23,r=8388607&t,n=2147483648&t;if(255===e)return 0===r?n?-1/0:1/0:NaN;var i=e?Math.pow(2,e-23-127)*(8388608+r):Math.pow(2,-149)*r;return n?-i:i},readFloat64:function(){var t=this.readUint32(),e=t>>20&2047,r=4294967296*(1048575&t)+this.readUint32(),n=2147483648&t;if(2047===e)return 0===r?n?-1/0:1/0:NaN;var i=e?Math.pow(2,e-52-1023)*(4503599627370496+r):Math.pow(2,-1074)*r;return n?-i:i},readUint16:function(){return 256*this.readByte()+this.readByte()},readUint32:function(){return 65536*this.readUint16()+this.readUint16()},readUint64:function(){return 4294967296*this.readUint32()+this.readUint32()}},s.prototype={writeByte:o("writeByte"),result:o("result"),writeFloat16:o("writeFloat16"),writeFloat32:o("writeFloat32"),writeFloat64:o("writeFloat64"),writeUint16:function(t){this.writeByte(t>>8&255),this.writeByte(255&t)},writeUint32:function(t){this.writeUint16(t>>16&65535),this.writeUint16(65535&t)},writeUint64:function(t){if(t>=9007199254740992||t<=-9007199254740992)throw new Error("Cannot encode Uint64 of: "+t+" magnitude to big (floating point errors)");this.writeUint32(Math.floor(t/4294967296)),this.writeUint32(t%4294967296)},writeString:o("writeString"),canWriteBinary:function(t){return!1},writeBinary:o("writeChunk")};var c=new Error;function l(t){var e=function(t){var e=t.readByte();return{type:e>>5,value:31&e}}(t);switch(e.type){case 0:return u(e,t);case 1:return-1-u(e,t);case 2:return t.readChunk(u(e,t));case 3:return t.readChunk(u(e,t)).toString("utf-8");case 4:case 5:var r=u(e,t),n=[];if(null!==r){5===e.type&&(r*=2);for(var o=0;o<r;o++)n[o]=l(t)}else for(var a;(a=l(t))!==c;)n.push(a);if(5===e.type){var s={};for(o=0;o<n.length;o+=2)s[n[o]]=n[o+1];return s}return n;case 6:var f=u(e,t),h=i[f];return n=l(t),h?h(n):n;case 7:if(25===e.value)return t.readFloat16();if(26===e.value)return t.readFloat32();if(27===e.value)return t.readFloat64();switch(u(e,t)){case 20:return!1;case 21:return!0;case 22:return null;case 23:return;case null:return c;default:throw new Error("Unknown fixed value: "+e.value)}default:throw new Error("Unsupported header: "+JSON.stringify(e))}throw new Error("not implemented yet")}function h(t,e){for(var n=0;n<r.length;n++){var i=r[n].fn(t);if(void 0!==i)return f(6,r[n].tag,e),h(i,e)}if(t&&"function"==typeof t.toCBOR&&(t=t.toCBOR()),!1===t)f(7,20,e);else if(!0===t)f(7,21,e);else if(null===t)f(7,22,e);else if(void 0===t)f(7,23,e);else if("number"==typeof t)Math.floor(t)===t&&t<9007199254740992&&t>-9007199254740992?t<0?f(1,-1-t,e):f(0,t,e):(function(t,e,r){r.writeByte(t<<5|e)}(7,27,e),e.writeFloat64(t));else if("string"==typeof t)e.writeString(t,(function(t){f(3,t,e)}));else if(e.canWriteBinary(t))e.writeBinary(t,(function(t){f(2,t,e)}));else{if("object"!=typeof t)throw new Error("CBOR encoding not supported: "+t);if(g.config.useToJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),Array.isArray(t))for(f(4,t.length,e),n=0;n<t.length;n++)h(t[n],e);else{var o=Object.keys(t);for(f(5,o.length,e),n=0;n<o.length;n++){const r=parseInt(o[n]);isNaN(r)?(h(o[n],e),h(t[o[n]],e)):(h(r,e),h(t[o[n]],e))}}}}var d=[],p=[],g={config:{useToJSON:!0},addWriter:function(t,e){"string"==typeof t?p.push((function(r){if(t===r)return e(r)})):p.push(t)},addReader:function(t,e){"string"==typeof t?d.push((function(r,n){if(t===n)return e(r,n)})):d.push(t)},encode:function(t,e){for(var r=0;r<p.length;r++){var n=(0,p[r])(e);if(n)return h(t,n),n.result()}throw new Error("Unsupported output format: "+e)},encodeDataItem:function(t,e){for(var r=0;r<p.length;r++){var n=(0,p[r])(e);if(n)return void 0!==t.getTag()?(h(t,n),n.result()):(h(t.getData(),n),n.result())}throw new Error("Unsupported output format: "+e)},decode:function(t,e){for(var r=0;r<d.length;r++){var n=(0,d[r])(t,e);if(n)return l(n)}throw new Error("Unsupported input format: "+e)},decodeToDataItem:function(e,r){for(var n=0;n<d.length;n++){var i=(0,d[n])(e,r);if(i){const e=l(i);return e instanceof t?e:new t(e)}}throw new Error("Unsupported input format: "+r)},addSemanticEncode:function(t,e){if("number"!=typeof t||t%1!=0||t<0)throw new Error("Tag must be a positive integer");return r.push({tag:t,fn:e}),this},addSemanticDecode:function(t,e){if("number"!=typeof t||t%1!=0||t<0)throw new Error("Tag must be a positive integer");return i[t]=e,this},Reader:a,Writer:s};function _(t){this.buffer=t,this.pos=0}function y(t){this.byteLength=0,this.defaultBufferLength=16384,this.latestBuffer=n.alloc(this.defaultBufferLength),this.latestBufferOffset=0,this.completeBuffers=[],this.stringFormat=t}function b(t){this.hex=t,this.pos=0}function v(t){this.$hex="",this.finalFormat=t||"hex"}return _.prototype=Object.create(a.prototype),_.prototype.peekByte=function(){return this.buffer[this.pos]},_.prototype.readByte=function(){return this.buffer[this.pos++]},_.prototype.readUint16=function(){var t=this.buffer.readUInt16BE(this.pos);return this.pos+=2,t},_.prototype.readUint32=function(){var t=this.buffer.readUInt32BE(this.pos);return this.pos+=4,t},_.prototype.readFloat32=function(){var t=this.buffer.readFloatBE(this.pos);return this.pos+=4,t},_.prototype.readFloat64=function(){var t=this.buffer.readDoubleBE(this.pos);return this.pos+=8,t},_.prototype.readChunk=function(t){var e=n.alloc(t);return this.buffer.copy(e,0,this.pos,this.pos+=t),e},y.prototype=Object.create(s.prototype),y.prototype.writeByte=function(t){this.latestBuffer[this.latestBufferOffset++]=t,this.latestBufferOffset>=this.latestBuffer.length&&(this.completeBuffers.push(this.latestBuffer),this.latestBuffer=n.alloc(this.defaultBufferLength),this.latestBufferOffset=0),this.byteLength++},y.prototype.writeFloat32=function(t){var e=n.alloc(4);e.writeFloatBE(t,0),this.writeBuffer(e)},y.prototype.writeFloat64=function(t){var e=n.alloc(8);e.writeDoubleBE(t,0),this.writeBuffer(e)},y.prototype.writeString=function(t,e){var r=n.from(t,"utf-8");e(r.length),this.writeBuffer(r)},y.prototype.canWriteBinary=function(t){return t instanceof n},y.prototype.writeBinary=function(t,e){e(t.length),this.writeBuffer(t)},y.prototype.writeBuffer=function(t){if(!(t instanceof n))throw new TypeError("BufferWriter only accepts Buffers");this.latestBufferOffset?this.latestBuffer.length-this.latestBufferOffset>=t.length?(t.copy(this.latestBuffer,this.latestBufferOffset),this.latestBufferOffset+=t.length,this.latestBufferOffset>=this.latestBuffer.length&&(this.completeBuffers.push(this.latestBuffer),this.latestBuffer=n.alloc(this.defaultBufferLength),this.latestBufferOffset=0)):(this.completeBuffers.push(this.latestBuffer.slice(0,this.latestBufferOffset)),this.completeBuffers.push(t),this.latestBuffer=n.alloc(this.defaultBufferLength),this.latestBufferOffset=0):this.completeBuffers.push(t),this.byteLength+=t.length},y.prototype.result=function(){for(var t=n.alloc(this.byteLength),e=0,r=0;r<this.completeBuffers.length;r++){var i=this.completeBuffers[r];i.copy(t,e,0,i.length),e+=i.length}return this.latestBufferOffset&&this.latestBuffer.copy(t,e,0,this.latestBufferOffset),this.stringFormat?t.toString(this.stringFormat):t},"function"==typeof n&&(g.addReader((function(t,e){return t instanceof n?new _(t):"hex"===e||"base64"===e?new _(n.from(t,e)):void 0})),g.addWriter((function(t){return t&&"buffer"!==t?"hex"===t||"base64"===t?new y(t):void 0:new y}))),b.prototype=Object.create(a.prototype),b.prototype.peekByte=function(){var t=this.hex.substring(this.pos,2);return parseInt(t,16)},b.prototype.readByte=function(){var t=this.hex.substring(this.pos,this.pos+2);return this.pos+=2,parseInt(t,16)},b.prototype.readChunk=function(t){var r=this.hex.substring(this.pos,this.pos+2*t);return this.pos+=2*t,"function"==typeof n?n.from(r,"hex"):new e(r)},v.prototype=Object.create(s.prototype),v.prototype.writeByte=function(t){if(t<0||t>255)throw new Error("Byte value out of range: "+t);var e=t.toString(16);1==e.length&&(e="0"+e),this.$hex+=e},v.prototype.canWriteBinary=function(t){return t instanceof e||"function"==typeof n&&t instanceof n},v.prototype.writeBinary=function(t,r){if(t instanceof e)r(t.length()),this.$hex+=t.$hex;else{if(!("function"==typeof n&&t instanceof n))throw new TypeError("HexWriter only accepts BinaryHex or Buffers");r(t.length),this.$hex+=t.toString("hex")}},v.prototype.result=function(){return"buffer"===this.finalFormat&&"function"==typeof n?n.from(this.$hex,"hex"):new e(this.$hex).toString(this.finalFormat)},v.prototype.writeString=function(t,r){var n=e.fromUtf8String(t);r(n.length()),this.$hex+=n.$hex},g.addReader((function(t,r){return t instanceof e||t.$hex?new b(t.$hex):"hex"===r?new b(t):void 0})),g.addWriter((function(t){if("hex"===t)return new v})),g}();return e.addSemanticEncode(0,(function(t){if(t instanceof Date)return t.toISOString()})).addSemanticDecode(0,(function(t){return new Date(t)})).addSemanticDecode(1,(function(t){return new Date(t)})),e})?i.apply(e,o):i)||(t.exports=a)}).call(this,r(0).Buffer)},function(t,e,r){"use strict";var n=r(25),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=l;var o=Object.create(r(20));o.inherits=r(21);var a=r(47),s=r(30);o.inherits(l,a);for(var u=i(s.prototype),f=0;f<u.length;f++){var c=u[f];l.prototype[c]||(l.prototype[c]=s.prototype[c])}function l(t){if(!(this instanceof l))return new l(t);a.call(this,t),s.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||n.nextTick(d,this)}function d(t){t.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"destroyed",{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)}}),l.prototype._destroy=function(t,e){this.push(null),this.end(),n.nextTick(e,t)}},function(t,e,r){"use strict";(function(t){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.bufferXOR=e.setDifference=e.arrayContains=e.arraysEqual=e.hasPrefix=e.isURType=e.intToBytes=e.toUint32=e.getCRCHex=e.getCRC=e.split=e.partition=e.sha256Hash=void 0;const i=n(r(44)),o=r(101);e.sha256Hash=t=>i.default("sha256").update(t).digest();e.partition=(t,e)=>t.match(new RegExp(".{1,"+e+"}","g"))||[t];e.split=(t,e)=>[t.slice(0,-e),t.slice(-e)];e.getCRC=t=>o.crc32(t);e.getCRCHex=t=>o.crc32(t).toString(16).padStart(8,"0");e.toUint32=t=>t>>>0;e.intToBytes=e=>{const r=new ArrayBuffer(4);return new DataView(r).setUint32(0,e,!1),t.from(r)};e.isURType=t=>t.split("").every((e,r)=>{let n=t.charCodeAt(r);return"a".charCodeAt(0)<=n&&n<="z".charCodeAt(0)||("0".charCodeAt(0)<=n&&n<="9".charCodeAt(0)||n==="-".charCodeAt(0))});e.hasPrefix=(t,e)=>0===t.indexOf(e);e.arraysEqual=(t,e)=>t.length===e.length&&t.every(t=>e.includes(t));e.arrayContains=(t,e)=>e.every(e=>t.includes(e));e.setDifference=(t,e)=>t.filter(t=>e.indexOf(t)<0);e.bufferXOR=(e,r)=>{const n=Math.max(e.length,r.length),i=t.allocUnsafe(n);for(let t=0;t<n;++t)i[t]=e[t]^r[t];return i}}).call(this,r(0).Buffer)},function(t,e,r){"use strict";var n={};function i(t,e,r){r||(r=Error);var i=function(t){var r,n;function i(r,n,i){return t.call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,n,i))||this}return n=t,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=t,n[t]=i}function o(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))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,i,a,s;if("string"==typeof e&&(i="not ",e.substr(!a||a<0?0:+a,i.length)===i)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(n," ").concat(o(e,"type"));else{var u=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(u," ").concat(n," ").concat(o(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},function(t,e,r){"use strict";(function(e){var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=f;var i=r(36),o=r(41);r(4)(f,i);for(var a=n(o.prototype),s=0;s<a.length;s++){var u=a[s];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",c)))}function c(){this._writableState.ended||e.nextTick(l,this)}function l(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)}})}).call(this,r(7))},function(t,e,r){var n=r(5).Buffer;function i(t,e){this._block=n.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}i.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=n.from(t,e));for(var r=this._block,i=this._blockSize,o=t.length,a=this._len,s=0;s<o;){for(var u=a%i,f=Math.min(o-s,i-u),c=0;c<f;c++)r[u+c]=t[s+c];s+=f,(a+=f)%i==0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return _}));var n,i=r(1),o=r(17),a=r(3),s=r(2);function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function l(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p(t);if(e){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return h(this,r)}}function h(t,e){return!e||"object"!==u(e)&&"function"!=typeof e?d(t):e}function d(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function g(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}!function(t){t[t.components=1]="components",t[t.source_fingerprint=2]="source_fingerprint",t[t.depth=3]="depth"}(n||(n={}));var _=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}(r,t);var e=l(r);function r(){var t,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],a=arguments.length>1?arguments[1]:void 0,u=arguments.length>2?arguments[2]:void 0;return f(this,r),g(d(t=e.call(this)),"getRegistryType",(function(){return s.b.CRYPTO_KEYPATH})),g(d(t),"getPath",(function(){if(0!==t.components.length)return t.components.map((function(t){return"".concat(t.isWildcard()?"*":t.getIndex()).concat(t.isHardened()?"'":"")})).join("/")})),g(d(t),"getComponents",(function(){return t.components})),g(d(t),"getSourceFingerprint",(function(){return t.sourceFingerprint})),g(d(t),"getDepth",(function(){return t.depth})),g(d(t),"toDataItem",(function(){var e={},r=[];return t.components&&t.components.forEach((function(t){t.isWildcard()?r.push([]):r.push(t.getIndex()),r.push(!!t.isHardened())})),e[n.components]=r,t.sourceFingerprint&&(e[n.source_fingerprint]=t.sourceFingerprint.readUInt32BE(0)),void 0!==t.depth&&(e[n.depth]=t.depth),new i.a(e)})),t.components=o,t.sourceFingerprint=a,t.depth=u,t}return r}(a.a);g(_,"fromDataItem",(function(e){var r=e.getData(),i=[],a=r[n.components];if(a)for(var s=0;s<a.length;s+=2){var u=a[s+1],f=a[s];"number"==typeof f?i.push(new o.a({index:f,hardened:u})):i.push(new o.a({hardened:u}))}var c,l=r[n.source_fingerprint];l&&(c=t.alloc(4)).writeUInt32BE(l,0);var h=r[n.depth];return new _(i,c,h)})),g(_,"fromCBOR",(function(t){var e=Object(i.f)(t);return _.fromDataItem(e)}))}).call(this,r(0).Buffer)},function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.d(e,"a",(function(){return i}));var i=function t(e){var r=this;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n(this,"getIndex",(function(){return r.index})),n(this,"isWildcard",(function(){return r.wildcard})),n(this,"isHardened",(function(){return r.hardened})),this.index=e.index,this.hardened=e.hardened,void 0!==this.index?this.wildcard=!1:this.wildcard=!0,this.index&&0!=(this.index&t.HARDENED_BIT))throw new Error("#[ur-registry][PathComponent][fn.constructor]: Invalid index ".concat(this.index," - most significant bit cannot be set"))};n(i,"HARDENED_BIT",2147483648)},function(t,e,r){"use strict";(function(e){var r,n="object"==typeof Reflect?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};r=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}t.exports=a,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))}_(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&_(t,"error",e,r)}(t,i,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function u(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function f(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function c(t,r,n,i){var o,a,s,c;if(u(n),void 0===(a=t._events)?(a=t._events=Object.create(null),t._eventsCount=0):(void 0!==a.newListener&&(t.emit("newListener",r,n.listener?n.listener:n),a=t._events),s=a[r]),void 0===s)s=a[r]=n,++t._eventsCount;else if("function"==typeof s?s=a[r]=i?[n,s]:[s,n]:i?s.unshift(n):s.push(n),(o=f(t))>0&&s.length>o&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(r)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=r,l.count=s.length,c=l,e&&e.warn&&e.warn(c)}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 d(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):g(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 g(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function _(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(a,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");s=t}}),a.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},a.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(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},a.prototype.getMaxListeners=function(){return f(this)},a.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,o=this._events;if(void 0!==o)n=n&&void 0===o.error;else if(!n)return!1;if(n){var a;if(e.length>0&&(a=e[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)i(u,this,e);else{var f=u.length,c=g(u,f);for(r=0;r<f;++r)i(c[r],this,e)}return!0},a.prototype.addListener=function(t,e){return c(this,t,e,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(t,e){return c(this,t,e,!0)},a.prototype.once=function(t,e){return u(e),this.on(t,h(this,t,e)),this},a.prototype.prependOnceListener=function(t,e){return u(e),this.prependListener(t,h(this,t,e)),this},a.prototype.removeListener=function(t,e){var r,n,i,o,a;if(u(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){a=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,a||e)}return this},a.prototype.off=a.prototype.removeListener,a.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},a.prototype.listeners=function(t){return d(this,t,!0)},a.prototype.rawListeners=function(t){return d(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}}).call(this,r(26))},function(t,e,r){"use strict";var n=r(5).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=s,e=4;break;case"base64":this.text=c,this.end=l,e=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"<22>";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"<22>";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"<22>"}}(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 c(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 l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.StringDecoder=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+"<22>":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=a(e[n]);if(i>=0)return i>0&&(t.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=a(e[n]))>=0)return i>0&&(t.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=a(e[n]))>=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 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}},function(t,e,r){(function(t){function r(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===r(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===r(t)},e.isObject=function(t){return"object"==typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===r(t)},e.isError=function(t){return"[object Error]"===r(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=t.isBuffer}).call(this,r(0).Buffer)},function(t,e){"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}}},function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.r(e),r.d(e,"DataItem",(function(){return i}));var i=function t(e,r){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n(this,"setTag",(function(t){i.tag=t})),n(this,"clearTag",(function(){i.tag=void 0})),n(this,"getTag",(function(){return i.tag})),n(this,"getData",(function(){return i.data})),this.data=e,this.tag=r}},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.URDecoder=e.UREncoder=e.UR=void 0;const i=n(r(51));e.UR=i.default;const o=n(r(94));e.UREncoder=o.default;const a=n(r(99));e.URDecoder=a.default},function(t,e,r){"use strict";(function(e){var n=r(64);
|
||
/*!
|
||
* The buffer module from node.js, for the browser.
|
||
*
|
||
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
||
* @license MIT
|
||
*/function i(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,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}function o(t){return e.Buffer&&"function"==typeof e.Buffer.isBuffer?e.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}var a=r(37),s=Object.prototype.hasOwnProperty,u=Array.prototype.slice,f="foo"===function(){}.name;function c(t){return Object.prototype.toString.call(t)}function l(t){return!o(t)&&("function"==typeof e.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}var h=t.exports=b,d=/\s*function\s+([^\(\s]*)\s*/;function p(t){if(a.isFunction(t)){if(f)return t.name;var e=t.toString().match(d);return e&&e[1]}}function g(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function _(t){if(f||!a.isFunction(t))return a.inspect(t);var e=p(t);return"[Function"+(e?": "+e:"")+"]"}function y(t,e,r,n,i){throw new h.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:i})}function b(t,e){t||y(t,!0,e,"==",h.ok)}function v(t,e,r,n){if(t===e)return!0;if(o(t)&&o(e))return 0===i(t,e);if(a.isDate(t)&&a.isDate(e))return t.getTime()===e.getTime();if(a.isRegExp(t)&&a.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"==typeof t||null!==e&&"object"==typeof e){if(l(t)&&l(e)&&c(t)===c(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===i(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(o(t)!==o(e))return!1;var s=(n=n||{actual:[],expected:[]}).actual.indexOf(t);return-1!==s&&s===n.expected.indexOf(e)||(n.actual.push(t),n.expected.push(e),function(t,e,r,n){if(null==t||null==e)return!1;if(a.isPrimitive(t)||a.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=m(t),o=m(e);if(i&&!o||!i&&o)return!1;if(i)return t=u.call(t),e=u.call(e),v(t,e,r);var s,f,c=S(t),l=S(e);if(c.length!==l.length)return!1;for(c.sort(),l.sort(),f=c.length-1;f>=0;f--)if(c[f]!==l[f])return!1;for(f=c.length-1;f>=0;f--)if(s=c[f],!v(t[s],e[s],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function m(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function w(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function E(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&y(i,r,"Missing expected exception"+n);var o="string"==typeof n,s=!t&&i&&!r;if((!t&&a.isError(i)&&o&&w(i,r)||s)&&y(i,r,"Got unwanted exception"+n),t&&i&&r&&!w(i,r)||!t&&i)throw i}h.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return g(_(t.actual),128)+" "+t.operator+" "+g(_(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||y;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=p(e),o=n.indexOf("\n"+i);if(o>=0){var a=n.indexOf("\n",o+1);n=n.substring(a+1)}this.stack=n}}},a.inherits(h.AssertionError,Error),h.fail=y,h.ok=b,h.equal=function(t,e,r){t!=e&&y(t,e,r,"==",h.equal)},h.notEqual=function(t,e,r){t==e&&y(t,e,r,"!=",h.notEqual)},h.deepEqual=function(t,e,r){v(t,e,!1)||y(t,e,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(t,e,r){v(t,e,!0)||y(t,e,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(t,e,r){v(t,e,!1)&&y(t,e,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function t(e,r,n){v(e,r,!0)&&y(e,r,n,"notDeepStrictEqual",t)},h.strictEqual=function(t,e,r){t!==e&&y(t,e,r,"===",h.strictEqual)},h.notStrictEqual=function(t,e,r){t===e&&y(t,e,r,"!==",h.notStrictEqual)},h.throws=function(t,e,r){E(!0,t,e,r)},h.doesNotThrow=function(t,e,r){E(!1,t,e,r)},h.ifError=function(t){if(t)throw t},h.strict=n((function t(e,r){e||y(e,!0,r,"==",t)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var S=Object.keys||function(t){var e=[];for(var r in t)s.call(t,r)&&e.push(r);return e}}).call(this,r(6))},function(t,e,r){"use strict";(function(e){void 0===e||!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,r,n,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick((function(){t.call(null,r)}));case 3:return e.nextTick((function(){t.call(null,r,n)}));case 4:return e.nextTick((function(){t.call(null,r,n,i)}));default:for(o=new Array(s-1),a=0;a<o.length;)o[a++]=arguments[a];return e.nextTick((function(){t.apply(null,o)}))}}}:t.exports=e}).call(this,r(7))},function(t,e,r){(function(e){var n=r(37),i=r(24);function o(){return(new Date).getTime()}var a,s=Array.prototype.slice,u={};a=void 0!==e&&e.console?e.console:"undefined"!=typeof window&&window.console?window.console:{};for(var f=[[function(){},"log"],[function(){a.log.apply(a,arguments)},"info"],[function(){a.log.apply(a,arguments)},"warn"],[function(){a.warn.apply(a,arguments)},"error"],[function(t){u[t]=o()},"time"],[function(t){var e=u[t];if(!e)throw new Error("No such label: "+t);delete u[t];var r=o()-e;a.log(t+": "+r+"ms")},"timeEnd"],[function(){var t=new Error;t.name="Trace",t.message=n.format.apply(null,arguments),a.error(t.stack)},"trace"],[function(t){a.log(n.inspect(t)+"\n")},"dir"],[function(t){if(!t){var e=s.call(arguments,1);i.ok(!1,n.format.apply(null,e))}},"assert"]],c=0;c<f.length;c++){var l=f[c],h=l[0],d=l[1];a[d]||(a[d]=h)}t.exports=a}).call(this,r(6))},function(t,e,r){"use strict";var n=r(13).codes.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 a=r.readable||!1!==r.readable&&e.readable,s=r.writable||!1!==r.writable&&e.writable,u=function(){e.writable||c()},f=e._writableState&&e._writableState.finished,c=function(){s=!1,f=!0,a||o.call(e)},l=e._readableState&&e._readableState.endEmitted,h=function(){a=!1,l=!0,s||o.call(e)},d=function(t){o.call(e,t)},p=function(){var t;return a&&!l?(e._readableState&&e._readableState.ended||(t=new n),o.call(e,t)):s&&!f?(e._writableState&&e._writableState.ended||(t=new n),o.call(e,t)):void 0},g=function(){e.req.on("finish",c)};return!function(t){return t.setHeader&&"function"==typeof t.abort}(e)?s&&!e._writableState&&(e.on("end",u),e.on("close",u)):(e.on("complete",c),e.on("abort",p),e.req?g():e.on("request",g)),e.on("end",h),e.on("finish",c),!1!==r.error&&e.on("error",d),e.on("close",p),function(){e.removeListener("complete",c),e.removeListener("abort",p),e.removeListener("request",g),e.req&&e.req.removeListener("finish",c),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("end",h),e.removeListener("error",d),e.removeListener("close",p)}}},function(t,e,r){(e=t.exports=r(47)).Stream=e,e.Readable=e,e.Writable=r(30),e.Duplex=r(11),e.Transform=r(50),e.PassThrough=r(85)},function(t,e,r){var n=r(0),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.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},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},function(t,e,r){"use strict";(function(e,n,i){var o=r(25);function a(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=b;var s,u=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?n:o.nextTick;b.WritableState=y;var f=Object.create(r(20));f.inherits=r(21);var c={deprecate:r(42)},l=r(48),h=r(29).Buffer,d=i.Uint8Array||function(){};var p,g=r(49);function _(){}function y(t,e){s=s||r(11),t=t||{};var n=e instanceof s;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,f=t.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(f||0===f)?f:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===t.decodeStrings;this.decodeStrings=!l,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(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?(o.nextTick(i,n),o.nextTick(O,t,e),t._writableState.errorEmitted=!0,t.emit("error",n)):(i(n),t._writableState.errorEmitted=!0,t.emit("error",n),O(t,e))}(t,r,n,e,i);else{var a=E(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||w(t,r),n?u(m,t,r,a,i):m(t,r,a,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.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function b(t){if(s=s||r(11),!(p.call(b,this)||this instanceof s))return new b(t);this._writableState=new y(t,this),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)),l.call(this)}function v(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function m(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),O(t,e)}function w(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,v(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new a(e),e.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,c=r.encoding,l=r.callback;if(v(t,e,!1,e.objectMode?1:f.length,f,c,l),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function E(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function S(t,e){t._final((function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),O(t,e)}))}function O(t,e){var r=E(e);return r&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(S,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}f.inherits(b,l),y.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(y.prototype,"buffer",{get:c.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]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(t){return!!p.call(this,t)||this===b&&(t&&t._writableState instanceof y)}})):p=function(t){return t instanceof this},b.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},b.prototype.write=function(t,e,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=t,h.isBuffer(n)||n instanceof d);return s&&!h.isBuffer(t)&&(t=function(t){return h.from(t)}(t)),"function"==typeof e&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=_),i.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),o.nextTick(e,r)}(this,r):(s||function(t,e,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(t.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,t,r))&&(i.pendingcb++,a=function(t,e,r,n,i,o){if(!r){var a=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=h.from(e,r));return e}(e,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=e.objectMode?1:n.length;e.length+=s;var u=e.length<e.highWaterMark;u||(e.needDrain=!0);if(e.writing||e.corked){var f=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},f?f.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else v(t,e,!1,s,n,i,o);return u}(this,i,s,t,e,r)),a},b.prototype.cork=function(){this._writableState.corked++},b.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||w(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 TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(t,e,r){var n=this._writableState;"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||n.finished||function(t,e,r){e.ending=!0,O(t,e),r&&(e.finished?o.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),b.prototype.destroy=g.destroy,b.prototype._undestroy=g.undestroy,b.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,r(7),r(83).setImmediate,r(6))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidChecksumError=e.InvalidSequenceComponentError=e.InvalidTypeError=e.InvalidPathLengthError=e.InvalidSchemeError=void 0;class n extends Error{constructor(){super("Invalid Scheme"),this.name="InvalidSchemeError"}}e.InvalidSchemeError=n;class i extends Error{constructor(){super("Invalid Path"),this.name="InvalidPathLengthError"}}e.InvalidPathLengthError=i;class o extends Error{constructor(){super("Invalid Type"),this.name="InvalidTypeError"}}e.InvalidTypeError=o;class a extends Error{constructor(){super("Invalid Sequence Component"),this.name="InvalidSequenceComponentError"}}e.InvalidSequenceComponentError=a;class s extends Error{constructor(){super("Invalid Checksum"),this.name="InvalidChecksumError"}}e.InvalidChecksumError=s},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return g}));var n,i=r(33),o=r(1),a=r(3),s=r(2);function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t,e){return(f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=d(t);if(e){var i=d(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return l(this,r)}}function l(t,e){return!e||"object"!==u(e)&&"function"!=typeof e?h(t):e}function h(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function p(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}!function(t){t[t.masterFingerprint=1]="masterFingerprint",t[t.outputDescriptors=2]="outputDescriptors"}(n||(n={}));var g=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&f(t,e)}(r,t);var e=c(r);function r(t,i){var a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),p(h(a=e.call(this)),"getRegistryType",(function(){return s.b.CRYPTO_ACCOUNT})),p(h(a),"getMasterFingerprint",(function(){return a.masterFingerprint})),p(h(a),"getOutputDescriptors",(function(){return a.outputDescriptors})),p(h(a),"toDataItem",(function(){var t={};return a.masterFingerprint&&(t[n.masterFingerprint]=a.masterFingerprint.readUInt32BE(0)),a.outputDescriptors&&(t[n.outputDescriptors]=a.outputDescriptors.map((function(t){return t.toDataItem()}))),new o.a(t)})),a.masterFingerprint=t,a.outputDescriptors=i,a}return r}(a.a);p(g,"fromDataItem",(function(e){var r=e.getData(),o=t.alloc(4),a=r[n.masterFingerprint];a&&o.writeUInt32BE(a,0);var s=r[n.outputDescriptors].map((function(t){return i.CryptoOutput.fromDataItem(t)}));return new g(o,s)})),p(g,"fromCBOR",(function(t){var e=Object(o.f)(t);return g.fromDataItem(e)}))}).call(this,r(0).Buffer)},function(t,e,r){"use strict";r.r(e),r.d(e,"DataItem",(function(){return n.a})),r.d(e,"URRegistryDecoder",(function(){return _t})),r.d(e,"Bytes",(function(){return C})),r.d(e,"CryptoAccount",(function(){return st.a})),r.d(e,"CryptoHDKey",(function(){return d.a})),r.d(e,"CryptoKeypath",(function(){return p.a})),r.d(e,"CryptoCoinInfo",(function(){return g.a})),r.d(e,"CryptoCoinInfoType",(function(){return g.c})),r.d(e,"CryptoCoinInfoNetwork",(function(){return g.b})),r.d(e,"CryptoECKey",(function(){return O})),r.d(e,"CryptoOutput",(function(){return Q})),r.d(e,"CryptoPSBT",(function(){return at})),r.d(e,"MultiKey",(function(){return z})),r.d(e,"ScriptExpressions",(function(){return f})),r.d(e,"PathComponent",(function(){return yt.a})),r.d(e,"extend",(function(){return mt}));var n=r(1),i=[],o=function(t){t.forEach((function(t){i.find((function(e){return e===t}))||(Object(n.d)(t,(function(e){if(e instanceof n.a&&e.getTag()===t)return e.getData()})),Object(n.c)(t,(function(e){return new n.a(e,t)})),i.push(t))}))},a=r(2);function s(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var u=function t(e,r){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),s(this,"getTag",(function(){return n.tag})),s(this,"getExpression",(function(){return n.expression})),this.tag=e,this.expression=r};s(u,"fromTag",(function(t){return Object.values(f).find((function(e){return e.getTag()===t}))}));var f={SCRIPT_HASH:new u(400,"sh"),WITNESS_SCRIPT_HASH:new u(401,"wsh"),PUBLIC_KEY:new u(402,"pk"),PUBLIC_KEY_HASH:new u(403,"pkh"),WITNESS_PUBLIC_KEY_HASH:new u(404,"wpkh"),COMBO:new u(405,"combo"),MULTISIG:new u(406,"multi"),SORTED_MULTISIG:new u(407,"sortedmulti"),ADDRESS:new u(307,"addr"),RAW_SCRIPT:new u(408,"raw")},c=Object.values(a.b).filter((function(t){return!!t.getTag()})).map((function(t){return t.getTag()})),l=Object.values(f).map((function(t){return t.getTag()}));o(c.concat(l));var h,d=r(9),p=r(16),g=r(8),_=r(3);function y(t){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function b(t,e){return(b=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function v(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=E(t);if(e){var i=E(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}function m(t,e){return!e||"object"!==y(e)&&"function"!=typeof e?w(t):e}function w(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function E(t){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function S(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}!function(t){t[t.curve=1]="curve",t[t.private=2]="private",t[t.data=3]="data"}(h||(h={}));var O=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&b(t,e)}(r,t);var e=v(r);function r(t){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),S(w(i=e.call(this)),"isECKey",(function(){return!0})),S(w(i),"getCurve",(function(){return i.curve||0})),S(w(i),"isPrivateKey",(function(){return i.privateKey||!1})),S(w(i),"getData",(function(){return i.data})),S(w(i),"getRegistryType",(function(){return a.b.CRYPTO_ECKEY})),S(w(i),"toDataItem",(function(){var t={};return i.curve&&(t[h.curve]=i.curve),void 0!==i.privateKey&&(t[h.private]=i.privateKey),t[h.data]=i.data,new n.a(t)})),S(w(i),"getOutputDescriptorContent",(function(){return i.data.toString("hex")})),i.data=t.data,i.curve=t.curve,i.privateKey=t.privateKey,i}return r}(_.a);function B(t){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function x(t,e){return(x=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function R(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=P(t);if(e){var i=P(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return k(this,r)}}function k(t,e){return!e||"object"!==B(e)&&"function"!=typeof e?T(t):e}function T(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function P(t){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function I(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}S(O,"fromDataItem",(function(t){var e=t.getData(),r=e[h.curve],n=e[h.private],i=e[h.data];if(!i)throw new Error("#[ur-registry][CryptoECKey][fn.fromDataItem]: decoded [dataItem][#data.data] is undefined: ".concat(t));return new O({data:i,curve:r,privateKey:n})})),S(O,"fromCBOR",(function(t){var e=Object(n.f)(t);return O.fromDataItem(e)}));var C=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&x(t,e)}(r,t);var e=R(r);function r(t){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),I(T(i=e.call(this)),"getRegistryType",(function(){return a.b.BYTES})),I(T(i),"getData",(function(){return i.bytes})),I(T(i),"toDataItem",(function(){return new n.a(i.bytes)})),i.bytes=t,i}return r}(_.a);I(C,"fromDataItem",(function(t){var e=t.getData();if(!e)throw new Error("#[ur-registry][Bytes][fn.fromDataItem]: decoded [dataItem][#data] is undefined: ".concat(t));return new C(e)})),I(C,"fromCBOR",(function(t){var e=Object(n.f)(t);return C.fromDataItem(e)}));var D,A=r(22);function j(t){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function M(t,e){return(M=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function L(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=F(t);if(e){var i=F(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return U(this,r)}}function U(t,e){return!e||"object"!==j(e)&&"function"!=typeof e?N(t):e}function N(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function F(t){return(F=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function q(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}!function(t){t[t.threshold=1]="threshold",t[t.keys=2]="keys"}(D||(D={}));var z=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&M(t,e)}(r,t);var e=L(r);function r(t,n){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),q(N(i=e.call(this)),"getThreshold",(function(){return i.threshold})),q(N(i),"getKeys",(function(){return i.keys})),q(N(i),"toDataItem",(function(){var t={};t[D.threshold]=i.threshold;var e=i.keys.map((function(t){var e=t.toDataItem();return e.setTag(t.getRegistryType().getTag()),e}));return t[D.keys]=e,new A.DataItem(t)})),q(N(i),"getOutputDescriptorContent",(function(){return[i.getThreshold(),i.keys.map((function(t){return t.getOutputDescriptorContent()})).join(",")].join(",")})),i.threshold=t,i.keys=n,i}return r}(_.a);function W(t){return(W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Y(t){return function(t){if(Array.isArray(t))return H(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return H(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return H(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function K(t,e){return(K=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function $(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=X(t);if(e){var i=X(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return G(this,r)}}function G(t,e){return!e||"object"!==W(e)&&"function"!=typeof e?V(t):e}function V(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function X(t){return(X=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function J(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}q(z,"fromDataItem",(function(t){var e=t.getData(),r=e[D.threshold],n=e[D.keys],i=[];return n.forEach((function(t){t.getTag()===a.b.CRYPTO_HDKEY.getTag()?i.push(d.a.fromDataItem(t)):t.getTag()===a.b.CRYPTO_ECKEY.getTag()&&i.push(O.fromDataItem(t))})),new z(r,i)}));var Q=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&K(t,e)}(r,t);var e=$(r);function r(t,i){var o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),J(V(o=e.call(this)),"getRegistryType",(function(){return a.b.CRYPTO_OUTPUT})),J(V(o),"getCryptoKey",(function(){return o.cryptoKey})),J(V(o),"getHDKey",(function(){return o.cryptoKey instanceof d.a?o.cryptoKey:void 0})),J(V(o),"getECKey",(function(){return o.cryptoKey instanceof O?o.cryptoKey:void 0})),J(V(o),"getMultiKey",(function(){return o.cryptoKey instanceof z?o.cryptoKey:void 0})),J(V(o),"getScriptExpressions",(function(){return o.scriptExpressions})),J(V(o),"_toOutputDescriptor",(function(t){return t>=o.scriptExpressions.length?o.cryptoKey.getOutputDescriptorContent():"".concat(o.scriptExpressions[t].getExpression(),"(").concat(o._toOutputDescriptor(t+1),")")})),J(V(o),"toString",(function(){return o._toOutputDescriptor(0)})),J(V(o),"toDataItem",(function(){var t=o.cryptoKey.toDataItem();return(o.cryptoKey instanceof O||o.cryptoKey instanceof d.a)&&t.setTag(o.cryptoKey.getRegistryType().getTag()),Y(o.scriptExpressions).reverse().forEach((function(e){var r=e.getTag();void 0===t.getTag()?t.setTag(r):t=new n.a(t,r)})),t})),o.scriptExpressions=t,o.cryptoKey=i,o}return r}(_.a);function Z(t){return(Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tt(t,e){return(tt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function et(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=it(t);if(e){var i=it(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return rt(this,r)}}function rt(t,e){return!e||"object"!==Z(e)&&"function"!=typeof e?nt(t):e}function nt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function it(t){return(it=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ot(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}J(Q,"fromDataItem",(function(t){for(var e=[],r=t;;){var i=r.getTag()||void 0,o=u.fromTag(i);if(!o)break;if(e.push(o),!(r.getData()instanceof n.a))break;i=(r=r.getData()).getTag()}var s=e.length;if(s>0&&(e[s-1].getExpression()===f.MULTISIG.getExpression()||e[s-1].getExpression()===f.SORTED_MULTISIG.getExpression())){var c=z.fromDataItem(r);return new Q(e,c)}if(r.getTag()===a.b.CRYPTO_HDKEY.getTag()){var l=d.a.fromDataItem(r);return new Q(e,l)}var h=O.fromDataItem(r);return new Q(e,h)})),J(Q,"fromCBOR",(function(t){var e=Object(n.f)(t);return Q.fromDataItem(e)}));var at=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&tt(t,e)}(r,t);var e=et(r);function r(t){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),ot(nt(i=e.call(this)),"getRegistryType",(function(){return a.b.CRYPTO_PSBT})),ot(nt(i),"getPSBT",(function(){return i.psbt})),ot(nt(i),"toDataItem",(function(){return new n.a(i.psbt)})),i.psbt=t,i}return r}(_.a);ot(at,"fromDataItem",(function(t){var e=t.getData();if(!e)throw new Error("#[ur-registry][CryptoPSBT][fn.fromDataItem]: decoded [dataItem][#data] is undefined: ".concat(t));return new at(e)})),ot(at,"fromCBOR",(function(t){var e=Object(n.f)(t);return at.fromDataItem(e)}));var st=r(32);function ut(t){return(ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ft(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ct(t,e){return(ct=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function lt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=pt(t);if(e){var i=pt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ht(this,r)}}function ht(t,e){return!e||"object"!==ut(e)&&"function"!=typeof e?dt(t):e}function dt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pt(t){return(pt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function gt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var _t=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ct(t,e)}(r,t);var e=lt(r);function r(){var t;ft(this,r);for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return gt(dt(t=e.call.apply(e,[this].concat(i))),"resultRegistryType",(function(){var e=t.resultUR();switch(e.type){case a.b.BYTES.getType():return C.fromCBOR(e.cbor);case a.b.CRYPTO_HDKEY.getType():return d.a.fromCBOR(e.cbor);case a.b.CRYPTO_KEYPATH.getType():return p.a.fromCBOR(e.cbor);case a.b.CRYPTO_COIN_INFO.getType():return g.a.fromCBOR(e.cbor);case a.b.CRYPTO_ECKEY.getType():return O.fromCBOR(e.cbor);case a.b.CRYPTO_OUTPUT.getType():return Q.fromCBOR(e.cbor);case a.b.CRYPTO_PSBT.getType():return at.fromCBOR(e.cbor);case a.b.CRYPTO_ACCOUNT.getType():return st.a.fromCBOR(e.cbor);default:throw new Error("#[ur-registry][Decoder][fn.resultRegistryType]: registry type ".concat(e.type," is not supported now"))}})),t}return r}(r(23).URDecoder),yt=r(17),bt={URRegistryDecoder:_t,Bytes:C,CryptoAccount:st.a,CryptoHDKey:d.a,CryptoKeypath:p.a,CryptoCoinInfo:g.a,CryptoCoinInfoType:g.c,CryptoCoinInfoNetwork:g.b,CryptoECKey:O,CryptoOutput:Q,CryptoPSBT:at,MultiKey:z,ScriptExpressions:f,PathComponent:yt.a},vt={addReader:n.b,addSemanticDecode:n.c,addSemanticEncode:n.d,addWriter:n.e,patchTags:o},mt={RegistryTypes:a.b,RegistryItem:_.a,RegistryType:a.a,decodeToDataItem:n.f,encodeDataItem:n.g,cbor:vt};e.default=bt},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){"use strict";var n=r(5).Buffer,i=r(61).Transform;function o(t){i.call(this),this._block=n.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(4)(o,i),o.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!n.isBuffer(t)&&"string"!=typeof t)throw new TypeError(e+" must be a string or a buffer")}(t,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(t)||(t=n.from(t,e));for(var r=this._block,i=0;this._blockOffset+t.length-i>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)r[o++]=t[i++];this._update(),this._blockOffset=0}for(;i<t.length;)r[this._blockOffset++]=t[i++];for(var a=0,s=8*t.length;s>0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},function(t,e,r){"use strict";(function(e,n){var i;t.exports=B,B.ReadableState=O;r(18).EventEmitter;var o=function(t,e){return t.listeners(e).length},a=r(38),s=r(0).Buffer,u=e.Uint8Array||function(){};var f,c=r(65);f=c&&c.debuglog?c.debuglog("stream"):function(){};var l,h,d,p=r(66),g=r(39),_=r(40).getHighWaterMark,y=r(13).codes,b=y.ERR_INVALID_ARG_TYPE,v=y.ERR_STREAM_PUSH_AFTER_EOF,m=y.ERR_METHOD_NOT_IMPLEMENTED,w=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(4)(B,a);var E=g.errorOrDestroy,S=["error","close","destroy","pause","resume"];function O(t,e,n){i=i||r(14),t=t||{},"boolean"!=typeof n&&(n=e instanceof i),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=_(this,t,"readableHighWaterMark",n),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(19).StringDecoder),this.decoder=new l(t.encoding),this.encoding=t.encoding)}function B(t){if(i=i||r(14),!(this instanceof B))return new B(t);var e=this instanceof i;this._readableState=new O(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function x(t,e,r,n,i){f("readableAddChunk",e);var o,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(f("onEofChunk"),e.ended)return;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?T(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,P(t)))}(t,a);else if(i||(o=function(t,e){var r;n=e,s.isBuffer(n)||n instanceof u||"string"==typeof e||void 0===e||t.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],e));var n;return r}(a,e)),o)E(t,o);else if(a.objectMode||e&&e.length>0)if("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),n)a.endEmitted?E(t,new w):R(t,a,e,!0);else if(a.ended)E(t,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?R(t,a,e,!1):I(t,a)):R(t,a,e,!1)}else n||(a.reading=!1,I(t,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function R(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&T(t)),I(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=g.destroy,B.prototype._undestroy=g.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=s.from(t,e),e=""),r=!0),x(this,t,e,!1,r)},B.prototype.unshift=function(t){return x(this,t,null,!0,!1)},B.prototype.isPaused=function(){return!1===this._readableState.flowing},B.prototype.setEncoding=function(t){l||(l=r(19).StringDecoder);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};function k(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>=1073741824?t=1073741824:(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 T(t){var e=t._readableState;f("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(f("emitReadable",e.flowing),e.emittedReadable=!0,n.nextTick(P,t))}function P(t){var e=t._readableState;f("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,M(t)}function I(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(C,t,e))}function C(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(f("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function D(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 A(t){f("readable nexttick read 0"),t.read(0)}function j(t,e){f("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),M(t),e.flowing&&!e.reading&&t.read(0)}function M(t){var e=t._readableState;for(f("flow",e.flowing);e.flowing&&null!==t.read(););}function L(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function U(t){var e=t._readableState;f("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,n.nextTick(N,e,t))}function N(t,e){if(f("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function F(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}B.prototype.read=function(t){f("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 f("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?U(this):T(this),null;if(0===(t=k(t,e))&&e.ended)return 0===e.length&&U(this),null;var n,i=e.needReadable;return f("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&f("length less than watermark",i=!0),e.ended||e.reading?f("reading or ended",i=!1):i&&(f("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=k(r,e))),null===(n=t>0?L(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&U(this)),null!==n&&this.emit("data",n),n},B.prototype._read=function(t){E(this,new m("_read()"))},B.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,f("pipe count=%d opts=%j",i.pipesCount,e);var a=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?u:_;function s(e,n){f("onunpipe"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,f("cleanup"),t.removeListener("close",p),t.removeListener("finish",g),t.removeListener("drain",c),t.removeListener("error",d),t.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",_),r.removeListener("data",h),l=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}function u(){f("onend"),t.end()}i.endEmitted?n.nextTick(a):r.once("end",a),t.on("unpipe",s);var c=function(t){return function(){var e=t._readableState;f("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,M(t))}}(r);t.on("drain",c);var l=!1;function h(e){f("ondata");var n=t.write(e);f("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==F(i.pipes,t))&&!l&&(f("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function d(e){f("onerror",e),_(),t.removeListener("error",d),0===o(t,"error")&&E(t,e)}function p(){t.removeListener("finish",g),_()}function g(){f("onfinish"),t.removeListener("close",p),_()}function _(){f("unpipe"),r.unpipe(t)}return r.on("data",h),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",d),t.once("close",p),t.once("finish",g),t.emit("pipe",r),i.flowing||(f("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 a=F(e.pipes,t);return-1===a||(e.pipes.splice(a,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=a.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,f("on readable",i.length,i.reading),i.length?T(this):i.reading||n.nextTick(A,this))),r},B.prototype.addListener=B.prototype.on,B.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&n.nextTick(D,this),r},B.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||n.nextTick(D,this),e},B.prototype.resume=function(){var t=this._readableState;return t.flowing||(f("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,n.nextTick(j,t,e))}(this,t)),t.paused=!1,this},B.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(f("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 i in t.on("end",(function(){if(f("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(f("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<S.length;o++)t.on(S[o],this.emit.bind(this,S[o]));return this._read=function(e){f("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"==typeof Symbol&&(B.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=r(68)),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=L,Object.defineProperty(B.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(B.from=function(t,e){return void 0===d&&(d=r(69)),d(B,t,e)})}).call(this,r(6),r(7))},function(t,e,r){(function(t,n){var i=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},o=/%[sdj%]/g;e.format=function(t){if(!b(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(u(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,i=n.length,a=String(t).replace(o,(function(t){if("%%"===t)return"%";if(r>=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),s=n[r];r<i;s=n[++r])_(s)||!w(s)?a+=" "+s:a+=" "+u(s);return a},e.deprecate=function(r,i){if(void 0!==t&&!0===t.noDeprecation)return r;if(void 0===t)return function(){return e.deprecate(r,i).apply(this,arguments)};var o=!1;return function(){if(!o){if(t.throwDeprecation)throw new Error(i);t.traceDeprecation?n.trace(i):n.error(i),o=!0}return r.apply(this,arguments)}};var a,s={};function u(t,r){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),l(n,t,n.depth)}function f(t,e){var r=u.styles[e];return r?"["+u.colors[r][0]+"m"+t+"["+u.colors[r][1]+"m":t}function c(t,e){return t}function l(t,r,n){if(t.customInspect&&r&&O(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return b(i)||(i=l(t,i,n)),i}var o=function(t,e){if(v(e))return t.stylize("undefined","undefined");if(b(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(y(e))return t.stylize(""+e,"number");if(g(e))return t.stylize(""+e,"boolean");if(_(e))return t.stylize("null","null")}(t,r);if(o)return o;var a=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),S(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return h(r);if(0===a.length){if(O(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(m(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(E(r))return t.stylize(Date.prototype.toString.call(r),"date");if(S(r))return h(r)}var f,c="",w=!1,B=["{","}"];(p(r)&&(w=!0,B=["[","]"]),O(r))&&(c=" [Function"+(r.name?": "+r.name:"")+"]");return m(r)&&(c=" "+RegExp.prototype.toString.call(r)),E(r)&&(c=" "+Date.prototype.toUTCString.call(r)),S(r)&&(c=" "+h(r)),0!==a.length||w&&0!=r.length?n<0?m(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),f=w?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a<s;++a)T(e,String(a))?o.push(d(t,e,r,n,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(d(t,e,r,n,i,!0))})),o}(t,r,n,s,a):a.map((function(e){return d(t,r,n,s,e,w)})),t.seen.pop(),function(t,e,r){if(t.reduce((function(t,e){return e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(f,c,B)):B[0]+c+B[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),T(n,i)||(a="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=_(r)?l(t,u.value,null):l(t,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),v(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function p(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function _(t){return null===t}function y(t){return"number"==typeof t}function b(t){return"string"==typeof t}function v(t){return void 0===t}function m(t){return w(t)&&"[object RegExp]"===B(t)}function w(t){return"object"==typeof t&&null!==t}function E(t){return w(t)&&"[object Date]"===B(t)}function S(t){return w(t)&&("[object Error]"===B(t)||t instanceof Error)}function O(t){return"function"==typeof t}function B(t){return Object.prototype.toString.call(t)}function x(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(r){if(v(a)&&(a=t.env.NODE_DEBUG||""),r=r.toUpperCase(),!s[r])if(new RegExp("\\b"+r+"\\b","i").test(a)){var i=t.pid;s[r]=function(){var t=e.format.apply(e,arguments);n.error("%s %d: %s",r,i,t)}}else s[r]=function(){};return s[r]},e.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=p,e.isBoolean=g,e.isNull=_,e.isNullOrUndefined=function(t){return null==t},e.isNumber=y,e.isString=b,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=v,e.isRegExp=m,e.isObject=w,e.isDate=E,e.isError=S,e.isFunction=O,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(62);var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function k(){var t=new Date,e=[x(t.getHours()),x(t.getMinutes()),x(t.getSeconds())].join(":");return[t.getDate(),R[t.getMonth()],e].join(" ")}function T(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){n.log("%s - %s",k(),e.format.apply(e,arguments))},e.inherits=r(63),e._extend=function(t,e){if(!e||!w(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var P="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function I(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(P&&t[P]){var e;if("function"!=typeof(e=t[P]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,P,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,i)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),P&&Object.defineProperty(e,P,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,i(t))},e.promisify.custom=P,e.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var i=r.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};e.apply(this,r).then((function(e){t.nextTick(a,null,e)}),(function(e){t.nextTick(I,e,a)}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),Object.defineProperties(r,i(e)),r}}).call(this,r(7),r(26))},function(t,e,r){t.exports=r(18).EventEmitter},function(t,e,r){"use strict";(function(e){function r(t,e){i(t,e),n(t)}function n(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,o){var a=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(o?o(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(i,this,t)):e.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!o&&t?a._writableState?a._writableState.errorEmitted?e.nextTick(n,a):(a._writableState.errorEmitted=!0,e.nextTick(r,a,t)):e.nextTick(r,a,t):o?(e.nextTick(n,a),o(t)):e.nextTick(n,a)})),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)}}}).call(this,r(7))},function(t,e,r){"use strict";var n=r(13).codes.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}}},function(t,e,r){"use strict";(function(e,n){function i(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var o;t.exports=B,B.WritableState=O;var a={deprecate:r(42)},s=r(38),u=r(0).Buffer,f=e.Uint8Array||function(){};var c,l=r(39),h=r(40).getHighWaterMark,d=r(13).codes,p=d.ERR_INVALID_ARG_TYPE,g=d.ERR_METHOD_NOT_IMPLEMENTED,_=d.ERR_MULTIPLE_CALLBACK,y=d.ERR_STREAM_CANNOT_PIPE,b=d.ERR_STREAM_DESTROYED,v=d.ERR_STREAM_NULL_VALUES,m=d.ERR_STREAM_WRITE_AFTER_END,w=d.ERR_UNKNOWN_ENCODING,E=l.errorOrDestroy;function S(){}function O(t,e,a){o=o||r(14),t=t||{},"boolean"!=typeof a&&(a=e instanceof o),this.objectMode=!!t.objectMode,a&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",a),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,i=r.sync,o=r.writecb;if("function"!=typeof o)throw new _;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,i,o){--e.pendingcb,r?(n.nextTick(o,i),n.nextTick(I,t,e),t._writableState.errorEmitted=!0,E(t,i)):(o(i),t._writableState.errorEmitted=!0,E(t,i),I(t,e))}(t,r,i,e,o);else{var a=T(r)||t.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||k(t,r),i?n.nextTick(R,t,r,a,o):R(t,r,a,o)}}(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 i(this)}function B(t){var e=this instanceof(o=o||r(14));if(!e&&!c.call(B,this))return new B(t);this._writableState=new O(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)),s.call(this)}function x(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,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 R(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),I(t,e)}function k(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,o=new Array(n),a=e.corkedRequestsFree;a.entry=r;for(var s=0,u=!0;r;)o[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;o.allBuffers=u,x(t,e,!0,e.length,o,"",a.finish),e.pendingcb++,e.lastBufferedRequest=null,a.next?(e.corkedRequestsFree=a.next,a.next=null):e.corkedRequestsFree=new i(e),e.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,c=r.encoding,l=r.callback;if(x(t,e,!1,e.objectMode?1:f.length,f,c,l),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function T(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function P(t,e){t._final((function(r){e.pendingcb--,r&&E(t,r),e.prefinished=!0,t.emit("prefinish"),I(t,e)}))}function I(t,e){var r=T(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,n.nextTick(P,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return r}r(4)(B,s),O.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(O.prototype,"buffer",{get:a.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]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(B,Symbol.hasInstance,{value:function(t){return!!c.call(this,t)||this===B&&(t&&t._writableState instanceof O)}})):c=function(t){return t instanceof this},B.prototype.pipe=function(){E(this,new y)},B.prototype.write=function(t,e,r){var i,o=this._writableState,a=!1,s=!o.objectMode&&(i=t,u.isBuffer(i)||i 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=o.defaultEncoding),"function"!=typeof r&&(r=S),o.ending?function(t,e){var r=new m;E(t,r),n.nextTick(e,r)}(this,r):(s||function(t,e,r,i){var o;return null===r?o=new v:"string"==typeof r||e.objectMode||(o=new p("chunk",["string","Buffer"],r)),!o||(E(t,o),n.nextTick(i,o),!1)}(this,o,t,r))&&(o.pendingcb++,a=function(t,e,r,n,i,o){if(!r){var a=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=u.from(e,r));return e}(e,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=e.objectMode?1:n.length;e.length+=s;var f=e.length<e.highWaterMark;f||(e.needDrain=!0);if(e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else x(t,e,!1,s,n,i,o);return f}(this,o,s,t,e,r)),a},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||k(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 w(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 g("_write()"))},B.prototype._writev=null,B.prototype.end=function(t,e,r){var i=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),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,r){e.ending=!0,I(t,e),r&&(e.finished?n.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,i,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)}}).call(this,r(6),r(7))},function(t,e,r){(function(e,r){function n(t){try{if(!r.localStorage)return!1}catch(t){return!1}var e=r.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,r){if(n("noDeprecation"))return t;var i=!1;return function(){if(!i){if(n("throwDeprecation"))throw new Error(r);n("traceDeprecation")?e.trace(r):e.warn(r),i=!0}return t.apply(this,arguments)}}}).call(this,r(26),r(6))},function(t,e,r){"use strict";t.exports=c;var n=r(13).codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(14);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 c(t){if(!(this instanceof c))return new c(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",l)}function l(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(e,r){h(t,e,r)}))}function h(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new s;if(t._transformState.transforming)throw new a;return t.push(null)}r(4)(c,u),c.prototype.push=function(t,e){return this._transformState.needTransform=!1,u.prototype.push.call(this,t,e)},c.prototype._transform=function(t,e,r){r(new i("_transform()"))},c.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)}},c.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))},c.prototype._destroy=function(t,e){u.prototype._destroy.call(this,t,(function(t){e(t)}))}},function(t,e,r){(e=t.exports=function(t){t=t.toLowerCase();var r=e[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r}).sha=r(73),e.sha1=r(74),e.sha224=r(75),e.sha256=r(45),e.sha384=r(76),e.sha512=r(46)},function(t,e,r){var n=r(4),i=r(15),o=r(5).Buffer,a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=new Array(64);function u(){this.init(),this._w=s,i.call(this,64,56)}function f(t,e,r){return r^t&(e^r)}function c(t,e,r){return t&e|r&(t|e)}function l(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function h(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,p=0|this._f,g=0|this._g,_=0|this._h,y=0;y<16;++y)r[y]=t.readInt32BE(4*y);for(;y<64;++y)r[y]=0|(((e=r[y-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[y-7]+d(r[y-15])+r[y-16];for(var b=0;b<64;++b){var v=_+h(u)+f(u,p,g)+a[b]+r[b]|0,m=l(n)+c(n,i,o)|0;_=g,g=p,p=u,u=s+v|0,s=o,o=i,i=n,n=v+m|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=g+this._g|0,this._h=_+this._h|0},u.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=u},function(t,e,r){var n=r(4),i=r(15),o=r(5).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}function f(t,e,r){return r^t&(e^r)}function c(t,e,r){return t&e|r&(t|e)}function l(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function h(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function g(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function _(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function y(t,e){return t>>>0<e>>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,u=0|this._fh,b=0|this._gh,v=0|this._hh,m=0|this._al,w=0|this._bl,E=0|this._cl,S=0|this._dl,O=0|this._el,B=0|this._fl,x=0|this._gl,R=0|this._hl,k=0;k<32;k+=2)e[k]=t.readInt32BE(4*k),e[k+1]=t.readInt32BE(4*k+4);for(;k<160;k+=2){var T=e[k-30],P=e[k-30+1],I=d(T,P),C=p(P,T),D=g(T=e[k-4],P=e[k-4+1]),A=_(P,T),j=e[k-14],M=e[k-14+1],L=e[k-32],U=e[k-32+1],N=C+M|0,F=I+j+y(N,C)|0;F=(F=F+D+y(N=N+A|0,A)|0)+L+y(N=N+U|0,U)|0,e[k]=F,e[k+1]=N}for(var q=0;q<160;q+=2){F=e[q],N=e[q+1];var z=c(r,n,i),W=c(m,w,E),Y=l(r,m),H=l(m,r),K=h(s,O),$=h(O,s),G=a[q],V=a[q+1],X=f(s,u,b),J=f(O,B,x),Q=R+$|0,Z=v+K+y(Q,R)|0;Z=(Z=(Z=Z+X+y(Q=Q+J|0,J)|0)+G+y(Q=Q+V|0,V)|0)+F+y(Q=Q+N|0,N)|0;var tt=H+W|0,et=Y+z+y(tt,H)|0;v=b,R=x,b=u,x=B,u=s,B=O,s=o+Z+y(O=S+Q|0,S)|0,o=i,S=E,i=n,E=w,n=r,w=m,r=Z+et+y(m=Q+tt|0,Q)|0}this._al=this._al+m|0,this._bl=this._bl+w|0,this._cl=this._cl+E|0,this._dl=this._dl+S|0,this._el=this._el+O|0,this._fl=this._fl+B|0,this._gl=this._gl+x|0,this._hl=this._hl+R|0,this._ah=this._ah+r+y(this._al,m)|0,this._bh=this._bh+n+y(this._bl,w)|0,this._ch=this._ch+i+y(this._cl,E)|0,this._dh=this._dh+o+y(this._dl,S)|0,this._eh=this._eh+s+y(this._el,O)|0,this._fh=this._fh+u+y(this._fl,B)|0,this._gh=this._gh+b+y(this._gl,x)|0,this._hh=this._hh+v+y(this._hl,R)|0},u.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=u},function(t,e,r){"use strict";(function(e,n){var i=r(25);t.exports=v;var o,a=r(34);v.ReadableState=b;r(18).EventEmitter;var s=function(t,e){return t.listeners(e).length},u=r(48),f=r(29).Buffer,c=e.Uint8Array||function(){};var l=Object.create(r(20));l.inherits=r(21);var h=r(80),d=void 0;d=h&&h.debuglog?h.debuglog("stream"):function(){};var p,g=r(81),_=r(49);l.inherits(v,u);var y=["error","close","destroy","pause","resume"];function b(t,e){t=t||{};var n=e instanceof(o=o||r(11));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,a=t.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,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.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=r(19).StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function v(t){if(o=o||r(11),!(this instanceof v))return new v(t);this._readableState=new b(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),u.call(this)}function m(t,e,r,n,i){var o,a=t._readableState;null===e?(a.reading=!1,function(t,e){if(e.ended)return;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,S(t)}(t,a)):(i||(o=function(t,e){var r;n=e,f.isBuffer(n)||n instanceof c||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(a,e)),o?t.emit("error",o):a.objectMode||e&&e.length>0?("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===f.prototype||(e=function(t){return f.from(t)}(e)),n?a.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):w(t,a,e,!0):a.ended?t.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?w(t,a,e,!1):B(t,a)):w(t,a,e,!1))):n||(a.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(a)}function w(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&S(t)),B(t,e)}Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),v.prototype.destroy=_.destroy,v.prototype._undestroy=_.undestroy,v.prototype._destroy=function(t,e){this.push(null),e(t)},v.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=f.from(t,e),e=""),r=!0),m(this,t,e,!1,r)},v.prototype.unshift=function(t){return m(this,t,null,!0,!1)},v.prototype.isPaused=function(){return!1===this._readableState.flowing},v.prototype.setEncoding=function(t){return p||(p=r(19).StringDecoder),this._readableState.decoder=new p(t),this._readableState.encoding=t,this};function E(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>=8388608?t=8388608:(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 S(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(d("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(O,t):O(t))}function O(t){d("emit readable"),t.emit("readable"),T(t)}function B(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(x,t,e))}function x(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(d("maybeReadMore read 0"),t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}function R(t){d("readable nexttick read 0"),t.read(0)}function k(t,e){e.reading||(d("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),T(t),e.flowing&&!e.reading&&t.read(0)}function T(t){var e=t._readableState;for(d("flow",e.flowing);e.flowing&&null!==t.read(););}function P(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;t<e.head.data.length?(n=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):n=t===e.head.data.length?e.shift():r?function(t,e){var r=e.head,n=1,i=r.data;t-=i.length;for(;r=r.next;){var o=r.data,a=t>o.length?o.length:t;if(a===o.length?i+=o:i+=o.slice(0,t),0===(t-=a)){a===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=f.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,a),0===(t-=a)){a===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(a));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function I(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(C,e,t))}function C(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function D(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}v.prototype.read=function(t){d("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return d("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?I(this):S(this),null;if(0===(t=E(t,e))&&e.ended)return 0===e.length&&I(this),null;var n,i=e.needReadable;return d("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&d("length less than watermark",i=!0),e.ended||e.reading?d("reading or ended",i=!1):i&&(d("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=E(r,e))),null===(n=t>0?P(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&I(this)),null!==n&&this.emit("data",n),n},v.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(t,e){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?c:v;function f(e,n){d("onunpipe"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d("cleanup"),t.removeListener("close",y),t.removeListener("finish",b),t.removeListener("drain",l),t.removeListener("error",_),t.removeListener("unpipe",f),r.removeListener("end",c),r.removeListener("end",v),r.removeListener("data",g),h=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||l())}function c(){d("onend"),t.end()}o.endEmitted?i.nextTick(u):r.once("end",u),t.on("unpipe",f);var l=function(t){return function(){var e=t._readableState;d("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,T(t))}}(r);t.on("drain",l);var h=!1;var p=!1;function g(e){d("ondata"),p=!1,!1!==t.write(e)||p||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==D(o.pipes,t))&&!h&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function _(e){d("onerror",e),v(),t.removeListener("error",_),0===s(t,"error")&&t.emit("error",e)}function y(){t.removeListener("finish",b),v()}function b(){d("onfinish"),t.removeListener("close",y),v()}function v(){d("unpipe"),r.unpipe(t)}return r.on("data",g),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?a(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",_),t.once("close",y),t.once("finish",b),t.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),t},v.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,r);return this}var a=D(e.pipes,t);return-1===a||(e.pipes.splice(a,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},v.prototype.on=function(t,e){var r=u.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&S(this):i.nextTick(R,this))}return r},v.prototype.addListener=v.prototype.on,v.prototype.resume=function(){var t=this._readableState;return t.flowing||(d("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(k,t,e))}(this,t)),this},v.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this},v.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(d("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(d("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<y.length;o++)t.on(y[o],this.emit.bind(this,y[o]));return this._read=function(e){d("wrapped _read",e),n&&(n=!1,t.resume())},this},Object.defineProperty(v.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),v._fromList=P}).call(this,r(6),r(7))},function(t,e,r){t.exports=r(18).EventEmitter},function(t,e,r){"use strict";var n=r(25);function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?(n.nextTick(i,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)})),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.finished=!1,this._writableState.errorEmitted=!1)}}},function(t,e,r){"use strict";t.exports=a;var n=r(11),i=Object.create(r(20));function o(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));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 a(t){if(!(this instanceof a))return new a(t);n.call(this,t),this._transformState={afterTransform:o.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",s)}function s(){var t=this;"function"==typeof this._flush?this._flush((function(e,r){u(t,e,r)})):u(this,null,null)}function u(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}i.inherits=r(21),i.inherits(a,n),a.prototype.push=function(t,e){return this._transformState.needTransform=!1,n.prototype.push.call(this,t,e)},a.prototype._transform=function(t,e,r){throw new Error("_transform() is not implemented")},a.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)}},a.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},a.prototype._destroy=function(t,e){var r=this;n.prototype._destroy.call(this,t,(function(t){e(t),r.emit("close")}))}},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});const n=r(31),i=r(12),o=r(52);class a{constructor(t,e="bytes"){if(this._cborPayload=t,this._type=e,!i.isURType(this._type))throw new n.InvalidTypeError}static fromBuffer(t){return new a(o.cborEncode(t))}static from(e,r){return a.fromBuffer(t.from(e,r))}decodeCBOR(){return o.cborDecode(this._cborPayload)}get type(){return this._type}get cbor(){return this._cborPayload}equals(t){return this.type===t.type&&this.cbor.equals(t.cbor)}}e.default=a}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.cborDecode=e.cborEncode=void 0;const n=r(93);e.cborEncode=t=>n.encode(t);e.cborDecode=e=>n.decode(t.isBuffer(e)?e:t.from(e,"hex"))}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(t){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.FountainEncoderPart=void 0;const i=n(r(24)),o=r(12),a=r(54),s=r(52);class u{constructor(t,e,r,n,i){this._seqNum=t,this._seqLength=e,this._messageLength=r,this._checksum=n,this._fragment=i}get messageLength(){return this._messageLength}get fragment(){return this._fragment}get seqNum(){return this._seqNum}get seqLength(){return this._seqLength}get checksum(){return this._checksum}cbor(){const e=s.cborEncode([this._seqNum,this._seqLength,this._messageLength,this._checksum,this._fragment]);return t.from(e)}description(){return`seqNum:${this._seqNum}, seqLen:${this._seqLength}, messageLen:${this._messageLength}, checksum:${this._checksum}, data:${this._fragment.toString("hex")}`}static fromCBOR(e){const[r,n,o,a,f]=s.cborDecode(e);return i.default("number"==typeof r),i.default("number"==typeof n),i.default("number"==typeof o),i.default("number"==typeof a),i.default(t.isBuffer(f)&&f.length>0),new u(r,n,o,a,t.from(f))}}e.FountainEncoderPart=u;class f{constructor(t,e=100,r=0,n=10){const i=f.findNominalFragmentLength(t.length,n,e);this._messageLength=t.length,this._fragments=f.partitionMessage(t,i),this.fragmentLength=i,this.seqNum=o.toUint32(r),this.checksum=o.getCRC(t)}get fragmentsLength(){return this._fragments.length}get fragments(){return this._fragments}get messageLength(){return this._messageLength}isComplete(){return this.seqNum>=this._fragments.length}isSinglePart(){return 1===this._fragments.length}seqLength(){return this._fragments.length}mix(e){return e.reduce((t,e)=>o.bufferXOR(this._fragments[e],t),t.alloc(this.fragmentLength,0))}nextPart(){this.seqNum=o.toUint32(this.seqNum+1);const t=a.chooseFragments(this.seqNum,this._fragments.length,this.checksum),e=this.mix(t);return new u(this.seqNum,this._fragments.length,this._messageLength,this.checksum,e)}static findNominalFragmentLength(t,e,r){i.default(t>0),i.default(e>0),i.default(r>=e);const n=Math.ceil(t/e);let o=0;for(let e=1;e<=n&&(o=Math.ceil(t/e),!(o<=r));e++);return o}static partitionMessage(e,r){let n,i=t.from(e),a=[];for(;i.length>0;)[n,i]=o.split(i,-r),n=t.alloc(r,0).fill(n,0,n.length),a.push(n);return a}}e.default=f}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(t){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.chooseFragments=e.shuffle=e.chooseDegree=void 0;const i=r(12),o=n(r(95)),a=r(98);e.chooseDegree=(t,e)=>{const r=[...new Array(t)].map((t,e)=>1/(e+1));return a(r,null,e.nextDouble).next()+1};e.shuffle=(t,e)=>{let r=[...t],n=[];for(;r.length>0;){let t=e.nextInt(0,r.length-1),i=r[t];r.splice(t,1),n.push(i)}return n};e.chooseFragments=(r,n,a)=>{if(r<=n)return[r-1];{const s=t.concat([i.intToBytes(r),i.intToBytes(a)]),u=new o.default(s),f=e.chooseDegree(n,u),c=[...new Array(n)].map((t,e)=>e);return e.shuffle(c,u).slice(0,f)}}}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(t){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=n(r(24)),o=r(12);let a=[];var s;!function(t){t.STANDARD="standard",t.URI="uri",t.MINIMAL="minimal"}(s||(s={}));const u=t=>"ableacidalsoapexaquaarchatomauntawayaxisbackbaldbarnbeltbetabiasbluebodybragbrewbulbbuzzcalmcashcatschefcityclawcodecolacookcostcruxcurlcuspcyandarkdatadaysdelidicedietdoordowndrawdropdrumdulldutyeacheasyechoedgeepicevenexamexiteyesfactfairfernfigsfilmfishfizzflapflewfluxfoxyfreefrogfuelfundgalagamegeargemsgiftgirlglowgoodgraygrimgurugushgyrohalfhanghardhawkheathelphighhillholyhopehornhutsicedideaidleinchinkyintoirisironitemjadejazzjoinjoltjowljudojugsjumpjunkjurykeepkenokeptkeyskickkilnkingkitekiwiknoblamblavalazyleaflegsliarlimplionlistlogoloudloveluaulucklungmainmanymathmazememomenumeowmildmintmissmonknailnavyneednewsnextnoonnotenumbobeyoboeomitonyxopenovalowlspaidpartpeckplaypluspoempoolposepuffpumapurrquadquizraceramprealredorichroadrockroofrubyruinrunsrustsafesagascarsetssilkskewslotsoapsolosongstubsurfswantacotasktaxitenttiedtimetinytoiltombtoystriptunatwinuglyundouniturgeuservastveryvetovialvibeviewvisavoidvowswallwandwarmwaspwavewaxywebswhatwhenwhizwolfworkyankyawnyellyogayurtzapszerozestzinczonezoom".slice(4*t,4*t+4),f=e=>`${e}${o.getCRCHex(t.from(e,"hex"))}`,c=(e,r)=>{const n=f(e);return t.from(n,"hex").reduce((t,e)=>[...t,u(e)],[]).join(r)},l=e=>{const r=f(e);return t.from(r,"hex").reduce((t,e)=>t+(t=>{const e=u(t);return`${e[0]}${e[3]}`})(e),"")},h=(e,r,n)=>{const s=(4==n?e.split(r):o.partition(e,2)).map(e=>((e,r)=>{i.default(e.length===r,"Invalid Bytewords: word.length does not match wordLength provided");if(0===a.length){a=[...new Array(676)].map(()=>-1);for(let t=0;t<256;t++){const e=u(t);let r=e[0].charCodeAt(0)-"a".charCodeAt(0),n=e[3].charCodeAt(0)-"a".charCodeAt(0);a[26*n+r]=t}}let n=e[0].toLowerCase().charCodeAt(0)-"a".charCodeAt(0),o=e[4==r?3:1].toLowerCase().charCodeAt(0)-"a".charCodeAt(0);i.default(0<=n&&n<26&&0<=o&&o<26,"Invalid Bytewords: invalid word");let s=a[26*o+n];if(i.default(-1!==s,"Invalid Bytewords: value not in lookup table"),4==r){const t=u(s);let r=e[1].toLowerCase(),n=e[2].toLowerCase();i.default(r===t[1]&&n===t[2],"Invalid Bytewords: invalid middle letters of word")}return t.from([s]).toString("hex")})(e,n)).join("");i.default(s.length>=5,"Invalid Bytewords: invalid decoded string length");const[f,c]=o.split(t.from(s,"hex"),4),l=o.getCRCHex(f);return i.default(l===c.toString("hex"),"Invalid Checksum"),f.toString("hex")};e.default={decode:(t,e=s.MINIMAL)=>{switch(e){case s.STANDARD:return h(t," ",4);case s.URI:return h(t,"-",4);case s.MINIMAL:return h(t,"",2);default:throw new Error("Invalid style "+e)}},encode:(t,e=s.MINIMAL)=>{switch(e){case s.STANDARD:return c(t," ");case s.URI:return c(t,"-");case s.MINIMAL:return l(t);default:throw new Error("Invalid style "+e)}},STYLES:s}}).call(this,r(0).Buffer)},function(t,e,r){"use strict";var n=r(59),i=r(90);t.exports=i((function(t){var e=n("sha256").update(t).digest();return n("sha256").update(e).digest()}))},function(t,e,r){"use strict";e.byteLength=function(t){var e=f(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=f(t),a=n[0],s=n[1],u=new o(function(t,e,r){return 3*(e+r)/4-r}(0,a,s)),c=0,l=s>0?a-4:a;for(r=0;r<l;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],u[c++]=e>>16&255,u[c++]=e>>8&255,u[c++]=255&e;2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[c++]=255&e);1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e);return u},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=0,s=r-i;a<s;a+=16383)o.push(c(t,a,a+16383>s?s:a+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)n[s]=a[s],i[a.charCodeAt(s)]=s;function f(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var i,o,a=[],s=e;s<r;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){
|
||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||
e.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,f=u>>1,c=-7,l=r?i-1:0,h=r?-1:1,d=t[e+l];for(l+=h,o=d&(1<<-c)-1,d>>=-c,c+=s;c>0;o=256*o+t[e+l],l+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+l],l+=h,c-=8);if(0===o)o=1-f;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=f}return(d?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,u,f=8*o-i-1,c=(1<<f)-1,l=c>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=c?(s=0,a=c):a+l>=1?(s=(e*u-1)*Math.pow(2,i),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;t[r+d]=255&a,d+=p,a/=256,f-=8);t[r+d-p]|=128*g}},function(t,e,r){"use strict";var n=r(4),i=r(60),o=r(72),a=r(44),s=r(77);function u(t){s.call(this,"digest"),this._hash=t}n(u,s),u.prototype._update=function(t){this._hash.update(t)},u.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new i:"rmd160"===t||"ripemd160"===t?new o:new u(a(t))}},function(t,e,r){"use strict";var n=r(4),i=r(35),o=r(5).Buffer,a=new Array(16);function s(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function u(t,e){return t<<e|t>>>32-e}function f(t,e,r,n,i,o,a){return u(t+(e&r|~e&n)+i+o|0,a)+e|0}function c(t,e,r,n,i,o,a){return u(t+(e&n|r&~n)+i+o|0,a)+e|0}function l(t,e,r,n,i,o,a){return u(t+(e^r^n)+i+o|0,a)+e|0}function h(t,e,r,n,i,o,a){return u(t+(r^(e|~n))+i+o|0,a)+e|0}n(s,i),s.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,o=this._d;r=f(r,n,i,o,t[0],3614090360,7),o=f(o,r,n,i,t[1],3905402710,12),i=f(i,o,r,n,t[2],606105819,17),n=f(n,i,o,r,t[3],3250441966,22),r=f(r,n,i,o,t[4],4118548399,7),o=f(o,r,n,i,t[5],1200080426,12),i=f(i,o,r,n,t[6],2821735955,17),n=f(n,i,o,r,t[7],4249261313,22),r=f(r,n,i,o,t[8],1770035416,7),o=f(o,r,n,i,t[9],2336552879,12),i=f(i,o,r,n,t[10],4294925233,17),n=f(n,i,o,r,t[11],2304563134,22),r=f(r,n,i,o,t[12],1804603682,7),o=f(o,r,n,i,t[13],4254626195,12),i=f(i,o,r,n,t[14],2792965006,17),r=c(r,n=f(n,i,o,r,t[15],1236535329,22),i,o,t[1],4129170786,5),o=c(o,r,n,i,t[6],3225465664,9),i=c(i,o,r,n,t[11],643717713,14),n=c(n,i,o,r,t[0],3921069994,20),r=c(r,n,i,o,t[5],3593408605,5),o=c(o,r,n,i,t[10],38016083,9),i=c(i,o,r,n,t[15],3634488961,14),n=c(n,i,o,r,t[4],3889429448,20),r=c(r,n,i,o,t[9],568446438,5),o=c(o,r,n,i,t[14],3275163606,9),i=c(i,o,r,n,t[3],4107603335,14),n=c(n,i,o,r,t[8],1163531501,20),r=c(r,n,i,o,t[13],2850285829,5),o=c(o,r,n,i,t[2],4243563512,9),i=c(i,o,r,n,t[7],1735328473,14),r=l(r,n=c(n,i,o,r,t[12],2368359562,20),i,o,t[5],4294588738,4),o=l(o,r,n,i,t[8],2272392833,11),i=l(i,o,r,n,t[11],1839030562,16),n=l(n,i,o,r,t[14],4259657740,23),r=l(r,n,i,o,t[1],2763975236,4),o=l(o,r,n,i,t[4],1272893353,11),i=l(i,o,r,n,t[7],4139469664,16),n=l(n,i,o,r,t[10],3200236656,23),r=l(r,n,i,o,t[13],681279174,4),o=l(o,r,n,i,t[0],3936430074,11),i=l(i,o,r,n,t[3],3572445317,16),n=l(n,i,o,r,t[6],76029189,23),r=l(r,n,i,o,t[9],3654602809,4),o=l(o,r,n,i,t[12],3873151461,11),i=l(i,o,r,n,t[15],530742520,16),r=h(r,n=l(n,i,o,r,t[2],3299628645,23),i,o,t[0],4096336452,6),o=h(o,r,n,i,t[7],1126891415,10),i=h(i,o,r,n,t[14],2878612391,15),n=h(n,i,o,r,t[5],4237533241,21),r=h(r,n,i,o,t[12],1700485571,6),o=h(o,r,n,i,t[3],2399980690,10),i=h(i,o,r,n,t[10],4293915773,15),n=h(n,i,o,r,t[1],2240044497,21),r=h(r,n,i,o,t[8],1873313359,6),o=h(o,r,n,i,t[15],4264355552,10),i=h(i,o,r,n,t[6],2734768916,15),n=h(n,i,o,r,t[13],1309151649,21),r=h(r,n,i,o,t[4],4149444226,6),o=h(o,r,n,i,t[11],3174756917,10),i=h(i,o,r,n,t[2],718787259,15),n=h(n,i,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=s},function(t,e,r){(e=t.exports=r(36)).Stream=e,e.Readable=e,e.Writable=r(41),e.Duplex=r(14),e.Transform=r(43),e.PassThrough=r(70),e.finished=r(27),e.pipeline=r(71)},function(t,e){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e,r){"use strict";
|
||
/*
|
||
object-assign
|
||
(c) Sindre Sorhus
|
||
@license MIT
|
||
*/var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,s,u=a(t),f=1;f<arguments.length;f++){for(var c in r=Object(arguments[f]))i.call(r,c)&&(u[c]=r[c]);if(n){s=n(r);for(var l=0;l<s.length;l++)o.call(r,s[l])&&(u[s[l]]=r[s[l]])}}return u}},function(t,e){},function(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,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(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,n.key,n)}}var a=r(0).Buffer,s=r(67).inspect,u=s&&s.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,f;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 a.alloc(0);for(var e,r,n,i=a.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=o.data,r=i,n=s,a.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=a.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:u,value:function(t,e){return s(this,function(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){i(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}({},e,{depth:0,customInspect:!1}))}}])&&o(e.prototype,r),f&&o(e,f),t}()},function(t,e){},function(t,e,r){"use strict";(function(e){var n;function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o=r(27),a=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),f=Symbol("ended"),c=Symbol("lastPromise"),l=Symbol("handlePromise"),h=Symbol("stream");function d(t,e){return{value:t,done:e}}function p(t){var e=t[a];if(null!==e){var r=t[h].read();null!==r&&(t[c]=null,t[a]=null,t[s]=null,e(d(r,!1)))}}function g(t){e.nextTick(p,t)}var _=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var t=this,r=this[u];if(null!==r)return Promise.reject(r);if(this[f])return Promise.resolve(d(void 0,!0));if(this[h].destroyed)return new Promise((function(r,n){e.nextTick((function(){t[u]?n(t[u]):r(d(void 0,!0))}))}));var n,i=this[c];if(i)n=new Promise(function(t,e){return function(r,n){t.then((function(){e[f]?r(d(void 0,!0)):e[l](r,n)}),n)}}(i,this));else{var o=this[h].read();if(null!==o)return Promise.resolve(d(o,!1));n=new Promise(this[l])}return this[c]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var t=this;return new Promise((function(e,r){t[h].destroy(null,(function(t){t?r(t):e(d(void 0,!0))}))}))})),n),_);t.exports=function(t){var e,r=Object.create(y,(i(e={},h,{value:t,writable:!0}),i(e,a,{value:null,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,u,{value:null,writable:!0}),i(e,f,{value:t._readableState.endEmitted,writable:!0}),i(e,l,{value:function(t,e){var n=r[h].read();n?(r[c]=null,r[a]=null,r[s]=null,t(d(n,!1))):(r[a]=t,r[s]=e)},writable:!0}),e));return r[c]=null,o(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[s];return null!==e&&(r[c]=null,r[a]=null,r[s]=null,e(t)),void(r[u]=t)}var n=r[a];null!==n&&(r[c]=null,r[a]=null,r[s]=null,n(d(void 0,!0))),r[f]=!0})),t.on("readable",g.bind(null,r)),r}}).call(this,r(7))},function(t,e){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(t,e,r){"use strict";t.exports=i;var n=r(43);function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r(4)(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},function(t,e,r){"use strict";var n;var i=r(13).codes,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function s(t){if(t)throw t}function u(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var s=!1;t.on("close",(function(){s=!0})),void 0===n&&(n=r(27)),n(t,{readable:e,writable:i},(function(t){if(t)return o(t);s=!0,o()}));var u=!1;return function(e){if(!s&&!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 a("pipe"))}}function f(t){t()}function c(t,e){return t.pipe(e)}function l(t){return t.length?"function"!=typeof t[t.length-1]?s:t.pop():s}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n,i=l(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new o("streams");var a=e.map((function(t,r){var o=r<e.length-1;return u(t,o,r>0,(function(t){n||(n=t),t&&a.forEach(f),o||(a.forEach(f),i(n))}))}));return e.reduce(c)}},function(t,e,r){"use strict";var n=r(0).Buffer,i=r(4),o=r(35),a=new Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],u=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],f=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],c=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],l=[0,1518500249,1859775393,2400959708,2840853838],h=[1352829926,1548603684,1836072691,2053994217,0];function d(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(t,e){return t<<e|t>>>32-e}function g(t,e,r,n,i,o,a,s){return p(t+(e^r^n)+o+a|0,s)+i|0}function _(t,e,r,n,i,o,a,s){return p(t+(e&r|~e&n)+o+a|0,s)+i|0}function y(t,e,r,n,i,o,a,s){return p(t+((e|~r)^n)+o+a|0,s)+i|0}function b(t,e,r,n,i,o,a,s){return p(t+(e&n|r&~n)+o+a|0,s)+i|0}function v(t,e,r,n,i,o,a,s){return p(t+(e^(r|~n))+o+a|0,s)+i|0}i(d,o),d.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,d=0|this._e,m=0|this._a,w=0|this._b,E=0|this._c,S=0|this._d,O=0|this._e,B=0;B<80;B+=1){var x,R;B<16?(x=g(r,n,i,o,d,t[s[B]],l[0],f[B]),R=v(m,w,E,S,O,t[u[B]],h[0],c[B])):B<32?(x=_(r,n,i,o,d,t[s[B]],l[1],f[B]),R=b(m,w,E,S,O,t[u[B]],h[1],c[B])):B<48?(x=y(r,n,i,o,d,t[s[B]],l[2],f[B]),R=y(m,w,E,S,O,t[u[B]],h[2],c[B])):B<64?(x=b(r,n,i,o,d,t[s[B]],l[3],f[B]),R=_(m,w,E,S,O,t[u[B]],h[3],c[B])):(x=v(r,n,i,o,d,t[s[B]],l[4],f[B]),R=g(m,w,E,S,O,t[u[B]],h[4],c[B])),r=d,d=o,o=p(i,10),i=n,n=x,m=O,O=S,S=p(E,10),E=w,w=R}var k=this._b+i+S|0;this._b=this._c+o+O|0,this._c=this._d+d+m|0,this._d=this._e+r+w|0,this._e=this._a+n+E|0,this._a=k},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=n.alloc?n.alloc(20):new n(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=d},function(t,e,r){var n=r(4),i=r(15),o=r(5).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function f(t){return t<<30|t>>>2}function c(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,l=0;l<16;++l)r[l]=t.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var h=0;h<80;++h){var d=~~(h/20),p=0|((e=n)<<5|e>>>27)+c(d,i,o,s)+u+r[h]+a[d];u=s,s=o,o=f(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},function(t,e,r){var n=r(4),i=r(15),o=r(5).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function f(t){return t<<5|t>>>27}function c(t){return t<<30|t>>>2}function l(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,h=0;h<16;++h)r[h]=t.readInt32BE(4*h);for(;h<80;++h)r[h]=(e=r[h-3]^r[h-8]^r[h-14]^r[h-16])<<1|e>>>31;for(var d=0;d<80;++d){var p=~~(d/20),g=f(n)+l(p,i,o,s)+u+r[d]+a[p]|0;u=s,s=o,o=c(i),i=n,n=g}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},function(t,e,r){var n=r(4),i=r(45),o=r(15),a=r(5).Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var t=a.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=u},function(t,e,r){var n=r(4),i=r(46),o=r(15),a=r(5).Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}n(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var t=a.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=u},function(t,e,r){var n=r(5).Buffer,i=r(78).Transform,o=r(19).StringDecoder;function a(t){i.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(4)(a,i),a.prototype.update=function(t,e,r){"string"==typeof t&&(t=n.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},a.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},a.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return t&&(e=this._toString(e,t,!0)),e},a.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},t.exports=a},function(t,e,r){t.exports=i;var n=r(18).EventEmitter;function i(){n.call(this)}r(79)(i,n),i.Readable=r(28),i.Writable=r(86),i.Duplex=r(87),i.Transform=r(88),i.PassThrough=r(89),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",s),r.on("close",u));var a=!1;function s(){a||(a=!0,t.end())}function u(){a||(a=!0,"function"==typeof t.destroy&&t.destroy())}function f(t){if(c(),0===n.listenerCount(this,"error"))throw t}function c(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",f),t.removeListener("error",f),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return r.on("error",f),t.on("error",f),r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e){},function(t,e,r){"use strict";var n=r(29).Buffer,i=r(82);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}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=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}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var e,r,i,o=n.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,r=o,i=s,e.copy(r,i),s+=a.data.length,a=a.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,r){(function(t){var n=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(84),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(6))},function(t,e,r){(function(t,e){!function(t,r){"use strict";if(!t.setImmediate){var n,i,o,a,s,u=1,f={},c=!1,l=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,"[object process]"==={}.toString.call(t.process)?n=function(t){e.nextTick((function(){p(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},n=function(t){o.port2.postMessage(t)}):l&&"onreadystatechange"in l.createElement("script")?(i=l.documentElement,n=function(t){var e=l.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):n=function(t){setTimeout(p,0,t)}:(a="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&p(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),n=function(e){t.postMessage(a+e,"*")}),h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r<e.length;r++)e[r]=arguments[r+1];var i={callback:t,args:e};return f[u]=i,n(u),u++},h.clearImmediate=d}function d(t){delete f[t]}function p(t){if(c)setTimeout(p,0,t);else{var e=f[t];if(e){c=!0;try{!function(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(void 0,r)}}(e)}finally{d(t),c=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,r(6),r(7))},function(t,e,r){"use strict";t.exports=o;var n=r(50),i=Object.create(r(20));function o(t){if(!(this instanceof o))return new o(t);n.call(this,t)}i.inherits=r(21),i.inherits(o,n),o.prototype._transform=function(t,e,r){r(null,t)}},function(t,e,r){t.exports=r(30)},function(t,e,r){t.exports=r(11)},function(t,e,r){t.exports=r(28).Transform},function(t,e,r){t.exports=r(28).PassThrough},function(t,e,r){"use strict";var n=r(91),i=r(5).Buffer;t.exports=function(t){function e(e){var r=e.slice(0,-4),n=e.slice(-4),i=t(r);if(!(n[0]^i[0]|n[1]^i[1]|n[2]^i[2]|n[3]^i[3]))return r}return{encode:function(e){var r=t(e);return n.encode(i.concat([e,r],e.length+4))},decode:function(t){var r=e(n.decode(t));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(t){var r=n.decodeUnsafe(t);if(r)return e(r)}}}},function(t,e,r){var n=r(92);t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(t,e,r){"use strict";var n=r(5).Buffer;t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),a=o.charCodeAt(0);if(255!==e[a])throw new TypeError(o+" is ambiguous");e[a]=i}var s=t.length,u=t.charAt(0),f=Math.log(s)/Math.log(256),c=Math.log(256)/Math.log(s);function l(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return n.alloc(0);var r=0;if(" "!==t[r]){for(var i=0,o=0;t[r]===u;)i++,r++;for(var a=(t.length-r)*f+1>>>0,c=new Uint8Array(a);t[r];){var l=e[t.charCodeAt(r)];if(255===l)return;for(var h=0,d=a-1;(0!==l||h<o)&&-1!==d;d--,h++)l+=s*c[d]>>>0,c[d]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");o=h,r++}if(" "!==t[r]){for(var p=a-o;p!==a&&0===c[p];)p++;var g=n.allocUnsafe(i+(a-p));g.fill(0,0,i);for(var _=i;p!==a;)g[_++]=c[p++];return g}}}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,i=0,o=0,a=e.length;o!==a&&0===e[o];)o++,r++;for(var f=(a-o)*c+1>>>0,l=new Uint8Array(f);o!==a;){for(var h=e[o],d=0,p=f-1;(0!==h||d<i)&&-1!==p;p--,d++)h+=256*l[p]>>>0,l[p]=h%s>>>0,h=h/s>>>0;if(0!==h)throw new Error("Non-zero carry");i=d,o++}for(var g=f-i;g!==f&&0===l[g];)g++;for(var _=u.repeat(r);g<f;++g)_+=t.charAt(l[g]);return _},decodeUnsafe:l,decode:function(t){var e=l(t);if(e)return e;throw new Error("Non-base"+s+" character")}}}},function(t,e,r){(function(r){var n,i,o;i=[],void 0===(o="function"==typeof(n=function(){var t=function(){function t(t){this.$hex=t}t.prototype={length:function(){return this.$hex.length/2},toString:function(t){if(!t||"hex"===t||16===t)return this.$hex;if("utf-8"===t){for(var e="",r=0;r<this.$hex.length;r+=2)e+="%"+this.$hex.substring(r,r+2);return decodeURIComponent(e)}if("latin"===t){for(e=[],r=0;r<this.$hex.length;r+=2)e.push(parseInt(this.$hex.substring(r,r+2),16));return String.fromCharCode.apply(String,e)}throw new Error("Unrecognised format: "+t)}},t.fromLatinString=function(e){for(var r="",n=0;n<e.length;n++){var i=e.charCodeAt(n).toString(16);1===i.length&&(i="0"+i),r+=i}return new t(r)},t.fromUtf8String=function(e){for(var r=encodeURIComponent(e),n="",i=0;i<r.length;i++)if("%"===r.charAt(i))n+=r.substring(i+1,i+3),i+=2;else{var o=r.charCodeAt(i).toString(16);o.length<2&&(o="0"+o),n+=o}return new t(n)};var e=[],n={},i=function(t){return function(){throw new Error(t+" not implemented")}};function o(){}function a(){}function s(t,e){var r=t.value;return r<24?r:24==r?e.readByte():25==r?e.readUint16():26==r?e.readUint32():27==r?e.readUint64():31==r?null:void i("Additional info: "+r)()}function u(t,e,r){var n=t<<5;e<24?r.writeByte(n|e):e<256?(r.writeByte(24|n),r.writeByte(e)):e<65536?(r.writeByte(25|n),r.writeUint16(e)):e<4294967296?(r.writeByte(26|n),r.writeUint32(e)):(r.writeByte(27|n),r.writeUint64(e))}o.prototype={peekByte:i("peekByte"),readByte:i("readByte"),readChunk:i("readChunk"),readFloat16:function(){var t=this.readUint16(),e=(32767&t)>>10,r=1023&t,n=32768&t;if(31===e)return 0===r?n?-1/0:1/0:NaN;var i=e?Math.pow(2,e-25)*(1024+r):Math.pow(2,-24)*r;return n?-i:i},readFloat32:function(){var t=this.readUint32(),e=(2147483647&t)>>23,r=8388607&t,n=2147483648&t;if(255===e)return 0===r?n?-1/0:1/0:NaN;var i=e?Math.pow(2,e-23-127)*(8388608+r):Math.pow(2,-149)*r;return n?-i:i},readFloat64:function(){var t=this.readUint32(),e=t>>20&2047,r=4294967296*(1048575&t)+this.readUint32(),n=2147483648&t;if(2047===e)return 0===r?n?-1/0:1/0:NaN;var i=e?Math.pow(2,e-52-1023)*(4503599627370496+r):Math.pow(2,-1074)*r;return n?-i:i},readUint16:function(){return 256*this.readByte()+this.readByte()},readUint32:function(){return 65536*this.readUint16()+this.readUint16()},readUint64:function(){return 4294967296*this.readUint32()+this.readUint32()}},a.prototype={writeByte:i("writeByte"),result:i("result"),writeFloat16:i("writeFloat16"),writeFloat32:i("writeFloat32"),writeFloat64:i("writeFloat64"),writeUint16:function(t){this.writeByte(t>>8&255),this.writeByte(255&t)},writeUint32:function(t){this.writeUint16(t>>16&65535),this.writeUint16(65535&t)},writeUint64:function(t){if(t>=9007199254740992||t<=-9007199254740992)throw new Error("Cannot encode Uint64 of: "+t+" magnitude to big (floating point errors)");this.writeUint32(Math.floor(t/4294967296)),this.writeUint32(t%4294967296)},writeString:i("writeString"),canWriteBinary:function(t){return!1},writeBinary:i("writeChunk")};var f=new Error;function c(t){var e=function(t){var e=t.readByte();return{type:e>>5,value:31&e}}(t);switch(e.type){case 0:return s(e,t);case 1:return-1-s(e,t);case 2:return t.readChunk(s(e,t));case 3:return t.readChunk(s(e,t)).toString("utf-8");case 4:case 5:var r=s(e,t),i=[];if(null!==r){5===e.type&&(r*=2);for(var o=0;o<r;o++)i[o]=c(t)}else for(var a;(a=c(t))!==f;)i.push(a);if(5===e.type){var u={};for(o=0;o<i.length;o+=2)u[i[o]]=i[o+1];return u}return i;case 6:var l=s(e,t),h=n[l];return i=c(t),h?h(i):i;case 7:if(25===e.value)return t.readFloat16();if(26===e.value)return t.readFloat32();if(27===e.value)return t.readFloat64();switch(s(e,t)){case 20:return!1;case 21:return!0;case 22:return null;case 23:return;case null:return f;default:throw new Error("Unknown fixed value: "+e.value)}default:throw new Error("Unsupported header: "+JSON.stringify(e))}throw new Error("not implemented yet")}function l(t,r){for(var n=0;n<e.length;n++){var i=e[n].fn(t);if(void 0!==i)return u(6,e[n].tag,r),l(i,r)}if(t&&"function"==typeof t.toCBOR&&(t=t.toCBOR()),!1===t)u(7,20,r);else if(!0===t)u(7,21,r);else if(null===t)u(7,22,r);else if(void 0===t)u(7,23,r);else if("number"==typeof t)Math.floor(t)===t&&t<9007199254740992&&t>-9007199254740992?t<0?u(1,-1-t,r):u(0,t,r):(function(t,e,r){r.writeByte(t<<5|e)}(7,27,r),r.writeFloat64(t));else if("string"==typeof t)r.writeString(t,(function(t){u(3,t,r)}));else if(r.canWriteBinary(t))r.writeBinary(t,(function(t){u(2,t,r)}));else{if("object"!=typeof t)throw new Error("CBOR encoding not supported: "+t);if(p.config.useToJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),Array.isArray(t))for(u(4,t.length,r),n=0;n<t.length;n++)l(t[n],r);else{var o=Object.keys(t);for(u(5,o.length,r),n=0;n<o.length;n++)l(o[n],r),l(t[o[n]],r)}}}var h=[],d=[],p={config:{useToJSON:!0},addWriter:function(t,e){"string"==typeof t?d.push((function(r){if(t===r)return e(r)})):d.push(t)},addReader:function(t,e){"string"==typeof t?h.push((function(r,n){if(t===n)return e(r,n)})):h.push(t)},encode:function(t,e){for(var r=0;r<d.length;r++){var n=(0,d[r])(e);if(n)return l(t,n),n.result()}throw new Error("Unsupported output format: "+e)},decode:function(t,e){for(var r=0;r<h.length;r++){var n=(0,h[r])(t,e);if(n)return c(n)}throw new Error("Unsupported input format: "+e)},addSemanticEncode:function(t,r){if("number"!=typeof t||t%1!=0||t<0)throw new Error("Tag must be a positive integer");return e.push({tag:t,fn:r}),this},addSemanticDecode:function(t,e){if("number"!=typeof t||t%1!=0||t<0)throw new Error("Tag must be a positive integer");return n[t]=e,this},Reader:o,Writer:a};function g(t){this.buffer=t,this.pos=0}function _(t){this.byteLength=0,this.defaultBufferLength=16384,this.latestBuffer=r.alloc(this.defaultBufferLength),this.latestBufferOffset=0,this.completeBuffers=[],this.stringFormat=t}function y(t){this.hex=t,this.pos=0}function b(t){this.$hex="",this.finalFormat=t||"hex"}return g.prototype=Object.create(o.prototype),g.prototype.peekByte=function(){return this.buffer[this.pos]},g.prototype.readByte=function(){return this.buffer[this.pos++]},g.prototype.readUint16=function(){var t=this.buffer.readUInt16BE(this.pos);return this.pos+=2,t},g.prototype.readUint32=function(){var t=this.buffer.readUInt32BE(this.pos);return this.pos+=4,t},g.prototype.readFloat32=function(){var t=this.buffer.readFloatBE(this.pos);return this.pos+=4,t},g.prototype.readFloat64=function(){var t=this.buffer.readDoubleBE(this.pos);return this.pos+=8,t},g.prototype.readChunk=function(t){var e=r.alloc(t);return this.buffer.copy(e,0,this.pos,this.pos+=t),e},_.prototype=Object.create(a.prototype),_.prototype.writeByte=function(t){this.latestBuffer[this.latestBufferOffset++]=t,this.latestBufferOffset>=this.latestBuffer.length&&(this.completeBuffers.push(this.latestBuffer),this.latestBuffer=r.alloc(this.defaultBufferLength),this.latestBufferOffset=0),this.byteLength++},_.prototype.writeFloat32=function(t){var e=r.alloc(4);e.writeFloatBE(t,0),this.writeBuffer(e)},_.prototype.writeFloat64=function(t){var e=r.alloc(8);e.writeDoubleBE(t,0),this.writeBuffer(e)},_.prototype.writeString=function(t,e){var n=r.from(t,"utf-8");e(n.length),this.writeBuffer(n)},_.prototype.canWriteBinary=function(t){return t instanceof r},_.prototype.writeBinary=function(t,e){e(t.length),this.writeBuffer(t)},_.prototype.writeBuffer=function(t){if(!(t instanceof r))throw new TypeError("BufferWriter only accepts Buffers");this.latestBufferOffset?this.latestBuffer.length-this.latestBufferOffset>=t.length?(t.copy(this.latestBuffer,this.latestBufferOffset),this.latestBufferOffset+=t.length,this.latestBufferOffset>=this.latestBuffer.length&&(this.completeBuffers.push(this.latestBuffer),this.latestBuffer=r.alloc(this.defaultBufferLength),this.latestBufferOffset=0)):(this.completeBuffers.push(this.latestBuffer.slice(0,this.latestBufferOffset)),this.completeBuffers.push(t),this.latestBuffer=r.alloc(this.defaultBufferLength),this.latestBufferOffset=0):this.completeBuffers.push(t),this.byteLength+=t.length},_.prototype.result=function(){for(var t=r.alloc(this.byteLength),e=0,n=0;n<this.completeBuffers.length;n++){var i=this.completeBuffers[n];i.copy(t,e,0,i.length),e+=i.length}return this.latestBufferOffset&&this.latestBuffer.copy(t,e,0,this.latestBufferOffset),this.stringFormat?t.toString(this.stringFormat):t},"function"==typeof r&&(p.addReader((function(t,e){return t instanceof r?new g(t):"hex"===e||"base64"===e?new g(r.from(t,e)):void 0})),p.addWriter((function(t){return t&&"buffer"!==t?"hex"===t||"base64"===t?new _(t):void 0:new _}))),y.prototype=Object.create(o.prototype),y.prototype.peekByte=function(){var t=this.hex.substring(this.pos,2);return parseInt(t,16)},y.prototype.readByte=function(){var t=this.hex.substring(this.pos,this.pos+2);return this.pos+=2,parseInt(t,16)},y.prototype.readChunk=function(e){var n=this.hex.substring(this.pos,this.pos+2*e);return this.pos+=2*e,"function"==typeof r?r.from(n,"hex"):new t(n)},b.prototype=Object.create(a.prototype),b.prototype.writeByte=function(t){if(t<0||t>255)throw new Error("Byte value out of range: "+t);var e=t.toString(16);1==e.length&&(e="0"+e),this.$hex+=e},b.prototype.canWriteBinary=function(e){return e instanceof t||"function"==typeof r&&e instanceof r},b.prototype.writeBinary=function(e,n){if(e instanceof t)n(e.length()),this.$hex+=e.$hex;else{if(!("function"==typeof r&&e instanceof r))throw new TypeError("HexWriter only accepts BinaryHex or Buffers");n(e.length),this.$hex+=e.toString("hex")}},b.prototype.result=function(){return"buffer"===this.finalFormat&&"function"==typeof r?r.from(this.$hex,"hex"):new t(this.$hex).toString(this.finalFormat)},b.prototype.writeString=function(e,r){var n=t.fromUtf8String(e);r(n.length()),this.$hex+=n.$hex},p.addReader((function(e,r){return e instanceof t||e.$hex?new y(e.$hex):"hex"===r?new y(e):void 0})),p.addWriter((function(t){if("hex"===t)return new b})),p}();return t.addSemanticEncode(0,(function(t){if(t instanceof Date)return t.toISOString()})).addSemanticDecode(0,(function(t){return new Date(t)})).addSemanticDecode(1,(function(t){return new Date(t)})),t})?n.apply(e,i):n)||(t.exports=o)}).call(this,r(0).Buffer)},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});const i=n(r(53)),o=n(r(55));class a{constructor(t,e,r,n){this.ur=t,this.fountainEncoder=new i.default(t.cbor,e,r,n)}get fragmentsLength(){return this.fountainEncoder.fragmentsLength}get fragments(){return this.fountainEncoder.fragments}get messageLength(){return this.fountainEncoder.messageLength}get cbor(){return this.ur.cbor}encodeWhole(){return[...new Array(this.fragmentsLength)].map(()=>this.nextPart())}nextPart(){const t=this.fountainEncoder.nextPart();return this.fountainEncoder.isSinglePart()?a.encodeSinglePart(this.ur):a.encodePart(this.ur.type,t)}static encodeUri(t,e){return[t,e.join("/")].join(":")}static encodeUR(t){return a.encodeUri("ur",t)}static encodePart(t,e){const r=`${e.seqNum}-${e.seqLength}`,n=o.default.encode(e.cbor().toString("hex"),o.default.STYLES.MINIMAL);return a.encodeUR([t,r,n])}static encodeSinglePart(t){const e=o.default.encode(t.cbor.toString("hex"),o.default.STYLES.MINIMAL);return a.encodeUR([t.type,e])}}e.default=a},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});const i=r(12),o=n(r(96)),a=n(r(97)),s=(t,e)=>a.default.bitwiseXor(a.default.asUintN(64,a.default.leftShift(t,a.default.BigInt(e))),a.default.BigInt(a.default.asUintN(64,a.default.signedRightShift(t,a.default.subtract(a.default.BigInt(64),a.default.BigInt(e))))));e.default=class{constructor(t){this.next=()=>new o.default(this.roll().toString()),this.nextDouble=()=>new o.default(this.roll().toString()).div(0x10000000000000000),this.nextInt=(t,e)=>Math.floor(this.nextDouble().toNumber()*(e-t+1)+t),this.nextByte=()=>this.nextInt(0,255),this.nextData=t=>[...new Array(t)].map(()=>this.nextByte());const e=i.sha256Hash(t);this.s=[a.default.BigInt(0),a.default.BigInt(0),a.default.BigInt(0),a.default.BigInt(0)],this.setS(e)}setS(t){for(let e=0;e<4;e++){let r=8*e,n=a.default.BigInt(0);for(let e=0;e<8;e++)n=a.default.asUintN(64,a.default.leftShift(n,a.default.BigInt(8))),n=a.default.asUintN(64,a.default.bitwiseOr(n,a.default.BigInt(t[r+e])));this.s[e]=a.default.asUintN(64,n)}}roll(){const t=a.default.asUintN(64,a.default.multiply(s(a.default.asUintN(64,a.default.multiply(this.s[1],a.default.BigInt(5))),7),a.default.BigInt(9))),e=a.default.asUintN(64,a.default.leftShift(this.s[1],a.default.BigInt(17)));return this.s[2]=a.default.asUintN(64,a.default.bitwiseXor(this.s[2],a.default.BigInt(this.s[0]))),this.s[3]=a.default.asUintN(64,a.default.bitwiseXor(this.s[3],a.default.BigInt(this.s[1]))),this.s[1]=a.default.asUintN(64,a.default.bitwiseXor(this.s[1],a.default.BigInt(this.s[2]))),this.s[0]=a.default.asUintN(64,a.default.bitwiseXor(this.s[0],a.default.BigInt(this.s[3]))),this.s[2]=a.default.asUintN(64,a.default.bitwiseXor(this.s[2],a.default.BigInt(e))),this.s[3]=a.default.asUintN(64,s(this.s[3],45)),t}}},function(t,e,r){var n;!function(i){"use strict";var o,a=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s=Math.ceil,u=Math.floor,f="[BigNumber Error] ",c=f+"Number primitive has more than 15 significant digits: ",l=1e14,h=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],d=1e9;function p(t){var e=0|t;return t>0||t===e?e:e-1}function g(t){for(var e,r,n=1,i=t.length,o=t[0]+"";n<i;){for(r=14-(e=t[n++]+"").length;r--;e="0"+e);o+=e}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function _(t,e){var r,n,i=t.c,o=e.c,a=t.s,s=e.s,u=t.e,f=e.e;if(!a||!s)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-s:a;if(a!=s)return a;if(r=a<0,n=u==f,!i||!o)return n?0:!i^r?1:-1;if(!n)return u>f^r?1:-1;for(s=(u=i.length)<(f=o.length)?u:f,a=0;a<s;a++)if(i[a]!=o[a])return i[a]>o[a]^r?1:-1;return u==f?0:u>f^r?1:-1}function y(t,e,r,n){if(t<e||t>r||t!==u(t))throw Error(f+(n||"Argument")+("number"==typeof t?t<e||t>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function b(t){var e=t.c.length-1;return p(t.e/14)==e&&t.c[e]%2!=0}function v(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function m(t,e,r){var n,i;if(e<0){for(i=r+".";++e;i+=r);t=i+t}else if(++e>(n=t.length)){for(i=r,e-=n;--e;i+=r);t+=i}else e<n&&(t=t.slice(0,e)+"."+t.slice(e));return t}(o=function t(e){var r,n,i,o,w,E,S,O,B,x=N.prototype={constructor:N,toString:null,valueOf:null},R=new N(1),k=20,T=4,P=-7,I=21,C=-1e7,D=1e7,A=!1,j=1,M=0,L={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"Â ",suffix:""},U="0123456789abcdefghijklmnopqrstuvwxyz";function N(t,e){var r,o,s,f,l,h,d,p,g=this;if(!(g instanceof N))return new N(t,e);if(null==e){if(t&&!0===t._isBigNumber)return g.s=t.s,void(!t.c||t.e>D?g.c=g.e=null:t.e<C?g.c=[g.e=0]:(g.e=t.e,g.c=t.c.slice()));if((h="number"==typeof t)&&0*t==0){if(g.s=1/t<0?(t=-t,-1):1,t===~~t){for(f=0,l=t;l>=10;l/=10,f++);return void(f>D?g.c=g.e=null:(g.e=f,g.c=[t]))}p=String(t)}else{if(!a.test(p=String(t)))return i(g,p,h);g.s=45==p.charCodeAt(0)?(p=p.slice(1),-1):1}(f=p.indexOf("."))>-1&&(p=p.replace(".","")),(l=p.search(/e/i))>0?(f<0&&(f=l),f+=+p.slice(l+1),p=p.substring(0,l)):f<0&&(f=p.length)}else{if(y(e,2,U.length,"Base"),10==e)return W(g=new N(t),k+g.e+1,T);if(p=String(t),h="number"==typeof t){if(0*t!=0)return i(g,p,h,e);if(g.s=1/t<0?(p=p.slice(1),-1):1,N.DEBUG&&p.replace(/^0\.0*|\./,"").length>15)throw Error(c+t)}else g.s=45===p.charCodeAt(0)?(p=p.slice(1),-1):1;for(r=U.slice(0,e),f=l=0,d=p.length;l<d;l++)if(r.indexOf(o=p.charAt(l))<0){if("."==o){if(l>f){f=d;continue}}else if(!s&&(p==p.toUpperCase()&&(p=p.toLowerCase())||p==p.toLowerCase()&&(p=p.toUpperCase()))){s=!0,l=-1,f=0;continue}return i(g,String(t),h,e)}h=!1,(f=(p=n(p,e,10,g.s)).indexOf("."))>-1?p=p.replace(".",""):f=p.length}for(l=0;48===p.charCodeAt(l);l++);for(d=p.length;48===p.charCodeAt(--d););if(p=p.slice(l,++d)){if(d-=l,h&&N.DEBUG&&d>15&&(t>9007199254740991||t!==u(t)))throw Error(c+g.s*t);if((f=f-l-1)>D)g.c=g.e=null;else if(f<C)g.c=[g.e=0];else{if(g.e=f,g.c=[],l=(f+1)%14,f<0&&(l+=14),l<d){for(l&&g.c.push(+p.slice(0,l)),d-=14;l<d;)g.c.push(+p.slice(l,l+=14));l=14-(p=p.slice(l)).length}else l-=d;for(;l--;p+="0");g.c.push(+p)}}else g.c=[g.e=0]}function F(t,e,r,n){var i,o,a,s,u;if(null==r?r=T:y(r,0,8),!t.c)return t.toString();if(i=t.c[0],a=t.e,null==e)u=g(t.c),u=1==n||2==n&&(a<=P||a>=I)?v(u,a):m(u,a,"0");else if(o=(t=W(new N(t),e,r)).e,s=(u=g(t.c)).length,1==n||2==n&&(e<=o||o<=P)){for(;s<e;u+="0",s++);u=v(u,o)}else if(e-=a,u=m(u,o,"0"),o+1>s){if(--e>0)for(u+=".";e--;u+="0");}else if((e+=o-s)>0)for(o+1==s&&(u+=".");e--;u+="0");return t.s<0&&i?"-"+u:u}function q(t,e){for(var r,n=1,i=new N(t[0]);n<t.length;n++){if(!(r=new N(t[n])).s){i=r;break}e.call(i,r)&&(i=r)}return i}function z(t,e,r){for(var n=1,i=e.length;!e[--i];e.pop());for(i=e[0];i>=10;i/=10,n++);return(r=n+14*r-1)>D?t.c=t.e=null:r<C?t.c=[t.e=0]:(t.e=r,t.c=e),t}function W(t,e,r,n){var i,o,a,f,c,d,p,g=t.c,_=h;if(g){t:{for(i=1,f=g[0];f>=10;f/=10,i++);if((o=e-i)<0)o+=14,a=e,p=(c=g[d=0])/_[i-a-1]%10|0;else if((d=s((o+1)/14))>=g.length){if(!n)break t;for(;g.length<=d;g.push(0));c=p=0,i=1,a=(o%=14)-14+1}else{for(c=f=g[d],i=1;f>=10;f/=10,i++);p=(a=(o%=14)-14+i)<0?0:c/_[i-a-1]%10|0}if(n=n||e<0||null!=g[d+1]||(a<0?c:c%_[i-a-1]),n=r<4?(p||n)&&(0==r||r==(t.s<0?3:2)):p>5||5==p&&(4==r||n||6==r&&(o>0?a>0?c/_[i-a]:0:g[d-1])%10&1||r==(t.s<0?8:7)),e<1||!g[0])return g.length=0,n?(e-=t.e+1,g[0]=_[(14-e%14)%14],t.e=-e||0):g[0]=t.e=0,t;if(0==o?(g.length=d,f=1,d--):(g.length=d+1,f=_[14-o],g[d]=a>0?u(c/_[i-a]%_[a])*f:0),n)for(;;){if(0==d){for(o=1,a=g[0];a>=10;a/=10,o++);for(a=g[0]+=f,f=1;a>=10;a/=10,f++);o!=f&&(t.e++,g[0]==l&&(g[0]=1));break}if(g[d]+=f,g[d]!=l)break;g[d--]=0,f=1}for(o=g.length;0===g[--o];g.pop());}t.e>D?t.c=t.e=null:t.e<C&&(t.c=[t.e=0])}return t}function Y(t){var e,r=t.e;return null===r?t.toString():(e=g(t.c),e=r<=P||r>=I?v(e,r):m(e,r,"0"),t.s<0?"-"+e:e)}return N.clone=t,N.ROUND_UP=0,N.ROUND_DOWN=1,N.ROUND_CEIL=2,N.ROUND_FLOOR=3,N.ROUND_HALF_UP=4,N.ROUND_HALF_DOWN=5,N.ROUND_HALF_EVEN=6,N.ROUND_HALF_CEIL=7,N.ROUND_HALF_FLOOR=8,N.EUCLID=9,N.config=N.set=function(t){var e,r;if(null!=t){if("object"!=typeof t)throw Error(f+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(y(r=t[e],0,d,e),k=r),t.hasOwnProperty(e="ROUNDING_MODE")&&(y(r=t[e],0,8,e),T=r),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((r=t[e])&&r.pop?(y(r[0],-d,0,e),y(r[1],0,d,e),P=r[0],I=r[1]):(y(r,-d,d,e),P=-(I=r<0?-r:r))),t.hasOwnProperty(e="RANGE"))if((r=t[e])&&r.pop)y(r[0],-d,-1,e),y(r[1],1,d,e),C=r[0],D=r[1];else{if(y(r,-d,d,e),!r)throw Error(f+e+" cannot be zero: "+r);C=-(D=r<0?-r:r)}if(t.hasOwnProperty(e="CRYPTO")){if((r=t[e])!==!!r)throw Error(f+e+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw A=!r,Error(f+"crypto unavailable");A=r}else A=r}if(t.hasOwnProperty(e="MODULO_MODE")&&(y(r=t[e],0,9,e),j=r),t.hasOwnProperty(e="POW_PRECISION")&&(y(r=t[e],0,d,e),M=r),t.hasOwnProperty(e="FORMAT")){if("object"!=typeof(r=t[e]))throw Error(f+e+" not an object: "+r);L=r}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(r=t[e])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(f+e+" invalid: "+r);U=r}}return{DECIMAL_PLACES:k,ROUNDING_MODE:T,EXPONENTIAL_AT:[P,I],RANGE:[C,D],CRYPTO:A,MODULO_MODE:j,POW_PRECISION:M,FORMAT:L,ALPHABET:U}},N.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!N.DEBUG)return!0;var e,r,n=t.c,i=t.e,o=t.s;t:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-d&&i<=d&&i===u(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break t}if((e=(i+1)%14)<1&&(e+=14),String(n[0]).length==e){for(e=0;e<n.length;e++)if((r=n[e])<0||r>=l||r!==u(r))break t;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(f+"Invalid BigNumber: "+t)},N.maximum=N.max=function(){return q(arguments,x.lt)},N.minimum=N.min=function(){return q(arguments,x.gt)},N.random=(o=9007199254740992*Math.random()&2097151?function(){return u(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,r,n,i,a,c=0,l=[],p=new N(R);if(null==t?t=k:y(t,0,d),i=s(t/14),A)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(i*=2));c<i;)(a=131072*e[c]+(e[c+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),e[c]=r[0],e[c+1]=r[1]):(l.push(a%1e14),c+=2);c=i/2}else{if(!crypto.randomBytes)throw A=!1,Error(f+"crypto unavailable");for(e=crypto.randomBytes(i*=7);c<i;)(a=281474976710656*(31&e[c])+1099511627776*e[c+1]+4294967296*e[c+2]+16777216*e[c+3]+(e[c+4]<<16)+(e[c+5]<<8)+e[c+6])>=9e15?crypto.randomBytes(7).copy(e,c):(l.push(a%1e14),c+=7);c=i/7}if(!A)for(;c<i;)(a=o())<9e15&&(l[c++]=a%1e14);for(t%=14,(i=l[--c])&&t&&(a=h[14-t],l[c]=u(i/a)*a);0===l[c];l.pop(),c--);if(c<0)l=[n=0];else{for(n=-1;0===l[0];l.splice(0,1),n-=14);for(c=1,a=l[0];a>=10;a/=10,c++);c<14&&(n-=14-c)}return p.e=n,p.c=l,p}),N.sum=function(){for(var t=1,e=arguments,r=new N(e[0]);t<e.length;)r=r.plus(e[t++]);return r},n=function(){function t(t,e,r,n){for(var i,o,a=[0],s=0,u=t.length;s<u;){for(o=a.length;o--;a[o]*=e);for(a[0]+=n.indexOf(t.charAt(s++)),i=0;i<a.length;i++)a[i]>r-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}return function(e,n,i,o,a){var s,u,f,c,l,h,d,p,_=e.indexOf("."),y=k,b=T;for(_>=0&&(c=M,M=0,e=e.replace(".",""),h=(p=new N(n)).pow(e.length-_),M=c,p.c=t(m(g(h.c),h.e,"0"),10,i,"0123456789"),p.e=p.c.length),f=c=(d=t(e,n,i,a?(s=U,"0123456789"):(s="0123456789",U))).length;0==d[--c];d.pop());if(!d[0])return s.charAt(0);if(_<0?--f:(h.c=d,h.e=f,h.s=o,d=(h=r(h,p,y,b,i)).c,l=h.r,f=h.e),_=d[u=f+y+1],c=i/2,l=l||u<0||null!=d[u+1],l=b<4?(null!=_||l)&&(0==b||b==(h.s<0?3:2)):_>c||_==c&&(4==b||l||6==b&&1&d[u-1]||b==(h.s<0?8:7)),u<1||!d[0])e=l?m(s.charAt(1),-y,s.charAt(0)):s.charAt(0);else{if(d.length=u,l)for(--i;++d[--u]>i;)d[u]=0,u||(++f,d=[1].concat(d));for(c=d.length;!d[--c];);for(_=0,e="";_<=c;e+=s.charAt(d[_++]));e=m(e,f,s.charAt(0))}return e}}(),r=function(){function t(t,e,r){var n,i,o,a,s=0,u=t.length,f=e%1e7,c=e/1e7|0;for(t=t.slice();u--;)s=((i=f*(o=t[u]%1e7)+(n=c*o+(a=t[u]/1e7|0)*f)%1e7*1e7+s)/r|0)+(n/1e7|0)+c*a,t[u]=i%r;return s&&(t=[s].concat(t)),t}function e(t,e,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(t[i]!=e[i]){o=t[i]>e[i]?1:-1;break}return o}function r(t,e,r,n){for(var i=0;r--;)t[r]-=i,i=t[r]<e[r]?1:0,t[r]=i*n+t[r]-e[r];for(;!t[0]&&t.length>1;t.splice(0,1));}return function(n,i,o,a,s){var f,c,h,d,g,_,y,b,v,m,w,E,S,O,B,x,R,k=n.s==i.s?1:-1,T=n.c,P=i.c;if(!(T&&T[0]&&P&&P[0]))return new N(n.s&&i.s&&(T?!P||T[0]!=P[0]:P)?T&&0==T[0]||!P?0*k:k/0:NaN);for(v=(b=new N(k)).c=[],k=o+(c=n.e-i.e)+1,s||(s=l,c=p(n.e/14)-p(i.e/14),k=k/14|0),h=0;P[h]==(T[h]||0);h++);if(P[h]>(T[h]||0)&&c--,k<0)v.push(1),d=!0;else{for(O=T.length,x=P.length,h=0,k+=2,(g=u(s/(P[0]+1)))>1&&(P=t(P,g,s),T=t(T,g,s),x=P.length,O=T.length),S=x,w=(m=T.slice(0,x)).length;w<x;m[w++]=0);R=P.slice(),R=[0].concat(R),B=P[0],P[1]>=s/2&&B++;do{if(g=0,(f=e(P,m,x,w))<0){if(E=m[0],x!=w&&(E=E*s+(m[1]||0)),(g=u(E/B))>1)for(g>=s&&(g=s-1),y=(_=t(P,g,s)).length,w=m.length;1==e(_,m,y,w);)g--,r(_,x<y?R:P,y,s),y=_.length,f=1;else 0==g&&(f=g=1),y=(_=P.slice()).length;if(y<w&&(_=[0].concat(_)),r(m,_,w,s),w=m.length,-1==f)for(;e(P,m,x,w)<1;)g++,r(m,x<w?R:P,w,s),w=m.length}else 0===f&&(g++,m=[0]);v[h++]=g,m[0]?m[w++]=T[S]||0:(m=[T[S]],w=1)}while((S++<O||null!=m[0])&&k--);d=null!=m[0],v[0]||v.splice(0,1)}if(s==l){for(h=1,k=v[0];k>=10;k/=10,h++);W(b,o+(b.e=h+14*c-1)+1,a,d)}else b.e=c,b.r=+d;return b}}(),w=/^(-?)0([xbo])(?=\w[\w.]*$)/i,E=/^([^.]+)\.$/,S=/^\.([^.]+)$/,O=/^-?(Infinity|NaN)$/,B=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(t,e,r,n){var i,o=r?e:e.replace(B,"");if(O.test(o))t.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(w,(function(t,e,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?t:e})),n&&(i=n,o=o.replace(E,"$1").replace(S,"0.$1")),e!=o))return new N(o,i);if(N.DEBUG)throw Error(f+"Not a"+(n?" base "+n:"")+" number: "+e);t.s=null}t.c=t.e=null},x.absoluteValue=x.abs=function(){var t=new N(this);return t.s<0&&(t.s=1),t},x.comparedTo=function(t,e){return _(this,new N(t,e))},x.decimalPlaces=x.dp=function(t,e){var r,n,i,o=this;if(null!=t)return y(t,0,d),null==e?e=T:y(e,0,8),W(new N(o),t+o.e+1,e);if(!(r=o.c))return null;if(n=14*((i=r.length-1)-p(this.e/14)),i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},x.dividedBy=x.div=function(t,e){return r(this,new N(t,e),k,T)},x.dividedToIntegerBy=x.idiv=function(t,e){return r(this,new N(t,e),0,1)},x.exponentiatedBy=x.pow=function(t,e){var r,n,i,o,a,c,l,h,d=this;if((t=new N(t)).c&&!t.isInteger())throw Error(f+"Exponent not an integer: "+Y(t));if(null!=e&&(e=new N(e)),a=t.e>14,!d.c||!d.c[0]||1==d.c[0]&&!d.e&&1==d.c.length||!t.c||!t.c[0])return h=new N(Math.pow(+Y(d),a?2-b(t):+Y(t))),e?h.mod(e):h;if(c=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new N(NaN);(n=!c&&d.isInteger()&&e.isInteger())&&(d=d.mod(e))}else{if(t.e>9&&(d.e>0||d.e<-1||(0==d.e?d.c[0]>1||a&&d.c[1]>=24e7:d.c[0]<8e13||a&&d.c[0]<=9999975e7)))return o=d.s<0&&b(t)?-0:0,d.e>-1&&(o=1/o),new N(c?1/o:o);M&&(o=s(M/14+2))}for(a?(r=new N(.5),c&&(t.s=1),l=b(t)):l=(i=Math.abs(+Y(t)))%2,h=new N(R);;){if(l){if(!(h=h.times(d)).c)break;o?h.c.length>o&&(h.c.length=o):n&&(h=h.mod(e))}if(i){if(0===(i=u(i/2)))break;l=i%2}else if(W(t=t.times(r),t.e+1,1),t.e>14)l=b(t);else{if(0===(i=+Y(t)))break;l=i%2}d=d.times(d),o?d.c&&d.c.length>o&&(d.c.length=o):n&&(d=d.mod(e))}return n?h:(c&&(h=R.div(h)),e?h.mod(e):o?W(h,M,T,void 0):h)},x.integerValue=function(t){var e=new N(this);return null==t?t=T:y(t,0,8),W(e,e.e+1,t)},x.isEqualTo=x.eq=function(t,e){return 0===_(this,new N(t,e))},x.isFinite=function(){return!!this.c},x.isGreaterThan=x.gt=function(t,e){return _(this,new N(t,e))>0},x.isGreaterThanOrEqualTo=x.gte=function(t,e){return 1===(e=_(this,new N(t,e)))||0===e},x.isInteger=function(){return!!this.c&&p(this.e/14)>this.c.length-2},x.isLessThan=x.lt=function(t,e){return _(this,new N(t,e))<0},x.isLessThanOrEqualTo=x.lte=function(t,e){return-1===(e=_(this,new N(t,e)))||0===e},x.isNaN=function(){return!this.s},x.isNegative=function(){return this.s<0},x.isPositive=function(){return this.s>0},x.isZero=function(){return!!this.c&&0==this.c[0]},x.minus=function(t,e){var r,n,i,o,a=this,s=a.s;if(e=(t=new N(t,e)).s,!s||!e)return new N(NaN);if(s!=e)return t.s=-e,a.plus(t);var u=a.e/14,f=t.e/14,c=a.c,h=t.c;if(!u||!f){if(!c||!h)return c?(t.s=-e,t):new N(h?a:NaN);if(!c[0]||!h[0])return h[0]?(t.s=-e,t):new N(c[0]?a:3==T?-0:0)}if(u=p(u),f=p(f),c=c.slice(),s=u-f){for((o=s<0)?(s=-s,i=c):(f=u,i=h),i.reverse(),e=s;e--;i.push(0));i.reverse()}else for(n=(o=(s=c.length)<(e=h.length))?s:e,s=e=0;e<n;e++)if(c[e]!=h[e]){o=c[e]<h[e];break}if(o&&(i=c,c=h,h=i,t.s=-t.s),(e=(n=h.length)-(r=c.length))>0)for(;e--;c[r++]=0);for(e=l-1;n>s;){if(c[--n]<h[n]){for(r=n;r&&!c[--r];c[r]=e);--c[r],c[n]+=l}c[n]-=h[n]}for(;0==c[0];c.splice(0,1),--f);return c[0]?z(t,c,f):(t.s=3==T?-1:1,t.c=[t.e=0],t)},x.modulo=x.mod=function(t,e){var n,i,o=this;return t=new N(t,e),!o.c||!t.s||t.c&&!t.c[0]?new N(NaN):!t.c||o.c&&!o.c[0]?new N(o):(9==j?(i=t.s,t.s=1,n=r(o,t,0,3),t.s=i,n.s*=i):n=r(o,t,0,j),(t=o.minus(n.times(t))).c[0]||1!=j||(t.s=o.s),t)},x.multipliedBy=x.times=function(t,e){var r,n,i,o,a,s,u,f,c,h,d,g,_,y,b=this,v=b.c,m=(t=new N(t,e)).c;if(!(v&&m&&v[0]&&m[0]))return!b.s||!t.s||v&&!v[0]&&!m||m&&!m[0]&&!v?t.c=t.e=t.s=null:(t.s*=b.s,v&&m?(t.c=[0],t.e=0):t.c=t.e=null),t;for(n=p(b.e/14)+p(t.e/14),t.s*=b.s,(u=v.length)<(h=m.length)&&(_=v,v=m,m=_,i=u,u=h,h=i),i=u+h,_=[];i--;_.push(0));for(y=l,1e7,i=h;--i>=0;){for(r=0,d=m[i]%1e7,g=m[i]/1e7|0,o=i+(a=u);o>i;)r=((f=d*(f=v[--a]%1e7)+(s=g*f+(c=v[a]/1e7|0)*d)%1e7*1e7+_[o]+r)/y|0)+(s/1e7|0)+g*c,_[o--]=f%y;_[o]=r}return r?++n:_.splice(0,1),z(t,_,n)},x.negated=function(){var t=new N(this);return t.s=-t.s||null,t},x.plus=function(t,e){var r,n=this,i=n.s;if(e=(t=new N(t,e)).s,!i||!e)return new N(NaN);if(i!=e)return t.s=-e,n.minus(t);var o=n.e/14,a=t.e/14,s=n.c,u=t.c;if(!o||!a){if(!s||!u)return new N(i/0);if(!s[0]||!u[0])return u[0]?t:new N(s[0]?n:0*i)}if(o=p(o),a=p(a),s=s.slice(),i=o-a){for(i>0?(a=o,r=u):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(e=u.length)<0&&(r=u,u=s,s=r,e=i),i=0;e;)i=(s[--e]=s[e]+u[e]+i)/l|0,s[e]=l===s[e]?0:s[e]%l;return i&&(s=[i].concat(s),++a),z(t,s,a)},x.precision=x.sd=function(t,e){var r,n,i,o=this;if(null!=t&&t!==!!t)return y(t,1,d),null==e?e=T:y(e,0,8),W(new N(o),t,e);if(!(r=o.c))return null;if(n=14*(i=r.length-1)+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return t&&o.e+1>n&&(n=o.e+1),n},x.shiftedBy=function(t){return y(t,-9007199254740991,9007199254740991),this.times("1e"+t)},x.squareRoot=x.sqrt=function(){var t,e,n,i,o,a=this,s=a.c,u=a.s,f=a.e,c=k+4,l=new N("0.5");if(1!==u||!s||!s[0])return new N(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(u=Math.sqrt(+Y(a)))||u==1/0?(((e=g(s)).length+f)%2==0&&(e+="0"),u=Math.sqrt(+e),f=p((f+1)/2)-(f<0||f%2),n=new N(e=u==1/0?"5e"+f:(e=u.toExponential()).slice(0,e.indexOf("e")+1)+f)):n=new N(u+""),n.c[0])for((u=(f=n.e)+c)<3&&(u=0);;)if(o=n,n=l.times(o.plus(r(a,o,c,1))),g(o.c).slice(0,u)===(e=g(n.c)).slice(0,u)){if(n.e<f&&--u,"9999"!=(e=e.slice(u-3,u+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(W(n,n.e+k+2,1),t=!n.times(n).eq(a));break}if(!i&&(W(o,o.e+k+2,0),o.times(o).eq(a))){n=o;break}c+=4,u+=4,i=1}return W(n,n.e+k+1,T,t)},x.toExponential=function(t,e){return null!=t&&(y(t,0,d),t++),F(this,t,e,1)},x.toFixed=function(t,e){return null!=t&&(y(t,0,d),t=t+this.e+1),F(this,t,e)},x.toFormat=function(t,e,r){var n,i=this;if(null==r)null!=t&&e&&"object"==typeof e?(r=e,e=null):t&&"object"==typeof t?(r=t,t=e=null):r=L;else if("object"!=typeof r)throw Error(f+"Argument not an object: "+r);if(n=i.toFixed(t,e),i.c){var o,a=n.split("."),s=+r.groupSize,u=+r.secondaryGroupSize,c=r.groupSeparator||"",l=a[0],h=a[1],d=i.s<0,p=d?l.slice(1):l,g=p.length;if(u&&(o=s,s=u,u=o,g-=o),s>0&&g>0){for(o=g%s||s,l=p.substr(0,o);o<g;o+=s)l+=c+p.substr(o,s);u>0&&(l+=c+p.slice(o)),d&&(l="-"+l)}n=h?l+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?h.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):h):l}return(r.prefix||"")+n+(r.suffix||"")},x.toFraction=function(t){var e,n,i,o,a,s,u,c,l,d,p,_,y=this,b=y.c;if(null!=t&&(!(u=new N(t)).isInteger()&&(u.c||1!==u.s)||u.lt(R)))throw Error(f+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+Y(u));if(!b)return new N(y);for(e=new N(R),l=n=new N(R),i=c=new N(R),_=g(b),a=e.e=_.length-y.e-1,e.c[0]=h[(s=a%14)<0?14+s:s],t=!t||u.comparedTo(e)>0?a>0?e:l:u,s=D,D=1/0,u=new N(_),c.c[0]=0;d=r(u,e,0,1),1!=(o=n.plus(d.times(i))).comparedTo(t);)n=i,i=o,l=c.plus(d.times(o=l)),c=o,e=u.minus(d.times(o=e)),u=o;return o=r(t.minus(n),i,0,1),c=c.plus(o.times(l)),n=n.plus(o.times(i)),c.s=l.s=y.s,p=r(l,i,a*=2,T).minus(y).abs().comparedTo(r(c,n,a,T).minus(y).abs())<1?[l,i]:[c,n],D=s,p},x.toNumber=function(){return+Y(this)},x.toPrecision=function(t,e){return null!=t&&y(t,1,d),F(this,t,e,2)},x.toString=function(t){var e,r=this,i=r.s,o=r.e;return null===o?i?(e="Infinity",i<0&&(e="-"+e)):e="NaN":(null==t?e=o<=P||o>=I?v(g(r.c),o):m(g(r.c),o,"0"):10===t?e=m(g((r=W(new N(r),k+o+1,T)).c),r.e,"0"):(y(t,2,U.length,"Base"),e=n(m(g(r.c),o,"0"),10,t,i,!0)),i<0&&r.c[0]&&(e="-"+e)),e},x.valueOf=x.toJSON=function(){return Y(this)},x._isBigNumber=!0,null!=e&&N.set(e),N}()).default=o.BigNumber=o,void 0===(n=function(){return o}.call(e,r,e,t))||(t.exports=n)}()},function(t,e,r){t.exports=function(){"use strict";var t=Math.imul,e=Math.clz32;function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e){for(var r,n=0;n<e.length;n++)(r=e[n]).enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}function i(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}function o(t){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function u(){return(u=s()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&a(i,r.prototype),i}).apply(null,arguments)}function f(t){var e="function"==typeof Map?new Map:void 0;return(f=function(t){function r(){return u(t,arguments,o(this).constructor)}if(null===t||!function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),a(r,t)})(t)}function c(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function l(t){var e=s();return function(){var r,n=o(t);if(e){var i=o(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return c(this,r)}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function d(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return h(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}var p=function(t){var e=Math.abs,n=Math.max;function o(t,e){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),t>o.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return(r=s.call(this,t)).sign=e,r}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}(o,t);var s=l(o);return i(o,[{key:"toDebugString",value:function(){var t,e=["BigInt["],r=d(this);try{for(r.s();!(t=r.n()).done;){var n=t.value;e.push((n?(n>>>0).toString(16):n)+", ")}}catch(t){r.e(t)}finally{r.f()}return e.push("]"),e.join("")}},{key:"toString",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:10;if(2>t||36<t)throw new RangeError("toString() radix argument must be between 2 and 36");return 0===this.length?"0":0==(t&t-1)?o.__toStringBasePowerOfTwo(this,t):o.__toStringGeneric(this,t,!1)}},{key:"__copy",value:function(){for(var t=new o(this.length,this.sign),e=0;e<this.length;e++)t[e]=this[e];return t}},{key:"__trim",value:function(){for(var t=this.length,e=this[t-1];0===e;)e=this[--t-1],this.pop();return 0===t&&(this.sign=!1),this}},{key:"__initializeDigits",value:function(){for(var t=0;t<this.length;t++)this[t]=0}},{key:"__clzmsd",value:function(){return o.__clz32(this[this.length-1])}},{key:"__inplaceMultiplyAdd",value:function(t,e,r){r>this.length&&(r=this.length);for(var n=65535&t,i=t>>>16,a=0,s=65535&e,u=e>>>16,f=0;f<r;f++){var c=this.__digit(f),l=65535&c,h=c>>>16,d=o.__imul(l,n),p=o.__imul(l,i),g=o.__imul(h,n),_=o.__imul(h,i),y=s+(65535&d),b=u+a+(y>>>16)+(d>>>16)+(65535&p)+(65535&g);a=(s=(p>>>16)+(g>>>16)+(65535&_)+(b>>>16))>>>16,s&=65535,u=_>>>16,this.__setDigit(f,65535&y|b<<16)}if(0!==a||0!==s||0!==u)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(t,e,r){for(var n,i=0,o=0;o<r;o++)i=(n=this.__halfDigit(e+o)+t.__halfDigit(o)+i)>>>16,this.__setHalfDigit(e+o,n);return i}},{key:"__inplaceSub",value:function(t,e,r){var n=0;if(1&e){e>>=1;for(var i=this.__digit(e),o=65535&i,a=0;a<r-1>>>1;a++){var s=t.__digit(a),u=(i>>>16)-(65535&s)-n;n=1&u>>>16,this.__setDigit(e+a,u<<16|65535&o),n=1&(o=(65535&(i=this.__digit(e+a+1)))-(s>>>16)-n)>>>16}var f=t.__digit(a),c=(i>>>16)-(65535&f)-n;if(n=1&c>>>16,this.__setDigit(e+a,c<<16|65535&o),e+a+1>=this.length)throw new RangeError("out of bounds");0==(1&r)&&(n=1&(o=(65535&(i=this.__digit(e+a+1)))-(f>>>16)-n)>>>16,this.__setDigit(e+t.length,4294901760&i|65535&o))}else{e>>=1;for(var l=0;l<t.length-1;l++){var h=this.__digit(e+l),d=t.__digit(l),p=(65535&h)-(65535&d)-n,g=(h>>>16)-(d>>>16)-(n=1&p>>>16);n=1&g>>>16,this.__setDigit(e+l,g<<16|65535&p)}var _=this.__digit(e+l),y=t.__digit(l),b=(65535&_)-(65535&y)-n;n=1&b>>>16;var v=0;0==(1&r)&&(n=1&(v=(_>>>16)-(y>>>16)-n)>>>16),this.__setDigit(e+l,v<<16|65535&b)}return n}},{key:"__inplaceRightShift",value:function(t){if(0!==t){for(var e,r=this.__digit(0)>>>t,n=this.length-1,i=0;i<n;i++)e=this.__digit(i+1),this.__setDigit(i,e<<32-t|r),r=e>>>t;this.__setDigit(n,r)}}},{key:"__digit",value:function(t){return this[t]}},{key:"__unsignedDigit",value:function(t){return this[t]>>>0}},{key:"__setDigit",value:function(t,e){this[t]=0|e}},{key:"__setDigitGrow",value:function(t,e){this[t]=0|e}},{key:"__halfDigitLength",value:function(){var t=this.length;return 65535>=this.__unsignedDigit(t-1)?2*t-1:2*t}},{key:"__halfDigit",value:function(t){return 65535&this[t>>>1]>>>((1&t)<<4)}},{key:"__setHalfDigit",value:function(t,e){var r=t>>>1,n=this.__digit(r),i=1&t?65535&n|e<<16:4294901760&n|65535&e;this.__setDigit(r,i)}}],[{key:"BigInt",value:function(t){var e=Math.floor,n=Number.isFinite;if("number"==typeof t){if(0===t)return o.__zero();if((0|t)===t)return 0>t?o.__oneDigit(-t,!0):o.__oneDigit(t,!1);if(!n(t)||e(t)!==t)throw new RangeError("The number "+t+" cannot be converted to BigInt because it is not an integer");return o.__fromDouble(t)}if("string"==typeof t){var i=o.__fromString(t);if(null===i)throw new SyntaxError("Cannot convert "+t+" to a BigInt");return i}if("boolean"==typeof t)return!0===t?o.__oneDigit(1,!1):o.__zero();if("object"===r(t)){if(t.constructor===o)return t;var a=o.__toPrimitive(t);return o.BigInt(a)}throw new TypeError("Cannot convert "+t+" to a BigInt")}},{key:"toNumber",value:function(t){var e=t.length;if(0===e)return 0;if(1===e){var r=t.__unsignedDigit(0);return t.sign?-r:r}var n=t.__digit(e-1),i=o.__clz32(n),a=32*e-i;if(1024<a)return t.sign?-1/0:1/0;var s=a-1,u=n,f=e-1,c=i+1,l=32===c?0:u<<c;l>>>=12;var h=c-12,d=12<=c?0:u<<20+c,p=20+c;0<h&&0<f&&(f--,l|=(u=t.__digit(f))>>>32-h,d=u<<h,p=h),0<p&&0<f&&(f--,d|=(u=t.__digit(f))>>>32-p,p-=32);var g=o.__decideRounding(t,p,f,u);if((1===g||0===g&&1==(1&d))&&0==(d=d+1>>>0)&&0!=++l>>>20&&(l=0,1023<++s))return t.sign?-1/0:1/0;var _=t.sign?-2147483648:0;return s=s+1023<<20,o.__kBitConversionInts[1]=_|s|l,o.__kBitConversionInts[0]=d,o.__kBitConversionDouble[0]}},{key:"unaryMinus",value:function(t){if(0===t.length)return t;var e=t.__copy();return e.sign=!t.sign,e}},{key:"bitwiseNot",value:function(t){return t.sign?o.__absoluteSubOne(t).__trim():o.__absoluteAddOne(t,!0)}},{key:"exponentiate",value:function(t,e){if(e.sign)throw new RangeError("Exponent must be positive");if(0===e.length)return o.__oneDigit(1,!1);if(0===t.length)return t;if(1===t.length&&1===t.__digit(0))return t.sign&&0==(1&e.__digit(0))?o.unaryMinus(t):t;if(1<e.length)throw new RangeError("BigInt too big");var r=e.__unsignedDigit(0);if(1===r)return t;if(r>=o.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===t.length&&2===t.__digit(0)){var n=1+(r>>>5),i=new o(n,t.sign&&0!=(1&r));i.__initializeDigits();var a=1<<(31&r);return i.__setDigit(n-1,a),i}var s=null,u=t;for(0!=(1&r)&&(s=t),r>>=1;0!==r;r>>=1)u=o.multiply(u,u),0!=(1&r)&&(s=null===s?u:o.multiply(s,u));return s}},{key:"multiply",value:function(t,e){if(0===t.length)return t;if(0===e.length)return e;var r=t.length+e.length;32<=t.__clzmsd()+e.__clzmsd()&&r--;var n=new o(r,t.sign!==e.sign);n.__initializeDigits();for(var i=0;i<t.length;i++)o.__multiplyAccumulate(e,t.__digit(i),n,i);return n.__trim()}},{key:"divide",value:function(t,e){if(0===e.length)throw new RangeError("Division by zero");if(0>o.__absoluteCompare(t,e))return o.__zero();var r,n=t.sign!==e.sign,i=e.__unsignedDigit(0);if(1===e.length&&65535>=i){if(1===i)return n===t.sign?t:o.unaryMinus(t);r=o.__absoluteDivSmall(t,i,null)}else r=o.__absoluteDivLarge(t,e,!0,!1);return r.sign=n,r.__trim()}},{key:"remainder",value:function(t,e){if(0===e.length)throw new RangeError("Division by zero");if(0>o.__absoluteCompare(t,e))return t;var r=e.__unsignedDigit(0);if(1===e.length&&65535>=r){if(1===r)return o.__zero();var n=o.__absoluteModSmall(t,r);return 0===n?o.__zero():o.__oneDigit(n,t.sign)}var i=o.__absoluteDivLarge(t,e,!1,!0);return i.sign=t.sign,i.__trim()}},{key:"add",value:function(t,e){var r=t.sign;return r===e.sign?o.__absoluteAdd(t,e,r):0<=o.__absoluteCompare(t,e)?o.__absoluteSub(t,e,r):o.__absoluteSub(e,t,!r)}},{key:"subtract",value:function(t,e){var r=t.sign;return r===e.sign?0<=o.__absoluteCompare(t,e)?o.__absoluteSub(t,e,r):o.__absoluteSub(e,t,!r):o.__absoluteAdd(t,e,r)}},{key:"leftShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?o.__rightShiftByAbsolute(t,e):o.__leftShiftByAbsolute(t,e)}},{key:"signedRightShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?o.__leftShiftByAbsolute(t,e):o.__rightShiftByAbsolute(t,e)}},{key:"unsignedRightShift",value:function(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}},{key:"lessThan",value:function(t,e){return 0>o.__compareToBigInt(t,e)}},{key:"lessThanOrEqual",value:function(t,e){return 0>=o.__compareToBigInt(t,e)}},{key:"greaterThan",value:function(t,e){return 0<o.__compareToBigInt(t,e)}},{key:"greaterThanOrEqual",value:function(t,e){return 0<=o.__compareToBigInt(t,e)}},{key:"equal",value:function(t,e){if(t.sign!==e.sign)return!1;if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(t.__digit(r)!==e.__digit(r))return!1;return!0}},{key:"notEqual",value:function(t,e){return!o.equal(t,e)}},{key:"bitwiseAnd",value:function(t,e){if(!t.sign&&!e.sign)return o.__absoluteAnd(t,e).__trim();if(t.sign&&e.sign){var r=n(t.length,e.length)+1,i=o.__absoluteSubOne(t,r),a=o.__absoluteSubOne(e);return i=o.__absoluteOr(i,a,i),o.__absoluteAddOne(i,!0,i).__trim()}if(t.sign){var s=[e,t];t=s[0],e=s[1]}return o.__absoluteAndNot(t,o.__absoluteSubOne(e)).__trim()}},{key:"bitwiseXor",value:function(t,e){if(!t.sign&&!e.sign)return o.__absoluteXor(t,e).__trim();if(t.sign&&e.sign){var r=n(t.length,e.length),i=o.__absoluteSubOne(t,r),a=o.__absoluteSubOne(e);return o.__absoluteXor(i,a,i).__trim()}var s=n(t.length,e.length)+1;if(t.sign){var u=[e,t];t=u[0],e=u[1]}var f=o.__absoluteSubOne(e,s);return f=o.__absoluteXor(f,t,f),o.__absoluteAddOne(f,!0,f).__trim()}},{key:"bitwiseOr",value:function(t,e){var r=n(t.length,e.length);if(!t.sign&&!e.sign)return o.__absoluteOr(t,e).__trim();if(t.sign&&e.sign){var i=o.__absoluteSubOne(t,r),a=o.__absoluteSubOne(e);return i=o.__absoluteAnd(i,a,i),o.__absoluteAddOne(i,!0,i).__trim()}if(t.sign){var s=[e,t];t=s[0],e=s[1]}var u=o.__absoluteSubOne(e,r);return u=o.__absoluteAndNot(u,t,u),o.__absoluteAddOne(u,!0,u).__trim()}},{key:"asIntN",value:function(t,e){if(0===e.length)return e;if(0===t)return o.__zero();if(t>=o.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.length<r)return e;var n=e.__unsignedDigit(r-1),i=1<<(31&t-1);if(e.length===r&&n<i)return e;if((n&i)!==i)return o.__truncateToNBits(t,e);if(!e.sign)return o.__truncateAndSubFromPowerOfTwo(t,e,!0);if(0==(n&i-1)){for(var a=r-2;0<=a;a--)if(0!==e.__digit(a))return o.__truncateAndSubFromPowerOfTwo(t,e,!1);return e.length===r&&n===i?e:o.__truncateToNBits(t,e)}return o.__truncateAndSubFromPowerOfTwo(t,e,!1)}},{key:"asUintN",value:function(t,e){if(0===e.length)return e;if(0===t)return o.__zero();if(e.sign){if(t>o.__kMaxLengthBits)throw new RangeError("BigInt too big");return o.__truncateAndSubFromPowerOfTwo(t,e,!1)}if(t>=o.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.length<r)return e;var n=31&t;if(e.length==r){if(0===n)return e;if(0==e.__digit(r-1)>>>n)return e}return o.__truncateToNBits(t,e)}},{key:"ADD",value:function(t,e){if(t=o.__toPrimitive(t),e=o.__toPrimitive(e),"string"==typeof t)return"string"!=typeof e&&(e=e.toString()),t+e;if("string"==typeof e)return t.toString()+e;if(t=o.__toNumeric(t),e=o.__toNumeric(e),o.__isBigInt(t)&&o.__isBigInt(e))return o.add(t,e);if("number"==typeof t&&"number"==typeof e)return t+e;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}},{key:"LT",value:function(t,e){return o.__compare(t,e,0)}},{key:"LE",value:function(t,e){return o.__compare(t,e,1)}},{key:"GT",value:function(t,e){return o.__compare(t,e,2)}},{key:"GE",value:function(t,e){return o.__compare(t,e,3)}},{key:"EQ",value:function(t,e){for(;;){if(o.__isBigInt(t))return o.__isBigInt(e)?o.equal(t,e):o.EQ(e,t);if("number"==typeof t){if(o.__isBigInt(e))return o.__equalToNumber(e,t);if("object"!==r(e))return t==e;e=o.__toPrimitive(e)}else if("string"==typeof t){if(o.__isBigInt(e))return null!==(t=o.__fromString(t))&&o.equal(t,e);if("object"!==r(e))return t==e;e=o.__toPrimitive(e)}else if("boolean"==typeof t){if(o.__isBigInt(e))return o.__equalToNumber(e,+t);if("object"!==r(e))return t==e;e=o.__toPrimitive(e)}else if("symbol"===r(t)){if(o.__isBigInt(e))return!1;if("object"!==r(e))return t==e;e=o.__toPrimitive(e)}else{if("object"!==r(t))return t==e;if("object"===r(e)&&e.constructor!==o)return t==e;t=o.__toPrimitive(t)}}}},{key:"NE",value:function(t,e){return!o.EQ(t,e)}},{key:"__zero",value:function(){return new o(0,!1)}},{key:"__oneDigit",value:function(t,e){var r=new o(1,e);return r.__setDigit(0,t),r}},{key:"__decideRounding",value:function(t,e,r,n){if(0<e)return-1;var i;if(0>e)i=-e-1;else{if(0===r)return-1;r--,n=t.__digit(r),i=31}var o=1<<i;if(0==(n&o))return-1;if(0!=(n&(o-=1)))return 1;for(;0<r;)if(r--,0!==t.__digit(r))return 1;return 0}},{key:"__fromDouble",value:function(t){o.__kBitConversionDouble[0]=t;var e,r=(2047&o.__kBitConversionInts[1]>>>20)-1023,n=1+(r>>>5),i=new o(n,0>t),a=1048575&o.__kBitConversionInts[1]|1048576,s=o.__kBitConversionInts[0],u=31&r,f=0;if(u<20){var c=20-u;f=c+32,e=a>>>c,a=a<<32-c|s>>>c,s<<=32-c}else if(20===u)f=32,e=a,a=s;else{var l=u-20;f=32-l,e=a<<l|s>>>32-l,a=s<<l}i.__setDigit(n-1,e);for(var h=n-2;0<=h;h--)0<f?(f-=32,e=a,a=s):e=0,i.__setDigit(h,e);return i.__trim()}},{key:"__isWhitespace",value:function(t){return!!(13>=t&&9<=t)||(159>=t?32==t:131071>=t?160==t||5760==t:196607>=t?10>=(t&=131071)||40==t||41==t||47==t||95==t||4096==t:65279==t)}},{key:"__fromString",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,r=0,n=t.length,i=0;if(i===n)return o.__zero();for(var a=t.charCodeAt(i);o.__isWhitespace(a);){if(++i===n)return o.__zero();a=t.charCodeAt(i)}if(43===a){if(++i===n)return null;a=t.charCodeAt(i),r=1}else if(45===a){if(++i===n)return null;a=t.charCodeAt(i),r=-1}if(0===e){if(e=10,48===a){if(++i===n)return o.__zero();if(88===(a=t.charCodeAt(i))||120===a){if(e=16,++i===n)return null;a=t.charCodeAt(i)}else if(79===a||111===a){if(e=8,++i===n)return null;a=t.charCodeAt(i)}else if(66===a||98===a){if(e=2,++i===n)return null;a=t.charCodeAt(i)}}}else if(16===e&&48===a){if(++i===n)return o.__zero();if(88===(a=t.charCodeAt(i))||120===a){if(++i===n)return null;a=t.charCodeAt(i)}}for(;48===a;){if(++i===n)return o.__zero();a=t.charCodeAt(i)}var s=n-i,u=o.__kMaxBitsPerChar[e],f=o.__kBitsPerCharTableMultiplier-1;if(s>1073741824/u)return null;var c=u*s+f>>>o.__kBitsPerCharTableShift,l=new o(c+31>>>5,!1),h=10>e?e:10,d=10<e?e-10:0;if(0==(e&e-1)){u>>=o.__kBitsPerCharTableShift;var p=[],g=[],_=!1;do{for(var y,b=0,v=0;;){if(y=void 0,a-48>>>0<h)y=a-48;else{if(!((32|a)-97>>>0<d)){_=!0;break}y=(32|a)-87}if(v+=u,b=b<<u|y,++i===n){_=!0;break}if(a=t.charCodeAt(i),32<v+u)break}p.push(b),g.push(v)}while(!_);o.__fillFromParts(l,p,g)}else{l.__initializeDigits();var m=!1,w=0;do{for(var E,S=0,O=1;;){if(E=void 0,a-48>>>0<h)E=a-48;else{if(!((32|a)-97>>>0<d)){m=!0;break}E=(32|a)-87}var B=O*e;if(4294967295<B)break;if(O=B,S=S*e+E,w++,++i===n){m=!0;break}a=t.charCodeAt(i)}var x=u*w+(f=32*o.__kBitsPerCharTableMultiplier-1)>>>o.__kBitsPerCharTableShift+5;l.__inplaceMultiplyAdd(O,S,x)}while(!m)}if(i!==n){if(!o.__isWhitespace(a))return null;for(i++;i<n;i++)if(a=t.charCodeAt(i),!o.__isWhitespace(a))return null}return 0!==r&&10!==e?null:(l.sign=-1===r,l.__trim())}},{key:"__fillFromParts",value:function(t,e,r){for(var n=0,i=0,o=0,a=e.length-1;0<=a;a--){var s=e[a],u=r[a];i|=s<<o,32===(o+=u)?(t.__setDigit(n++,i),o=0,i=0):32<o&&(t.__setDigit(n++,i),i=s>>>u-(o-=32))}if(0!==i){if(n>=t.length)throw new Error("implementation bug");t.__setDigit(n++,i)}for(;n<t.length;n++)t.__setDigit(n,0)}},{key:"__toStringBasePowerOfTwo",value:function(t,e){var r=t.length,n=e-1,i=n=(15&(n=(51&(n=(85&n>>>1)+(85&n))>>>2)+(51&n))>>>4)+(15&n),a=e-1,s=t.__digit(r-1),u=0|(32*r-o.__clz32(s)+i-1)/i;if(t.sign&&u++,268435456<u)throw new Error("string too long");for(var f=Array(u),c=u-1,l=0,h=0,d=0;d<r-1;d++){var p=t.__digit(d),g=(l|p<<h)&a;f[c--]=o.__kConversionChars[g];var _=i-h;for(l=p>>>_,h=32-_;h>=i;)f[c--]=o.__kConversionChars[l&a],l>>>=i,h-=i}var y=(l|s<<h)&a;for(f[c--]=o.__kConversionChars[y],l=s>>>i-h;0!==l;)f[c--]=o.__kConversionChars[l&a],l>>>=i;if(t.sign&&(f[c--]="-"),-1!==c)throw new Error("implementation bug");return f.join("")}},{key:"__toStringGeneric",value:function(t,e,r){var n=t.length;if(0===n)return"";if(1===n){var i=t.__unsignedDigit(0).toString(e);return!1===r&&t.sign&&(i="-"+i),i}var a,s,u=32*n-o.__clz32(t.__digit(n-1)),f=o.__kMaxBitsPerChar[e]-1,c=u*o.__kBitsPerCharTableMultiplier,l=1+(c=0|(c+=f-1)/f)>>1,h=o.exponentiate(o.__oneDigit(e,!1),o.__oneDigit(l,!1)),d=h.__unsignedDigit(0);if(1===h.length&&65535>=d){(a=new o(t.length,!1)).__initializeDigits();for(var p,g=0,_=2*t.length-1;0<=_;_--)p=g<<16|t.__halfDigit(_),a.__setHalfDigit(_,0|p/d),g=0|p%d;s=g.toString(e)}else{var y=o.__absoluteDivLarge(t,h,!0,!0);a=y.quotient;var b=y.remainder.__trim();s=o.__toStringGeneric(b,e,!0)}a.__trim();for(var v=o.__toStringGeneric(a,e,!0);s.length<l;)s="0"+s;return!1===r&&t.sign&&(v="-"+v),v+s}},{key:"__unequalSign",value:function(t){return t?-1:1}},{key:"__absoluteGreater",value:function(t){return t?-1:1}},{key:"__absoluteLess",value:function(t){return t?1:-1}},{key:"__compareToBigInt",value:function(t,e){var r=t.sign;if(r!==e.sign)return o.__unequalSign(r);var n=o.__absoluteCompare(t,e);return 0<n?o.__absoluteGreater(r):0>n?o.__absoluteLess(r):0}},{key:"__compareToNumber",value:function(t,r){if(!0|r){var n=t.sign,i=0>r;if(n!==i)return o.__unequalSign(n);if(0===t.length){if(i)throw new Error("implementation bug");return 0===r?0:-1}if(1<t.length)return o.__absoluteGreater(n);var a=e(r),s=t.__unsignedDigit(0);return s>a?o.__absoluteGreater(n):s<a?o.__absoluteLess(n):0}return o.__compareToDouble(t,r)}},{key:"__compareToDouble",value:function(t,e){if(e!=e)return e;if(e===1/0)return-1;if(e===-1/0)return 1;var r=t.sign;if(r!==0>e)return o.__unequalSign(r);if(0===e)throw new Error("implementation bug: should be handled elsewhere");if(0===t.length)return-1;o.__kBitConversionDouble[0]=e;var n=2047&o.__kBitConversionInts[1]>>>20;if(2047==n)throw new Error("implementation bug: handled elsewhere");var i=n-1023;if(0>i)return o.__absoluteGreater(r);var a=t.length,s=t.__digit(a-1),u=o.__clz32(s),f=32*a-u,c=i+1;if(f<c)return o.__absoluteLess(r);if(f>c)return o.__absoluteGreater(r);var l=1048576|1048575&o.__kBitConversionInts[1],h=o.__kBitConversionInts[0],d=31-u;if(d!==(f-1)%31)throw new Error("implementation bug");var p,g=0;if(d<20){var _=20-d;g=_+32,p=l>>>_,l=l<<32-_|h>>>_,h<<=32-_}else if(20===d)g=32,p=l,l=h;else{var y=d-20;g=32-y,p=l<<y|h>>>32-y,l=h<<y}if((s>>>=0)>(p>>>=0))return o.__absoluteGreater(r);if(s<p)return o.__absoluteLess(r);for(var b=a-2;0<=b;b--){0<g?(g-=32,p=l>>>0,l=h,h=0):p=0;var v=t.__unsignedDigit(b);if(v>p)return o.__absoluteGreater(r);if(v<p)return o.__absoluteLess(r)}if(0!==l||0!==h){if(0===g)throw new Error("implementation bug");return o.__absoluteLess(r)}return 0}},{key:"__equalToNumber",value:function(t,r){return r|0===r?0===r?0===t.length:1===t.length&&t.sign===0>r&&t.__unsignedDigit(0)===e(r):0===o.__compareToDouble(t,r)}},{key:"__comparisonResultToBool",value:function(t,e){switch(e){case 0:return 0>t;case 1:return 0>=t;case 2:return 0<t;case 3:return 0<=t}throw new Error("unreachable")}},{key:"__compare",value:function(t,e,r){if(t=o.__toPrimitive(t),e=o.__toPrimitive(e),"string"==typeof t&&"string"==typeof e)switch(r){case 0:return t<e;case 1:return t<=e;case 2:return t>e;case 3:return t>=e}if(o.__isBigInt(t)&&"string"==typeof e)return null!==(e=o.__fromString(e))&&o.__comparisonResultToBool(o.__compareToBigInt(t,e),r);if("string"==typeof t&&o.__isBigInt(e))return null!==(t=o.__fromString(t))&&o.__comparisonResultToBool(o.__compareToBigInt(t,e),r);if(t=o.__toNumeric(t),e=o.__toNumeric(e),o.__isBigInt(t)){if(o.__isBigInt(e))return o.__comparisonResultToBool(o.__compareToBigInt(t,e),r);if("number"!=typeof e)throw new Error("implementation bug");return o.__comparisonResultToBool(o.__compareToNumber(t,e),r)}if("number"!=typeof t)throw new Error("implementation bug");if(o.__isBigInt(e))return o.__comparisonResultToBool(o.__compareToNumber(e,t),2^r);if("number"!=typeof e)throw new Error("implementation bug");return 0===r?t<e:1===r?t<=e:2===r?t>e:3===r?t>=e:void 0}},{key:"__absoluteAdd",value:function(t,e,r){if(t.length<e.length)return o.__absoluteAdd(e,t,r);if(0===t.length)return t;if(0===e.length)return t.sign===r?t:o.unaryMinus(t);var n=t.length;(0===t.__clzmsd()||e.length===t.length&&0===e.__clzmsd())&&n++;for(var i=new o(n,r),a=0,s=0;s<e.length;s++){var u=e.__digit(s),f=t.__digit(s),c=(65535&f)+(65535&u)+a,l=(f>>>16)+(u>>>16)+(c>>>16);a=l>>>16,i.__setDigit(s,65535&c|l<<16)}for(;s<t.length;s++){var h=t.__digit(s),d=(65535&h)+a,p=(h>>>16)+(d>>>16);a=p>>>16,i.__setDigit(s,65535&d|p<<16)}return s<i.length&&i.__setDigit(s,a),i.__trim()}},{key:"__absoluteSub",value:function(t,e,r){if(0===t.length)return t;if(0===e.length)return t.sign===r?t:o.unaryMinus(t);for(var n=new o(t.length,r),i=0,a=0;a<e.length;a++){var s=t.__digit(a),u=e.__digit(a),f=(65535&s)-(65535&u)-i,c=(s>>>16)-(u>>>16)-(i=1&f>>>16);i=1&c>>>16,n.__setDigit(a,65535&f|c<<16)}for(;a<t.length;a++){var l=t.__digit(a),h=(65535&l)-i,d=(l>>>16)-(i=1&h>>>16);i=1&d>>>16,n.__setDigit(a,65535&h|d<<16)}return n.__trim()}},{key:"__absoluteAddOne",value:function(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,n=t.length;null===r?r=new o(n,e):r.sign=e;for(var i,a=!0,s=0;s<n;s++){if(i=t.__digit(s),a){var u=-1===i;i=0|i+1,a=u}r.__setDigit(s,i)}return a&&r.__setDigitGrow(n,1),r}},{key:"__absoluteSubOne",value:function(t,e){for(var r,n=t.length,i=new o(e=e||n,!1),a=!0,s=0;s<n;s++){if(r=t.__digit(s),a){var u=0===r;r=0|r-1,a=u}i.__setDigit(s,r)}if(a)throw new Error("implementation bug");for(var f=n;f<e;f++)i.__setDigit(f,0);return i}},{key:"__absoluteAnd",value:function(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,n=t.length,i=e.length,a=i;if(n<i){a=n;var s=t,u=n;t=e,n=i,e=s,i=u}var f=a;null===r?r=new o(f,!1):f=r.length;for(var c=0;c<a;c++)r.__setDigit(c,t.__digit(c)&e.__digit(c));for(;c<f;c++)r.__setDigit(c,0);return r}},{key:"__absoluteAndNot",value:function(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,n=t.length,i=e.length,a=i;n<i&&(a=n);var s=n;null===r?r=new o(s,!1):s=r.length;for(var u=0;u<a;u++)r.__setDigit(u,t.__digit(u)&~e.__digit(u));for(;u<n;u++)r.__setDigit(u,t.__digit(u));for(;u<s;u++)r.__setDigit(u,0);return r}},{key:"__absoluteOr",value:function(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,n=t.length,i=e.length,a=i;if(n<i){a=n;var s=t,u=n;t=e,n=i,e=s,i=u}var f=n;null===r?r=new o(f,!1):f=r.length;for(var c=0;c<a;c++)r.__setDigit(c,t.__digit(c)|e.__digit(c));for(;c<n;c++)r.__setDigit(c,t.__digit(c));for(;c<f;c++)r.__setDigit(c,0);return r}},{key:"__absoluteXor",value:function(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,n=t.length,i=e.length,a=i;if(n<i){a=n;var s=t,u=n;t=e,n=i,e=s,i=u}var f=n;null===r?r=new o(f,!1):f=r.length;for(var c=0;c<a;c++)r.__setDigit(c,t.__digit(c)^e.__digit(c));for(;c<n;c++)r.__setDigit(c,t.__digit(c));for(;c<f;c++)r.__setDigit(c,0);return r}},{key:"__absoluteCompare",value:function(t,e){var r=t.length-e.length;if(0!=r)return r;for(var n=t.length-1;0<=n&&t.__digit(n)===e.__digit(n);)n--;return 0>n?0:t.__unsignedDigit(n)>e.__unsignedDigit(n)?1:-1}},{key:"__multiplyAccumulate",value:function(t,e,r,n){if(0!==e){for(var i=65535&e,a=e>>>16,s=0,u=0,f=0,c=0;c<t.length;c++,n++){var l=r.__digit(n),h=65535&l,d=l>>>16,p=t.__digit(c),g=65535&p,_=p>>>16,y=o.__imul(g,i),b=o.__imul(g,a),v=o.__imul(_,i),m=o.__imul(_,a);s=(u=(b>>>16)+(v>>>16)+(65535&m)+(s=(d+=f+s+((h+=u+(65535&y))>>>16)+(y>>>16)+(65535&b)+(65535&v))>>>16))>>>16,u&=65535,f=m>>>16,l=65535&h|d<<16,r.__setDigit(n,l)}for(;0!==s||0!==u||0!==f;n++){var w=r.__digit(n),E=(65535&w)+u,S=(w>>>16)+(E>>>16)+f+s;u=0,f=0,s=S>>>16,w=65535&E|S<<16,r.__setDigit(n,w)}}}},{key:"__internalMultiplyAdd",value:function(t,e,r,n,i){for(var a=r,s=0,u=0;u<n;u++){var f=t.__digit(u),c=o.__imul(65535&f,e),l=(65535&c)+s+a;a=l>>>16;var h=o.__imul(f>>>16,e),d=(65535&h)+(c>>>16)+a;a=d>>>16,s=h>>>16,i.__setDigit(u,d<<16|65535&l)}if(i.length>n)for(i.__setDigit(n++,a+s);n<i.length;)i.__setDigit(n++,0);else if(0!==a+s)throw new Error("implementation bug")}},{key:"__absoluteDivSmall",value:function(t,e,r){null===r&&(r=new o(t.length,!1));for(var n=0,i=2*t.length-1;0<=i;i-=2){var a=(n<<16|t.__halfDigit(i))>>>0,s=0|a/e,u=0|(a=((n=0|a%e)<<16|t.__halfDigit(i-1))>>>0)/e;n=0|a%e,r.__setDigit(i>>>1,s<<16|u)}return r}},{key:"__absoluteModSmall",value:function(t,e){for(var r=0,n=2*t.length-1;0<=n;n--)r=0|((r<<16|t.__halfDigit(n))>>>0)%e;return r}},{key:"__absoluteDivLarge",value:function(t,e,r,n){var i=e.__halfDigitLength(),a=e.length,s=t.__halfDigitLength()-i,u=null;r&&(u=new o(s+2>>>1,!1)).__initializeDigits();var f=new o(i+2>>>1,!1);f.__initializeDigits();var c=o.__clz16(e.__halfDigit(i-1));0<c&&(e=o.__specialLeftShift(e,c,0));for(var l=o.__specialLeftShift(t,c,1),h=e.__halfDigit(i-1),d=0,p=s;0<=p;p--){var g=65535,_=l.__halfDigit(p+i);if(_!==h){var y=(_<<16|l.__halfDigit(p+i-1))>>>0;g=0|y/h;for(var b=0|y%h,v=e.__halfDigit(i-2),m=l.__halfDigit(p+i-2);o.__imul(g,v)>>>0>(b<<16|m)>>>0&&(g--,!(65535<(b+=h))););}o.__internalMultiplyAdd(e,g,0,a,f);var w=l.__inplaceSub(f,p,i+1);0!==w&&(w=l.__inplaceAdd(e,p,i),l.__setHalfDigit(p+i,l.__halfDigit(p+i)+w),g--),r&&(1&p?d=g<<16:u.__setDigit(p>>>1,d|g))}return n?(l.__inplaceRightShift(c),r?{quotient:u,remainder:l}:l):r?u:void 0}},{key:"__clz16",value:function(t){return o.__clz32(t)-16}},{key:"__specialLeftShift",value:function(t,e,r){var n=t.length,i=new o(n+r,!1);if(0===e){for(var a=0;a<n;a++)i.__setDigit(a,t.__digit(a));return 0<r&&i.__setDigit(n,0),i}for(var s,u=0,f=0;f<n;f++)s=t.__digit(f),i.__setDigit(f,s<<e|u),u=s>>>32-e;return 0<r&&i.__setDigit(n,u),i}},{key:"__leftShiftByAbsolute",value:function(t,e){var r=o.__toShiftAmount(e);if(0>r)throw new RangeError("BigInt too big");var n=r>>>5,i=31&r,a=t.length,s=0!==i&&0!=t.__digit(a-1)>>>32-i,u=a+n+(s?1:0),f=new o(u,t.sign);if(0===i){for(var c=0;c<n;c++)f.__setDigit(c,0);for(;c<u;c++)f.__setDigit(c,t.__digit(c-n))}else{for(var l=0,h=0;h<n;h++)f.__setDigit(h,0);for(var d,p=0;p<a;p++)d=t.__digit(p),f.__setDigit(p+n,d<<i|l),l=d>>>32-i;if(s)f.__setDigit(a+n,l);else if(0!==l)throw new Error("implementation bug")}return f.__trim()}},{key:"__rightShiftByAbsolute",value:function(t,e){var r=t.length,n=t.sign,i=o.__toShiftAmount(e);if(0>i)return o.__rightShiftByMaximum(n);var a=i>>>5,s=31&i,u=r-a;if(0>=u)return o.__rightShiftByMaximum(n);var f=!1;if(n)if(0!=(t.__digit(a)&(1<<s)-1))f=!0;else for(var c=0;c<a;c++)if(0!==t.__digit(c)){f=!0;break}f&&0===s&&0==~t.__digit(r-1)&&u++;var l=new o(u,n);if(0===s)for(var h=a;h<r;h++)l.__setDigit(h-a,t.__digit(h));else{for(var d,p=t.__digit(a)>>>s,g=r-a-1,_=0;_<g;_++)d=t.__digit(_+a+1),l.__setDigit(_,d<<32-s|p),p=d>>>s;l.__setDigit(g,p)}return f&&(l=o.__absoluteAddOne(l,!0,l)),l.__trim()}},{key:"__rightShiftByMaximum",value:function(t){return t?o.__oneDigit(1,!0):o.__zero()}},{key:"__toShiftAmount",value:function(t){if(1<t.length)return-1;var e=t.__unsignedDigit(0);return e>o.__kMaxLengthBits?-1:e}},{key:"__toPrimitive",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"default";if("object"!==r(t))return t;if(t.constructor===o)return t;var n=t[Symbol.toPrimitive];if(n){var i=n(e);if("object"!==r(i))return i;throw new TypeError("Cannot convert object to primitive value")}var a=t.valueOf;if(a){var s=a.call(t);if("object"!==r(s))return s}var u=t.toString;if(u){var f=u.call(t);if("object"!==r(f))return f}throw new TypeError("Cannot convert object to primitive value")}},{key:"__toNumeric",value:function(t){return o.__isBigInt(t)?t:+t}},{key:"__isBigInt",value:function(t){return"object"===r(t)&&null!==t&&t.constructor===o}},{key:"__truncateToNBits",value:function(t,e){for(var r=t+31>>>5,n=new o(r,e.sign),i=r-1,a=0;a<i;a++)n.__setDigit(a,e.__digit(a));var s=e.__digit(i);if(0!=(31&t)){var u=32-(31&t);s=s<<u>>>u}return n.__setDigit(i,s),n.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(t,e,r){for(var n=Math.min,i=t+31>>>5,a=new o(i,r),s=0,u=i-1,f=0,c=n(u,e.length);s<c;s++){var l=e.__digit(s),h=0-(65535&l)-f,d=0-(l>>>16)-(f=1&h>>>16);f=1&d>>>16,a.__setDigit(s,65535&h|d<<16)}for(;s<u;s++)a.__setDigit(s,0|-f);var p,g=u<e.length?e.__digit(u):0,_=31&t;if(0===_){var y=0-(65535&g)-f;p=65535&y|0-(g>>>16)-(f=1&y>>>16)<<16}else{var b=32-_,v=1<<32-b,m=(65535&v)-(65535&(g=g<<b>>>b))-f;p=65535&m|(v>>>16)-(g>>>16)-(f=1&m>>>16)<<16,p&=v-1}return a.__setDigit(u,p),a.__trim()}},{key:"__digitPow",value:function(t,e){for(var r=1;0<e;)1&e&&(r*=t),e>>>=1,t*=t;return r}}]),o}(f(Array));return p.__kMaxLength=33554432,p.__kMaxLengthBits=p.__kMaxLength<<5,p.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],p.__kBitsPerCharTableShift=5,p.__kBitsPerCharTableMultiplier=1<<p.__kBitsPerCharTableShift,p.__kConversionChars=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],p.__kBitConversionBuffer=new ArrayBuffer(8),p.__kBitConversionDouble=new Float64Array(p.__kBitConversionBuffer),p.__kBitConversionInts=new Int32Array(p.__kBitConversionBuffer),p.__clz32=e||function(t){var e=Math.LN2,r=Math.log;return 0===t?32:0|31-(0|r(t>>>0)/e)},p.__imul=t||function(t,e){return 0|t*e},p}()},function(t,e){function r(t,e,r){"use strict";this.alias=[],this.prob=[],this.outcomes=e||this.indexedOutcomes(t.length),this.rng=r||Math.random,this.precomputeAlias(t)}r.prototype.next=function(t){"use strict";var e=t||1,r=[],n=0;do{var i=Math.floor(this.rng()*this.prob.length);r[n]=this.outcomes[this.rng()<this.prob[i]?i:this.alias[i]]}while(++n<e);return e>1?r:r[0]},r.prototype.precomputeAlias=function(t){"use strict";var e,r,n,i=t.length,o=0,a=0,s=0,u=[],f=[],c=[];for(r=0;r<i;++r){if(t[r]<0)throw"Probability must be a positive: p["+r+"]="+t[r];o+=t[r]}if(0===o)throw"Probability cannot be zero.";for(r=0;r<i;++r)u[r]=t[r]*i/o;for(r=i-1;r>=0;--r)u[r]<1?f[a++]=r:c[s++]=r;for(;a&&s;)n=f[--a],e=c[--s],this.prob[n]=u[n],this.alias[n]=e,u[e]=u[e]+u[n]-1,u[e]<1?f[a++]=e:c[s++]=e;for(;s;)this.prob[c[--s]]=1;for(;a;)this.prob[f[--a]]=1},r.prototype.indexedOutcomes=function(t){"use strict";for(var e=[],r=0;r<t;r++)e[r]=r;return e},r.prototype.randomInt=function(t,e){"use strict";return Math.floor(this.rng()*(e-t))+t},t.exports=function(t,e,n){"use strict";return new r(t,e,n)}},function(t,e,r){"use strict";(function(t){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=n(r(100)),o=n(r(55)),a=n(r(24)),s=r(12),u=r(31),f=n(r(51)),c=r(53);class l{constructor(t=new i.default,e="bytes"){this.fountainDecoder=t,this.type=e,a.default(s.isURType(e),"Invalid UR type"),this.expected_type=""}static decodeBody(e,r){const n=o.default.decode(r,o.default.STYLES.MINIMAL);return new f.default(t.from(n,"hex"),e)}validatePart(t){return this.expected_type?this.expected_type===t:!!s.isURType(t)&&(this.expected_type=t,!0)}static decode(t){const[e,r]=this.parse(t);if(0===r.length)throw new u.InvalidPathLengthError;const n=r[0];return l.decodeBody(e,n)}static parse(t){const e=t.toLowerCase();if("ur:"!==e.slice(0,3))throw new u.InvalidSchemeError;const r=e.slice(3).split("/"),n=r[0];if(r.length<2)throw new u.InvalidPathLengthError;if(!s.isURType(n))throw new u.InvalidTypeError;return[n,r.slice(1)]}static parseSequenceComponent(t){const e=t.split("-");if(2!==e.length)throw new u.InvalidSequenceComponentError;const r=s.toUint32(Number(e[0])),n=Number(e[1]);if(r<1||n<1)throw new u.InvalidSequenceComponentError;return[r,n]}receivePart(t){if(void 0!==this.result)return!1;const[e,r]=l.parse(t);if(!this.validatePart(e))return!1;if(1===r.length)return this.result=l.decodeBody(e,r[0]),!0;if(2!==r.length)throw new u.InvalidPathLengthError;const[n,i]=r,[a,s]=l.parseSequenceComponent(n),h=o.default.decode(i,o.default.STYLES.MINIMAL),d=c.FountainEncoderPart.fromCBOR(h);return a===d.seqNum&&s===d.seqLength&&(!!this.fountainDecoder.receivePart(d)&&(this.fountainDecoder.isSuccess()?this.result=new f.default(this.fountainDecoder.resultMessage(),e):this.fountainDecoder.isFailure()&&(this.error=new u.InvalidSchemeError),!0))}resultUR(){return this.result?this.result:new f.default(t.from([]))}isComplete(){return this.result&&this.result.cbor.length>0}isSuccess(){return!this.error&&this.isComplete()}isError(){return void 0!==this.error}resultError(){return this.error?this.error.message:""}expectedPartCount(){return this.fountainDecoder.expectedPartCount()}expectedPartIndexes(){return this.fountainDecoder.getExpectedPartIndexes()}receivedPartIndexes(){return this.fountainDecoder.getReceivedPartIndexes()}lastPartIndexes(){return this.fountainDecoder.getLastPartIndexes()}estimatedPercentComplete(){return this.fountainDecoder.estimatedPercentComplete()}getProgress(){return this.fountainDecoder.getProgress()}}e.default=l}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.FountainDecoderPart=void 0;const n=r(12),i=r(54),o=r(31);class a{constructor(t,e){this._indexes=t,this._fragment=e}get indexes(){return this._indexes}get fragment(){return this._fragment}static fromEncoderPart(t){const e=i.chooseFragments(t.seqNum,t.seqLength,t.checksum),r=t.fragment;return new a(e,r)}isSimple(){return 1===this.indexes.length}}e.FountainDecoderPart=a;class s{constructor(){this.result=void 0,this.expectedMessageLength=0,this.expectedChecksum=0,this.expectedFragmentLength=0,this.processedPartsCount=0,this.expectedPartIndexes=[],this.lastPartIndexes=[],this.queuedParts=[],this.receivedPartIndexes=[],this.mixedParts=[],this.simpleParts=[]}validatePart(t){if(0===this.expectedPartIndexes.length)[...new Array(t.seqLength)].forEach((t,e)=>this.expectedPartIndexes.push(e)),this.expectedMessageLength=t.messageLength,this.expectedChecksum=t.checksum,this.expectedFragmentLength=t.fragment.length;else{if(this.expectedPartIndexes.length!==t.seqLength)return!1;if(this.expectedMessageLength!==t.messageLength)return!1;if(this.expectedChecksum!==t.checksum)return!1;if(this.expectedFragmentLength!==t.fragment.length)return!1}return!0}reducePartByPart(t,e){if(n.arrayContains(t.indexes,e.indexes)){const r=n.setDifference(t.indexes,e.indexes),i=n.bufferXOR(t.fragment,e.fragment);return new a(r,i)}return t}reduceMixedBy(t){const e=[];this.mixedParts.map(({value:e})=>this.reducePartByPart(e,t)).forEach(t=>{t.isSimple()?this.queuedParts.push(t):e.push({key:t.indexes,value:t})}),this.mixedParts=e}processSimplePart(t){const e=t.indexes[0];if(!this.receivedPartIndexes.includes(e))if(this.simpleParts.push({key:t.indexes,value:t}),this.receivedPartIndexes.push(e),n.arraysEqual(this.receivedPartIndexes,this.expectedPartIndexes)){const t=this.simpleParts.map(({value:t})=>t).sort((t,e)=>t.indexes[0]-e.indexes[0]),e=s.joinFragments(t.map(t=>t.fragment),this.expectedMessageLength);n.getCRC(e)===this.expectedChecksum?this.result=e:this.error=new o.InvalidChecksumError}else this.reduceMixedBy(t)}processMixedPart(t){if(this.mixedParts.some(({key:e})=>n.arraysEqual(e,t.indexes)))return;let e=this.simpleParts.reduce((t,{value:e})=>this.reducePartByPart(t,e),t);e=this.mixedParts.reduce((t,{value:e})=>this.reducePartByPart(t,e),e),e.isSimple()?this.queuedParts.push(e):(this.reduceMixedBy(e),this.mixedParts.push({key:e.indexes,value:e}))}processQueuedItem(){if(0===this.queuedParts.length)return;const t=this.queuedParts.shift();t.isSimple()?this.processSimplePart(t):this.processMixedPart(t)}receivePart(t){if(this.isComplete())return!1;if(!this.validatePart(t))return!1;const e=a.fromEncoderPart(t);for(this.lastPartIndexes=e.indexes,this.queuedParts.push(e);!this.isComplete()&&this.queuedParts.length>0;)this.processQueuedItem();return this.processedPartsCount+=1,!0}isComplete(){return Boolean(void 0!==this.result&&this.result.length>0)}isSuccess(){return Boolean(void 0===this.error&&this.isComplete())}resultMessage(){return this.isSuccess()?this.result:t.from([])}isFailure(){return void 0!==this.error}resultError(){return this.error?this.error.message:""}expectedPartCount(){return this.expectedPartIndexes.length}getExpectedPartIndexes(){return[...this.expectedPartIndexes]}getReceivedPartIndexes(){return[...this.receivedPartIndexes]}getLastPartIndexes(){return[...this.lastPartIndexes]}estimatedPercentComplete(){if(this.isComplete())return 1;const t=this.expectedPartCount();return 0===t?0:Math.min(.99,this.processedPartsCount/(1.75*t))}getProgress(){if(this.isComplete())return 1;const t=this.expectedPartCount();return 0===t?0:this.receivedPartIndexes.length/t}}e.default=s,s.joinFragments=(e,r)=>t.concat(e).slice(0,r)}).call(this,r(0).Buffer)},function(t,e,r){"use strict";r.r(e),r.d(e,"crc1",(function(){return a})),r.d(e,"crc8",(function(){return u})),r.d(e,"crc81wire",(function(){return c})),r.d(e,"crc16",(function(){return h})),r.d(e,"crc16ccitt",(function(){return p})),r.d(e,"crc16modbus",(function(){return _})),r.d(e,"crc16xmodem",(function(){return y})),r.d(e,"crc16kermit",(function(){return v})),r.d(e,"crc24",(function(){return w})),r.d(e,"crc32",(function(){return S})),r.d(e,"crcjam",(function(){return B}));var n=r(0);var i=n.Buffer.from&&n.Buffer.alloc&&n.Buffer.allocUnsafe&&n.Buffer.allocUnsafeSlow?n.Buffer.from:t=>new n.Buffer(t),o=function(t,e){const r=(t,r)=>e(t,r)>>>0;return r.signed=e,r.unsigned=r,r.model=t,r};var a=o("crc1",(function(t,e){n.Buffer.isBuffer(t)||(t=i(t));let r=~~e,o=0;for(let e=0;e<t.length;e++){o+=t[e]}return r+=o%256,r%256}));let s=[0,7,14,9,28,27,18,21,56,63,54,49,36,35,42,45,112,119,126,121,108,107,98,101,72,79,70,65,84,83,90,93,224,231,238,233,252,251,242,245,216,223,214,209,196,195,202,205,144,151,158,153,140,139,130,133,168,175,166,161,180,179,186,189,199,192,201,206,219,220,213,210,255,248,241,246,227,228,237,234,183,176,185,190,171,172,165,162,143,136,129,134,147,148,157,154,39,32,41,46,59,60,53,50,31,24,17,22,3,4,13,10,87,80,89,94,75,76,69,66,111,104,97,102,115,116,125,122,137,142,135,128,149,146,155,156,177,182,191,184,173,170,163,164,249,254,247,240,229,226,235,236,193,198,207,200,221,218,211,212,105,110,103,96,117,114,123,124,81,86,95,88,77,74,67,68,25,30,23,16,5,2,11,12,33,38,47,40,61,58,51,52,78,73,64,71,82,85,92,91,118,113,120,127,106,109,100,99,62,57,48,55,34,37,44,43,6,1,8,15,26,29,20,19,174,169,160,167,178,181,188,187,150,145,152,159,138,141,132,131,222,217,208,215,194,197,204,203,230,225,232,239,250,253,244,243];"undefined"!=typeof Int32Array&&(s=new Int32Array(s));var u=o("crc-8",(function(t,e){n.Buffer.isBuffer(t)||(t=i(t));let r=~~e;for(let e=0;e<t.length;e++){const n=t[e];r=255&s[255&(r^n)]}return r}));let f=[0,94,188,226,97,63,221,131,194,156,126,32,163,253,31,65,157,195,33,127,252,162,64,30,95,1,227,189,62,96,130,220,35,125,159,193,66,28,254,160,225,191,93,3,128,222,60,98,190,224,2,92,223,129,99,61,124,34,192,158,29,67,161,255,70,24,250,164,39,121,155,197,132,218,56,102,229,187,89,7,219,133,103,57,186,228,6,88,25,71,165,251,120,38,196,154,101,59,217,135,4,90,184,230,167,249,27,69,198,152,122,36,248,166,68,26,153,199,37,123,58,100,134,216,91,5,231,185,140,210,48,110,237,179,81,15,78,16,242,172,47,113,147,205,17,79,173,243,112,46,204,146,211,141,111,49,178,236,14,80,175,241,19,77,206,144,114,44,109,51,209,143,12,82,176,238,50,108,142,208,83,13,239,177,240,174,76,18,145,207,45,115,202,148,118,40,171,245,23,73,8,86,180,234,105,55,213,139,87,9,235,181,54,104,138,212,149,203,41,119,244,170,72,22,233,183,85,11,136,214,52,106,43,117,151,201,74,20,246,168,116,42,200,150,21,75,169,247,182,232,10,84,215,137,107,53];"undefined"!=typeof Int32Array&&(f=new Int32Array(f));var c=o("dallas-1-wire",(function(t,e){n.Buffer.isBuffer(t)||(t=i(t));let r=~~e;for(let e=0;e<t.length;e++){const n=t[e];r=255&f[255&(r^n)]}return r}));let l=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];"undefined"!=typeof Int32Array&&(l=new Int32Array(l));var h=o("crc-16",(function(t,e){n.Buffer.isBuffer(t)||(t=i(t));let r=~~e;for(let e=0;e<t.length;e++){const n=t[e];r=65535&(l[255&(r^n)]^r>>8)}return r}));let d=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920];"undefined"!=typeof Int32Array&&(d=new Int32Array(d));var p=o("ccitt",(function(t,e){n.Buffer.isBuffer(t)||(t=i(t));let r=void 0!==e?~~e:65535;for(let e=0;e<t.length;e++){const n=t[e];r=65535&(d[255&(r>>8^n)]^r<<8)}return r}));let g=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];"undefined"!=typeof Int32Array&&(g=new Int32Array(g));var _=o("crc-16-modbus",(function(t,e){n.Buffer.isBuffer(t)||(t=i(t));let r=void 0!==e?~~e:65535;for(let e=0;e<t.length;e++){const n=t[e];r=65535&(g[255&(r^n)]^r>>8)}return r}));var y=o("xmodem",(function(t,e){n.Buffer.isBuffer(t)||(t=i(t));let r=void 0!==e?~~e:0;for(let e=0;e<t.length;e++){let n=r>>>8&255;n^=255&t[e],n^=n>>>4,r=r<<8&65535,r^=n,n=n<<5&65535,r^=n,n=n<<7&65535,r^=n}return r}));let b=[0,4489,8978,12955,17956,22445,25910,29887,35912,40385,44890,48851,51820,56293,59774,63735,4225,264,13203,8730,22181,18220,30135,25662,40137,36160,49115,44626,56045,52068,63999,59510,8450,12427,528,5017,26406,30383,17460,21949,44362,48323,36440,40913,60270,64231,51324,55797,12675,8202,4753,792,30631,26158,21685,17724,48587,44098,40665,36688,64495,60006,55549,51572,16900,21389,24854,28831,1056,5545,10034,14011,52812,57285,60766,64727,34920,39393,43898,47859,21125,17164,29079,24606,5281,1320,14259,9786,57037,53060,64991,60502,39145,35168,48123,43634,25350,29327,16404,20893,9506,13483,1584,6073,61262,65223,52316,56789,43370,47331,35448,39921,29575,25102,20629,16668,13731,9258,5809,1848,65487,60998,56541,52564,47595,43106,39673,35696,33800,38273,42778,46739,49708,54181,57662,61623,2112,6601,11090,15067,20068,24557,28022,31999,38025,34048,47003,42514,53933,49956,61887,57398,6337,2376,15315,10842,24293,20332,32247,27774,42250,46211,34328,38801,58158,62119,49212,53685,10562,14539,2640,7129,28518,32495,19572,24061,46475,41986,38553,34576,62383,57894,53437,49460,14787,10314,6865,2904,32743,28270,23797,19836,50700,55173,58654,62615,32808,37281,41786,45747,19012,23501,26966,30943,3168,7657,12146,16123,54925,50948,62879,58390,37033,33056,46011,41522,23237,19276,31191,26718,7393,3432,16371,11898,59150,63111,50204,54677,41258,45219,33336,37809,27462,31439,18516,23005,11618,15595,3696,8185,63375,58886,54429,50452,45483,40994,37561,33584,31687,27214,22741,18780,15843,11370,7921,3960];"undefined"!=typeof Int32Array&&(b=new Int32Array(b));var v=o("kermit",(function(t,e){n.Buffer.isBuffer(t)||(t=i(t));let r=void 0!==e?~~e:0;for(let e=0;e<t.length;e++){const n=t[e];r=65535&(b[255&(r^n)]^r>>8)}return r}));let m=[0,8801531,9098509,825846,9692897,1419802,1651692,10452759,10584377,2608578,2839604,11344079,3303384,11807523,12104405,4128302,12930697,4391538,5217156,13227903,5679208,13690003,14450021,5910942,6606768,14844747,15604413,6837830,16197969,7431594,8256604,16494759,840169,9084178,8783076,18463,10434312,1670131,1434117,9678590,11358416,2825259,2590173,10602790,4109873,12122826,11821884,3289031,13213536,5231515,4409965,12912278,5929345,14431610,13675660,5693559,6823513,15618722,14863188,6588335,16513208,8238147,7417269,16212302,1680338,10481449,9664223,1391140,9061683,788936,36926,8838341,12067563,4091408,3340262,11844381,2868234,11372785,10555655,2579964,14478683,5939616,5650518,13661357,5180346,13190977,12967607,4428364,8219746,16457881,16234863,7468436,15633027,6866552,6578062,14816117,1405499,9649856,10463030,1698765,8819930,55329,803287,9047340,11858690,3325945,4072975,12086004,2561507,10574104,11387118,2853909,13647026,5664841,5958079,14460228,4446803,12949160,13176670,5194661,7454091,16249200,16476294,8201341,14834538,6559633,6852199,15647388,3360676,11864927,12161705,4185682,10527045,2551230,2782280,11286707,9619101,1346150,1577872,10379115,73852,8875143,9172337,899466,16124205,7357910,8182816,16421083,6680524,14918455,15678145,6911546,5736468,13747439,14507289,5968354,12873461,4334094,5159928,13170435,4167245,12180150,11879232,3346363,11301036,2767959,2532769,10545498,10360692,1596303,1360505,9604738,913813,9157998,8856728,92259,16439492,8164415,7343561,16138546,6897189,15692510,14936872,6662099,5986813,14488838,13733104,5750795,13156124,5174247,4352529,12855018,2810998,11315341,10498427,2522496,12124823,4148844,3397530,11901793,9135439,862644,110658,8912057,1606574,10407765,9590435,1317464,15706879,6940164,6651890,14889737,8145950,16384229,16161043,7394792,5123014,13133629,12910283,4370992,14535975,5997020,5707818,13718737,2504095,10516836,11329682,2796649,11916158,3383173,4130419,12143240,8893606,129117,876971,9121104,1331783,9576124,10389322,1625009,14908182,6633453,6925851,15721184,7380471,16175372,16402682,8127489,4389423,12891860,13119266,5137369,13704398,5722165,6015427,14517560];"undefined"!=typeof Int32Array&&(m=new Int32Array(m));var w=o("crc-24",(function(t,e){n.Buffer.isBuffer(t)||(t=i(t));let r=void 0!==e?~~e:11994318;for(let e=0;e<t.length;e++){const n=t[e];r=16777215&(m[255&(r>>16^n)]^r<<8)}return r}));let E=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];"undefined"!=typeof Int32Array&&(E=new Int32Array(E));var S=o("crc-32",(function(t,e){n.Buffer.isBuffer(t)||(t=i(t));let r=0===e?0:-1^~~e;for(let e=0;e<t.length;e++){const n=t[e];r=E[255&(r^n)]^r>>>8}return-1^r}));let O=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];"undefined"!=typeof Int32Array&&(O=new Int32Array(O));var B=o("jam",(function(t,e=-1){n.Buffer.isBuffer(t)||(t=i(t));let r=0===e?0:~~e;for(let e=0;e<t.length;e++){const n=t[e];r=O[255&(r^n)]^r>>>8}return r}));e.default={crc1:a,crc8:u,crc81wire:c,crc16:h,crc16ccitt:p,crc16modbus:_,crc16xmodem:y,crc16kermit:v,crc24:w,crc32:S,crcjam:B}}])})); |