@teleportdao/bitcoin 1.5.5 → 1.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js CHANGED
@@ -8,10 +8,10 @@
8
8
  var n=r(155),i=r(156),o=r(88);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return c(this,e,t,r)}function c(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=d(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,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(t,r),i=(e=s(e,n)).write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(u.isBuffer(t)){var r=0|h(t.length);return 0===(e=s(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?s(e,0):d(e,t);if("Buffer"===t.type&&o(t.data))return d(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t){if(f(t),e=s(e,t<0?0:0|h(t)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function d(e,t){var r=t.length<0?0:0|h(t.length);e=s(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function h(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return L(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return D(e).length;default:if(n)return L(e).length;t=(""+t).toLowerCase(),n=!0}}function b(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return T(this,t,r);case"ascii":return A(this,t,r);case"latin1":case"binary":return P(this,t,r);case"base64":return x(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=r;o<s;o++)if(c(e,o)===c(t,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*a}else-1!==f&&(o-=o-f),f=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){for(var l=!0,d=0;d<u;d++)if(c(e,o+d)!==c(t,d)){l=!1;break}if(l)return o}return-1}function v(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.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(t.substr(2*a,2),16);if(isNaN(s))return a;e[r+a]=s}return a}function w(e,t,r,n){return F(L(t,e.length-r),e,r,n)}function _(e,t,r,n){return F(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return _(e,t,r,n)}function k(e,t,r,n){return F(D(t),e,r,n)}function S(e,t,r,n){return F(function(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function x(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function T(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,s,u,c=e[i],f=null,l=c>239?4:c>223?3:c>191?2:1;if(i+l<=r)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(f=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,r){return c(null,e,t,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(e,t,r){return function(e,t,r,n){return f(t),t<=0?s(e,t):void 0!==r?"string"==typeof n?s(e,t).fill(r,n):s(e,t).fill(r):s(e,t)}(null,e,t,r)},u.allocUnsafe=function(e){return l(null,e)},u.allocUnsafeSlow=function(e){return l(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var a=e[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 e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?T(this,0,e):b.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,r,n,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),c=this.slice(n,i),f=e.slice(t,r),l=0;l<s;++l)if(c[l]!==f[l]){o=c[l],a=f[l];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return _(this,e,t,r);case"latin1":case"binary":return E(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function P(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function O(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=z(e[o]);return i}function I(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function B(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function R(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function N(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function j(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(e,t,r,n,o){return o||j(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function C(e,t,r,n,o){return o||j(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;r=new u(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},u.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||B(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||B(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUInt8=function(e,t){return t||B(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||B(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||B(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||B(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||B(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||B(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){t||B(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||B(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||B(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||B(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||B(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||M(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||M(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);M(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);M(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return U(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return U(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return C(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return C(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=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 e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var a=u.isBuffer(e)?e:L(new u(e,n).toString()),s=a.length;for(o=0;o<r-t;++o)this[o+t]=a[o%s]}return this};var H=/[^+\/0-9A-Za-z-_]/g;function z(e){return e<16?"0"+e.toString(16):e.toString(16)}function L(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function D(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(H,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(17))},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(272),i=r(273),o=r(16),a=r(125),s=r(25),u=r(275),c=r(3);t.OPS=r(80);const f=r(276),l=t.OPS.OP_RESERVED;function d(e){return o.Buffer(e)||function(e){return o.Number(e)&&(e===t.OPS.OP_0||e>=t.OPS.OP_1&&e<=t.OPS.OP_16||e===t.OPS.OP_1NEGATE)}(e)}function h(e){return o.Array(e)&&e.every(d)}function p(e){return 0===e.length?t.OPS.OP_0:1===e.length?e[0]>=1&&e[0]<=16?l+e[0]:129===e[0]?t.OPS.OP_1NEGATE:void 0:void 0}function b(t){return e.isBuffer(t)}function m(t){return e.isBuffer(t)}function g(t){if(b(t))return t;c(o.Array,t);const r=t.reduce((e,t)=>m(t)?1===t.length&&void 0!==p(t)?e+1:e+u.encodingLength(t.length)+t.length:e+1,0),n=e.allocUnsafe(r);let i=0;if(t.forEach(e=>{if(m(e)){const t=p(e);if(void 0!==t)return n.writeUInt8(t,i),void(i+=1);i+=u.encode(n,e.length,i),e.copy(n,i),i+=e.length}else n.writeUInt8(e,i),i+=1}),i!==n.length)throw new Error("Could not decode chunks");return n}function y(e){if(r=e,o.Array(r))return e;var r;c(o.Buffer,e);const n=[];let i=0;for(;i<e.length;){const r=e[i];if(r>t.OPS.OP_0&&r<=t.OPS.OP_PUSHDATA4){const t=u.decode(e,i);if(null===t)return null;if(i+=t.size,i+t.number>e.length)return null;const r=e.slice(i,i+t.number);i+=t.number;const o=p(r);void 0!==o?n.push(o):n.push(r)}else n.push(r),i+=1}return n}function v(e){const t=-129&e;return t>0&&t<4}t.isPushOnly=h,t.compile=g,t.decompile=y,t.toASM=function(e){return b(e)&&(e=y(e)),e.map(e=>{if(m(e)){const t=p(e);if(void 0===t)return e.toString("hex");e=t}return f[e]}).join(" ")},t.fromASM=function(r){return c(o.String,r),g(r.split(" ").map(r=>void 0!==t.OPS[r]?t.OPS[r]:(c(o.Hex,r),e.from(r,"hex"))))},t.toStack=function(r){return r=y(r),c(h,r),r.map(r=>m(r)?r:r===t.OPS.OP_0?e.allocUnsafe(0):n.encode(r-l))},t.isCanonicalPubKey=function(e){return s.isPoint(e)},t.isDefinedHashType=v,t.isCanonicalScriptSignature=function(t){return!!e.isBuffer(t)&&(!!v(t[t.length-1])&&a.check(t.slice(0,-1)))},t.number=n,t.signature=i}).call(this,r(0).Buffer)},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},function(e,t,r){var n=r(91),i=r(59),o=n.tfJSON,a=n.TfTypeError,s=n.TfPropertyTypeError,u=n.tfSubError,c=n.getValueTypeName,f={arrayOf:function(e,t){function r(r,n){return!!i.Array(r)&&(!i.Nil(r)&&(!(void 0!==t.minLength&&r.length<t.minLength)&&(!(void 0!==t.maxLength&&r.length>t.maxLength)&&((void 0===t.length||r.length===t.length)&&r.every((function(t,r){try{return d(e,t,n)}catch(e){throw u(e,r)}}))))))}return e=l(e),t=t||{},r.toJSON=function(){var r="["+o(e)+"]";return void 0!==t.length?r+="{"+t.length+"}":void 0===t.minLength&&void 0===t.maxLength||(r+="{"+(void 0===t.minLength?0:t.minLength)+","+(void 0===t.maxLength?1/0:t.maxLength)+"}"),r},r},maybe:function e(t){function r(r,n){return i.Nil(r)||t(r,n,e)}return t=l(t),r.toJSON=function(){return"?"+o(t)},r},map:function(e,t){function r(r,n){if(!i.Object(r))return!1;if(i.Nil(r))return!1;for(var o in r){try{t&&d(t,o,n)}catch(e){throw u(e,o,"key")}try{var a=r[o];d(e,a,n)}catch(e){throw u(e,o)}}return!0}return e=l(e),t&&(t=l(t)),r.toJSON=t?function(){return"{"+o(t)+": "+o(e)+"}"}:function(){return"{"+o(e)+"}"},r},object:function(e){var t={};for(var r in e)t[r]=l(e[r]);function n(e,r){if(!i.Object(e))return!1;if(i.Nil(e))return!1;var n;try{for(n in t){d(t[n],e[n],r)}}catch(e){throw u(e,n)}if(r)for(n in e)if(!t[n])throw new s(void 0,n);return!0}return n.toJSON=function(){return o(t)},n},anyOf:function(){var e=[].slice.call(arguments).map(l);function t(t,r){return e.some((function(e){try{return d(e,t,r)}catch(e){return!1}}))}return t.toJSON=function(){return e.map(o).join("|")},t},allOf:function(){var e=[].slice.call(arguments).map(l);function t(t,r){return e.every((function(e){try{return d(e,t,r)}catch(e){return!1}}))}return t.toJSON=function(){return e.map(o).join(" & ")},t},quacksLike:function(e){function t(t){return e===c(t)}return t.toJSON=function(){return e},t},tuple:function(){var e=[].slice.call(arguments).map(l);function t(t,r){return!i.Nil(t)&&(!i.Nil(t.length)&&((!r||t.length===e.length)&&e.every((function(e,n){try{return d(e,t[n],r)}catch(e){throw u(e,n)}}))))}return t.toJSON=function(){return"("+e.map(o).join(", ")+")"},t},value:function(e){function t(t){return t===e}return t.toJSON=function(){return e},t}};function l(e){if(i.String(e))return"?"===e[0]?f.maybe(e.slice(1)):i[e]||f.quacksLike(e);if(e&&i.Object(e)){if(i.Array(e)){if(1!==e.length)throw new TypeError("Expected compile() parameter of type Array of length 1");return f.arrayOf(e[0])}return f.object(e)}return i.Function(e)?e:f.value(e)}function d(e,t,r,n){if(i.Function(e)){if(e(t,r))return!0;throw new a(n||e,t)}return d(l(e),t,r)}for(var h in f.oneOf=f.anyOf,i)d[h]=i[h];for(h in f)d[h]=f[h];var p=r(161);for(h in p)d[h]=p[h];d.compile=l,d.TfTypeError=a,d.TfPropertyTypeError=s,e.exports=d},function(e,t,r){
9
9
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
10
10
  var n=r(0),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.UNSIGNED_TX=0]="UNSIGNED_TX",e[e.GLOBAL_XPUB=1]="GLOBAL_XPUB"}(t.GlobalTypes||(t.GlobalTypes={})),t.GLOBAL_TYPE_NAMES=["unsignedTx","globalXpub"],function(e){e[e.NON_WITNESS_UTXO=0]="NON_WITNESS_UTXO",e[e.WITNESS_UTXO=1]="WITNESS_UTXO",e[e.PARTIAL_SIG=2]="PARTIAL_SIG",e[e.SIGHASH_TYPE=3]="SIGHASH_TYPE",e[e.REDEEM_SCRIPT=4]="REDEEM_SCRIPT",e[e.WITNESS_SCRIPT=5]="WITNESS_SCRIPT",e[e.BIP32_DERIVATION=6]="BIP32_DERIVATION",e[e.FINAL_SCRIPTSIG=7]="FINAL_SCRIPTSIG",e[e.FINAL_SCRIPTWITNESS=8]="FINAL_SCRIPTWITNESS",e[e.POR_COMMITMENT=9]="POR_COMMITMENT",e[e.TAP_KEY_SIG=19]="TAP_KEY_SIG",e[e.TAP_SCRIPT_SIG=20]="TAP_SCRIPT_SIG",e[e.TAP_LEAF_SCRIPT=21]="TAP_LEAF_SCRIPT",e[e.TAP_BIP32_DERIVATION=22]="TAP_BIP32_DERIVATION",e[e.TAP_INTERNAL_KEY=23]="TAP_INTERNAL_KEY",e[e.TAP_MERKLE_ROOT=24]="TAP_MERKLE_ROOT"}(t.InputTypes||(t.InputTypes={})),t.INPUT_TYPE_NAMES=["nonWitnessUtxo","witnessUtxo","partialSig","sighashType","redeemScript","witnessScript","bip32Derivation","finalScriptSig","finalScriptWitness","porCommitment","tapKeySig","tapScriptSig","tapLeafScript","tapBip32Derivation","tapInternalKey","tapMerkleRoot"],function(e){e[e.REDEEM_SCRIPT=0]="REDEEM_SCRIPT",e[e.WITNESS_SCRIPT=1]="WITNESS_SCRIPT",e[e.BIP32_DERIVATION=2]="BIP32_DERIVATION",e[e.TAP_INTERNAL_KEY=5]="TAP_INTERNAL_KEY",e[e.TAP_TREE=6]="TAP_TREE",e[e.TAP_BIP32_DERIVATION=7]="TAP_BIP32_DERIVATION"}(t.OutputTypes||(t.OutputTypes={})),t.OUTPUT_TYPE_NAMES=["redeemScript","witnessScript","bip32Derivation","tapInternalKey","tapTree","tapBip32Derivation"]},function(e,t,r){"use strict";var n,i=r(132),o=Object.prototype.toString,a=(n=Object.create(null),function(e){var t=o.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())});function s(e){return e=e.toLowerCase(),function(t){return a(t)===e}}function u(e){return Array.isArray(e)}function c(e){return void 0===e}var f=s("ArrayBuffer");function l(e){return null!==e&&"object"==typeof e}function d(e){if("object"!==a(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var h=s("Date"),p=s("File"),b=s("Blob"),m=s("FileList");function g(e){return"[object Function]"===o.call(e)}var y=s("URLSearchParams");function v(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),u(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var w,_=(w="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return w&&e instanceof w});e.exports={isArray:u,isArrayBuffer:f,isBuffer:function(e){return null!==e&&!c(e)&&null!==e.constructor&&!c(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return e&&("function"==typeof FormData&&e instanceof FormData||"[object FormData]"===o.call(e)||g(e.toString)&&"[object FormData]"===e.toString())},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&f(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:l,isPlainObject:d,isUndefined:c,isDate:h,isFile:p,isBlob:b,isFunction:g,isStream:function(e){return l(e)&&g(e.pipe)},isURLSearchParams:y,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:v,merge:function e(){var t={};function r(r,n){d(t[n])&&d(r)?t[n]=e(t[n],r):d(r)?t[n]=e({},r):u(r)?t[n]=r.slice():t[n]=r}for(var n=0,i=arguments.length;n<i;n++)v(arguments[n],r);return t},extend:function(e,t,r){return v(t,(function(t,n){e[n]=r&&"function"==typeof t?i(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,r,n){e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,r&&Object.assign(e.prototype,r)},toFlatObject:function(e,t,r){var n,i,o,a={};t=t||{};do{for(i=(n=Object.getOwnPropertyNames(e)).length;i-- >0;)a[o=n[i]]||(t[o]=e[o],a[o]=!0);e=Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:a,kindOfTest:s,endsWith:function(e,t,r){e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;var n=e.indexOf(t,r);return-1!==n&&n===r},toArray:function(e){if(!e)return null;var t=e.length;if(c(t))return null;for(var r=new Array(t);t-- >0;)r[t]=e[t];return r},isTypedArray:_,isFileList:m}},function(e,t,r){"use strict";var n,i=r(142),o=Object.prototype.toString,a=(n=Object.create(null),function(e){var t=o.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())});function s(e){return e=e.toLowerCase(),function(t){return a(t)===e}}function u(e){return Array.isArray(e)}function c(e){return void 0===e}var f=s("ArrayBuffer");function l(e){return null!==e&&"object"==typeof e}function d(e){if("object"!==a(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var h=s("Date"),p=s("File"),b=s("Blob"),m=s("FileList");function g(e){return"[object Function]"===o.call(e)}var y=s("URLSearchParams");function v(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),u(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var w,_=(w="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return w&&e instanceof w});e.exports={isArray:u,isArrayBuffer:f,isBuffer:function(e){return null!==e&&!c(e)&&null!==e.constructor&&!c(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return e&&("function"==typeof FormData&&e instanceof FormData||"[object FormData]"===o.call(e)||g(e.toString)&&"[object FormData]"===e.toString())},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&f(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:l,isPlainObject:d,isUndefined:c,isDate:h,isFile:p,isBlob:b,isFunction:g,isStream:function(e){return l(e)&&g(e.pipe)},isURLSearchParams:y,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:v,merge:function e(){var t={};function r(r,n){d(t[n])&&d(r)?t[n]=e(t[n],r):d(r)?t[n]=e({},r):u(r)?t[n]=r.slice():t[n]=r}for(var n=0,i=arguments.length;n<i;n++)v(arguments[n],r);return t},extend:function(e,t,r){return v(t,(function(t,n){e[n]=r&&"function"==typeof t?i(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,r,n){e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,r&&Object.assign(e.prototype,r)},toFlatObject:function(e,t,r){var n,i,o,a={};t=t||{};do{for(i=(n=Object.getOwnPropertyNames(e)).length;i-- >0;)a[o=n[i]]||(t[o]=e[o],a[o]=!0);e=Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:a,kindOfTest:s,endsWith:function(e,t,r){e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;var n=e.indexOf(t,r);return-1!==n&&n===r},toArray:function(e){if(!e)return null;var t=e.length;if(c(t))return null;for(var r=new Array(t);t-- >0;)r[t]=e[t];return r},isTypedArray:_,isFileList:m}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.oneOf=t.Null=t.BufferN=t.Function=t.UInt32=t.UInt8=t.tuple=t.maybe=t.Hex=t.Buffer=t.String=t.Boolean=t.Array=t.Number=t.Hash256bit=t.Hash160bit=t.Buffer256bit=t.isTaptree=t.isTapleaf=t.TAPLEAF_VERSION_MASK=t.Network=t.ECPoint=t.Satoshi=t.Signer=t.BIP32Path=t.UInt31=t.isPoint=t.typeforce=void 0;const n=r(0);t.typeforce=r(3);const i=n.Buffer.alloc(32,0),o=n.Buffer.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","hex");t.isPoint=function(e){if(!n.Buffer.isBuffer(e))return!1;if(e.length<33)return!1;const t=e[0],r=e.slice(1,33);if(0===r.compare(i))return!1;if(r.compare(o)>=0)return!1;if((2===t||3===t)&&33===e.length)return!0;const a=e.slice(33);return 0!==a.compare(i)&&(!(a.compare(o)>=0)&&(4===t&&65===e.length))};const a=Math.pow(2,31)-1;function s(e){return t.typeforce.String(e)&&!!e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}t.UInt31=function(e){return t.typeforce.UInt32(e)&&e<=a},t.BIP32Path=s,s.toJSON=()=>"BIP32 derivation path",t.Signer=function(e){return(t.typeforce.Buffer(e.publicKey)||"function"==typeof e.getPublicKey)&&"function"==typeof e.sign};function u(e){return!(!e||!("output"in e))&&(!!n.Buffer.isBuffer(e.output)&&(void 0===e.version||(e.version&t.TAPLEAF_VERSION_MASK)===e.version))}t.Satoshi=function(e){return t.typeforce.UInt53(e)&&e<=21e14},t.ECPoint=t.typeforce.quacksLike("Point"),t.Network=t.typeforce.compile({messagePrefix:t.typeforce.oneOf(t.typeforce.Buffer,t.typeforce.String),bip32:{public:t.typeforce.UInt32,private:t.typeforce.UInt32},pubKeyHash:t.typeforce.UInt8,scriptHash:t.typeforce.UInt8,wif:t.typeforce.UInt8}),t.TAPLEAF_VERSION_MASK=254,t.isTapleaf=u,t.isTaptree=function e(r){return(0,t.Array)(r)?2===r.length&&r.every(t=>e(t)):u(r)},t.Buffer256bit=t.typeforce.BufferN(32),t.Hash160bit=t.typeforce.BufferN(20),t.Hash256bit=t.typeforce.BufferN(32),t.Number=t.typeforce.Number,t.Array=t.typeforce.Array,t.Boolean=t.typeforce.Boolean,t.String=t.typeforce.String,t.Buffer=t.typeforce.Buffer,t.Hex=t.typeforce.Hex,t.maybe=t.typeforce.maybe,t.tuple=t.typeforce.tuple,t.UInt8=t.typeforce.UInt8,t.UInt32=t.typeforce.UInt32,t.Function=t.typeforce.Function,t.BufferN=t.typeforce.BufferN,t.Null=t.typeforce.Null,t.oneOf=t.typeforce.oneOf},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.signature=t.number=t.isCanonicalScriptSignature=t.isDefinedHashType=t.isCanonicalPubKey=t.toStack=t.fromASM=t.toASM=t.decompile=t.compile=t.countNonPushOnlyOPs=t.isPushOnly=t.OPS=void 0;const n=r(90),i=r(58);Object.defineProperty(t,"OPS",{enumerable:!0,get:function(){return i.OPS}});const o=r(158),a=r(159),s=r(160),u=r(8),{typeforce:c}=u,f=i.OPS.OP_RESERVED;function l(e){return u.Buffer(e)||function(e){return u.Number(e)&&(e===i.OPS.OP_0||e>=i.OPS.OP_1&&e<=i.OPS.OP_16||e===i.OPS.OP_1NEGATE)}(e)}function d(e){return u.Array(e)&&e.every(l)}function h(e){return 0===e.length?i.OPS.OP_0:1===e.length?e[0]>=1&&e[0]<=16?f+e[0]:129===e[0]?i.OPS.OP_1NEGATE:void 0:void 0}function p(t){return e.isBuffer(t)}function b(t){return e.isBuffer(t)}function m(t){if(p(t))return t;c(u.Array,t);const r=t.reduce((e,t)=>b(t)?1===t.length&&void 0!==h(t)?e+1:e+o.encodingLength(t.length)+t.length:e+1,0),n=e.allocUnsafe(r);let i=0;if(t.forEach(e=>{if(b(e)){const t=h(e);if(void 0!==t)return n.writeUInt8(t,i),void(i+=1);i+=o.encode(n,e.length,i),e.copy(n,i),i+=e.length}else n.writeUInt8(e,i),i+=1}),i!==n.length)throw new Error("Could not decode chunks");return n}function g(e){if(t=e,u.Array(t))return e;var t;c(u.Buffer,e);const r=[];let n=0;for(;n<e.length;){const t=e[n];if(t>i.OPS.OP_0&&t<=i.OPS.OP_PUSHDATA4){const t=o.decode(e,n);if(null===t)return null;if(n+=t.size,n+t.number>e.length)return null;const i=e.slice(n,n+t.number);n+=t.number;const a=h(i);void 0!==a?r.push(a):r.push(i)}else r.push(t),n+=1}return r}function y(e){const t=-129&e;return t>0&&t<4}t.isPushOnly=d,t.countNonPushOnlyOPs=function(e){return e.length-e.filter(l).length},t.compile=m,t.decompile=g,t.toASM=function(e){return p(e)&&(e=g(e)),e.map(e=>{if(b(e)){const t=h(e);if(void 0===t)return e.toString("hex");e=t}return i.REVERSE_OPS[e]}).join(" ")},t.fromASM=function(t){return c(u.String,t),m(t.split(" ").map(t=>void 0!==i.OPS[t]?i.OPS[t]:(c(u.Hex,t),e.from(t,"hex"))))},t.toStack=function(t){return t=g(t),c(d,t),t.map(t=>b(t)?t:t===i.OPS.OP_0?e.allocUnsafe(0):a.encode(t-f))},t.isCanonicalPubKey=function(e){return u.isPoint(e)},t.isDefinedHashType=y,t.isCanonicalScriptSignature=function(t){return!!e.isBuffer(t)&&(!!y(t[t.length-1])&&n.check(t.slice(0,-1)))},t.number=a,t.signature=s}).call(this,r(0).Buffer)},function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var u,c=[],f=!1,l=-1;function d(){f&&u&&(f=!1,u.length?c=u.concat(c):l=-1,c.length&&h())}function h(){if(!f){var e=s(d);f=!0;for(var t=c.length;t;){for(u=c,c=[];++l<t;)u&&u[l].run();l=-1,t=c.length}u=null,f=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function b(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new p(e,t)),1!==c.length||f||s(h)},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=b,i.addListener=b,i.once=b,i.off=b,i.removeListener=b,i.removeAllListeners=b,i.emit=b,i.prependListener=b,i.prependOnceListener=b,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,r){"use strict";var n=t,i=r(14),o=r(24),a=r(119);n.assert=o,n.toArray=a.toArray,n.zero2=a.zero2,n.toHex=a.toHex,n.encode=a.encode,n.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),a=0;a<n.length;a++){var s,u=o.andln(i-1);o.isOdd()?(s=u>(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),a=0==(1&u)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(a),s=0==(1&c)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitcoin={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},t.regtest={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bcrt",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},t.testnet={messagePrefix:"Bitcoin Signed Message:\n",bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testnet=t.regtest=t.bitcoin=void 0,t.bitcoin={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},t.regtest={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bcrt",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},t.testnet={messagePrefix:"Bitcoin Signed Message:\n",bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239}},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(250).Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a<o;a++){var s=e.charCodeAt(a)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f<s;f+=n)u=c(e,f,f+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var l=1;for(u=c(e,f,e.length,t),f=0;f<a;f++)l*=t;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c<n;c++){for(var f=u>>>26,l=67108863&u,d=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=d;h++){var p=c-h|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[h])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);r=0!==(o=s>>>24-i&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],h=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(h).toString(e);r=(p=p.idivn(h)).isZero()?b+r:f[c-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[s]=a;for(;s<o;s++)c[s]=0}else{for(s=0;s<o-i;s++)c[s]=0;for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[o-s-1]=a}return c},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a<n.length;a++)o=(t=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,o,a=e.words,s=t.words,u=r.words,c=0,f=0|a[0],l=8191&f,d=f>>>13,h=0|a[1],p=8191&h,b=h>>>13,m=0|a[2],g=8191&m,y=m>>>13,v=0|a[3],w=8191&v,_=v>>>13,E=0|a[4],k=8191&E,S=E>>>13,x=0|a[5],T=8191&x,A=x>>>13,P=0|a[6],O=8191&P,I=P>>>13,B=0|a[7],M=8191&B,R=B>>>13,N=0|a[8],j=8191&N,U=N>>>13,C=0|a[9],H=8191&C,z=C>>>13,L=0|s[0],D=8191&L,F=L>>>13,q=0|s[1],K=8191&q,W=q>>>13,V=0|s[2],G=8191&V,X=V>>>13,Y=0|s[3],$=8191&Y,J=Y>>>13,Q=0|s[4],Z=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,fe=0|s[8],le=8191&fe,de=fe>>>13,he=0|s[9],pe=8191&he,be=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(n=Math.imul(l,D))|0)+((8191&(i=(i=Math.imul(l,F))+Math.imul(d,D)|0))<<13)|0;c=((o=Math.imul(d,F))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,D),i=(i=Math.imul(p,F))+Math.imul(b,D)|0,o=Math.imul(b,F);var ge=(c+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,W)|0)+Math.imul(d,K)|0))<<13)|0;c=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,D),i=(i=Math.imul(g,F))+Math.imul(y,D)|0,o=Math.imul(y,F),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,W)|0;var ye=(c+(n=n+Math.imul(l,G)|0)|0)+((8191&(i=(i=i+Math.imul(l,X)|0)+Math.imul(d,G)|0))<<13)|0;c=((o=o+Math.imul(d,X)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(w,D),i=(i=Math.imul(w,F))+Math.imul(_,D)|0,o=Math.imul(_,F),n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,W)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,X)|0;var ve=(c+(n=n+Math.imul(l,$)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(d,$)|0))<<13)|0;c=((o=o+Math.imul(d,J)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(k,D),i=(i=Math.imul(k,F))+Math.imul(S,D)|0,o=Math.imul(S,F),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(g,G)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,X)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,J)|0;var we=(c+(n=n+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,ee)|0)+Math.imul(d,Z)|0))<<13)|0;c=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(T,D),i=(i=Math.imul(T,F))+Math.imul(A,D)|0,o=Math.imul(A,F),n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(g,$)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,J)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,ee)|0;var _e=(c+(n=n+Math.imul(l,re)|0)|0)+((8191&(i=(i=i+Math.imul(l,ne)|0)+Math.imul(d,re)|0))<<13)|0;c=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(O,D),i=(i=Math.imul(O,F))+Math.imul(I,D)|0,o=Math.imul(I,F),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(k,G)|0,i=(i=i+Math.imul(k,X)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(g,Z)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0;var Ee=(c+(n=n+Math.imul(l,oe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ae)|0)+Math.imul(d,oe)|0))<<13)|0;c=((o=o+Math.imul(d,ae)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(M,D),i=(i=Math.imul(M,F))+Math.imul(R,D)|0,o=Math.imul(R,F),n=n+Math.imul(O,K)|0,i=(i=i+Math.imul(O,W)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,W)|0,n=n+Math.imul(T,G)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,J)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0;var ke=(c+(n=n+Math.imul(l,ue)|0)|0)+((8191&(i=(i=i+Math.imul(l,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((o=o+Math.imul(d,ce)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(j,D),i=(i=Math.imul(j,F))+Math.imul(U,D)|0,o=Math.imul(U,F),n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(O,G)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(I,G)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(k,Z)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0;var Se=(c+(n=n+Math.imul(l,le)|0)|0)+((8191&(i=(i=i+Math.imul(l,de)|0)+Math.imul(d,le)|0))<<13)|0;c=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(H,D),i=(i=Math.imul(H,F))+Math.imul(z,D)|0,o=Math.imul(z,F),n=n+Math.imul(j,K)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul(U,K)|0,o=o+Math.imul(U,W)|0,n=n+Math.imul(M,G)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,J)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(k,re)|0,i=(i=i+Math.imul(k,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0,n=n+Math.imul(p,le)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,de)|0;var xe=(c+(n=n+Math.imul(l,pe)|0)|0)+((8191&(i=(i=i+Math.imul(l,be)|0)+Math.imul(d,pe)|0))<<13)|0;c=((o=o+Math.imul(d,be)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(H,K),i=(i=Math.imul(H,W))+Math.imul(z,K)|0,o=Math.imul(z,W),n=n+Math.imul(j,G)|0,i=(i=i+Math.imul(j,X)|0)+Math.imul(U,G)|0,o=o+Math.imul(U,X)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,J)|0,n=n+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(k,oe)|0,i=(i=i+Math.imul(k,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(g,le)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(y,le)|0,o=o+Math.imul(y,de)|0;var Te=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;c=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(H,G),i=(i=Math.imul(H,X))+Math.imul(z,G)|0,o=Math.imul(z,X),n=n+Math.imul(j,$)|0,i=(i=i+Math.imul(j,J)|0)+Math.imul(U,$)|0,o=o+Math.imul(U,J)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(k,ue)|0,i=(i=i+Math.imul(k,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,n=n+Math.imul(w,le)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,le)|0,o=o+Math.imul(_,de)|0;var Ae=(c+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,be)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(H,$),i=(i=Math.imul(H,J))+Math.imul(z,$)|0,o=Math.imul(z,J),n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(U,Z)|0,o=o+Math.imul(U,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,ce)|0,n=n+Math.imul(k,le)|0,i=(i=i+Math.imul(k,de)|0)+Math.imul(S,le)|0,o=o+Math.imul(S,de)|0;var Pe=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,be)|0)+Math.imul(_,pe)|0))<<13)|0;c=((o=o+Math.imul(_,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(H,Z),i=(i=Math.imul(H,ee))+Math.imul(z,Z)|0,o=Math.imul(z,ee),n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(U,re)|0,o=o+Math.imul(U,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(I,ue)|0,o=o+Math.imul(I,ce)|0,n=n+Math.imul(T,le)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(A,le)|0,o=o+Math.imul(A,de)|0;var Oe=(c+(n=n+Math.imul(k,pe)|0)|0)+((8191&(i=(i=i+Math.imul(k,be)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,be)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(H,re),i=(i=Math.imul(H,ne))+Math.imul(z,re)|0,o=Math.imul(z,ne),n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,ae)|0)+Math.imul(U,oe)|0,o=o+Math.imul(U,ae)|0,n=n+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,n=n+Math.imul(O,le)|0,i=(i=i+Math.imul(O,de)|0)+Math.imul(I,le)|0,o=o+Math.imul(I,de)|0;var Ie=(c+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,be)|0)+Math.imul(A,pe)|0))<<13)|0;c=((o=o+Math.imul(A,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(H,oe),i=(i=Math.imul(H,ae))+Math.imul(z,oe)|0,o=Math.imul(z,ae),n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(U,ue)|0,o=o+Math.imul(U,ce)|0,n=n+Math.imul(M,le)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(R,le)|0,o=o+Math.imul(R,de)|0;var Be=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,be)|0)+Math.imul(I,pe)|0))<<13)|0;c=((o=o+Math.imul(I,be)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(H,ue),i=(i=Math.imul(H,ce))+Math.imul(z,ue)|0,o=Math.imul(z,ce),n=n+Math.imul(j,le)|0,i=(i=i+Math.imul(j,de)|0)+Math.imul(U,le)|0,o=o+Math.imul(U,de)|0;var Me=(c+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,be)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,be)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(H,le),i=(i=Math.imul(H,de))+Math.imul(z,le)|0,o=Math.imul(z,de);var Re=(c+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,be)|0)+Math.imul(U,pe)|0))<<13)|0;c=((o=o+Math.imul(U,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ne=(c+(n=Math.imul(H,pe))|0)+((8191&(i=(i=Math.imul(H,be))+Math.imul(z,pe)|0))<<13)|0;return c=((o=Math.imul(z,be))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=me,u[1]=ge,u[2]=ye,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Ee,u[7]=ke,u[8]=Se,u[9]=xe,u[10]=Te,u[11]=Ae,u[12]=Pe,u[13]=Oe,u[14]=Ie,u[15]=Be,u[16]=Me,u[17]=Re,u[18]=Ne,0!==c&&(u[19]=c,r.length++),r};function b(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(p=h),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):r<63?h(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var f=o-c,l=(0|e.words[f])*(0|t.words[c]),d=67108863&l;s=67108863&(d=d+s|0),i+=(a=(a=a+(l/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):b(this,e,t)},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},m.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a<o;a++)n[a]=t[e[a]],i[a]=r[e[a]]},m.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),f=0;f<i;f+=s)for(var l=u,d=c,h=0;h<a;h++){var p=r[f+h],b=n[f+h],m=r[f+h+a],g=n[f+h+a],y=l*m-d*g;g=l*g+d*m,m=y,r[f+h]=p+m,n[f+h]=b+g,r[f+h+a]=p-m,n[f+h+a]=b-g,h!==s&&(y=u*l-c*d,d=u*d+c*l,l=y)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},m.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},m.prototype.convert13b=function(e,t,r,i){for(var o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)r[a]=0;n(0===o),n(0==(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),a=new Array(n),s=new Array(n),u=new Array(n),c=new Array(n),f=new Array(n),l=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,c,n),this.transform(a,o,s,u,n,i),this.transform(c,o,f,l,n,i);for(var h=0;h<n;h++){var p=s[h]*f[h]-u[h]*l[h];u[h]=s[h]*l[h]+u[h]*f[h],s[h]=p}return this.conjugate(s,u,n),this.transform(s,u,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),b(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var f=0;for(c=this.length-1;c>=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,a=e.length+r;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+s;var u=(0|e.words[i])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var f=n.clone()._ishlnsubmul(i,1,u);0===f.negative&&(n=f,s&&(s.words[u]=1));for(var l=u-1;l>=0;l--){var d=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,l);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),l=t.clone();!t.isZero();){for(var d=0,h=1;0==(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0==(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,d=1;0==(r.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new k(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(v,y),v.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n<r;n++)t.words[n]=e.words[n];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=4194303&i,n=10;n<e.length;n++){var o=0|e.words[n];e.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,y),i(_,y),i(E,y),E.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return g[e]=t,t},k.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,i),d=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=a;0!==h.cmp(s);){for(var b=h,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m<p);var g=this.pow(l,new o(1).iushln(p-m-1));d=d.redMul(g),l=g.redSqr(),h=h.redMul(l),p=m}return d},k.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},k.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],f=u-1;f>=0;f--){var l=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new S(e)},i(S,k),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(249)(e))},function(e,t,r){"use strict";var n=r(24),i=r(2);function o(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var a=e.charCodeAt(i);a<128?r[n++]=a:a<2048?(r[n++]=a>>6|192,r[n++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=s(e[r].toString(16));return t},t.htonl=a,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=a(i)),r+=u(i.toString(16))}return r},t.zero2=s,t.zero8=u,t.join32=function(e,t,r,i){var o=r-t;n(o%4==0);for(var a=new Array(o/4),s=0,u=t;s<a.length;s++,u+=4){var c;c="big"===i?e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]:e[u+3]<<24|e[u+2]<<16|e[u+1]<<8|e[u],a[s]=c>>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o<n?1:0)+r+i;e[t]=a>>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,a,s){var u=0,c=t;return u+=(c=c+n>>>0)<t?1:0,u+=(c=c+o>>>0)<o?1:0,e+r+i+a+(u+=(c=c+s>>>0)<s?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,u,c){var f=0,l=t;return f+=(l=l+n>>>0)<t?1:0,f+=(l=l+o>>>0)<o?1:0,f+=(l=l+s>>>0)<s?1:0,e+r+i+a+u+(f+=(l=l+c>>>0)<c?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,u,c){return t+n+o+s+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(3),i=Math.pow(2,31)-1;function o(e){return n.String(e)&&!!e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}t.UInt31=function(e){return n.UInt32(e)&&e<=i},t.BIP32Path=o,o.toJSON=()=>"BIP32 derivation path",t.Signer=function(e){return(n.Buffer(e.publicKey)||"function"==typeof e.getPublicKey)&&"function"==typeof e.sign};t.Satoshi=function(e){return n.UInt53(e)&&e<=21e14},t.ECPoint=n.quacksLike("Point"),t.Network=n.compile({messagePrefix:n.oneOf(n.Buffer,n.String),bip32:{public:n.UInt32,private:n.UInt32},pubKeyHash:n.UInt8,scriptHash:n.UInt8,wif:n.UInt8}),t.Buffer256bit=n.BufferN(32),t.Hash160bit=n.BufferN(20),t.Hash256bit=n.BufferN(32),t.Number=n.Number,t.Array=n.Array,t.Boolean=n.Boolean,t.String=n.String,t.Buffer=n.Buffer,t.Hex=n.Hex,t.maybe=n.maybe,t.tuple=n.tuple,t.UInt8=n.UInt8,t.UInt32=n.UInt32,t.Function=n.Function,t.BufferN=n.BufferN,t.Null=n.Null,t.oneOf=n.oneOf},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.taggedHash=t.TAGGED_HASH_PREFIXES=t.TAGS=t.hash256=t.hash160=t.sha256=t.sha1=t.ripemd160=void 0;const n=r(92),i=r(166),o=r(27);function a(t){return e.from((0,o.sha256)(Uint8Array.from(t)))}t.ripemd160=function(t){return e.from((0,n.ripemd160)(Uint8Array.from(t)))},t.sha1=function(t){return e.from((0,i.sha1)(Uint8Array.from(t)))},t.sha256=a,t.hash160=function(t){return e.from((0,n.ripemd160)((0,o.sha256)(Uint8Array.from(t))))},t.hash256=function(t){return e.from((0,o.sha256)((0,o.sha256)(Uint8Array.from(t))))},t.TAGS=["BIP0340/challenge","BIP0340/aux","BIP0340/nonce","TapLeaf","TapBranch","TapSighash","TapTweak","KeyAgg list","KeyAgg coefficient"],t.TAGGED_HASH_PREFIXES={"BIP0340/challenge":e.from([123,181,45,122,159,239,88,50,62,177,191,122,64,125,179,130,210,243,242,216,27,177,34,79,73,254,81,143,109,72,211,124,123,181,45,122,159,239,88,50,62,177,191,122,64,125,179,130,210,243,242,216,27,177,34,79,73,254,81,143,109,72,211,124]),"BIP0340/aux":e.from([241,239,78,94,192,99,202,218,109,148,202,250,157,152,126,160,105,38,88,57,236,193,31,151,45,119,165,46,216,193,204,144,241,239,78,94,192,99,202,218,109,148,202,250,157,152,126,160,105,38,88,57,236,193,31,151,45,119,165,46,216,193,204,144]),"BIP0340/nonce":e.from([7,73,119,52,167,155,203,53,91,155,140,125,3,79,18,28,244,52,215,62,247,45,218,25,135,0,97,251,82,191,235,47,7,73,119,52,167,155,203,53,91,155,140,125,3,79,18,28,244,52,215,62,247,45,218,25,135,0,97,251,82,191,235,47]),TapLeaf:e.from([174,234,143,220,66,8,152,49,5,115,75,88,8,29,30,38,56,211,95,28,181,64,8,212,211,87,202,3,190,120,233,238,174,234,143,220,66,8,152,49,5,115,75,88,8,29,30,38,56,211,95,28,181,64,8,212,211,87,202,3,190,120,233,238]),TapBranch:e.from([25,65,161,242,229,110,185,95,162,169,241,148,190,92,1,247,33,111,51,237,130,176,145,70,52,144,208,91,245,22,160,21,25,65,161,242,229,110,185,95,162,169,241,148,190,92,1,247,33,111,51,237,130,176,145,70,52,144,208,91,245,22,160,21]),TapSighash:e.from([244,10,72,223,75,42,112,200,180,146,75,242,101,70,97,237,61,149,253,102,163,19,235,135,35,117,151,198,40,228,160,49,244,10,72,223,75,42,112,200,180,146,75,242,101,70,97,237,61,149,253,102,163,19,235,135,35,117,151,198,40,228,160,49]),TapTweak:e.from([232,15,225,99,156,156,160,80,227,175,27,57,193,67,198,62,66,156,188,235,21,217,64,251,181,197,161,244,175,87,197,233,232,15,225,99,156,156,160,80,227,175,27,57,193,67,198,62,66,156,188,235,21,217,64,251,181,197,161,244,175,87,197,233]),"KeyAgg list":e.from([72,28,151,28,60,11,70,215,240,178,117,174,89,141,78,44,126,215,49,156,89,74,92,110,199,158,160,212,153,2,148,240,72,28,151,28,60,11,70,215,240,178,117,174,89,141,78,44,126,215,49,156,89,74,92,110,199,158,160,212,153,2,148,240]),"KeyAgg coefficient":e.from([191,201,4,3,77,28,136,232,200,14,34,229,61,36,86,109,100,130,78,214,66,114,129,192,145,0,249,77,205,82,201,129,191,201,4,3,77,28,136,232,200,14,34,229,61,36,86,109,100,130,78,214,66,114,129,192,145,0,249,77,205,82,201,129])},t.taggedHash=function(r,n){return a(e.concat([t.TAGGED_HASH_PREFIXES[r],n]))}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(70);function i(e){try{return n("rmd160").update(e).digest()}catch(t){return n("ripemd160").update(e).digest()}}function o(e){return n("sha256").update(e).digest()}t.ripemd160=i,t.sha1=function(e){return n("sha1").update(e).digest()},t.sha256=o,t.hash160=function(e){return i(o(e))},t.hash256=function(e){return o(o(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.value=t.prop=void 0,t.prop=function(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){const e=r.call(this);return this[t]=e,e},set(e){Object.defineProperty(this,t,{configurable:!0,enumerable:!0,value:e,writable:!0})}})},t.value=function(e){let t;return()=>(void 0!==t||(t=e()),t)}},function(e,t,r){"use strict";
11
- /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const n=r(165),i=e=>e instanceof Uint8Array;t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");const o=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));t.bytesToHex=function(e){if(!i(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=o[e[r]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(t/2);for(let t=0;t<r.length;t++){const n=2*t,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");r[t]=o}return r};function a(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function s(e){if("string"==typeof e&&(e=a(e)),!i(e))throw new Error("expected Uint8Array, got "+typeof e);return e}t.nextTick=async()=>{},t.asyncLoop=async function(e,r,n){let i=Date.now();for(let o=0;o<e;o++){n(o);const e=Date.now()-i;e>=0&&e<r||(await(0,t.nextTick)(),i+=e)}},t.utf8ToBytes=a,t.toBytes=s,t.concatBytes=function(...e){const t=new Uint8Array(e.reduce((e,t)=>e+t.length,0));let r=0;return e.forEach(e=>{if(!i(e))throw new Error("Uint8Array expected");t.set(e,r),r+=e.length}),t};t.Hash=class{clone(){return this._cloneInto()}};t.checkOpts=function(e,t){if(void 0!==t&&("object"!=typeof t||(r=t,"[object Object]"!==Object.prototype.toString.call(r)||r.constructor!==Object)))throw new Error("Options should be object or undefined");var r;return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(s(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(s(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(s(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});function r(e){if(e<0||e>9007199254740991||e%1!=0)throw new RangeError("value out of range")}function n(e){return r(e),e<253?1:e<=65535?3:e<=4294967295?5:9}t.encode=function t(i,o,a){if(r(i),o||(o=e.allocUnsafe(n(i))),!e.isBuffer(o))throw new TypeError("buffer must be a Buffer instance");return a||(a=0),i<253?(o.writeUInt8(i,a),Object.assign(t,{bytes:1})):i<=65535?(o.writeUInt8(253,a),o.writeUInt16LE(i,a+1),Object.assign(t,{bytes:3})):i<=4294967295?(o.writeUInt8(254,a),o.writeUInt32LE(i,a+1),Object.assign(t,{bytes:5})):(o.writeUInt8(255,a),o.writeUInt32LE(i>>>0,a+1),o.writeUInt32LE(i/4294967296|0,a+5),Object.assign(t,{bytes:9})),o},t.decode=function t(n,i){if(!e.isBuffer(n))throw new TypeError("buffer must be a Buffer instance");i||(i=0);const o=n.readUInt8(i);if(o<253)return Object.assign(t,{bytes:1}),o;if(253===o)return Object.assign(t,{bytes:3}),n.readUInt16LE(i+1);if(254===o)return Object.assign(t,{bytes:5}),n.readUInt32LE(i+1);{Object.assign(t,{bytes:9});const e=n.readUInt32LE(i+1),o=4294967296*n.readUInt32LE(i+5)+e;return r(o),o}},t.encodingLength=n}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(48),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var o=Object.create(r(42));o.inherits=r(31);var a=r(113),s=r(74);o.inherits(l,a);for(var u=i(s.prototype),c=0;c<u.length;c++){var f=u[c];l.prototype[f]||(l.prototype[f]=s.prototype[f])}function l(e){if(!(this instanceof l))return new l(e);a.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",d)}function d(){this.allowHalfOpen||this._writableState.ended||n.nextTick(h,this)}function h(e){e.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(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),l.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}},function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=r,r.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},function(e,t,r){(function(t){const n=r(14),i=new(0,r(118).ec)("secp256k1"),o=r(274),a=t.alloc(32,0),s=t.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),u=t.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","hex"),c=i.curve.n,f=c.shrn(1),l=i.curve.g;function d(e){return t.isBuffer(e)&&32===e.length}function h(e){return!!d(e)&&e.compare(s)<0}function p(e){if(!t.isBuffer(e))return!1;if(e.length<33)return!1;const r=e[0],n=e.slice(1,33);if(0===n.compare(a))return!1;if(n.compare(u)>=0)return!1;if((2===r||3===r)&&33===e.length){try{w(e)}catch(e){return!1}return!0}const i=e.slice(33);return 0!==i.compare(a)&&(!(i.compare(u)>=0)&&(4===r&&65===e.length))}function b(e){return 4!==e[0]}function m(e){return!!d(e)&&(e.compare(a)>0&&e.compare(s)<0)}function g(e,t){return void 0===e&&void 0!==t?b(t):void 0===e||e}function y(e){return new n(e)}function v(e){return e.toArrayLike(t,"be",32)}function w(e){return i.curve.decodePoint(e)}function _(e,r){return t.from(e._encode(r))}function E(e,r,n){if(!d(e))throw new TypeError("Expected Hash");if(!m(r))throw new TypeError("Expected Private");if(void 0!==n&&!d(n))throw new TypeError("Expected Extra Data (32 bytes)");const i=y(r),a=y(e);let s,u;o(e,r,(function(e){const t=y(e),r=l.mul(t);return!r.isInfinity()&&(s=r.x.umod(c),0!==s.isZero()&&(u=t.invm(c).mul(a.add(i.mul(s))).umod(c),0!==u.isZero()))}),m,n),u.cmp(f)>0&&(u=c.sub(u));const h=t.allocUnsafe(64);return v(s).copy(h,0),v(u).copy(h,32),h}e.exports={isPoint:p,isPointCompressed:function(e){return!!p(e)&&b(e)},isPrivate:m,pointAdd:function(e,t,r){if(!p(e))throw new TypeError("Expected Point");if(!p(t))throw new TypeError("Expected Point");const n=w(e),i=w(t),o=n.add(i);return o.isInfinity()?null:_(o,g(r,e))},pointAddScalar:function(e,t,r){if(!p(e))throw new TypeError("Expected Point");if(!h(t))throw new TypeError("Expected Tweak");const n=g(r,e),i=w(e);if(0===t.compare(a))return _(i,n);const o=y(t),s=l.mul(o),u=i.add(s);return u.isInfinity()?null:_(u,n)},pointCompress:function(e,t){if(!p(e))throw new TypeError("Expected Point");const r=w(e);if(r.isInfinity())throw new TypeError("Expected Point");return _(r,g(t,e))},pointFromScalar:function(e,t){if(!m(e))throw new TypeError("Expected Private");const r=y(e),n=l.mul(r);return n.isInfinity()?null:_(n,g(t))},pointMultiply:function(e,t,r){if(!p(e))throw new TypeError("Expected Point");if(!h(t))throw new TypeError("Expected Tweak");const n=g(r,e),i=w(e),o=y(t),a=i.mul(o);return a.isInfinity()?null:_(a,n)},privateAdd:function(e,t){if(!m(e))throw new TypeError("Expected Private");if(!h(t))throw new TypeError("Expected Tweak");const r=y(e),n=y(t),i=v(r.add(n).umod(c));return m(i)?i:null},privateSub:function(e,t){if(!m(e))throw new TypeError("Expected Private");if(!h(t))throw new TypeError("Expected Tweak");const r=y(e),n=y(t),i=v(r.sub(n).umod(c));return m(i)?i:null},sign:function(e,t){return E(e,t)},signWithEntropy:function(e,t,r){return E(e,t,r)},verify:function(e,r,n,i){if(!d(e))throw new TypeError("Expected Hash");if(!p(r))throw new TypeError("Expected Point");if(!function(e){const r=e.slice(0,32),n=e.slice(32,64);return t.isBuffer(e)&&64===e.length&&r.compare(s)<0&&n.compare(s)<0}(n))throw new TypeError("Expected Signature");const o=w(r),a=y(n.slice(0,32)),u=y(n.slice(32,64));if(i&&u.cmp(f)>0)return!1;if(a.gtn(0)<=0)return!1;if(u.gtn(0)<=0)return!1;const h=y(e),b=u.invm(c),m=h.mul(b).umod(c),g=a.mul(b).umod(c),v=l.mulAdd(m,o,g);return!v.isInfinity()&&v.x.umod(c).eq(a)}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prop=function(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){const e=r.call(this);return this[t]=e,e},set(e){Object.defineProperty(this,t,{configurable:!0,enumerable:!0,value:e,writable:!0})}})},t.value=function(e){let t;return()=>(void 0!==t||(t=e()),t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=void 0;const n=r(44),i=r(21),o=(e,t,r)=>e&t^e&r^t&r,a=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),s=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=new Uint32Array(64);class c extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|s[0],this.B=0|s[1],this.C=0|s[2],this.D=0|s[3],this.E=0|s[4],this.F=0|s[5],this.G=0|s[6],this.H=0|s[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:o,G:a,H:s}=this;return[e,t,r,n,i,o,a,s]}set(e,t,r,n,i,o,a,s){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|a,this.H=0|s}process(e,t){for(let r=0;r<16;r++,t+=4)u[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=u[e-15],r=u[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,o=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;u[e]=o+u[e-7]+n+u[e-16]|0}let{A:r,B:n,C:s,D:c,E:f,F:l,G:d,H:h}=this;for(let e=0;e<64;e++){const t=h+((0,i.rotr)(f,6)^(0,i.rotr)(f,11)^(0,i.rotr)(f,25))+((p=f)&l^~p&d)+a[e]+u[e]|0,b=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+o(r,n,s)|0;h=d,d=l,l=f,f=c+t|0,c=s,s=n,n=r,r=t+b|0}var p;r=r+this.A|0,n=n+this.B|0,s=s+this.C|0,c=c+this.D|0,f=f+this.E|0,l=l+this.F|0,d=d+this.G|0,h=h+this.H|0,this.set(r,n,s,c,f,l,d,h)}roundClean(){u.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class f extends c{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}t.sha256=(0,i.wrapConstructor)(()=>new c),t.sha224=(0,i.wrapConstructor)(()=>new f)},function(e,t,r){"use strict";var n={};function i(e,t,r){r||(r=Error);var i=function(e){var r,n;function i(r,n,i){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i))||this}return n=e,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=e,n[e]=i}function o(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,i,a,s;if("string"==typeof t&&(i="not ",t.substr(!a||a<0?0:+a,i.length)===i)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(n," ").concat(o(t,"type"));else{var u=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(u," ").concat(n," ").concat(o(t,"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(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" 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(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var i=r(102),o=r(106);r(2)(c,i);for(var a=n(o.prototype),s=0;s<a.length;s++){var u=a[s];c.prototype[u]||(c.prototype[u]=o.prototype[u])}function c(e){if(!(this instanceof c))return new c(e);i.call(this,e),o.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||t.nextTick(l,this)}function l(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this,r(10))},function(e,t,r){var n=r(4).Buffer;function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,i=this._blockSize,o=e.length,a=this._len,s=0;s<o;){for(var u=a%i,c=Math.min(o-s,i-u),f=0;f<c;f++)r[u+f]=e[s+f];s+=c,(a+=c)%i==0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=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 e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){"use strict";var n=r(6);function i(e,t,r,n,i){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}n.inherits(i,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var o=i.prototype,a={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(e){a[e]={value:e}})),Object.defineProperties(i,a),Object.defineProperty(o,"isAxiosError",{value:!0}),i.from=function(e,t,r,a,s,u){var c=Object.create(o);return n.toFlatObject(e,c,(function(e){return e!==Error.prototype})),i.call(c,e.message,t,r,a,s),c.name=e.name,u&&Object.assign(c,u),c},e.exports=i},function(e,t,r){"use strict";var n=r(7);function i(e,t,r,n,i){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}n.inherits(i,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var o=i.prototype,a={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(e){a[e]={value:e}})),Object.defineProperties(i,a),Object.defineProperty(o,"isAxiosError",{value:!0}),i.from=function(e,t,r,a,s,u){var c=Object.create(o);return n.toFlatObject(e,c,(function(e){return e!==Error.prototype})),i.call(c,e.message,t,r,a,s),c.name=e.name,u&&Object.assign(c,u),c},e.exports=i},function(e,t,r){"use strict";(function(e){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.addressTypeHelper=t.publicKeyConvertor=t.createAddressObjectByAddress=t.createAddressObjectByPublicKey=t.createAddressObjectByHash=t.createAddressObjectByScript=t.getAddressType=t.validateAddress=t.extractTransactionsAndBlockInfoFromRawBlock=t.parseRawBlock=t.convertBitcoinScriptToAddress=t.parseBlockHeader=t.calculateMerkleProof=t.parseRawTransaction=t.getPrivateKeyHexFromWIF=t.getPubKeyFromPrivateKeyHex=t.getPubKeyFromPrivateKeyWIF=t.getPublicKeyHexByXpubAndIndex=t.reverseBytes=t.generateMnemonic=t.networks=void 0;const s=a(r(57));t.networks=s.default;const u=o(r(96)),c=a(r(99)),f=o(r(75)),l=o(r(35)),d=o(r(117)),h=(0,c.default)(f),p=d.ECPair;let b=r(37);const m=r(126),g=r(304),y=r(305);function v(t,r,n){let i=t.findIndex(e=>e===r);if(i<0)throw new Error("txId is not in this tree");let o=t.map(t=>e.from(t,"hex").reverse());if(n&&n!==m(o,l.crypto.hash256).toString("hex"))throw new Error("calculated merkleRoot and block merkleRoot not matched");let a=g(o,l.crypto.hash256),s=y(a,o[i]).map(e=>e&&e.toString("hex")).filter(e=>null!=e);return{intermediateNodes:s.reduce((e,t,r)=>r!==i%2&&r<s.length-1?e+t:e,"0x"),transactionIndex:i}}function w(e,t=l.networks.bitcoin){try{return l.address.fromOutputScript(e,t)}catch(e){return null}}function _(e,t=l.networks.bitcoin){if(e.startsWith(t.bech32+"1p"))return"p2tr";if(e.startsWith(t.bech32))return l.address.fromBech32(e),"p2wpkh";let r=l.address.fromBase58Check(e);if(r.version===Number(t.scriptHash))return"p2sh";if(r.version===Number(t.pubKeyHash))return"p2pkh";throw new Error("invalid address")}function E(e,t=l.networks.bitcoin){let r,n=_(e,t);switch(n){case"p2pkh":r=l.payments.p2pkh({address:e,network:t});break;case"p2wpkh":r=l.payments.p2wpkh({address:e,network:t});break;case"p2sh":r=l.payments.p2sh({address:e,network:t});break;case"p2tr":r=l.payments.p2tr({address:e,network:t});break;default:throw new Error("address type is incorrect")}return{addressObject:r,addressType:n}}t.generateMnemonic=function(){return u.generateMnemonic(256)},t.reverseBytes=function(t){return e.from(t,"hex").reverse().toString("hex")},t.getPublicKeyHexByXpubAndIndex=function(e,t=0,r=!1,n=s.default.bitcoin){return h.fromBase58(e,n).derive(r?1:0).derive(t).publicKey.toString("hex")},t.getPubKeyFromPrivateKeyWIF=function(e,t=l.networks.bitcoin){return p.fromWIF(e,t).publicKey},t.getPubKeyFromPrivateKeyHex=function(t,r=l.networks.bitcoin){return p.fromPrivateKey(e.from(t,"hex"),{network:r}).publicKey},t.getPrivateKeyHexFromWIF=function(e,t=l.networks.bitcoin){return p.fromWIF(e,t).privateKey.toString("hex")},t.parseRawTransaction=function(t){const r=4,n=2,i=32,o=4,a=4,s=8;let u=0,c=t.slice(u,2*r);u+=2*r;let f=t.slice(u,u+2*n);u="0001"===f?u+2*n:u;let l=u,d=b.decode(e.from(t.slice(u),"hex"));u+=2*b.encodingLength(d);for(let r=0;r<d;r+=1){u+=2*i,u+=2*o;let r=b.decode(e.from(t.slice(u),"hex"));u+=2*b.encodingLength(r),u+=2*r,u+=2*a}let h=u,p=u,m=b.decode(e.from(t.slice(u),"hex"));u+=2*b.encodingLength(m);for(let r=0;r<m;r+=1){u+=2*s;let r=b.decode(e.from(t.slice(u),"hex"));u+=2*b.encodingLength(r),u+=2*r}let g=u;return c="0x"+c,f="0x"+f,{version:c,flag:f,vin:"0x"+t.slice(l,h),vout:"0x"+t.slice(p,g),witness:"0x"+t.slice(g,t.length-8),locktime:"0x"+t.slice(t.length-8,t.length)}},t.calculateMerkleProof=v,t.parseBlockHeader=function(e){const t={version:4,previousBlockHash:32,merkleRoot:32,timestamp:4,difficulty:4,nonce:4};let r=0,n={};for(let i in t)n[i]=e.slice(r,r+2*t[i]),r+=2*t[i];return n},t.convertBitcoinScriptToAddress=w,t.parseRawBlock=function(t,r,n=l.networks.bitcoin){var i;let o=l.Block.fromBuffer(e.from(t,"hex")),a=o.getHash().toString("hex"),s=o.merkleRoot.toString("hex"),u=o.prevHash.toString("hex");return{blockNumber:r,merkleRoot:s,prvBlockHash:u,transactions:null===(i=o.transactions)||void 0===i?void 0:i.map(t=>({txId:t.getId(),version:t.version,locktime:t.locktime,blockNumber:r,blockHash:a,vout:t.outs.map((e,t)=>({address:w(e.script,n),script:e.script.toString("hex"),value:e.value,index:t})),vin:t.ins.map(t=>({txId:e.from(t.hash).reverse().toString("hex"),index:t.index}))}))}},t.extractTransactionsAndBlockInfoFromRawBlock=function(t,r,n=[],i=[],o=l.networks.bitcoin){var a;let s=l.Block.fromBuffer(e.from(t,"hex")),u=s.getHash().reverse().toString("hex"),c=s.merkleRoot.toString("hex"),f=s.prevHash.toString("hex"),d={blockNumber:r,blockHash:u,merkleRoot:c,prvBlockHash:f},h=n.map(e=>E(e,o).addressObject.output.toString("hex")),p=s.transactions.map(e=>e.getId()),b=[],m=[];return null===(a=s.transactions)||void 0===a||a.forEach(t=>{let a,s=t.getId();if(t.ins.find(t=>{let r=e.from(t.hash).reverse().toString("hex"),n=i.find(e=>e.txId===r&&e.index===t.index);return a=null==n?void 0:n.address,!!a})&&a){let n=v(p,s,c);b.push({txId:t.getId(),version:t.version,locktime:t.locktime,blockNumber:r,blockHash:u,merkleProof:n,vout:t.outs.map(e=>({address:w(e.script,o),script:e.script.toString("hex"),value:e.value})),vin:t.ins.map(t=>{let r=e.from(t.hash).reverse().toString("hex"),n=i.find(e=>e.txId===r&&e.index===t.index);return{txId:e.from(t.hash).reverse().toString("hex"),index:t.index,address:(null==n?void 0:n.address)||null,script:(null==n?void 0:n.script)||null,value:(null==n?void 0:n.value)||null}}),address:a,addressScript:E(a,o).addressObject.output.toString("hex")})}let f=-1;if(t.outs.find(e=>{let t=h.findIndex(t=>t===e.script.toString("hex"));return t>=0&&(f=t,!0)})&&f>=0){let i=v(p,s,c);m.push({txId:t.getId(),version:t.version,locktime:t.locktime,blockNumber:r,blockHash:u,merkleProof:i,vout:t.outs.map(e=>({address:w(e.script,o),script:e.script.toString("hex"),value:e.value})),vin:t.ins.map(t=>({txId:e.from(t.hash).reverse().toString("hex"),index:t.index})),addressScript:h[f],address:n[f]})}}),{blockInfo:d,withdrawTxs:b,depositTxs:m}},t.validateAddress=function(e,t=l.networks.bitcoin){try{let r=!1;if(e.startsWith(t.bech32))l.address.fromBech32(e),r=!0;else{let n=l.address.fromBase58Check(e);r=n.version===Number(t.scriptHash)||n.version===Number(t.pubKeyHash)}return r}catch(e){return!1}},t.getAddressType=_,t.createAddressObjectByScript=function({addressType:e,script:t},r=l.networks.bitcoin){let n;switch(e){case"p2pkh":n=l.payments.p2pkh({output:t,network:r});break;case"p2wpkh":n=l.payments.p2wpkh({output:t,network:r});break;case"p2sh":n=l.payments.p2sh({output:t,network:r});break;case"p2wsh":n=l.payments.p2wsh({output:t,network:r});break;case"p2tr":n=l.payments.p2tr({output:t,network:r});break;default:throw new Error("address type is incorrect")}return n},t.createAddressObjectByHash=function({addressType:e,hash:t},r=l.networks.bitcoin){let n;switch(e){case"p2pkh":n=l.payments.p2pkh({hash:t,network:r});break;case"p2wpkh":n=l.payments.p2wpkh({hash:t,network:r});break;case"p2sh":n=l.payments.p2sh({hash:t,network:r});break;case"p2wsh":n=l.payments.p2wsh({hash:t,network:r});break;case"p2tr":n=l.payments.p2tr({pubkey:t,network:r});break;default:throw new Error("address type is incorrect")}return n},t.createAddressObjectByPublicKey=function({addressType:e,publicKey:t},r=l.networks.bitcoin){let n;switch(e){case"p2pkh":n=l.payments.p2pkh({pubkey:t,network:r});break;case"p2wpkh":n=l.payments.p2wpkh({pubkey:t,network:r});break;case"p2sh-p2wpkh":n=l.payments.p2sh({redeem:l.payments.p2wpkh({pubkey:t,network:r})});break;case"p2tr":n=l.payments.p2tr({internalPubkey:(i=t,32===i.length?i:i.slice(1,33)),network:r});break;default:throw new Error("address type is incorrect")}var i;return n},t.createAddressObjectByAddress=E,t.publicKeyConvertor=function(t,r=!0){return p.fromPublicKey(e.from(t,"hex"),{compressed:r}).publicKey.toString("hex")},t.addressTypeHelper={addressTypesNumber:{p2pk:0,p2pkh:1,p2sh:2,p2wpkh:3,p2wsh:4,p2tr:5},addressTypes:["p2pk","p2pkh","p2sh","p2wpkh","p2wsh","p2tr"]}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initEccLib=t.Transaction=t.opcodes=t.Psbt=t.Block=t.script=t.payments=t.networks=t.crypto=t.address=void 0;const n=r(89);t.address=n;const i=r(18);t.crypto=i;const o=r(13);t.networks=o;const a=r(36);t.payments=a;const s=r(9);t.script=s;var u=r(174);Object.defineProperty(t,"Block",{enumerable:!0,get:function(){return u.Block}});var c=r(176);Object.defineProperty(t,"Psbt",{enumerable:!0,get:function(){return c.Psbt}});var f=r(58);Object.defineProperty(t,"opcodes",{enumerable:!0,get:function(){return f.OPS}});var l=r(38);Object.defineProperty(t,"Transaction",{enumerable:!0,get:function(){return l.Transaction}});var d=r(62);Object.defineProperty(t,"initEccLib",{enumerable:!0,get:function(){return d.initEccLib}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.p2tr=t.p2wsh=t.p2wpkh=t.p2sh=t.p2pkh=t.p2pk=t.p2ms=t.embed=void 0;const n=r(157);Object.defineProperty(t,"embed",{enumerable:!0,get:function(){return n.p2data}});const i=r(162);Object.defineProperty(t,"p2ms",{enumerable:!0,get:function(){return i.p2ms}});const o=r(163);Object.defineProperty(t,"p2pk",{enumerable:!0,get:function(){return o.p2pk}});const a=r(164);Object.defineProperty(t,"p2pkh",{enumerable:!0,get:function(){return a.p2pkh}});const s=r(170);Object.defineProperty(t,"p2sh",{enumerable:!0,get:function(){return s.p2sh}});const u=r(171);Object.defineProperty(t,"p2wpkh",{enumerable:!0,get:function(){return u.p2wpkh}});const c=r(172);Object.defineProperty(t,"p2wsh",{enumerable:!0,get:function(){return c.p2wsh}});const f=r(173);Object.defineProperty(t,"p2tr",{enumerable:!0,get:function(){return f.p2tr}})},function(e,t,r){"use strict";var n=r(4).Buffer;function i(e){if(e<0||e>9007199254740991||e%1!=0)throw new RangeError("value out of range")}function o(e){return i(e),e<253?1:e<=65535?3:e<=4294967295?5:9}e.exports={encode:function e(t,r,a){if(i(t),r||(r=n.allocUnsafe(o(t))),!n.isBuffer(r))throw new TypeError("buffer must be a Buffer instance");return a||(a=0),t<253?(r.writeUInt8(t,a),e.bytes=1):t<=65535?(r.writeUInt8(253,a),r.writeUInt16LE(t,a+1),e.bytes=3):t<=4294967295?(r.writeUInt8(254,a),r.writeUInt32LE(t,a+1),e.bytes=5):(r.writeUInt8(255,a),r.writeUInt32LE(t>>>0,a+1),r.writeUInt32LE(t/4294967296|0,a+5),e.bytes=9),r},decode:function e(t,r){if(!n.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");r||(r=0);var o=t.readUInt8(r);if(o<253)return e.bytes=1,o;if(253===o)return e.bytes=3,t.readUInt16LE(r+1);if(254===o)return e.bytes=5,t.readUInt32LE(r+1);e.bytes=9;var a=t.readUInt32LE(r+1),s=4294967296*t.readUInt32LE(r+5)+a;return i(s),s},encodingLength:o}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.Transaction=void 0;const n=r(46),i=r(18),o=r(9),a=r(9),s=r(8),{typeforce:u}=s;function c(e){const t=e.length;return n.varuint.encodingLength(t)+t}const f=e.allocUnsafe(0),l=[],d=e.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),h=e.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),p=e.from("ffffffffffffffff","hex"),b={script:f,valueBuffer:p};class m{constructor(){this.version=1,this.locktime=0,this.ins=[],this.outs=[]}static fromBuffer(e,t){const r=new n.BufferReader(e),i=new m;i.version=r.readInt32();const o=r.readUInt8(),a=r.readUInt8();let s=!1;o===m.ADVANCED_TRANSACTION_MARKER&&a===m.ADVANCED_TRANSACTION_FLAG?s=!0:r.offset-=2;const u=r.readVarInt();for(let e=0;e<u;++e)i.ins.push({hash:r.readSlice(32),index:r.readUInt32(),script:r.readVarSlice(),sequence:r.readUInt32(),witness:l});const c=r.readVarInt();for(let e=0;e<c;++e)i.outs.push({value:r.readUInt64(),script:r.readVarSlice()});if(s){for(let e=0;e<u;++e)i.ins[e].witness=r.readVector();if(!i.hasWitnesses())throw new Error("Transaction has superfluous witness data")}if(i.locktime=r.readUInt32(),t)return i;if(r.offset!==e.length)throw new Error("Transaction has unexpected data");return i}static fromHex(t){return m.fromBuffer(e.from(t,"hex"),!1)}static isCoinbaseHash(e){u(s.Hash256bit,e);for(let t=0;t<32;++t)if(0!==e[t])return!1;return!0}isCoinbase(){return 1===this.ins.length&&m.isCoinbaseHash(this.ins[0].hash)}addInput(e,t,r,n){return u(s.tuple(s.Hash256bit,s.UInt32,s.maybe(s.UInt32),s.maybe(s.Buffer)),arguments),s.Null(r)&&(r=m.DEFAULT_SEQUENCE),this.ins.push({hash:e,index:t,script:n||f,sequence:r,witness:l})-1}addOutput(e,t){return u(s.tuple(s.Buffer,s.Satoshi),arguments),this.outs.push({script:e,value:t})-1}hasWitnesses(){return this.ins.some(e=>0!==e.witness.length)}weight(){return 3*this.byteLength(!1)+this.byteLength(!0)}virtualSize(){return Math.ceil(this.weight()/4)}byteLength(e=!0){const t=e&&this.hasWitnesses();return(t?10:8)+n.varuint.encodingLength(this.ins.length)+n.varuint.encodingLength(this.outs.length)+this.ins.reduce((e,t)=>e+40+c(t.script),0)+this.outs.reduce((e,t)=>e+8+c(t.script),0)+(t?this.ins.reduce((e,t)=>e+function(e){const t=e.length;return n.varuint.encodingLength(t)+e.reduce((e,t)=>e+c(t),0)}(t.witness),0):0)}clone(){const e=new m;return e.version=this.version,e.locktime=this.locktime,e.ins=this.ins.map(e=>({hash:e.hash,index:e.index,script:e.script,sequence:e.sequence,witness:e.witness})),e.outs=this.outs.map(e=>({script:e.script,value:e.value})),e}hashForSignature(t,r,n){if(u(s.tuple(s.UInt32,s.Buffer,s.Number),arguments),t>=this.ins.length)return h;const c=o.compile(o.decompile(r).filter(e=>e!==a.OPS.OP_CODESEPARATOR)),l=this.clone();if((31&n)===m.SIGHASH_NONE)l.outs=[],l.ins.forEach((e,r)=>{r!==t&&(e.sequence=0)});else if((31&n)===m.SIGHASH_SINGLE){if(t>=this.outs.length)return h;l.outs.length=t+1;for(let e=0;e<t;e++)l.outs[e]=b;l.ins.forEach((e,r)=>{r!==t&&(e.sequence=0)})}n&m.SIGHASH_ANYONECANPAY?(l.ins=[l.ins[t]],l.ins[0].script=c):(l.ins.forEach(e=>{e.script=f}),l.ins[t].script=c);const d=e.allocUnsafe(l.byteLength(!1)+4);return d.writeInt32LE(n,d.length-4),l.__toBuffer(d,0,!1),i.hash256(d)}hashForWitnessV1(t,r,o,a,l,d){if(u(s.tuple(s.UInt32,u.arrayOf(s.Buffer),u.arrayOf(s.Satoshi),s.UInt32),arguments),o.length!==this.ins.length||r.length!==this.ins.length)throw new Error("Must supply prevout script and value for all inputs");const h=a===m.SIGHASH_DEFAULT?m.SIGHASH_ALL:a&m.SIGHASH_OUTPUT_MASK,p=(a&m.SIGHASH_INPUT_MASK)===m.SIGHASH_ANYONECANPAY,b=h===m.SIGHASH_NONE,g=h===m.SIGHASH_SINGLE;let y=f,v=f,w=f,_=f,E=f;if(!p){let e=n.BufferWriter.withCapacity(36*this.ins.length);this.ins.forEach(t=>{e.writeSlice(t.hash),e.writeUInt32(t.index)}),y=i.sha256(e.end()),e=n.BufferWriter.withCapacity(8*this.ins.length),o.forEach(t=>e.writeUInt64(t)),v=i.sha256(e.end()),e=n.BufferWriter.withCapacity(r.map(c).reduce((e,t)=>e+t)),r.forEach(t=>e.writeVarSlice(t)),w=i.sha256(e.end()),e=n.BufferWriter.withCapacity(4*this.ins.length),this.ins.forEach(t=>e.writeUInt32(t.sequence)),_=i.sha256(e.end())}if(b||g){if(g&&t<this.outs.length){const e=this.outs[t],r=n.BufferWriter.withCapacity(8+c(e.script));r.writeUInt64(e.value),r.writeVarSlice(e.script),E=i.sha256(r.end())}}else{const e=this.outs.map(e=>8+c(e.script)).reduce((e,t)=>e+t),t=n.BufferWriter.withCapacity(e);this.outs.forEach(e=>{t.writeUInt64(e.value),t.writeVarSlice(e.script)}),E=i.sha256(t.end())}const k=(l?2:0)+(d?1:0),S=174-(p?49:0)-(b?32:0)+(d?32:0)+(l?37:0),x=n.BufferWriter.withCapacity(S);if(x.writeUInt8(a),x.writeInt32(this.version),x.writeUInt32(this.locktime),x.writeSlice(y),x.writeSlice(v),x.writeSlice(w),x.writeSlice(_),b||g||x.writeSlice(E),x.writeUInt8(k),p){const e=this.ins[t];x.writeSlice(e.hash),x.writeUInt32(e.index),x.writeUInt64(o[t]),x.writeVarSlice(r[t]),x.writeUInt32(e.sequence)}else x.writeUInt32(t);if(d){const e=n.BufferWriter.withCapacity(c(d));e.writeVarSlice(d),x.writeSlice(i.sha256(e.end()))}return g&&x.writeSlice(E),l&&(x.writeSlice(l),x.writeUInt8(0),x.writeUInt32(4294967295)),i.taggedHash("TapSighash",e.concat([e.from([0]),x.end()]))}hashForWitnessV0(t,r,o,a){u(s.tuple(s.UInt32,s.Buffer,s.Satoshi,s.UInt32),arguments);let f,l=e.from([]),h=d,p=d,b=d;if(a&m.SIGHASH_ANYONECANPAY||(l=e.allocUnsafe(36*this.ins.length),f=new n.BufferWriter(l,0),this.ins.forEach(e=>{f.writeSlice(e.hash),f.writeUInt32(e.index)}),p=i.hash256(l)),a&m.SIGHASH_ANYONECANPAY||(31&a)===m.SIGHASH_SINGLE||(31&a)===m.SIGHASH_NONE||(l=e.allocUnsafe(4*this.ins.length),f=new n.BufferWriter(l,0),this.ins.forEach(e=>{f.writeUInt32(e.sequence)}),b=i.hash256(l)),(31&a)!==m.SIGHASH_SINGLE&&(31&a)!==m.SIGHASH_NONE){const t=this.outs.reduce((e,t)=>e+8+c(t.script),0);l=e.allocUnsafe(t),f=new n.BufferWriter(l,0),this.outs.forEach(e=>{f.writeUInt64(e.value),f.writeVarSlice(e.script)}),h=i.hash256(l)}else if((31&a)===m.SIGHASH_SINGLE&&t<this.outs.length){const r=this.outs[t];l=e.allocUnsafe(8+c(r.script)),f=new n.BufferWriter(l,0),f.writeUInt64(r.value),f.writeVarSlice(r.script),h=i.hash256(l)}l=e.allocUnsafe(156+c(r)),f=new n.BufferWriter(l,0);const g=this.ins[t];return f.writeInt32(this.version),f.writeSlice(p),f.writeSlice(b),f.writeSlice(g.hash),f.writeUInt32(g.index),f.writeVarSlice(r),f.writeUInt64(o),f.writeUInt32(g.sequence),f.writeSlice(h),f.writeUInt32(this.locktime),f.writeUInt32(a),i.hash256(l)}getHash(t){return t&&this.isCoinbase()?e.alloc(32,0):i.hash256(this.__toBuffer(void 0,void 0,t))}getId(){return(0,n.reverseBuffer)(this.getHash(!1)).toString("hex")}toBuffer(e,t){return this.__toBuffer(e,t,!0)}toHex(){return this.toBuffer(void 0,void 0).toString("hex")}setInputScript(e,t){u(s.tuple(s.Number,s.Buffer),arguments),this.ins[e].script=t}setWitness(e,t){u(s.tuple(s.Number,[s.Buffer]),arguments),this.ins[e].witness=t}__toBuffer(t,r,i=!1){t||(t=e.allocUnsafe(this.byteLength(i)));const o=new n.BufferWriter(t,r||0);o.writeInt32(this.version);const a=i&&this.hasWitnesses();return a&&(o.writeUInt8(m.ADVANCED_TRANSACTION_MARKER),o.writeUInt8(m.ADVANCED_TRANSACTION_FLAG)),o.writeVarInt(this.ins.length),this.ins.forEach(e=>{o.writeSlice(e.hash),o.writeUInt32(e.index),o.writeVarSlice(e.script),o.writeUInt32(e.sequence)}),o.writeVarInt(this.outs.length),this.outs.forEach(e=>{void 0!==e.value?o.writeUInt64(e.value):o.writeSlice(e.valueBuffer),o.writeVarSlice(e.script)}),a&&this.ins.forEach(e=>{o.writeVector(e.witness)}),o.writeUInt32(this.locktime),void 0!==r?t.slice(r,o.offset):t}}t.Transaction=m,m.DEFAULT_SEQUENCE=4294967295,m.SIGHASH_DEFAULT=0,m.SIGHASH_ALL=1,m.SIGHASH_NONE=2,m.SIGHASH_SINGLE=3,m.SIGHASH_ANYONECANPAY=128,m.SIGHASH_OUTPUT_MASK=3,m.SIGHASH_INPUT_MASK=128,m.ADVANCED_TRANSACTION_MARKER=0,m.ADVANCED_TRANSACTION_FLAG=1}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(70),i=r(239);e.exports=i((function(e){var t=n("sha256").update(e).digest();return n("sha256").update(t).digest()}))},function(e,t,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}g(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&g(e,"error",t,r)}(e,i,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function f(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var i,o,a,s;if(c(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=f(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function d(){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(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=d.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):m(i,i.length)}function b(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),s.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},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return f(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var c=u.length,f=m(u,c);for(r=0;r<c;++r)o(f[r],this,t)}return!0},s.prototype.addListener=function(e,t){return l(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return l(this,e,t,!0)},s.prototype.once=function(e,t){return c(t),this.on(e,h(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,h(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,n,i,o,a;if(c(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):b.call(e,t)},s.prototype.listenerCount=b,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t,r){"use strict";var n=r(47).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.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(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=l,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function f(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=a(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=a(t[n]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=a(t[n]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(0).Buffer.isBuffer},function(e,t,r){"use strict";var n=r(15),i=r(24);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;const n=r(60),i=r(21);class o extends i.Hash{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,i.createView)(this.buffer)}update(e){n.default.exists(this);const{view:t,buffer:r,blockLen:o}=this,a=(e=(0,i.toBytes)(e)).length;for(let n=0;n<a;){const s=Math.min(o-this.pos,a-n);if(s!==o)r.set(e.subarray(n,n+s),this.pos),this.pos+=s,n+=s,this.pos===o&&(this.process(t,0),this.pos=0);else{const t=(0,i.createView)(e);for(;o<=a-n;n+=o)this.process(t,n)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){n.default.exists(this),n.default.output(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:o,isLE:a}=this;let{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>o-s&&(this.process(r,0),s=0);for(let e=s;e<o;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),a=Number(r>>i&o),s=Number(r&o),u=n?4:0,c=n?0:4;e.setUint32(t+u,a,n),e.setUint32(t+c,s,n)}(r,o-8,BigInt(8*this.length),a),this.process(r,0);const u=(0,i.createView)(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const f=c/4,l=this.get();if(f>l.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<f;e++)u.setUint32(4*e,l[e],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:a}=this;return e.length=n,e.pos=a,e.finished=i,e.destroyed=o,n%t&&e.buffer.set(r),e}}t.SHA2=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bech32m=t.bech32=void 0;const n="qpzry9x8gf2tvdw0s3jn54khce6mua7l",i={};for(let e=0;e<n.length;e++){const t=n.charAt(e);i[t]=e}function o(e){const t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function a(e){let t=1;for(let r=0;r<e.length;++r){const n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=o(t)^n>>5}t=o(t);for(let r=0;r<e.length;++r){const n=e.charCodeAt(r);t=o(t)^31&n}return t}function s(e,t,r,n){let i=0,o=0;const a=(1<<r)-1,s=[];for(let n=0;n<e.length;++n)for(i=i<<t|e[n],o+=t;o>=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<<r-o&a);else{if(o>=t)return"Excess padding";if(i<<r-o&a)return"Non-zero padding"}return s}function u(e){return s(e,8,5,!0)}function c(e){const t=s(e,5,8,!1);if(Array.isArray(t))return t}function f(e){const t=s(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}function l(e){let t;function r(e,r){if(r=r||90,e.length<8)return e+" too short";if(e.length>r)return"Exceeds length limit";const n=e.toLowerCase(),s=e.toUpperCase();if(e!==n&&e!==s)return"Mixed-case string "+e;const u=(e=n).lastIndexOf("1");if(-1===u)return"No separator character for "+e;if(0===u)return"Missing prefix for "+e;const c=e.slice(0,u),f=e.slice(u+1);if(f.length<6)return"Data too short";let l=a(c);if("string"==typeof l)return l;const d=[];for(let e=0;e<f.length;++e){const t=f.charAt(e),r=i[t];if(void 0===r)return"Unknown character "+t;l=o(l)^r,e+6>=f.length||d.push(r)}return l!==t?"Invalid checksum for "+e:{prefix:c,words:d}}return t="bech32"===e?1:734539939,{decodeUnsafe:function(e,t){const n=r(e,t);if("object"==typeof n)return n},decode:function(e,t){const n=r(e,t);if("object"==typeof n)return n;throw new Error(n)},encode:function(e,r,i){if(i=i||90,e.length+7+r.length>i)throw new TypeError("Exceeds length limit");let s=a(e=e.toLowerCase());if("string"==typeof s)throw new Error(s);let u=e+"1";for(let e=0;e<r.length;++e){const t=r[e];if(t>>5!=0)throw new Error("Non 5-bit word");s=o(s)^t,u+=n.charAt(t)}for(let e=0;e<6;++e)s=o(s);s^=t;for(let e=0;e<6;++e){u+=n.charAt(s>>5*(5-e)&31)}return u},toWords:u,fromWordsUnsafe:c,fromWords:f}}t.bech32=l("bech32"),t.bech32m=l("bech32m")},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.BufferReader=t.BufferWriter=t.cloneBuffer=t.reverseBuffer=t.writeUInt64LE=t.readUInt64LE=t.varuint=void 0;const n=r(8),{typeforce:i}=n,o=r(37);function a(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}function s(e,t){const r=e.readUInt32LE(t);let n=e.readUInt32LE(t+4);return n*=4294967296,a(n+r,9007199254740991),n+r}function u(e,t,r){return a(t,9007199254740991),e.writeInt32LE(-1&t,r),e.writeUInt32LE(Math.floor(t/4294967296),r+4),r+8}t.varuint=o,t.readUInt64LE=s,t.writeUInt64LE=u,t.reverseBuffer=function(e){if(e.length<1)return e;let t=e.length-1,r=0;for(let n=0;n<e.length/2;n++)r=e[n],e[n]=e[t],e[t]=r,t--;return e},t.cloneBuffer=function(t){const r=e.allocUnsafe(t.length);return t.copy(r),r};class c{static withCapacity(t){return new c(e.alloc(t))}constructor(e,t=0){this.buffer=e,this.offset=t,i(n.tuple(n.Buffer,n.UInt32),[e,t])}writeUInt8(e){this.offset=this.buffer.writeUInt8(e,this.offset)}writeInt32(e){this.offset=this.buffer.writeInt32LE(e,this.offset)}writeUInt32(e){this.offset=this.buffer.writeUInt32LE(e,this.offset)}writeUInt64(e){this.offset=u(this.buffer,e,this.offset)}writeVarInt(e){o.encode(e,this.buffer,this.offset),this.offset+=o.encode.bytes}writeSlice(e){if(this.buffer.length<this.offset+e.length)throw new Error("Cannot write slice out of bounds");this.offset+=e.copy(this.buffer,this.offset)}writeVarSlice(e){this.writeVarInt(e.length),this.writeSlice(e)}writeVector(e){this.writeVarInt(e.length),e.forEach(e=>this.writeVarSlice(e))}end(){if(this.buffer.length===this.offset)return this.buffer;throw new Error(`buffer size ${this.buffer.length}, offset ${this.offset}`)}}t.BufferWriter=c;t.BufferReader=class{constructor(e,t=0){this.buffer=e,this.offset=t,i(n.tuple(n.Buffer,n.UInt32),[e,t])}readUInt8(){const e=this.buffer.readUInt8(this.offset);return this.offset++,e}readInt32(){const e=this.buffer.readInt32LE(this.offset);return this.offset+=4,e}readUInt32(){const e=this.buffer.readUInt32LE(this.offset);return this.offset+=4,e}readUInt64(){const e=s(this.buffer,this.offset);return this.offset+=8,e}readVarInt(){const e=o.decode(this.buffer,this.offset);return this.offset+=o.decode.bytes,e}readSlice(e){if(this.buffer.length<this.offset+e)throw new Error("Cannot read slice out of bounds");const t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}readVarSlice(){return this.readSlice(this.readVarInt())}readVector(){const e=this.readVarInt(),t=[];for(let r=0;r<e;r++)t.push(this.readVarSlice());return t}}}).call(this,r(0).Buffer)},function(e,t,r){var n=r(0),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,n)}));case 4:return t.nextTick((function(){e.call(null,r,n,i)}));default:for(o=new Array(s-1),a=0;a<o.length;)o[a++]=arguments[a];return t.nextTick((function(){e.apply(null,o)}))}}}:e.exports=t}).call(this,r(10))},function(e,t,r){"use strict";var n=r(14),i=r(11),o=i.getNAF,a=i.getJSF,s=i.assert;function u(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){s(e.precomputed);var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var a,u,c=[];for(a=0;a<n.length;a+=r.step){u=0;for(var f=a+r.step-1;f>=a;f--)u=(u<<1)+n[f];c.push(u)}for(var l=this.jpoint(null,null,null),d=this.jpoint(null,null,null),h=i;h>0;h--){for(a=0;a<c.length;a++)(u=c[a])===h?d=d.mixedAdd(r.points[a]):u===-h&&(d=d.mixedAdd(r.points[a].neg()));l=l.add(d)}return l.toP()},u.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,a=o(t,r,this._bitLength),u=this.jpoint(null,null,null),c=a.length-1;c>=0;c--){for(var f=0;c>=0&&0===a[c];c--)f++;if(c>=0&&f++,u=u.dblp(f),c<0)break;var l=a[c];s(0!==l),u="affine"===e.type?l>0?u.mixedAdd(i[l-1>>1]):u.mixedAdd(i[-l-1>>1].neg()):l>0?u.add(i[l-1>>1]):u.add(i[-l-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,n,i){var s,u,c,f=this._wnafT1,l=this._wnafT2,d=this._wnafT3,h=0;for(s=0;s<n;s++){var p=(c=t[s])._getNAFPoints(e);f[s]=p.wnd,l[s]=p.points}for(s=n-1;s>=1;s-=2){var b=s-1,m=s;if(1===f[b]&&1===f[m]){var g=[t[b],null,null,t[m]];0===t[b].y.cmp(t[m].y)?(g[1]=t[b].add(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg())):0===t[b].y.cmp(t[m].y.redNeg())?(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].add(t[m].neg())):(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],v=a(r[b],r[m]);for(h=Math.max(v[0].length,h),d[b]=new Array(h),d[m]=new Array(h),u=0;u<h;u++){var w=0|v[0][u],_=0|v[1][u];d[b][u]=y[3*(w+1)+(_+1)],d[m][u]=0,l[b]=g}}else d[b]=o(r[b],f[b],this._bitLength),d[m]=o(r[m],f[m],this._bitLength),h=Math.max(d[b].length,h),h=Math.max(d[m].length,h)}var E=this.jpoint(null,null,null),k=this._wnafT4;for(s=h;s>=0;s--){for(var S=0;s>=0;){var x=!0;for(u=0;u<n;u++)k[u]=0|d[u][s],0!==k[u]&&(x=!1);if(!x)break;S++,s--}if(s>=0&&S++,E=E.dblp(S),s<0)break;for(u=0;u<n;u++){var T=k[u];0!==T&&(T>0?c=l[u][T-1>>1]:T<0&&(c=l[u][-T-1>>1].neg()),E="affine"===c.type?E.mixedAdd(c):E.add(c))}}for(s=0;s<n;s++)l[s]=null;return i?E:E.toP()},u.BasePoint=c,c.prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(e,t){e=i.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?s(e[e.length-1]%2==0):7===e[0]&&s(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(e){return this.encode(e,!0)},c.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},c.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},c.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},c.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},c.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(271);t.embed=n.p2data;const i=r(277);t.p2ms=i.p2ms;const o=r(278);t.p2pk=o.p2pk;const a=r(279);t.p2pkh=a.p2pkh;const s=r(280);t.p2sh=s.p2sh;const u=r(281);t.p2wpkh=u.p2wpkh;const c=r(282);t.p2wsh=c.p2wsh},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(16),i=r(3),o=r(37);function a(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}function s(e,t){const r=e.readUInt32LE(t);let n=e.readUInt32LE(t+4);return n*=4294967296,a(n+r,9007199254740991),n+r}function u(e,t,r){return a(t,9007199254740991),e.writeInt32LE(-1&t,r),e.writeUInt32LE(Math.floor(t/4294967296),r+4),r+8}t.readUInt64LE=s,t.writeUInt64LE=u,t.reverseBuffer=function(e){if(e.length<1)return e;let t=e.length-1,r=0;for(let n=0;n<e.length/2;n++)r=e[n],e[n]=e[t],e[t]=r,t--;return e},t.cloneBuffer=function(t){const r=e.allocUnsafe(t.length);return t.copy(r),r};t.BufferWriter=class{constructor(e,t=0){this.buffer=e,this.offset=t,i(n.tuple(n.Buffer,n.UInt32),[e,t])}writeUInt8(e){this.offset=this.buffer.writeUInt8(e,this.offset)}writeInt32(e){this.offset=this.buffer.writeInt32LE(e,this.offset)}writeUInt32(e){this.offset=this.buffer.writeUInt32LE(e,this.offset)}writeUInt64(e){this.offset=u(this.buffer,e,this.offset)}writeVarInt(e){o.encode(e,this.buffer,this.offset),this.offset+=o.encode.bytes}writeSlice(e){if(this.buffer.length<this.offset+e.length)throw new Error("Cannot write slice out of bounds");this.offset+=e.copy(this.buffer,this.offset)}writeVarSlice(e){this.writeVarInt(e.length),this.writeSlice(e)}writeVector(e){this.writeVarInt(e.length),e.forEach(e=>this.writeVarSlice(e))}};t.BufferReader=class{constructor(e,t=0){this.buffer=e,this.offset=t,i(n.tuple(n.Buffer,n.UInt32),[e,t])}readUInt8(){const e=this.buffer.readUInt8(this.offset);return this.offset++,e}readInt32(){const e=this.buffer.readInt32LE(this.offset);return this.offset+=4,e}readUInt32(){const e=this.buffer.readUInt32LE(this.offset);return this.offset+=4,e}readUInt64(){const e=s(this.buffer,this.offset);return this.offset+=8,e}readVarInt(){const e=o.decode(this.buffer,this.offset);return this.offset+=o.decode.bytes,e}readSlice(e){if(this.buffer.length<this.offset+e)throw new Error("Cannot read slice out of bounds");const t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}readVarSlice(){return this.readSlice(this.readVarInt())}readVector(){const e=this.readVarInt(),t=[];for(let r=0;r<e;r++)t.push(this.readVarSlice());return t}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(51),i=r(19),o=r(1),a=r(1),s=r(16),u=r(3),c=r(37);function f(e){const t=e.length;return c.encodingLength(t)+t}const l=e.allocUnsafe(0),d=[],h=e.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),p=e.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),b=e.from("ffffffffffffffff","hex"),m={script:l,valueBuffer:b};class g{constructor(){this.version=1,this.locktime=0,this.ins=[],this.outs=[]}static fromBuffer(e,t){const r=new n.BufferReader(e),i=new g;i.version=r.readInt32();const o=r.readUInt8(),a=r.readUInt8();let s=!1;o===g.ADVANCED_TRANSACTION_MARKER&&a===g.ADVANCED_TRANSACTION_FLAG?s=!0:r.offset-=2;const u=r.readVarInt();for(let e=0;e<u;++e)i.ins.push({hash:r.readSlice(32),index:r.readUInt32(),script:r.readVarSlice(),sequence:r.readUInt32(),witness:d});const c=r.readVarInt();for(let e=0;e<c;++e)i.outs.push({value:r.readUInt64(),script:r.readVarSlice()});if(s){for(let e=0;e<u;++e)i.ins[e].witness=r.readVector();if(!i.hasWitnesses())throw new Error("Transaction has superfluous witness data")}if(i.locktime=r.readUInt32(),t)return i;if(r.offset!==e.length)throw new Error("Transaction has unexpected data");return i}static fromHex(t){return g.fromBuffer(e.from(t,"hex"),!1)}static isCoinbaseHash(e){u(s.Hash256bit,e);for(let t=0;t<32;++t)if(0!==e[t])return!1;return!0}isCoinbase(){return 1===this.ins.length&&g.isCoinbaseHash(this.ins[0].hash)}addInput(e,t,r,n){return u(s.tuple(s.Hash256bit,s.UInt32,s.maybe(s.UInt32),s.maybe(s.Buffer)),arguments),s.Null(r)&&(r=g.DEFAULT_SEQUENCE),this.ins.push({hash:e,index:t,script:n||l,sequence:r,witness:d})-1}addOutput(e,t){return u(s.tuple(s.Buffer,s.Satoshi),arguments),this.outs.push({script:e,value:t})-1}hasWitnesses(){return this.ins.some(e=>0!==e.witness.length)}weight(){return 3*this.byteLength(!1)+this.byteLength(!0)}virtualSize(){return Math.ceil(this.weight()/4)}byteLength(e=!0){const t=e&&this.hasWitnesses();return(t?10:8)+c.encodingLength(this.ins.length)+c.encodingLength(this.outs.length)+this.ins.reduce((e,t)=>e+40+f(t.script),0)+this.outs.reduce((e,t)=>e+8+f(t.script),0)+(t?this.ins.reduce((e,t)=>e+function(e){const t=e.length;return c.encodingLength(t)+e.reduce((e,t)=>e+f(t),0)}(t.witness),0):0)}clone(){const e=new g;return e.version=this.version,e.locktime=this.locktime,e.ins=this.ins.map(e=>({hash:e.hash,index:e.index,script:e.script,sequence:e.sequence,witness:e.witness})),e.outs=this.outs.map(e=>({script:e.script,value:e.value})),e}hashForSignature(t,r,n){if(u(s.tuple(s.UInt32,s.Buffer,s.Number),arguments),t>=this.ins.length)return p;const c=o.compile(o.decompile(r).filter(e=>e!==a.OPS.OP_CODESEPARATOR)),f=this.clone();if((31&n)===g.SIGHASH_NONE)f.outs=[],f.ins.forEach((e,r)=>{r!==t&&(e.sequence=0)});else if((31&n)===g.SIGHASH_SINGLE){if(t>=this.outs.length)return p;f.outs.length=t+1;for(let e=0;e<t;e++)f.outs[e]=m;f.ins.forEach((e,r)=>{r!==t&&(e.sequence=0)})}n&g.SIGHASH_ANYONECANPAY?(f.ins=[f.ins[t]],f.ins[0].script=c):(f.ins.forEach(e=>{e.script=l}),f.ins[t].script=c);const d=e.allocUnsafe(f.byteLength(!1)+4);return d.writeInt32LE(n,d.length-4),f.__toBuffer(d,0,!1),i.hash256(d)}hashForWitnessV0(t,r,o,a){u(s.tuple(s.UInt32,s.Buffer,s.Satoshi,s.UInt32),arguments);let c,l=e.from([]),d=h,p=h,b=h;if(a&g.SIGHASH_ANYONECANPAY||(l=e.allocUnsafe(36*this.ins.length),c=new n.BufferWriter(l,0),this.ins.forEach(e=>{c.writeSlice(e.hash),c.writeUInt32(e.index)}),p=i.hash256(l)),a&g.SIGHASH_ANYONECANPAY||(31&a)===g.SIGHASH_SINGLE||(31&a)===g.SIGHASH_NONE||(l=e.allocUnsafe(4*this.ins.length),c=new n.BufferWriter(l,0),this.ins.forEach(e=>{c.writeUInt32(e.sequence)}),b=i.hash256(l)),(31&a)!==g.SIGHASH_SINGLE&&(31&a)!==g.SIGHASH_NONE){const t=this.outs.reduce((e,t)=>e+8+f(t.script),0);l=e.allocUnsafe(t),c=new n.BufferWriter(l,0),this.outs.forEach(e=>{c.writeUInt64(e.value),c.writeVarSlice(e.script)}),d=i.hash256(l)}else if((31&a)===g.SIGHASH_SINGLE&&t<this.outs.length){const r=this.outs[t];l=e.allocUnsafe(8+f(r.script)),c=new n.BufferWriter(l,0),c.writeUInt64(r.value),c.writeVarSlice(r.script),d=i.hash256(l)}l=e.allocUnsafe(156+f(r)),c=new n.BufferWriter(l,0);const m=this.ins[t];return c.writeUInt32(this.version),c.writeSlice(p),c.writeSlice(b),c.writeSlice(m.hash),c.writeUInt32(m.index),c.writeVarSlice(r),c.writeUInt64(o),c.writeUInt32(m.sequence),c.writeSlice(d),c.writeUInt32(this.locktime),c.writeUInt32(a),i.hash256(l)}getHash(t){return t&&this.isCoinbase()?e.alloc(32,0):i.hash256(this.__toBuffer(void 0,void 0,t))}getId(){return n.reverseBuffer(this.getHash(!1)).toString("hex")}toBuffer(e,t){return this.__toBuffer(e,t,!0)}toHex(){return this.toBuffer(void 0,void 0).toString("hex")}setInputScript(e,t){u(s.tuple(s.Number,s.Buffer),arguments),this.ins[e].script=t}setWitness(e,t){u(s.tuple(s.Number,[s.Buffer]),arguments),this.ins[e].witness=t}__toBuffer(t,r,i=!1){t||(t=e.allocUnsafe(this.byteLength(i)));const o=new n.BufferWriter(t,r||0);o.writeInt32(this.version);const a=i&&this.hasWitnesses();return a&&(o.writeUInt8(g.ADVANCED_TRANSACTION_MARKER),o.writeUInt8(g.ADVANCED_TRANSACTION_FLAG)),o.writeVarInt(this.ins.length),this.ins.forEach(e=>{o.writeSlice(e.hash),o.writeUInt32(e.index),o.writeVarSlice(e.script),o.writeUInt32(e.sequence)}),o.writeVarInt(this.outs.length),this.outs.forEach(e=>{void 0!==e.value?o.writeUInt64(e.value):o.writeSlice(e.valueBuffer),o.writeVarSlice(e.script)}),a&&this.ins.forEach(e=>{o.writeVector(e.witness)}),o.writeUInt32(this.locktime),void 0!==r?t.slice(r,o.offset):t}}g.DEFAULT_SEQUENCE=4294967295,g.SIGHASH_ALL=1,g.SIGHASH_NONE=2,g.SIGHASH_SINGLE=3,g.SIGHASH_ANYONECANPAY=128,g.ADVANCED_TRANSACTION_MARKER=0,g.ADVANCED_TRANSACTION_FLAG=1,t.Transaction=g}).call(this,r(0).Buffer)},function(e,t){function r(e){return 41+(e.script?e.script.length:107)}function n(e){return 9+(e.script?e.script.length:25)}function i(e,t){return r({})*t}function o(e,t){return 10+e.reduce((function(e,t){return e+r(t)}),0)+t.reduce((function(e,t){return e+n(t)}),0)}function a(e){return"number"!=typeof e?NaN:isFinite(e)?Math.floor(e)!==e||e<0?NaN:e:NaN}function s(e){return e.reduce((function(e,t){return e+a(t.value)}),0)}var u=n({});e.exports={dustThreshold:i,finalize:function(e,t,r){var n=o(e,t),a=r*(n+u),c=s(e)-(s(t)+a);c>i(0,r)&&(t=t.concat({value:c}));var f=s(e)-s(t);return isFinite(f)?{inputs:e,outputs:t,fee:f}:{fee:r*n}},inputBytes:r,outputBytes:n,sumOrNaN:s,sumForgiving:function(e){return e.reduce((function(e,t){return e+(isFinite(t.value)?t.value:0)}),0)},transactionBytes:o,uintOrNaN:a}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getAxiosInstance=t.getRandomInteger=t.runWithRetries=t.sleep=void 0;const o=i(r(315));function a(e){return new Promise(t=>setTimeout(t,e))}t.sleep=a,t.runWithRetries=function(e,t={maxTries:2,retrySleep:1e3}){return n(this,void 0,void 0,(function*(){const r=t.maxTries||2,n=t.retrySleep||1e3;let i;for(let t=0;t<r;t+=1){try{return yield e()}catch(e){i=e}yield a(n)}throw i||new Error("function failed after retries")}))},t.getRandomInteger=function(e,t){return Math.floor(Math.random()*(t-e))+e},t.getAxiosInstance=function({baseUrl:e,timeout:t=1e4,headers:r={},auth:n}){let i,a=e;return i=o.default.create({baseURL:a,timeout:t,auth:n,headers:Object.assign({},r)}),i.interceptors.response.use(e=>e,e=>{if(e.response){const t=new Error(JSON.stringify({data:e.response.data,message:e.message}));return Promise.reject(t)}if(e.request){const t=new Error(e.message);return Promise.reject(t)}return Promise.reject(e)}),i}},function(e,t,r){"use strict";var n=r(32);function i(e){n.call(this,null==e?"canceled":e,n.ERR_CANCELED),this.name="CanceledError"}r(6).inherits(i,n,{__CANCEL__:!0}),e.exports=i},function(e,t,r){"use strict";var n=r(33);function i(e){n.call(this,null==e?"canceled":e,n.ERR_CANCELED),this.name="CanceledError"}r(7).inherits(i,n,{__CANCEL__:!0}),e.exports=i},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const a=o(r(35)),s={bitcoin:a.networks.bitcoin,bitcoin_testnet:a.networks.testnet,litecoin:{messagePrefix:"Litecoin Signed Message:\n",bech32:"ltc",bip32:{public:76067358,private:76066276},pubKeyHash:48,scriptHash:50,wif:176},litecoin_testnet:{messagePrefix:"Litecoin Signed Message:\n",bech32:"tltc",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:58,wif:239}};t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.REVERSE_OPS=t.OPS=void 0;const n={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_CHECKSIGADD:186,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255};t.OPS=n;const i={};t.REVERSE_OPS=i;for(const e of Object.keys(n)){i[n[e]]=e}},function(e,t){var r={Array:function(e){return null!=e&&e.constructor===Array},Boolean:function(e){return"boolean"==typeof e},Function:function(e){return"function"==typeof e},Nil:function(e){return null==e},Number:function(e){return"number"==typeof e},Object:function(e){return"object"==typeof e},String:function(e){return"string"==typeof e},"":function(){return!0}};for(var n in r.Null=r.Nil,r)r[n].toJSON=function(e){return e}.bind(null,n);e.exports=r},function(e,t,r){"use strict";function n(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Wrong positive integer: "+e)}function i(e){if("boolean"!=typeof e)throw new Error("Expected boolean, not "+e)}function o(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function a(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");n(e.outputLen),n(e.blockLen)}function s(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function u(e,t){o(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=void 0,t.number=n,t.bool=i,t.bytes=o,t.hash=a,t.exists=s,t.output=u;const c={number:n,bool:i,bytes:o,hash:a,exists:s,output:u};t.default=c},function(e,t,r){"use strict";var{sha256:n}=r(27),i=r(167);e.exports=i((function(e){return n(n(e))}))},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.getEccLib=t.initEccLib=void 0;const r={};t.initEccLib=function(t){var a;t?t!==r.eccLib&&(i("function"==typeof(a=t).isXOnlyPoint),i(a.isXOnlyPoint(n("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),i(a.isXOnlyPoint(n("fffffffffffffffffffffffffffffffffffffffffffffffffffffffeeffffc2e"))),i(a.isXOnlyPoint(n("f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9"))),i(a.isXOnlyPoint(n("0000000000000000000000000000000000000000000000000000000000000001"))),i(!a.isXOnlyPoint(n("0000000000000000000000000000000000000000000000000000000000000000"))),i(!a.isXOnlyPoint(n("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"))),i("function"==typeof a.xOnlyPointAddTweak),o.forEach(t=>{const r=a.xOnlyPointAddTweak(n(t.pubkey),n(t.tweak));null===t.result?i(null===r):(i(null!==r),i(r.parity===t.parity),i(e.from(r.xOnlyPubkey).equals(n(t.result))))}),r.eccLib=t):r.eccLib=t},t.getEccLib=function(){if(!r.eccLib)throw new Error("No ECC Library provided. You must call initEccLib() with a valid TinySecp256k1Interface instance");return r.eccLib};const n=t=>e.from(t,"hex");function i(e){if(!e)throw new Error("ecc library invalid")}const o=[{pubkey:"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",tweak:"fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140",parity:-1,result:null},{pubkey:"1617d38ed8d8657da4d4761e8057bc396ea9e4b9d29776d4be096016dbd2509b",tweak:"a8397a935f0dfceba6ba9618f6451ef4d80637abf4e6af2669fbc9de6a8fd2ac",parity:1,result:"e478f99dab91052ab39a33ea35fd5e6e4933f4d28023cd597c9a1f6760346adf"},{pubkey:"2c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991",tweak:"823c3cd2142744b075a87eade7e1b8678ba308d566226a0056ca2b7a76f86b47",parity:0,result:"9534f8dc8c6deda2dc007655981c78b49c5d96c778fbf363462a11ec9dfd948c"}]}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tweakKey=t.tapTweakHash=t.tapleafHash=t.findScriptPath=t.toHashTree=t.rootHashFromPath=t.MAX_TAPTREE_DEPTH=t.LEAF_VERSION_TAPSCRIPT=void 0;const n=r(0),i=r(62),o=r(18),a=r(46),s=r(8);t.LEAF_VERSION_TAPSCRIPT=192,t.MAX_TAPTREE_DEPTH=128;function u(e){const r=e.version||t.LEAF_VERSION_TAPSCRIPT;return o.taggedHash("TapLeaf",n.Buffer.concat([n.Buffer.from([r]),l(e.output)]))}function c(e,t){return o.taggedHash("TapTweak",n.Buffer.concat(t?[e,t]:[e]))}function f(e,t){return o.taggedHash("TapBranch",n.Buffer.concat([e,t]))}function l(e){const t=a.varuint.encodingLength(e.length),r=n.Buffer.allocUnsafe(t);return a.varuint.encode(e.length,r),n.Buffer.concat([r,e])}t.rootHashFromPath=function(e,t){if(e.length<33)throw new TypeError(`The control-block length is too small. Got ${e.length}, expected min 33.`);const r=(e.length-33)/32;let n=t;for(let t=0;t<r;t++){const r=e.slice(33+32*t,65+32*t);n=n.compare(r)<0?f(n,r):f(r,n)}return n},t.toHashTree=function e(t){if((0,s.isTapleaf)(t))return{hash:u(t)};const r=[e(t[0]),e(t[1])];r.sort((e,t)=>e.hash.compare(t.hash));const[n,i]=r;return{hash:f(n.hash,i.hash),left:n,right:i}},t.findScriptPath=function e(t,r){if("left"in(n=t)&&"right"in n){const n=e(t.left,r);if(void 0!==n)return[...n,t.right.hash];const i=e(t.right,r);if(void 0!==i)return[...i,t.left.hash]}else if(t.hash.equals(r))return[];var n},t.tapleafHash=u,t.tapTweakHash=c,t.tweakKey=function(e,t){if(!n.Buffer.isBuffer(e))return null;if(32!==e.length)return null;if(t&&32!==t.length)return null;const r=c(e,t),o=(0,i.getEccLib)().xOnlyPointAddTweak(e,r);return o&&null!==o.xOnlyPubkey?{parity:o.parity,x:n.Buffer.from(o.xOnlyPubkey)}:null}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5),i=r(179),o=r(180),a=r(181),s=r(182),u=r(183),c=r(184),f=r(185),l=r(186),d=r(187),h=r(188),p=r(189),b=r(190),m=r(191),g=r(192),y=r(95),v=r(193),w=r(194),_=r(195),E=r(196),k=r(197),S={unsignedTx:o,globalXpub:i,checkPubkey:v.makeChecker([])};t.globals=S;const x={nonWitnessUtxo:u,partialSig:c,sighashType:l,finalScriptSig:a,finalScriptWitness:s,porCommitment:f,witnessUtxo:m,bip32Derivation:y.makeConverter(n.InputTypes.BIP32_DERIVATION),redeemScript:w.makeConverter(n.InputTypes.REDEEM_SCRIPT),witnessScript:k.makeConverter(n.InputTypes.WITNESS_SCRIPT),checkPubkey:v.makeChecker([n.InputTypes.PARTIAL_SIG,n.InputTypes.BIP32_DERIVATION]),tapKeySig:d,tapScriptSig:b,tapLeafScript:h,tapBip32Derivation:_.makeConverter(n.InputTypes.TAP_BIP32_DERIVATION),tapInternalKey:E.makeConverter(n.InputTypes.TAP_INTERNAL_KEY),tapMerkleRoot:p};t.inputs=x;const T={bip32Derivation:y.makeConverter(n.OutputTypes.BIP32_DERIVATION),redeemScript:w.makeConverter(n.OutputTypes.REDEEM_SCRIPT),witnessScript:k.makeConverter(n.OutputTypes.WITNESS_SCRIPT),checkPubkey:v.makeChecker([n.OutputTypes.BIP32_DERIVATION]),tapBip32Derivation:_.makeConverter(n.OutputTypes.TAP_BIP32_DERIVATION),tapTree:g,tapInternalKey:E.makeConverter(n.OutputTypes.TAP_INTERNAL_KEY)};t.outputs=T},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(22);function i(t){const r=t.key.length,i=t.value.length,o=n.encodingLength(r),a=n.encodingLength(i),s=e.allocUnsafe(o+r+a+i);return n.encode(r,s,0),t.key.copy(s,o),n.encode(i,s,o+r),t.value.copy(s,o+r+a),s}function o(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}t.range=e=>[...Array(e).keys()],t.reverseBuffer=function(e){if(e.length<1)return e;let t=e.length-1,r=0;for(let n=0;n<e.length/2;n++)r=e[n],e[n]=e[t],e[t]=r,t--;return e},t.keyValsToBuffer=function(t){const r=t.map(i);return r.push(e.from([0])),e.concat(r)},t.keyValToBuffer=i,t.readUInt64LE=function(e,t){const r=e.readUInt32LE(t);let n=e.readUInt32LE(t+4);return n*=4294967296,o(n+r,9007199254740991),n+r},t.writeUInt64LE=function(e,t,r){return o(t,9007199254740991),e.writeInt32LE(-1&t,r),e.writeUInt32LE(Math.floor(t/4294967296),r+4),r+8}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(64);function i(e,t){const r=e[t];if(void 0===r)throw new Error("No input #"+t);return r}function o(e,t){const r=e[t];if(void 0===r)throw new Error("No output #"+t);return r}function a(e,t,r,n){throw new Error(`Data for ${e} key ${t} is incorrect: Expected ${r} and got ${JSON.stringify(n)}`)}function s(e){return(t,r)=>{for(const i of Object.keys(t)){const o=t[i],{canAdd:s,canAddToArray:u,check:c,expected:f}=n[e+"s"][i]||{},l=!!u;if(c)if(l){if(!Array.isArray(o)||r[i]&&!Array.isArray(r[i]))throw new Error(`Key type ${i} must be an array`);o.every(c)||a(e,i,f,o);const t=r[i]||[],n=new Set;if(!o.every(e=>u(t,e,n)))throw new Error("Can not add duplicate data to array");r[i]=t.concat(o)}else{if(c(o)||a(e,i,f,o),!s(r,o))throw new Error("Can not add duplicate data to "+e);r[i]=o}}}}t.checkForInput=i,t.checkForOutput=o,t.checkHasKey=function(e,t,r){if(e.key[0]<r)throw new Error("Use the method for your specific key instead of addUnknownKeyVal*");if(t&&0!==t.filter(t=>t.key.equals(e.key)).length)throw new Error("Duplicate Key: "+e.key.toString("hex"))},t.getEnumLength=function(e){let t=0;return Object.keys(e).forEach(e=>{Number(isNaN(Number(e)))&&t++}),t},t.inputCheckUncleanFinalized=function(e,t){let r=!1;if(t.nonWitnessUtxo||t.witnessUtxo){const e=!!t.redeemScript,n=!!t.witnessScript,i=!e||!!t.finalScriptSig,o=!n||!!t.finalScriptWitness,a=!!t.finalScriptSig||!!t.finalScriptWitness;r=i&&o&&a}if(!1===r)throw new Error(`Input #${e} has too much or too little data to clean`)},t.updateGlobal=s("global"),t.updateInput=s("input"),t.updateOutput=s("output"),t.addInputAttributes=function(e,r){const n=i(e,e.length-1);t.updateInput(r,n)},t.addOutputAttributes=function(e,r){const n=o(e,e.length-1);t.updateOutput(r,n)},t.defaultVersionSetter=function(t,r){if(!e.isBuffer(r)||r.length<4)throw new Error("Set Version: Invalid Transaction");return r.writeUInt32LE(t,0),r},t.defaultLocktimeSetter=function(t,r){if(!e.isBuffer(r)||r.length<4)throw new Error("Set Locktime: Invalid Transaction");return r.writeUInt32LE(t,r.length-4),r}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.signatureBlocksAction=t.checkInputForSig=t.pubkeyInScript=t.pubkeyPositionInScript=t.witnessStackToScriptWitness=t.isP2TR=t.isP2SHScript=t.isP2WSHScript=t.isP2WPKH=t.isP2PKH=t.isP2PK=t.isP2MS=void 0;const n=r(22),i=r(9),o=r(38),a=r(18),s=r(36);function u(e){return t=>{try{return e({output:t}),!0}catch(e){return!1}}}function c(e,t){const r=(0,a.hash160)(e),n=e.slice(1,33),o=i.decompile(t);if(null===o)throw new Error("Unknown script error");return o.findIndex(t=>"number"!=typeof t&&(t.equals(e)||t.equals(r)||t.equals(n)))}function f(e,t,r){const{hashType:n}=t(e),i=[];n&o.Transaction.SIGHASH_ANYONECANPAY&&i.push("addInput");switch(31&n){case o.Transaction.SIGHASH_ALL:break;case o.Transaction.SIGHASH_SINGLE:case o.Transaction.SIGHASH_NONE:i.push("addOutput"),i.push("setInputSequence")}return-1===i.indexOf(r)}t.isP2MS=u(s.p2ms),t.isP2PK=u(s.p2pk),t.isP2PKH=u(s.p2pkh),t.isP2WPKH=u(s.p2wpkh),t.isP2WSHScript=u(s.p2wsh),t.isP2SHScript=u(s.p2sh),t.isP2TR=u(s.p2tr),t.witnessStackToScriptWitness=function(t){let r=e.allocUnsafe(0);function i(t){const i=r.length,o=n.encodingLength(t);r=e.concat([r,e.allocUnsafe(o)]),n.encode(t,r,i)}function o(t){i(t.length),function(t){r=e.concat([r,e.from(t)])}(t)}var a;return i((a=t).length),a.forEach(o),r},t.pubkeyPositionInScript=c,t.pubkeyInScript=function(e,t){return-1!==c(e,t)},t.checkInputForSig=function(t,r){return function(t){let r=[];if(0===(t.partialSig||[]).length){if(!t.finalScriptSig&&!t.finalScriptWitness)return[];r=function(t){const r=t.finalScriptSig&&i.decompile(t.finalScriptSig)||[],n=t.finalScriptWitness&&i.decompile(t.finalScriptWitness)||[];return r.concat(n).filter(t=>e.isBuffer(t)&&i.isCanonicalScriptSignature(t)).map(e=>({signature:e}))}(t)}else r=t.partialSig;return r.map(e=>e.signature)}(t).some(e=>f(e,i.signature.decode,r))},t.signatureBlocksAction=f}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=t.HMAC=void 0;const n=r(60),i=r(21);class o extends i.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,n.default.hash(e);const r=(0,i.toBytes)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,a=new Uint8Array(o);a.set(r.length>o?e.create().update(r).digest():r);for(let e=0;e<a.length;e++)a[e]^=54;this.iHash.update(a),this.oHash=e.create();for(let e=0;e<a.length;e++)a[e]^=106;this.oHash.update(a),a.fill(0)}update(e){return n.default.exists(this),this.iHash.update(e),this}digestInto(e){n.default.exists(this),n.default.bytes(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:o,outputLen:a}=this;return(e=e).finished=n,e.destroyed=i,e.blockLen=o,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.HMAC=o;t.hmac=(e,t,r)=>new o(e,t).update(r).digest(),t.hmac.create=(e,t)=>new o(e,t)},function(e,t,r){(function(t){var n=r(39);function i(e,t){if(void 0!==t&&e[0]!==t)throw new Error("Invalid network version");if(33===e.length)return{version:e[0],privateKey:e.slice(1,33),compressed:!1};if(34!==e.length)throw new Error("Invalid WIF length");if(1!==e[33])throw new Error("Invalid compression flag");return{version:e[0],privateKey:e.slice(1,33),compressed:!0}}function o(e,r,n){var i=new t(n?34:33);return i.writeUInt8(e,0),r.copy(i,1),n&&(i[33]=1),i}e.exports={decode:function(e,t){return i(n.decode(e),t)},decodeRaw:i,encode:function(e,t,r){return"number"==typeof e?n.encode(o(e,t,r)):n.encode(o(e.version,e.privateKey,e.compressed))},encodeRaw:o}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(2),i=r(100),o=r(109),a=r(110),s=r(72);function u(e){s.call(this,"digest"),this._hash=e}n(u,s),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new o:new u(a(e))}},function(e,t,r){"use strict";var n=r(28).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var a=r.readable||!1!==r.readable&&t.readable,s=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||f()},c=t._writableState&&t._writableState.finished,f=function(){s=!1,c=!0,a||o.call(t)},l=t._readableState&&t._readableState.endEmitted,d=function(){a=!1,l=!0,s||o.call(t)},h=function(e){o.call(t,e)},p=function(){var e;return a&&!l?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):s&&!c?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},b=function(){t.req.on("finish",f)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?s&&!t._writableState&&(t.on("end",u),t.on("close",u)):(t.on("complete",f),t.on("abort",p),t.req?b():t.on("request",b)),t.on("end",d),t.on("finish",f),!1!==r.error&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",f),t.removeListener("abort",p),t.removeListener("request",b),t.req&&t.req.removeListener("finish",f),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",f),t.removeListener("end",d),t.removeListener("error",h),t.removeListener("close",p)}}},function(e,t,r){var n=r(4).Buffer,i=r(228).Transform,o=r(41).StringDecoder;function a(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(2)(a,i),a.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);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(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=a},function(e,t,r){(t=e.exports=r(113)).Stream=t,t.Readable=t,t.Writable=r(74),t.Duplex=r(23),t.Transform=r(116),t.PassThrough=r(234)},function(e,t,r){"use strict";(function(t,n,i){var o=r(48);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=y;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:o.nextTick;y.WritableState=g;var c=Object.create(r(42));c.inherits=r(31);var f={deprecate:r(107)},l=r(114),d=r(47).Buffer,h=(void 0!==i?i:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var p,b=r(115);function m(){}function g(e,t){s=s||r(23),e=e||{};var n=t instanceof s;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,c=e.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:f,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===e.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),S(e,t))}(e,r,n,t,i);else{var a=E(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||_(e,r),n?u(w,e,r,a,i):w(e,r,a,i)}}(t,e)},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 y(e){if(s=s||r(23),!(p.call(y,this)||this instanceof s))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function v(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),S(e,t)}function _(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.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(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(v(e,t,!1,t.objectMode?1:c.length,c,f,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),S(e,t)}))}function S(e,t){var r=E(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(k,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}c.inherits(y,l),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:f.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===y&&(e&&e._writableState instanceof g)}})):p=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=e,d.isBuffer(n)||n instanceof h);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=m),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),o.nextTick(t,r)}(this,r):(s||function(e,t,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||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else v(e,t,!1,s,n,i,o);return u}(this,i,s,e,t,r)),a},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||_(this,e))},y.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,S(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=b.destroy,y.prototype._undestroy=b.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(10),r(232).setImmediate,r(17))},function(e,t,r){"use strict";(function(e){var n=r(242),i=r(68),o=r(27);function a(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var s=a(n);s.utils.hmacSha256Sync=(e,...t)=>i.hmac(o.sha256,e,s.utils.concatBytes(...t)),s.utils.sha256Sync=(...e)=>o.sha256(s.utils.concatBytes(...e));const u=s.utils._normalizePrivateKey,c=new Uint8Array([255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65]);function f(e,t){for(let r=0;r<32;++r)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return 0}function l(e){return e instanceof Uint8Array&&32===e.length&&!(f(e,c)>=0)}function d(e){return e instanceof Uint8Array&&64===e.length&&f(e.subarray(0,32),c)<0&&f(e.subarray(32,64),c)<0}function h(e){return e instanceof Uint8Array&&32===e.length}function p(e){return void 0===e||e instanceof Uint8Array&&32===e.length}function b(e){if("string"!=typeof e)throw new TypeError("hexToNumber: expected string, got "+typeof e);return BigInt("0x"+e)}function m(e){let t;if("bigint"==typeof e)t=e;else if("number"==typeof e&&Number.isSafeInteger(e)&&e>=0)t=BigInt(e);else if("string"==typeof e){if(64!==e.length)throw new Error("Expected 32 bytes of private scalar");t=b(e)}else{if(!(e instanceof Uint8Array))throw new TypeError("Expected valid private scalar");if(32!==e.length)throw new Error("Expected 32 bytes of private scalar");r=e,t=b(s.utils.bytesToHex(r))}var r;if(t<0)throw new Error("Expected private scalar >= 0");return t}const g=(e,t,r)=>{const n=s.Point.fromHex(e),i=m(t),o=s.Point.BASE.multiplyAndAddUnsafe(n,i,1n);if(!o)throw new Error("Tweaked point at infinity");return o.toRawBytes(r)};function y(e,t){return void 0===e?void 0===t||E(t):!!e}function v(e){try{return e()}catch(e){return null}}function w(e,t){if(32===e.length!==t)return!1;try{return!!s.Point.fromHex(e)}catch(e){return!1}}function _(e){return w(e,!1)}function E(e){return w(e,!1)&&33===e.length}function k(e){return s.utils.isValidPrivateKey(e)}function S(e){return w(e,!0)}function x(e){if(!_(e))throw new Error("Expected Point");return e.slice(1,33)}function T(e,t){if(!k(e))throw new Error("Expected Private");return v(()=>s.getPublicKey(e,y(t)))}t.isPoint=_,t.isPointCompressed=E,t.isPrivate=k,t.isXOnlyPoint=S,t.pointAdd=function(e,t,r){if(!_(e)||!_(t))throw new Error("Expected Point");return v(()=>{const n=s.Point.fromHex(e),i=s.Point.fromHex(t);return n.equals(i.negate())?null:n.add(i).toRawBytes(y(r,e))})},t.pointAddScalar=function(e,t,r){if(!_(e))throw new Error("Expected Point");if(!l(t))throw new Error("Expected Tweak");return v(()=>g(e,t,y(r,e)))},t.pointCompress=function(e,t){if(!_(e))throw new Error("Expected Point");return s.Point.fromHex(e).toRawBytes(y(t,e))},t.pointFromScalar=T,t.pointMultiply=function(e,t,r){if(!_(e))throw new Error("Expected Point");if(!l(t))throw new Error("Expected Tweak");return v(()=>((e,t,r)=>{const n=s.Point.fromHex(e),i="string"==typeof t?t:s.utils.bytesToHex(t),o=BigInt("0x"+i);return n.multiply(o).toRawBytes(r)})(e,t,y(r,e)))},t.privateAdd=function(e,t){if(!1===k(e))throw new Error("Expected Private");if(!1===l(t))throw new Error("Expected Tweak");return v(()=>((e,t)=>{const r=u(e),n=m(t),i=s.utils._bigintTo32Bytes(s.utils.mod(r+n,s.CURVE.n));return s.utils.isValidPrivateKey(i)?i:null})(e,t))},t.privateNegate=function(e){if(!1===k(e))throw new Error("Expected Private");return(e=>{const t=u(e),r=s.utils._bigintTo32Bytes(s.CURVE.n-t);return s.utils.isValidPrivateKey(r)?r:null})(e)},t.privateSub=function(e,t){if(!1===k(e))throw new Error("Expected Private");if(!1===l(t))throw new Error("Expected Tweak");return v(()=>((e,t)=>{const r=u(e),n=m(t),i=s.utils._bigintTo32Bytes(s.utils.mod(r-n,s.CURVE.n));return s.utils.isValidPrivateKey(i)?i:null})(e,t))},t.sign=function(e,t,r){if(!k(t))throw new Error("Expected Private");if(!h(e))throw new Error("Expected Scalar");if(!p(r))throw new Error("Expected Extra Data (32 bytes)");return s.signSync(e,t,{der:!1,extraEntropy:r})},t.signSchnorr=function(t,r,n=e.alloc(32,0)){if(!k(r))throw new Error("Expected Private");if(!h(t))throw new Error("Expected Scalar");if(!p(n))throw new Error("Expected Extra Data (32 bytes)");return s.schnorr.signSync(t,r,n)},t.verify=function(e,t,r,n){if(!_(t))throw new Error("Expected Point");if(!d(r))throw new Error("Expected Signature");if(!h(e))throw new Error("Expected Scalar");return s.verify(r,e,t,{strict:n})},t.verifySchnorr=function(e,t,r){if(!S(t))throw new Error("Expected Point");if(!d(r))throw new Error("Expected Signature");if(!h(e))throw new Error("Expected Scalar");return s.schnorr.verifySync(r,e,t)},t.xOnlyPointAddTweak=function(e,t){if(!S(e))throw new Error("Expected Point");if(!l(t))throw new Error("Expected Tweak");return v(()=>{const r=g(e,t,!0);return{parity:r[0]%2==1?1:0,xOnlyPubkey:r.slice(1)}})},t.xOnlyPointFromPoint=x,t.xOnlyPointFromScalar=function(e){if(!k(e))throw new Error("Expected Private");return x(T(e))}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(2),i=r(246),o=r(72),a=r(4).Buffer,s=r(247),u=r(109),c=r(110),f=a.alloc(128);function l(e,t){o.call(this,"digest"),"string"==typeof t&&(t=a.from(t));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=t,t.length>r)?t=("rmd160"===e?new u:c(e)).update(t).digest():t.length<r&&(t=a.concat([t,f],r));for(var n=this._ipad=a.allocUnsafe(r),i=this._opad=a.allocUnsafe(r),s=0;s<r;s++)n[s]=54^t[s],i[s]=92^t[s];this._hash="rmd160"===e?new u:c(e),this._hash.update(n)}n(l,o),l.prototype._update=function(e){this._hash.update(e)},l.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new u:c(this._alg)).update(this._opad).update(e).digest()},e.exports=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new l("rmd160",t):"md5"===e?new i(s,t):new l(e,t)}},function(e,t,r){"use strict";var n,i=t,o=r(78),a=r(121),s=r(11).assert;function u(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(262)}catch(e){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},function(e,t,r){var n=t;n.utils=r(15),n.common=r(43),n.sha=r(256),n.ripemd=r(260),n.hmac=r(261),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(12),i=r(50),o=r(1),a=r(16),s=r(81),u=r(39),c=r(3);function f(e){const t=u.decode(e);if(t.length<21)throw new TypeError(e+" is too short");if(t.length>21)throw new TypeError(e+" is too long");return{version:t.readUInt8(0),hash:t.slice(1)}}function l(t){const r=s.decode(t),n=s.fromWords(r.words.slice(1));return{version:r.words[0],prefix:r.prefix,data:e.from(n)}}t.fromBase58Check=f,t.fromBech32=l,t.toBase58Check=function(t,r){c(a.tuple(a.Hash160bit,a.UInt8),arguments);const n=e.allocUnsafe(21);return n.writeUInt8(r,0),t.copy(n,1),u.encode(n)},t.toBech32=function(e,t,r){const n=s.toWords(e);return n.unshift(t),s.encode(r,n)},t.fromOutputScript=function(e,t){t=t||n.bitcoin;try{return i.p2pkh({output:e,network:t}).address}catch(e){}try{return i.p2sh({output:e,network:t}).address}catch(e){}try{return i.p2wpkh({output:e,network:t}).address}catch(e){}try{return i.p2wsh({output:e,network:t}).address}catch(e){}throw new Error(o.toASM(e)+" has no matching Address")},t.toOutputScript=function(e,t){let r,o;t=t||n.bitcoin;try{r=f(e)}catch(e){}if(r){if(r.version===t.pubKeyHash)return i.p2pkh({hash:r.hash}).output;if(r.version===t.scriptHash)return i.p2sh({hash:r.hash}).output}else{try{o=l(e)}catch(e){}if(o){if(o.prefix!==t.bech32)throw new Error(e+" has an invalid prefix");if(0===o.version){if(20===o.data.length)return i.p2wpkh({hash:o.data}).output;if(32===o.data.length)return i.p2wsh({hash:o.data}).output}}}throw new Error(e+" has no matching Script")}}).call(this,r(0).Buffer)},function(e){e.exports=JSON.parse('{"OP_FALSE":0,"OP_0":0,"OP_PUSHDATA1":76,"OP_PUSHDATA2":77,"OP_PUSHDATA4":78,"OP_1NEGATE":79,"OP_RESERVED":80,"OP_TRUE":81,"OP_1":81,"OP_2":82,"OP_3":83,"OP_4":84,"OP_5":85,"OP_6":86,"OP_7":87,"OP_8":88,"OP_9":89,"OP_10":90,"OP_11":91,"OP_12":92,"OP_13":93,"OP_14":94,"OP_15":95,"OP_16":96,"OP_NOP":97,"OP_VER":98,"OP_IF":99,"OP_NOTIF":100,"OP_VERIF":101,"OP_VERNOTIF":102,"OP_ELSE":103,"OP_ENDIF":104,"OP_VERIFY":105,"OP_RETURN":106,"OP_TOALTSTACK":107,"OP_FROMALTSTACK":108,"OP_2DROP":109,"OP_2DUP":110,"OP_3DUP":111,"OP_2OVER":112,"OP_2ROT":113,"OP_2SWAP":114,"OP_IFDUP":115,"OP_DEPTH":116,"OP_DROP":117,"OP_DUP":118,"OP_NIP":119,"OP_OVER":120,"OP_PICK":121,"OP_ROLL":122,"OP_ROT":123,"OP_SWAP":124,"OP_TUCK":125,"OP_CAT":126,"OP_SUBSTR":127,"OP_LEFT":128,"OP_RIGHT":129,"OP_SIZE":130,"OP_INVERT":131,"OP_AND":132,"OP_OR":133,"OP_XOR":134,"OP_EQUAL":135,"OP_EQUALVERIFY":136,"OP_RESERVED1":137,"OP_RESERVED2":138,"OP_1ADD":139,"OP_1SUB":140,"OP_2MUL":141,"OP_2DIV":142,"OP_NEGATE":143,"OP_ABS":144,"OP_NOT":145,"OP_0NOTEQUAL":146,"OP_ADD":147,"OP_SUB":148,"OP_MUL":149,"OP_DIV":150,"OP_MOD":151,"OP_LSHIFT":152,"OP_RSHIFT":153,"OP_BOOLAND":154,"OP_BOOLOR":155,"OP_NUMEQUAL":156,"OP_NUMEQUALVERIFY":157,"OP_NUMNOTEQUAL":158,"OP_LESSTHAN":159,"OP_GREATERTHAN":160,"OP_LESSTHANOREQUAL":161,"OP_GREATERTHANOREQUAL":162,"OP_MIN":163,"OP_MAX":164,"OP_WITHIN":165,"OP_RIPEMD160":166,"OP_SHA1":167,"OP_SHA256":168,"OP_HASH160":169,"OP_HASH256":170,"OP_CODESEPARATOR":171,"OP_CHECKSIG":172,"OP_CHECKSIGVERIFY":173,"OP_CHECKMULTISIG":174,"OP_CHECKMULTISIGVERIFY":175,"OP_NOP1":176,"OP_NOP2":177,"OP_CHECKLOCKTIMEVERIFY":177,"OP_NOP3":178,"OP_CHECKSEQUENCEVERIFY":178,"OP_NOP4":179,"OP_NOP5":180,"OP_NOP6":181,"OP_NOP7":182,"OP_NOP8":183,"OP_NOP9":184,"OP_NOP10":185,"OP_PUBKEYHASH":253,"OP_PUBKEY":254,"OP_INVALIDOPCODE":255}')},function(e,t,r){"use strict";for(var n="qpzry9x8gf2tvdw0s3jn54khce6mua7l",i={},o=0;o<n.length;o++){var a=n.charAt(o);if(void 0!==i[a])throw new TypeError(a+" is ambiguous");i[a]=o}function s(e){var t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function u(e){for(var t=1,r=0;r<e.length;++r){var n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=s(t)^n>>5}for(t=s(t),r=0;r<e.length;++r){var i=e.charCodeAt(r);t=s(t)^31&i}return t}function c(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)return"Exceeds length limit";var r=e.toLowerCase(),n=e.toUpperCase();if(e!==r&&e!==n)return"Mixed-case string "+e;var o=(e=r).lastIndexOf("1");if(-1===o)return"No separator character for "+e;if(0===o)return"Missing prefix for "+e;var a=e.slice(0,o),c=e.slice(o+1);if(c.length<6)return"Data too short";var f=u(a);if("string"==typeof f)return f;for(var l=[],d=0;d<c.length;++d){var h=c.charAt(d),p=i[h];if(void 0===p)return"Unknown character "+h;f=s(f)^p,d+6>=c.length||l.push(p)}return 1!==f?"Invalid checksum for "+e:{prefix:a,words:l}}function f(e,t,r,n){for(var i=0,o=0,a=(1<<r)-1,s=[],u=0;u<e.length;++u)for(i=i<<t|e[u],o+=t;o>=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<<r-o&a);else{if(o>=t)return"Excess padding";if(i<<r-o&a)return"Non-zero padding"}return s}e.exports={decodeUnsafe:function(){var e=c.apply(null,arguments);if("object"==typeof e)return e},decode:function(e){var t=c.apply(null,arguments);if("object"==typeof t)return t;throw new Error(t)},encode:function(e,t,r){if(r=r||90,e.length+7+t.length>r)throw new TypeError("Exceeds length limit");var i=u(e=e.toLowerCase());if("string"==typeof i)throw new Error(i);for(var o=e+"1",a=0;a<t.length;++a){var c=t[a];if(c>>5!=0)throw new Error("Non 5-bit word");i=s(i)^c,o+=n.charAt(c)}for(a=0;a<6;++a)i=s(i);for(i^=1,a=0;a<6;++a){o+=n.charAt(i>>5*(5-a)&31)}return o},toWordsUnsafe:function(e){var t=f(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=f(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=f(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=f(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(12),i=r(16),o=r(25),a=r(283),s=r(3),u=r(69),c=s.maybe(s.compile({compressed:i.maybe(i.Boolean),network:i.maybe(i.Network)}));class f{constructor(e,t,r){this.__D=e,this.__Q=t,this.lowR=!1,void 0===r&&(r={}),this.compressed=void 0===r.compressed||r.compressed,this.network=r.network||n.bitcoin,void 0!==t&&(this.__Q=o.pointCompress(t,this.compressed))}get privateKey(){return this.__D}get publicKey(){return this.__Q||(this.__Q=o.pointFromScalar(this.__D,this.compressed)),this.__Q}toWIF(){if(!this.__D)throw new Error("Missing private key");return u.encode(this.network.wif,this.__D,this.compressed)}sign(t,r){if(!this.__D)throw new Error("Missing private key");if(void 0===r&&(r=this.lowR),!1===r)return o.sign(t,this.__D);{let r=o.sign(t,this.__D);const n=e.alloc(32,0);let i=0;for(;r[0]>127;)i++,n.writeUIntLE(i,0,6),r=o.signWithEntropy(t,this.__D,n);return r}}verify(e,t){return o.verify(e,this.publicKey,t)}}function l(e,t){if(s(i.Buffer256bit,e),!o.isPrivate(e))throw new TypeError("Private key not in range [1, n)");return s(c,t),new f(e,void 0,t)}t.fromPrivateKey=l,t.fromPublicKey=function(e,t){return s(o.isPoint,e),s(c,t),new f(void 0,e,t)},t.fromWIF=function(e,t){const r=u.decode(e),o=r.version;if(i.Array(t)){if(!(t=t.filter(e=>o===e.wif).pop()))throw new Error("Unknown network version")}else if(t=t||n.bitcoin,o!==t.wif)throw new Error("Invalid network version");return l(r.privateKey,{compressed:r.compressed,network:t})},t.makeRandom=function(e){s(c,e),void 0===e&&(e={});const t=e.rng||a;let r;do{r=t(32),s(i.Buffer256bit,r)}while(!o.isPrivate(r));return l(r,e)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(288);t.input=n;const i=r(289);t.output=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(291);t.input=n;const i=r(292);t.output=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(293);t.input=n;const i=r(294);t.output=i},function(e,t,r){"use strict";(function(t){var n=r(6),i=r(321),o=r(32),a=r(134),s=r(135),u={"Content-Type":"application/x-www-form-urlencoded"};function c(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var f,l={transitional:a,adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(f=r(136)),f),transformRequest:[function(e,t){if(i(t,"Accept"),i(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e))return e;if(n.isArrayBufferView(e))return e.buffer;if(n.isURLSearchParams(e))return c(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var r,o=n.isObject(e),a=t&&t["Content-Type"];if((r=n.isFileList(e))||o&&"multipart/form-data"===a){var u=this.env&&this.env.FormData;return s(r?{"files[]":e}:e,u&&new u)}return o||"application/json"===a?(c(t,"application/json"),function(e,t,r){if(n.isString(e))try{return(t||JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||l.transitional,r=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,a=!r&&"json"===this.responseType;if(a||i&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw o.from(e,o.ERR_BAD_RESPONSE,this,null,this.response);throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:r(329)},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){l.headers[e]=n.merge(u)})),e.exports=l}).call(this,r(10))},function(e,t,r){"use strict";(function(t){var n=r(7),i=r(346),o=r(33),a=r(144),s=r(145),u={"Content-Type":"application/x-www-form-urlencoded"};function c(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var f,l={transitional:a,adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(f=r(146)),f),transformRequest:[function(e,t){if(i(t,"Accept"),i(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e))return e;if(n.isArrayBufferView(e))return e.buffer;if(n.isURLSearchParams(e))return c(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var r,o=n.isObject(e),a=t&&t["Content-Type"];if((r=n.isFileList(e))||o&&"multipart/form-data"===a){var u=this.env&&this.env.FormData;return s(r?{"files[]":e}:e,u&&new u)}return o||"application/json"===a?(c(t,"application/json"),function(e,t,r){if(n.isString(e))try{return(t||JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||l.transitional,r=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,a=!r&&"json"===this.responseType;if(a||i&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw o.from(e,o.ERR_BAD_RESPONSE,this,null,this.response);throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:r(354)},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){l.headers[e]=n.merge(u)})),e.exports=l}).call(this,r(10))},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.toOutputScript=t.fromOutputScript=t.toBech32=t.toBase58Check=t.fromBech32=t.fromBase58Check=void 0;const n=r(13),i=r(36),o=r(9),a=r(8),s=r(45),u=r(61),c="WARNING: Sending to a future segwit version address can lead to loss of funds. End users MUST be warned carefully in the GUI and asked if they wish to proceed with caution. Wallets should verify the segwit version from the output of fromBech32, then decide when it is safe to use which version of segwit.";function f(t){const r=e.from(u.decode(t));if(r.length<21)throw new TypeError(t+" is too short");if(r.length>21)throw new TypeError(t+" is too long");return{version:r.readUInt8(0),hash:r.slice(1)}}function l(t){let r,n;try{r=s.bech32.decode(t)}catch(e){}if(r){if(n=r.words[0],0!==n)throw new TypeError(t+" uses wrong encoding")}else if(r=s.bech32m.decode(t),n=r.words[0],0===n)throw new TypeError(t+" uses wrong encoding");const i=s.bech32.fromWords(r.words.slice(1));return{version:n,prefix:r.prefix,data:e.from(i)}}function d(e,t,r){const n=s.bech32.toWords(e);return n.unshift(t),0===t?s.bech32.encode(r,n):s.bech32m.encode(r,n)}t.fromBase58Check=f,t.fromBech32=l,t.toBase58Check=function(t,r){(0,a.typeforce)((0,a.tuple)(a.Hash160bit,a.UInt8),arguments);const n=e.allocUnsafe(21);return n.writeUInt8(r,0),t.copy(n,1),u.encode(n)},t.toBech32=d,t.fromOutputScript=function(e,t){t=t||n.bitcoin;try{return i.p2pkh({output:e,network:t}).address}catch(e){}try{return i.p2sh({output:e,network:t}).address}catch(e){}try{return i.p2wpkh({output:e,network:t}).address}catch(e){}try{return i.p2wsh({output:e,network:t}).address}catch(e){}try{return i.p2tr({output:e,network:t}).address}catch(e){}try{return function(e,t){const r=e.slice(2);if(r.length<2||r.length>40)throw new TypeError("Invalid program length for segwit address");const n=e[0]-80;if(n<2||n>16)throw new TypeError("Invalid version for segwit address");if(e[1]!==r.length)throw new TypeError("Invalid script for segwit address");return console.warn(c),d(r,n,t.bech32)}(e,t)}catch(e){}throw new Error(o.toASM(e)+" has no matching Address")},t.toOutputScript=function(e,t){let r,a;t=t||n.bitcoin;try{r=f(e)}catch(e){}if(r){if(r.version===t.pubKeyHash)return i.p2pkh({hash:r.hash}).output;if(r.version===t.scriptHash)return i.p2sh({hash:r.hash}).output}else{try{a=l(e)}catch(e){}if(a){if(a.prefix!==t.bech32)throw new Error(e+" has an invalid prefix");if(0===a.version){if(20===a.data.length)return i.p2wpkh({hash:a.data}).output;if(32===a.data.length)return i.p2wsh({hash:a.data}).output}else if(1===a.version){if(32===a.data.length)return i.p2tr({pubkey:a.data}).output}else if(a.version>=2&&a.version<=16&&a.data.length>=2&&a.data.length<=40)return console.warn(c),o.compile([a.version+80,a.data])}}throw new Error(e+" has no matching Script")}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.encode=t.decode=t.check=void 0,t.check=function(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;const t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;const r=e[5+t];return 0!==r&&(6+t+r===e.length&&(!(128&e[4])&&(!(t>1&&0===e[4]&&!(128&e[5]))&&(!(128&e[t+6])&&!(r>1&&0===e[t+6]&&!(128&e[t+7]))))))},t.decode=function(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");const t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");const r=e[5+t];if(0===r)throw new Error("S length is zero");if(6+t+r!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(r>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}},t.encode=function(t,r){const n=t.length,i=r.length;if(0===n)throw new Error("R length is zero");if(0===i)throw new Error("S length is zero");if(n>33)throw new Error("R length is too long");if(i>33)throw new Error("S length is too long");if(128&t[0])throw new Error("R value is negative");if(128&r[0])throw new Error("S value is negative");if(n>1&&0===t[0]&&!(128&t[1]))throw new Error("R value excessively padded");if(i>1&&0===r[0]&&!(128&r[1]))throw new Error("S value excessively padded");const o=e.allocUnsafe(6+n+i);return o[0]=48,o[1]=o.length-2,o[2]=2,o[3]=t.length,t.copy(o,4),o[4+n]=2,o[5+n]=r.length,r.copy(o,6+n),o}}).call(this,r(0).Buffer)},function(e,t,r){var n=r(59);function i(e){return e.name||e.toString().match(/function (.*?)\s*\(/)[1]}function o(e){return n.Nil(e)?"":i(e.constructor)}function a(e,t){Error.captureStackTrace&&Error.captureStackTrace(e,t)}function s(e){return n.Function(e)?e.toJSON?e.toJSON():i(e):n.Array(e)?"Array":e&&n.Object(e)?"Object":void 0!==e?e:""}function u(e,t,r){var i=function(e){return n.Function(e)?"":n.String(e)?JSON.stringify(e):e&&n.Object(e)?"":e}(t);return"Expected "+s(e)+", got"+(""!==r?" "+r:"")+(""!==i?" "+i:"")}function c(e,t,r){r=r||o(t),this.message=u(e,t,r),a(this,c),this.__type=e,this.__value=t,this.__valueTypeName=r}function f(e,t,r,n,i){e?(i=i||o(n),this.message=function(e,t,r,n,i){var o='" of type ';return"key"===t&&(o='" with key type '),u('property "'+s(r)+o+s(e),n,i)}(e,r,t,n,i)):this.message='Unexpected property "'+t+'"',a(this,c),this.__label=r,this.__property=t,this.__type=e,this.__value=n,this.__valueTypeName=i}c.prototype=Object.create(Error.prototype),c.prototype.constructor=c,f.prototype=Object.create(Error.prototype),f.prototype.constructor=c,e.exports={TfTypeError:c,TfPropertyTypeError:f,tfCustomError:function(e,t){return new c(e,{},t)},tfSubError:function(e,t,r){return e instanceof f?(t=t+"."+e.__property,e=new f(e.__type,t,e.__label,e.__value,e.__valueTypeName)):e instanceof c&&(e=new f(e.__type,t,r,e.__value,e.__valueTypeName)),a(e),e},tfJSON:s,getValueTypeName:o}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=t.RIPEMD160=void 0;const n=r(44),i=r(21),o=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),a=Uint8Array.from({length:16},(e,t)=>t),s=a.map(e=>(9*e+5)%16);let u=[a],c=[s];for(let e=0;e<4;e++)for(let t of[u,c])t.push(t[e].map(e=>o[e]));const f=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>new Uint8Array(e)),l=u.map((e,t)=>e.map(e=>f[t][e])),d=c.map((e,t)=>e.map(e=>f[t][e])),h=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),p=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),b=(e,t)=>e<<t|e>>>32-t;function m(e,t,r,n){return 0===e?t^r^n:1===e?t&r|~t&n:2===e?(t|~r)^n:3===e?t&n|r&~n:t^(r|~n)}const g=new Uint32Array(16);class y extends n.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:r,h3:n,h4:i}=this;return[e,t,r,n,i]}set(e,t,r,n,i){this.h0=0|e,this.h1=0|t,this.h2=0|r,this.h3=0|n,this.h4=0|i}process(e,t){for(let r=0;r<16;r++,t+=4)g[r]=e.getUint32(t,!0);let r=0|this.h0,n=r,i=0|this.h1,o=i,a=0|this.h2,s=a,f=0|this.h3,y=f,v=0|this.h4,w=v;for(let e=0;e<5;e++){const t=4-e,_=h[e],E=p[e],k=u[e],S=c[e],x=l[e],T=d[e];for(let t=0;t<16;t++){const n=b(r+m(e,i,a,f)+g[k[t]]+_,x[t])+v|0;r=v,v=f,f=0|b(a,10),a=i,i=n}for(let e=0;e<16;e++){const r=b(n+m(t,o,s,y)+g[S[e]]+E,T[e])+w|0;n=w,w=y,y=0|b(s,10),s=o,o=r}}this.set(this.h1+a+y|0,this.h2+f+w|0,this.h3+v+n|0,this.h4+r+o|0,this.h0+i+s|0)}roundClean(){g.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}t.RIPEMD160=y,t.ripemd160=(0,i.wrapConstructor)(()=>new y)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(177),i=r(94),o=r(5),a=r(66);t.Psbt=class{constructor(e){this.inputs=[],this.outputs=[],this.globalMap={unsignedTx:e}}static fromBase64(t,r){const n=e.from(t,"base64");return this.fromBuffer(n,r)}static fromHex(t,r){const n=e.from(t,"hex");return this.fromBuffer(n,r)}static fromBuffer(e,t){const r=i.psbtFromBuffer(e,t),n=new this(r.globalMap.unsignedTx);return Object.assign(n,r),n}toBase64(){return this.toBuffer().toString("base64")}toHex(){return this.toBuffer().toString("hex")}toBuffer(){return i.psbtToBuffer(this)}updateGlobal(e){return a.updateGlobal(e,this.globalMap),this}updateInput(e,t){const r=a.checkForInput(this.inputs,e);return a.updateInput(t,r),this}updateOutput(e,t){const r=a.checkForOutput(this.outputs,e);return a.updateOutput(t,r),this}addUnknownKeyValToGlobal(e){return a.checkHasKey(e,this.globalMap.unknownKeyVals,a.getEnumLength(o.GlobalTypes)),this.globalMap.unknownKeyVals||(this.globalMap.unknownKeyVals=[]),this.globalMap.unknownKeyVals.push(e),this}addUnknownKeyValToInput(e,t){const r=a.checkForInput(this.inputs,e);return a.checkHasKey(t,r.unknownKeyVals,a.getEnumLength(o.InputTypes)),r.unknownKeyVals||(r.unknownKeyVals=[]),r.unknownKeyVals.push(t),this}addUnknownKeyValToOutput(e,t){const r=a.checkForOutput(this.outputs,e);return a.checkHasKey(t,r.unknownKeyVals,a.getEnumLength(o.OutputTypes)),r.unknownKeyVals||(r.unknownKeyVals=[]),r.unknownKeyVals.push(t),this}addInput(e){this.globalMap.unsignedTx.addInput(e),this.inputs.push({unknownKeyVals:[]});const t=e.unknownKeyVals||[],r=this.inputs.length-1;if(!Array.isArray(t))throw new Error("unknownKeyVals must be an Array");return t.forEach(e=>this.addUnknownKeyValToInput(r,e)),a.addInputAttributes(this.inputs,e),this}addOutput(e){this.globalMap.unsignedTx.addOutput(e),this.outputs.push({unknownKeyVals:[]});const t=e.unknownKeyVals||[],r=this.outputs.length-1;if(!Array.isArray(t))throw new Error("unknownKeyVals must be an Array");return t.forEach(e=>this.addUnknownKeyValToOutput(r,e)),a.addOutputAttributes(this.outputs,e),this}clearFinalizedInput(e){const t=a.checkForInput(this.inputs,e);a.inputCheckUncleanFinalized(e,t);for(const e of Object.keys(t))["witnessUtxo","nonWitnessUtxo","finalScriptSig","finalScriptWitness","unknownKeyVals"].includes(e)||delete t[e];return this}combine(...e){const t=n.combine([this].concat(e));return Object.assign(this,t),this}getTransaction(){return this.globalMap.unsignedTx.toBuffer()}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),n(r(178)),n(r(198))},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const r=e=>33===e.length&&[2,3].includes(e[0])||65===e.length&&4===e[0];t.makeConverter=function(t,n=r){return{decode:function(e){if(e.key[0]!==t)throw new Error("Decode Error: could not decode bip32Derivation with key 0x"+e.key.toString("hex"));const r=e.key.slice(1);if(!n(r))throw new Error("Decode Error: bip32Derivation has invalid pubkey in key 0x"+e.key.toString("hex"));if(e.value.length/4%1!=0)throw new Error("Decode Error: Input BIP32_DERIVATION value length should be multiple of 4");const i={masterFingerprint:e.value.slice(0,4),pubkey:r,path:"m"};for(const t of(o=e.value.length/4-1,[...Array(o).keys()])){const r=e.value.readUInt32LE(4*t+4),n=!!(2147483648&r),o=2147483647&r;i.path+="/"+o.toString(10)+(n?"'":"")}var o;return i},encode:function(r){const n=e.from([t]),i=e.concat([n,r.pubkey]),o=r.path.split("/"),a=e.allocUnsafe(4*o.length);r.masterFingerprint.copy(a,0);let s=4;return o.slice(1).forEach(e=>{const t="'"===e.slice(-1);let r=2147483647&parseInt(t?e.slice(0,-1):e,10);t&&(r+=2147483648),a.writeUInt32LE(r,s),s+=4}),{key:i,value:a}},check:function(t){return e.isBuffer(t.pubkey)&&e.isBuffer(t.masterFingerprint)&&"string"==typeof t.path&&n(t.pubkey)&&4===t.masterFingerprint.length},expected:"{ masterFingerprint: Buffer; pubkey: Buffer; path: string; }",canAddToArray:function(e,t,r){const n=t.pubkey.toString("hex");return!r.has(n)&&(r.add(n),0===e.filter(e=>e.pubkey.equals(t.pubkey)).length)}}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(27),i=r(97),o=r(201),a=r(21),s=r(98);let u=s._default;const c="A wordlist is required but a default could not be found.\nPlease pass a 2048 word array explicitly.";function f(e){return(e||"").normalize("NFKD")}function l(e,t,r){for(;e.length<r;)e=t+e;return e}function d(e){return parseInt(e,2)}function h(e){return e.map(e=>l(e.toString(2),"0",8)).join("")}function p(e){const t=8*e.length/32,r=n.sha256(Uint8Array.from(e));return h(Array.from(r)).slice(0,t)}function b(e){return"mnemonic"+(e||"")}function m(t,r){if(!(r=r||u))throw new Error(c);const n=f(t).split(" ");if(n.length%3!=0)throw new Error("Invalid mnemonic");const i=n.map(e=>{const t=r.indexOf(e);if(-1===t)throw new Error("Invalid mnemonic");return l(t.toString(2),"0",11)}).join(""),o=32*Math.floor(i.length/33),a=i.slice(0,o),s=i.slice(o),h=a.match(/(.{1,8})/g).map(d);if(h.length<16)throw new Error("Invalid entropy");if(h.length>32)throw new Error("Invalid entropy");if(h.length%4!=0)throw new Error("Invalid entropy");const b=e.from(h);if(p(b)!==s)throw new Error("Invalid mnemonic checksum");return b.toString("hex")}function g(t,r){if(e.isBuffer(t)||(t=e.from(t,"hex")),!(r=r||u))throw new Error(c);if(t.length<16)throw new TypeError("Invalid entropy");if(t.length>32)throw new TypeError("Invalid entropy");if(t.length%4!=0)throw new TypeError("Invalid entropy");const n=(h(Array.from(t))+p(t)).match(/(.{1,11})/g).map(e=>{const t=d(e);return r[t]});return"あいこくしん"===r[0]?n.join(" "):n.join(" ")}t.mnemonicToSeedSync=function(t,r){const n=Uint8Array.from(e.from(f(t),"utf8")),a=Uint8Array.from(e.from(b(f(r)),"utf8")),s=o.pbkdf2(i.sha512,n,a,{c:2048,dkLen:64});return e.from(s)},t.mnemonicToSeed=function(t,r){const n=Uint8Array.from(e.from(f(t),"utf8")),a=Uint8Array.from(e.from(b(f(r)),"utf8"));return o.pbkdf2Async(i.sha512,n,a,{c:2048,dkLen:64}).then(t=>e.from(t))},t.mnemonicToEntropy=m,t.entropyToMnemonic=g,t.generateMnemonic=function(t,r,n){if((t=t||128)%32!=0)throw new TypeError("Invalid entropy");return g((r=r||(t=>e.from(a.randomBytes(t))))(t/8),n)},t.validateMnemonic=function(e,t){try{m(e,t)}catch(e){return!1}return!0},t.setDefaultWordlist=function(e){const t=s.wordlists[e];if(!t)throw new Error('Could not find wordlist for language "'+e+'"');u=t},t.getDefaultWordlist=function(){if(!u)throw new Error("No Default Wordlist set");return Object.keys(s.wordlists).filter(e=>"JA"!==e&&"EN"!==e&&s.wordlists[e].every((e,t)=>e===u[t]))[0]};var y=r(98);t.wordlists=y.wordlists}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha384=t.sha512_256=t.sha512_224=t.sha512=t.SHA512=void 0;const n=r(44),i=r(200),o=r(21),[a,s]=i.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),u=new Uint32Array(80),c=new Uint32Array(80);class f extends n.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:a,Dl:s,Eh:u,El:c,Fh:f,Fl:l,Gh:d,Gl:h,Hh:p,Hl:b}=this;return[e,t,r,n,i,o,a,s,u,c,f,l,d,h,p,b]}set(e,t,r,n,i,o,a,s,u,c,f,l,d,h,p,b){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|a,this.Dl=0|s,this.Eh=0|u,this.El=0|c,this.Fh=0|f,this.Fl=0|l,this.Gh=0|d,this.Gl=0|h,this.Hh=0|p,this.Hl=0|b}process(e,t){for(let r=0;r<16;r++,t+=4)u[r]=e.getUint32(t),c[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|u[e-15],r=0|c[e-15],n=i.default.rotrSH(t,r,1)^i.default.rotrSH(t,r,8)^i.default.shrSH(t,r,7),o=i.default.rotrSL(t,r,1)^i.default.rotrSL(t,r,8)^i.default.shrSL(t,r,7),a=0|u[e-2],s=0|c[e-2],f=i.default.rotrSH(a,s,19)^i.default.rotrBH(a,s,61)^i.default.shrSH(a,s,6),l=i.default.rotrSL(a,s,19)^i.default.rotrBL(a,s,61)^i.default.shrSL(a,s,6),d=i.default.add4L(o,l,c[e-7],c[e-16]),h=i.default.add4H(d,n,f,u[e-7],u[e-16]);u[e]=0|h,c[e]=0|d}let{Ah:r,Al:n,Bh:o,Bl:f,Ch:l,Cl:d,Dh:h,Dl:p,Eh:b,El:m,Fh:g,Fl:y,Gh:v,Gl:w,Hh:_,Hl:E}=this;for(let e=0;e<80;e++){const t=i.default.rotrSH(b,m,14)^i.default.rotrSH(b,m,18)^i.default.rotrBH(b,m,41),k=i.default.rotrSL(b,m,14)^i.default.rotrSL(b,m,18)^i.default.rotrBL(b,m,41),S=b&g^~b&v,x=m&y^~m&w,T=i.default.add5L(E,k,x,s[e],c[e]),A=i.default.add5H(T,_,t,S,a[e],u[e]),P=0|T,O=i.default.rotrSH(r,n,28)^i.default.rotrBH(r,n,34)^i.default.rotrBH(r,n,39),I=i.default.rotrSL(r,n,28)^i.default.rotrBL(r,n,34)^i.default.rotrBL(r,n,39),B=r&o^r&l^o&l,M=n&f^n&d^f&d;_=0|v,E=0|w,v=0|g,w=0|y,g=0|b,y=0|m,({h:b,l:m}=i.default.add(0|h,0|p,0|A,0|P)),h=0|l,p=0|d,l=0|o,d=0|f,o=0|r,f=0|n;const R=i.default.add3L(P,I,M);r=i.default.add3H(R,A,O,B),n=0|R}({h:r,l:n}=i.default.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:o,l:f}=i.default.add(0|this.Bh,0|this.Bl,0|o,0|f)),({h:l,l:d}=i.default.add(0|this.Ch,0|this.Cl,0|l,0|d)),({h:h,l:p}=i.default.add(0|this.Dh,0|this.Dl,0|h,0|p)),({h:b,l:m}=i.default.add(0|this.Eh,0|this.El,0|b,0|m)),({h:g,l:y}=i.default.add(0|this.Fh,0|this.Fl,0|g,0|y)),({h:v,l:w}=i.default.add(0|this.Gh,0|this.Gl,0|v,0|w)),({h:_,l:E}=i.default.add(0|this.Hh,0|this.Hl,0|_,0|E)),this.set(r,n,o,f,l,d,h,p,b,m,g,y,v,w,_,E)}roundClean(){u.fill(0),c.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}t.SHA512=f;class l extends f{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class d extends f{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class h extends f{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}t.sha512=(0,o.wrapConstructor)(()=>new f),t.sha512_224=(0,o.wrapConstructor)(()=>new l),t.sha512_256=(0,o.wrapConstructor)(()=>new d),t.sha384=(0,o.wrapConstructor)(()=>new h)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={};let i;t.wordlists=n,t._default=i;try{t._default=i=r(202),n.czech=i}catch(e){}try{t._default=i=r(203),n.chinese_simplified=i}catch(e){}try{t._default=i=r(204),n.chinese_traditional=i}catch(e){}try{t._default=i=r(205),n.korean=i}catch(e){}try{t._default=i=r(206),n.french=i}catch(e){}try{t._default=i=r(207),n.italian=i}catch(e){}try{t._default=i=r(208),n.spanish=i}catch(e){}try{t._default=i=r(209),n.japanese=i,n.JA=i}catch(e){}try{t._default=i=r(210),n.portuguese=i}catch(e){}try{t._default=i=r(211),n.english=i,n.EN=i}catch(e){}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BIP32Factory=t.default=void 0;var n=r(212);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n.BIP32Factory}}),Object.defineProperty(t,"BIP32Factory",{enumerable:!0,get:function(){return n.BIP32Factory}})},function(e,t,r){"use strict";var n=r(2),i=r(101),o=r(4).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(e,t){return e<<t|e>>>32-t}function c(e,t,r,n,i,o,a){return u(e+(t&r|~t&n)+i+o|0,a)+t|0}function f(e,t,r,n,i,o,a){return u(e+(t&n|r&~n)+i+o|0,a)+t|0}function l(e,t,r,n,i,o,a){return u(e+(t^r^n)+i+o|0,a)+t|0}function d(e,t,r,n,i,o,a){return u(e+(r^(t|~n))+i+o|0,a)+t|0}n(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=c(r,n,i,o,e[0],3614090360,7),o=c(o,r,n,i,e[1],3905402710,12),i=c(i,o,r,n,e[2],606105819,17),n=c(n,i,o,r,e[3],3250441966,22),r=c(r,n,i,o,e[4],4118548399,7),o=c(o,r,n,i,e[5],1200080426,12),i=c(i,o,r,n,e[6],2821735955,17),n=c(n,i,o,r,e[7],4249261313,22),r=c(r,n,i,o,e[8],1770035416,7),o=c(o,r,n,i,e[9],2336552879,12),i=c(i,o,r,n,e[10],4294925233,17),n=c(n,i,o,r,e[11],2304563134,22),r=c(r,n,i,o,e[12],1804603682,7),o=c(o,r,n,i,e[13],4254626195,12),i=c(i,o,r,n,e[14],2792965006,17),r=f(r,n=c(n,i,o,r,e[15],1236535329,22),i,o,e[1],4129170786,5),o=f(o,r,n,i,e[6],3225465664,9),i=f(i,o,r,n,e[11],643717713,14),n=f(n,i,o,r,e[0],3921069994,20),r=f(r,n,i,o,e[5],3593408605,5),o=f(o,r,n,i,e[10],38016083,9),i=f(i,o,r,n,e[15],3634488961,14),n=f(n,i,o,r,e[4],3889429448,20),r=f(r,n,i,o,e[9],568446438,5),o=f(o,r,n,i,e[14],3275163606,9),i=f(i,o,r,n,e[3],4107603335,14),n=f(n,i,o,r,e[8],1163531501,20),r=f(r,n,i,o,e[13],2850285829,5),o=f(o,r,n,i,e[2],4243563512,9),i=f(i,o,r,n,e[7],1735328473,14),r=l(r,n=f(n,i,o,r,e[12],2368359562,20),i,o,e[5],4294588738,4),o=l(o,r,n,i,e[8],2272392833,11),i=l(i,o,r,n,e[11],1839030562,16),n=l(n,i,o,r,e[14],4259657740,23),r=l(r,n,i,o,e[1],2763975236,4),o=l(o,r,n,i,e[4],1272893353,11),i=l(i,o,r,n,e[7],4139469664,16),n=l(n,i,o,r,e[10],3200236656,23),r=l(r,n,i,o,e[13],681279174,4),o=l(o,r,n,i,e[0],3936430074,11),i=l(i,o,r,n,e[3],3572445317,16),n=l(n,i,o,r,e[6],76029189,23),r=l(r,n,i,o,e[9],3654602809,4),o=l(o,r,n,i,e[12],3873151461,11),i=l(i,o,r,n,e[15],530742520,16),r=d(r,n=l(n,i,o,r,e[2],3299628645,23),i,o,e[0],4096336452,6),o=d(o,r,n,i,e[7],1126891415,10),i=d(i,o,r,n,e[14],2878612391,15),n=d(n,i,o,r,e[5],4237533241,21),r=d(r,n,i,o,e[12],1700485571,6),o=d(o,r,n,i,e[3],2399980690,10),i=d(i,o,r,n,e[10],4293915773,15),n=d(n,i,o,r,e[1],2240044497,21),r=d(r,n,i,o,e[8],1873313359,6),o=d(o,r,n,i,e[15],4264355552,10),i=d(i,o,r,n,e[6],2734768916,15),n=d(n,i,o,r,e[13],1309151649,21),r=d(r,n,i,o,e[4],4149444226,6),o=d(o,r,n,i,e[11],3174756917,10),i=d(i,o,r,n,e[2],718787259,15),n=d(n,i,o,r,e[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 e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},function(e,t,r){"use strict";var n=r(4).Buffer,i=r(216).Transform;function o(e){i.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(2)(o,i),o.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},o.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},o.prototype.update=function(e,t){if(function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)r[o++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)r[this._blockOffset++]=e[i++];for(var a=0,s=8*e.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(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},function(e,t,r){"use strict";(function(t,n){var i;e.exports=x,x.ReadableState=S;r(40).EventEmitter;var o=function(e,t){return e.listeners(t).length},a=r(103),s=r(0).Buffer,u=(void 0!==t?t:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var c,f=r(217);c=f&&f.debuglog?f.debuglog("stream"):function(){};var l,d,h,p=r(218),b=r(104),m=r(105).getHighWaterMark,g=r(28).codes,y=g.ERR_INVALID_ARG_TYPE,v=g.ERR_STREAM_PUSH_AFTER_EOF,w=g.ERR_METHOD_NOT_IMPLEMENTED,_=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(2)(x,a);var E=b.errorOrDestroy,k=["error","close","destroy","pause","resume"];function S(e,t,n){i=i||r(29),e=e||{},"boolean"!=typeof n&&(n=t instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=m(this,e,"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!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=r(41).StringDecoder),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function x(e){if(i=i||r(29),!(this instanceof x))return new x(e);var t=this instanceof i;this._readableState=new S(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function T(e,t,r,n,i){c("readableAddChunk",t);var o,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(c("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,I(e)))}(e,a);else if(i||(o=function(e,t){var r;n=t,s.isBuffer(n)||n instanceof u||"string"==typeof t||void 0===t||e.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(a,t)),o)E(e,o);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),n)a.endEmitted?E(e,new _):A(e,a,t,!0);else if(a.ended)E(e,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?A(e,a,t,!1):B(e,a)):A(e,a,t,!1)}else n||(a.reading=!1,B(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function A(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&O(e)),B(e,t)}Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),x.prototype.destroy=b.destroy,x.prototype._undestroy=b.undestroy,x.prototype._destroy=function(e,t){t(e)},x.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=s.from(e,t),t=""),r=!0),T(this,e,t,!1,r)},x.prototype.unshift=function(e){return T(this,e,null,!0,!1)},x.prototype.isPaused=function(){return!1===this._readableState.flowing},x.prototype.setEncoding=function(e){l||(l=r(41).StringDecoder);var t=new l(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};function P(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(I,e))}function I(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,U(e)}function B(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(M,e,t))}function M(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(c("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function R(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function N(e){c("readable nexttick read 0"),e.read(0)}function j(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),U(e),t.flowing&&!t.reading&&e.read(0)}function U(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function C(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function H(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(z,t,e))}function z(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function L(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}x.prototype.read=function(e){c("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?H(this):O(this),null;if(0===(e=P(e,t))&&t.ended)return 0===t.length&&H(this),null;var n,i=t.needReadable;return c("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&c("length less than watermark",i=!0),t.ended||t.reading?c("reading or ended",i=!1):i&&(c("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=P(r,t))),null===(n=e>0?C(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&H(this)),null!==n&&this.emit("data",n),n},x.prototype._read=function(e){E(this,new w("_read()"))},x.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,t);var a=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?u:m;function s(t,n){c("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,c("cleanup"),e.removeListener("close",p),e.removeListener("finish",b),e.removeListener("drain",f),e.removeListener("error",h),e.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",m),r.removeListener("data",d),l=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function u(){c("onend"),e.end()}i.endEmitted?n.nextTick(a):r.once("end",a),e.on("unpipe",s);var f=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,U(e))}}(r);e.on("drain",f);var l=!1;function d(t){c("ondata");var n=e.write(t);c("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==L(i.pipes,e))&&!l&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function h(t){c("onerror",t),m(),e.removeListener("error",h),0===o(e,"error")&&E(e,t)}function p(){e.removeListener("finish",b),m()}function b(){c("onfinish"),e.removeListener("close",p),m()}function m(){c("unpipe"),r.unpipe(e)}return r.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",p),e.once("finish",b),e.emit("pipe",r),i.flowing||(c("pipe resume"),r.resume()),e},x.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=L(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},x.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?O(this):i.reading||n.nextTick(N,this))),r},x.prototype.addListener=x.prototype.on,x.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(R,this),r},x.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(R,this),t},x.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(j,e,t))}(this,e)),e.paused=!1,this},x.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},x.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<k.length;o++)e.on(k[o],this.emit.bind(this,k[o]));return this._read=function(t){c("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(x.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=r(220)),d(this)}),Object.defineProperty(x.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(x.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(x.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),x._fromList=C,Object.defineProperty(x.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(x.from=function(e,t){return void 0===h&&(h=r(221)),h(x,e,t)})}).call(this,r(17),r(10))},function(e,t,r){e.exports=r(40).EventEmitter},function(e,t,r){"use strict";(function(t){function r(e,t){i(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,o){var a=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(o?o(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(i,this,e)):t.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!o&&e?a._writableState?a._writableState.errorEmitted?t.nextTick(n,a):(a._writableState.errorEmitted=!0,t.nextTick(r,a,e)):t.nextTick(r,a,e):o?(t.nextTick(n,a),o(e)):t.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(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this,r(10))},function(e,t,r){"use strict";var n=r(28).codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,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 e.objectMode?16:16384}}},function(e,t,r){"use strict";(function(t,n){function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var o;e.exports=x,x.WritableState=S;var a={deprecate:r(107)},s=r(103),u=r(0).Buffer,c=(void 0!==t?t:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var f,l=r(104),d=r(105).getHighWaterMark,h=r(28).codes,p=h.ERR_INVALID_ARG_TYPE,b=h.ERR_METHOD_NOT_IMPLEMENTED,m=h.ERR_MULTIPLE_CALLBACK,g=h.ERR_STREAM_CANNOT_PIPE,y=h.ERR_STREAM_DESTROYED,v=h.ERR_STREAM_NULL_VALUES,w=h.ERR_STREAM_WRITE_AFTER_END,_=h.ERR_UNKNOWN_ENCODING,E=l.errorOrDestroy;function k(){}function S(e,t,a){o=o||r(29),e=e||{},"boolean"!=typeof a&&(a=t instanceof o),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,i=r.sync,o=r.writecb;if("function"!=typeof o)throw new m;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,i,o){--t.pendingcb,r?(n.nextTick(o,i),n.nextTick(B,e,t),e._writableState.errorEmitted=!0,E(e,i)):(o(i),e._writableState.errorEmitted=!0,E(e,i),B(e,t))}(e,r,i,t,o);else{var a=O(r)||e.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||P(e,r),i?n.nextTick(A,e,r,a,o):A(e,r,a,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function x(e){var t=this instanceof(o=o||r(29));if(!t&&!f.call(x,this))return new x(e);this._writableState=new S(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),s.call(this)}function T(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function A(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),B(e,t)}function P(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,o=new Array(n),a=t.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,T(e,t,!0,t.length,o,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(T(e,t,!1,t.objectMode?1:c.length,c,f,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function O(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function I(e,t){e._final((function(r){t.pendingcb--,r&&E(e,r),t.prefinished=!0,e.emit("prefinish"),B(e,t)}))}function B(e,t){var r=O(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,n.nextTick(I,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return r}r(2)(x,s),S.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(S.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(x,Symbol.hasInstance,{value:function(e){return!!f.call(this,e)||this===x&&(e&&e._writableState instanceof S)}})):f=function(e){return e instanceof this},x.prototype.pipe=function(){E(this,new g)},x.prototype.write=function(e,t,r){var i,o=this._writableState,a=!1,s=!o.objectMode&&(i=e,u.isBuffer(i)||i instanceof c);return s&&!u.isBuffer(e)&&(e=function(e){return u.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=k),o.ending?function(e,t){var r=new w;E(e,r),n.nextTick(t,r)}(this,r):(s||function(e,t,r,i){var o;return null===r?o=new v:"string"==typeof r||t.objectMode||(o=new p("chunk",["string","Buffer"],r)),!o||(E(e,o),n.nextTick(i,o),!1)}(this,o,e,r))&&(o.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=u.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var c=t.length<t.highWaterMark;c||(t.needDrain=!0);if(t.writing||t.corked){var f=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},f?f.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else T(e,t,!1,s,n,i,o);return c}(this,o,s,e,t,r)),a},x.prototype.cork=function(){this._writableState.corked++},x.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||P(this,e))},x.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(x.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(x.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),x.prototype._write=function(e,t,r){r(new b("_write()"))},x.prototype._writev=null,x.prototype.end=function(e,t,r){var i=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,B(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(x.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),x.prototype.destroy=l.destroy,x.prototype._undestroy=l.undestroy,x.prototype._destroy=function(e,t){t(e)}}).call(this,r(17),r(10))},function(e,t,r){(function(t){function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this,r(17))},function(e,t,r){"use strict";e.exports=f;var n=r(28).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(29);function c(e,t){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!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function f(e){if(!(this instanceof f))return new f(e);u.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",l)}function l(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush((function(t,r){d(e,t,r)}))}function d(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new s;if(e._transformState.transforming)throw new a;return e.push(null)}r(2)(f,u),f.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},f.prototype._transform=function(e,t,r){r(new i("_transform()"))},f.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},f.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},f.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},function(e,t,r){"use strict";var n=r(0).Buffer,i=r(2),o=r(101),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],c=[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],f=[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],d=[1352829926,1548603684,1836072691,2053994217,0];function h(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<<t|e>>>32-t}function b(e,t,r,n,i,o,a,s){return p(e+(t^r^n)+o+a|0,s)+i|0}function m(e,t,r,n,i,o,a,s){return p(e+(t&r|~t&n)+o+a|0,s)+i|0}function g(e,t,r,n,i,o,a,s){return p(e+((t|~r)^n)+o+a|0,s)+i|0}function y(e,t,r,n,i,o,a,s){return p(e+(t&n|r&~n)+o+a|0,s)+i|0}function v(e,t,r,n,i,o,a,s){return p(e+(t^(r|~n))+o+a|0,s)+i|0}i(h,o),h.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,h=0|this._e,w=0|this._a,_=0|this._b,E=0|this._c,k=0|this._d,S=0|this._e,x=0;x<80;x+=1){var T,A;x<16?(T=b(r,n,i,o,h,e[s[x]],l[0],c[x]),A=v(w,_,E,k,S,e[u[x]],d[0],f[x])):x<32?(T=m(r,n,i,o,h,e[s[x]],l[1],c[x]),A=y(w,_,E,k,S,e[u[x]],d[1],f[x])):x<48?(T=g(r,n,i,o,h,e[s[x]],l[2],c[x]),A=g(w,_,E,k,S,e[u[x]],d[2],f[x])):x<64?(T=y(r,n,i,o,h,e[s[x]],l[3],c[x]),A=m(w,_,E,k,S,e[u[x]],d[3],f[x])):(T=v(r,n,i,o,h,e[s[x]],l[4],c[x]),A=b(w,_,E,k,S,e[u[x]],d[4],f[x])),r=h,h=o,o=p(i,10),i=n,n=T,w=S,S=k,k=p(E,10),E=_,_=A}var P=this._b+i+k|0;this._b=this._c+o+S|0,this._c=this._d+h+w|0,this._d=this._e+r+_|0,this._e=this._a+n+E|0,this._a=P},h.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 e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=h},function(e,t,r){(t=e.exports=function(e){e=e.toLowerCase();var r=t[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r}).sha=r(224),t.sha1=r(225),t.sha224=r(226),t.sha256=r(111),t.sha384=r(227),t.sha512=r(112)},function(e,t,r){var n=r(2),i=r(30),o=r(4).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 c(e,t,r){return r^e&(t^r)}function f(e,t,r){return e&t|r&(e|t)}function l(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function d(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>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(e){for(var t,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,b=0|this._g,m=0|this._h,g=0;g<16;++g)r[g]=e.readInt32BE(4*g);for(;g<64;++g)r[g]=0|(((t=r[g-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[g-7]+h(r[g-15])+r[g-16];for(var y=0;y<64;++y){var v=m+d(u)+c(u,p,b)+a[y]+r[y]|0,w=l(n)+f(n,i,o)|0;m=b,b=p,p=u,u=s+v|0,s=o,o=i,i=n,n=v+w|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=b+this._g|0,this._h=m+this._h|0},u.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=u},function(e,t,r){var n=r(2),i=r(30),o=r(4).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 c(e,t,r){return r^e&(t^r)}function f(e,t,r){return e&t|r&(e|t)}function l(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function d(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function b(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function g(e,t){return e>>>0<t>>>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(e){for(var t=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,y=0|this._gh,v=0|this._hh,w=0|this._al,_=0|this._bl,E=0|this._cl,k=0|this._dl,S=0|this._el,x=0|this._fl,T=0|this._gl,A=0|this._hl,P=0;P<32;P+=2)t[P]=e.readInt32BE(4*P),t[P+1]=e.readInt32BE(4*P+4);for(;P<160;P+=2){var O=t[P-30],I=t[P-30+1],B=h(O,I),M=p(I,O),R=b(O=t[P-4],I=t[P-4+1]),N=m(I,O),j=t[P-14],U=t[P-14+1],C=t[P-32],H=t[P-32+1],z=M+U|0,L=B+j+g(z,M)|0;L=(L=L+R+g(z=z+N|0,N)|0)+C+g(z=z+H|0,H)|0,t[P]=L,t[P+1]=z}for(var D=0;D<160;D+=2){L=t[D],z=t[D+1];var F=f(r,n,i),q=f(w,_,E),K=l(r,w),W=l(w,r),V=d(s,S),G=d(S,s),X=a[D],Y=a[D+1],$=c(s,u,y),J=c(S,x,T),Q=A+G|0,Z=v+V+g(Q,A)|0;Z=(Z=(Z=Z+$+g(Q=Q+J|0,J)|0)+X+g(Q=Q+Y|0,Y)|0)+L+g(Q=Q+z|0,z)|0;var ee=W+q|0,te=K+F+g(ee,W)|0;v=y,A=T,y=u,T=x,u=s,x=S,s=o+Z+g(S=k+Q|0,k)|0,o=i,k=E,i=n,E=_,n=r,_=w,r=Z+te+g(w=Q+ee|0,Q)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+E|0,this._dl=this._dl+k|0,this._el=this._el+S|0,this._fl=this._fl+x|0,this._gl=this._gl+T|0,this._hl=this._hl+A|0,this._ah=this._ah+r+g(this._al,w)|0,this._bh=this._bh+n+g(this._bl,_)|0,this._ch=this._ch+i+g(this._cl,E)|0,this._dh=this._dh+o+g(this._dl,k)|0,this._eh=this._eh+s+g(this._el,S)|0,this._fh=this._fh+u+g(this._fl,x)|0,this._gh=this._gh+y+g(this._gl,T)|0,this._hh=this._hh+v+g(this._hl,A)|0},u.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},function(e,t,r){"use strict";(function(t,n){var i=r(48);e.exports=v;var o,a=r(88);v.ReadableState=y;r(40).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=r(114),c=r(47).Buffer,f=(void 0!==t?t:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var l=Object.create(r(42));l.inherits=r(31);var d=r(229),h=void 0;h=d&&d.debuglog?d.debuglog("stream"):function(){};var p,b=r(230),m=r(115);l.inherits(v,u);var g=["error","close","destroy","pause","resume"];function y(e,t){e=e||{};var n=t instanceof(o=o||r(23));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.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 b,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=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=r(41).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function v(e){if(o=o||r(23),!(this instanceof v))return new v(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function w(e,t,r,n,i){var o,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,k(e)}(e,a)):(i||(o=function(e,t){var r;n=t,c.isBuffer(n)||n instanceof f||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?_(e,a,t,!1):x(e,a)):_(e,a,t,!1))):n||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(a)}function _(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&k(e)),x(e,t)}Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),v.prototype.destroy=m.destroy,v.prototype._undestroy=m.undestroy,v.prototype._destroy=function(e,t){this.push(null),t(e)},v.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=c.from(e,t),t=""),r=!0),w(this,e,t,!1,r)},v.prototype.unshift=function(e){return w(this,e,null,!0,!1)},v.prototype.isPaused=function(){return!1===this._readableState.flowing},v.prototype.setEncoding=function(e){return p||(p=r(41).StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this};function E(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(S,e):S(e))}function S(e){h("emit readable"),e.emit("readable"),O(e)}function x(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(T,e,t))}function T(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function A(e){h("readable nexttick read 0"),e.read(0)}function P(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),O(e),t.flowing&&!t.reading&&e.read(0)}function O(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function I(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,i=r.data;e-=i.length;for(;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function B(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(M,t,e))}function M(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function R(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}v.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?B(this):k(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&B(this),null;var n,i=t.needReadable;return h("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",i=!0),t.ended||t.reading?h("reading or ended",i=!1):i&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=E(r,t))),null===(n=e>0?I(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&B(this)),null!==n&&this.emit("data",n),n},v.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,h("pipe count=%d opts=%j",o.pipesCount,t);var u=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?f:v;function c(t,n){h("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,h("cleanup"),e.removeListener("close",g),e.removeListener("finish",y),e.removeListener("drain",l),e.removeListener("error",m),e.removeListener("unpipe",c),r.removeListener("end",f),r.removeListener("end",v),r.removeListener("data",b),d=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function f(){h("onend"),e.end()}o.endEmitted?i.nextTick(u):r.once("end",u),e.on("unpipe",c);var l=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,O(e))}}(r);e.on("drain",l);var d=!1;var p=!1;function b(t){h("ondata"),p=!1,!1!==e.write(t)||p||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==R(o.pipes,e))&&!d&&(h("false write response, pause",o.awaitDrain),o.awaitDrain++,p=!0),r.pause())}function m(t){h("onerror",t),v(),e.removeListener("error",m),0===s(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",y),v()}function y(){h("onfinish"),e.removeListener("close",g),v()}function v(){h("unpipe"),r.unpipe(e)}return r.on("data",b),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",m),e.once("close",g),e.once("finish",y),e.emit("pipe",r),o.flowing||(h("pipe resume"),r.resume()),e},v.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=R(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},v.prototype.on=function(e,t){var r=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&k(this):i.nextTick(A,this))}return r},v.prototype.addListener=v.prototype.on,v.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(P,e,t))}(this,e)),this},v.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},v.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(h("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(h("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<g.length;o++)e.on(g[o],this.emit.bind(this,g[o]));return this._read=function(t){h("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(v.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),v._fromList=I}).call(this,r(17),r(10))},function(e,t,r){e.exports=r(40).EventEmitter},function(e,t,r){"use strict";var n=r(48);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(i,this,e)):n.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t&&t(e)})),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)}}},function(e,t,r){"use strict";e.exports=a;var n=r(23),i=Object.create(r(42));function o(e,t){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!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);n.call(this,e),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"==typeof this._flush?this._flush((function(t,r){u(e,t,r)})):u(this,null,null)}function u(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=r(31),i.inherits(a,n),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},a.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},a.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,(function(e){t(e),r.emit("close")}))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(243);t.bip32=n;const i=r(79);t.address=i;const o=r(19);t.crypto=o;const a=r(82);t.ECPair=a;const s=r(12);t.networks=s;const u=r(50);t.payments=u;const c=r(1);t.script=c;var f=r(284);t.Block=f.Block;var l=r(285);t.Psbt=l.Psbt;var d=r(1);t.opcodes=d.OPS;var h=r(52);t.Transaction=h.Transaction;var p=r(286);t.TransactionBuilder=p.TransactionBuilder},function(e,t,r){"use strict";var n=t;n.version=r(251).version,n.utils=r(11),n.rand=r(120),n.curve=r(121),n.curves=r(77),n.ec=r(263),n.eddsa=r(267)},function(e,t,r){"use strict";var n=t;function i(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t}n.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(e,t){return"hex"===t?o(e):e}},function(e,t,r){var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(252);if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(e){return o.randomBytes(e)}}catch(e){}},function(e,t,r){"use strict";var n=t;n.base=r(49),n.short=r(253),n.mont=r(254),n.edwards=r(255)},function(e,t,r){"use strict";var n=r(15).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function a(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?a(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=a,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict";var n=r(15),i=r(43),o=r(122),a=r(24),s=n.sum32,u=n.sum32_4,c=n.sum32_5,f=o.ch32,l=o.maj32,d=o.s0_256,h=o.s1_256,p=o.g0_256,b=o.g1_256,m=i.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(y,m),e.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=u(b(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],m=this.h[2],g=this.h[3],y=this.h[4],v=this.h[5],w=this.h[6],_=this.h[7];for(a(this.k.length===r.length),n=0;n<r.length;n++){var E=c(_,h(y),f(y,v,w),this.k[n],r[n]),k=s(d(i),l(i,o,m));_=w,w=v,v=y,y=s(g,E),g=m,m=o,o=i,i=s(E,k)}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],m),this.h[3]=s(this.h[3],g),this.h[4]=s(this.h[4],y),this.h[5]=s(this.h[5],v),this.h[6]=s(this.h[6],w),this.h[7]=s(this.h[7],_)},y.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(e,t,r){"use strict";var n=r(15),i=r(43),o=r(24),a=n.rotr64_hi,s=n.rotr64_lo,u=n.shr64_hi,c=n.shr64_lo,f=n.sum64,l=n.sum64_hi,d=n.sum64_lo,h=n.sum64_4_hi,p=n.sum64_4_lo,b=n.sum64_5_hi,m=n.sum64_5_lo,g=i.BlockHash,y=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(){if(!(this instanceof v))return new v;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=y,this.W=new Array(160)}function w(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function _(e,t,r,n,i,o){var a=t&n^~t&o;return a<0&&(a+=4294967296),a}function E(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function k(e,t,r,n,i,o){var a=t&n^t&o^n&o;return a<0&&(a+=4294967296),a}function S(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function T(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function A(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function P(e,t){var r=a(e,t,1)^a(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function O(e,t){var r=s(e,t,1)^s(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=a(e,t,19)^a(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}function B(e,t){var r=s(e,t,19)^s(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(v,g),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=I(r[n-4],r[n-3]),o=B(r[n-4],r[n-3]),a=r[n-14],s=r[n-13],u=P(r[n-30],r[n-29]),c=O(r[n-30],r[n-29]),f=r[n-32],l=r[n-31];r[n]=h(i,o,a,s,u,c,f,l),r[n+1]=p(i,o,a,s,u,c,f,l)}},v.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4],c=this.h[5],h=this.h[6],p=this.h[7],g=this.h[8],y=this.h[9],v=this.h[10],P=this.h[11],O=this.h[12],I=this.h[13],B=this.h[14],M=this.h[15];o(this.k.length===r.length);for(var R=0;R<r.length;R+=2){var N=B,j=M,U=T(g,y),C=A(g,y),H=w(g,y,v,P,O),z=_(g,y,v,P,O,I),L=this.k[R],D=this.k[R+1],F=r[R],q=r[R+1],K=b(N,j,U,C,H,z,L,D,F,q),W=m(N,j,U,C,H,z,L,D,F,q);N=S(n,i),j=x(n,i),U=E(n,i,a,s,u),C=k(n,i,a,s,u,c);var V=l(N,j,U,C),G=d(N,j,U,C);B=O,M=I,O=v,I=P,v=g,P=y,g=l(h,p,K,W),y=d(p,p,K,W),h=u,p=c,u=a,c=s,a=n,s=i,n=l(K,W,V,G),i=d(K,W,V,G)}f(this.h,0,n,i),f(this.h,2,a,s),f(this.h,4,u,c),f(this.h,6,h,p),f(this.h,8,g,y),f(this.h,10,v,P),f(this.h,12,O,I),f(this.h,14,B,M)},v.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(e,t,r){var n=r(4).Buffer;e.exports={check:function(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;var t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;var r=e[5+t];return 0!==r&&(6+t+r===e.length&&(!(128&e[4])&&(!(t>1&&0===e[4]&&!(128&e[5]))&&(!(128&e[t+6])&&!(r>1&&0===e[t+6]&&!(128&e[t+7]))))))},decode:function(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");var t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");var r=e[5+t];if(0===r)throw new Error("S length is zero");if(6+t+r!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(r>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}},encode:function(e,t){var r=e.length,i=t.length;if(0===r)throw new Error("R length is zero");if(0===i)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(i>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&t[0])throw new Error("S value is negative");if(r>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(i>1&&0===t[0]&&!(128&t[1]))throw new Error("S value excessively padded");var o=n.allocUnsafe(6+r+i);return o[0]=48,o[1]=o.length-2,o[2]=2,o[3]=e.length,e.copy(o,4),o[4+r]=2,o[5+r]=t.length,t.copy(o,6+r),o}}},function(e,t,r){(function(t){e.exports=function(e,r){if(!Array.isArray(e))throw TypeError("Expected values Array");if("function"!=typeof r)throw TypeError("Expected digest Function");for(var n=e.length,i=e.concat();n>1;){for(var o=0,a=0;a<n;a+=2,++o){var s=i[a],u=a+1===n?s:i[a+1],c=t.concat([s,u]);i[o]=r(c)}n=o}return i[0]}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(1);function o(e){const t=n.compile(e);return 22===t.length&&t[0]===i.OPS.OP_0&&20===t[1]}t.check=o,o.toJSON=()=>"Witness pubKeyHash output"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(1);function o(e){const t=n.compile(e);return 34===t.length&&t[0]===i.OPS.OP_0&&32===t[1]}t.check=o,o.toJSON=()=>"Witness scriptHash output"},function(e,t,r){"use strict";(function(e){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BitcoinBase=void 0;const u=s(r(307)),c=s(r(371)),f=o(r(96)),l=r(151),d=r(34),h=s(r(57)),p=s(r(99)),b=s(r(75)),m=(0,p.default)(b.default);t.BitcoinBase=class{constructor(e,t={api:{enabled:!0,provider:"BlockStream"}}){this.network=h.default[e],this.hdWalletPath=l.hdWalletPath.bitcoin,this.transactionBuilder=new u.default(t,e,this.network),this.btcInterface=this.transactionBuilder.btcInterface,this.signer=new c.default(this.network),this.currentAccount=void 0,this.currentAccountType=void 0,this.privateKey=void 0,this.publicKey=void 0,this.publicKeys=[]}get signerInfo(){return this.privateKey?{address:this.bitcoinAddress,publicKey:this.publicKey.toString("hex"),addressType:this.currentAccountType}:void 0}static createTransactionInputsAndOutputs({targets:e,extendedUtxo:t,changeAddress:r,feeRate:n}){return u.default.helperHandleInputsAndOutputs({targets:e,extendedUtxo:t,changeObject:{address:r},feeRate:n})}static checkBalanceIsSufficient({targets:e,extendedUtxo:t,changeAddress:r,feeRate:n,fullAmount:i=!1}){try{return u.default.helperHandleInputsAndOutputs({targets:e,extendedUtxo:t,changeObject:{address:r},feeRate:n}),!0}catch(e){return!1}}setMultiSigAccount(e="p2sh"){throw new Error("accountType is incorrect")}setAccountPrivateKey(t){this.privateKey=e.from(t,"hex");let r=(0,d.getPubKeyFromPrivateKeyHex)(t,this.network);this.publicKey=r}setAccountPublicKey(t){this.publicKey=e.from(t,"hex")}setAccountPrivateKeyByMnemonic({mnemonic:e,mnemonicPassword:t="",index:r=0,walletNumber:n=0,addressType:i="p2sh-p2wpkh"}){if(!f.validateMnemonic(e))throw new Error("invalid mnemonic");const o=f.mnemonicToSeedSync(e,t),a=m.fromSeed(o);let s=this.hdWalletPath[i];if(!s)throw new Error("incorrect path or addressType");const u=`${s}/${n}`,c=a.derivePath(u).derive(r);return this.setAccountPrivateKey(c.privateKey.toString("hex")),this.setAccount(i)}setAccount(e="p2pkh"){if(!this.publicKey)throw new Error("account not initialized");let t=this.transactionBuilder.createAddressObject({addressType:e,publicKey:this.publicKey});return this.currentAccount=t.address,this.currentAccountType=e,this.addressObj=t,this.bitcoinAddress=t.address,t.address}getExtendedUtxo(e){return a(this,void 0,void 0,(function*(){return this.transactionBuilder.getExtendedUtxo(e)}))}send({receiverAddress:e,amount:t,fullAmount:r=!1,speed:n="normal"}){return a(this,void 0,void 0,(function*(){if(!(this.currentAccount&&this.currentAccountType&&this.publicKey&&this.privateKey))throw new Error("account not initialized");let i=yield this.getExtendedUtxo({address:this.currentAccount,addressType:this.currentAccountType,publicKey:this.publicKey.toString("hex")});if(t-+t.toFixed()!=0)throw new Error("incorrect amount. amount should be in satoshi");let o=yield this.transactionBuilder._getFeeRate(n),a=yield this.transactionBuilder.processUnsignedTransaction({extendedUtxo:i,targets:[{address:e,value:t}],changeAddress:this.currentAccount,feeRate:o,fullAmount:r}),s=yield this.signer.signPsbt(a,this.privateKey),u=this.signer.finalizePsbts([s]);return yield this.transactionBuilder.sendTx(u)}))}sendSignedPsbt(e){return a(this,void 0,void 0,(function*(){let t=this.signer.finalizePsbts([e]);return yield this.transactionBuilder.sendTx(t)}))}sendSignedTx(e){return a(this,void 0,void 0,(function*(){return yield this.transactionBuilder.sendTx(e)}))}sendMultiSignedPsbt(e=[]){return a(this,void 0,void 0,(function*(){let t=this.signer.finalizePsbts(e);return yield this.transactionBuilder.sendTx(t)}))}increaseTransactionFee(e,t,r){return a(this,void 0,void 0,(function*(){let t=yield this.btcInterface.getTransaction(e);console.log(t),null==t||t.blockNumber}))}}}).call(this,r(0).Buffer)},function(e,t,r){var n=r(53);e.exports=function(e,t,r){if(!isFinite(n.uintOrNaN(r)))return{};for(var i=n.transactionBytes([],t),o=0,a=[],s=n.sumOrNaN(t),u=0;u<e.length;++u){var c=e[u],f=n.inputBytes(c),l=r*f,d=n.uintOrNaN(c.value);if(l>c.value){if(u===e.length-1)return{fee:r*(i+f)}}else if(i+=f,o+=d,a.push(c),!(o<s+r*i))return n.finalize(a,t,r)}return{fee:r*i}}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BitcoinInterface=void 0;const i=r(312),o=r(339),a=r(34),s=r(359),u=r(370),c=r(152);class f extends c.BitcoinInterfaceUtils{constructor(e,t,r={minTeleporterFeeAmount:0}){var n;if(super(t),null===(n=e.rpc)||void 0===n?void 0:n.enabled)this.rpcProvider=i.bitcoin.getRpcProvider(e.rpc);else if("BlockStream"!==e.api.provider&&"MempoolSpace"!==e.api.provider)throw new Error("if rpc is disabled, we just support BlockStream Or MempoolSpace as api provider");e.api.enabled&&(this.apiProviderName=e.api.provider,this.apiProvider=i.bitcoin.getApiProvider(e.api,t)),this.minTeleporterFeeAmount=r.minTeleporterFeeAmount,this.provider=this.rpcProvider||this.apiProvider}getLatestBlockNumber(){return n(this,void 0,void 0,(function*(){return yield this.provider.getLatestBlockNumber()}))}getBlockHash(e){return n(this,void 0,void 0,(function*(){return yield(0,o.runWithRetries)(()=>this.provider.getBlockHash(e))}))}getBlockHeaderHex(e){return n(this,void 0,void 0,(function*(){return yield(0,o.runWithRetries)(()=>this.provider.getBlockHeaderHex(e))}))}getTransaction(e){return n(this,void 0,void 0,(function*(){return this.provider.getTransaction(e)}))}getFeeRate(e){return n(this,void 0,void 0,(function*(){return new i.bitcoin.ApiProviders.MempoolSpace(this.testnet).getRecommendedFeeRate(e)}))}getHexBlockHeaders(e,t){return n(this,void 0,void 0,(function*(){const r=[];let n=null,i="",o=e;for(let s=e;s<=t;s+=1){let e=yield this.getBlockHeaderHex(s);console.log("block",s);let t=(0,a.parseBlockHeader)(e);n&&t.difficulty!==n?(r.push({hexBlockHeaders:i,fromBlockNumber:o,toBlockNumber:s-1,difficulty:n}),i=e,o=s):i+=e,n=t.difficulty}return i&&r.push({hexBlockHeaders:i,fromBlockNumber:o,toBlockNumber:t,difficulty:n}),r}))}getRequestProof(e){return n(this,void 0,void 0,(function*(){let t,r=e.hex||(yield this.provider.getRawTransaction(e.txId));e.blockHash&&e.blockNumber||(t=yield this.provider.getTransaction(e.txId));let n=e.blockHash||(null==t?void 0:t.blockHash),i=e.blockNumber||(null==t?void 0:t.blockNumber);return{parsedTx:(0,a.parseRawTransaction)(r),merkleProof:e.merkleProof||(yield this.getMerkleProof(e.txId,n)),blockNumber:i,blockHash:n}}))}getMerkleProof(e,t){return n(this,void 0,void 0,(function*(){if(!this.rpcProvider)throw new Error("RPC provider not set");let r=yield this.rpcProvider.getBlockTransactionIds(t);return(0,a.calculateMerkleProof)(r,e)}))}getAddressesUtxo(e){return n(this,void 0,void 0,(function*(){if(!this.apiProvider)throw new Error("api provider not set");const t=[];for(let r=0;r<e.length;r+=20){const n=e.slice(r,r+20);t.push(n)}let r=[];for(let e of t){const t=[];for(let r of e){let e=yield this.apiProvider.getUtxos(r);t.push(e)}let n=yield Promise.all(t);if(0===n.flat(1).length)break;r.push(n.flat(1))}return r.flat(1)}))}getAddressesExtendedUtxo(e){return n(this,void 0,void 0,(function*(){if(!this.apiProvider)throw new Error("this function need an api provider");const t=[];for(let r=0;r<e.length;r+=20){const n=e.slice(r,r+20);t.push(n)}let r=[];for(let e of t){const t=[];for(let r of e){let e=this.apiProvider.getUtxos(r.address);t.push(e)}let n=yield Promise.all(t);if(0===n.flat(1).length)break;r.push(n.map((t,r)=>t.map(t=>({hash:t.txId,value:t.value,index:t.index,signerInfo:e[r]}))).flat(1))}return r.flat(1)}))}getBalance(e){var t;return n(this,void 0,void 0,(function*(){if(!this.apiProvider)throw new Error("this function need an api provider");return(null!==(t=yield this.apiProvider.getUtxos(e))&&void 0!==t?t:[]).reduce((e,t)=>e+Number(t.value),0)}))}getBlockTransactions(e,t,r=[]){return n(this,void 0,void 0,(function*(){if(!this.rpcProvider)throw new Error("RPC provider not set");let n=yield this.rpcProvider.getBlockByBlockNumber(t,0),{withdrawTxs:i,depositTxs:o}=(0,a.extractTransactionsAndBlockInfoFromRawBlock)(n,t,e,r,this.network);return o.concat(i)}))}getMultipleBlocksTransactions(e,t,r,i=[]){return n(this,void 0,void 0,(function*(){if(r-t>20)throw new Error("cant get more than 20 block per function call");let n=[];for(let o=+t+1;o<=r;o+=1){console.log(o);const t=yield this.getBlockTransactions(e,o,i);n.push(t)}return n=yield Promise.all(n),n.flat(1)}))}getTransactionHistory(e,t,r){return n(this,void 0,void 0,(function*(){if(this.rpcProvider){let n=r||(yield this.getLatestBlockNumber()),i=Math.max(+t,+n-20);return this.getMultipleBlocksTransactions(e,i,n)}if("BlockStream"!==this.apiProviderName&&"MempoolSpace"!==this.apiProviderName)throw new Error("not support this api provider");return(yield this.apiProvider.getTransactionHistoryForMultipleAddresses(e,t)).flat(1)}))}getMempoolTransactionHistory(e){return n(this,void 0,void 0,(function*(){if("BlockStream"!==this.apiProviderName&&"MempoolSpace"!==this.apiProviderName)throw new Error("not support this api provider");return(yield this.apiProvider.getMempoolTransactionHistoryForMultipleAddresses(e)).flat(1)}))}getTeleporterRequests(e,t,r,i=!1){return n(this,void 0,void 0,(function*(){let n=i?yield this.getMempoolTransactionHistory(e):yield this.getTransactionHistory(e,t,r),o=[],a=[];for(let e of n){let{transaction:t,request:r,lockerAddress:n,lockerLockingScript:i}=yield this.getTeleportRequestByTx(e,e.address);r.status?o.push({transaction:t,request:r,lockerAddress:n,lockerLockingScript:i}):"NO_OP_RETURN"!==r.code&&a.push({transaction:t,request:r,lockerAddress:n,lockerLockingScript:i})}return{requests:o,invalidRequests:a}}))}getTeleportRequestByTx(e,t){return n(this,void 0,void 0,(function*(){let r=e;if(!r.txId)throw new Error("txId not exist");(null==r?void 0:r.vout)||(r=yield this.getTransaction(r.txId));let n=r.vout,i=(0,s.checkAndParseProtocolRequest)(n,t,{minTeleporterFeeAmount:this.minTeleporterFeeAmount}),o=r.addressScript||this.convertAddressToScript(t).script.toString("hex");return{transaction:r,request:i,lockerAddress:t,lockerLockingScript:o}}))}getLockersBurnTransactions(e,t,r,i=!1){return n(this,void 0,void 0,(function*(){let n=i?yield this.getMempoolTransactionHistory(e):yield this.getTransactionHistory(e,t,r),o=[];for(let e of n){let t=e.address,r=yield this.getTransactionBurnInfoByTx(e,t);if(r){const{burnInfo:t,lockerAddress:n,lockerLockingScript:i}=r;o.push({transaction:e,burnInfo:t,lockerAddress:n,lockerLockingScript:i})}}return o}))}getTransactionBurnInfoByTx(e,t){return n(this,void 0,void 0,(function*(){if(!e.txId)throw new Error("txId not exist");let r=e.vin||(yield this.getTransaction(e.txId)).vin,n=(0,u.getBurnTransactionInfo)(t,r,e.vout);if(!n)return null;let i=e.addressScript||this.convertAddressToScript(t).script.toString("hex");return{burnInfo:n,lockerAddress:t,lockerLockingScript:i}}))}}t.BitcoinInterface=f},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},function(e,t,r){"use strict";var n=r(6);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var o;if(r)o=r(t);else if(n.isURLSearchParams(t))o=t.toString();else{var a=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),a.push(i(t)+"="+i(e))})))})),o=a.join("&")}if(o){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},function(e,t,r){"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},function(e,t,r){"use strict";(function(t){var n=r(6);e.exports=function(e,r){r=r||new FormData;var i=[];function o(e){return null===e?"":n.isDate(e)?e.toISOString():n.isArrayBuffer(e)||n.isTypedArray(e)?"function"==typeof Blob?new Blob([e]):t.from(e):e}return function e(t,a){if(n.isPlainObject(t)||n.isArray(t)){if(-1!==i.indexOf(t))throw Error("Circular reference detected in "+a);i.push(t),n.forEach(t,(function(t,i){if(!n.isUndefined(t)){var s,u=a?a+"."+i:i;if(t&&!a&&"object"==typeof t)if(n.endsWith(i,"{}"))t=JSON.stringify(t);else if(n.endsWith(i,"[]")&&(s=n.toArray(t)))return void s.forEach((function(e){!n.isUndefined(e)&&r.append(u,o(e))}));e(t,u)}})),i.pop()}else r.append(a,o(t))}(e),r}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(6),i=r(322),o=r(323),a=r(133),s=r(137),u=r(326),c=r(327),f=r(134),l=r(32),d=r(55),h=r(328);e.exports=function(e){return new Promise((function(t,r){var p,b=e.data,m=e.headers,g=e.responseType;function y(){e.cancelToken&&e.cancelToken.unsubscribe(p),e.signal&&e.signal.removeEventListener("abort",p)}n.isFormData(b)&&n.isStandardBrowserEnv()&&delete m["Content-Type"];var v=new XMLHttpRequest;if(e.auth){var w=e.auth.username||"",_=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";m.Authorization="Basic "+btoa(w+":"+_)}var E=s(e.baseURL,e.url);function k(){if(v){var n="getAllResponseHeaders"in v?u(v.getAllResponseHeaders()):null,o={data:g&&"text"!==g&&"json"!==g?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:n,config:e,request:v};i((function(e){t(e),y()}),(function(e){r(e),y()}),o),v=null}}if(v.open(e.method.toUpperCase(),a(E,e.params,e.paramsSerializer),!0),v.timeout=e.timeout,"onloadend"in v?v.onloadend=k:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(k)},v.onabort=function(){v&&(r(new l("Request aborted",l.ECONNABORTED,e,v)),v=null)},v.onerror=function(){r(new l("Network Error",l.ERR_NETWORK,e,v,v)),v=null},v.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||f;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new l(t,n.clarifyTimeoutError?l.ETIMEDOUT:l.ECONNABORTED,e,v)),v=null},n.isStandardBrowserEnv()){var S=(e.withCredentials||c(E))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;S&&(m[e.xsrfHeaderName]=S)}"setRequestHeader"in v&&n.forEach(m,(function(e,t){void 0===b&&"content-type"===t.toLowerCase()?delete m[t]:v.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(v.withCredentials=!!e.withCredentials),g&&"json"!==g&&(v.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&v.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(p=function(e){v&&(r(!e||e&&e.type?new d:e),v.abort(),v=null)},e.cancelToken&&e.cancelToken.subscribe(p),e.signal&&(e.signal.aborted?p():e.signal.addEventListener("abort",p))),b||(b=null);var x=h(E);x&&-1===["http","https","file"].indexOf(x)?r(new l("Unsupported protocol "+x+":",l.ERR_BAD_REQUEST,e)):v.send(b)}))}},function(e,t,r){"use strict";var n=r(324),i=r(325);e.exports=function(e,t){return e&&!n(t)?i(e,t):t}},function(e,t,r){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,r){"use strict";var n=r(6);e.exports=function(e,t){t=t||{};var r={};function i(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function o(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(e[r],t[r])}function a(e){if(!n.isUndefined(t[e]))return i(void 0,t[e])}function s(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(void 0,t[r])}function u(r){return r in t?i(e[r],t[r]):r in e?i(void 0,e[r]):void 0}var c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:u};return n.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||o,i=t(e);n.isUndefined(i)&&t!==u||(r[e]=i)})),r}},function(e,t){e.exports={version:"0.27.2"}},function(e,t,r){"use strict";(function(e){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(54);t.default=class{constructor(e,t){this.api=(0,i.getAxiosInstance)({baseUrl:e,headers:t})}getOutspend(e,t){return n(this,void 0,void 0,(function*(){return(yield this.api.get(`/tx/${e}/outspend/${t}`)).data}))}getOutspends(e){return n(this,void 0,void 0,(function*(){return(yield this.api.get(`/tx/${e}/outspends`)).data}))}getLatestBlockNumber(){return n(this,void 0,void 0,(function*(){return(yield this.api.get("/blocks/tip/height")).data}))}getBlockHash(e){return n(this,void 0,void 0,(function*(){return(yield this.api.get("/block-height/"+e)).data}))}getBlockHeaderHex(e){return n(this,void 0,void 0,(function*(){const t=yield this.getBlockHash(e);return(yield this.api.get(`/block/${t}/header`)).data}))}getConfirmedTransactions(e,t=""){return n(this,void 0,void 0,(function*(){return(yield this.api.get(`/address/${e}/txs/chain/${t}`)).data}))}getMempoolTransactions(e){return n(this,void 0,void 0,(function*(){return(yield this.api.get(`/address/${e}/txs/mempool`)).data}))}getTransaction(e){return n(this,void 0,void 0,(function*(){let t=(yield this.api.get("/tx/"+e)).data;return{txId:t.txid,version:t.version,locktime:t.locktime,blockTime:t.status.block_time,blockNumber:t.status.block_height||null,blockHash:t.status.block_hash||null,vout:t.vout.map(e=>({address:e.scriptpubkey_address||null,script:e.scriptpubkey,value:e.value})),vin:t.vin.map(e=>({txId:e.txid,index:e.vout,address:e.prevout.scriptpubkey_address||null,script:e.prevout.scriptpubkey,value:e.prevout.value}))}}))}getRawTransaction(e){return n(this,void 0,void 0,(function*(){return(yield this.api.get(`/tx/${e}/hex`)).data}))}getTransactionHistory(e,t=0,r){var i;return n(this,void 0,void 0,(function*(){let n=!0,o=[],a="";for(;n;){let s=yield this.getConfirmedTransactions(e,a),u=s.findIndex(e=>e.txid===r);s=s.filter(e=>+e.status.block_height>t),s=u<0?s:s.filter((e,t)=>t<u),o.push(...s),a=null===(i=s[s.length-1])||void 0===i?void 0:i.txid,n=15===s.length&&u<0&&0!==s.length}return o.map(t=>({address:e,txId:t.txid,version:t.version,locktime:t.locktime,blockNumber:t.status.block_height||null,blockHash:t.status.block_hash||null,blockTime:t.status.block_time||null,vout:t.vout.map(e=>({address:e.scriptpubkey_address||null,script:e.scriptpubkey,value:e.value})),vin:t.vin.map(e=>({txId:e.txid,index:e.vout,address:e.prevout.scriptpubkey_address||null,script:e.prevout.scriptpubkey,value:e.prevout.value}))}))}))}getMempoolTransactionHistory(e){return n(this,void 0,void 0,(function*(){return(yield this.getMempoolTransactions(e)).map(t=>({address:e,txId:t.txid,version:t.version,locktime:t.locktime,vout:t.vout.map(e=>({address:e.scriptpubkey_address||null,script:e.scriptpubkey,value:e.value})),vin:t.vin.map(e=>({txId:e.txid,index:e.vout,address:e.prevout.scriptpubkey_address||null,script:e.prevout.scriptpubkey,value:e.prevout.value}))}))}))}getMempoolTransactionHistoryForMultipleAddresses(e,t=0){return n(this,void 0,void 0,(function*(){const t=[];for(let r of e){let e=yield this.getMempoolTransactionHistory(r);t.push(e)}return yield Promise.all(t)}))}getTransactionHistoryForMultipleAddresses(e,t=0){return n(this,void 0,void 0,(function*(){const r=[];for(let n of e){let e=yield this.getTransactionHistory(n,t);r.push(e),yield(0,i.sleep)(200)}return yield Promise.all(r)}))}getUtxos(e){return n(this,void 0,void 0,(function*(){return(yield this.api.get(`/address/${e}/utxo`)).data.map(t=>{var r;return{address:e,txId:t.txid,index:t.vout,value:t.value,blockNumber:(null===(r=t.status)||void 0===r?void 0:r.block_height)||void 0}})}))}getBalance(e){return n(this,void 0,void 0,(function*(){return(yield this.getUtxos(e)).reduce((e,t)=>e+Number(t.value),0)}))}getBlockTransactionIds(e){return n(this,void 0,void 0,(function*(){return(yield this.api.get(`/block/${e}/txids`)).data}))}getFeeRate(e="normal"){return n(this,void 0,void 0,(function*(){let t=yield this.api.get("/fee-estimates"),r={slow:+t.data[10],normal:+t.data[6],fast:+t.data[3]};return r[e]||r.normal}))}getRecommendedFeeRate(e="normal"){return n(this,void 0,void 0,(function*(){let t=yield this.api.get("/v1/fees/recommended"),r={slow:+t.data.economyFee,normal:+t.data.halfHourFee,fast:+t.data.fastestFee};return r[e]||r.normal}))}sendRawTransaction(e){return n(this,void 0,void 0,(function*(){return(yield this.api.post("/tx",e)).data}))}getMerkleProof(t){return n(this,void 0,void 0,(function*(){let r=(yield this.api.get(`/tx/${t}/merkle-proof`)).data;return{intermediateNodes:r.merkle.reduce((t,r)=>t+e.from(r,"hex").reverse().toString("hex"),"0x"),transactionIndex:r.pos}}))}getLatestBlock(){return n(this,void 0,void 0,(function*(){return(yield this.api.get("/blocks")).data[0]}))}getBlock(e){return n(this,void 0,void 0,(function*(){const t=yield this.getBlockHash(e);return(yield this.api.get("/block/"+t)).data}))}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},function(e,t,r){"use strict";var n=r(7);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var o;if(r)o=r(t);else if(n.isURLSearchParams(t))o=t.toString();else{var a=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),a.push(i(t)+"="+i(e))})))})),o=a.join("&")}if(o){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},function(e,t,r){"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},function(e,t,r){"use strict";(function(t){var n=r(7);e.exports=function(e,r){r=r||new FormData;var i=[];function o(e){return null===e?"":n.isDate(e)?e.toISOString():n.isArrayBuffer(e)||n.isTypedArray(e)?"function"==typeof Blob?new Blob([e]):t.from(e):e}return function e(t,a){if(n.isPlainObject(t)||n.isArray(t)){if(-1!==i.indexOf(t))throw Error("Circular reference detected in "+a);i.push(t),n.forEach(t,(function(t,i){if(!n.isUndefined(t)){var s,u=a?a+"."+i:i;if(t&&!a&&"object"==typeof t)if(n.endsWith(i,"{}"))t=JSON.stringify(t);else if(n.endsWith(i,"[]")&&(s=n.toArray(t)))return void s.forEach((function(e){!n.isUndefined(e)&&r.append(u,o(e))}));e(t,u)}})),i.pop()}else r.append(a,o(t))}(e),r}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(7),i=r(347),o=r(348),a=r(143),s=r(147),u=r(351),c=r(352),f=r(144),l=r(33),d=r(56),h=r(353);e.exports=function(e){return new Promise((function(t,r){var p,b=e.data,m=e.headers,g=e.responseType;function y(){e.cancelToken&&e.cancelToken.unsubscribe(p),e.signal&&e.signal.removeEventListener("abort",p)}n.isFormData(b)&&n.isStandardBrowserEnv()&&delete m["Content-Type"];var v=new XMLHttpRequest;if(e.auth){var w=e.auth.username||"",_=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";m.Authorization="Basic "+btoa(w+":"+_)}var E=s(e.baseURL,e.url);function k(){if(v){var n="getAllResponseHeaders"in v?u(v.getAllResponseHeaders()):null,o={data:g&&"text"!==g&&"json"!==g?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:n,config:e,request:v};i((function(e){t(e),y()}),(function(e){r(e),y()}),o),v=null}}if(v.open(e.method.toUpperCase(),a(E,e.params,e.paramsSerializer),!0),v.timeout=e.timeout,"onloadend"in v?v.onloadend=k:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(k)},v.onabort=function(){v&&(r(new l("Request aborted",l.ECONNABORTED,e,v)),v=null)},v.onerror=function(){r(new l("Network Error",l.ERR_NETWORK,e,v,v)),v=null},v.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||f;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new l(t,n.clarifyTimeoutError?l.ETIMEDOUT:l.ECONNABORTED,e,v)),v=null},n.isStandardBrowserEnv()){var S=(e.withCredentials||c(E))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;S&&(m[e.xsrfHeaderName]=S)}"setRequestHeader"in v&&n.forEach(m,(function(e,t){void 0===b&&"content-type"===t.toLowerCase()?delete m[t]:v.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(v.withCredentials=!!e.withCredentials),g&&"json"!==g&&(v.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&v.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(p=function(e){v&&(r(!e||e&&e.type?new d:e),v.abort(),v=null)},e.cancelToken&&e.cancelToken.subscribe(p),e.signal&&(e.signal.aborted?p():e.signal.addEventListener("abort",p))),b||(b=null);var x=h(E);x&&-1===["http","https","file"].indexOf(x)?r(new l("Unsupported protocol "+x+":",l.ERR_BAD_REQUEST,e)):v.send(b)}))}},function(e,t,r){"use strict";var n=r(349),i=r(350);e.exports=function(e,t){return e&&!n(t)?i(e,t):t}},function(e,t,r){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,r){"use strict";var n=r(7);e.exports=function(e,t){t=t||{};var r={};function i(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function o(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(e[r],t[r])}function a(e){if(!n.isUndefined(t[e]))return i(void 0,t[e])}function s(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(void 0,t[r])}function u(r){return r in t?i(e[r],t[r]):r in e?i(void 0,e[r]):void 0}var c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:u};return n.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||o,i=t(e);n.isUndefined(i)&&t!==u||(r[e]=i)})),r}},function(e,t){e.exports={version:"0.27.2"}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.teleswap=void 0,o(r(360),t),t.teleswap=a(r(364))},function(e,t,r){"use strict";(function(e){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BitcoinInterfaceUtils=void 0;const i=n(r(57)),o=r(34);class a{constructor(e){this.testnet=e.includes("_testnet"),this.network=i.default[e]}convertHashToAddress(t,r){let n=(0,o.createAddressObjectByHash)({addressType:r,hash:e.from(t,"hex")},this.network);if(!n.address)throw new Error("incorrect input");return n.address}convertScriptToAddress(t,r){let n=(0,o.createAddressObjectByScript)({addressType:r,script:e.from(t,"hex")},this.network);if(!n.address)throw new Error("incorrect input");return n.address}convertAddressToScript(e){let{addressObject:t,addressType:r}=(0,o.createAddressObjectByAddress)(e,this.network);return{script:t.output,hash:t.hash,addressType:r}}convertAddressToObject(e){return(0,o.createAddressObjectByAddress)(e,this.network)}createAddressObjectByPublicKey(t,r){return(0,o.createAddressObjectByPublicKey)({publicKey:e.from(t,"hex"),addressType:r},this.network)}}t.BitcoinInterfaceUtils=a,t.default=a}).call(this,r(0).Buffer)},function(e,t){},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.bitcoinUtils=void 0,t.bitcoinUtils=o(r(34)),a(r(306),t),a(r(131),t),a(r(152),t),a(r(129),t)},function(e,t,r){"use strict";t.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=c(e),a=n[0],s=n[1],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),f=0,l=s>0?a-4:a;for(r=0;r<l;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],u[f++]=t>>16&255,u[f++]=t>>8&255,u[f++]=255&t;2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[f++]=255&t);1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[f++]=t>>8&255,u[f++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;a<s;a+=16383)o.push(f(e,a,a+16383>s?s:a+16383));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<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 c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function f(e,t,r){for(var i,o,a=[],s=t;s<r;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[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(e,t){
11
+ /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const n=r(165),i=e=>e instanceof Uint8Array;t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");const o=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));t.bytesToHex=function(e){if(!i(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=o[e[r]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(t/2);for(let t=0;t<r.length;t++){const n=2*t,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");r[t]=o}return r};function a(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function s(e){if("string"==typeof e&&(e=a(e)),!i(e))throw new Error("expected Uint8Array, got "+typeof e);return e}t.nextTick=async()=>{},t.asyncLoop=async function(e,r,n){let i=Date.now();for(let o=0;o<e;o++){n(o);const e=Date.now()-i;e>=0&&e<r||(await(0,t.nextTick)(),i+=e)}},t.utf8ToBytes=a,t.toBytes=s,t.concatBytes=function(...e){const t=new Uint8Array(e.reduce((e,t)=>e+t.length,0));let r=0;return e.forEach(e=>{if(!i(e))throw new Error("Uint8Array expected");t.set(e,r),r+=e.length}),t};t.Hash=class{clone(){return this._cloneInto()}};t.checkOpts=function(e,t){if(void 0!==t&&("object"!=typeof t||(r=t,"[object Object]"!==Object.prototype.toString.call(r)||r.constructor!==Object)))throw new Error("Options should be object or undefined");var r;return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(s(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(s(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(s(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});function r(e){if(e<0||e>9007199254740991||e%1!=0)throw new RangeError("value out of range")}function n(e){return r(e),e<253?1:e<=65535?3:e<=4294967295?5:9}t.encode=function t(i,o,a){if(r(i),o||(o=e.allocUnsafe(n(i))),!e.isBuffer(o))throw new TypeError("buffer must be a Buffer instance");return a||(a=0),i<253?(o.writeUInt8(i,a),Object.assign(t,{bytes:1})):i<=65535?(o.writeUInt8(253,a),o.writeUInt16LE(i,a+1),Object.assign(t,{bytes:3})):i<=4294967295?(o.writeUInt8(254,a),o.writeUInt32LE(i,a+1),Object.assign(t,{bytes:5})):(o.writeUInt8(255,a),o.writeUInt32LE(i>>>0,a+1),o.writeUInt32LE(i/4294967296|0,a+5),Object.assign(t,{bytes:9})),o},t.decode=function t(n,i){if(!e.isBuffer(n))throw new TypeError("buffer must be a Buffer instance");i||(i=0);const o=n.readUInt8(i);if(o<253)return Object.assign(t,{bytes:1}),o;if(253===o)return Object.assign(t,{bytes:3}),n.readUInt16LE(i+1);if(254===o)return Object.assign(t,{bytes:5}),n.readUInt32LE(i+1);{Object.assign(t,{bytes:9});const e=n.readUInt32LE(i+1),o=4294967296*n.readUInt32LE(i+5)+e;return r(o),o}},t.encodingLength=n}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(48),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var o=Object.create(r(42));o.inherits=r(31);var a=r(113),s=r(74);o.inherits(l,a);for(var u=i(s.prototype),c=0;c<u.length;c++){var f=u[c];l.prototype[f]||(l.prototype[f]=s.prototype[f])}function l(e){if(!(this instanceof l))return new l(e);a.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",d)}function d(){this.allowHalfOpen||this._writableState.ended||n.nextTick(h,this)}function h(e){e.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(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),l.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}},function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=r,r.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},function(e,t,r){(function(t){const n=r(14),i=new(0,r(118).ec)("secp256k1"),o=r(274),a=t.alloc(32,0),s=t.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),u=t.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","hex"),c=i.curve.n,f=c.shrn(1),l=i.curve.g;function d(e){return t.isBuffer(e)&&32===e.length}function h(e){return!!d(e)&&e.compare(s)<0}function p(e){if(!t.isBuffer(e))return!1;if(e.length<33)return!1;const r=e[0],n=e.slice(1,33);if(0===n.compare(a))return!1;if(n.compare(u)>=0)return!1;if((2===r||3===r)&&33===e.length){try{w(e)}catch(e){return!1}return!0}const i=e.slice(33);return 0!==i.compare(a)&&(!(i.compare(u)>=0)&&(4===r&&65===e.length))}function b(e){return 4!==e[0]}function m(e){return!!d(e)&&(e.compare(a)>0&&e.compare(s)<0)}function g(e,t){return void 0===e&&void 0!==t?b(t):void 0===e||e}function y(e){return new n(e)}function v(e){return e.toArrayLike(t,"be",32)}function w(e){return i.curve.decodePoint(e)}function _(e,r){return t.from(e._encode(r))}function E(e,r,n){if(!d(e))throw new TypeError("Expected Hash");if(!m(r))throw new TypeError("Expected Private");if(void 0!==n&&!d(n))throw new TypeError("Expected Extra Data (32 bytes)");const i=y(r),a=y(e);let s,u;o(e,r,(function(e){const t=y(e),r=l.mul(t);return!r.isInfinity()&&(s=r.x.umod(c),0!==s.isZero()&&(u=t.invm(c).mul(a.add(i.mul(s))).umod(c),0!==u.isZero()))}),m,n),u.cmp(f)>0&&(u=c.sub(u));const h=t.allocUnsafe(64);return v(s).copy(h,0),v(u).copy(h,32),h}e.exports={isPoint:p,isPointCompressed:function(e){return!!p(e)&&b(e)},isPrivate:m,pointAdd:function(e,t,r){if(!p(e))throw new TypeError("Expected Point");if(!p(t))throw new TypeError("Expected Point");const n=w(e),i=w(t),o=n.add(i);return o.isInfinity()?null:_(o,g(r,e))},pointAddScalar:function(e,t,r){if(!p(e))throw new TypeError("Expected Point");if(!h(t))throw new TypeError("Expected Tweak");const n=g(r,e),i=w(e);if(0===t.compare(a))return _(i,n);const o=y(t),s=l.mul(o),u=i.add(s);return u.isInfinity()?null:_(u,n)},pointCompress:function(e,t){if(!p(e))throw new TypeError("Expected Point");const r=w(e);if(r.isInfinity())throw new TypeError("Expected Point");return _(r,g(t,e))},pointFromScalar:function(e,t){if(!m(e))throw new TypeError("Expected Private");const r=y(e),n=l.mul(r);return n.isInfinity()?null:_(n,g(t))},pointMultiply:function(e,t,r){if(!p(e))throw new TypeError("Expected Point");if(!h(t))throw new TypeError("Expected Tweak");const n=g(r,e),i=w(e),o=y(t),a=i.mul(o);return a.isInfinity()?null:_(a,n)},privateAdd:function(e,t){if(!m(e))throw new TypeError("Expected Private");if(!h(t))throw new TypeError("Expected Tweak");const r=y(e),n=y(t),i=v(r.add(n).umod(c));return m(i)?i:null},privateSub:function(e,t){if(!m(e))throw new TypeError("Expected Private");if(!h(t))throw new TypeError("Expected Tweak");const r=y(e),n=y(t),i=v(r.sub(n).umod(c));return m(i)?i:null},sign:function(e,t){return E(e,t)},signWithEntropy:function(e,t,r){return E(e,t,r)},verify:function(e,r,n,i){if(!d(e))throw new TypeError("Expected Hash");if(!p(r))throw new TypeError("Expected Point");if(!function(e){const r=e.slice(0,32),n=e.slice(32,64);return t.isBuffer(e)&&64===e.length&&r.compare(s)<0&&n.compare(s)<0}(n))throw new TypeError("Expected Signature");const o=w(r),a=y(n.slice(0,32)),u=y(n.slice(32,64));if(i&&u.cmp(f)>0)return!1;if(a.gtn(0)<=0)return!1;if(u.gtn(0)<=0)return!1;const h=y(e),b=u.invm(c),m=h.mul(b).umod(c),g=a.mul(b).umod(c),v=l.mulAdd(m,o,g);return!v.isInfinity()&&v.x.umod(c).eq(a)}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prop=function(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){const e=r.call(this);return this[t]=e,e},set(e){Object.defineProperty(this,t,{configurable:!0,enumerable:!0,value:e,writable:!0})}})},t.value=function(e){let t;return()=>(void 0!==t||(t=e()),t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=void 0;const n=r(44),i=r(21),o=(e,t,r)=>e&t^e&r^t&r,a=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),s=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=new Uint32Array(64);class c extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|s[0],this.B=0|s[1],this.C=0|s[2],this.D=0|s[3],this.E=0|s[4],this.F=0|s[5],this.G=0|s[6],this.H=0|s[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:o,G:a,H:s}=this;return[e,t,r,n,i,o,a,s]}set(e,t,r,n,i,o,a,s){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|a,this.H=0|s}process(e,t){for(let r=0;r<16;r++,t+=4)u[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=u[e-15],r=u[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,o=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;u[e]=o+u[e-7]+n+u[e-16]|0}let{A:r,B:n,C:s,D:c,E:f,F:l,G:d,H:h}=this;for(let e=0;e<64;e++){const t=h+((0,i.rotr)(f,6)^(0,i.rotr)(f,11)^(0,i.rotr)(f,25))+((p=f)&l^~p&d)+a[e]+u[e]|0,b=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+o(r,n,s)|0;h=d,d=l,l=f,f=c+t|0,c=s,s=n,n=r,r=t+b|0}var p;r=r+this.A|0,n=n+this.B|0,s=s+this.C|0,c=c+this.D|0,f=f+this.E|0,l=l+this.F|0,d=d+this.G|0,h=h+this.H|0,this.set(r,n,s,c,f,l,d,h)}roundClean(){u.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class f extends c{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}t.sha256=(0,i.wrapConstructor)(()=>new c),t.sha224=(0,i.wrapConstructor)(()=>new f)},function(e,t,r){"use strict";var n={};function i(e,t,r){r||(r=Error);var i=function(e){var r,n;function i(r,n,i){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i))||this}return n=e,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=e,n[e]=i}function o(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,i,a,s;if("string"==typeof t&&(i="not ",t.substr(!a||a<0?0:+a,i.length)===i)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(n," ").concat(o(t,"type"));else{var u=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(u," ").concat(n," ").concat(o(t,"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(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" 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(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var i=r(102),o=r(106);r(2)(c,i);for(var a=n(o.prototype),s=0;s<a.length;s++){var u=a[s];c.prototype[u]||(c.prototype[u]=o.prototype[u])}function c(e){if(!(this instanceof c))return new c(e);i.call(this,e),o.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||t.nextTick(l,this)}function l(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this,r(10))},function(e,t,r){var n=r(4).Buffer;function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,i=this._blockSize,o=e.length,a=this._len,s=0;s<o;){for(var u=a%i,c=Math.min(o-s,i-u),f=0;f<c;f++)r[u+f]=e[s+f];s+=c,(a+=c)%i==0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=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 e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){"use strict";var n=r(6);function i(e,t,r,n,i){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}n.inherits(i,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var o=i.prototype,a={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(e){a[e]={value:e}})),Object.defineProperties(i,a),Object.defineProperty(o,"isAxiosError",{value:!0}),i.from=function(e,t,r,a,s,u){var c=Object.create(o);return n.toFlatObject(e,c,(function(e){return e!==Error.prototype})),i.call(c,e.message,t,r,a,s),c.name=e.name,u&&Object.assign(c,u),c},e.exports=i},function(e,t,r){"use strict";var n=r(7);function i(e,t,r,n,i){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}n.inherits(i,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var o=i.prototype,a={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(e){a[e]={value:e}})),Object.defineProperties(i,a),Object.defineProperty(o,"isAxiosError",{value:!0}),i.from=function(e,t,r,a,s,u){var c=Object.create(o);return n.toFlatObject(e,c,(function(e){return e!==Error.prototype})),i.call(c,e.message,t,r,a,s),c.name=e.name,u&&Object.assign(c,u),c},e.exports=i},function(e,t,r){"use strict";(function(e){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.addressTypeHelper=t.publicKeyConvertor=t.createAddressObjectByAddress=t.createAddressObjectByPublicKey=t.createAddressObjectByHash=t.createAddressObjectByScript=t.getAddressType=t.validateAddress=t.extractTransactionsAndBlockInfoFromRawBlock=t.parseRawBlock=t.convertBitcoinScriptToAddress=t.parseBlockHeader=t.calculateMerkleProof=t.parseRawTransaction=t.getPrivateKeyHexFromWIF=t.getPubKeyFromPrivateKeyHex=t.getPubKeyFromPrivateKeyWIF=t.getPublicKeyHexByXpubAndIndex=t.reverseBytes=t.generateMnemonic=t.networks=void 0;const s=a(r(57));t.networks=s.default;const u=o(r(96)),c=a(r(99)),f=o(r(75)),l=o(r(35)),d=o(r(117)),h=(0,c.default)(f),p=d.ECPair;l.initEccLib(f);let b=r(37);const m=r(126),g=r(304),y=r(305);function v(t,r,n){let i=t.findIndex(e=>e===r);if(i<0)throw new Error("txId is not in this tree");let o=t.map(t=>e.from(t,"hex").reverse());if(n&&n!==m(o,l.crypto.hash256).toString("hex"))throw new Error("calculated merkleRoot and block merkleRoot not matched");let a=g(o,l.crypto.hash256),s=y(a,o[i]).map(e=>e&&e.toString("hex")).filter(e=>null!=e);return{intermediateNodes:s.reduce((e,t,r)=>r!==i%2&&r<s.length-1?e+t:e,"0x"),transactionIndex:i}}function w(e,t=l.networks.bitcoin){try{return l.address.fromOutputScript(e,t)}catch(e){return null}}function _(e,t=l.networks.bitcoin){if(e.startsWith(t.bech32+"1p"))return"p2tr";if(e.startsWith(t.bech32))return l.address.fromBech32(e),"p2wpkh";let r=l.address.fromBase58Check(e);if(r.version===Number(t.scriptHash))return"p2sh";if(r.version===Number(t.pubKeyHash))return"p2pkh";throw new Error("invalid address")}function E(e,t=l.networks.bitcoin){let r,n=_(e,t);switch(n){case"p2pkh":r=l.payments.p2pkh({address:e,network:t});break;case"p2wpkh":r=l.payments.p2wpkh({address:e,network:t});break;case"p2sh":r=l.payments.p2sh({address:e,network:t});break;case"p2tr":r=l.payments.p2tr({address:e,network:t});break;default:throw new Error("address type is incorrect")}return{addressObject:r,addressType:n}}t.generateMnemonic=function(){return u.generateMnemonic(256)},t.reverseBytes=function(t){return e.from(t,"hex").reverse().toString("hex")},t.getPublicKeyHexByXpubAndIndex=function(e,t=0,r=!1,n=s.default.bitcoin){return h.fromBase58(e,n).derive(r?1:0).derive(t).publicKey.toString("hex")},t.getPubKeyFromPrivateKeyWIF=function(e,t=l.networks.bitcoin){return p.fromWIF(e,t).publicKey},t.getPubKeyFromPrivateKeyHex=function(t,r=l.networks.bitcoin){return p.fromPrivateKey(e.from(t,"hex"),{network:r}).publicKey},t.getPrivateKeyHexFromWIF=function(e,t=l.networks.bitcoin){return p.fromWIF(e,t).privateKey.toString("hex")},t.parseRawTransaction=function(t){const r=4,n=2,i=32,o=4,a=4,s=8;let u=0,c=t.slice(u,2*r);u+=2*r;let f=t.slice(u,u+2*n);u="0001"===f?u+2*n:u;let l=u,d=b.decode(e.from(t.slice(u),"hex"));u+=2*b.encodingLength(d);for(let r=0;r<d;r+=1){u+=2*i,u+=2*o;let r=b.decode(e.from(t.slice(u),"hex"));u+=2*b.encodingLength(r),u+=2*r,u+=2*a}let h=u,p=u,m=b.decode(e.from(t.slice(u),"hex"));u+=2*b.encodingLength(m);for(let r=0;r<m;r+=1){u+=2*s;let r=b.decode(e.from(t.slice(u),"hex"));u+=2*b.encodingLength(r),u+=2*r}let g=u;return c="0x"+c,f="0x"+f,{version:c,flag:f,vin:"0x"+t.slice(l,h),vout:"0x"+t.slice(p,g),witness:"0x"+t.slice(g,t.length-8),locktime:"0x"+t.slice(t.length-8,t.length)}},t.calculateMerkleProof=v,t.parseBlockHeader=function(e){const t={version:4,previousBlockHash:32,merkleRoot:32,timestamp:4,difficulty:4,nonce:4};let r=0,n={};for(let i in t)n[i]=e.slice(r,r+2*t[i]),r+=2*t[i];return n},t.convertBitcoinScriptToAddress=w,t.parseRawBlock=function(t,r,n=l.networks.bitcoin){var i;let o=l.Block.fromBuffer(e.from(t,"hex")),a=o.getHash().toString("hex"),s=o.merkleRoot.toString("hex"),u=o.prevHash.toString("hex");return{blockNumber:r,merkleRoot:s,prvBlockHash:u,transactions:null===(i=o.transactions)||void 0===i?void 0:i.map(t=>({txId:t.getId(),version:t.version,locktime:t.locktime,blockNumber:r,blockHash:a,vout:t.outs.map((e,t)=>({address:w(e.script,n),script:e.script.toString("hex"),value:e.value,index:t})),vin:t.ins.map(t=>({txId:e.from(t.hash).reverse().toString("hex"),index:t.index}))}))}},t.extractTransactionsAndBlockInfoFromRawBlock=function(t,r,n=[],i=[],o=l.networks.bitcoin){var a;let s=l.Block.fromBuffer(e.from(t,"hex")),u=s.getHash().reverse().toString("hex"),c=s.merkleRoot.toString("hex"),f=s.prevHash.toString("hex"),d={blockNumber:r,blockHash:u,merkleRoot:c,prvBlockHash:f},h=n.map(e=>E(e,o).addressObject.output.toString("hex")),p=s.transactions.map(e=>e.getId()),b=[],m=[];return null===(a=s.transactions)||void 0===a||a.forEach(t=>{let a,s=t.getId();if(t.ins.find(t=>{let r=e.from(t.hash).reverse().toString("hex"),n=i.find(e=>e.txId===r&&e.index===t.index);return a=null==n?void 0:n.address,!!a})&&a){let n=v(p,s,c);b.push({txId:t.getId(),version:t.version,locktime:t.locktime,blockNumber:r,blockHash:u,merkleProof:n,vout:t.outs.map(e=>({address:w(e.script,o),script:e.script.toString("hex"),value:e.value})),vin:t.ins.map(t=>{let r=e.from(t.hash).reverse().toString("hex"),n=i.find(e=>e.txId===r&&e.index===t.index);return{txId:e.from(t.hash).reverse().toString("hex"),index:t.index,address:(null==n?void 0:n.address)||null,script:(null==n?void 0:n.script)||null,value:(null==n?void 0:n.value)||null}}),address:a,addressScript:E(a,o).addressObject.output.toString("hex")})}let f=-1;if(t.outs.find(e=>{let t=h.findIndex(t=>t===e.script.toString("hex"));return t>=0&&(f=t,!0)})&&f>=0){let i=v(p,s,c);m.push({txId:t.getId(),version:t.version,locktime:t.locktime,blockNumber:r,blockHash:u,merkleProof:i,vout:t.outs.map(e=>({address:w(e.script,o),script:e.script.toString("hex"),value:e.value})),vin:t.ins.map(t=>({txId:e.from(t.hash).reverse().toString("hex"),index:t.index})),addressScript:h[f],address:n[f]})}}),{blockInfo:d,withdrawTxs:b,depositTxs:m}},t.validateAddress=function(e,t=l.networks.bitcoin){try{let r=!1;if(e.startsWith(t.bech32))l.address.fromBech32(e),r=!0;else{let n=l.address.fromBase58Check(e);r=n.version===Number(t.scriptHash)||n.version===Number(t.pubKeyHash)}return r}catch(e){return!1}},t.getAddressType=_,t.createAddressObjectByScript=function({addressType:e,script:t},r=l.networks.bitcoin){let n;switch(e){case"p2pkh":n=l.payments.p2pkh({output:t,network:r});break;case"p2wpkh":n=l.payments.p2wpkh({output:t,network:r});break;case"p2sh":n=l.payments.p2sh({output:t,network:r});break;case"p2wsh":n=l.payments.p2wsh({output:t,network:r});break;case"p2tr":n=l.payments.p2tr({output:t,network:r});break;default:throw new Error("address type is incorrect")}return n},t.createAddressObjectByHash=function({addressType:e,hash:t},r=l.networks.bitcoin){let n;switch(e){case"p2pkh":n=l.payments.p2pkh({hash:t,network:r});break;case"p2wpkh":n=l.payments.p2wpkh({hash:t,network:r});break;case"p2sh":n=l.payments.p2sh({hash:t,network:r});break;case"p2wsh":n=l.payments.p2wsh({hash:t,network:r});break;case"p2tr":n=l.payments.p2tr({pubkey:t,network:r});break;default:throw new Error("address type is incorrect")}return n},t.createAddressObjectByPublicKey=function({addressType:e,publicKey:t},r=l.networks.bitcoin){let n;switch(e){case"p2pkh":n=l.payments.p2pkh({pubkey:t,network:r});break;case"p2wpkh":n=l.payments.p2wpkh({pubkey:t,network:r});break;case"p2sh-p2wpkh":n=l.payments.p2sh({redeem:l.payments.p2wpkh({pubkey:t,network:r})});break;case"p2tr":n=l.payments.p2tr({internalPubkey:(i=t,32===i.length?i:i.slice(1,33)),network:r});break;default:throw new Error("address type is incorrect")}var i;return n},t.createAddressObjectByAddress=E,t.publicKeyConvertor=function(t,r=!0){return p.fromPublicKey(e.from(t,"hex"),{compressed:r}).publicKey.toString("hex")},t.addressTypeHelper={addressTypesNumber:{p2pk:0,p2pkh:1,p2sh:2,p2wpkh:3,p2wsh:4,p2tr:5},addressTypes:["p2pk","p2pkh","p2sh","p2wpkh","p2wsh","p2tr"]}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initEccLib=t.Transaction=t.opcodes=t.Psbt=t.Block=t.script=t.payments=t.networks=t.crypto=t.address=void 0;const n=r(89);t.address=n;const i=r(18);t.crypto=i;const o=r(13);t.networks=o;const a=r(36);t.payments=a;const s=r(9);t.script=s;var u=r(174);Object.defineProperty(t,"Block",{enumerable:!0,get:function(){return u.Block}});var c=r(176);Object.defineProperty(t,"Psbt",{enumerable:!0,get:function(){return c.Psbt}});var f=r(58);Object.defineProperty(t,"opcodes",{enumerable:!0,get:function(){return f.OPS}});var l=r(38);Object.defineProperty(t,"Transaction",{enumerable:!0,get:function(){return l.Transaction}});var d=r(62);Object.defineProperty(t,"initEccLib",{enumerable:!0,get:function(){return d.initEccLib}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.p2tr=t.p2wsh=t.p2wpkh=t.p2sh=t.p2pkh=t.p2pk=t.p2ms=t.embed=void 0;const n=r(157);Object.defineProperty(t,"embed",{enumerable:!0,get:function(){return n.p2data}});const i=r(162);Object.defineProperty(t,"p2ms",{enumerable:!0,get:function(){return i.p2ms}});const o=r(163);Object.defineProperty(t,"p2pk",{enumerable:!0,get:function(){return o.p2pk}});const a=r(164);Object.defineProperty(t,"p2pkh",{enumerable:!0,get:function(){return a.p2pkh}});const s=r(170);Object.defineProperty(t,"p2sh",{enumerable:!0,get:function(){return s.p2sh}});const u=r(171);Object.defineProperty(t,"p2wpkh",{enumerable:!0,get:function(){return u.p2wpkh}});const c=r(172);Object.defineProperty(t,"p2wsh",{enumerable:!0,get:function(){return c.p2wsh}});const f=r(173);Object.defineProperty(t,"p2tr",{enumerable:!0,get:function(){return f.p2tr}})},function(e,t,r){"use strict";var n=r(4).Buffer;function i(e){if(e<0||e>9007199254740991||e%1!=0)throw new RangeError("value out of range")}function o(e){return i(e),e<253?1:e<=65535?3:e<=4294967295?5:9}e.exports={encode:function e(t,r,a){if(i(t),r||(r=n.allocUnsafe(o(t))),!n.isBuffer(r))throw new TypeError("buffer must be a Buffer instance");return a||(a=0),t<253?(r.writeUInt8(t,a),e.bytes=1):t<=65535?(r.writeUInt8(253,a),r.writeUInt16LE(t,a+1),e.bytes=3):t<=4294967295?(r.writeUInt8(254,a),r.writeUInt32LE(t,a+1),e.bytes=5):(r.writeUInt8(255,a),r.writeUInt32LE(t>>>0,a+1),r.writeUInt32LE(t/4294967296|0,a+5),e.bytes=9),r},decode:function e(t,r){if(!n.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");r||(r=0);var o=t.readUInt8(r);if(o<253)return e.bytes=1,o;if(253===o)return e.bytes=3,t.readUInt16LE(r+1);if(254===o)return e.bytes=5,t.readUInt32LE(r+1);e.bytes=9;var a=t.readUInt32LE(r+1),s=4294967296*t.readUInt32LE(r+5)+a;return i(s),s},encodingLength:o}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.Transaction=void 0;const n=r(46),i=r(18),o=r(9),a=r(9),s=r(8),{typeforce:u}=s;function c(e){const t=e.length;return n.varuint.encodingLength(t)+t}const f=e.allocUnsafe(0),l=[],d=e.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),h=e.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),p=e.from("ffffffffffffffff","hex"),b={script:f,valueBuffer:p};class m{constructor(){this.version=1,this.locktime=0,this.ins=[],this.outs=[]}static fromBuffer(e,t){const r=new n.BufferReader(e),i=new m;i.version=r.readInt32();const o=r.readUInt8(),a=r.readUInt8();let s=!1;o===m.ADVANCED_TRANSACTION_MARKER&&a===m.ADVANCED_TRANSACTION_FLAG?s=!0:r.offset-=2;const u=r.readVarInt();for(let e=0;e<u;++e)i.ins.push({hash:r.readSlice(32),index:r.readUInt32(),script:r.readVarSlice(),sequence:r.readUInt32(),witness:l});const c=r.readVarInt();for(let e=0;e<c;++e)i.outs.push({value:r.readUInt64(),script:r.readVarSlice()});if(s){for(let e=0;e<u;++e)i.ins[e].witness=r.readVector();if(!i.hasWitnesses())throw new Error("Transaction has superfluous witness data")}if(i.locktime=r.readUInt32(),t)return i;if(r.offset!==e.length)throw new Error("Transaction has unexpected data");return i}static fromHex(t){return m.fromBuffer(e.from(t,"hex"),!1)}static isCoinbaseHash(e){u(s.Hash256bit,e);for(let t=0;t<32;++t)if(0!==e[t])return!1;return!0}isCoinbase(){return 1===this.ins.length&&m.isCoinbaseHash(this.ins[0].hash)}addInput(e,t,r,n){return u(s.tuple(s.Hash256bit,s.UInt32,s.maybe(s.UInt32),s.maybe(s.Buffer)),arguments),s.Null(r)&&(r=m.DEFAULT_SEQUENCE),this.ins.push({hash:e,index:t,script:n||f,sequence:r,witness:l})-1}addOutput(e,t){return u(s.tuple(s.Buffer,s.Satoshi),arguments),this.outs.push({script:e,value:t})-1}hasWitnesses(){return this.ins.some(e=>0!==e.witness.length)}weight(){return 3*this.byteLength(!1)+this.byteLength(!0)}virtualSize(){return Math.ceil(this.weight()/4)}byteLength(e=!0){const t=e&&this.hasWitnesses();return(t?10:8)+n.varuint.encodingLength(this.ins.length)+n.varuint.encodingLength(this.outs.length)+this.ins.reduce((e,t)=>e+40+c(t.script),0)+this.outs.reduce((e,t)=>e+8+c(t.script),0)+(t?this.ins.reduce((e,t)=>e+function(e){const t=e.length;return n.varuint.encodingLength(t)+e.reduce((e,t)=>e+c(t),0)}(t.witness),0):0)}clone(){const e=new m;return e.version=this.version,e.locktime=this.locktime,e.ins=this.ins.map(e=>({hash:e.hash,index:e.index,script:e.script,sequence:e.sequence,witness:e.witness})),e.outs=this.outs.map(e=>({script:e.script,value:e.value})),e}hashForSignature(t,r,n){if(u(s.tuple(s.UInt32,s.Buffer,s.Number),arguments),t>=this.ins.length)return h;const c=o.compile(o.decompile(r).filter(e=>e!==a.OPS.OP_CODESEPARATOR)),l=this.clone();if((31&n)===m.SIGHASH_NONE)l.outs=[],l.ins.forEach((e,r)=>{r!==t&&(e.sequence=0)});else if((31&n)===m.SIGHASH_SINGLE){if(t>=this.outs.length)return h;l.outs.length=t+1;for(let e=0;e<t;e++)l.outs[e]=b;l.ins.forEach((e,r)=>{r!==t&&(e.sequence=0)})}n&m.SIGHASH_ANYONECANPAY?(l.ins=[l.ins[t]],l.ins[0].script=c):(l.ins.forEach(e=>{e.script=f}),l.ins[t].script=c);const d=e.allocUnsafe(l.byteLength(!1)+4);return d.writeInt32LE(n,d.length-4),l.__toBuffer(d,0,!1),i.hash256(d)}hashForWitnessV1(t,r,o,a,l,d){if(u(s.tuple(s.UInt32,u.arrayOf(s.Buffer),u.arrayOf(s.Satoshi),s.UInt32),arguments),o.length!==this.ins.length||r.length!==this.ins.length)throw new Error("Must supply prevout script and value for all inputs");const h=a===m.SIGHASH_DEFAULT?m.SIGHASH_ALL:a&m.SIGHASH_OUTPUT_MASK,p=(a&m.SIGHASH_INPUT_MASK)===m.SIGHASH_ANYONECANPAY,b=h===m.SIGHASH_NONE,g=h===m.SIGHASH_SINGLE;let y=f,v=f,w=f,_=f,E=f;if(!p){let e=n.BufferWriter.withCapacity(36*this.ins.length);this.ins.forEach(t=>{e.writeSlice(t.hash),e.writeUInt32(t.index)}),y=i.sha256(e.end()),e=n.BufferWriter.withCapacity(8*this.ins.length),o.forEach(t=>e.writeUInt64(t)),v=i.sha256(e.end()),e=n.BufferWriter.withCapacity(r.map(c).reduce((e,t)=>e+t)),r.forEach(t=>e.writeVarSlice(t)),w=i.sha256(e.end()),e=n.BufferWriter.withCapacity(4*this.ins.length),this.ins.forEach(t=>e.writeUInt32(t.sequence)),_=i.sha256(e.end())}if(b||g){if(g&&t<this.outs.length){const e=this.outs[t],r=n.BufferWriter.withCapacity(8+c(e.script));r.writeUInt64(e.value),r.writeVarSlice(e.script),E=i.sha256(r.end())}}else{const e=this.outs.map(e=>8+c(e.script)).reduce((e,t)=>e+t),t=n.BufferWriter.withCapacity(e);this.outs.forEach(e=>{t.writeUInt64(e.value),t.writeVarSlice(e.script)}),E=i.sha256(t.end())}const k=(l?2:0)+(d?1:0),S=174-(p?49:0)-(b?32:0)+(d?32:0)+(l?37:0),x=n.BufferWriter.withCapacity(S);if(x.writeUInt8(a),x.writeInt32(this.version),x.writeUInt32(this.locktime),x.writeSlice(y),x.writeSlice(v),x.writeSlice(w),x.writeSlice(_),b||g||x.writeSlice(E),x.writeUInt8(k),p){const e=this.ins[t];x.writeSlice(e.hash),x.writeUInt32(e.index),x.writeUInt64(o[t]),x.writeVarSlice(r[t]),x.writeUInt32(e.sequence)}else x.writeUInt32(t);if(d){const e=n.BufferWriter.withCapacity(c(d));e.writeVarSlice(d),x.writeSlice(i.sha256(e.end()))}return g&&x.writeSlice(E),l&&(x.writeSlice(l),x.writeUInt8(0),x.writeUInt32(4294967295)),i.taggedHash("TapSighash",e.concat([e.from([0]),x.end()]))}hashForWitnessV0(t,r,o,a){u(s.tuple(s.UInt32,s.Buffer,s.Satoshi,s.UInt32),arguments);let f,l=e.from([]),h=d,p=d,b=d;if(a&m.SIGHASH_ANYONECANPAY||(l=e.allocUnsafe(36*this.ins.length),f=new n.BufferWriter(l,0),this.ins.forEach(e=>{f.writeSlice(e.hash),f.writeUInt32(e.index)}),p=i.hash256(l)),a&m.SIGHASH_ANYONECANPAY||(31&a)===m.SIGHASH_SINGLE||(31&a)===m.SIGHASH_NONE||(l=e.allocUnsafe(4*this.ins.length),f=new n.BufferWriter(l,0),this.ins.forEach(e=>{f.writeUInt32(e.sequence)}),b=i.hash256(l)),(31&a)!==m.SIGHASH_SINGLE&&(31&a)!==m.SIGHASH_NONE){const t=this.outs.reduce((e,t)=>e+8+c(t.script),0);l=e.allocUnsafe(t),f=new n.BufferWriter(l,0),this.outs.forEach(e=>{f.writeUInt64(e.value),f.writeVarSlice(e.script)}),h=i.hash256(l)}else if((31&a)===m.SIGHASH_SINGLE&&t<this.outs.length){const r=this.outs[t];l=e.allocUnsafe(8+c(r.script)),f=new n.BufferWriter(l,0),f.writeUInt64(r.value),f.writeVarSlice(r.script),h=i.hash256(l)}l=e.allocUnsafe(156+c(r)),f=new n.BufferWriter(l,0);const g=this.ins[t];return f.writeInt32(this.version),f.writeSlice(p),f.writeSlice(b),f.writeSlice(g.hash),f.writeUInt32(g.index),f.writeVarSlice(r),f.writeUInt64(o),f.writeUInt32(g.sequence),f.writeSlice(h),f.writeUInt32(this.locktime),f.writeUInt32(a),i.hash256(l)}getHash(t){return t&&this.isCoinbase()?e.alloc(32,0):i.hash256(this.__toBuffer(void 0,void 0,t))}getId(){return(0,n.reverseBuffer)(this.getHash(!1)).toString("hex")}toBuffer(e,t){return this.__toBuffer(e,t,!0)}toHex(){return this.toBuffer(void 0,void 0).toString("hex")}setInputScript(e,t){u(s.tuple(s.Number,s.Buffer),arguments),this.ins[e].script=t}setWitness(e,t){u(s.tuple(s.Number,[s.Buffer]),arguments),this.ins[e].witness=t}__toBuffer(t,r,i=!1){t||(t=e.allocUnsafe(this.byteLength(i)));const o=new n.BufferWriter(t,r||0);o.writeInt32(this.version);const a=i&&this.hasWitnesses();return a&&(o.writeUInt8(m.ADVANCED_TRANSACTION_MARKER),o.writeUInt8(m.ADVANCED_TRANSACTION_FLAG)),o.writeVarInt(this.ins.length),this.ins.forEach(e=>{o.writeSlice(e.hash),o.writeUInt32(e.index),o.writeVarSlice(e.script),o.writeUInt32(e.sequence)}),o.writeVarInt(this.outs.length),this.outs.forEach(e=>{void 0!==e.value?o.writeUInt64(e.value):o.writeSlice(e.valueBuffer),o.writeVarSlice(e.script)}),a&&this.ins.forEach(e=>{o.writeVector(e.witness)}),o.writeUInt32(this.locktime),void 0!==r?t.slice(r,o.offset):t}}t.Transaction=m,m.DEFAULT_SEQUENCE=4294967295,m.SIGHASH_DEFAULT=0,m.SIGHASH_ALL=1,m.SIGHASH_NONE=2,m.SIGHASH_SINGLE=3,m.SIGHASH_ANYONECANPAY=128,m.SIGHASH_OUTPUT_MASK=3,m.SIGHASH_INPUT_MASK=128,m.ADVANCED_TRANSACTION_MARKER=0,m.ADVANCED_TRANSACTION_FLAG=1}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(70),i=r(239);e.exports=i((function(e){var t=n("sha256").update(e).digest();return n("sha256").update(t).digest()}))},function(e,t,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}g(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&g(e,"error",t,r)}(e,i,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function f(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var i,o,a,s;if(c(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=f(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function d(){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(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=d.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):m(i,i.length)}function b(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),s.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},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return f(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var c=u.length,f=m(u,c);for(r=0;r<c;++r)o(f[r],this,t)}return!0},s.prototype.addListener=function(e,t){return l(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return l(this,e,t,!0)},s.prototype.once=function(e,t){return c(t),this.on(e,h(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,h(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,n,i,o,a;if(c(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):b.call(e,t)},s.prototype.listenerCount=b,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t,r){"use strict";var n=r(47).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.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(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=l,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function f(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=a(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=a(t[n]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=a(t[n]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(0).Buffer.isBuffer},function(e,t,r){"use strict";var n=r(15),i=r(24);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;const n=r(60),i=r(21);class o extends i.Hash{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,i.createView)(this.buffer)}update(e){n.default.exists(this);const{view:t,buffer:r,blockLen:o}=this,a=(e=(0,i.toBytes)(e)).length;for(let n=0;n<a;){const s=Math.min(o-this.pos,a-n);if(s!==o)r.set(e.subarray(n,n+s),this.pos),this.pos+=s,n+=s,this.pos===o&&(this.process(t,0),this.pos=0);else{const t=(0,i.createView)(e);for(;o<=a-n;n+=o)this.process(t,n)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){n.default.exists(this),n.default.output(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:o,isLE:a}=this;let{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>o-s&&(this.process(r,0),s=0);for(let e=s;e<o;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),a=Number(r>>i&o),s=Number(r&o),u=n?4:0,c=n?0:4;e.setUint32(t+u,a,n),e.setUint32(t+c,s,n)}(r,o-8,BigInt(8*this.length),a),this.process(r,0);const u=(0,i.createView)(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const f=c/4,l=this.get();if(f>l.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<f;e++)u.setUint32(4*e,l[e],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:a}=this;return e.length=n,e.pos=a,e.finished=i,e.destroyed=o,n%t&&e.buffer.set(r),e}}t.SHA2=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bech32m=t.bech32=void 0;const n="qpzry9x8gf2tvdw0s3jn54khce6mua7l",i={};for(let e=0;e<n.length;e++){const t=n.charAt(e);i[t]=e}function o(e){const t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function a(e){let t=1;for(let r=0;r<e.length;++r){const n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=o(t)^n>>5}t=o(t);for(let r=0;r<e.length;++r){const n=e.charCodeAt(r);t=o(t)^31&n}return t}function s(e,t,r,n){let i=0,o=0;const a=(1<<r)-1,s=[];for(let n=0;n<e.length;++n)for(i=i<<t|e[n],o+=t;o>=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<<r-o&a);else{if(o>=t)return"Excess padding";if(i<<r-o&a)return"Non-zero padding"}return s}function u(e){return s(e,8,5,!0)}function c(e){const t=s(e,5,8,!1);if(Array.isArray(t))return t}function f(e){const t=s(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}function l(e){let t;function r(e,r){if(r=r||90,e.length<8)return e+" too short";if(e.length>r)return"Exceeds length limit";const n=e.toLowerCase(),s=e.toUpperCase();if(e!==n&&e!==s)return"Mixed-case string "+e;const u=(e=n).lastIndexOf("1");if(-1===u)return"No separator character for "+e;if(0===u)return"Missing prefix for "+e;const c=e.slice(0,u),f=e.slice(u+1);if(f.length<6)return"Data too short";let l=a(c);if("string"==typeof l)return l;const d=[];for(let e=0;e<f.length;++e){const t=f.charAt(e),r=i[t];if(void 0===r)return"Unknown character "+t;l=o(l)^r,e+6>=f.length||d.push(r)}return l!==t?"Invalid checksum for "+e:{prefix:c,words:d}}return t="bech32"===e?1:734539939,{decodeUnsafe:function(e,t){const n=r(e,t);if("object"==typeof n)return n},decode:function(e,t){const n=r(e,t);if("object"==typeof n)return n;throw new Error(n)},encode:function(e,r,i){if(i=i||90,e.length+7+r.length>i)throw new TypeError("Exceeds length limit");let s=a(e=e.toLowerCase());if("string"==typeof s)throw new Error(s);let u=e+"1";for(let e=0;e<r.length;++e){const t=r[e];if(t>>5!=0)throw new Error("Non 5-bit word");s=o(s)^t,u+=n.charAt(t)}for(let e=0;e<6;++e)s=o(s);s^=t;for(let e=0;e<6;++e){u+=n.charAt(s>>5*(5-e)&31)}return u},toWords:u,fromWordsUnsafe:c,fromWords:f}}t.bech32=l("bech32"),t.bech32m=l("bech32m")},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.BufferReader=t.BufferWriter=t.cloneBuffer=t.reverseBuffer=t.writeUInt64LE=t.readUInt64LE=t.varuint=void 0;const n=r(8),{typeforce:i}=n,o=r(37);function a(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}function s(e,t){const r=e.readUInt32LE(t);let n=e.readUInt32LE(t+4);return n*=4294967296,a(n+r,9007199254740991),n+r}function u(e,t,r){return a(t,9007199254740991),e.writeInt32LE(-1&t,r),e.writeUInt32LE(Math.floor(t/4294967296),r+4),r+8}t.varuint=o,t.readUInt64LE=s,t.writeUInt64LE=u,t.reverseBuffer=function(e){if(e.length<1)return e;let t=e.length-1,r=0;for(let n=0;n<e.length/2;n++)r=e[n],e[n]=e[t],e[t]=r,t--;return e},t.cloneBuffer=function(t){const r=e.allocUnsafe(t.length);return t.copy(r),r};class c{static withCapacity(t){return new c(e.alloc(t))}constructor(e,t=0){this.buffer=e,this.offset=t,i(n.tuple(n.Buffer,n.UInt32),[e,t])}writeUInt8(e){this.offset=this.buffer.writeUInt8(e,this.offset)}writeInt32(e){this.offset=this.buffer.writeInt32LE(e,this.offset)}writeUInt32(e){this.offset=this.buffer.writeUInt32LE(e,this.offset)}writeUInt64(e){this.offset=u(this.buffer,e,this.offset)}writeVarInt(e){o.encode(e,this.buffer,this.offset),this.offset+=o.encode.bytes}writeSlice(e){if(this.buffer.length<this.offset+e.length)throw new Error("Cannot write slice out of bounds");this.offset+=e.copy(this.buffer,this.offset)}writeVarSlice(e){this.writeVarInt(e.length),this.writeSlice(e)}writeVector(e){this.writeVarInt(e.length),e.forEach(e=>this.writeVarSlice(e))}end(){if(this.buffer.length===this.offset)return this.buffer;throw new Error(`buffer size ${this.buffer.length}, offset ${this.offset}`)}}t.BufferWriter=c;t.BufferReader=class{constructor(e,t=0){this.buffer=e,this.offset=t,i(n.tuple(n.Buffer,n.UInt32),[e,t])}readUInt8(){const e=this.buffer.readUInt8(this.offset);return this.offset++,e}readInt32(){const e=this.buffer.readInt32LE(this.offset);return this.offset+=4,e}readUInt32(){const e=this.buffer.readUInt32LE(this.offset);return this.offset+=4,e}readUInt64(){const e=s(this.buffer,this.offset);return this.offset+=8,e}readVarInt(){const e=o.decode(this.buffer,this.offset);return this.offset+=o.decode.bytes,e}readSlice(e){if(this.buffer.length<this.offset+e)throw new Error("Cannot read slice out of bounds");const t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}readVarSlice(){return this.readSlice(this.readVarInt())}readVector(){const e=this.readVarInt(),t=[];for(let r=0;r<e;r++)t.push(this.readVarSlice());return t}}}).call(this,r(0).Buffer)},function(e,t,r){var n=r(0),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,n)}));case 4:return t.nextTick((function(){e.call(null,r,n,i)}));default:for(o=new Array(s-1),a=0;a<o.length;)o[a++]=arguments[a];return t.nextTick((function(){e.apply(null,o)}))}}}:e.exports=t}).call(this,r(10))},function(e,t,r){"use strict";var n=r(14),i=r(11),o=i.getNAF,a=i.getJSF,s=i.assert;function u(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){s(e.precomputed);var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var a,u,c=[];for(a=0;a<n.length;a+=r.step){u=0;for(var f=a+r.step-1;f>=a;f--)u=(u<<1)+n[f];c.push(u)}for(var l=this.jpoint(null,null,null),d=this.jpoint(null,null,null),h=i;h>0;h--){for(a=0;a<c.length;a++)(u=c[a])===h?d=d.mixedAdd(r.points[a]):u===-h&&(d=d.mixedAdd(r.points[a].neg()));l=l.add(d)}return l.toP()},u.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,a=o(t,r,this._bitLength),u=this.jpoint(null,null,null),c=a.length-1;c>=0;c--){for(var f=0;c>=0&&0===a[c];c--)f++;if(c>=0&&f++,u=u.dblp(f),c<0)break;var l=a[c];s(0!==l),u="affine"===e.type?l>0?u.mixedAdd(i[l-1>>1]):u.mixedAdd(i[-l-1>>1].neg()):l>0?u.add(i[l-1>>1]):u.add(i[-l-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,n,i){var s,u,c,f=this._wnafT1,l=this._wnafT2,d=this._wnafT3,h=0;for(s=0;s<n;s++){var p=(c=t[s])._getNAFPoints(e);f[s]=p.wnd,l[s]=p.points}for(s=n-1;s>=1;s-=2){var b=s-1,m=s;if(1===f[b]&&1===f[m]){var g=[t[b],null,null,t[m]];0===t[b].y.cmp(t[m].y)?(g[1]=t[b].add(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg())):0===t[b].y.cmp(t[m].y.redNeg())?(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].add(t[m].neg())):(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],v=a(r[b],r[m]);for(h=Math.max(v[0].length,h),d[b]=new Array(h),d[m]=new Array(h),u=0;u<h;u++){var w=0|v[0][u],_=0|v[1][u];d[b][u]=y[3*(w+1)+(_+1)],d[m][u]=0,l[b]=g}}else d[b]=o(r[b],f[b],this._bitLength),d[m]=o(r[m],f[m],this._bitLength),h=Math.max(d[b].length,h),h=Math.max(d[m].length,h)}var E=this.jpoint(null,null,null),k=this._wnafT4;for(s=h;s>=0;s--){for(var S=0;s>=0;){var x=!0;for(u=0;u<n;u++)k[u]=0|d[u][s],0!==k[u]&&(x=!1);if(!x)break;S++,s--}if(s>=0&&S++,E=E.dblp(S),s<0)break;for(u=0;u<n;u++){var T=k[u];0!==T&&(T>0?c=l[u][T-1>>1]:T<0&&(c=l[u][-T-1>>1].neg()),E="affine"===c.type?E.mixedAdd(c):E.add(c))}}for(s=0;s<n;s++)l[s]=null;return i?E:E.toP()},u.BasePoint=c,c.prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(e,t){e=i.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?s(e[e.length-1]%2==0):7===e[0]&&s(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(e){return this.encode(e,!0)},c.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},c.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},c.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},c.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},c.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(271);t.embed=n.p2data;const i=r(277);t.p2ms=i.p2ms;const o=r(278);t.p2pk=o.p2pk;const a=r(279);t.p2pkh=a.p2pkh;const s=r(280);t.p2sh=s.p2sh;const u=r(281);t.p2wpkh=u.p2wpkh;const c=r(282);t.p2wsh=c.p2wsh},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(16),i=r(3),o=r(37);function a(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}function s(e,t){const r=e.readUInt32LE(t);let n=e.readUInt32LE(t+4);return n*=4294967296,a(n+r,9007199254740991),n+r}function u(e,t,r){return a(t,9007199254740991),e.writeInt32LE(-1&t,r),e.writeUInt32LE(Math.floor(t/4294967296),r+4),r+8}t.readUInt64LE=s,t.writeUInt64LE=u,t.reverseBuffer=function(e){if(e.length<1)return e;let t=e.length-1,r=0;for(let n=0;n<e.length/2;n++)r=e[n],e[n]=e[t],e[t]=r,t--;return e},t.cloneBuffer=function(t){const r=e.allocUnsafe(t.length);return t.copy(r),r};t.BufferWriter=class{constructor(e,t=0){this.buffer=e,this.offset=t,i(n.tuple(n.Buffer,n.UInt32),[e,t])}writeUInt8(e){this.offset=this.buffer.writeUInt8(e,this.offset)}writeInt32(e){this.offset=this.buffer.writeInt32LE(e,this.offset)}writeUInt32(e){this.offset=this.buffer.writeUInt32LE(e,this.offset)}writeUInt64(e){this.offset=u(this.buffer,e,this.offset)}writeVarInt(e){o.encode(e,this.buffer,this.offset),this.offset+=o.encode.bytes}writeSlice(e){if(this.buffer.length<this.offset+e.length)throw new Error("Cannot write slice out of bounds");this.offset+=e.copy(this.buffer,this.offset)}writeVarSlice(e){this.writeVarInt(e.length),this.writeSlice(e)}writeVector(e){this.writeVarInt(e.length),e.forEach(e=>this.writeVarSlice(e))}};t.BufferReader=class{constructor(e,t=0){this.buffer=e,this.offset=t,i(n.tuple(n.Buffer,n.UInt32),[e,t])}readUInt8(){const e=this.buffer.readUInt8(this.offset);return this.offset++,e}readInt32(){const e=this.buffer.readInt32LE(this.offset);return this.offset+=4,e}readUInt32(){const e=this.buffer.readUInt32LE(this.offset);return this.offset+=4,e}readUInt64(){const e=s(this.buffer,this.offset);return this.offset+=8,e}readVarInt(){const e=o.decode(this.buffer,this.offset);return this.offset+=o.decode.bytes,e}readSlice(e){if(this.buffer.length<this.offset+e)throw new Error("Cannot read slice out of bounds");const t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}readVarSlice(){return this.readSlice(this.readVarInt())}readVector(){const e=this.readVarInt(),t=[];for(let r=0;r<e;r++)t.push(this.readVarSlice());return t}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(51),i=r(19),o=r(1),a=r(1),s=r(16),u=r(3),c=r(37);function f(e){const t=e.length;return c.encodingLength(t)+t}const l=e.allocUnsafe(0),d=[],h=e.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),p=e.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),b=e.from("ffffffffffffffff","hex"),m={script:l,valueBuffer:b};class g{constructor(){this.version=1,this.locktime=0,this.ins=[],this.outs=[]}static fromBuffer(e,t){const r=new n.BufferReader(e),i=new g;i.version=r.readInt32();const o=r.readUInt8(),a=r.readUInt8();let s=!1;o===g.ADVANCED_TRANSACTION_MARKER&&a===g.ADVANCED_TRANSACTION_FLAG?s=!0:r.offset-=2;const u=r.readVarInt();for(let e=0;e<u;++e)i.ins.push({hash:r.readSlice(32),index:r.readUInt32(),script:r.readVarSlice(),sequence:r.readUInt32(),witness:d});const c=r.readVarInt();for(let e=0;e<c;++e)i.outs.push({value:r.readUInt64(),script:r.readVarSlice()});if(s){for(let e=0;e<u;++e)i.ins[e].witness=r.readVector();if(!i.hasWitnesses())throw new Error("Transaction has superfluous witness data")}if(i.locktime=r.readUInt32(),t)return i;if(r.offset!==e.length)throw new Error("Transaction has unexpected data");return i}static fromHex(t){return g.fromBuffer(e.from(t,"hex"),!1)}static isCoinbaseHash(e){u(s.Hash256bit,e);for(let t=0;t<32;++t)if(0!==e[t])return!1;return!0}isCoinbase(){return 1===this.ins.length&&g.isCoinbaseHash(this.ins[0].hash)}addInput(e,t,r,n){return u(s.tuple(s.Hash256bit,s.UInt32,s.maybe(s.UInt32),s.maybe(s.Buffer)),arguments),s.Null(r)&&(r=g.DEFAULT_SEQUENCE),this.ins.push({hash:e,index:t,script:n||l,sequence:r,witness:d})-1}addOutput(e,t){return u(s.tuple(s.Buffer,s.Satoshi),arguments),this.outs.push({script:e,value:t})-1}hasWitnesses(){return this.ins.some(e=>0!==e.witness.length)}weight(){return 3*this.byteLength(!1)+this.byteLength(!0)}virtualSize(){return Math.ceil(this.weight()/4)}byteLength(e=!0){const t=e&&this.hasWitnesses();return(t?10:8)+c.encodingLength(this.ins.length)+c.encodingLength(this.outs.length)+this.ins.reduce((e,t)=>e+40+f(t.script),0)+this.outs.reduce((e,t)=>e+8+f(t.script),0)+(t?this.ins.reduce((e,t)=>e+function(e){const t=e.length;return c.encodingLength(t)+e.reduce((e,t)=>e+f(t),0)}(t.witness),0):0)}clone(){const e=new g;return e.version=this.version,e.locktime=this.locktime,e.ins=this.ins.map(e=>({hash:e.hash,index:e.index,script:e.script,sequence:e.sequence,witness:e.witness})),e.outs=this.outs.map(e=>({script:e.script,value:e.value})),e}hashForSignature(t,r,n){if(u(s.tuple(s.UInt32,s.Buffer,s.Number),arguments),t>=this.ins.length)return p;const c=o.compile(o.decompile(r).filter(e=>e!==a.OPS.OP_CODESEPARATOR)),f=this.clone();if((31&n)===g.SIGHASH_NONE)f.outs=[],f.ins.forEach((e,r)=>{r!==t&&(e.sequence=0)});else if((31&n)===g.SIGHASH_SINGLE){if(t>=this.outs.length)return p;f.outs.length=t+1;for(let e=0;e<t;e++)f.outs[e]=m;f.ins.forEach((e,r)=>{r!==t&&(e.sequence=0)})}n&g.SIGHASH_ANYONECANPAY?(f.ins=[f.ins[t]],f.ins[0].script=c):(f.ins.forEach(e=>{e.script=l}),f.ins[t].script=c);const d=e.allocUnsafe(f.byteLength(!1)+4);return d.writeInt32LE(n,d.length-4),f.__toBuffer(d,0,!1),i.hash256(d)}hashForWitnessV0(t,r,o,a){u(s.tuple(s.UInt32,s.Buffer,s.Satoshi,s.UInt32),arguments);let c,l=e.from([]),d=h,p=h,b=h;if(a&g.SIGHASH_ANYONECANPAY||(l=e.allocUnsafe(36*this.ins.length),c=new n.BufferWriter(l,0),this.ins.forEach(e=>{c.writeSlice(e.hash),c.writeUInt32(e.index)}),p=i.hash256(l)),a&g.SIGHASH_ANYONECANPAY||(31&a)===g.SIGHASH_SINGLE||(31&a)===g.SIGHASH_NONE||(l=e.allocUnsafe(4*this.ins.length),c=new n.BufferWriter(l,0),this.ins.forEach(e=>{c.writeUInt32(e.sequence)}),b=i.hash256(l)),(31&a)!==g.SIGHASH_SINGLE&&(31&a)!==g.SIGHASH_NONE){const t=this.outs.reduce((e,t)=>e+8+f(t.script),0);l=e.allocUnsafe(t),c=new n.BufferWriter(l,0),this.outs.forEach(e=>{c.writeUInt64(e.value),c.writeVarSlice(e.script)}),d=i.hash256(l)}else if((31&a)===g.SIGHASH_SINGLE&&t<this.outs.length){const r=this.outs[t];l=e.allocUnsafe(8+f(r.script)),c=new n.BufferWriter(l,0),c.writeUInt64(r.value),c.writeVarSlice(r.script),d=i.hash256(l)}l=e.allocUnsafe(156+f(r)),c=new n.BufferWriter(l,0);const m=this.ins[t];return c.writeUInt32(this.version),c.writeSlice(p),c.writeSlice(b),c.writeSlice(m.hash),c.writeUInt32(m.index),c.writeVarSlice(r),c.writeUInt64(o),c.writeUInt32(m.sequence),c.writeSlice(d),c.writeUInt32(this.locktime),c.writeUInt32(a),i.hash256(l)}getHash(t){return t&&this.isCoinbase()?e.alloc(32,0):i.hash256(this.__toBuffer(void 0,void 0,t))}getId(){return n.reverseBuffer(this.getHash(!1)).toString("hex")}toBuffer(e,t){return this.__toBuffer(e,t,!0)}toHex(){return this.toBuffer(void 0,void 0).toString("hex")}setInputScript(e,t){u(s.tuple(s.Number,s.Buffer),arguments),this.ins[e].script=t}setWitness(e,t){u(s.tuple(s.Number,[s.Buffer]),arguments),this.ins[e].witness=t}__toBuffer(t,r,i=!1){t||(t=e.allocUnsafe(this.byteLength(i)));const o=new n.BufferWriter(t,r||0);o.writeInt32(this.version);const a=i&&this.hasWitnesses();return a&&(o.writeUInt8(g.ADVANCED_TRANSACTION_MARKER),o.writeUInt8(g.ADVANCED_TRANSACTION_FLAG)),o.writeVarInt(this.ins.length),this.ins.forEach(e=>{o.writeSlice(e.hash),o.writeUInt32(e.index),o.writeVarSlice(e.script),o.writeUInt32(e.sequence)}),o.writeVarInt(this.outs.length),this.outs.forEach(e=>{void 0!==e.value?o.writeUInt64(e.value):o.writeSlice(e.valueBuffer),o.writeVarSlice(e.script)}),a&&this.ins.forEach(e=>{o.writeVector(e.witness)}),o.writeUInt32(this.locktime),void 0!==r?t.slice(r,o.offset):t}}g.DEFAULT_SEQUENCE=4294967295,g.SIGHASH_ALL=1,g.SIGHASH_NONE=2,g.SIGHASH_SINGLE=3,g.SIGHASH_ANYONECANPAY=128,g.ADVANCED_TRANSACTION_MARKER=0,g.ADVANCED_TRANSACTION_FLAG=1,t.Transaction=g}).call(this,r(0).Buffer)},function(e,t){function r(e){return 41+(e.script?e.script.length:107)}function n(e){return 9+(e.script?e.script.length:25)}function i(e,t){return r({})*t}function o(e,t){return 10+e.reduce((function(e,t){return e+r(t)}),0)+t.reduce((function(e,t){return e+n(t)}),0)}function a(e){return"number"!=typeof e?NaN:isFinite(e)?Math.floor(e)!==e||e<0?NaN:e:NaN}function s(e){return e.reduce((function(e,t){return e+a(t.value)}),0)}var u=n({});e.exports={dustThreshold:i,finalize:function(e,t,r){var n=o(e,t),a=r*(n+u),c=s(e)-(s(t)+a);c>i(0,r)&&(t=t.concat({value:c}));var f=s(e)-s(t);return isFinite(f)?{inputs:e,outputs:t,fee:f}:{fee:r*n}},inputBytes:r,outputBytes:n,sumOrNaN:s,sumForgiving:function(e){return e.reduce((function(e,t){return e+(isFinite(t.value)?t.value:0)}),0)},transactionBytes:o,uintOrNaN:a}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getAxiosInstance=t.getRandomInteger=t.runWithRetries=t.sleep=void 0;const o=i(r(315));function a(e){return new Promise(t=>setTimeout(t,e))}t.sleep=a,t.runWithRetries=function(e,t={maxTries:2,retrySleep:1e3}){return n(this,void 0,void 0,(function*(){const r=t.maxTries||2,n=t.retrySleep||1e3;let i;for(let t=0;t<r;t+=1){try{return yield e()}catch(e){i=e}yield a(n)}throw i||new Error("function failed after retries")}))},t.getRandomInteger=function(e,t){return Math.floor(Math.random()*(t-e))+e},t.getAxiosInstance=function({baseUrl:e,timeout:t=1e4,headers:r={},auth:n}){let i,a=e;return i=o.default.create({baseURL:a,timeout:t,auth:n,headers:Object.assign({},r)}),i.interceptors.response.use(e=>e,e=>{if(e.response){const t=new Error(JSON.stringify({data:e.response.data,message:e.message}));return Promise.reject(t)}if(e.request){const t=new Error(e.message);return Promise.reject(t)}return Promise.reject(e)}),i}},function(e,t,r){"use strict";var n=r(32);function i(e){n.call(this,null==e?"canceled":e,n.ERR_CANCELED),this.name="CanceledError"}r(6).inherits(i,n,{__CANCEL__:!0}),e.exports=i},function(e,t,r){"use strict";var n=r(33);function i(e){n.call(this,null==e?"canceled":e,n.ERR_CANCELED),this.name="CanceledError"}r(7).inherits(i,n,{__CANCEL__:!0}),e.exports=i},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const a=o(r(35)),s={bitcoin:a.networks.bitcoin,bitcoin_testnet:a.networks.testnet,litecoin:{messagePrefix:"Litecoin Signed Message:\n",bech32:"ltc",bip32:{public:76067358,private:76066276},pubKeyHash:48,scriptHash:50,wif:176},litecoin_testnet:{messagePrefix:"Litecoin Signed Message:\n",bech32:"tltc",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:58,wif:239}};t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.REVERSE_OPS=t.OPS=void 0;const n={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_CHECKSIGADD:186,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255};t.OPS=n;const i={};t.REVERSE_OPS=i;for(const e of Object.keys(n)){i[n[e]]=e}},function(e,t){var r={Array:function(e){return null!=e&&e.constructor===Array},Boolean:function(e){return"boolean"==typeof e},Function:function(e){return"function"==typeof e},Nil:function(e){return null==e},Number:function(e){return"number"==typeof e},Object:function(e){return"object"==typeof e},String:function(e){return"string"==typeof e},"":function(){return!0}};for(var n in r.Null=r.Nil,r)r[n].toJSON=function(e){return e}.bind(null,n);e.exports=r},function(e,t,r){"use strict";function n(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Wrong positive integer: "+e)}function i(e){if("boolean"!=typeof e)throw new Error("Expected boolean, not "+e)}function o(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function a(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");n(e.outputLen),n(e.blockLen)}function s(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function u(e,t){o(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=void 0,t.number=n,t.bool=i,t.bytes=o,t.hash=a,t.exists=s,t.output=u;const c={number:n,bool:i,bytes:o,hash:a,exists:s,output:u};t.default=c},function(e,t,r){"use strict";var{sha256:n}=r(27),i=r(167);e.exports=i((function(e){return n(n(e))}))},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.getEccLib=t.initEccLib=void 0;const r={};t.initEccLib=function(t){var a;t?t!==r.eccLib&&(i("function"==typeof(a=t).isXOnlyPoint),i(a.isXOnlyPoint(n("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),i(a.isXOnlyPoint(n("fffffffffffffffffffffffffffffffffffffffffffffffffffffffeeffffc2e"))),i(a.isXOnlyPoint(n("f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9"))),i(a.isXOnlyPoint(n("0000000000000000000000000000000000000000000000000000000000000001"))),i(!a.isXOnlyPoint(n("0000000000000000000000000000000000000000000000000000000000000000"))),i(!a.isXOnlyPoint(n("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"))),i("function"==typeof a.xOnlyPointAddTweak),o.forEach(t=>{const r=a.xOnlyPointAddTweak(n(t.pubkey),n(t.tweak));null===t.result?i(null===r):(i(null!==r),i(r.parity===t.parity),i(e.from(r.xOnlyPubkey).equals(n(t.result))))}),r.eccLib=t):r.eccLib=t},t.getEccLib=function(){if(!r.eccLib)throw new Error("No ECC Library provided. You must call initEccLib() with a valid TinySecp256k1Interface instance");return r.eccLib};const n=t=>e.from(t,"hex");function i(e){if(!e)throw new Error("ecc library invalid")}const o=[{pubkey:"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",tweak:"fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140",parity:-1,result:null},{pubkey:"1617d38ed8d8657da4d4761e8057bc396ea9e4b9d29776d4be096016dbd2509b",tweak:"a8397a935f0dfceba6ba9618f6451ef4d80637abf4e6af2669fbc9de6a8fd2ac",parity:1,result:"e478f99dab91052ab39a33ea35fd5e6e4933f4d28023cd597c9a1f6760346adf"},{pubkey:"2c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991",tweak:"823c3cd2142744b075a87eade7e1b8678ba308d566226a0056ca2b7a76f86b47",parity:0,result:"9534f8dc8c6deda2dc007655981c78b49c5d96c778fbf363462a11ec9dfd948c"}]}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tweakKey=t.tapTweakHash=t.tapleafHash=t.findScriptPath=t.toHashTree=t.rootHashFromPath=t.MAX_TAPTREE_DEPTH=t.LEAF_VERSION_TAPSCRIPT=void 0;const n=r(0),i=r(62),o=r(18),a=r(46),s=r(8);t.LEAF_VERSION_TAPSCRIPT=192,t.MAX_TAPTREE_DEPTH=128;function u(e){const r=e.version||t.LEAF_VERSION_TAPSCRIPT;return o.taggedHash("TapLeaf",n.Buffer.concat([n.Buffer.from([r]),l(e.output)]))}function c(e,t){return o.taggedHash("TapTweak",n.Buffer.concat(t?[e,t]:[e]))}function f(e,t){return o.taggedHash("TapBranch",n.Buffer.concat([e,t]))}function l(e){const t=a.varuint.encodingLength(e.length),r=n.Buffer.allocUnsafe(t);return a.varuint.encode(e.length,r),n.Buffer.concat([r,e])}t.rootHashFromPath=function(e,t){if(e.length<33)throw new TypeError(`The control-block length is too small. Got ${e.length}, expected min 33.`);const r=(e.length-33)/32;let n=t;for(let t=0;t<r;t++){const r=e.slice(33+32*t,65+32*t);n=n.compare(r)<0?f(n,r):f(r,n)}return n},t.toHashTree=function e(t){if((0,s.isTapleaf)(t))return{hash:u(t)};const r=[e(t[0]),e(t[1])];r.sort((e,t)=>e.hash.compare(t.hash));const[n,i]=r;return{hash:f(n.hash,i.hash),left:n,right:i}},t.findScriptPath=function e(t,r){if("left"in(n=t)&&"right"in n){const n=e(t.left,r);if(void 0!==n)return[...n,t.right.hash];const i=e(t.right,r);if(void 0!==i)return[...i,t.left.hash]}else if(t.hash.equals(r))return[];var n},t.tapleafHash=u,t.tapTweakHash=c,t.tweakKey=function(e,t){if(!n.Buffer.isBuffer(e))return null;if(32!==e.length)return null;if(t&&32!==t.length)return null;const r=c(e,t),o=(0,i.getEccLib)().xOnlyPointAddTweak(e,r);return o&&null!==o.xOnlyPubkey?{parity:o.parity,x:n.Buffer.from(o.xOnlyPubkey)}:null}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5),i=r(179),o=r(180),a=r(181),s=r(182),u=r(183),c=r(184),f=r(185),l=r(186),d=r(187),h=r(188),p=r(189),b=r(190),m=r(191),g=r(192),y=r(95),v=r(193),w=r(194),_=r(195),E=r(196),k=r(197),S={unsignedTx:o,globalXpub:i,checkPubkey:v.makeChecker([])};t.globals=S;const x={nonWitnessUtxo:u,partialSig:c,sighashType:l,finalScriptSig:a,finalScriptWitness:s,porCommitment:f,witnessUtxo:m,bip32Derivation:y.makeConverter(n.InputTypes.BIP32_DERIVATION),redeemScript:w.makeConverter(n.InputTypes.REDEEM_SCRIPT),witnessScript:k.makeConverter(n.InputTypes.WITNESS_SCRIPT),checkPubkey:v.makeChecker([n.InputTypes.PARTIAL_SIG,n.InputTypes.BIP32_DERIVATION]),tapKeySig:d,tapScriptSig:b,tapLeafScript:h,tapBip32Derivation:_.makeConverter(n.InputTypes.TAP_BIP32_DERIVATION),tapInternalKey:E.makeConverter(n.InputTypes.TAP_INTERNAL_KEY),tapMerkleRoot:p};t.inputs=x;const T={bip32Derivation:y.makeConverter(n.OutputTypes.BIP32_DERIVATION),redeemScript:w.makeConverter(n.OutputTypes.REDEEM_SCRIPT),witnessScript:k.makeConverter(n.OutputTypes.WITNESS_SCRIPT),checkPubkey:v.makeChecker([n.OutputTypes.BIP32_DERIVATION]),tapBip32Derivation:_.makeConverter(n.OutputTypes.TAP_BIP32_DERIVATION),tapTree:g,tapInternalKey:E.makeConverter(n.OutputTypes.TAP_INTERNAL_KEY)};t.outputs=T},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(22);function i(t){const r=t.key.length,i=t.value.length,o=n.encodingLength(r),a=n.encodingLength(i),s=e.allocUnsafe(o+r+a+i);return n.encode(r,s,0),t.key.copy(s,o),n.encode(i,s,o+r),t.value.copy(s,o+r+a),s}function o(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}t.range=e=>[...Array(e).keys()],t.reverseBuffer=function(e){if(e.length<1)return e;let t=e.length-1,r=0;for(let n=0;n<e.length/2;n++)r=e[n],e[n]=e[t],e[t]=r,t--;return e},t.keyValsToBuffer=function(t){const r=t.map(i);return r.push(e.from([0])),e.concat(r)},t.keyValToBuffer=i,t.readUInt64LE=function(e,t){const r=e.readUInt32LE(t);let n=e.readUInt32LE(t+4);return n*=4294967296,o(n+r,9007199254740991),n+r},t.writeUInt64LE=function(e,t,r){return o(t,9007199254740991),e.writeInt32LE(-1&t,r),e.writeUInt32LE(Math.floor(t/4294967296),r+4),r+8}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(64);function i(e,t){const r=e[t];if(void 0===r)throw new Error("No input #"+t);return r}function o(e,t){const r=e[t];if(void 0===r)throw new Error("No output #"+t);return r}function a(e,t,r,n){throw new Error(`Data for ${e} key ${t} is incorrect: Expected ${r} and got ${JSON.stringify(n)}`)}function s(e){return(t,r)=>{for(const i of Object.keys(t)){const o=t[i],{canAdd:s,canAddToArray:u,check:c,expected:f}=n[e+"s"][i]||{},l=!!u;if(c)if(l){if(!Array.isArray(o)||r[i]&&!Array.isArray(r[i]))throw new Error(`Key type ${i} must be an array`);o.every(c)||a(e,i,f,o);const t=r[i]||[],n=new Set;if(!o.every(e=>u(t,e,n)))throw new Error("Can not add duplicate data to array");r[i]=t.concat(o)}else{if(c(o)||a(e,i,f,o),!s(r,o))throw new Error("Can not add duplicate data to "+e);r[i]=o}}}}t.checkForInput=i,t.checkForOutput=o,t.checkHasKey=function(e,t,r){if(e.key[0]<r)throw new Error("Use the method for your specific key instead of addUnknownKeyVal*");if(t&&0!==t.filter(t=>t.key.equals(e.key)).length)throw new Error("Duplicate Key: "+e.key.toString("hex"))},t.getEnumLength=function(e){let t=0;return Object.keys(e).forEach(e=>{Number(isNaN(Number(e)))&&t++}),t},t.inputCheckUncleanFinalized=function(e,t){let r=!1;if(t.nonWitnessUtxo||t.witnessUtxo){const e=!!t.redeemScript,n=!!t.witnessScript,i=!e||!!t.finalScriptSig,o=!n||!!t.finalScriptWitness,a=!!t.finalScriptSig||!!t.finalScriptWitness;r=i&&o&&a}if(!1===r)throw new Error(`Input #${e} has too much or too little data to clean`)},t.updateGlobal=s("global"),t.updateInput=s("input"),t.updateOutput=s("output"),t.addInputAttributes=function(e,r){const n=i(e,e.length-1);t.updateInput(r,n)},t.addOutputAttributes=function(e,r){const n=o(e,e.length-1);t.updateOutput(r,n)},t.defaultVersionSetter=function(t,r){if(!e.isBuffer(r)||r.length<4)throw new Error("Set Version: Invalid Transaction");return r.writeUInt32LE(t,0),r},t.defaultLocktimeSetter=function(t,r){if(!e.isBuffer(r)||r.length<4)throw new Error("Set Locktime: Invalid Transaction");return r.writeUInt32LE(t,r.length-4),r}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.signatureBlocksAction=t.checkInputForSig=t.pubkeyInScript=t.pubkeyPositionInScript=t.witnessStackToScriptWitness=t.isP2TR=t.isP2SHScript=t.isP2WSHScript=t.isP2WPKH=t.isP2PKH=t.isP2PK=t.isP2MS=void 0;const n=r(22),i=r(9),o=r(38),a=r(18),s=r(36);function u(e){return t=>{try{return e({output:t}),!0}catch(e){return!1}}}function c(e,t){const r=(0,a.hash160)(e),n=e.slice(1,33),o=i.decompile(t);if(null===o)throw new Error("Unknown script error");return o.findIndex(t=>"number"!=typeof t&&(t.equals(e)||t.equals(r)||t.equals(n)))}function f(e,t,r){const{hashType:n}=t(e),i=[];n&o.Transaction.SIGHASH_ANYONECANPAY&&i.push("addInput");switch(31&n){case o.Transaction.SIGHASH_ALL:break;case o.Transaction.SIGHASH_SINGLE:case o.Transaction.SIGHASH_NONE:i.push("addOutput"),i.push("setInputSequence")}return-1===i.indexOf(r)}t.isP2MS=u(s.p2ms),t.isP2PK=u(s.p2pk),t.isP2PKH=u(s.p2pkh),t.isP2WPKH=u(s.p2wpkh),t.isP2WSHScript=u(s.p2wsh),t.isP2SHScript=u(s.p2sh),t.isP2TR=u(s.p2tr),t.witnessStackToScriptWitness=function(t){let r=e.allocUnsafe(0);function i(t){const i=r.length,o=n.encodingLength(t);r=e.concat([r,e.allocUnsafe(o)]),n.encode(t,r,i)}function o(t){i(t.length),function(t){r=e.concat([r,e.from(t)])}(t)}var a;return i((a=t).length),a.forEach(o),r},t.pubkeyPositionInScript=c,t.pubkeyInScript=function(e,t){return-1!==c(e,t)},t.checkInputForSig=function(t,r){return function(t){let r=[];if(0===(t.partialSig||[]).length){if(!t.finalScriptSig&&!t.finalScriptWitness)return[];r=function(t){const r=t.finalScriptSig&&i.decompile(t.finalScriptSig)||[],n=t.finalScriptWitness&&i.decompile(t.finalScriptWitness)||[];return r.concat(n).filter(t=>e.isBuffer(t)&&i.isCanonicalScriptSignature(t)).map(e=>({signature:e}))}(t)}else r=t.partialSig;return r.map(e=>e.signature)}(t).some(e=>f(e,i.signature.decode,r))},t.signatureBlocksAction=f}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=t.HMAC=void 0;const n=r(60),i=r(21);class o extends i.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,n.default.hash(e);const r=(0,i.toBytes)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,a=new Uint8Array(o);a.set(r.length>o?e.create().update(r).digest():r);for(let e=0;e<a.length;e++)a[e]^=54;this.iHash.update(a),this.oHash=e.create();for(let e=0;e<a.length;e++)a[e]^=106;this.oHash.update(a),a.fill(0)}update(e){return n.default.exists(this),this.iHash.update(e),this}digestInto(e){n.default.exists(this),n.default.bytes(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:o,outputLen:a}=this;return(e=e).finished=n,e.destroyed=i,e.blockLen=o,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.HMAC=o;t.hmac=(e,t,r)=>new o(e,t).update(r).digest(),t.hmac.create=(e,t)=>new o(e,t)},function(e,t,r){(function(t){var n=r(39);function i(e,t){if(void 0!==t&&e[0]!==t)throw new Error("Invalid network version");if(33===e.length)return{version:e[0],privateKey:e.slice(1,33),compressed:!1};if(34!==e.length)throw new Error("Invalid WIF length");if(1!==e[33])throw new Error("Invalid compression flag");return{version:e[0],privateKey:e.slice(1,33),compressed:!0}}function o(e,r,n){var i=new t(n?34:33);return i.writeUInt8(e,0),r.copy(i,1),n&&(i[33]=1),i}e.exports={decode:function(e,t){return i(n.decode(e),t)},decodeRaw:i,encode:function(e,t,r){return"number"==typeof e?n.encode(o(e,t,r)):n.encode(o(e.version,e.privateKey,e.compressed))},encodeRaw:o}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(2),i=r(100),o=r(109),a=r(110),s=r(72);function u(e){s.call(this,"digest"),this._hash=e}n(u,s),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new o:new u(a(e))}},function(e,t,r){"use strict";var n=r(28).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var a=r.readable||!1!==r.readable&&t.readable,s=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||f()},c=t._writableState&&t._writableState.finished,f=function(){s=!1,c=!0,a||o.call(t)},l=t._readableState&&t._readableState.endEmitted,d=function(){a=!1,l=!0,s||o.call(t)},h=function(e){o.call(t,e)},p=function(){var e;return a&&!l?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):s&&!c?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},b=function(){t.req.on("finish",f)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?s&&!t._writableState&&(t.on("end",u),t.on("close",u)):(t.on("complete",f),t.on("abort",p),t.req?b():t.on("request",b)),t.on("end",d),t.on("finish",f),!1!==r.error&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",f),t.removeListener("abort",p),t.removeListener("request",b),t.req&&t.req.removeListener("finish",f),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",f),t.removeListener("end",d),t.removeListener("error",h),t.removeListener("close",p)}}},function(e,t,r){var n=r(4).Buffer,i=r(228).Transform,o=r(41).StringDecoder;function a(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(2)(a,i),a.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);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(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=a},function(e,t,r){(t=e.exports=r(113)).Stream=t,t.Readable=t,t.Writable=r(74),t.Duplex=r(23),t.Transform=r(116),t.PassThrough=r(234)},function(e,t,r){"use strict";(function(t,n,i){var o=r(48);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=y;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:o.nextTick;y.WritableState=g;var c=Object.create(r(42));c.inherits=r(31);var f={deprecate:r(107)},l=r(114),d=r(47).Buffer,h=(void 0!==i?i:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var p,b=r(115);function m(){}function g(e,t){s=s||r(23),e=e||{};var n=t instanceof s;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,c=e.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:f,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===e.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),S(e,t))}(e,r,n,t,i);else{var a=E(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||_(e,r),n?u(w,e,r,a,i):w(e,r,a,i)}}(t,e)},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 y(e){if(s=s||r(23),!(p.call(y,this)||this instanceof s))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function v(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),S(e,t)}function _(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.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(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(v(e,t,!1,t.objectMode?1:c.length,c,f,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),S(e,t)}))}function S(e,t){var r=E(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(k,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}c.inherits(y,l),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:f.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===y&&(e&&e._writableState instanceof g)}})):p=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=e,d.isBuffer(n)||n instanceof h);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=m),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),o.nextTick(t,r)}(this,r):(s||function(e,t,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||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else v(e,t,!1,s,n,i,o);return u}(this,i,s,e,t,r)),a},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||_(this,e))},y.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,S(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=b.destroy,y.prototype._undestroy=b.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(10),r(232).setImmediate,r(17))},function(e,t,r){"use strict";(function(e){var n=r(242),i=r(68),o=r(27);function a(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var s=a(n);s.utils.hmacSha256Sync=(e,...t)=>i.hmac(o.sha256,e,s.utils.concatBytes(...t)),s.utils.sha256Sync=(...e)=>o.sha256(s.utils.concatBytes(...e));const u=s.utils._normalizePrivateKey,c=new Uint8Array([255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65]);function f(e,t){for(let r=0;r<32;++r)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return 0}function l(e){return e instanceof Uint8Array&&32===e.length&&!(f(e,c)>=0)}function d(e){return e instanceof Uint8Array&&64===e.length&&f(e.subarray(0,32),c)<0&&f(e.subarray(32,64),c)<0}function h(e){return e instanceof Uint8Array&&32===e.length}function p(e){return void 0===e||e instanceof Uint8Array&&32===e.length}function b(e){if("string"!=typeof e)throw new TypeError("hexToNumber: expected string, got "+typeof e);return BigInt("0x"+e)}function m(e){let t;if("bigint"==typeof e)t=e;else if("number"==typeof e&&Number.isSafeInteger(e)&&e>=0)t=BigInt(e);else if("string"==typeof e){if(64!==e.length)throw new Error("Expected 32 bytes of private scalar");t=b(e)}else{if(!(e instanceof Uint8Array))throw new TypeError("Expected valid private scalar");if(32!==e.length)throw new Error("Expected 32 bytes of private scalar");r=e,t=b(s.utils.bytesToHex(r))}var r;if(t<0)throw new Error("Expected private scalar >= 0");return t}const g=(e,t,r)=>{const n=s.Point.fromHex(e),i=m(t),o=s.Point.BASE.multiplyAndAddUnsafe(n,i,1n);if(!o)throw new Error("Tweaked point at infinity");return o.toRawBytes(r)};function y(e,t){return void 0===e?void 0===t||E(t):!!e}function v(e){try{return e()}catch(e){return null}}function w(e,t){if(32===e.length!==t)return!1;try{return!!s.Point.fromHex(e)}catch(e){return!1}}function _(e){return w(e,!1)}function E(e){return w(e,!1)&&33===e.length}function k(e){return s.utils.isValidPrivateKey(e)}function S(e){return w(e,!0)}function x(e){if(!_(e))throw new Error("Expected Point");return e.slice(1,33)}function T(e,t){if(!k(e))throw new Error("Expected Private");return v(()=>s.getPublicKey(e,y(t)))}t.isPoint=_,t.isPointCompressed=E,t.isPrivate=k,t.isXOnlyPoint=S,t.pointAdd=function(e,t,r){if(!_(e)||!_(t))throw new Error("Expected Point");return v(()=>{const n=s.Point.fromHex(e),i=s.Point.fromHex(t);return n.equals(i.negate())?null:n.add(i).toRawBytes(y(r,e))})},t.pointAddScalar=function(e,t,r){if(!_(e))throw new Error("Expected Point");if(!l(t))throw new Error("Expected Tweak");return v(()=>g(e,t,y(r,e)))},t.pointCompress=function(e,t){if(!_(e))throw new Error("Expected Point");return s.Point.fromHex(e).toRawBytes(y(t,e))},t.pointFromScalar=T,t.pointMultiply=function(e,t,r){if(!_(e))throw new Error("Expected Point");if(!l(t))throw new Error("Expected Tweak");return v(()=>((e,t,r)=>{const n=s.Point.fromHex(e),i="string"==typeof t?t:s.utils.bytesToHex(t),o=BigInt("0x"+i);return n.multiply(o).toRawBytes(r)})(e,t,y(r,e)))},t.privateAdd=function(e,t){if(!1===k(e))throw new Error("Expected Private");if(!1===l(t))throw new Error("Expected Tweak");return v(()=>((e,t)=>{const r=u(e),n=m(t),i=s.utils._bigintTo32Bytes(s.utils.mod(r+n,s.CURVE.n));return s.utils.isValidPrivateKey(i)?i:null})(e,t))},t.privateNegate=function(e){if(!1===k(e))throw new Error("Expected Private");return(e=>{const t=u(e),r=s.utils._bigintTo32Bytes(s.CURVE.n-t);return s.utils.isValidPrivateKey(r)?r:null})(e)},t.privateSub=function(e,t){if(!1===k(e))throw new Error("Expected Private");if(!1===l(t))throw new Error("Expected Tweak");return v(()=>((e,t)=>{const r=u(e),n=m(t),i=s.utils._bigintTo32Bytes(s.utils.mod(r-n,s.CURVE.n));return s.utils.isValidPrivateKey(i)?i:null})(e,t))},t.sign=function(e,t,r){if(!k(t))throw new Error("Expected Private");if(!h(e))throw new Error("Expected Scalar");if(!p(r))throw new Error("Expected Extra Data (32 bytes)");return s.signSync(e,t,{der:!1,extraEntropy:r})},t.signSchnorr=function(t,r,n=e.alloc(32,0)){if(!k(r))throw new Error("Expected Private");if(!h(t))throw new Error("Expected Scalar");if(!p(n))throw new Error("Expected Extra Data (32 bytes)");return s.schnorr.signSync(t,r,n)},t.verify=function(e,t,r,n){if(!_(t))throw new Error("Expected Point");if(!d(r))throw new Error("Expected Signature");if(!h(e))throw new Error("Expected Scalar");return s.verify(r,e,t,{strict:n})},t.verifySchnorr=function(e,t,r){if(!S(t))throw new Error("Expected Point");if(!d(r))throw new Error("Expected Signature");if(!h(e))throw new Error("Expected Scalar");return s.schnorr.verifySync(r,e,t)},t.xOnlyPointAddTweak=function(e,t){if(!S(e))throw new Error("Expected Point");if(!l(t))throw new Error("Expected Tweak");return v(()=>{const r=g(e,t,!0);return{parity:r[0]%2==1?1:0,xOnlyPubkey:r.slice(1)}})},t.xOnlyPointFromPoint=x,t.xOnlyPointFromScalar=function(e){if(!k(e))throw new Error("Expected Private");return x(T(e))}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(2),i=r(246),o=r(72),a=r(4).Buffer,s=r(247),u=r(109),c=r(110),f=a.alloc(128);function l(e,t){o.call(this,"digest"),"string"==typeof t&&(t=a.from(t));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=t,t.length>r)?t=("rmd160"===e?new u:c(e)).update(t).digest():t.length<r&&(t=a.concat([t,f],r));for(var n=this._ipad=a.allocUnsafe(r),i=this._opad=a.allocUnsafe(r),s=0;s<r;s++)n[s]=54^t[s],i[s]=92^t[s];this._hash="rmd160"===e?new u:c(e),this._hash.update(n)}n(l,o),l.prototype._update=function(e){this._hash.update(e)},l.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new u:c(this._alg)).update(this._opad).update(e).digest()},e.exports=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new l("rmd160",t):"md5"===e?new i(s,t):new l(e,t)}},function(e,t,r){"use strict";var n,i=t,o=r(78),a=r(121),s=r(11).assert;function u(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(262)}catch(e){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},function(e,t,r){var n=t;n.utils=r(15),n.common=r(43),n.sha=r(256),n.ripemd=r(260),n.hmac=r(261),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(12),i=r(50),o=r(1),a=r(16),s=r(81),u=r(39),c=r(3);function f(e){const t=u.decode(e);if(t.length<21)throw new TypeError(e+" is too short");if(t.length>21)throw new TypeError(e+" is too long");return{version:t.readUInt8(0),hash:t.slice(1)}}function l(t){const r=s.decode(t),n=s.fromWords(r.words.slice(1));return{version:r.words[0],prefix:r.prefix,data:e.from(n)}}t.fromBase58Check=f,t.fromBech32=l,t.toBase58Check=function(t,r){c(a.tuple(a.Hash160bit,a.UInt8),arguments);const n=e.allocUnsafe(21);return n.writeUInt8(r,0),t.copy(n,1),u.encode(n)},t.toBech32=function(e,t,r){const n=s.toWords(e);return n.unshift(t),s.encode(r,n)},t.fromOutputScript=function(e,t){t=t||n.bitcoin;try{return i.p2pkh({output:e,network:t}).address}catch(e){}try{return i.p2sh({output:e,network:t}).address}catch(e){}try{return i.p2wpkh({output:e,network:t}).address}catch(e){}try{return i.p2wsh({output:e,network:t}).address}catch(e){}throw new Error(o.toASM(e)+" has no matching Address")},t.toOutputScript=function(e,t){let r,o;t=t||n.bitcoin;try{r=f(e)}catch(e){}if(r){if(r.version===t.pubKeyHash)return i.p2pkh({hash:r.hash}).output;if(r.version===t.scriptHash)return i.p2sh({hash:r.hash}).output}else{try{o=l(e)}catch(e){}if(o){if(o.prefix!==t.bech32)throw new Error(e+" has an invalid prefix");if(0===o.version){if(20===o.data.length)return i.p2wpkh({hash:o.data}).output;if(32===o.data.length)return i.p2wsh({hash:o.data}).output}}}throw new Error(e+" has no matching Script")}}).call(this,r(0).Buffer)},function(e){e.exports=JSON.parse('{"OP_FALSE":0,"OP_0":0,"OP_PUSHDATA1":76,"OP_PUSHDATA2":77,"OP_PUSHDATA4":78,"OP_1NEGATE":79,"OP_RESERVED":80,"OP_TRUE":81,"OP_1":81,"OP_2":82,"OP_3":83,"OP_4":84,"OP_5":85,"OP_6":86,"OP_7":87,"OP_8":88,"OP_9":89,"OP_10":90,"OP_11":91,"OP_12":92,"OP_13":93,"OP_14":94,"OP_15":95,"OP_16":96,"OP_NOP":97,"OP_VER":98,"OP_IF":99,"OP_NOTIF":100,"OP_VERIF":101,"OP_VERNOTIF":102,"OP_ELSE":103,"OP_ENDIF":104,"OP_VERIFY":105,"OP_RETURN":106,"OP_TOALTSTACK":107,"OP_FROMALTSTACK":108,"OP_2DROP":109,"OP_2DUP":110,"OP_3DUP":111,"OP_2OVER":112,"OP_2ROT":113,"OP_2SWAP":114,"OP_IFDUP":115,"OP_DEPTH":116,"OP_DROP":117,"OP_DUP":118,"OP_NIP":119,"OP_OVER":120,"OP_PICK":121,"OP_ROLL":122,"OP_ROT":123,"OP_SWAP":124,"OP_TUCK":125,"OP_CAT":126,"OP_SUBSTR":127,"OP_LEFT":128,"OP_RIGHT":129,"OP_SIZE":130,"OP_INVERT":131,"OP_AND":132,"OP_OR":133,"OP_XOR":134,"OP_EQUAL":135,"OP_EQUALVERIFY":136,"OP_RESERVED1":137,"OP_RESERVED2":138,"OP_1ADD":139,"OP_1SUB":140,"OP_2MUL":141,"OP_2DIV":142,"OP_NEGATE":143,"OP_ABS":144,"OP_NOT":145,"OP_0NOTEQUAL":146,"OP_ADD":147,"OP_SUB":148,"OP_MUL":149,"OP_DIV":150,"OP_MOD":151,"OP_LSHIFT":152,"OP_RSHIFT":153,"OP_BOOLAND":154,"OP_BOOLOR":155,"OP_NUMEQUAL":156,"OP_NUMEQUALVERIFY":157,"OP_NUMNOTEQUAL":158,"OP_LESSTHAN":159,"OP_GREATERTHAN":160,"OP_LESSTHANOREQUAL":161,"OP_GREATERTHANOREQUAL":162,"OP_MIN":163,"OP_MAX":164,"OP_WITHIN":165,"OP_RIPEMD160":166,"OP_SHA1":167,"OP_SHA256":168,"OP_HASH160":169,"OP_HASH256":170,"OP_CODESEPARATOR":171,"OP_CHECKSIG":172,"OP_CHECKSIGVERIFY":173,"OP_CHECKMULTISIG":174,"OP_CHECKMULTISIGVERIFY":175,"OP_NOP1":176,"OP_NOP2":177,"OP_CHECKLOCKTIMEVERIFY":177,"OP_NOP3":178,"OP_CHECKSEQUENCEVERIFY":178,"OP_NOP4":179,"OP_NOP5":180,"OP_NOP6":181,"OP_NOP7":182,"OP_NOP8":183,"OP_NOP9":184,"OP_NOP10":185,"OP_PUBKEYHASH":253,"OP_PUBKEY":254,"OP_INVALIDOPCODE":255}')},function(e,t,r){"use strict";for(var n="qpzry9x8gf2tvdw0s3jn54khce6mua7l",i={},o=0;o<n.length;o++){var a=n.charAt(o);if(void 0!==i[a])throw new TypeError(a+" is ambiguous");i[a]=o}function s(e){var t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function u(e){for(var t=1,r=0;r<e.length;++r){var n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=s(t)^n>>5}for(t=s(t),r=0;r<e.length;++r){var i=e.charCodeAt(r);t=s(t)^31&i}return t}function c(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)return"Exceeds length limit";var r=e.toLowerCase(),n=e.toUpperCase();if(e!==r&&e!==n)return"Mixed-case string "+e;var o=(e=r).lastIndexOf("1");if(-1===o)return"No separator character for "+e;if(0===o)return"Missing prefix for "+e;var a=e.slice(0,o),c=e.slice(o+1);if(c.length<6)return"Data too short";var f=u(a);if("string"==typeof f)return f;for(var l=[],d=0;d<c.length;++d){var h=c.charAt(d),p=i[h];if(void 0===p)return"Unknown character "+h;f=s(f)^p,d+6>=c.length||l.push(p)}return 1!==f?"Invalid checksum for "+e:{prefix:a,words:l}}function f(e,t,r,n){for(var i=0,o=0,a=(1<<r)-1,s=[],u=0;u<e.length;++u)for(i=i<<t|e[u],o+=t;o>=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<<r-o&a);else{if(o>=t)return"Excess padding";if(i<<r-o&a)return"Non-zero padding"}return s}e.exports={decodeUnsafe:function(){var e=c.apply(null,arguments);if("object"==typeof e)return e},decode:function(e){var t=c.apply(null,arguments);if("object"==typeof t)return t;throw new Error(t)},encode:function(e,t,r){if(r=r||90,e.length+7+t.length>r)throw new TypeError("Exceeds length limit");var i=u(e=e.toLowerCase());if("string"==typeof i)throw new Error(i);for(var o=e+"1",a=0;a<t.length;++a){var c=t[a];if(c>>5!=0)throw new Error("Non 5-bit word");i=s(i)^c,o+=n.charAt(c)}for(a=0;a<6;++a)i=s(i);for(i^=1,a=0;a<6;++a){o+=n.charAt(i>>5*(5-a)&31)}return o},toWordsUnsafe:function(e){var t=f(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=f(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=f(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=f(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(12),i=r(16),o=r(25),a=r(283),s=r(3),u=r(69),c=s.maybe(s.compile({compressed:i.maybe(i.Boolean),network:i.maybe(i.Network)}));class f{constructor(e,t,r){this.__D=e,this.__Q=t,this.lowR=!1,void 0===r&&(r={}),this.compressed=void 0===r.compressed||r.compressed,this.network=r.network||n.bitcoin,void 0!==t&&(this.__Q=o.pointCompress(t,this.compressed))}get privateKey(){return this.__D}get publicKey(){return this.__Q||(this.__Q=o.pointFromScalar(this.__D,this.compressed)),this.__Q}toWIF(){if(!this.__D)throw new Error("Missing private key");return u.encode(this.network.wif,this.__D,this.compressed)}sign(t,r){if(!this.__D)throw new Error("Missing private key");if(void 0===r&&(r=this.lowR),!1===r)return o.sign(t,this.__D);{let r=o.sign(t,this.__D);const n=e.alloc(32,0);let i=0;for(;r[0]>127;)i++,n.writeUIntLE(i,0,6),r=o.signWithEntropy(t,this.__D,n);return r}}verify(e,t){return o.verify(e,this.publicKey,t)}}function l(e,t){if(s(i.Buffer256bit,e),!o.isPrivate(e))throw new TypeError("Private key not in range [1, n)");return s(c,t),new f(e,void 0,t)}t.fromPrivateKey=l,t.fromPublicKey=function(e,t){return s(o.isPoint,e),s(c,t),new f(void 0,e,t)},t.fromWIF=function(e,t){const r=u.decode(e),o=r.version;if(i.Array(t)){if(!(t=t.filter(e=>o===e.wif).pop()))throw new Error("Unknown network version")}else if(t=t||n.bitcoin,o!==t.wif)throw new Error("Invalid network version");return l(r.privateKey,{compressed:r.compressed,network:t})},t.makeRandom=function(e){s(c,e),void 0===e&&(e={});const t=e.rng||a;let r;do{r=t(32),s(i.Buffer256bit,r)}while(!o.isPrivate(r));return l(r,e)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(288);t.input=n;const i=r(289);t.output=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(291);t.input=n;const i=r(292);t.output=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(293);t.input=n;const i=r(294);t.output=i},function(e,t,r){"use strict";(function(t){var n=r(6),i=r(321),o=r(32),a=r(134),s=r(135),u={"Content-Type":"application/x-www-form-urlencoded"};function c(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var f,l={transitional:a,adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(f=r(136)),f),transformRequest:[function(e,t){if(i(t,"Accept"),i(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e))return e;if(n.isArrayBufferView(e))return e.buffer;if(n.isURLSearchParams(e))return c(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var r,o=n.isObject(e),a=t&&t["Content-Type"];if((r=n.isFileList(e))||o&&"multipart/form-data"===a){var u=this.env&&this.env.FormData;return s(r?{"files[]":e}:e,u&&new u)}return o||"application/json"===a?(c(t,"application/json"),function(e,t,r){if(n.isString(e))try{return(t||JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||l.transitional,r=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,a=!r&&"json"===this.responseType;if(a||i&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw o.from(e,o.ERR_BAD_RESPONSE,this,null,this.response);throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:r(329)},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){l.headers[e]=n.merge(u)})),e.exports=l}).call(this,r(10))},function(e,t,r){"use strict";(function(t){var n=r(7),i=r(346),o=r(33),a=r(144),s=r(145),u={"Content-Type":"application/x-www-form-urlencoded"};function c(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var f,l={transitional:a,adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(f=r(146)),f),transformRequest:[function(e,t){if(i(t,"Accept"),i(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e))return e;if(n.isArrayBufferView(e))return e.buffer;if(n.isURLSearchParams(e))return c(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var r,o=n.isObject(e),a=t&&t["Content-Type"];if((r=n.isFileList(e))||o&&"multipart/form-data"===a){var u=this.env&&this.env.FormData;return s(r?{"files[]":e}:e,u&&new u)}return o||"application/json"===a?(c(t,"application/json"),function(e,t,r){if(n.isString(e))try{return(t||JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||l.transitional,r=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,a=!r&&"json"===this.responseType;if(a||i&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw o.from(e,o.ERR_BAD_RESPONSE,this,null,this.response);throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:r(354)},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){l.headers[e]=n.merge(u)})),e.exports=l}).call(this,r(10))},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.toOutputScript=t.fromOutputScript=t.toBech32=t.toBase58Check=t.fromBech32=t.fromBase58Check=void 0;const n=r(13),i=r(36),o=r(9),a=r(8),s=r(45),u=r(61),c="WARNING: Sending to a future segwit version address can lead to loss of funds. End users MUST be warned carefully in the GUI and asked if they wish to proceed with caution. Wallets should verify the segwit version from the output of fromBech32, then decide when it is safe to use which version of segwit.";function f(t){const r=e.from(u.decode(t));if(r.length<21)throw new TypeError(t+" is too short");if(r.length>21)throw new TypeError(t+" is too long");return{version:r.readUInt8(0),hash:r.slice(1)}}function l(t){let r,n;try{r=s.bech32.decode(t)}catch(e){}if(r){if(n=r.words[0],0!==n)throw new TypeError(t+" uses wrong encoding")}else if(r=s.bech32m.decode(t),n=r.words[0],0===n)throw new TypeError(t+" uses wrong encoding");const i=s.bech32.fromWords(r.words.slice(1));return{version:n,prefix:r.prefix,data:e.from(i)}}function d(e,t,r){const n=s.bech32.toWords(e);return n.unshift(t),0===t?s.bech32.encode(r,n):s.bech32m.encode(r,n)}t.fromBase58Check=f,t.fromBech32=l,t.toBase58Check=function(t,r){(0,a.typeforce)((0,a.tuple)(a.Hash160bit,a.UInt8),arguments);const n=e.allocUnsafe(21);return n.writeUInt8(r,0),t.copy(n,1),u.encode(n)},t.toBech32=d,t.fromOutputScript=function(e,t){t=t||n.bitcoin;try{return i.p2pkh({output:e,network:t}).address}catch(e){}try{return i.p2sh({output:e,network:t}).address}catch(e){}try{return i.p2wpkh({output:e,network:t}).address}catch(e){}try{return i.p2wsh({output:e,network:t}).address}catch(e){}try{return i.p2tr({output:e,network:t}).address}catch(e){}try{return function(e,t){const r=e.slice(2);if(r.length<2||r.length>40)throw new TypeError("Invalid program length for segwit address");const n=e[0]-80;if(n<2||n>16)throw new TypeError("Invalid version for segwit address");if(e[1]!==r.length)throw new TypeError("Invalid script for segwit address");return console.warn(c),d(r,n,t.bech32)}(e,t)}catch(e){}throw new Error(o.toASM(e)+" has no matching Address")},t.toOutputScript=function(e,t){let r,a;t=t||n.bitcoin;try{r=f(e)}catch(e){}if(r){if(r.version===t.pubKeyHash)return i.p2pkh({hash:r.hash}).output;if(r.version===t.scriptHash)return i.p2sh({hash:r.hash}).output}else{try{a=l(e)}catch(e){}if(a){if(a.prefix!==t.bech32)throw new Error(e+" has an invalid prefix");if(0===a.version){if(20===a.data.length)return i.p2wpkh({hash:a.data}).output;if(32===a.data.length)return i.p2wsh({hash:a.data}).output}else if(1===a.version){if(32===a.data.length)return i.p2tr({pubkey:a.data}).output}else if(a.version>=2&&a.version<=16&&a.data.length>=2&&a.data.length<=40)return console.warn(c),o.compile([a.version+80,a.data])}}throw new Error(e+" has no matching Script")}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.encode=t.decode=t.check=void 0,t.check=function(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;const t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;const r=e[5+t];return 0!==r&&(6+t+r===e.length&&(!(128&e[4])&&(!(t>1&&0===e[4]&&!(128&e[5]))&&(!(128&e[t+6])&&!(r>1&&0===e[t+6]&&!(128&e[t+7]))))))},t.decode=function(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");const t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");const r=e[5+t];if(0===r)throw new Error("S length is zero");if(6+t+r!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(r>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}},t.encode=function(t,r){const n=t.length,i=r.length;if(0===n)throw new Error("R length is zero");if(0===i)throw new Error("S length is zero");if(n>33)throw new Error("R length is too long");if(i>33)throw new Error("S length is too long");if(128&t[0])throw new Error("R value is negative");if(128&r[0])throw new Error("S value is negative");if(n>1&&0===t[0]&&!(128&t[1]))throw new Error("R value excessively padded");if(i>1&&0===r[0]&&!(128&r[1]))throw new Error("S value excessively padded");const o=e.allocUnsafe(6+n+i);return o[0]=48,o[1]=o.length-2,o[2]=2,o[3]=t.length,t.copy(o,4),o[4+n]=2,o[5+n]=r.length,r.copy(o,6+n),o}}).call(this,r(0).Buffer)},function(e,t,r){var n=r(59);function i(e){return e.name||e.toString().match(/function (.*?)\s*\(/)[1]}function o(e){return n.Nil(e)?"":i(e.constructor)}function a(e,t){Error.captureStackTrace&&Error.captureStackTrace(e,t)}function s(e){return n.Function(e)?e.toJSON?e.toJSON():i(e):n.Array(e)?"Array":e&&n.Object(e)?"Object":void 0!==e?e:""}function u(e,t,r){var i=function(e){return n.Function(e)?"":n.String(e)?JSON.stringify(e):e&&n.Object(e)?"":e}(t);return"Expected "+s(e)+", got"+(""!==r?" "+r:"")+(""!==i?" "+i:"")}function c(e,t,r){r=r||o(t),this.message=u(e,t,r),a(this,c),this.__type=e,this.__value=t,this.__valueTypeName=r}function f(e,t,r,n,i){e?(i=i||o(n),this.message=function(e,t,r,n,i){var o='" of type ';return"key"===t&&(o='" with key type '),u('property "'+s(r)+o+s(e),n,i)}(e,r,t,n,i)):this.message='Unexpected property "'+t+'"',a(this,c),this.__label=r,this.__property=t,this.__type=e,this.__value=n,this.__valueTypeName=i}c.prototype=Object.create(Error.prototype),c.prototype.constructor=c,f.prototype=Object.create(Error.prototype),f.prototype.constructor=c,e.exports={TfTypeError:c,TfPropertyTypeError:f,tfCustomError:function(e,t){return new c(e,{},t)},tfSubError:function(e,t,r){return e instanceof f?(t=t+"."+e.__property,e=new f(e.__type,t,e.__label,e.__value,e.__valueTypeName)):e instanceof c&&(e=new f(e.__type,t,r,e.__value,e.__valueTypeName)),a(e),e},tfJSON:s,getValueTypeName:o}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=t.RIPEMD160=void 0;const n=r(44),i=r(21),o=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),a=Uint8Array.from({length:16},(e,t)=>t),s=a.map(e=>(9*e+5)%16);let u=[a],c=[s];for(let e=0;e<4;e++)for(let t of[u,c])t.push(t[e].map(e=>o[e]));const f=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>new Uint8Array(e)),l=u.map((e,t)=>e.map(e=>f[t][e])),d=c.map((e,t)=>e.map(e=>f[t][e])),h=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),p=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),b=(e,t)=>e<<t|e>>>32-t;function m(e,t,r,n){return 0===e?t^r^n:1===e?t&r|~t&n:2===e?(t|~r)^n:3===e?t&n|r&~n:t^(r|~n)}const g=new Uint32Array(16);class y extends n.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:r,h3:n,h4:i}=this;return[e,t,r,n,i]}set(e,t,r,n,i){this.h0=0|e,this.h1=0|t,this.h2=0|r,this.h3=0|n,this.h4=0|i}process(e,t){for(let r=0;r<16;r++,t+=4)g[r]=e.getUint32(t,!0);let r=0|this.h0,n=r,i=0|this.h1,o=i,a=0|this.h2,s=a,f=0|this.h3,y=f,v=0|this.h4,w=v;for(let e=0;e<5;e++){const t=4-e,_=h[e],E=p[e],k=u[e],S=c[e],x=l[e],T=d[e];for(let t=0;t<16;t++){const n=b(r+m(e,i,a,f)+g[k[t]]+_,x[t])+v|0;r=v,v=f,f=0|b(a,10),a=i,i=n}for(let e=0;e<16;e++){const r=b(n+m(t,o,s,y)+g[S[e]]+E,T[e])+w|0;n=w,w=y,y=0|b(s,10),s=o,o=r}}this.set(this.h1+a+y|0,this.h2+f+w|0,this.h3+v+n|0,this.h4+r+o|0,this.h0+i+s|0)}roundClean(){g.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}t.RIPEMD160=y,t.ripemd160=(0,i.wrapConstructor)(()=>new y)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(177),i=r(94),o=r(5),a=r(66);t.Psbt=class{constructor(e){this.inputs=[],this.outputs=[],this.globalMap={unsignedTx:e}}static fromBase64(t,r){const n=e.from(t,"base64");return this.fromBuffer(n,r)}static fromHex(t,r){const n=e.from(t,"hex");return this.fromBuffer(n,r)}static fromBuffer(e,t){const r=i.psbtFromBuffer(e,t),n=new this(r.globalMap.unsignedTx);return Object.assign(n,r),n}toBase64(){return this.toBuffer().toString("base64")}toHex(){return this.toBuffer().toString("hex")}toBuffer(){return i.psbtToBuffer(this)}updateGlobal(e){return a.updateGlobal(e,this.globalMap),this}updateInput(e,t){const r=a.checkForInput(this.inputs,e);return a.updateInput(t,r),this}updateOutput(e,t){const r=a.checkForOutput(this.outputs,e);return a.updateOutput(t,r),this}addUnknownKeyValToGlobal(e){return a.checkHasKey(e,this.globalMap.unknownKeyVals,a.getEnumLength(o.GlobalTypes)),this.globalMap.unknownKeyVals||(this.globalMap.unknownKeyVals=[]),this.globalMap.unknownKeyVals.push(e),this}addUnknownKeyValToInput(e,t){const r=a.checkForInput(this.inputs,e);return a.checkHasKey(t,r.unknownKeyVals,a.getEnumLength(o.InputTypes)),r.unknownKeyVals||(r.unknownKeyVals=[]),r.unknownKeyVals.push(t),this}addUnknownKeyValToOutput(e,t){const r=a.checkForOutput(this.outputs,e);return a.checkHasKey(t,r.unknownKeyVals,a.getEnumLength(o.OutputTypes)),r.unknownKeyVals||(r.unknownKeyVals=[]),r.unknownKeyVals.push(t),this}addInput(e){this.globalMap.unsignedTx.addInput(e),this.inputs.push({unknownKeyVals:[]});const t=e.unknownKeyVals||[],r=this.inputs.length-1;if(!Array.isArray(t))throw new Error("unknownKeyVals must be an Array");return t.forEach(e=>this.addUnknownKeyValToInput(r,e)),a.addInputAttributes(this.inputs,e),this}addOutput(e){this.globalMap.unsignedTx.addOutput(e),this.outputs.push({unknownKeyVals:[]});const t=e.unknownKeyVals||[],r=this.outputs.length-1;if(!Array.isArray(t))throw new Error("unknownKeyVals must be an Array");return t.forEach(e=>this.addUnknownKeyValToOutput(r,e)),a.addOutputAttributes(this.outputs,e),this}clearFinalizedInput(e){const t=a.checkForInput(this.inputs,e);a.inputCheckUncleanFinalized(e,t);for(const e of Object.keys(t))["witnessUtxo","nonWitnessUtxo","finalScriptSig","finalScriptWitness","unknownKeyVals"].includes(e)||delete t[e];return this}combine(...e){const t=n.combine([this].concat(e));return Object.assign(this,t),this}getTransaction(){return this.globalMap.unsignedTx.toBuffer()}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),n(r(178)),n(r(198))},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const r=e=>33===e.length&&[2,3].includes(e[0])||65===e.length&&4===e[0];t.makeConverter=function(t,n=r){return{decode:function(e){if(e.key[0]!==t)throw new Error("Decode Error: could not decode bip32Derivation with key 0x"+e.key.toString("hex"));const r=e.key.slice(1);if(!n(r))throw new Error("Decode Error: bip32Derivation has invalid pubkey in key 0x"+e.key.toString("hex"));if(e.value.length/4%1!=0)throw new Error("Decode Error: Input BIP32_DERIVATION value length should be multiple of 4");const i={masterFingerprint:e.value.slice(0,4),pubkey:r,path:"m"};for(const t of(o=e.value.length/4-1,[...Array(o).keys()])){const r=e.value.readUInt32LE(4*t+4),n=!!(2147483648&r),o=2147483647&r;i.path+="/"+o.toString(10)+(n?"'":"")}var o;return i},encode:function(r){const n=e.from([t]),i=e.concat([n,r.pubkey]),o=r.path.split("/"),a=e.allocUnsafe(4*o.length);r.masterFingerprint.copy(a,0);let s=4;return o.slice(1).forEach(e=>{const t="'"===e.slice(-1);let r=2147483647&parseInt(t?e.slice(0,-1):e,10);t&&(r+=2147483648),a.writeUInt32LE(r,s),s+=4}),{key:i,value:a}},check:function(t){return e.isBuffer(t.pubkey)&&e.isBuffer(t.masterFingerprint)&&"string"==typeof t.path&&n(t.pubkey)&&4===t.masterFingerprint.length},expected:"{ masterFingerprint: Buffer; pubkey: Buffer; path: string; }",canAddToArray:function(e,t,r){const n=t.pubkey.toString("hex");return!r.has(n)&&(r.add(n),0===e.filter(e=>e.pubkey.equals(t.pubkey)).length)}}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(27),i=r(97),o=r(201),a=r(21),s=r(98);let u=s._default;const c="A wordlist is required but a default could not be found.\nPlease pass a 2048 word array explicitly.";function f(e){return(e||"").normalize("NFKD")}function l(e,t,r){for(;e.length<r;)e=t+e;return e}function d(e){return parseInt(e,2)}function h(e){return e.map(e=>l(e.toString(2),"0",8)).join("")}function p(e){const t=8*e.length/32,r=n.sha256(Uint8Array.from(e));return h(Array.from(r)).slice(0,t)}function b(e){return"mnemonic"+(e||"")}function m(t,r){if(!(r=r||u))throw new Error(c);const n=f(t).split(" ");if(n.length%3!=0)throw new Error("Invalid mnemonic");const i=n.map(e=>{const t=r.indexOf(e);if(-1===t)throw new Error("Invalid mnemonic");return l(t.toString(2),"0",11)}).join(""),o=32*Math.floor(i.length/33),a=i.slice(0,o),s=i.slice(o),h=a.match(/(.{1,8})/g).map(d);if(h.length<16)throw new Error("Invalid entropy");if(h.length>32)throw new Error("Invalid entropy");if(h.length%4!=0)throw new Error("Invalid entropy");const b=e.from(h);if(p(b)!==s)throw new Error("Invalid mnemonic checksum");return b.toString("hex")}function g(t,r){if(e.isBuffer(t)||(t=e.from(t,"hex")),!(r=r||u))throw new Error(c);if(t.length<16)throw new TypeError("Invalid entropy");if(t.length>32)throw new TypeError("Invalid entropy");if(t.length%4!=0)throw new TypeError("Invalid entropy");const n=(h(Array.from(t))+p(t)).match(/(.{1,11})/g).map(e=>{const t=d(e);return r[t]});return"あいこくしん"===r[0]?n.join(" "):n.join(" ")}t.mnemonicToSeedSync=function(t,r){const n=Uint8Array.from(e.from(f(t),"utf8")),a=Uint8Array.from(e.from(b(f(r)),"utf8")),s=o.pbkdf2(i.sha512,n,a,{c:2048,dkLen:64});return e.from(s)},t.mnemonicToSeed=function(t,r){const n=Uint8Array.from(e.from(f(t),"utf8")),a=Uint8Array.from(e.from(b(f(r)),"utf8"));return o.pbkdf2Async(i.sha512,n,a,{c:2048,dkLen:64}).then(t=>e.from(t))},t.mnemonicToEntropy=m,t.entropyToMnemonic=g,t.generateMnemonic=function(t,r,n){if((t=t||128)%32!=0)throw new TypeError("Invalid entropy");return g((r=r||(t=>e.from(a.randomBytes(t))))(t/8),n)},t.validateMnemonic=function(e,t){try{m(e,t)}catch(e){return!1}return!0},t.setDefaultWordlist=function(e){const t=s.wordlists[e];if(!t)throw new Error('Could not find wordlist for language "'+e+'"');u=t},t.getDefaultWordlist=function(){if(!u)throw new Error("No Default Wordlist set");return Object.keys(s.wordlists).filter(e=>"JA"!==e&&"EN"!==e&&s.wordlists[e].every((e,t)=>e===u[t]))[0]};var y=r(98);t.wordlists=y.wordlists}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha384=t.sha512_256=t.sha512_224=t.sha512=t.SHA512=void 0;const n=r(44),i=r(200),o=r(21),[a,s]=i.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),u=new Uint32Array(80),c=new Uint32Array(80);class f extends n.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:a,Dl:s,Eh:u,El:c,Fh:f,Fl:l,Gh:d,Gl:h,Hh:p,Hl:b}=this;return[e,t,r,n,i,o,a,s,u,c,f,l,d,h,p,b]}set(e,t,r,n,i,o,a,s,u,c,f,l,d,h,p,b){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|a,this.Dl=0|s,this.Eh=0|u,this.El=0|c,this.Fh=0|f,this.Fl=0|l,this.Gh=0|d,this.Gl=0|h,this.Hh=0|p,this.Hl=0|b}process(e,t){for(let r=0;r<16;r++,t+=4)u[r]=e.getUint32(t),c[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|u[e-15],r=0|c[e-15],n=i.default.rotrSH(t,r,1)^i.default.rotrSH(t,r,8)^i.default.shrSH(t,r,7),o=i.default.rotrSL(t,r,1)^i.default.rotrSL(t,r,8)^i.default.shrSL(t,r,7),a=0|u[e-2],s=0|c[e-2],f=i.default.rotrSH(a,s,19)^i.default.rotrBH(a,s,61)^i.default.shrSH(a,s,6),l=i.default.rotrSL(a,s,19)^i.default.rotrBL(a,s,61)^i.default.shrSL(a,s,6),d=i.default.add4L(o,l,c[e-7],c[e-16]),h=i.default.add4H(d,n,f,u[e-7],u[e-16]);u[e]=0|h,c[e]=0|d}let{Ah:r,Al:n,Bh:o,Bl:f,Ch:l,Cl:d,Dh:h,Dl:p,Eh:b,El:m,Fh:g,Fl:y,Gh:v,Gl:w,Hh:_,Hl:E}=this;for(let e=0;e<80;e++){const t=i.default.rotrSH(b,m,14)^i.default.rotrSH(b,m,18)^i.default.rotrBH(b,m,41),k=i.default.rotrSL(b,m,14)^i.default.rotrSL(b,m,18)^i.default.rotrBL(b,m,41),S=b&g^~b&v,x=m&y^~m&w,T=i.default.add5L(E,k,x,s[e],c[e]),A=i.default.add5H(T,_,t,S,a[e],u[e]),P=0|T,O=i.default.rotrSH(r,n,28)^i.default.rotrBH(r,n,34)^i.default.rotrBH(r,n,39),I=i.default.rotrSL(r,n,28)^i.default.rotrBL(r,n,34)^i.default.rotrBL(r,n,39),B=r&o^r&l^o&l,M=n&f^n&d^f&d;_=0|v,E=0|w,v=0|g,w=0|y,g=0|b,y=0|m,({h:b,l:m}=i.default.add(0|h,0|p,0|A,0|P)),h=0|l,p=0|d,l=0|o,d=0|f,o=0|r,f=0|n;const R=i.default.add3L(P,I,M);r=i.default.add3H(R,A,O,B),n=0|R}({h:r,l:n}=i.default.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:o,l:f}=i.default.add(0|this.Bh,0|this.Bl,0|o,0|f)),({h:l,l:d}=i.default.add(0|this.Ch,0|this.Cl,0|l,0|d)),({h:h,l:p}=i.default.add(0|this.Dh,0|this.Dl,0|h,0|p)),({h:b,l:m}=i.default.add(0|this.Eh,0|this.El,0|b,0|m)),({h:g,l:y}=i.default.add(0|this.Fh,0|this.Fl,0|g,0|y)),({h:v,l:w}=i.default.add(0|this.Gh,0|this.Gl,0|v,0|w)),({h:_,l:E}=i.default.add(0|this.Hh,0|this.Hl,0|_,0|E)),this.set(r,n,o,f,l,d,h,p,b,m,g,y,v,w,_,E)}roundClean(){u.fill(0),c.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}t.SHA512=f;class l extends f{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class d extends f{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class h extends f{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}t.sha512=(0,o.wrapConstructor)(()=>new f),t.sha512_224=(0,o.wrapConstructor)(()=>new l),t.sha512_256=(0,o.wrapConstructor)(()=>new d),t.sha384=(0,o.wrapConstructor)(()=>new h)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={};let i;t.wordlists=n,t._default=i;try{t._default=i=r(202),n.czech=i}catch(e){}try{t._default=i=r(203),n.chinese_simplified=i}catch(e){}try{t._default=i=r(204),n.chinese_traditional=i}catch(e){}try{t._default=i=r(205),n.korean=i}catch(e){}try{t._default=i=r(206),n.french=i}catch(e){}try{t._default=i=r(207),n.italian=i}catch(e){}try{t._default=i=r(208),n.spanish=i}catch(e){}try{t._default=i=r(209),n.japanese=i,n.JA=i}catch(e){}try{t._default=i=r(210),n.portuguese=i}catch(e){}try{t._default=i=r(211),n.english=i,n.EN=i}catch(e){}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BIP32Factory=t.default=void 0;var n=r(212);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n.BIP32Factory}}),Object.defineProperty(t,"BIP32Factory",{enumerable:!0,get:function(){return n.BIP32Factory}})},function(e,t,r){"use strict";var n=r(2),i=r(101),o=r(4).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(e,t){return e<<t|e>>>32-t}function c(e,t,r,n,i,o,a){return u(e+(t&r|~t&n)+i+o|0,a)+t|0}function f(e,t,r,n,i,o,a){return u(e+(t&n|r&~n)+i+o|0,a)+t|0}function l(e,t,r,n,i,o,a){return u(e+(t^r^n)+i+o|0,a)+t|0}function d(e,t,r,n,i,o,a){return u(e+(r^(t|~n))+i+o|0,a)+t|0}n(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=c(r,n,i,o,e[0],3614090360,7),o=c(o,r,n,i,e[1],3905402710,12),i=c(i,o,r,n,e[2],606105819,17),n=c(n,i,o,r,e[3],3250441966,22),r=c(r,n,i,o,e[4],4118548399,7),o=c(o,r,n,i,e[5],1200080426,12),i=c(i,o,r,n,e[6],2821735955,17),n=c(n,i,o,r,e[7],4249261313,22),r=c(r,n,i,o,e[8],1770035416,7),o=c(o,r,n,i,e[9],2336552879,12),i=c(i,o,r,n,e[10],4294925233,17),n=c(n,i,o,r,e[11],2304563134,22),r=c(r,n,i,o,e[12],1804603682,7),o=c(o,r,n,i,e[13],4254626195,12),i=c(i,o,r,n,e[14],2792965006,17),r=f(r,n=c(n,i,o,r,e[15],1236535329,22),i,o,e[1],4129170786,5),o=f(o,r,n,i,e[6],3225465664,9),i=f(i,o,r,n,e[11],643717713,14),n=f(n,i,o,r,e[0],3921069994,20),r=f(r,n,i,o,e[5],3593408605,5),o=f(o,r,n,i,e[10],38016083,9),i=f(i,o,r,n,e[15],3634488961,14),n=f(n,i,o,r,e[4],3889429448,20),r=f(r,n,i,o,e[9],568446438,5),o=f(o,r,n,i,e[14],3275163606,9),i=f(i,o,r,n,e[3],4107603335,14),n=f(n,i,o,r,e[8],1163531501,20),r=f(r,n,i,o,e[13],2850285829,5),o=f(o,r,n,i,e[2],4243563512,9),i=f(i,o,r,n,e[7],1735328473,14),r=l(r,n=f(n,i,o,r,e[12],2368359562,20),i,o,e[5],4294588738,4),o=l(o,r,n,i,e[8],2272392833,11),i=l(i,o,r,n,e[11],1839030562,16),n=l(n,i,o,r,e[14],4259657740,23),r=l(r,n,i,o,e[1],2763975236,4),o=l(o,r,n,i,e[4],1272893353,11),i=l(i,o,r,n,e[7],4139469664,16),n=l(n,i,o,r,e[10],3200236656,23),r=l(r,n,i,o,e[13],681279174,4),o=l(o,r,n,i,e[0],3936430074,11),i=l(i,o,r,n,e[3],3572445317,16),n=l(n,i,o,r,e[6],76029189,23),r=l(r,n,i,o,e[9],3654602809,4),o=l(o,r,n,i,e[12],3873151461,11),i=l(i,o,r,n,e[15],530742520,16),r=d(r,n=l(n,i,o,r,e[2],3299628645,23),i,o,e[0],4096336452,6),o=d(o,r,n,i,e[7],1126891415,10),i=d(i,o,r,n,e[14],2878612391,15),n=d(n,i,o,r,e[5],4237533241,21),r=d(r,n,i,o,e[12],1700485571,6),o=d(o,r,n,i,e[3],2399980690,10),i=d(i,o,r,n,e[10],4293915773,15),n=d(n,i,o,r,e[1],2240044497,21),r=d(r,n,i,o,e[8],1873313359,6),o=d(o,r,n,i,e[15],4264355552,10),i=d(i,o,r,n,e[6],2734768916,15),n=d(n,i,o,r,e[13],1309151649,21),r=d(r,n,i,o,e[4],4149444226,6),o=d(o,r,n,i,e[11],3174756917,10),i=d(i,o,r,n,e[2],718787259,15),n=d(n,i,o,r,e[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 e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},function(e,t,r){"use strict";var n=r(4).Buffer,i=r(216).Transform;function o(e){i.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(2)(o,i),o.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},o.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},o.prototype.update=function(e,t){if(function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)r[o++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)r[this._blockOffset++]=e[i++];for(var a=0,s=8*e.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(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},function(e,t,r){"use strict";(function(t,n){var i;e.exports=x,x.ReadableState=S;r(40).EventEmitter;var o=function(e,t){return e.listeners(t).length},a=r(103),s=r(0).Buffer,u=(void 0!==t?t:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var c,f=r(217);c=f&&f.debuglog?f.debuglog("stream"):function(){};var l,d,h,p=r(218),b=r(104),m=r(105).getHighWaterMark,g=r(28).codes,y=g.ERR_INVALID_ARG_TYPE,v=g.ERR_STREAM_PUSH_AFTER_EOF,w=g.ERR_METHOD_NOT_IMPLEMENTED,_=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(2)(x,a);var E=b.errorOrDestroy,k=["error","close","destroy","pause","resume"];function S(e,t,n){i=i||r(29),e=e||{},"boolean"!=typeof n&&(n=t instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=m(this,e,"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!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=r(41).StringDecoder),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function x(e){if(i=i||r(29),!(this instanceof x))return new x(e);var t=this instanceof i;this._readableState=new S(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function T(e,t,r,n,i){c("readableAddChunk",t);var o,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(c("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,I(e)))}(e,a);else if(i||(o=function(e,t){var r;n=t,s.isBuffer(n)||n instanceof u||"string"==typeof t||void 0===t||e.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(a,t)),o)E(e,o);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),n)a.endEmitted?E(e,new _):A(e,a,t,!0);else if(a.ended)E(e,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?A(e,a,t,!1):B(e,a)):A(e,a,t,!1)}else n||(a.reading=!1,B(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function A(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&O(e)),B(e,t)}Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),x.prototype.destroy=b.destroy,x.prototype._undestroy=b.undestroy,x.prototype._destroy=function(e,t){t(e)},x.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=s.from(e,t),t=""),r=!0),T(this,e,t,!1,r)},x.prototype.unshift=function(e){return T(this,e,null,!0,!1)},x.prototype.isPaused=function(){return!1===this._readableState.flowing},x.prototype.setEncoding=function(e){l||(l=r(41).StringDecoder);var t=new l(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};function P(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(I,e))}function I(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,U(e)}function B(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(M,e,t))}function M(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(c("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function R(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function N(e){c("readable nexttick read 0"),e.read(0)}function j(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),U(e),t.flowing&&!t.reading&&e.read(0)}function U(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function C(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function H(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(z,t,e))}function z(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function L(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}x.prototype.read=function(e){c("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?H(this):O(this),null;if(0===(e=P(e,t))&&t.ended)return 0===t.length&&H(this),null;var n,i=t.needReadable;return c("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&c("length less than watermark",i=!0),t.ended||t.reading?c("reading or ended",i=!1):i&&(c("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=P(r,t))),null===(n=e>0?C(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&H(this)),null!==n&&this.emit("data",n),n},x.prototype._read=function(e){E(this,new w("_read()"))},x.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,t);var a=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?u:m;function s(t,n){c("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,c("cleanup"),e.removeListener("close",p),e.removeListener("finish",b),e.removeListener("drain",f),e.removeListener("error",h),e.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",m),r.removeListener("data",d),l=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function u(){c("onend"),e.end()}i.endEmitted?n.nextTick(a):r.once("end",a),e.on("unpipe",s);var f=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,U(e))}}(r);e.on("drain",f);var l=!1;function d(t){c("ondata");var n=e.write(t);c("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==L(i.pipes,e))&&!l&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function h(t){c("onerror",t),m(),e.removeListener("error",h),0===o(e,"error")&&E(e,t)}function p(){e.removeListener("finish",b),m()}function b(){c("onfinish"),e.removeListener("close",p),m()}function m(){c("unpipe"),r.unpipe(e)}return r.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",p),e.once("finish",b),e.emit("pipe",r),i.flowing||(c("pipe resume"),r.resume()),e},x.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=L(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},x.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?O(this):i.reading||n.nextTick(N,this))),r},x.prototype.addListener=x.prototype.on,x.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(R,this),r},x.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(R,this),t},x.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(j,e,t))}(this,e)),e.paused=!1,this},x.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},x.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<k.length;o++)e.on(k[o],this.emit.bind(this,k[o]));return this._read=function(t){c("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(x.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=r(220)),d(this)}),Object.defineProperty(x.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(x.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(x.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),x._fromList=C,Object.defineProperty(x.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(x.from=function(e,t){return void 0===h&&(h=r(221)),h(x,e,t)})}).call(this,r(17),r(10))},function(e,t,r){e.exports=r(40).EventEmitter},function(e,t,r){"use strict";(function(t){function r(e,t){i(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,o){var a=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(o?o(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(i,this,e)):t.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!o&&e?a._writableState?a._writableState.errorEmitted?t.nextTick(n,a):(a._writableState.errorEmitted=!0,t.nextTick(r,a,e)):t.nextTick(r,a,e):o?(t.nextTick(n,a),o(e)):t.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(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this,r(10))},function(e,t,r){"use strict";var n=r(28).codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,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 e.objectMode?16:16384}}},function(e,t,r){"use strict";(function(t,n){function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var o;e.exports=x,x.WritableState=S;var a={deprecate:r(107)},s=r(103),u=r(0).Buffer,c=(void 0!==t?t:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var f,l=r(104),d=r(105).getHighWaterMark,h=r(28).codes,p=h.ERR_INVALID_ARG_TYPE,b=h.ERR_METHOD_NOT_IMPLEMENTED,m=h.ERR_MULTIPLE_CALLBACK,g=h.ERR_STREAM_CANNOT_PIPE,y=h.ERR_STREAM_DESTROYED,v=h.ERR_STREAM_NULL_VALUES,w=h.ERR_STREAM_WRITE_AFTER_END,_=h.ERR_UNKNOWN_ENCODING,E=l.errorOrDestroy;function k(){}function S(e,t,a){o=o||r(29),e=e||{},"boolean"!=typeof a&&(a=t instanceof o),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,i=r.sync,o=r.writecb;if("function"!=typeof o)throw new m;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,i,o){--t.pendingcb,r?(n.nextTick(o,i),n.nextTick(B,e,t),e._writableState.errorEmitted=!0,E(e,i)):(o(i),e._writableState.errorEmitted=!0,E(e,i),B(e,t))}(e,r,i,t,o);else{var a=O(r)||e.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||P(e,r),i?n.nextTick(A,e,r,a,o):A(e,r,a,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function x(e){var t=this instanceof(o=o||r(29));if(!t&&!f.call(x,this))return new x(e);this._writableState=new S(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),s.call(this)}function T(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function A(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),B(e,t)}function P(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,o=new Array(n),a=t.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,T(e,t,!0,t.length,o,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(T(e,t,!1,t.objectMode?1:c.length,c,f,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function O(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function I(e,t){e._final((function(r){t.pendingcb--,r&&E(e,r),t.prefinished=!0,e.emit("prefinish"),B(e,t)}))}function B(e,t){var r=O(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,n.nextTick(I,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return r}r(2)(x,s),S.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(S.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(x,Symbol.hasInstance,{value:function(e){return!!f.call(this,e)||this===x&&(e&&e._writableState instanceof S)}})):f=function(e){return e instanceof this},x.prototype.pipe=function(){E(this,new g)},x.prototype.write=function(e,t,r){var i,o=this._writableState,a=!1,s=!o.objectMode&&(i=e,u.isBuffer(i)||i instanceof c);return s&&!u.isBuffer(e)&&(e=function(e){return u.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=k),o.ending?function(e,t){var r=new w;E(e,r),n.nextTick(t,r)}(this,r):(s||function(e,t,r,i){var o;return null===r?o=new v:"string"==typeof r||t.objectMode||(o=new p("chunk",["string","Buffer"],r)),!o||(E(e,o),n.nextTick(i,o),!1)}(this,o,e,r))&&(o.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=u.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var c=t.length<t.highWaterMark;c||(t.needDrain=!0);if(t.writing||t.corked){var f=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},f?f.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else T(e,t,!1,s,n,i,o);return c}(this,o,s,e,t,r)),a},x.prototype.cork=function(){this._writableState.corked++},x.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||P(this,e))},x.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(x.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(x.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),x.prototype._write=function(e,t,r){r(new b("_write()"))},x.prototype._writev=null,x.prototype.end=function(e,t,r){var i=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,B(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(x.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),x.prototype.destroy=l.destroy,x.prototype._undestroy=l.undestroy,x.prototype._destroy=function(e,t){t(e)}}).call(this,r(17),r(10))},function(e,t,r){(function(t){function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this,r(17))},function(e,t,r){"use strict";e.exports=f;var n=r(28).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(29);function c(e,t){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!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function f(e){if(!(this instanceof f))return new f(e);u.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",l)}function l(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush((function(t,r){d(e,t,r)}))}function d(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new s;if(e._transformState.transforming)throw new a;return e.push(null)}r(2)(f,u),f.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},f.prototype._transform=function(e,t,r){r(new i("_transform()"))},f.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},f.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},f.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},function(e,t,r){"use strict";var n=r(0).Buffer,i=r(2),o=r(101),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],c=[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],f=[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],d=[1352829926,1548603684,1836072691,2053994217,0];function h(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<<t|e>>>32-t}function b(e,t,r,n,i,o,a,s){return p(e+(t^r^n)+o+a|0,s)+i|0}function m(e,t,r,n,i,o,a,s){return p(e+(t&r|~t&n)+o+a|0,s)+i|0}function g(e,t,r,n,i,o,a,s){return p(e+((t|~r)^n)+o+a|0,s)+i|0}function y(e,t,r,n,i,o,a,s){return p(e+(t&n|r&~n)+o+a|0,s)+i|0}function v(e,t,r,n,i,o,a,s){return p(e+(t^(r|~n))+o+a|0,s)+i|0}i(h,o),h.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,h=0|this._e,w=0|this._a,_=0|this._b,E=0|this._c,k=0|this._d,S=0|this._e,x=0;x<80;x+=1){var T,A;x<16?(T=b(r,n,i,o,h,e[s[x]],l[0],c[x]),A=v(w,_,E,k,S,e[u[x]],d[0],f[x])):x<32?(T=m(r,n,i,o,h,e[s[x]],l[1],c[x]),A=y(w,_,E,k,S,e[u[x]],d[1],f[x])):x<48?(T=g(r,n,i,o,h,e[s[x]],l[2],c[x]),A=g(w,_,E,k,S,e[u[x]],d[2],f[x])):x<64?(T=y(r,n,i,o,h,e[s[x]],l[3],c[x]),A=m(w,_,E,k,S,e[u[x]],d[3],f[x])):(T=v(r,n,i,o,h,e[s[x]],l[4],c[x]),A=b(w,_,E,k,S,e[u[x]],d[4],f[x])),r=h,h=o,o=p(i,10),i=n,n=T,w=S,S=k,k=p(E,10),E=_,_=A}var P=this._b+i+k|0;this._b=this._c+o+S|0,this._c=this._d+h+w|0,this._d=this._e+r+_|0,this._e=this._a+n+E|0,this._a=P},h.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 e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=h},function(e,t,r){(t=e.exports=function(e){e=e.toLowerCase();var r=t[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r}).sha=r(224),t.sha1=r(225),t.sha224=r(226),t.sha256=r(111),t.sha384=r(227),t.sha512=r(112)},function(e,t,r){var n=r(2),i=r(30),o=r(4).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 c(e,t,r){return r^e&(t^r)}function f(e,t,r){return e&t|r&(e|t)}function l(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function d(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>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(e){for(var t,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,b=0|this._g,m=0|this._h,g=0;g<16;++g)r[g]=e.readInt32BE(4*g);for(;g<64;++g)r[g]=0|(((t=r[g-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[g-7]+h(r[g-15])+r[g-16];for(var y=0;y<64;++y){var v=m+d(u)+c(u,p,b)+a[y]+r[y]|0,w=l(n)+f(n,i,o)|0;m=b,b=p,p=u,u=s+v|0,s=o,o=i,i=n,n=v+w|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=b+this._g|0,this._h=m+this._h|0},u.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=u},function(e,t,r){var n=r(2),i=r(30),o=r(4).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 c(e,t,r){return r^e&(t^r)}function f(e,t,r){return e&t|r&(e|t)}function l(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function d(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function b(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function g(e,t){return e>>>0<t>>>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(e){for(var t=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,y=0|this._gh,v=0|this._hh,w=0|this._al,_=0|this._bl,E=0|this._cl,k=0|this._dl,S=0|this._el,x=0|this._fl,T=0|this._gl,A=0|this._hl,P=0;P<32;P+=2)t[P]=e.readInt32BE(4*P),t[P+1]=e.readInt32BE(4*P+4);for(;P<160;P+=2){var O=t[P-30],I=t[P-30+1],B=h(O,I),M=p(I,O),R=b(O=t[P-4],I=t[P-4+1]),N=m(I,O),j=t[P-14],U=t[P-14+1],C=t[P-32],H=t[P-32+1],z=M+U|0,L=B+j+g(z,M)|0;L=(L=L+R+g(z=z+N|0,N)|0)+C+g(z=z+H|0,H)|0,t[P]=L,t[P+1]=z}for(var D=0;D<160;D+=2){L=t[D],z=t[D+1];var F=f(r,n,i),q=f(w,_,E),K=l(r,w),W=l(w,r),V=d(s,S),G=d(S,s),X=a[D],Y=a[D+1],$=c(s,u,y),J=c(S,x,T),Q=A+G|0,Z=v+V+g(Q,A)|0;Z=(Z=(Z=Z+$+g(Q=Q+J|0,J)|0)+X+g(Q=Q+Y|0,Y)|0)+L+g(Q=Q+z|0,z)|0;var ee=W+q|0,te=K+F+g(ee,W)|0;v=y,A=T,y=u,T=x,u=s,x=S,s=o+Z+g(S=k+Q|0,k)|0,o=i,k=E,i=n,E=_,n=r,_=w,r=Z+te+g(w=Q+ee|0,Q)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+E|0,this._dl=this._dl+k|0,this._el=this._el+S|0,this._fl=this._fl+x|0,this._gl=this._gl+T|0,this._hl=this._hl+A|0,this._ah=this._ah+r+g(this._al,w)|0,this._bh=this._bh+n+g(this._bl,_)|0,this._ch=this._ch+i+g(this._cl,E)|0,this._dh=this._dh+o+g(this._dl,k)|0,this._eh=this._eh+s+g(this._el,S)|0,this._fh=this._fh+u+g(this._fl,x)|0,this._gh=this._gh+y+g(this._gl,T)|0,this._hh=this._hh+v+g(this._hl,A)|0},u.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},function(e,t,r){"use strict";(function(t,n){var i=r(48);e.exports=v;var o,a=r(88);v.ReadableState=y;r(40).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=r(114),c=r(47).Buffer,f=(void 0!==t?t:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var l=Object.create(r(42));l.inherits=r(31);var d=r(229),h=void 0;h=d&&d.debuglog?d.debuglog("stream"):function(){};var p,b=r(230),m=r(115);l.inherits(v,u);var g=["error","close","destroy","pause","resume"];function y(e,t){e=e||{};var n=t instanceof(o=o||r(23));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.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 b,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=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=r(41).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function v(e){if(o=o||r(23),!(this instanceof v))return new v(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function w(e,t,r,n,i){var o,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,k(e)}(e,a)):(i||(o=function(e,t){var r;n=t,c.isBuffer(n)||n instanceof f||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?_(e,a,t,!1):x(e,a)):_(e,a,t,!1))):n||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(a)}function _(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&k(e)),x(e,t)}Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),v.prototype.destroy=m.destroy,v.prototype._undestroy=m.undestroy,v.prototype._destroy=function(e,t){this.push(null),t(e)},v.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=c.from(e,t),t=""),r=!0),w(this,e,t,!1,r)},v.prototype.unshift=function(e){return w(this,e,null,!0,!1)},v.prototype.isPaused=function(){return!1===this._readableState.flowing},v.prototype.setEncoding=function(e){return p||(p=r(41).StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this};function E(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(S,e):S(e))}function S(e){h("emit readable"),e.emit("readable"),O(e)}function x(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(T,e,t))}function T(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function A(e){h("readable nexttick read 0"),e.read(0)}function P(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),O(e),t.flowing&&!t.reading&&e.read(0)}function O(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function I(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,i=r.data;e-=i.length;for(;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function B(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(M,t,e))}function M(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function R(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}v.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?B(this):k(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&B(this),null;var n,i=t.needReadable;return h("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",i=!0),t.ended||t.reading?h("reading or ended",i=!1):i&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=E(r,t))),null===(n=e>0?I(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&B(this)),null!==n&&this.emit("data",n),n},v.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,h("pipe count=%d opts=%j",o.pipesCount,t);var u=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?f:v;function c(t,n){h("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,h("cleanup"),e.removeListener("close",g),e.removeListener("finish",y),e.removeListener("drain",l),e.removeListener("error",m),e.removeListener("unpipe",c),r.removeListener("end",f),r.removeListener("end",v),r.removeListener("data",b),d=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function f(){h("onend"),e.end()}o.endEmitted?i.nextTick(u):r.once("end",u),e.on("unpipe",c);var l=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,O(e))}}(r);e.on("drain",l);var d=!1;var p=!1;function b(t){h("ondata"),p=!1,!1!==e.write(t)||p||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==R(o.pipes,e))&&!d&&(h("false write response, pause",o.awaitDrain),o.awaitDrain++,p=!0),r.pause())}function m(t){h("onerror",t),v(),e.removeListener("error",m),0===s(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",y),v()}function y(){h("onfinish"),e.removeListener("close",g),v()}function v(){h("unpipe"),r.unpipe(e)}return r.on("data",b),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",m),e.once("close",g),e.once("finish",y),e.emit("pipe",r),o.flowing||(h("pipe resume"),r.resume()),e},v.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=R(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},v.prototype.on=function(e,t){var r=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&k(this):i.nextTick(A,this))}return r},v.prototype.addListener=v.prototype.on,v.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(P,e,t))}(this,e)),this},v.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},v.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(h("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(h("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<g.length;o++)e.on(g[o],this.emit.bind(this,g[o]));return this._read=function(t){h("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(v.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),v._fromList=I}).call(this,r(17),r(10))},function(e,t,r){e.exports=r(40).EventEmitter},function(e,t,r){"use strict";var n=r(48);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(i,this,e)):n.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t&&t(e)})),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)}}},function(e,t,r){"use strict";e.exports=a;var n=r(23),i=Object.create(r(42));function o(e,t){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!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);n.call(this,e),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"==typeof this._flush?this._flush((function(t,r){u(e,t,r)})):u(this,null,null)}function u(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=r(31),i.inherits(a,n),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},a.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},a.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,(function(e){t(e),r.emit("close")}))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(243);t.bip32=n;const i=r(79);t.address=i;const o=r(19);t.crypto=o;const a=r(82);t.ECPair=a;const s=r(12);t.networks=s;const u=r(50);t.payments=u;const c=r(1);t.script=c;var f=r(284);t.Block=f.Block;var l=r(285);t.Psbt=l.Psbt;var d=r(1);t.opcodes=d.OPS;var h=r(52);t.Transaction=h.Transaction;var p=r(286);t.TransactionBuilder=p.TransactionBuilder},function(e,t,r){"use strict";var n=t;n.version=r(251).version,n.utils=r(11),n.rand=r(120),n.curve=r(121),n.curves=r(77),n.ec=r(263),n.eddsa=r(267)},function(e,t,r){"use strict";var n=t;function i(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t}n.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(e,t){return"hex"===t?o(e):e}},function(e,t,r){var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(252);if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(e){return o.randomBytes(e)}}catch(e){}},function(e,t,r){"use strict";var n=t;n.base=r(49),n.short=r(253),n.mont=r(254),n.edwards=r(255)},function(e,t,r){"use strict";var n=r(15).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function a(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?a(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=a,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict";var n=r(15),i=r(43),o=r(122),a=r(24),s=n.sum32,u=n.sum32_4,c=n.sum32_5,f=o.ch32,l=o.maj32,d=o.s0_256,h=o.s1_256,p=o.g0_256,b=o.g1_256,m=i.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(y,m),e.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=u(b(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],m=this.h[2],g=this.h[3],y=this.h[4],v=this.h[5],w=this.h[6],_=this.h[7];for(a(this.k.length===r.length),n=0;n<r.length;n++){var E=c(_,h(y),f(y,v,w),this.k[n],r[n]),k=s(d(i),l(i,o,m));_=w,w=v,v=y,y=s(g,E),g=m,m=o,o=i,i=s(E,k)}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],m),this.h[3]=s(this.h[3],g),this.h[4]=s(this.h[4],y),this.h[5]=s(this.h[5],v),this.h[6]=s(this.h[6],w),this.h[7]=s(this.h[7],_)},y.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(e,t,r){"use strict";var n=r(15),i=r(43),o=r(24),a=n.rotr64_hi,s=n.rotr64_lo,u=n.shr64_hi,c=n.shr64_lo,f=n.sum64,l=n.sum64_hi,d=n.sum64_lo,h=n.sum64_4_hi,p=n.sum64_4_lo,b=n.sum64_5_hi,m=n.sum64_5_lo,g=i.BlockHash,y=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(){if(!(this instanceof v))return new v;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=y,this.W=new Array(160)}function w(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function _(e,t,r,n,i,o){var a=t&n^~t&o;return a<0&&(a+=4294967296),a}function E(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function k(e,t,r,n,i,o){var a=t&n^t&o^n&o;return a<0&&(a+=4294967296),a}function S(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function T(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function A(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function P(e,t){var r=a(e,t,1)^a(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function O(e,t){var r=s(e,t,1)^s(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=a(e,t,19)^a(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}function B(e,t){var r=s(e,t,19)^s(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(v,g),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=I(r[n-4],r[n-3]),o=B(r[n-4],r[n-3]),a=r[n-14],s=r[n-13],u=P(r[n-30],r[n-29]),c=O(r[n-30],r[n-29]),f=r[n-32],l=r[n-31];r[n]=h(i,o,a,s,u,c,f,l),r[n+1]=p(i,o,a,s,u,c,f,l)}},v.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4],c=this.h[5],h=this.h[6],p=this.h[7],g=this.h[8],y=this.h[9],v=this.h[10],P=this.h[11],O=this.h[12],I=this.h[13],B=this.h[14],M=this.h[15];o(this.k.length===r.length);for(var R=0;R<r.length;R+=2){var N=B,j=M,U=T(g,y),C=A(g,y),H=w(g,y,v,P,O),z=_(g,y,v,P,O,I),L=this.k[R],D=this.k[R+1],F=r[R],q=r[R+1],K=b(N,j,U,C,H,z,L,D,F,q),W=m(N,j,U,C,H,z,L,D,F,q);N=S(n,i),j=x(n,i),U=E(n,i,a,s,u),C=k(n,i,a,s,u,c);var V=l(N,j,U,C),G=d(N,j,U,C);B=O,M=I,O=v,I=P,v=g,P=y,g=l(h,p,K,W),y=d(p,p,K,W),h=u,p=c,u=a,c=s,a=n,s=i,n=l(K,W,V,G),i=d(K,W,V,G)}f(this.h,0,n,i),f(this.h,2,a,s),f(this.h,4,u,c),f(this.h,6,h,p),f(this.h,8,g,y),f(this.h,10,v,P),f(this.h,12,O,I),f(this.h,14,B,M)},v.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(e,t,r){var n=r(4).Buffer;e.exports={check:function(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;var t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;var r=e[5+t];return 0!==r&&(6+t+r===e.length&&(!(128&e[4])&&(!(t>1&&0===e[4]&&!(128&e[5]))&&(!(128&e[t+6])&&!(r>1&&0===e[t+6]&&!(128&e[t+7]))))))},decode:function(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");var t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");var r=e[5+t];if(0===r)throw new Error("S length is zero");if(6+t+r!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(r>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}},encode:function(e,t){var r=e.length,i=t.length;if(0===r)throw new Error("R length is zero");if(0===i)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(i>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&t[0])throw new Error("S value is negative");if(r>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(i>1&&0===t[0]&&!(128&t[1]))throw new Error("S value excessively padded");var o=n.allocUnsafe(6+r+i);return o[0]=48,o[1]=o.length-2,o[2]=2,o[3]=e.length,e.copy(o,4),o[4+r]=2,o[5+r]=t.length,t.copy(o,6+r),o}}},function(e,t,r){(function(t){e.exports=function(e,r){if(!Array.isArray(e))throw TypeError("Expected values Array");if("function"!=typeof r)throw TypeError("Expected digest Function");for(var n=e.length,i=e.concat();n>1;){for(var o=0,a=0;a<n;a+=2,++o){var s=i[a],u=a+1===n?s:i[a+1],c=t.concat([s,u]);i[o]=r(c)}n=o}return i[0]}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(1);function o(e){const t=n.compile(e);return 22===t.length&&t[0]===i.OPS.OP_0&&20===t[1]}t.check=o,o.toJSON=()=>"Witness pubKeyHash output"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(1);function o(e){const t=n.compile(e);return 34===t.length&&t[0]===i.OPS.OP_0&&32===t[1]}t.check=o,o.toJSON=()=>"Witness scriptHash output"},function(e,t,r){"use strict";(function(e){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BitcoinBase=void 0;const u=s(r(307)),c=s(r(371)),f=o(r(96)),l=r(151),d=r(34),h=s(r(57)),p=s(r(99)),b=s(r(75)),m=(0,p.default)(b.default);t.BitcoinBase=class{constructor(e,t={api:{enabled:!0,provider:"BlockStream"}}){this.network=h.default[e],this.hdWalletPath=l.hdWalletPath.bitcoin,this.transactionBuilder=new u.default(t,e,this.network),this.btcInterface=this.transactionBuilder.btcInterface,this.signer=new c.default(this.network),this.currentAccount=void 0,this.currentAccountType=void 0,this.privateKey=void 0,this.publicKey=void 0,this.publicKeys=[]}get signerInfo(){return this.privateKey?{address:this.bitcoinAddress,publicKey:this.publicKey.toString("hex"),addressType:this.currentAccountType}:void 0}static createTransactionInputsAndOutputs({targets:e,extendedUtxo:t,changeAddress:r,feeRate:n}){return u.default.helperHandleInputsAndOutputs({targets:e,extendedUtxo:t,changeObject:{address:r},feeRate:n})}static checkBalanceIsSufficient({targets:e,extendedUtxo:t,changeAddress:r,feeRate:n,fullAmount:i=!1}){try{return u.default.helperHandleInputsAndOutputs({targets:e,extendedUtxo:t,changeObject:{address:r},feeRate:n}),!0}catch(e){return!1}}setMultiSigAccount(e="p2sh"){throw new Error("accountType is incorrect")}setAccountPrivateKey(t){this.privateKey=e.from(t,"hex");let r=(0,d.getPubKeyFromPrivateKeyHex)(t,this.network);this.publicKey=r}setAccountPublicKey(t){this.publicKey=e.from(t,"hex")}setAccountPrivateKeyByMnemonic({mnemonic:e,mnemonicPassword:t="",index:r=0,walletNumber:n=0,addressType:i="p2sh-p2wpkh"}){if(!f.validateMnemonic(e))throw new Error("invalid mnemonic");const o=f.mnemonicToSeedSync(e,t),a=m.fromSeed(o);let s=this.hdWalletPath[i];if(!s)throw new Error("incorrect path or addressType");const u=`${s}/${n}`,c=a.derivePath(u).derive(r);return this.setAccountPrivateKey(c.privateKey.toString("hex")),this.setAccount(i)}setAccount(e="p2pkh"){if(!this.publicKey)throw new Error("account not initialized");let t=this.transactionBuilder.createAddressObject({addressType:e,publicKey:this.publicKey});return this.currentAccount=t.address,this.currentAccountType=e,this.addressObj=t,this.bitcoinAddress=t.address,t.address}getExtendedUtxo(e){return a(this,void 0,void 0,(function*(){return this.transactionBuilder.getExtendedUtxo(e)}))}send({receiverAddress:e,amount:t,fullAmount:r=!1,speed:n="normal"}){return a(this,void 0,void 0,(function*(){if(!(this.currentAccount&&this.currentAccountType&&this.publicKey&&this.privateKey))throw new Error("account not initialized");let i=yield this.getExtendedUtxo({address:this.currentAccount,addressType:this.currentAccountType,publicKey:this.publicKey.toString("hex")});if(t-+t.toFixed()!=0)throw new Error("incorrect amount. amount should be in satoshi");let o=yield this.transactionBuilder._getFeeRate(n),a=yield this.transactionBuilder.processUnsignedTransaction({extendedUtxo:i,targets:[{address:e,value:t}],changeAddress:this.currentAccount,feeRate:o,fullAmount:r}),s=yield this.signer.signPsbt(a,this.privateKey),u=this.signer.finalizePsbts([s]);return yield this.transactionBuilder.sendTx(u)}))}sendSignedPsbt(e){return a(this,void 0,void 0,(function*(){let t=this.signer.finalizePsbts([e]);return yield this.transactionBuilder.sendTx(t)}))}sendSignedTx(e){return a(this,void 0,void 0,(function*(){return yield this.transactionBuilder.sendTx(e)}))}sendMultiSignedPsbt(e=[]){return a(this,void 0,void 0,(function*(){let t=this.signer.finalizePsbts(e);return yield this.transactionBuilder.sendTx(t)}))}increaseTransactionFee(e,t,r){return a(this,void 0,void 0,(function*(){let t=yield this.btcInterface.getTransaction(e);console.log(t),null==t||t.blockNumber}))}}}).call(this,r(0).Buffer)},function(e,t,r){var n=r(53);e.exports=function(e,t,r){if(!isFinite(n.uintOrNaN(r)))return{};for(var i=n.transactionBytes([],t),o=0,a=[],s=n.sumOrNaN(t),u=0;u<e.length;++u){var c=e[u],f=n.inputBytes(c),l=r*f,d=n.uintOrNaN(c.value);if(l>c.value){if(u===e.length-1)return{fee:r*(i+f)}}else if(i+=f,o+=d,a.push(c),!(o<s+r*i))return n.finalize(a,t,r)}return{fee:r*i}}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BitcoinInterface=void 0;const i=r(312),o=r(339),a=r(34),s=r(359),u=r(370),c=r(152);class f extends c.BitcoinInterfaceUtils{constructor(e,t,r={minTeleporterFeeAmount:0}){var n;if(super(t),null===(n=e.rpc)||void 0===n?void 0:n.enabled)this.rpcProvider=i.bitcoin.getRpcProvider(e.rpc);else if("BlockStream"!==e.api.provider&&"MempoolSpace"!==e.api.provider)throw new Error("if rpc is disabled, we just support BlockStream Or MempoolSpace as api provider");e.api.enabled&&(this.apiProviderName=e.api.provider,this.apiProvider=i.bitcoin.getApiProvider(e.api,t)),this.minTeleporterFeeAmount=r.minTeleporterFeeAmount,this.provider=this.rpcProvider||this.apiProvider}getLatestBlockNumber(){return n(this,void 0,void 0,(function*(){return yield this.provider.getLatestBlockNumber()}))}getBlockHash(e){return n(this,void 0,void 0,(function*(){return yield(0,o.runWithRetries)(()=>this.provider.getBlockHash(e))}))}getBlockHeaderHex(e){return n(this,void 0,void 0,(function*(){return yield(0,o.runWithRetries)(()=>this.provider.getBlockHeaderHex(e))}))}getTransaction(e){return n(this,void 0,void 0,(function*(){return this.provider.getTransaction(e)}))}getFeeRate(e){return n(this,void 0,void 0,(function*(){return new i.bitcoin.ApiProviders.MempoolSpace(this.testnet).getRecommendedFeeRate(e)}))}getHexBlockHeaders(e,t){return n(this,void 0,void 0,(function*(){const r=[];let n=null,i="",o=e;for(let s=e;s<=t;s+=1){let e=yield this.getBlockHeaderHex(s);console.log("block",s);let t=(0,a.parseBlockHeader)(e);n&&t.difficulty!==n?(r.push({hexBlockHeaders:i,fromBlockNumber:o,toBlockNumber:s-1,difficulty:n}),i=e,o=s):i+=e,n=t.difficulty}return i&&r.push({hexBlockHeaders:i,fromBlockNumber:o,toBlockNumber:t,difficulty:n}),r}))}getRequestProof(e){return n(this,void 0,void 0,(function*(){let t,r=e.hex||(yield this.provider.getRawTransaction(e.txId));e.blockHash&&e.blockNumber||(t=yield this.provider.getTransaction(e.txId));let n=e.blockHash||(null==t?void 0:t.blockHash),i=e.blockNumber||(null==t?void 0:t.blockNumber);return{parsedTx:(0,a.parseRawTransaction)(r),merkleProof:e.merkleProof||(yield this.getMerkleProof(e.txId,n)),blockNumber:i,blockHash:n}}))}getMerkleProof(e,t){return n(this,void 0,void 0,(function*(){if(!this.rpcProvider)throw new Error("RPC provider not set");let r=yield this.rpcProvider.getBlockTransactionIds(t);return(0,a.calculateMerkleProof)(r,e)}))}getAddressesUtxo(e){return n(this,void 0,void 0,(function*(){if(!this.apiProvider)throw new Error("api provider not set");const t=[];for(let r=0;r<e.length;r+=20){const n=e.slice(r,r+20);t.push(n)}let r=[];for(let e of t){const t=[];for(let r of e){let e=yield this.apiProvider.getUtxos(r);t.push(e)}let n=yield Promise.all(t);if(0===n.flat(1).length)break;r.push(n.flat(1))}return r.flat(1)}))}getAddressesExtendedUtxo(e){return n(this,void 0,void 0,(function*(){if(!this.apiProvider)throw new Error("this function need an api provider");const t=[];for(let r=0;r<e.length;r+=20){const n=e.slice(r,r+20);t.push(n)}let r=[];for(let e of t){const t=[];for(let r of e){let e=this.apiProvider.getUtxos(r.address);t.push(e)}let n=yield Promise.all(t);if(0===n.flat(1).length)break;r.push(n.map((t,r)=>t.map(t=>({hash:t.txId,value:t.value,index:t.index,signerInfo:e[r]}))).flat(1))}return r.flat(1)}))}getBalance(e){var t;return n(this,void 0,void 0,(function*(){if(!this.apiProvider)throw new Error("this function need an api provider");return(null!==(t=yield this.apiProvider.getUtxos(e))&&void 0!==t?t:[]).reduce((e,t)=>e+Number(t.value),0)}))}getBlockTransactions(e,t,r=[]){return n(this,void 0,void 0,(function*(){if(!this.rpcProvider)throw new Error("RPC provider not set");let n=yield this.rpcProvider.getBlockByBlockNumber(t,0),{withdrawTxs:i,depositTxs:o}=(0,a.extractTransactionsAndBlockInfoFromRawBlock)(n,t,e,r,this.network);return o.concat(i)}))}getMultipleBlocksTransactions(e,t,r,i=[]){return n(this,void 0,void 0,(function*(){if(r-t>20)throw new Error("cant get more than 20 block per function call");let n=[];for(let o=+t+1;o<=r;o+=1){console.log(o);const t=yield this.getBlockTransactions(e,o,i);n.push(t)}return n=yield Promise.all(n),n.flat(1)}))}getTransactionHistory(e,t,r){return n(this,void 0,void 0,(function*(){if(this.rpcProvider){let n=r||(yield this.getLatestBlockNumber()),i=Math.max(+t,+n-20);return this.getMultipleBlocksTransactions(e,i,n)}if("BlockStream"!==this.apiProviderName&&"MempoolSpace"!==this.apiProviderName)throw new Error("not support this api provider");return(yield this.apiProvider.getTransactionHistoryForMultipleAddresses(e,t)).flat(1)}))}getMempoolTransactionHistory(e){return n(this,void 0,void 0,(function*(){if("BlockStream"!==this.apiProviderName&&"MempoolSpace"!==this.apiProviderName)throw new Error("not support this api provider");return(yield this.apiProvider.getMempoolTransactionHistoryForMultipleAddresses(e)).flat(1)}))}getTeleporterRequests(e,t,r,i=!1){return n(this,void 0,void 0,(function*(){let n=i?yield this.getMempoolTransactionHistory(e):yield this.getTransactionHistory(e,t,r),o=[],a=[];for(let e of n){let{transaction:t,request:r,lockerAddress:n,lockerLockingScript:i}=yield this.getTeleportRequestByTx(e,e.address);r.status?o.push({transaction:t,request:r,lockerAddress:n,lockerLockingScript:i}):"NO_OP_RETURN"!==r.code&&a.push({transaction:t,request:r,lockerAddress:n,lockerLockingScript:i})}return{requests:o,invalidRequests:a}}))}getTeleportRequestByTx(e,t){return n(this,void 0,void 0,(function*(){let r=e;if(!r.txId)throw new Error("txId not exist");(null==r?void 0:r.vout)||(r=yield this.getTransaction(r.txId));let n=r.vout,i=(0,s.checkAndParseProtocolRequest)(n,t,{minTeleporterFeeAmount:this.minTeleporterFeeAmount}),o=r.addressScript||this.convertAddressToScript(t).script.toString("hex");return{transaction:r,request:i,lockerAddress:t,lockerLockingScript:o}}))}getLockersBurnTransactions(e,t,r,i=!1){return n(this,void 0,void 0,(function*(){let n=i?yield this.getMempoolTransactionHistory(e):yield this.getTransactionHistory(e,t,r),o=[];for(let e of n){let t=e.address,r=yield this.getTransactionBurnInfoByTx(e,t);if(r){const{burnInfo:t,lockerAddress:n,lockerLockingScript:i}=r;o.push({transaction:e,burnInfo:t,lockerAddress:n,lockerLockingScript:i})}}return o}))}getTransactionBurnInfoByTx(e,t){return n(this,void 0,void 0,(function*(){if(!e.txId)throw new Error("txId not exist");let r=e.vin||(yield this.getTransaction(e.txId)).vin,n=(0,u.getBurnTransactionInfo)(t,r,e.vout);if(!n)return null;let i=e.addressScript||this.convertAddressToScript(t).script.toString("hex");return{burnInfo:n,lockerAddress:t,lockerLockingScript:i}}))}}t.BitcoinInterface=f},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},function(e,t,r){"use strict";var n=r(6);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var o;if(r)o=r(t);else if(n.isURLSearchParams(t))o=t.toString();else{var a=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),a.push(i(t)+"="+i(e))})))})),o=a.join("&")}if(o){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},function(e,t,r){"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},function(e,t,r){"use strict";(function(t){var n=r(6);e.exports=function(e,r){r=r||new FormData;var i=[];function o(e){return null===e?"":n.isDate(e)?e.toISOString():n.isArrayBuffer(e)||n.isTypedArray(e)?"function"==typeof Blob?new Blob([e]):t.from(e):e}return function e(t,a){if(n.isPlainObject(t)||n.isArray(t)){if(-1!==i.indexOf(t))throw Error("Circular reference detected in "+a);i.push(t),n.forEach(t,(function(t,i){if(!n.isUndefined(t)){var s,u=a?a+"."+i:i;if(t&&!a&&"object"==typeof t)if(n.endsWith(i,"{}"))t=JSON.stringify(t);else if(n.endsWith(i,"[]")&&(s=n.toArray(t)))return void s.forEach((function(e){!n.isUndefined(e)&&r.append(u,o(e))}));e(t,u)}})),i.pop()}else r.append(a,o(t))}(e),r}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(6),i=r(322),o=r(323),a=r(133),s=r(137),u=r(326),c=r(327),f=r(134),l=r(32),d=r(55),h=r(328);e.exports=function(e){return new Promise((function(t,r){var p,b=e.data,m=e.headers,g=e.responseType;function y(){e.cancelToken&&e.cancelToken.unsubscribe(p),e.signal&&e.signal.removeEventListener("abort",p)}n.isFormData(b)&&n.isStandardBrowserEnv()&&delete m["Content-Type"];var v=new XMLHttpRequest;if(e.auth){var w=e.auth.username||"",_=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";m.Authorization="Basic "+btoa(w+":"+_)}var E=s(e.baseURL,e.url);function k(){if(v){var n="getAllResponseHeaders"in v?u(v.getAllResponseHeaders()):null,o={data:g&&"text"!==g&&"json"!==g?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:n,config:e,request:v};i((function(e){t(e),y()}),(function(e){r(e),y()}),o),v=null}}if(v.open(e.method.toUpperCase(),a(E,e.params,e.paramsSerializer),!0),v.timeout=e.timeout,"onloadend"in v?v.onloadend=k:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(k)},v.onabort=function(){v&&(r(new l("Request aborted",l.ECONNABORTED,e,v)),v=null)},v.onerror=function(){r(new l("Network Error",l.ERR_NETWORK,e,v,v)),v=null},v.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||f;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new l(t,n.clarifyTimeoutError?l.ETIMEDOUT:l.ECONNABORTED,e,v)),v=null},n.isStandardBrowserEnv()){var S=(e.withCredentials||c(E))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;S&&(m[e.xsrfHeaderName]=S)}"setRequestHeader"in v&&n.forEach(m,(function(e,t){void 0===b&&"content-type"===t.toLowerCase()?delete m[t]:v.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(v.withCredentials=!!e.withCredentials),g&&"json"!==g&&(v.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&v.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(p=function(e){v&&(r(!e||e&&e.type?new d:e),v.abort(),v=null)},e.cancelToken&&e.cancelToken.subscribe(p),e.signal&&(e.signal.aborted?p():e.signal.addEventListener("abort",p))),b||(b=null);var x=h(E);x&&-1===["http","https","file"].indexOf(x)?r(new l("Unsupported protocol "+x+":",l.ERR_BAD_REQUEST,e)):v.send(b)}))}},function(e,t,r){"use strict";var n=r(324),i=r(325);e.exports=function(e,t){return e&&!n(t)?i(e,t):t}},function(e,t,r){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,r){"use strict";var n=r(6);e.exports=function(e,t){t=t||{};var r={};function i(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function o(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(e[r],t[r])}function a(e){if(!n.isUndefined(t[e]))return i(void 0,t[e])}function s(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(void 0,t[r])}function u(r){return r in t?i(e[r],t[r]):r in e?i(void 0,e[r]):void 0}var c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:u};return n.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||o,i=t(e);n.isUndefined(i)&&t!==u||(r[e]=i)})),r}},function(e,t){e.exports={version:"0.27.2"}},function(e,t,r){"use strict";(function(e){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(54);t.default=class{constructor(e,t){this.api=(0,i.getAxiosInstance)({baseUrl:e,headers:t})}getOutspend(e,t){return n(this,void 0,void 0,(function*(){return(yield this.api.get(`/tx/${e}/outspend/${t}`)).data}))}getOutspends(e){return n(this,void 0,void 0,(function*(){return(yield this.api.get(`/tx/${e}/outspends`)).data}))}getLatestBlockNumber(){return n(this,void 0,void 0,(function*(){return(yield this.api.get("/blocks/tip/height")).data}))}getBlockHash(e){return n(this,void 0,void 0,(function*(){return(yield this.api.get("/block-height/"+e)).data}))}getBlockHeaderHex(e){return n(this,void 0,void 0,(function*(){const t=yield this.getBlockHash(e);return(yield this.api.get(`/block/${t}/header`)).data}))}getConfirmedTransactions(e,t=""){return n(this,void 0,void 0,(function*(){return(yield this.api.get(`/address/${e}/txs/chain/${t}`)).data}))}getMempoolTransactions(e){return n(this,void 0,void 0,(function*(){return(yield this.api.get(`/address/${e}/txs/mempool`)).data}))}getTransaction(e){return n(this,void 0,void 0,(function*(){let t=(yield this.api.get("/tx/"+e)).data;return{txId:t.txid,version:t.version,locktime:t.locktime,blockTime:t.status.block_time,blockNumber:t.status.block_height||null,blockHash:t.status.block_hash||null,vout:t.vout.map(e=>({address:e.scriptpubkey_address||null,script:e.scriptpubkey,value:e.value})),vin:t.vin.map(e=>({txId:e.txid,index:e.vout,address:e.prevout.scriptpubkey_address||null,script:e.prevout.scriptpubkey,value:e.prevout.value}))}}))}getRawTransaction(e){return n(this,void 0,void 0,(function*(){return(yield this.api.get(`/tx/${e}/hex`)).data}))}getTransactionHistory(e,t=0,r){var i;return n(this,void 0,void 0,(function*(){let n=!0,o=[],a="";for(;n;){let s=yield this.getConfirmedTransactions(e,a),u=s.findIndex(e=>e.txid===r);s=s.filter(e=>+e.status.block_height>t),s=u<0?s:s.filter((e,t)=>t<u),o.push(...s),a=null===(i=s[s.length-1])||void 0===i?void 0:i.txid,n=15===s.length&&u<0&&0!==s.length}return o.map(t=>({address:e,txId:t.txid,version:t.version,locktime:t.locktime,blockNumber:t.status.block_height||null,blockHash:t.status.block_hash||null,blockTime:t.status.block_time||null,vout:t.vout.map(e=>({address:e.scriptpubkey_address||null,script:e.scriptpubkey,value:e.value})),vin:t.vin.map(e=>({txId:e.txid,index:e.vout,address:e.prevout.scriptpubkey_address||null,script:e.prevout.scriptpubkey,value:e.prevout.value}))}))}))}getMempoolTransactionHistory(e){return n(this,void 0,void 0,(function*(){return(yield this.getMempoolTransactions(e)).map(t=>({address:e,txId:t.txid,version:t.version,locktime:t.locktime,vout:t.vout.map(e=>({address:e.scriptpubkey_address||null,script:e.scriptpubkey,value:e.value})),vin:t.vin.map(e=>({txId:e.txid,index:e.vout,address:e.prevout.scriptpubkey_address||null,script:e.prevout.scriptpubkey,value:e.prevout.value}))}))}))}getMempoolTransactionHistoryForMultipleAddresses(e,t=0){return n(this,void 0,void 0,(function*(){const t=[];for(let r of e){let e=yield this.getMempoolTransactionHistory(r);t.push(e)}return yield Promise.all(t)}))}getTransactionHistoryForMultipleAddresses(e,t=0){return n(this,void 0,void 0,(function*(){const r=[];for(let n of e){let e=yield this.getTransactionHistory(n,t);r.push(e),yield(0,i.sleep)(200)}return yield Promise.all(r)}))}getUtxos(e){return n(this,void 0,void 0,(function*(){return(yield this.api.get(`/address/${e}/utxo`)).data.map(t=>{var r;return{address:e,txId:t.txid,index:t.vout,value:t.value,blockNumber:(null===(r=t.status)||void 0===r?void 0:r.block_height)||void 0}})}))}getBalance(e){return n(this,void 0,void 0,(function*(){return(yield this.getUtxos(e)).reduce((e,t)=>e+Number(t.value),0)}))}getBlockTransactionIds(e){return n(this,void 0,void 0,(function*(){return(yield this.api.get(`/block/${e}/txids`)).data}))}getFeeRate(e="normal"){return n(this,void 0,void 0,(function*(){let t=yield this.api.get("/fee-estimates"),r={slow:+t.data[10],normal:+t.data[6],fast:+t.data[3]};return r[e]||r.normal}))}getRecommendedFeeRate(e="normal"){return n(this,void 0,void 0,(function*(){let t=yield this.api.get("/v1/fees/recommended"),r={slow:+t.data.economyFee,normal:+t.data.halfHourFee,fast:+t.data.fastestFee};return r[e]||r.normal}))}sendRawTransaction(e){return n(this,void 0,void 0,(function*(){return(yield this.api.post("/tx",e)).data}))}getMerkleProof(t){return n(this,void 0,void 0,(function*(){let r=(yield this.api.get(`/tx/${t}/merkle-proof`)).data;return{intermediateNodes:r.merkle.reduce((t,r)=>t+e.from(r,"hex").reverse().toString("hex"),"0x"),transactionIndex:r.pos}}))}getLatestBlock(){return n(this,void 0,void 0,(function*(){return(yield this.api.get("/blocks")).data[0]}))}getBlock(e){return n(this,void 0,void 0,(function*(){const t=yield this.getBlockHash(e);return(yield this.api.get("/block/"+t)).data}))}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},function(e,t,r){"use strict";var n=r(7);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var o;if(r)o=r(t);else if(n.isURLSearchParams(t))o=t.toString();else{var a=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),a.push(i(t)+"="+i(e))})))})),o=a.join("&")}if(o){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},function(e,t,r){"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},function(e,t,r){"use strict";(function(t){var n=r(7);e.exports=function(e,r){r=r||new FormData;var i=[];function o(e){return null===e?"":n.isDate(e)?e.toISOString():n.isArrayBuffer(e)||n.isTypedArray(e)?"function"==typeof Blob?new Blob([e]):t.from(e):e}return function e(t,a){if(n.isPlainObject(t)||n.isArray(t)){if(-1!==i.indexOf(t))throw Error("Circular reference detected in "+a);i.push(t),n.forEach(t,(function(t,i){if(!n.isUndefined(t)){var s,u=a?a+"."+i:i;if(t&&!a&&"object"==typeof t)if(n.endsWith(i,"{}"))t=JSON.stringify(t);else if(n.endsWith(i,"[]")&&(s=n.toArray(t)))return void s.forEach((function(e){!n.isUndefined(e)&&r.append(u,o(e))}));e(t,u)}})),i.pop()}else r.append(a,o(t))}(e),r}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(7),i=r(347),o=r(348),a=r(143),s=r(147),u=r(351),c=r(352),f=r(144),l=r(33),d=r(56),h=r(353);e.exports=function(e){return new Promise((function(t,r){var p,b=e.data,m=e.headers,g=e.responseType;function y(){e.cancelToken&&e.cancelToken.unsubscribe(p),e.signal&&e.signal.removeEventListener("abort",p)}n.isFormData(b)&&n.isStandardBrowserEnv()&&delete m["Content-Type"];var v=new XMLHttpRequest;if(e.auth){var w=e.auth.username||"",_=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";m.Authorization="Basic "+btoa(w+":"+_)}var E=s(e.baseURL,e.url);function k(){if(v){var n="getAllResponseHeaders"in v?u(v.getAllResponseHeaders()):null,o={data:g&&"text"!==g&&"json"!==g?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:n,config:e,request:v};i((function(e){t(e),y()}),(function(e){r(e),y()}),o),v=null}}if(v.open(e.method.toUpperCase(),a(E,e.params,e.paramsSerializer),!0),v.timeout=e.timeout,"onloadend"in v?v.onloadend=k:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(k)},v.onabort=function(){v&&(r(new l("Request aborted",l.ECONNABORTED,e,v)),v=null)},v.onerror=function(){r(new l("Network Error",l.ERR_NETWORK,e,v,v)),v=null},v.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||f;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new l(t,n.clarifyTimeoutError?l.ETIMEDOUT:l.ECONNABORTED,e,v)),v=null},n.isStandardBrowserEnv()){var S=(e.withCredentials||c(E))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;S&&(m[e.xsrfHeaderName]=S)}"setRequestHeader"in v&&n.forEach(m,(function(e,t){void 0===b&&"content-type"===t.toLowerCase()?delete m[t]:v.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(v.withCredentials=!!e.withCredentials),g&&"json"!==g&&(v.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&v.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(p=function(e){v&&(r(!e||e&&e.type?new d:e),v.abort(),v=null)},e.cancelToken&&e.cancelToken.subscribe(p),e.signal&&(e.signal.aborted?p():e.signal.addEventListener("abort",p))),b||(b=null);var x=h(E);x&&-1===["http","https","file"].indexOf(x)?r(new l("Unsupported protocol "+x+":",l.ERR_BAD_REQUEST,e)):v.send(b)}))}},function(e,t,r){"use strict";var n=r(349),i=r(350);e.exports=function(e,t){return e&&!n(t)?i(e,t):t}},function(e,t,r){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,r){"use strict";var n=r(7);e.exports=function(e,t){t=t||{};var r={};function i(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function o(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(e[r],t[r])}function a(e){if(!n.isUndefined(t[e]))return i(void 0,t[e])}function s(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(void 0,t[r])}function u(r){return r in t?i(e[r],t[r]):r in e?i(void 0,e[r]):void 0}var c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:u};return n.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||o,i=t(e);n.isUndefined(i)&&t!==u||(r[e]=i)})),r}},function(e,t){e.exports={version:"0.27.2"}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.teleswap=void 0,o(r(360),t),t.teleswap=a(r(364))},function(e,t,r){"use strict";(function(e){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BitcoinInterfaceUtils=void 0;const i=n(r(57)),o=r(34);class a{constructor(e){this.testnet=e.includes("_testnet"),this.network=i.default[e]}convertHashToAddress(t,r){let n=(0,o.createAddressObjectByHash)({addressType:r,hash:e.from(t,"hex")},this.network);if(!n.address)throw new Error("incorrect input");return n.address}convertScriptToAddress(t,r){let n=(0,o.createAddressObjectByScript)({addressType:r,script:e.from(t,"hex")},this.network);if(!n.address)throw new Error("incorrect input");return n.address}convertAddressToScript(e){let{addressObject:t,addressType:r}=(0,o.createAddressObjectByAddress)(e,this.network);return{script:t.output,hash:t.hash,addressType:r}}convertAddressToObject(e){return(0,o.createAddressObjectByAddress)(e,this.network)}createAddressObjectByPublicKey(t,r){return(0,o.createAddressObjectByPublicKey)({publicKey:e.from(t,"hex"),addressType:r},this.network)}}t.BitcoinInterfaceUtils=a,t.default=a}).call(this,r(0).Buffer)},function(e,t){},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.bitcoinUtils=void 0,t.bitcoinUtils=o(r(34)),a(r(306),t),a(r(131),t),a(r(152),t),a(r(129),t)},function(e,t,r){"use strict";t.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=c(e),a=n[0],s=n[1],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),f=0,l=s>0?a-4:a;for(r=0;r<l;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],u[f++]=t>>16&255,u[f++]=t>>8&255,u[f++]=255&t;2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[f++]=255&t);1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[f++]=t>>8&255,u[f++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;a<s;a+=16383)o.push(f(e,a,a+16383>s?s:a+16383));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<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 c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function f(e,t,r){for(var i,o,a=[],s=t;s<r;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[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(e,t){
12
12
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
13
13
  t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,c=u>>1,f=-7,l=r?i-1:0,d=r?-1:1,h=e[t+l];for(l+=d,o=h&(1<<-f)-1,h>>=-f,f+=s;f>0;o=256*o+e[t+l],l+=d,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+l],l+=d,f-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),o-=c}return(h?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,u,c=8*o-i-1,f=(1<<c)-1,l=f>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+l>=1?d/u:d*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(t*u-1)*Math.pow(2,i),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=255&s,h+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[r+h]=255&a,h+=p,a/=256,c-=8);e[r+h-p]|=128*b}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.p2data=void 0;const n=r(13),i=r(9),o=r(8),a=r(20),s=i.OPS;t.p2data=function(e,t){if(!e.data&&!e.output)throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,o.typeforce)({network:o.typeforce.maybe(o.typeforce.Object),output:o.typeforce.maybe(o.typeforce.Buffer),data:o.typeforce.maybe(o.typeforce.arrayOf(o.typeforce.Buffer))},e);const r={name:"embed",network:e.network||n.bitcoin};if(a.prop(r,"output",()=>{if(e.data)return i.compile([s.OP_RETURN].concat(e.data))}),a.prop(r,"data",()=>{if(e.output)return i.decompile(e.output).slice(1)}),t.validate&&e.output){const t=i.decompile(e.output);if(t[0]!==s.OP_RETURN)throw new TypeError("Output is invalid");if(!t.slice(1).every(o.typeforce.Buffer))throw new TypeError("Output is invalid");if(e.data&&!function(e,t){return e.length===t.length&&e.every((e,r)=>e.equals(t[r]))}(e.data,r.data))throw new TypeError("Data mismatch")}return Object.assign(r,e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encode=t.encodingLength=void 0;const n=r(58);function i(e){return e<n.OPS.OP_PUSHDATA1?1:e<=255?2:e<=65535?3:5}t.encodingLength=i,t.encode=function(e,t,r){const o=i(t);return 1===o?e.writeUInt8(t,r):2===o?(e.writeUInt8(n.OPS.OP_PUSHDATA1,r),e.writeUInt8(t,r+1)):3===o?(e.writeUInt8(n.OPS.OP_PUSHDATA2,r),e.writeUInt16LE(t,r+1)):(e.writeUInt8(n.OPS.OP_PUSHDATA4,r),e.writeUInt32LE(t,r+1)),o},t.decode=function(e,t){const r=e.readUInt8(t);let i,o;if(r<n.OPS.OP_PUSHDATA1)i=r,o=1;else if(r===n.OPS.OP_PUSHDATA1){if(t+2>e.length)return null;i=e.readUInt8(t+1),o=2}else if(r===n.OPS.OP_PUSHDATA2){if(t+3>e.length)return null;i=e.readUInt16LE(t+1),o=3}else{if(t+5>e.length)return null;if(r!==n.OPS.OP_PUSHDATA4)throw new Error("Unexpected opcode");i=e.readUInt32LE(t+1),o=5}return{opcode:r,number:i,size:o}}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.encode=t.decode=void 0,t.decode=function(e,t,r){t=t||4,r=void 0===r||r;const n=e.length;if(0===n)return 0;if(n>t)throw new TypeError("Script number overflow");if(r&&0==(127&e[n-1])&&(n<=1||0==(128&e[n-2])))throw new Error("Non-minimally encoded script number");if(5===n){const t=e.readUInt32LE(0),r=e.readUInt8(4);return 128&r?-(4294967296*(-129&r)+t):4294967296*r+t}let i=0;for(let t=0;t<n;++t)i|=e[t]<<8*t;return 128&e[n-1]?-(i&~(128<<8*(n-1))):i},t.encode=function(t){let r=Math.abs(t);const n=(i=r)>2147483647?5:i>8388607?4:i>32767?3:i>127?2:i>0?1:0;var i;const o=e.allocUnsafe(n),a=t<0;for(let e=0;e<n;++e)o.writeUInt8(255&r,e),r>>=8;return 128&o[n-1]?o.writeUInt8(a?128:0,n-1):a&&(o[n-1]|=128),o}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.encode=t.decode=void 0;const n=r(90),i=r(8),{typeforce:o}=i,a=e.alloc(1,0);function s(t){let r=0;for(;0===t[r];)++r;return r===t.length?a:128&(t=t.slice(r))[0]?e.concat([a,t],1+t.length):t}function u(t){0===t[0]&&(t=t.slice(1));const r=e.alloc(32,0),n=Math.max(0,32-t.length);return t.copy(r,n),r}t.decode=function(t){const r=t.readUInt8(t.length-1),i=-129&r;if(i<=0||i>=4)throw new Error("Invalid hashType "+r);const o=n.decode(t.slice(0,-1)),a=u(o.r),s=u(o.s);return{signature:e.concat([a,s],64),hashType:r}},t.encode=function(t,r){o({signature:i.BufferN(64),hashType:i.UInt8},{signature:t,hashType:r});const a=-129&r;if(a<=0||a>=4)throw new Error("Invalid hashType "+r);const u=e.allocUnsafe(1);u.writeUInt8(r,0);const c=s(t.slice(0,32)),f=s(t.slice(32,64));return e.concat([n.encode(c,f),u])}}).call(this,r(0).Buffer)},function(e,t,r){(function(t){var n=r(59),i=r(91);function o(e){return t.isBuffer(e)}function a(e){return"string"==typeof e&&/^([0-9a-f]{2})+$/i.test(e)}function s(e,t){var r=e.toJSON();function n(n){if(!e(n))return!1;if(n.length===t)return!0;throw i.tfCustomError(r+"(Length: "+t+")",r+"(Length: "+n.length+")")}return n.toJSON=function(){return r},n}var u=s.bind(null,n.Array),c=s.bind(null,o),f=s.bind(null,a),l=s.bind(null,n.String);var d=Math.pow(2,53)-1;var h={ArrayN:u,Buffer:o,BufferN:c,Finite:function(e){return"number"==typeof e&&isFinite(e)},Hex:a,HexN:f,Int8:function(e){return e<<24>>24===e},Int16:function(e){return e<<16>>16===e},Int32:function(e){return(0|e)===e},Int53:function(e){return"number"==typeof e&&e>=-d&&e<=d&&Math.floor(e)===e},Range:function(e,t,r){function i(n,i){return r(n,i)&&n>e&&n<t}return r=r||n.Number,i.toJSON=function(){return`${r.toJSON()} between [${e}, ${t}]`},i},StringN:l,UInt8:function(e){return(255&e)===e},UInt16:function(e){return(65535&e)===e},UInt32:function(e){return e>>>0===e},UInt53:function(e){return"number"==typeof e&&e>=0&&e<=d&&Math.floor(e)===e}};for(var p in h)h[p].toJSON=function(e){return e}.bind(null,p);e.exports=h}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.p2ms=void 0;const n=r(13),i=r(9),o=r(8),a=r(20),s=i.OPS,u=s.OP_RESERVED;function c(e,t){return e.length===t.length&&e.every((e,r)=>e.equals(t[r]))}t.p2ms=function(e,t){if(!(e.input||e.output||e.pubkeys&&void 0!==e.m||e.signatures))throw new TypeError("Not enough data");function r(e){return i.isCanonicalScriptSignature(e)||void 0!==(t.allowIncomplete&&e===s.OP_0)}t=Object.assign({validate:!0},t||{}),(0,o.typeforce)({network:o.typeforce.maybe(o.typeforce.Object),m:o.typeforce.maybe(o.typeforce.Number),n:o.typeforce.maybe(o.typeforce.Number),output:o.typeforce.maybe(o.typeforce.Buffer),pubkeys:o.typeforce.maybe(o.typeforce.arrayOf(o.isPoint)),signatures:o.typeforce.maybe(o.typeforce.arrayOf(r)),input:o.typeforce.maybe(o.typeforce.Buffer)},e);const f={network:e.network||n.bitcoin};let l=[],d=!1;function h(e){d||(d=!0,l=i.decompile(e),f.m=l[0]-u,f.n=l[l.length-2]-u,f.pubkeys=l.slice(1,-2))}if(a.prop(f,"output",()=>{if(e.m&&f.n&&e.pubkeys)return i.compile([].concat(u+e.m,e.pubkeys,u+f.n,s.OP_CHECKMULTISIG))}),a.prop(f,"m",()=>{if(f.output)return h(f.output),f.m}),a.prop(f,"n",()=>{if(f.pubkeys)return f.pubkeys.length}),a.prop(f,"pubkeys",()=>{if(e.output)return h(e.output),f.pubkeys}),a.prop(f,"signatures",()=>{if(e.input)return i.decompile(e.input).slice(1)}),a.prop(f,"input",()=>{if(e.signatures)return i.compile([s.OP_0].concat(e.signatures))}),a.prop(f,"witness",()=>{if(f.input)return[]}),a.prop(f,"name",()=>{if(f.m&&f.n)return`p2ms(${f.m} of ${f.n})`}),t.validate){if(e.output){if(h(e.output),!o.typeforce.Number(l[0]))throw new TypeError("Output is invalid");if(!o.typeforce.Number(l[l.length-2]))throw new TypeError("Output is invalid");if(l[l.length-1]!==s.OP_CHECKMULTISIG)throw new TypeError("Output is invalid");if(f.m<=0||f.n>16||f.m>f.n||f.n!==l.length-3)throw new TypeError("Output is invalid");if(!f.pubkeys.every(e=>(0,o.isPoint)(e)))throw new TypeError("Output is invalid");if(void 0!==e.m&&e.m!==f.m)throw new TypeError("m mismatch");if(void 0!==e.n&&e.n!==f.n)throw new TypeError("n mismatch");if(e.pubkeys&&!c(e.pubkeys,f.pubkeys))throw new TypeError("Pubkeys mismatch")}if(e.pubkeys){if(void 0!==e.n&&e.n!==e.pubkeys.length)throw new TypeError("Pubkey count mismatch");if(f.n=e.pubkeys.length,f.n<f.m)throw new TypeError("Pubkey count cannot be less than m")}if(e.signatures){if(e.signatures.length<f.m)throw new TypeError("Not enough signatures provided");if(e.signatures.length>f.m)throw new TypeError("Too many signatures provided")}if(e.input){if(e.input[0]!==s.OP_0)throw new TypeError("Input is invalid");if(0===f.signatures.length||!f.signatures.every(r))throw new TypeError("Input has invalid signature(s)");if(e.signatures&&!c(e.signatures,f.signatures))throw new TypeError("Signature mismatch");if(void 0!==e.m&&e.m!==e.signatures.length)throw new TypeError("Signature count mismatch")}}return Object.assign(f,e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.p2pk=void 0;const n=r(13),i=r(9),o=r(8),a=r(20),s=i.OPS;t.p2pk=function(e,t){if(!(e.input||e.output||e.pubkey||e.input||e.signature))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,o.typeforce)({network:o.typeforce.maybe(o.typeforce.Object),output:o.typeforce.maybe(o.typeforce.Buffer),pubkey:o.typeforce.maybe(o.isPoint),signature:o.typeforce.maybe(i.isCanonicalScriptSignature),input:o.typeforce.maybe(o.typeforce.Buffer)},e);const r=a.value(()=>i.decompile(e.input)),u={name:"p2pk",network:e.network||n.bitcoin};if(a.prop(u,"output",()=>{if(e.pubkey)return i.compile([e.pubkey,s.OP_CHECKSIG])}),a.prop(u,"pubkey",()=>{if(e.output)return e.output.slice(1,-1)}),a.prop(u,"signature",()=>{if(e.input)return r()[0]}),a.prop(u,"input",()=>{if(e.signature)return i.compile([e.signature])}),a.prop(u,"witness",()=>{if(u.input)return[]}),t.validate){if(e.output){if(e.output[e.output.length-1]!==s.OP_CHECKSIG)throw new TypeError("Output is invalid");if(!(0,o.isPoint)(u.pubkey))throw new TypeError("Output pubkey is invalid");if(e.pubkey&&!e.pubkey.equals(u.pubkey))throw new TypeError("Pubkey mismatch")}if(e.signature&&e.input&&!e.input.equals(u.input))throw new TypeError("Signature mismatch");if(e.input){if(1!==r().length)throw new TypeError("Input is invalid");if(!i.isCanonicalScriptSignature(u.signature))throw new TypeError("Input has invalid signature")}}return Object.assign(u,e)}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.p2pkh=void 0;const n=r(18),i=r(13),o=r(9),a=r(8),s=r(20),u=r(61),c=o.OPS;t.p2pkh=function(t,r){if(!(t.address||t.hash||t.output||t.pubkey||t.input))throw new TypeError("Not enough data");r=Object.assign({validate:!0},r||{}),(0,a.typeforce)({network:a.typeforce.maybe(a.typeforce.Object),address:a.typeforce.maybe(a.typeforce.String),hash:a.typeforce.maybe(a.typeforce.BufferN(20)),output:a.typeforce.maybe(a.typeforce.BufferN(25)),pubkey:a.typeforce.maybe(a.isPoint),signature:a.typeforce.maybe(o.isCanonicalScriptSignature),input:a.typeforce.maybe(a.typeforce.Buffer)},t);const f=s.value(()=>{const r=e.from(u.decode(t.address));return{version:r.readUInt8(0),hash:r.slice(1)}}),l=s.value(()=>o.decompile(t.input)),d=t.network||i.bitcoin,h={name:"p2pkh",network:d};if(s.prop(h,"address",()=>{if(!h.hash)return;const t=e.allocUnsafe(21);return t.writeUInt8(d.pubKeyHash,0),h.hash.copy(t,1),u.encode(t)}),s.prop(h,"hash",()=>t.output?t.output.slice(3,23):t.address?f().hash:t.pubkey||h.pubkey?n.hash160(t.pubkey||h.pubkey):void 0),s.prop(h,"output",()=>{if(h.hash)return o.compile([c.OP_DUP,c.OP_HASH160,h.hash,c.OP_EQUALVERIFY,c.OP_CHECKSIG])}),s.prop(h,"pubkey",()=>{if(t.input)return l()[1]}),s.prop(h,"signature",()=>{if(t.input)return l()[0]}),s.prop(h,"input",()=>{if(t.pubkey&&t.signature)return o.compile([t.signature,t.pubkey])}),s.prop(h,"witness",()=>{if(h.input)return[]}),r.validate){let r=e.from([]);if(t.address){if(f().version!==d.pubKeyHash)throw new TypeError("Invalid version or Network mismatch");if(20!==f().hash.length)throw new TypeError("Invalid address");r=f().hash}if(t.hash){if(r.length>0&&!r.equals(t.hash))throw new TypeError("Hash mismatch");r=t.hash}if(t.output){if(25!==t.output.length||t.output[0]!==c.OP_DUP||t.output[1]!==c.OP_HASH160||20!==t.output[2]||t.output[23]!==c.OP_EQUALVERIFY||t.output[24]!==c.OP_CHECKSIG)throw new TypeError("Output is invalid");const e=t.output.slice(3,23);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch");r=e}if(t.pubkey){const e=n.hash160(t.pubkey);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch");r=e}if(t.input){const e=l();if(2!==e.length)throw new TypeError("Input is invalid");if(!o.isCanonicalScriptSignature(e[0]))throw new TypeError("Input has invalid signature");if(!(0,a.isPoint)(e[1]))throw new TypeError("Input has invalid pubkey");if(t.signature&&!t.signature.equals(e[0]))throw new TypeError("Signature mismatch");if(t.pubkey&&!t.pubkey.equals(e[1]))throw new TypeError("Pubkey mismatch");const i=n.hash160(e[1]);if(r.length>0&&!r.equals(i))throw new TypeError("Hash mismatch")}}return Object.assign(h,t)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha1=void 0;const n=r(44),i=r(21),o=(e,t)=>e<<t|e>>>32-t>>>0,a=(e,t,r)=>e&t^e&r^t&r,s=new Uint32Array([1732584193,4023233417,2562383102,271733878,3285377520]),u=new Uint32Array(80);class c extends n.SHA2{constructor(){super(64,20,8,!1),this.A=0|s[0],this.B=0|s[1],this.C=0|s[2],this.D=0|s[3],this.E=0|s[4]}get(){const{A:e,B:t,C:r,D:n,E:i}=this;return[e,t,r,n,i]}set(e,t,r,n,i){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i}process(e,t){for(let r=0;r<16;r++,t+=4)u[r]=e.getUint32(t,!1);for(let e=16;e<80;e++)u[e]=o(u[e-3]^u[e-8]^u[e-14]^u[e-16],1);let{A:r,B:n,C:i,D:s,E:c}=this;for(let e=0;e<80;e++){let t,l;e<20?(t=(f=n)&i^~f&s,l=1518500249):e<40?(t=n^i^s,l=1859775393):e<60?(t=a(n,i,s),l=2400959708):(t=n^i^s,l=3395469782);const d=o(r,5)+t+c+l+u[e]|0;c=s,s=i,i=o(n,30),n=r,r=d}var f;r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,s=s+this.D|0,c=c+this.E|0,this.set(r,n,i,s,c)}roundClean(){u.fill(0)}destroy(){this.set(0,0,0,0,0),this.buffer.fill(0)}}t.sha1=(0,i.wrapConstructor)(()=>new c)},function(e,t,r){"use strict";var n=r(168);e.exports=function(e){function t(t){var r=t.slice(0,-4),n=t.slice(-4),i=e(r);if(!(n[0]^i[0]|n[1]^i[1]|n[2]^i[2]|n[3]^i[3]))return r}return{encode:function(t){var r=Uint8Array.from(t),i=e(r),o=r.length+4,a=new Uint8Array(o);return a.set(r,0),a.set(i.subarray(0,4),r.length),n.encode(a,o)},decode:function(e){var r=t(n.decode(e));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(e){var r=n.decodeUnsafe(e);if(r)return t(r)}}}},function(e,t,r){const n=r(169);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(e,t,r){"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var i=e.charAt(n),o=i.charCodeAt(0);if(255!==t[o])throw new TypeError(i+" is ambiguous");t[o]=n}var a=e.length,s=e.charAt(0),u=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function f(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;for(var r=0,n=0,i=0;e[r]===s;)n++,r++;for(var o=(e.length-r)*u+1>>>0,c=new Uint8Array(o);e[r];){var f=t[e.charCodeAt(r)];if(255===f)return;for(var l=0,d=o-1;(0!==f||l<i)&&-1!==d;d--,l++)f+=a*c[d]>>>0,c[d]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");i=l,r++}for(var h=o-i;h!==o&&0===c[h];)h++;for(var p=new Uint8Array(n+(o-h)),b=n;h!==o;)p[b++]=c[h++];return p}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var u=(o-i)*c+1>>>0,f=new Uint8Array(u);i!==o;){for(var l=t[i],d=0,h=u-1;(0!==l||d<n)&&-1!==h;h--,d++)l+=256*f[h]>>>0,f[h]=l%a>>>0,l=l/a>>>0;if(0!==l)throw new Error("Non-zero carry");n=d,i++}for(var p=u-n;p!==u&&0===f[p];)p++;for(var b=s.repeat(r);p<u;++p)b+=e.charAt(f[p]);return b},decodeUnsafe:f,decode:function(e){var t=f(e);if(t)return t;throw new Error("Non-base"+a+" character")}}}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.p2sh=void 0;const n=r(18),i=r(13),o=r(9),a=r(8),s=r(20),u=r(61),c=o.OPS;t.p2sh=function(t,r){if(!(t.address||t.hash||t.output||t.redeem||t.input))throw new TypeError("Not enough data");r=Object.assign({validate:!0},r||{}),(0,a.typeforce)({network:a.typeforce.maybe(a.typeforce.Object),address:a.typeforce.maybe(a.typeforce.String),hash:a.typeforce.maybe(a.typeforce.BufferN(20)),output:a.typeforce.maybe(a.typeforce.BufferN(23)),redeem:a.typeforce.maybe({network:a.typeforce.maybe(a.typeforce.Object),output:a.typeforce.maybe(a.typeforce.Buffer),input:a.typeforce.maybe(a.typeforce.Buffer),witness:a.typeforce.maybe(a.typeforce.arrayOf(a.typeforce.Buffer))}),input:a.typeforce.maybe(a.typeforce.Buffer),witness:a.typeforce.maybe(a.typeforce.arrayOf(a.typeforce.Buffer))},t);let f=t.network;f||(f=t.redeem&&t.redeem.network||i.bitcoin);const l={network:f},d=s.value(()=>{const r=e.from(u.decode(t.address));return{version:r.readUInt8(0),hash:r.slice(1)}}),h=s.value(()=>o.decompile(t.input)),p=s.value(()=>{const r=h(),n=r[r.length-1];return{network:f,output:n===c.OP_FALSE?e.from([]):n,input:o.compile(r.slice(0,-1)),witness:t.witness||[]}});if(s.prop(l,"address",()=>{if(!l.hash)return;const t=e.allocUnsafe(21);return t.writeUInt8(l.network.scriptHash,0),l.hash.copy(t,1),u.encode(t)}),s.prop(l,"hash",()=>t.output?t.output.slice(2,22):t.address?d().hash:l.redeem&&l.redeem.output?n.hash160(l.redeem.output):void 0),s.prop(l,"output",()=>{if(l.hash)return o.compile([c.OP_HASH160,l.hash,c.OP_EQUAL])}),s.prop(l,"redeem",()=>{if(t.input)return p()}),s.prop(l,"input",()=>{if(t.redeem&&t.redeem.input&&t.redeem.output)return o.compile([].concat(o.decompile(t.redeem.input),t.redeem.output))}),s.prop(l,"witness",()=>l.redeem&&l.redeem.witness?l.redeem.witness:l.input?[]:void 0),s.prop(l,"name",()=>{const e=["p2sh"];return void 0!==l.redeem&&void 0!==l.redeem.name&&e.push(l.redeem.name),e.join("-")}),r.validate){let r=e.from([]);if(t.address){if(d().version!==f.scriptHash)throw new TypeError("Invalid version or Network mismatch");if(20!==d().hash.length)throw new TypeError("Invalid address");r=d().hash}if(t.hash){if(r.length>0&&!r.equals(t.hash))throw new TypeError("Hash mismatch");r=t.hash}if(t.output){if(23!==t.output.length||t.output[0]!==c.OP_HASH160||20!==t.output[1]||t.output[22]!==c.OP_EQUAL)throw new TypeError("Output is invalid");const e=t.output.slice(2,22);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch");r=e}const i=e=>{if(e.output){const t=o.decompile(e.output);if(!t||t.length<1)throw new TypeError("Redeem.output too short");if(e.output.byteLength>520)throw new TypeError("Redeem.output unspendable if larger than 520 bytes");if(o.countNonPushOnlyOPs(t)>201)throw new TypeError("Redeem.output unspendable with more than 201 non-push ops");const i=n.hash160(e.output);if(r.length>0&&!r.equals(i))throw new TypeError("Hash mismatch");r=i}if(e.input){const t=e.input.length>0,r=e.witness&&e.witness.length>0;if(!t&&!r)throw new TypeError("Empty input");if(t&&r)throw new TypeError("Input and witness provided");if(t){const t=o.decompile(e.input);if(!o.isPushOnly(t))throw new TypeError("Non push-only scriptSig")}}};if(t.input){const t=h();if(!t||t.length<1)throw new TypeError("Input too short");if(!e.isBuffer(p().output))throw new TypeError("Input is invalid");i(p())}if(t.redeem){if(t.redeem.network&&t.redeem.network!==f)throw new TypeError("Network mismatch");if(t.input){const e=p();if(t.redeem.output&&!t.redeem.output.equals(e.output))throw new TypeError("Redeem.output mismatch");if(t.redeem.input&&!t.redeem.input.equals(e.input))throw new TypeError("Redeem.input mismatch")}i(t.redeem)}if(t.witness&&t.redeem&&t.redeem.witness&&!function(e,t){return e.length===t.length&&e.every((e,r)=>e.equals(t[r]))}(t.redeem.witness,t.witness))throw new TypeError("Witness and redeem.witness mismatch")}return Object.assign(l,t)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.p2wpkh=void 0;const n=r(18),i=r(13),o=r(9),a=r(8),s=r(20),u=r(45),c=o.OPS,f=e.alloc(0);t.p2wpkh=function(t,r){if(!(t.address||t.hash||t.output||t.pubkey||t.witness))throw new TypeError("Not enough data");r=Object.assign({validate:!0},r||{}),(0,a.typeforce)({address:a.typeforce.maybe(a.typeforce.String),hash:a.typeforce.maybe(a.typeforce.BufferN(20)),input:a.typeforce.maybe(a.typeforce.BufferN(0)),network:a.typeforce.maybe(a.typeforce.Object),output:a.typeforce.maybe(a.typeforce.BufferN(22)),pubkey:a.typeforce.maybe(a.isPoint),signature:a.typeforce.maybe(o.isCanonicalScriptSignature),witness:a.typeforce.maybe(a.typeforce.arrayOf(a.typeforce.Buffer))},t);const l=s.value(()=>{const r=u.bech32.decode(t.address),n=r.words.shift(),i=u.bech32.fromWords(r.words);return{version:n,prefix:r.prefix,data:e.from(i)}}),d=t.network||i.bitcoin,h={name:"p2wpkh",network:d};if(s.prop(h,"address",()=>{if(!h.hash)return;const e=u.bech32.toWords(h.hash);return e.unshift(0),u.bech32.encode(d.bech32,e)}),s.prop(h,"hash",()=>t.output?t.output.slice(2,22):t.address?l().data:t.pubkey||h.pubkey?n.hash160(t.pubkey||h.pubkey):void 0),s.prop(h,"output",()=>{if(h.hash)return o.compile([c.OP_0,h.hash])}),s.prop(h,"pubkey",()=>t.pubkey?t.pubkey:t.witness?t.witness[1]:void 0),s.prop(h,"signature",()=>{if(t.witness)return t.witness[0]}),s.prop(h,"input",()=>{if(h.witness)return f}),s.prop(h,"witness",()=>{if(t.pubkey&&t.signature)return[t.signature,t.pubkey]}),r.validate){let r=e.from([]);if(t.address){if(d&&d.bech32!==l().prefix)throw new TypeError("Invalid prefix or Network mismatch");if(0!==l().version)throw new TypeError("Invalid address version");if(20!==l().data.length)throw new TypeError("Invalid address data");r=l().data}if(t.hash){if(r.length>0&&!r.equals(t.hash))throw new TypeError("Hash mismatch");r=t.hash}if(t.output){if(22!==t.output.length||t.output[0]!==c.OP_0||20!==t.output[1])throw new TypeError("Output is invalid");if(r.length>0&&!r.equals(t.output.slice(2)))throw new TypeError("Hash mismatch");r=t.output.slice(2)}if(t.pubkey){const e=n.hash160(t.pubkey);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch");if(r=e,!(0,a.isPoint)(t.pubkey)||33!==t.pubkey.length)throw new TypeError("Invalid pubkey for p2wpkh")}if(t.witness){if(2!==t.witness.length)throw new TypeError("Witness is invalid");if(!o.isCanonicalScriptSignature(t.witness[0]))throw new TypeError("Witness has invalid signature");if(!(0,a.isPoint)(t.witness[1])||33!==t.witness[1].length)throw new TypeError("Witness has invalid pubkey");if(t.signature&&!t.signature.equals(t.witness[0]))throw new TypeError("Signature mismatch");if(t.pubkey&&!t.pubkey.equals(t.witness[1]))throw new TypeError("Pubkey mismatch");const e=n.hash160(t.witness[1]);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch")}}return Object.assign(h,t)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.p2wsh=void 0;const n=r(18),i=r(13),o=r(9),a=r(8),s=r(20),u=r(45),c=o.OPS,f=e.alloc(0);function l(t){return!(!e.isBuffer(t)||65!==t.length||4!==t[0]||!(0,a.isPoint)(t))}t.p2wsh=function(t,r){if(!(t.address||t.hash||t.output||t.redeem||t.witness))throw new TypeError("Not enough data");r=Object.assign({validate:!0},r||{}),(0,a.typeforce)({network:a.typeforce.maybe(a.typeforce.Object),address:a.typeforce.maybe(a.typeforce.String),hash:a.typeforce.maybe(a.typeforce.BufferN(32)),output:a.typeforce.maybe(a.typeforce.BufferN(34)),redeem:a.typeforce.maybe({input:a.typeforce.maybe(a.typeforce.Buffer),network:a.typeforce.maybe(a.typeforce.Object),output:a.typeforce.maybe(a.typeforce.Buffer),witness:a.typeforce.maybe(a.typeforce.arrayOf(a.typeforce.Buffer))}),input:a.typeforce.maybe(a.typeforce.BufferN(0)),witness:a.typeforce.maybe(a.typeforce.arrayOf(a.typeforce.Buffer))},t);const d=s.value(()=>{const r=u.bech32.decode(t.address),n=r.words.shift(),i=u.bech32.fromWords(r.words);return{version:n,prefix:r.prefix,data:e.from(i)}}),h=s.value(()=>o.decompile(t.redeem.input));let p=t.network;p||(p=t.redeem&&t.redeem.network||i.bitcoin);const b={network:p};if(s.prop(b,"address",()=>{if(!b.hash)return;const e=u.bech32.toWords(b.hash);return e.unshift(0),u.bech32.encode(p.bech32,e)}),s.prop(b,"hash",()=>t.output?t.output.slice(2):t.address?d().data:b.redeem&&b.redeem.output?n.sha256(b.redeem.output):void 0),s.prop(b,"output",()=>{if(b.hash)return o.compile([c.OP_0,b.hash])}),s.prop(b,"redeem",()=>{if(t.witness)return{output:t.witness[t.witness.length-1],input:f,witness:t.witness.slice(0,-1)}}),s.prop(b,"input",()=>{if(b.witness)return f}),s.prop(b,"witness",()=>{if(t.redeem&&t.redeem.input&&t.redeem.input.length>0&&t.redeem.output&&t.redeem.output.length>0){const e=o.toStack(h());return b.redeem=Object.assign({witness:e},t.redeem),b.redeem.input=f,[].concat(e,t.redeem.output)}if(t.redeem&&t.redeem.output&&t.redeem.witness)return[].concat(t.redeem.witness,t.redeem.output)}),s.prop(b,"name",()=>{const e=["p2wsh"];return void 0!==b.redeem&&void 0!==b.redeem.name&&e.push(b.redeem.name),e.join("-")}),r.validate){let r=e.from([]);if(t.address){if(d().prefix!==p.bech32)throw new TypeError("Invalid prefix or Network mismatch");if(0!==d().version)throw new TypeError("Invalid address version");if(32!==d().data.length)throw new TypeError("Invalid address data");r=d().data}if(t.hash){if(r.length>0&&!r.equals(t.hash))throw new TypeError("Hash mismatch");r=t.hash}if(t.output){if(34!==t.output.length||t.output[0]!==c.OP_0||32!==t.output[1])throw new TypeError("Output is invalid");const e=t.output.slice(2);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch");r=e}if(t.redeem){if(t.redeem.network&&t.redeem.network!==p)throw new TypeError("Network mismatch");if(t.redeem.input&&t.redeem.input.length>0&&t.redeem.witness&&t.redeem.witness.length>0)throw new TypeError("Ambiguous witness source");if(t.redeem.output){const e=o.decompile(t.redeem.output);if(!e||e.length<1)throw new TypeError("Redeem.output is invalid");if(t.redeem.output.byteLength>3600)throw new TypeError("Redeem.output unspendable if larger than 3600 bytes");if(o.countNonPushOnlyOPs(e)>201)throw new TypeError("Redeem.output unspendable with more than 201 non-push ops");const i=n.sha256(t.redeem.output);if(r.length>0&&!r.equals(i))throw new TypeError("Hash mismatch");r=i}if(t.redeem.input&&!o.isPushOnly(h()))throw new TypeError("Non push-only scriptSig");if(t.witness&&t.redeem.witness&&!function(e,t){return e.length===t.length&&e.every((e,r)=>e.equals(t[r]))}(t.witness,t.redeem.witness))throw new TypeError("Witness and redeem.witness mismatch");if(t.redeem.input&&h().some(l)||t.redeem.output&&(o.decompile(t.redeem.output)||[]).some(l))throw new TypeError("redeem.input or redeem.output contains uncompressed pubkey")}if(t.witness&&t.witness.length>0){const e=t.witness[t.witness.length-1];if(t.redeem&&t.redeem.output&&!t.redeem.output.equals(e))throw new TypeError("Witness and redeem.output mismatch");if(t.witness.some(l)||(o.decompile(e)||[]).some(l))throw new TypeError("Witness contains uncompressed pubkey")}}return Object.assign(b,t)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.p2tr=void 0;const n=r(0),i=r(13),o=r(9),a=r(8),s=r(62),u=r(63),c=r(20),f=r(45),l=o.OPS;t.p2tr=function(e,t){if(!(e.address||e.output||e.pubkey||e.internalPubkey||e.witness&&e.witness.length>1))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),(0,a.typeforce)({address:a.typeforce.maybe(a.typeforce.String),input:a.typeforce.maybe(a.typeforce.BufferN(0)),network:a.typeforce.maybe(a.typeforce.Object),output:a.typeforce.maybe(a.typeforce.BufferN(34)),internalPubkey:a.typeforce.maybe(a.typeforce.BufferN(32)),hash:a.typeforce.maybe(a.typeforce.BufferN(32)),pubkey:a.typeforce.maybe(a.typeforce.BufferN(32)),signature:a.typeforce.maybe(a.typeforce.anyOf(a.typeforce.BufferN(64),a.typeforce.BufferN(65))),witness:a.typeforce.maybe(a.typeforce.arrayOf(a.typeforce.Buffer)),scriptTree:a.typeforce.maybe(a.isTaptree),redeem:a.typeforce.maybe({output:a.typeforce.maybe(a.typeforce.Buffer),redeemVersion:a.typeforce.maybe(a.typeforce.Number),witness:a.typeforce.maybe(a.typeforce.arrayOf(a.typeforce.Buffer))}),redeemVersion:a.typeforce.maybe(a.typeforce.Number)},e);const r=c.value(()=>{const t=f.bech32m.decode(e.address),r=t.words.shift(),i=f.bech32m.fromWords(t.words);return{version:r,prefix:t.prefix,data:n.Buffer.from(i)}}),d=c.value(()=>{if(e.witness&&e.witness.length)return e.witness.length>=2&&80===e.witness[e.witness.length-1][0]?e.witness.slice(0,-1):e.witness.slice()}),h=c.value(()=>e.scriptTree?(0,u.toHashTree)(e.scriptTree):e.hash?{hash:e.hash}:void 0),p=e.network||i.bitcoin,b={name:"p2tr",network:p};if(c.prop(b,"address",()=>{if(!b.pubkey)return;const e=f.bech32m.toWords(b.pubkey);return e.unshift(1),f.bech32m.encode(p.bech32,e)}),c.prop(b,"hash",()=>{const e=h();if(e)return e.hash;const t=d();if(t&&t.length>1){const e=t[t.length-1],r=e[0]&a.TAPLEAF_VERSION_MASK,n=t[t.length-2],i=(0,u.tapleafHash)({output:n,version:r});return(0,u.rootHashFromPath)(e,i)}return null}),c.prop(b,"output",()=>{if(b.pubkey)return o.compile([l.OP_1,b.pubkey])}),c.prop(b,"redeemVersion",()=>e.redeemVersion?e.redeemVersion:e.redeem&&void 0!==e.redeem.redeemVersion&&null!==e.redeem.redeemVersion?e.redeem.redeemVersion:u.LEAF_VERSION_TAPSCRIPT),c.prop(b,"redeem",()=>{const e=d();if(e&&!(e.length<2))return{output:e[e.length-2],witness:e.slice(0,-2),redeemVersion:e[e.length-1][0]&a.TAPLEAF_VERSION_MASK}}),c.prop(b,"pubkey",()=>{if(e.pubkey)return e.pubkey;if(e.output)return e.output.slice(2);if(e.address)return r().data;if(b.internalPubkey){const e=(0,u.tweakKey)(b.internalPubkey,b.hash);if(e)return e.x}}),c.prop(b,"internalPubkey",()=>{if(e.internalPubkey)return e.internalPubkey;const t=d();return t&&t.length>1?t[t.length-1].slice(1,33):void 0}),c.prop(b,"signature",()=>{if(e.signature)return e.signature;const t=d();return t&&1===t.length?t[0]:void 0}),c.prop(b,"witness",()=>{if(e.witness)return e.witness;const t=h();if(t&&e.redeem&&e.redeem.output&&e.internalPubkey){const r=(0,u.tapleafHash)({output:e.redeem.output,version:b.redeemVersion}),i=(0,u.findScriptPath)(t,r);if(!i)return;const o=(0,u.tweakKey)(e.internalPubkey,t.hash);if(!o)return;const a=n.Buffer.concat([n.Buffer.from([b.redeemVersion|o.parity]),e.internalPubkey].concat(i));return[e.redeem.output,a]}return e.signature?[e.signature]:void 0}),t.validate){let t=n.Buffer.from([]);if(e.address){if(p&&p.bech32!==r().prefix)throw new TypeError("Invalid prefix or Network mismatch");if(1!==r().version)throw new TypeError("Invalid address version");if(32!==r().data.length)throw new TypeError("Invalid address data");t=r().data}if(e.pubkey){if(t.length>0&&!t.equals(e.pubkey))throw new TypeError("Pubkey mismatch");t=e.pubkey}if(e.output){if(34!==e.output.length||e.output[0]!==l.OP_1||32!==e.output[1])throw new TypeError("Output is invalid");if(t.length>0&&!t.equals(e.output.slice(2)))throw new TypeError("Pubkey mismatch");t=e.output.slice(2)}if(e.internalPubkey){const r=(0,u.tweakKey)(e.internalPubkey,b.hash);if(t.length>0&&!t.equals(r.x))throw new TypeError("Pubkey mismatch");t=r.x}if(t&&t.length&&!(0,s.getEccLib)().isXOnlyPoint(t))throw new TypeError("Invalid pubkey for p2tr");const i=h();if(e.hash&&i&&!e.hash.equals(i.hash))throw new TypeError("Hash mismatch");if(e.redeem&&e.redeem.output&&i){const t=(0,u.tapleafHash)({output:e.redeem.output,version:b.redeemVersion});if(!(0,u.findScriptPath)(i,t))throw new TypeError("Redeem script not in tree")}const c=d();if(e.redeem&&b.redeem){if(e.redeem.redeemVersion&&e.redeem.redeemVersion!==b.redeem.redeemVersion)throw new TypeError("Redeem.redeemVersion and witness mismatch");if(e.redeem.output){if(0===o.decompile(e.redeem.output).length)throw new TypeError("Redeem.output is invalid");if(b.redeem.output&&!e.redeem.output.equals(b.redeem.output))throw new TypeError("Redeem.output and witness mismatch")}if(e.redeem.witness&&b.redeem.witness&&!function(e,t){return e.length===t.length&&e.every((e,r)=>e.equals(t[r]))}(e.redeem.witness,b.redeem.witness))throw new TypeError("Redeem.witness and witness mismatch")}if(c&&c.length)if(1===c.length){if(e.signature&&!e.signature.equals(c[0]))throw new TypeError("Signature mismatch")}else{const r=c[c.length-1];if(r.length<33)throw new TypeError(`The control-block length is too small. Got ${r.length}, expected min 33.`);if((r.length-33)%32!=0)throw new TypeError(`The control-block length of ${r.length} is incorrect!`);const n=(r.length-33)/32;if(n>128)throw new TypeError(`The script path is too long. Got ${n}, expected max 128.`);const i=r.slice(1,33);if(e.internalPubkey&&!e.internalPubkey.equals(i))throw new TypeError("Internal pubkey mismatch");if(!(0,s.getEccLib)().isXOnlyPoint(i))throw new TypeError("Invalid internalPubkey for p2tr witness");const o=r[0]&a.TAPLEAF_VERSION_MASK,f=c[c.length-2],l=(0,u.tapleafHash)({output:f,version:o}),d=(0,u.rootHashFromPath)(r,l),h=(0,u.tweakKey)(i,d);if(!h)throw new TypeError("Invalid outputKey for p2tr witness");if(t.length&&!t.equals(h.x))throw new TypeError("Pubkey mismatch for p2tr witness");if(h.parity!==(1&r[0]))throw new Error("Incorrect parity")}}return Object.assign(b,e)}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.Block=void 0;const n=r(46),i=r(18),o=r(175),a=r(38),s=r(8),{typeforce:u}=s,c=new TypeError("Cannot compute merkle root for zero transactions"),f=new TypeError("Cannot compute witness commit for non-segwit block");class l{constructor(){this.version=1,this.prevHash=void 0,this.merkleRoot=void 0,this.timestamp=0,this.witnessCommit=void 0,this.bits=0,this.nonce=0,this.transactions=void 0}static fromBuffer(e){if(e.length<80)throw new Error("Buffer too small (< 80 bytes)");const t=new n.BufferReader(e),r=new l;if(r.version=t.readInt32(),r.prevHash=t.readSlice(32),r.merkleRoot=t.readSlice(32),r.timestamp=t.readUInt32(),r.bits=t.readUInt32(),r.nonce=t.readUInt32(),80===e.length)return r;const i=()=>{const e=a.Transaction.fromBuffer(t.buffer.slice(t.offset),!0);return t.offset+=e.byteLength(),e},o=t.readVarInt();r.transactions=[];for(let e=0;e<o;++e){const e=i();r.transactions.push(e)}const s=r.getWitnessCommit();return s&&(r.witnessCommit=s),r}static fromHex(t){return l.fromBuffer(e.from(t,"hex"))}static calculateTarget(t){const r=((4278190080&t)>>24)-3,n=8388607&t,i=e.alloc(32,0);return i.writeUIntBE(n,29-r,3),i}static calculateMerkleRoot(t,r){if(u([{getHash:s.Function}],t),0===t.length)throw c;if(r&&!d(t))throw f;const n=t.map(e=>e.getHash(r)),a=(0,o.fastMerkleRoot)(n,i.hash256);return r?i.hash256(e.concat([a,t[0].ins[0].witness[0]])):a}getWitnessCommit(){if(!d(this.transactions))return null;const t=this.transactions[0].outs.filter(t=>t.script.slice(0,6).equals(e.from("6a24aa21a9ed","hex"))).map(e=>e.script.slice(6,38));if(0===t.length)return null;const r=t[t.length-1];return r instanceof e&&32===r.length?r:null}hasWitnessCommit(){return this.witnessCommit instanceof e&&32===this.witnessCommit.length||null!==this.getWitnessCommit()}hasWitness(){return(e=this.transactions)instanceof Array&&e.some(e=>"object"==typeof e&&e.ins instanceof Array&&e.ins.some(e=>"object"==typeof e&&e.witness instanceof Array&&e.witness.length>0));var e}weight(){return 3*this.byteLength(!1,!1)+this.byteLength(!1,!0)}byteLength(e,t=!0){return e||!this.transactions?80:80+n.varuint.encodingLength(this.transactions.length)+this.transactions.reduce((e,r)=>e+r.byteLength(t),0)}getHash(){return i.hash256(this.toBuffer(!0))}getId(){return(0,n.reverseBuffer)(this.getHash()).toString("hex")}getUTCDate(){const e=new Date(0);return e.setUTCSeconds(this.timestamp),e}toBuffer(t){const r=e.allocUnsafe(this.byteLength(t)),i=new n.BufferWriter(r);return i.writeInt32(this.version),i.writeSlice(this.prevHash),i.writeSlice(this.merkleRoot),i.writeUInt32(this.timestamp),i.writeUInt32(this.bits),i.writeUInt32(this.nonce),t||!this.transactions||(n.varuint.encode(this.transactions.length,r,i.offset),i.offset+=n.varuint.encode.bytes,this.transactions.forEach(e=>{const t=e.byteLength();e.toBuffer(r,i.offset),i.offset+=t})),r}toHex(e){return this.toBuffer(e).toString("hex")}checkTxRoots(){const e=this.hasWitnessCommit();return!(!e&&this.hasWitness())&&(this.__checkMerkleRoot()&&(!e||this.__checkWitnessCommit()))}checkProofOfWork(){const e=(0,n.reverseBuffer)(this.getHash()),t=l.calculateTarget(this.bits);return e.compare(t)<=0}__checkMerkleRoot(){if(!this.transactions)throw c;const e=l.calculateMerkleRoot(this.transactions);return 0===this.merkleRoot.compare(e)}__checkWitnessCommit(){if(!this.transactions)throw c;if(!this.hasWitnessCommit())throw f;const e=l.calculateMerkleRoot(this.transactions,!0);return 0===this.witnessCommit.compare(e)}}function d(e){return e instanceof Array&&e[0]&&e[0].ins&&e[0].ins instanceof Array&&e[0].ins[0]&&e[0].ins[0].witness&&e[0].ins[0].witness instanceof Array&&e[0].ins[0].witness.length>0}t.Block=l}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.fastMerkleRoot=void 0,t.fastMerkleRoot=function(t,r){if(!Array.isArray(t))throw TypeError("Expected values Array");if("function"!=typeof r)throw TypeError("Expected digest Function");let n=t.length;const i=t.concat();for(;n>1;){let t=0;for(let o=0;o<n;o+=2,++t){const a=i[o],s=o+1===n?a:i[o+1],u=e.concat([a,s]);i[t]=r(u)}n=t}return i[0]}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.Psbt=void 0;const n=r(93),i=r(22),o=r(66),a=r(89),s=r(46),u=r(13),c=r(36),f=r(63),l=r(9),d=r(38),h=r(199),p=r(67),b={network:u.bitcoin,maximumFeeRate:5e3};class m{static fromBase64(t,r={}){const n=e.from(t,"base64");return this.fromBuffer(n,r)}static fromHex(t,r={}){const n=e.from(t,"hex");return this.fromBuffer(n,r)}static fromBuffer(e,t={}){const r=n.Psbt.fromBuffer(e,g),i=new m(t,r);var o,a;return o=i.__CACHE.__TX,a=i.__CACHE,o.ins.forEach(e=>{T(a,e)}),i}constructor(e={},t=new n.Psbt(new y)){this.data=t,this.opts=Object.assign({},b,e),this.__CACHE={__NON_WITNESS_UTXO_TX_CACHE:[],__NON_WITNESS_UTXO_BUF_CACHE:[],__TX_IN_CACHE:{},__TX:this.data.globalMap.unsignedTx.tx,__UNSAFE_SIGN_NONSEGWIT:!1},0===this.data.inputs.length&&this.setVersion(2);const r=(e,t,r,n)=>Object.defineProperty(e,t,{enumerable:r,writable:n});r(this,"__CACHE",!1,!0),r(this,"opts",!1,!0)}get inputCount(){return this.data.inputs.length}get version(){return this.__CACHE.__TX.version}set version(e){this.setVersion(e)}get locktime(){return this.__CACHE.__TX.locktime}set locktime(e){this.setLocktime(e)}get txInputs(){return this.__CACHE.__TX.ins.map(e=>({hash:(0,s.cloneBuffer)(e.hash),index:e.index,sequence:e.sequence}))}get txOutputs(){return this.__CACHE.__TX.outs.map(e=>{let t;try{t=(0,a.fromOutputScript)(e.script,this.opts.network)}catch(e){}return{script:(0,s.cloneBuffer)(e.script),value:e.value,address:t}})}combine(...e){return this.data.combine(...e.map(e=>e.data)),this}clone(){const e=m.fromBuffer(this.data.toBuffer());return e.opts=JSON.parse(JSON.stringify(this.opts)),e}setMaximumFeeRate(e){k(e),this.opts.maximumFeeRate=e}setVersion(e){k(e),S(this.data.inputs,"setVersion");const t=this.__CACHE;return t.__TX.version=e,t.__EXTRACTED_TX=void 0,this}setLocktime(e){k(e),S(this.data.inputs,"setLocktime");const t=this.__CACHE;return t.__TX.locktime=e,t.__EXTRACTED_TX=void 0,this}setInputSequence(e,t){k(t),S(this.data.inputs,"setInputSequence");const r=this.__CACHE;if(r.__TX.ins.length<=e)throw new Error("Input index too high");return r.__TX.ins[e].sequence=t,r.__EXTRACTED_TX=void 0,this}addInputs(e){return e.forEach(e=>this.addInput(e)),this}addInput(e){if(arguments.length>1||!e||void 0===e.hash||void 0===e.index)throw new Error("Invalid arguments for Psbt.addInput. Requires single object with at least [hash] and [index]");(0,h.checkTaprootInputFields)(e,e,"addInput"),S(this.data.inputs,"addInput"),e.witnessScript&&G(e.witnessScript);const t=this.__CACHE;this.data.addInput(e);T(t,t.__TX.ins[t.__TX.ins.length-1]);const r=this.data.inputs.length-1,n=this.data.inputs[r];return n.nonWitnessUtxo&&L(this.__CACHE,n,r),t.__FEE=void 0,t.__FEE_RATE=void 0,t.__EXTRACTED_TX=void 0,this}addOutputs(e){return e.forEach(e=>this.addOutput(e)),this}addOutput(e){if(arguments.length>1||!e||void 0===e.value||void 0===e.address&&void 0===e.script)throw new Error("Invalid arguments for Psbt.addOutput. Requires single object with at least [script or address] and [value]");S(this.data.inputs,"addOutput");const{address:t}=e;if("string"==typeof t){const{network:r}=this.opts,n=(0,a.toOutputScript)(t,r);e=Object.assign(e,{script:n})}(0,h.checkTaprootOutputFields)(e,e,"addOutput");const r=this.__CACHE;return this.data.addOutput(e),r.__FEE=void 0,r.__FEE_RATE=void 0,r.__EXTRACTED_TX=void 0,this}extractTransaction(e){if(!this.data.inputs.every(_))throw new Error("Not finalized");const t=this.__CACHE;if(e||function(e,t,r){const n=t.__FEE_RATE||e.getFeeRate(),i=t.__EXTRACTED_TX.virtualSize(),o=n*i;if(n>=r.maximumFeeRate)throw new Error(`Warning: You are paying around ${(o/1e8).toFixed(8)} in fees, which is ${n} satoshi per byte for a transaction with a VSize of ${i} bytes (segwit counted as 0.25 byte per byte). Use setMaximumFeeRate method to raise your threshold, or pass true to the first arg of extractTransaction.`)}(this,t,this.opts),t.__EXTRACTED_TX)return t.__EXTRACTED_TX;const r=t.__TX.clone();return D(this.data.inputs,r,t,!0),r}getFeeRate(){return I("__FEE_RATE","fee rate",this.data.inputs,this.__CACHE)}getFee(){return I("__FEE","fee",this.data.inputs,this.__CACHE)}finalizeAllInputs(){return(0,o.checkForInput)(this.data.inputs,0),Y(this.data.inputs.length).forEach(e=>this.finalizeInput(e)),this}finalizeInput(e,t){const r=(0,o.checkForInput)(this.data.inputs,e);return(0,h.isTaprootInput)(r)?this._finalizeTaprootInput(e,r,void 0,t):this._finalizeInput(e,r,t)}finalizeTaprootInput(e,t,r=h.tapScriptFinalizer){const n=(0,o.checkForInput)(this.data.inputs,e);if((0,h.isTaprootInput)(n))return this._finalizeTaprootInput(e,n,t,r);throw new Error(`Cannot finalize input #${e}. Not Taproot.`)}_finalizeInput(e,t,r=B){const{script:n,isP2SH:i,isP2WSH:o,isSegwit:a}=function(e,t,r){const n=r.__TX,i={script:null,isSegwit:!1,isP2SH:!1,isP2WSH:!1};if(i.isP2SH=!!t.redeemScript,i.isP2WSH=!!t.witnessScript,t.witnessScript)i.script=t.witnessScript;else if(t.redeemScript)i.script=t.redeemScript;else if(t.nonWitnessUtxo){const o=F(r,t,e),a=n.ins[e].index;i.script=o.outs[a].script}else t.witnessUtxo&&(i.script=t.witnessUtxo.script);(t.witnessScript||(0,p.isP2WPKH)(i.script))&&(i.isSegwit=!0);return i}(e,t,this.__CACHE);if(!n)throw new Error("No script found for input #"+e);!function(e){if(!e.sighashType||!e.partialSig)return;const{partialSig:t,sighashType:r}=e;t.forEach(e=>{const{hashType:t}=l.signature.decode(e.signature);if(r!==t)throw new Error("Signature sighash does not match input sighash type")})}(t);const{finalScriptSig:s,finalScriptWitness:u}=r(e,t,n,a,i,o);if(s&&this.data.updateInput(e,{finalScriptSig:s}),u&&this.data.updateInput(e,{finalScriptWitness:u}),!s&&!u)throw new Error("Unknown error finalizing input #"+e);return this.data.clearFinalizedInput(e),this}_finalizeTaprootInput(e,t,r,n=h.tapScriptFinalizer){if(!t.witnessUtxo)throw new Error(`Cannot finalize input #${e}. Missing withness utxo.`);if(t.tapKeySig){const r=c.p2tr({output:t.witnessUtxo.script,signature:t.tapKeySig}),n=(0,p.witnessStackToScriptWitness)(r.witness);this.data.updateInput(e,{finalScriptWitness:n})}else{const{finalScriptWitness:i}=n(e,t,r);this.data.updateInput(e,{finalScriptWitness:i})}return this.data.clearFinalizedInput(e),this}getInputType(t){const r=(0,o.checkForInput)(this.data.inputs,t),n=V(q(t,r,this.__CACHE),t,"input",r.redeemScript||function(t){if(!t)return;const r=l.decompile(t);if(!r)return;const n=r[r.length-1];if(!e.isBuffer(n)||W(n)||(i=n,l.isCanonicalScriptSignature(i)))return;var i;if(!l.decompile(n))return;return n}(r.finalScriptSig),r.witnessScript||function(e){if(!e)return;const t=z(e),r=t[t.length-1];if(W(r))return;if(!l.decompile(r))return;return r}(r.finalScriptWitness));return("raw"===n.type?"":n.type+"-")+X(n.meaningfulScript)}inputHasPubkey(e,t){return function(e,t,r,n){const i=q(r,t,n),{meaningfulScript:o}=V(i,r,"input",t.redeemScript,t.witnessScript);return(0,p.pubkeyInScript)(e,o)}(t,(0,o.checkForInput)(this.data.inputs,e),e,this.__CACHE)}inputHasHDKey(e,t){const r=(0,o.checkForInput)(this.data.inputs,e),n=E(t);return!!r.bip32Derivation&&r.bip32Derivation.some(n)}outputHasPubkey(e,t){return function(e,t,r,n){const i=n.__TX.outs[r].script,{meaningfulScript:o}=V(i,r,"output",t.redeemScript,t.witnessScript);return(0,p.pubkeyInScript)(e,o)}(t,(0,o.checkForOutput)(this.data.outputs,e),e,this.__CACHE)}outputHasHDKey(e,t){const r=(0,o.checkForOutput)(this.data.outputs,e),n=E(t);return!!r.bip32Derivation&&r.bip32Derivation.some(n)}validateSignaturesOfAllInputs(e){(0,o.checkForInput)(this.data.inputs,0);return Y(this.data.inputs.length).map(t=>this.validateSignaturesOfInput(t,e)).reduce((e,t)=>!0===t&&e,!0)}validateSignaturesOfInput(e,t,r){const n=this.data.inputs[e];return(0,h.isTaprootInput)(n)?this.validateSignaturesOfTaprootInput(e,t,r):this._validateSignaturesOfInput(e,t,r)}_validateSignaturesOfInput(e,t,r){const n=this.data.inputs[e],i=(n||{}).partialSig;if(!n||!i||i.length<1)throw new Error("No signatures to validate");if("function"!=typeof t)throw new Error("Need validator function to validate signatures");const o=r?i.filter(e=>e.pubkey.equals(r)):i;if(o.length<1)throw new Error("No signatures for this pubkey");const a=[];let s,u,c;for(const r of o){const i=l.signature.decode(r.signature),{hash:o,script:f}=c!==i.hashType?R(e,Object.assign({},n,{sighashType:i.hashType}),this.__CACHE,!0):{hash:s,script:u};c=i.hashType,s=o,u=f,x(r.pubkey,f,"verify"),a.push(t(r.pubkey,o,i.signature))}return a.every(e=>!0===e)}validateSignaturesOfTaprootInput(e,t,r){const n=this.data.inputs[e],i=(n||{}).tapKeySig,o=(n||{}).tapScriptSig;if(!n&&!i&&(!o||o.length))throw new Error("No signatures to validate");if("function"!=typeof t)throw new Error("Need validator function to validate signatures");const a=(r=r&&(0,h.toXOnly)(r))?U(e,n,this.data.inputs,r,this.__CACHE):function(e,t,r,n){const i=[];if(t.tapInternalKey){const r=N(e,t,n);r&&i.push(r)}if(t.tapScriptSig){const e=t.tapScriptSig.map(e=>e.pubkey);i.push(...e)}return i.map(i=>U(e,t,r,i,n)).flat()}(e,n,this.data.inputs,this.__CACHE);if(!a.length)throw new Error("No signatures for this pubkey");const s=a.find(e=>!e.leafHash);let u=0;if(i&&s){if(!t(s.pubkey,s.hash,j(i)))return!1;u++}if(o)for(const e of o){const r=a.find(t=>e.pubkey.equals(t.pubkey));if(r){if(!t(e.pubkey,r.hash,j(e.signature)))return!1;u++}}return u>0}signAllInputsHD(e,t=[d.Transaction.SIGHASH_ALL]){if(!e||!e.publicKey||!e.fingerprint)throw new Error("Need HDSigner to sign input");const r=[];for(const n of Y(this.data.inputs.length))try{this.signInputHD(n,e,t),r.push(!0)}catch(e){r.push(!1)}if(r.every(e=>!1===e))throw new Error("No inputs were signed");return this}signAllInputsHDAsync(e,t=[d.Transaction.SIGHASH_ALL]){return new Promise((r,n)=>{if(!e||!e.publicKey||!e.fingerprint)return n(new Error("Need HDSigner to sign input"));const i=[],o=[];for(const r of Y(this.data.inputs.length))o.push(this.signInputHDAsync(r,e,t).then(()=>{i.push(!0)},()=>{i.push(!1)}));return Promise.all(o).then(()=>{if(i.every(e=>!1===e))return n(new Error("No inputs were signed"));r()})})}signInputHD(e,t,r=[d.Transaction.SIGHASH_ALL]){if(!t||!t.publicKey||!t.fingerprint)throw new Error("Need HDSigner to sign input");return H(e,this.data.inputs,t).forEach(t=>this.signInput(e,t,r)),this}signInputHDAsync(e,t,r=[d.Transaction.SIGHASH_ALL]){return new Promise((n,i)=>{if(!t||!t.publicKey||!t.fingerprint)return i(new Error("Need HDSigner to sign input"));const o=H(e,this.data.inputs,t).map(t=>this.signInputAsync(e,t,r));return Promise.all(o).then(()=>{n()}).catch(i)})}signAllInputs(e,t){if(!e||!e.publicKey)throw new Error("Need Signer to sign input");const r=[];for(const n of Y(this.data.inputs.length))try{this.signInput(n,e,t),r.push(!0)}catch(e){r.push(!1)}if(r.every(e=>!1===e))throw new Error("No inputs were signed");return this}signAllInputsAsync(e,t){return new Promise((r,n)=>{if(!e||!e.publicKey)return n(new Error("Need Signer to sign input"));const i=[],o=[];for(const[r]of this.data.inputs.entries())o.push(this.signInputAsync(r,e,t).then(()=>{i.push(!0)},()=>{i.push(!1)}));return Promise.all(o).then(()=>{if(i.every(e=>!1===e))return n(new Error("No inputs were signed"));r()})})}signInput(e,t,r){if(!t||!t.publicKey)throw new Error("Need Signer to sign input");const n=(0,o.checkForInput)(this.data.inputs,e);return(0,h.isTaprootInput)(n)?this._signTaprootInput(e,n,t,void 0,r):this._signInput(e,t,r)}signTaprootInput(e,t,r,n){if(!t||!t.publicKey)throw new Error("Need Signer to sign input");const i=(0,o.checkForInput)(this.data.inputs,e);if((0,h.isTaprootInput)(i))return this._signTaprootInput(e,i,t,r,n);throw new Error(`Input #${e} is not of type Taproot.`)}_signInput(e,t,r=[d.Transaction.SIGHASH_ALL]){const{hash:n,sighashType:i}=M(this.data.inputs,e,t.publicKey,this.__CACHE,r),o=[{pubkey:t.publicKey,signature:l.signature.encode(t.sign(n),i)}];return this.data.updateInput(e,{partialSig:o}),this}_signTaprootInput(e,t,r,n,i=[d.Transaction.SIGHASH_DEFAULT]){const o=this.checkTaprootHashesForSig(e,t,r,n,i),a=o.filter(e=>!e.leafHash).map(e=>(0,h.serializeTaprootSignature)(r.signSchnorr(e.hash),t.sighashType))[0],s=o.filter(e=>!!e.leafHash).map(e=>({pubkey:(0,h.toXOnly)(r.publicKey),signature:(0,h.serializeTaprootSignature)(r.signSchnorr(e.hash),t.sighashType),leafHash:e.leafHash}));return a&&this.data.updateInput(e,{tapKeySig:a}),s.length&&this.data.updateInput(e,{tapScriptSig:s}),this}signInputAsync(e,t,r){return Promise.resolve().then(()=>{if(!t||!t.publicKey)throw new Error("Need Signer to sign input");const n=(0,o.checkForInput)(this.data.inputs,e);return(0,h.isTaprootInput)(n)?this._signTaprootInputAsync(e,n,t,void 0,r):this._signInputAsync(e,t,r)})}signTaprootInputAsync(e,t,r,n){return Promise.resolve().then(()=>{if(!t||!t.publicKey)throw new Error("Need Signer to sign input");const i=(0,o.checkForInput)(this.data.inputs,e);if((0,h.isTaprootInput)(i))return this._signTaprootInputAsync(e,i,t,r,n);throw new Error(`Input #${e} is not of type Taproot.`)})}_signInputAsync(e,t,r=[d.Transaction.SIGHASH_ALL]){const{hash:n,sighashType:i}=M(this.data.inputs,e,t.publicKey,this.__CACHE,r);return Promise.resolve(t.sign(n)).then(r=>{const n=[{pubkey:t.publicKey,signature:l.signature.encode(r,i)}];this.data.updateInput(e,{partialSig:n})})}async _signTaprootInputAsync(e,t,r,n,i=[d.Transaction.SIGHASH_DEFAULT]){const o=this.checkTaprootHashesForSig(e,t,r,n,i),a=[],s=o.filter(e=>!e.leafHash)[0];if(s){const e=Promise.resolve(r.signSchnorr(s.hash)).then(e=>({tapKeySig:(0,h.serializeTaprootSignature)(e,t.sighashType)}));a.push(e)}const u=o.filter(e=>!!e.leafHash);if(u.length){const e=u.map(e=>Promise.resolve(r.signSchnorr(e.hash)).then(n=>({tapScriptSig:[{pubkey:(0,h.toXOnly)(r.publicKey),signature:(0,h.serializeTaprootSignature)(n,t.sighashType),leafHash:e.leafHash}]})));a.push(...e)}return Promise.all(a).then(t=>{t.forEach(t=>this.data.updateInput(e,t))})}checkTaprootHashesForSig(e,t,r,n,i){if("function"!=typeof r.signSchnorr)throw new Error(`Need Schnorr Signer to sign taproot input #${e}.`);const o=U(e,t,this.data.inputs,r.publicKey,this.__CACHE,n,i);if(!o||!o.length)throw new Error(`Can not sign for input #${e} with the key ${r.publicKey.toString("hex")}`);return o}toBuffer(){return v(this.__CACHE),this.data.toBuffer()}toHex(){return v(this.__CACHE),this.data.toHex()}toBase64(){return v(this.__CACHE),this.data.toBase64()}updateGlobal(e){return this.data.updateGlobal(e),this}updateInput(e,t){return t.witnessScript&&G(t.witnessScript),(0,h.checkTaprootInputFields)(this.data.inputs[e],t,"updateInput"),this.data.updateInput(e,t),t.nonWitnessUtxo&&L(this.__CACHE,this.data.inputs[e],e),this}updateOutput(e,t){const r=this.data.outputs[e];return(0,h.checkTaprootOutputFields)(r,t,"updateOutput"),this.data.updateOutput(e,t),this}addUnknownKeyValToGlobal(e){return this.data.addUnknownKeyValToGlobal(e),this}addUnknownKeyValToInput(e,t){return this.data.addUnknownKeyValToInput(e,t),this}addUnknownKeyValToOutput(e,t){return this.data.addUnknownKeyValToOutput(e,t),this}clearFinalizedInput(e){return this.data.clearFinalizedInput(e),this}}t.Psbt=m;const g=e=>new y(e);class y{constructor(t=e.from([2,0,0,0,0,0,0,0,0,0])){this.tx=d.Transaction.fromBuffer(t),function(e){if(!e.ins.every(e=>e.script&&0===e.script.length&&e.witness&&0===e.witness.length))throw new Error("Format Error: Transaction ScriptSigs are not empty")}(this.tx),Object.defineProperty(this,"tx",{enumerable:!1,writable:!0})}getInputOutputCounts(){return{inputCount:this.tx.ins.length,outputCount:this.tx.outs.length}}addInput(t){if(void 0===t.hash||void 0===t.index||!e.isBuffer(t.hash)&&"string"!=typeof t.hash||"number"!=typeof t.index)throw new Error("Error adding input.");const r="string"==typeof t.hash?(0,s.reverseBuffer)(e.from(t.hash,"hex")):t.hash;this.tx.addInput(r,t.index,t.sequence)}addOutput(t){if(void 0===t.script||void 0===t.value||!e.isBuffer(t.script)||"number"!=typeof t.value)throw new Error("Error adding output.");this.tx.addOutput(t.script,t.value)}toBuffer(){return this.tx.toBuffer()}}function v(e){if(!1!==e.__UNSAFE_SIGN_NONSEGWIT)throw new Error("Not BIP174 compliant, can not export")}function w(e,t,r){if(!t)return!1;let n;if(n=r?r.map(e=>{const r=function(e){if(65===e.length){const t=1&e[64],r=e.slice(0,33);return r[0]=2|t,r}return e.slice()}(e);return t.find(e=>e.pubkey.equals(r))}).filter(e=>!!e):t,n.length>e)throw new Error("Too many signatures");return n.length===e}function _(e){return!!e.finalScriptSig||!!e.finalScriptWitness}function E(e){return t=>!!t.masterFingerprint.equals(e.fingerprint)&&!!e.derivePath(t.path).publicKey.equals(t.pubkey)}function k(e){if("number"!=typeof e||e!==Math.floor(e)||e>4294967295||e<0)throw new Error("Invalid 32 bit integer")}function S(e,t){e.forEach(e=>{if((0,h.isTaprootInput)(e)?(0,h.checkTaprootInputForSigs)(e,t):(0,p.checkInputForSig)(e,t))throw new Error("Can not modify transaction, signatures exist.")})}function x(e,t,r){if(!(0,p.pubkeyInScript)(e,t))throw new Error(`Can not ${r} for this input with the key ${e.toString("hex")}`)}function T(t,r){const n=(0,s.reverseBuffer)(e.from(r.hash)).toString("hex")+":"+r.index;if(t.__TX_IN_CACHE[n])throw new Error("Duplicate input detected.");t.__TX_IN_CACHE[n]=1}function A(e,t){return(r,n,i,o)=>{const a=e({redeem:{output:i}}).output;if(!n.equals(a))throw new Error(`${t} for ${o} #${r} doesn't match the scriptPubKey in the prevout`)}}const P=A(c.p2sh,"Redeem script"),O=A(c.p2wsh,"Witness script");function I(e,t,r,n){if(!r.every(_))throw new Error("PSBT must be finalized to calculate "+t);if("__FEE_RATE"===e&&n.__FEE_RATE)return n.__FEE_RATE;if("__FEE"===e&&n.__FEE)return n.__FEE;let i,o=!0;return n.__EXTRACTED_TX?(i=n.__EXTRACTED_TX,o=!1):i=n.__TX.clone(),D(r,i,n,o),"__FEE_RATE"===e?n.__FEE_RATE:"__FEE"===e?n.__FEE:void 0}function B(e,t,r,n,i,o){const a=X(r);if(!function(e,t,r){switch(r){case"pubkey":case"pubkeyhash":case"witnesspubkeyhash":return w(1,e.partialSig);case"multisig":const r=c.p2ms({output:t});return w(r.m,e.partialSig,r.pubkeys);default:return!1}}(t,r,a))throw new Error("Can not finalize input #"+e);return function(e,t,r,n,i,o){let a,s;const u=function(e,t,r){let n;switch(t){case"multisig":const t=function(e,t){return c.p2ms({output:e}).pubkeys.map(e=>(t.filter(t=>t.pubkey.equals(e))[0]||{}).signature).filter(e=>!!e)}(e,r);n=c.p2ms({output:e,signatures:t});break;case"pubkey":n=c.p2pk({output:e,signature:r[0].signature});break;case"pubkeyhash":n=c.p2pkh({output:e,pubkey:r[0].pubkey,signature:r[0].signature});break;case"witnesspubkeyhash":n=c.p2wpkh({output:e,pubkey:r[0].pubkey,signature:r[0].signature})}return n}(e,t,r),f=o?c.p2wsh({redeem:u}):null,l=i?c.p2sh({redeem:f||u}):null;n?(s=f?(0,p.witnessStackToScriptWitness)(f.witness):(0,p.witnessStackToScriptWitness)(u.witness),l&&(a=l.input)):a=l?l.input:u.input;return{finalScriptSig:a,finalScriptWitness:s}}(r,a,t.partialSig,n,i,o)}function M(e,t,r,n,i){const a=(0,o.checkForInput)(e,t),{hash:s,sighashType:u,script:c}=R(t,a,n,!1,i);return x(r,c,"sign"),{hash:s,sighashType:u}}function R(e,t,r,n,i){const o=r.__TX,a=t.sighashType||d.Transaction.SIGHASH_ALL;let s,u;if(C(a,i),t.nonWitnessUtxo){const n=F(r,t,e),i=o.ins[e].hash,a=n.getHash();if(!i.equals(a))throw new Error(`Non-witness UTXO hash for input #${e} doesn't match the hash specified in the prevout`);const s=o.ins[e].index;u=n.outs[s]}else{if(!t.witnessUtxo)throw new Error("Need a Utxo input item for signing");u=t.witnessUtxo}const{meaningfulScript:f,type:l}=V(u.script,e,"input",t.redeemScript,t.witnessScript);if(["p2sh-p2wsh","p2wsh"].indexOf(l)>=0)s=o.hashForWitnessV0(e,f,u.value,a);else if((0,p.isP2WPKH)(f)){const t=c.p2pkh({hash:f.slice(2)}).output;s=o.hashForWitnessV0(e,t,u.value,a)}else{if(void 0===t.nonWitnessUtxo&&!1===r.__UNSAFE_SIGN_NONSEGWIT)throw new Error(`Input #${e} has witnessUtxo but non-segwit script: `+f.toString("hex"));n||!1===r.__UNSAFE_SIGN_NONSEGWIT||console.warn("Warning: Signing non-segwit inputs without the full parent transaction means there is a chance that a miner could feed you incorrect information to trick you into paying large fees. This behavior is the same as Psbt's predecesor (TransactionBuilder - now removed) when signing non-segwit scripts. You are not able to export this Psbt with toBuffer|toBase64|toHex since it is not BIP174 compliant.\n*********************\nPROCEED WITH CAUTION!\n*********************"),s=o.hashForSignature(e,f,a)}return{script:f,sighashType:a,hash:s}}function N(e,t,r){const{script:n}=K(e,t,r);return(0,p.isP2TR)(n)?n.subarray(2,34):null}function j(e){return 64===e.length?e:e.subarray(0,64)}function U(t,r,n,i,o,a,s){const u=o.__TX,c=r.sighashType||d.Transaction.SIGHASH_DEFAULT;C(c,s);const l=n.map((e,t)=>K(t,e,o)),b=l.map(e=>e.script),m=l.map(e=>e.value),g=[];if(r.tapInternalKey&&!a){const n=N(t,r,o)||e.from([]);if((0,h.toXOnly)(i).equals(n)){const e=u.hashForWitnessV1(t,b,m,c);g.push({pubkey:i,hash:e})}}const y=(r.tapLeafScript||[]).filter(e=>(0,p.pubkeyInScript)(i,e.script)).map(e=>{const t=(0,f.tapleafHash)({output:e.script,version:e.leafVersion});return Object.assign({hash:t},e)}).filter(e=>!a||a.equals(e.hash)).map(e=>{const r=u.hashForWitnessV1(t,b,m,d.Transaction.SIGHASH_DEFAULT,e.hash);return{pubkey:i,hash:r,leafHash:e.hash}});return g.concat(y)}function C(e,t){if(t&&t.indexOf(e)<0){const t=function(e){let t=e&d.Transaction.SIGHASH_ANYONECANPAY?"SIGHASH_ANYONECANPAY | ":"";switch(31&e){case d.Transaction.SIGHASH_ALL:t+="SIGHASH_ALL";break;case d.Transaction.SIGHASH_SINGLE:t+="SIGHASH_SINGLE";break;case d.Transaction.SIGHASH_NONE:t+="SIGHASH_NONE"}return t}(e);throw new Error("Sighash type is not allowed. Retry the sign method passing the sighashTypes array of whitelisted types. Sighash type: "+t)}}function H(e,t,r){const n=(0,o.checkForInput)(t,e);if(!n.bip32Derivation||0===n.bip32Derivation.length)throw new Error("Need bip32Derivation to sign with HD");const i=n.bip32Derivation.map(e=>e.masterFingerprint.equals(r.fingerprint)?e:void 0).filter(e=>!!e);if(0===i.length)throw new Error("Need one bip32Derivation masterFingerprint to match the HDSigner fingerprint");return i.map(e=>{const t=r.derivePath(e.path);if(!e.pubkey.equals(t.publicKey))throw new Error("pubkey did not match bip32Derivation");return t})}function z(e){let t=0;function r(){const r=i.decode(e,t);return t+=i.decode.bytes,r}function n(){return n=r(),t+=n,e.slice(t-n,t);var n}return function(){const e=r(),t=[];for(let r=0;r<e;r++)t.push(n());return t}()}function L(e,t,r){e.__NON_WITNESS_UTXO_BUF_CACHE[r]=t.nonWitnessUtxo;const n=d.Transaction.fromBuffer(t.nonWitnessUtxo);e.__NON_WITNESS_UTXO_TX_CACHE[r]=n;const i=e,o=r;delete t.nonWitnessUtxo,Object.defineProperty(t,"nonWitnessUtxo",{enumerable:!0,get(){const e=i.__NON_WITNESS_UTXO_BUF_CACHE[o],t=i.__NON_WITNESS_UTXO_TX_CACHE[o];if(void 0!==e)return e;{const e=t.toBuffer();return i.__NON_WITNESS_UTXO_BUF_CACHE[o]=e,e}},set(e){i.__NON_WITNESS_UTXO_BUF_CACHE[o]=e}})}function D(e,t,r,n){let i=0;e.forEach((e,o)=>{if(n&&e.finalScriptSig&&(t.ins[o].script=e.finalScriptSig),n&&e.finalScriptWitness&&(t.ins[o].witness=z(e.finalScriptWitness)),e.witnessUtxo)i+=e.witnessUtxo.value;else if(e.nonWitnessUtxo){const n=F(r,e,o),a=t.ins[o].index,s=n.outs[a];i+=s.value}});const o=t.outs.reduce((e,t)=>e+t.value,0),a=i-o;if(a<0)throw new Error("Outputs are spending more than Inputs");const s=t.virtualSize();r.__FEE=a,r.__EXTRACTED_TX=t,r.__FEE_RATE=Math.floor(a/s)}function F(e,t,r){const n=e.__NON_WITNESS_UTXO_TX_CACHE;return n[r]||L(e,t,r),n[r]}function q(e,t,r){const{script:n}=K(e,t,r);return n}function K(e,t,r){if(void 0!==t.witnessUtxo)return{script:t.witnessUtxo.script,value:t.witnessUtxo.value};if(void 0!==t.nonWitnessUtxo){const n=F(r,t,e).outs[r.__TX.ins[e].index];return{script:n.script,value:n.value}}throw new Error("Can't find pubkey in input without Utxo data")}function W(e){return 33===e.length&&l.isCanonicalPubKey(e)}function V(e,t,r,n,i){const o=(0,p.isP2SHScript)(e),a=o&&n&&(0,p.isP2WSHScript)(n),s=(0,p.isP2WSHScript)(e);if(o&&void 0===n)throw new Error("scriptPubkey is P2SH but redeemScript missing");if((s||a)&&void 0===i)throw new Error("scriptPubkey or redeemScript is P2WSH but witnessScript missing");let u;return a?(u=i,P(t,e,n,r),O(t,n,i,r),G(u)):s?(u=i,O(t,e,i,r),G(u)):o?(u=n,P(t,e,n,r)):u=e,{meaningfulScript:u,type:a?"p2sh-p2wsh":o?"p2sh":s?"p2wsh":"raw"}}function G(e){if((0,p.isP2WPKH)(e)||(0,p.isP2SHScript)(e))throw new Error("P2WPKH or P2SH can not be contained within P2WSH")}function X(e){return(0,p.isP2WPKH)(e)?"witnesspubkeyhash":(0,p.isP2PKH)(e)?"pubkeyhash":(0,p.isP2MS)(e)?"multisig":(0,p.isP2PK)(e)?"pubkey":"nonstandard"}function Y(e){return[...Array(e).keys()]}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(94);function i(e,t,r){return n=>{if(e.has(n))return;const i=r.filter(e=>e.key.toString("hex")===n)[0];t.push(i),e.add(n)}}function o(e){return e.globalMap.unsignedTx}function a(e){const t=new Set;return e.forEach(e=>{const r=e.key.toString("hex");if(t.has(r))throw new Error("Combine: KeyValue Map keys should be unique");t.add(r)}),t}t.combine=function(e){const t=e[0],r=n.psbtToKeyVals(t),s=e.slice(1);if(0===s.length)throw new Error("Combine: Nothing to combine");const u=o(t);if(void 0===u)throw new Error("Combine: Self missing transaction");const c=a(r.globalKeyVals),f=r.inputKeyVals.map(a),l=r.outputKeyVals.map(a);for(const e of s){const t=o(e);if(void 0===t||!t.toBuffer().equals(u.toBuffer()))throw new Error("Combine: One of the Psbts does not have the same transaction.");const s=n.psbtToKeyVals(e);a(s.globalKeyVals).forEach(i(c,r.globalKeyVals,s.globalKeyVals));s.inputKeyVals.map(a).forEach((e,t)=>e.forEach(i(f[t],r.inputKeyVals[t],s.inputKeyVals[t])));s.outputKeyVals.map(a).forEach((e,t)=>e.forEach(i(l[t],r.outputKeyVals[t],s.outputKeyVals[t])))}return n.psbtFromKeyVals(u,{globalMapKeyVals:r.globalKeyVals,inputKeyVals:r.inputKeyVals,outputKeyVals:r.outputKeyVals})}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(64),i=r(65),o=r(22),a=r(5);function s(t,r,n){if(!r.equals(e.from([n])))throw new Error(`Format Error: Invalid ${t} key: ${r.toString("hex")}`)}function u(e,{globalMapKeyVals:t,inputKeyVals:r,outputKeyVals:o}){const u={unsignedTx:e};let c=0;for(const e of t)switch(e.key[0]){case a.GlobalTypes.UNSIGNED_TX:if(s("global",e.key,a.GlobalTypes.UNSIGNED_TX),c>0)throw new Error("Format Error: GlobalMap has multiple UNSIGNED_TX");c++;break;case a.GlobalTypes.GLOBAL_XPUB:void 0===u.globalXpub&&(u.globalXpub=[]),u.globalXpub.push(n.globals.globalXpub.decode(e));break;default:u.unknownKeyVals||(u.unknownKeyVals=[]),u.unknownKeyVals.push(e)}const f=r.length,l=o.length,d=[],h=[];for(const e of i.range(f)){const t={};for(const i of r[e])switch(n.inputs.checkPubkey(i),i.key[0]){case a.InputTypes.NON_WITNESS_UTXO:if(s("input",i.key,a.InputTypes.NON_WITNESS_UTXO),void 0!==t.nonWitnessUtxo)throw new Error("Format Error: Input has multiple NON_WITNESS_UTXO");t.nonWitnessUtxo=n.inputs.nonWitnessUtxo.decode(i);break;case a.InputTypes.WITNESS_UTXO:if(s("input",i.key,a.InputTypes.WITNESS_UTXO),void 0!==t.witnessUtxo)throw new Error("Format Error: Input has multiple WITNESS_UTXO");t.witnessUtxo=n.inputs.witnessUtxo.decode(i);break;case a.InputTypes.PARTIAL_SIG:void 0===t.partialSig&&(t.partialSig=[]),t.partialSig.push(n.inputs.partialSig.decode(i));break;case a.InputTypes.SIGHASH_TYPE:if(s("input",i.key,a.InputTypes.SIGHASH_TYPE),void 0!==t.sighashType)throw new Error("Format Error: Input has multiple SIGHASH_TYPE");t.sighashType=n.inputs.sighashType.decode(i);break;case a.InputTypes.REDEEM_SCRIPT:if(s("input",i.key,a.InputTypes.REDEEM_SCRIPT),void 0!==t.redeemScript)throw new Error("Format Error: Input has multiple REDEEM_SCRIPT");t.redeemScript=n.inputs.redeemScript.decode(i);break;case a.InputTypes.WITNESS_SCRIPT:if(s("input",i.key,a.InputTypes.WITNESS_SCRIPT),void 0!==t.witnessScript)throw new Error("Format Error: Input has multiple WITNESS_SCRIPT");t.witnessScript=n.inputs.witnessScript.decode(i);break;case a.InputTypes.BIP32_DERIVATION:void 0===t.bip32Derivation&&(t.bip32Derivation=[]),t.bip32Derivation.push(n.inputs.bip32Derivation.decode(i));break;case a.InputTypes.FINAL_SCRIPTSIG:s("input",i.key,a.InputTypes.FINAL_SCRIPTSIG),t.finalScriptSig=n.inputs.finalScriptSig.decode(i);break;case a.InputTypes.FINAL_SCRIPTWITNESS:s("input",i.key,a.InputTypes.FINAL_SCRIPTWITNESS),t.finalScriptWitness=n.inputs.finalScriptWitness.decode(i);break;case a.InputTypes.POR_COMMITMENT:s("input",i.key,a.InputTypes.POR_COMMITMENT),t.porCommitment=n.inputs.porCommitment.decode(i);break;case a.InputTypes.TAP_KEY_SIG:s("input",i.key,a.InputTypes.TAP_KEY_SIG),t.tapKeySig=n.inputs.tapKeySig.decode(i);break;case a.InputTypes.TAP_SCRIPT_SIG:void 0===t.tapScriptSig&&(t.tapScriptSig=[]),t.tapScriptSig.push(n.inputs.tapScriptSig.decode(i));break;case a.InputTypes.TAP_LEAF_SCRIPT:void 0===t.tapLeafScript&&(t.tapLeafScript=[]),t.tapLeafScript.push(n.inputs.tapLeafScript.decode(i));break;case a.InputTypes.TAP_BIP32_DERIVATION:void 0===t.tapBip32Derivation&&(t.tapBip32Derivation=[]),t.tapBip32Derivation.push(n.inputs.tapBip32Derivation.decode(i));break;case a.InputTypes.TAP_INTERNAL_KEY:s("input",i.key,a.InputTypes.TAP_INTERNAL_KEY),t.tapInternalKey=n.inputs.tapInternalKey.decode(i);break;case a.InputTypes.TAP_MERKLE_ROOT:s("input",i.key,a.InputTypes.TAP_MERKLE_ROOT),t.tapMerkleRoot=n.inputs.tapMerkleRoot.decode(i);break;default:t.unknownKeyVals||(t.unknownKeyVals=[]),t.unknownKeyVals.push(i)}d.push(t)}for(const e of i.range(l)){const t={};for(const r of o[e])switch(n.outputs.checkPubkey(r),r.key[0]){case a.OutputTypes.REDEEM_SCRIPT:if(s("output",r.key,a.OutputTypes.REDEEM_SCRIPT),void 0!==t.redeemScript)throw new Error("Format Error: Output has multiple REDEEM_SCRIPT");t.redeemScript=n.outputs.redeemScript.decode(r);break;case a.OutputTypes.WITNESS_SCRIPT:if(s("output",r.key,a.OutputTypes.WITNESS_SCRIPT),void 0!==t.witnessScript)throw new Error("Format Error: Output has multiple WITNESS_SCRIPT");t.witnessScript=n.outputs.witnessScript.decode(r);break;case a.OutputTypes.BIP32_DERIVATION:void 0===t.bip32Derivation&&(t.bip32Derivation=[]),t.bip32Derivation.push(n.outputs.bip32Derivation.decode(r));break;case a.OutputTypes.TAP_INTERNAL_KEY:s("output",r.key,a.OutputTypes.TAP_INTERNAL_KEY),t.tapInternalKey=n.outputs.tapInternalKey.decode(r);break;case a.OutputTypes.TAP_TREE:s("output",r.key,a.OutputTypes.TAP_TREE),t.tapTree=n.outputs.tapTree.decode(r);break;case a.OutputTypes.TAP_BIP32_DERIVATION:void 0===t.tapBip32Derivation&&(t.tapBip32Derivation=[]),t.tapBip32Derivation.push(n.outputs.tapBip32Derivation.decode(r));break;default:t.unknownKeyVals||(t.unknownKeyVals=[]),t.unknownKeyVals.push(r)}h.push(t)}return{globalMap:u,inputs:d,outputs:h}}t.psbtFromBuffer=function(e,t){let r=0;function n(){const t=o.decode(e,r);r+=o.encodingLength(t);const n=e.slice(r,r+t);return r+=t,n}function s(){return{key:n(),value:n()}}function c(){if(r>=e.length)throw new Error("Format Error: Unexpected End of PSBT");const t=0===e.readUInt8(r);return t&&r++,t}if(1886610036!==function(){const t=e.readUInt32BE(r);return r+=4,t}())throw new Error("Format Error: Invalid Magic Number");if(255!==function(){const t=e.readUInt8(r);return r+=1,t}())throw new Error("Format Error: Magic Number must be followed by 0xff separator");const f=[],l={};for(;!c();){const e=s(),t=e.key.toString("hex");if(l[t])throw new Error("Format Error: Keys must be unique for global keymap: key "+t);l[t]=1,f.push(e)}const d=f.filter(e=>e.key[0]===a.GlobalTypes.UNSIGNED_TX);if(1!==d.length)throw new Error("Format Error: Only one UNSIGNED_TX allowed");const h=t(d[0].value),{inputCount:p,outputCount:b}=h.getInputOutputCounts(),m=[],g=[];for(const e of i.range(p)){const t={},r=[];for(;!c();){const n=s(),i=n.key.toString("hex");if(t[i])throw new Error("Format Error: Keys must be unique for each input: input index "+e+" key "+i);t[i]=1,r.push(n)}m.push(r)}for(const e of i.range(b)){const t={},r=[];for(;!c();){const n=s(),i=n.key.toString("hex");if(t[i])throw new Error("Format Error: Keys must be unique for each output: output index "+e+" key "+i);t[i]=1,r.push(n)}g.push(r)}return u(h,{globalMapKeyVals:f,inputKeyVals:m,outputKeyVals:g})},t.checkKeyBuffer=s,t.psbtFromKeyVals=u}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(5);t.decode=function(e){if(e.key[0]!==n.GlobalTypes.GLOBAL_XPUB)throw new Error("Decode Error: could not decode globalXpub with key 0x"+e.key.toString("hex"));if(79!==e.key.length||![2,3].includes(e.key[46]))throw new Error("Decode Error: globalXpub has invalid extended pubkey in key 0x"+e.key.toString("hex"));if(e.value.length/4%1!=0)throw new Error("Decode Error: Global GLOBAL_XPUB value length should be multiple of 4");const t=e.key.slice(1),r={masterFingerprint:e.value.slice(0,4),extendedPubkey:t,path:"m"};for(const t of(i=e.value.length/4-1,[...Array(i).keys()])){const n=e.value.readUInt32LE(4*t+4),i=!!(2147483648&n),o=2147483647&n;r.path+="/"+o.toString(10)+(i?"'":"")}var i;return r},t.encode=function(t){const r=e.from([n.GlobalTypes.GLOBAL_XPUB]),i=e.concat([r,t.extendedPubkey]),o=t.path.split("/"),a=e.allocUnsafe(4*o.length);t.masterFingerprint.copy(a,0);let s=4;return o.slice(1).forEach(e=>{const t="'"===e.slice(-1);let r=2147483647&parseInt(t?e.slice(0,-1):e,10);t&&(r+=2147483648),a.writeUInt32LE(r,s),s+=4}),{key:i,value:a}},t.expected="{ masterFingerprint: Buffer; extendedPubkey: Buffer; path: string; }",t.check=function(t){const r=t.extendedPubkey,n=t.masterFingerprint,i=t.path;return e.isBuffer(r)&&78===r.length&&[2,3].indexOf(r[45])>-1&&e.isBuffer(n)&&4===n.length&&"string"==typeof i&&!!i.match(/^m(\/\d+'?)*$/)},t.canAddToArray=function(e,t,r){const n=t.extendedPubkey.toString("hex");return!r.has(n)&&(r.add(n),0===e.filter(e=>e.extendedPubkey.equals(t.extendedPubkey)).length)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(5);t.encode=function(t){return{key:e.from([n.GlobalTypes.UNSIGNED_TX]),value:t.toBuffer()}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(5);t.decode=function(e){if(e.key[0]!==n.InputTypes.FINAL_SCRIPTSIG)throw new Error("Decode Error: could not decode finalScriptSig with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(t){return{key:e.from([n.InputTypes.FINAL_SCRIPTSIG]),value:t}},t.expected="Buffer",t.check=function(t){return e.isBuffer(t)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.finalScriptSig}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(5);t.decode=function(e){if(e.key[0]!==n.InputTypes.FINAL_SCRIPTWITNESS)throw new Error("Decode Error: could not decode finalScriptWitness with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(t){return{key:e.from([n.InputTypes.FINAL_SCRIPTWITNESS]),value:t}},t.expected="Buffer",t.check=function(t){return e.isBuffer(t)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.finalScriptWitness}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(5);t.decode=function(e){if(e.key[0]!==n.InputTypes.NON_WITNESS_UTXO)throw new Error("Decode Error: could not decode nonWitnessUtxo with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(t){return{key:e.from([n.InputTypes.NON_WITNESS_UTXO]),value:t}},t.expected="Buffer",t.check=function(t){return e.isBuffer(t)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.nonWitnessUtxo}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(5);t.decode=function(e){if(e.key[0]!==n.InputTypes.PARTIAL_SIG)throw new Error("Decode Error: could not decode partialSig with key 0x"+e.key.toString("hex"));if(34!==e.key.length&&66!==e.key.length||![2,3,4].includes(e.key[1]))throw new Error("Decode Error: partialSig has invalid pubkey in key 0x"+e.key.toString("hex"));return{pubkey:e.key.slice(1),signature:e.value}},t.encode=function(t){const r=e.from([n.InputTypes.PARTIAL_SIG]);return{key:e.concat([r,t.pubkey]),value:t.signature}},t.expected="{ pubkey: Buffer; signature: Buffer; }",t.check=function(t){return e.isBuffer(t.pubkey)&&e.isBuffer(t.signature)&&[33,65].includes(t.pubkey.length)&&[2,3,4].includes(t.pubkey[0])&&function(t){if(!e.isBuffer(t)||t.length<9)return!1;if(48!==t[0])return!1;if(t.length!==t[1]+3)return!1;if(2!==t[2])return!1;const r=t[3];if(r>33||r<1)return!1;if(2!==t[3+r+1])return!1;const n=t[3+r+2];return!(n>33||n<1)&&t.length===3+r+2+n+2}(t.signature)},t.canAddToArray=function(e,t,r){const n=t.pubkey.toString("hex");return!r.has(n)&&(r.add(n),0===e.filter(e=>e.pubkey.equals(t.pubkey)).length)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(5);t.decode=function(e){if(e.key[0]!==n.InputTypes.POR_COMMITMENT)throw new Error("Decode Error: could not decode porCommitment with key 0x"+e.key.toString("hex"));return e.value.toString("utf8")},t.encode=function(t){return{key:e.from([n.InputTypes.POR_COMMITMENT]),value:e.from(t,"utf8")}},t.expected="string",t.check=function(e){return"string"==typeof e},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.porCommitment}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(5);t.decode=function(e){if(e.key[0]!==n.InputTypes.SIGHASH_TYPE)throw new Error("Decode Error: could not decode sighashType with key 0x"+e.key.toString("hex"));return e.value.readUInt32LE(0)},t.encode=function(t){const r=e.from([n.InputTypes.SIGHASH_TYPE]),i=e.allocUnsafe(4);return i.writeUInt32LE(t,0),{key:r,value:i}},t.expected="number",t.check=function(e){return"number"==typeof e},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.sighashType}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(5);function i(t){return e.isBuffer(t)&&(64===t.length||65===t.length)}t.decode=function(e){if(e.key[0]!==n.InputTypes.TAP_KEY_SIG||1!==e.key.length)throw new Error("Decode Error: could not decode tapKeySig with key 0x"+e.key.toString("hex"));if(!i(e.value))throw new Error("Decode Error: tapKeySig not a valid 64-65-byte BIP340 signature");return e.value},t.encode=function(t){return{key:e.from([n.InputTypes.TAP_KEY_SIG]),value:t}},t.expected="Buffer",t.check=i,t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.tapKeySig}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(5);t.decode=function(e){if(e.key[0]!==n.InputTypes.TAP_LEAF_SCRIPT)throw new Error("Decode Error: could not decode tapLeafScript with key 0x"+e.key.toString("hex"));if((e.key.length-2)%32!=0)throw new Error("Decode Error: tapLeafScript has invalid control block in key 0x"+e.key.toString("hex"));const t=e.value[e.value.length-1];if((254&e.key[1])!==t)throw new Error("Decode Error: tapLeafScript bad leaf version in key 0x"+e.key.toString("hex"));const r=e.value.slice(0,-1);return{controlBlock:e.key.slice(1),script:r,leafVersion:t}},t.encode=function(t){const r=e.from([n.InputTypes.TAP_LEAF_SCRIPT]),i=e.from([t.leafVersion]);return{key:e.concat([r,t.controlBlock]),value:e.concat([t.script,i])}},t.expected="{ controlBlock: Buffer; leafVersion: number, script: Buffer; }",t.check=function(t){return e.isBuffer(t.controlBlock)&&(t.controlBlock.length-1)%32==0&&(254&t.controlBlock[0])===t.leafVersion&&e.isBuffer(t.script)},t.canAddToArray=function(e,t,r){const n=t.controlBlock.toString("hex");return!r.has(n)&&(r.add(n),0===e.filter(e=>e.controlBlock.equals(t.controlBlock)).length)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(5);function i(t){return e.isBuffer(t)&&32===t.length}t.decode=function(e){if(e.key[0]!==n.InputTypes.TAP_MERKLE_ROOT||1!==e.key.length)throw new Error("Decode Error: could not decode tapMerkleRoot with key 0x"+e.key.toString("hex"));if(!i(e.value))throw new Error("Decode Error: tapMerkleRoot not a 32-byte hash");return e.value},t.encode=function(t){return{key:e.from([n.InputTypes.TAP_MERKLE_ROOT]),value:t}},t.expected="Buffer",t.check=i,t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.tapMerkleRoot}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(5);t.decode=function(e){if(e.key[0]!==n.InputTypes.TAP_SCRIPT_SIG)throw new Error("Decode Error: could not decode tapScriptSig with key 0x"+e.key.toString("hex"));if(65!==e.key.length)throw new Error("Decode Error: tapScriptSig has invalid key 0x"+e.key.toString("hex"));if(64!==e.value.length&&65!==e.value.length)throw new Error("Decode Error: tapScriptSig has invalid signature in key 0x"+e.key.toString("hex"));return{pubkey:e.key.slice(1,33),leafHash:e.key.slice(33),signature:e.value}},t.encode=function(t){const r=e.from([n.InputTypes.TAP_SCRIPT_SIG]);return{key:e.concat([r,t.pubkey,t.leafHash]),value:t.signature}},t.expected="{ pubkey: Buffer; leafHash: Buffer; signature: Buffer; }",t.check=function(t){return e.isBuffer(t.pubkey)&&e.isBuffer(t.leafHash)&&e.isBuffer(t.signature)&&32===t.pubkey.length&&32===t.leafHash.length&&(64===t.signature.length||65===t.signature.length)},t.canAddToArray=function(e,t,r){const n=t.pubkey.toString("hex")+t.leafHash.toString("hex");return!r.has(n)&&(r.add(n),0===e.filter(e=>e.pubkey.equals(t.pubkey)&&e.leafHash.equals(t.leafHash)).length)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(5),i=r(65),o=r(22);t.decode=function(e){if(e.key[0]!==n.InputTypes.WITNESS_UTXO)throw new Error("Decode Error: could not decode witnessUtxo with key 0x"+e.key.toString("hex"));const t=i.readUInt64LE(e.value,0);let r=8;const a=o.decode(e.value,r);r+=o.encodingLength(a);const s=e.value.slice(r);if(s.length!==a)throw new Error("Decode Error: WITNESS_UTXO script is not proper length");return{script:s,value:t}},t.encode=function(t){const{script:r,value:a}=t,s=o.encodingLength(r.length),u=e.allocUnsafe(8+s+r.length);return i.writeUInt64LE(u,a,0),o.encode(r.length,u,8),r.copy(u,8+s),{key:e.from([n.InputTypes.WITNESS_UTXO]),value:u}},t.expected="{ script: Buffer; value: number; }",t.check=function(t){return e.isBuffer(t.script)&&"number"==typeof t.value},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.witnessUtxo}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(5),i=r(22);t.decode=function(e){if(e.key[0]!==n.OutputTypes.TAP_TREE||1!==e.key.length)throw new Error("Decode Error: could not decode tapTree with key 0x"+e.key.toString("hex"));let t=0;const r=[];for(;t<e.value.length;){const n=e.value[t++],o=e.value[t++],a=i.decode(e.value,t);t+=i.encodingLength(a),r.push({depth:n,leafVersion:o,script:e.value.slice(t,t+a)}),t+=a}return{leaves:r}},t.encode=function(t){const r=e.from([n.OutputTypes.TAP_TREE]),o=[].concat(...t.leaves.map(t=>[e.of(t.depth,t.leafVersion),i.encode(t.script.length),t.script]));return{key:r,value:e.concat(o)}},t.expected="{ leaves: [{ depth: number; leafVersion: number, script: Buffer; }] }",t.check=function(t){return Array.isArray(t.leaves)&&t.leaves.every(t=>t.depth>=0&&t.depth<=128&&(254&t.leafVersion)===t.leafVersion&&e.isBuffer(t.script))},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.tapTree}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeChecker=function(e){return function(t){let r;if(e.includes(t.key[0])&&(r=t.key.slice(1),33!==r.length&&65!==r.length||![2,3,4].includes(r[0])))throw new Error("Format Error: invalid pubkey in key 0x"+t.key.toString("hex"));return r}}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.makeConverter=function(t){return{decode:function(e){if(e.key[0]!==t)throw new Error("Decode Error: could not decode redeemScript with key 0x"+e.key.toString("hex"));return e.value},encode:function(r){return{key:e.from([t]),value:r}},check:function(t){return e.isBuffer(t)},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.redeemScript}}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(22),i=r(95),o=e=>32===e.length;t.makeConverter=function(t){const r=i.makeConverter(t,o);return{decode:function(e){const t=n.decode(e.value),i=n.encodingLength(t),o=r.decode({key:e.key,value:e.value.slice(i+32*t)}),a=new Array(t);for(let r=0,n=i;r<t;r++,n+=32)a[r]=e.value.slice(n,n+32);return Object.assign({},o,{leafHashes:a})},encode:function(t){const i=r.encode(t),o=n.encodingLength(t.leafHashes.length),a=e.allocUnsafe(o);n.encode(t.leafHashes.length,a);const s=e.concat([a,...t.leafHashes,i.value]);return Object.assign({},i,{value:s})},check:function(t){return Array.isArray(t.leafHashes)&&t.leafHashes.every(t=>e.isBuffer(t)&&32===t.length)&&r.check(t)},expected:"{ masterFingerprint: Buffer; pubkey: Buffer; path: string; leafHashes: Buffer[]; }",canAddToArray:r.canAddToArray}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.makeConverter=function(t){return{decode:function(e){if(e.key[0]!==t||1!==e.key.length)throw new Error("Decode Error: could not decode tapInternalKey with key 0x"+e.key.toString("hex"));if(32!==e.value.length)throw new Error("Decode Error: tapInternalKey not a 32-byte x-only pubkey");return e.value},encode:function(r){return{key:e.from([t]),value:r}},check:function(t){return e.isBuffer(t)&&32===t.length},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.tapInternalKey}}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.makeConverter=function(t){return{decode:function(e){if(e.key[0]!==t)throw new Error("Decode Error: could not decode witnessScript with key 0x"+e.key.toString("hex"));return e.value},encode:function(r){return{key:e.from([t]),value:r}},check:function(t){return e.isBuffer(t)},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.witnessScript}}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(64),i=r(65);t.psbtToBuffer=function({globalMap:t,inputs:r,outputs:n}){const{globalKeyVals:o,inputKeyVals:a,outputKeyVals:u}=s({globalMap:t,inputs:r,outputs:n}),c=i.keyValsToBuffer(o),f=t=>0===t.length?[e.from([0])]:t.map(i.keyValsToBuffer),l=f(a),d=f(u),h=e.allocUnsafe(5);return h.writeUIntBE(482972169471,0,5),e.concat([h,c].concat(l,d))};const o=(e,t)=>e.key.compare(t.key);function a(e,t){const r=new Set,n=Object.entries(e).reduce((e,[n,i])=>{if("unknownKeyVals"===n)return e;const o=t[n];if(void 0===o)return e;const a=(Array.isArray(i)?i:[i]).map(o.encode);return a.map(e=>e.key.toString("hex")).forEach(e=>{if(r.has(e))throw new Error("Serialize Error: Duplicate key: "+e);r.add(e)}),e.concat(a)},[]),i=e.unknownKeyVals?e.unknownKeyVals.filter(e=>!r.has(e.key.toString("hex"))):[];return n.concat(i).sort(o)}function s({globalMap:e,inputs:t,outputs:r}){return{globalKeyVals:a(e,n.globals),inputKeyVals:t.map(e=>a(e,n.inputs)),outputKeyVals:r.map(e=>a(e,n.outputs))}}t.psbtToKeyVals=s}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.checkTaprootInputForSigs=t.tapTreeFromList=t.tapTreeToList=t.tweakInternalPubKey=t.checkTaprootOutputFields=t.checkTaprootInputFields=t.isTaprootOutput=t.isTaprootInput=t.serializeTaprootSignature=t.tapScriptFinalizer=t.toXOnly=void 0;const n=r(8),i=r(38),o=r(67),a=r(63),s=r(36),u=r(67);function c(e){return e&&!!(e.tapInternalKey||e.tapMerkleRoot||e.tapLeafScript&&e.tapLeafScript.length||e.tapBip32Derivation&&e.tapBip32Derivation.length||e.witnessUtxo&&(0,o.isP2TR)(e.witnessUtxo.script))}function f(e,t){return e&&!!(e.tapInternalKey||e.tapTree||e.tapBip32Derivation&&e.tapBip32Derivation.length||t&&(0,o.isP2TR)(t))}function l(e=[]){return 1===e.length&&0===e[0].depth?{output:e[0].script,version:e[0].leafVersion}:function(e){let t;for(const r of e)if(t=h(r,t),!t)throw new Error("No room left to insert tapleaf in tree");return t}(e)}function d(e){return{signature:e.slice(0,64),hashType:e.slice(64)[0]||i.Transaction.SIGHASH_DEFAULT}}function h(e,t,r=0){if(r>a.MAX_TAPTREE_DEPTH)throw new Error("Max taptree depth exceeded.");if(e.depth===r)return t?void 0:{output:e.script,version:e.leafVersion};if((0,n.isTapleaf)(t))return;const i=h(e,t&&t[0],r+1);if(i)return[i,t&&t[1]];const o=h(e,t&&t[1],r+1);return o?[t&&t[0],o]:void 0}function p(e,t){if(!t)return!0;const r=(0,a.tapleafHash)({output:e.script,version:e.leafVersion});return(0,a.rootHashFromPath)(e.controlBlock,r).equals(t)}function b(e){return e&&!!(e.redeemScript||e.witnessScript||e.bip32Derivation&&e.bip32Derivation.length)}t.toXOnly=e=>32===e.length?e:e.slice(1,33),t.tapScriptFinalizer=function(e,t,r){const n=function(e,t,r){if(!e.tapScriptSig||!e.tapScriptSig.length)throw new Error(`Can not finalize taproot input #${t}. No tapleaf script signature provided.`);const n=(e.tapLeafScript||[]).sort((e,t)=>e.controlBlock.length-t.controlBlock.length).find(t=>function(e,t,r){const n=(0,a.tapleafHash)({output:e.script,version:e.leafVersion});return(!r||r.equals(n))&&void 0!==t.find(e=>e.leafHash.equals(n))}(t,e.tapScriptSig,r));if(!n)throw new Error(`Can not finalize taproot input #${t}. Signature for tapleaf script not found.`);return n}(t,e,r);try{const e=function(e,t){const r=(0,a.tapleafHash)({output:t.script,version:t.leafVersion});return(e.tapScriptSig||[]).filter(e=>e.leafHash.equals(r)).map(e=>function(e,t){return Object.assign({positionInScript:(0,o.pubkeyPositionInScript)(t.pubkey,e)},t)}(t.script,e)).sort((e,t)=>t.positionInScript-e.positionInScript).map(e=>e.signature)}(t,n).concat(n.script).concat(n.controlBlock);return{finalScriptWitness:(0,o.witnessStackToScriptWitness)(e)}}catch(t){throw new Error(`Can not finalize taproot input #${e}: ${t}`)}},t.serializeTaprootSignature=function(t,r){const n=r?e.from([r]):e.from([]);return e.concat([t,n])},t.isTaprootInput=c,t.isTaprootOutput=f,t.checkTaprootInputFields=function(e,t,r){!function(e,t,r){const n=c(e)&&b(t),i=b(e)&&c(t),o=e===t&&c(t)&&b(t);if(n||i||o)throw new Error(`Invalid arguments for Psbt.${r}. Cannot use both taproot and non-taproot fields.`)}(e,t,r),function(e,t,r){if(t.tapMerkleRoot){const n=(t.tapLeafScript||[]).every(e=>p(e,t.tapMerkleRoot)),i=(e.tapLeafScript||[]).every(e=>p(e,t.tapMerkleRoot));if(!n||!i)throw new Error(`Invalid arguments for Psbt.${r}. Tapleaf not part of taptree.`)}else if(e.tapMerkleRoot){if(!(t.tapLeafScript||[]).every(t=>p(t,e.tapMerkleRoot)))throw new Error(`Invalid arguments for Psbt.${r}. Tapleaf not part of taptree.`)}}(e,t,r)},t.checkTaprootOutputFields=function(e,t,r){!function(e,t,r){const n=f(e)&&b(t),i=b(e)&&f(t),o=e===t&&f(t)&&b(t);if(n||i||o)throw new Error(`Invalid arguments for Psbt.${r}. Cannot use both taproot and non-taproot fields.`)}(e,t,r),function(e,t){if(!t.tapTree&&!t.tapInternalKey)return;const r=t.tapInternalKey||e.tapInternalKey,n=t.tapTree||e.tapTree;if(r){const{script:t}=e,i=function(e,t){const r=t&&l(t.leaves),{output:n}=(0,s.p2tr)({internalPubkey:e,scriptTree:r});return n}(r,n);if(t&&!t.equals(i))throw new Error("Error adding output. Script or address missmatch.")}}(e,t)},t.tweakInternalPubKey=function(e,t){const r=t.tapInternalKey,n=r&&(0,a.tweakKey)(r,t.tapMerkleRoot);if(!n)throw new Error(`Cannot tweak tap internal key for input #${e}. Public key: ${r&&r.toString("hex")}`);return n.x},t.tapTreeToList=function(e){if(!(0,n.isTaptree)(e))throw new Error("Cannot convert taptree to tapleaf list. Expecting a tapree structure.");return function e(t,r=[],i=0){if(i>a.MAX_TAPTREE_DEPTH)throw new Error("Max taptree depth exceeded.");if(!t)return[];if((0,n.isTapleaf)(t))return r.push({depth:i,leafVersion:t.version||a.LEAF_VERSION_TAPSCRIPT,script:t.output}),r;t[0]&&e(t[0],r,i+1);t[1]&&e(t[1],r,i+1);return r}(e)},t.tapTreeFromList=l,t.checkTaprootInputForSigs=function(e,t){return function(e){const t=[];e.tapKeySig&&t.push(e.tapKeySig);e.tapScriptSig&&t.push(...e.tapScriptSig.map(e=>e.signature));if(!t.length){const r=function(e){if(!e)return;const t=e.slice(2);if(64===t.length||65===t.length)return t}(e.finalScriptWitness);r&&t.push(r)}return t}(e).some(e=>(0,u.signatureBlocksAction)(e,d,t))}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.add=t.toBig=t.split=t.fromBig=void 0;const n=BigInt(2**32-1),i=BigInt(32);function o(e,t=!1){return t?{h:Number(e&n),l:Number(e>>i&n)}:{h:0|Number(e>>i&n),l:0|Number(e&n)}}function a(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:a,l:s}=o(e[i],t);[r[i],n[i]]=[a,s]}return[r,n]}t.fromBig=o,t.split=a;t.toBig=(e,t)=>BigInt(e>>>0)<<i|BigInt(t>>>0);function s(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}}t.add=s;const u={fromBig:o,split:a,toBig:t.toBig,shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,r)=>e<<r|t>>>32-r,rotlSL:(e,t,r)=>t<<r|e>>>32-r,rotlBH:(e,t,r)=>t<<r-32|e>>>64-r,rotlBL:(e,t,r)=>e<<r-32|t>>>64-r,add:s,add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/2**32|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0,add5H:(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0,add5L:(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0)};t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pbkdf2Async=t.pbkdf2=void 0;const n=r(60),i=r(68),o=r(21);function a(e,t,r,a){n.default.hash(e);const s=(0,o.checkOpts)({dkLen:32,asyncTick:10},a),{c:u,dkLen:c,asyncTick:f}=s;if(n.default.number(u),n.default.number(c),n.default.number(f),u<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const l=(0,o.toBytes)(t),d=(0,o.toBytes)(r),h=new Uint8Array(c),p=i.hmac.create(e,l),b=p._cloneInto().update(d);return{c:u,dkLen:c,asyncTick:f,DK:h,PRF:p,PRFSalt:b}}function s(e,t,r,n,i){return e.destroy(),t.destroy(),n&&n.destroy(),i.fill(0),r}t.pbkdf2=function(e,t,r,n){const{c:i,dkLen:u,DK:c,PRF:f,PRFSalt:l}=a(e,t,r,n);let d;const h=new Uint8Array(4),p=(0,o.createView)(h),b=new Uint8Array(f.outputLen);for(let e=1,t=0;t<u;e++,t+=f.outputLen){const r=c.subarray(t,t+f.outputLen);p.setInt32(0,e,!1),(d=l._cloneInto(d)).update(h).digestInto(b),r.set(b.subarray(0,r.length));for(let e=1;e<i;e++){f._cloneInto(d).update(b).digestInto(b);for(let e=0;e<r.length;e++)r[e]^=b[e]}}return s(f,l,c,d,b)},t.pbkdf2Async=async function(e,t,r,n){const{c:i,dkLen:u,asyncTick:c,DK:f,PRF:l,PRFSalt:d}=a(e,t,r,n);let h;const p=new Uint8Array(4),b=(0,o.createView)(p),m=new Uint8Array(l.outputLen);for(let e=1,t=0;t<u;e++,t+=l.outputLen){const r=f.subarray(t,t+l.outputLen);b.setInt32(0,e,!1),(h=d._cloneInto(h)).update(p).digestInto(m),r.set(m.subarray(0,r.length)),await(0,o.asyncLoop)(i-1,c,e=>{l._cloneInto(h).update(m).digestInto(m);for(let e=0;e<r.length;e++)r[e]^=m[e]})}return s(l,d,f,h,m)}},function(e){e.exports=JSON.parse('["abdikace","abeceda","adresa","agrese","akce","aktovka","alej","alkohol","amputace","ananas","andulka","anekdota","anketa","antika","anulovat","archa","arogance","asfalt","asistent","aspirace","astma","astronom","atlas","atletika","atol","autobus","azyl","babka","bachor","bacil","baculka","badatel","bageta","bagr","bahno","bakterie","balada","baletka","balkon","balonek","balvan","balza","bambus","bankomat","barbar","baret","barman","baroko","barva","baterka","batoh","bavlna","bazalka","bazilika","bazuka","bedna","beran","beseda","bestie","beton","bezinka","bezmoc","beztak","bicykl","bidlo","biftek","bikiny","bilance","biograf","biolog","bitva","bizon","blahobyt","blatouch","blecha","bledule","blesk","blikat","blizna","blokovat","bloudit","blud","bobek","bobr","bodlina","bodnout","bohatost","bojkot","bojovat","bokorys","bolest","borec","borovice","bota","boubel","bouchat","bouda","boule","bourat","boxer","bradavka","brambora","branka","bratr","brepta","briketa","brko","brloh","bronz","broskev","brunetka","brusinka","brzda","brzy","bublina","bubnovat","buchta","buditel","budka","budova","bufet","bujarost","bukvice","buldok","bulva","bunda","bunkr","burza","butik","buvol","buzola","bydlet","bylina","bytovka","bzukot","capart","carevna","cedr","cedule","cejch","cejn","cela","celer","celkem","celnice","cenina","cennost","cenovka","centrum","cenzor","cestopis","cetka","chalupa","chapadlo","charita","chata","chechtat","chemie","chichot","chirurg","chlad","chleba","chlubit","chmel","chmura","chobot","chochol","chodba","cholera","chomout","chopit","choroba","chov","chrapot","chrlit","chrt","chrup","chtivost","chudina","chutnat","chvat","chvilka","chvost","chyba","chystat","chytit","cibule","cigareta","cihelna","cihla","cinkot","cirkus","cisterna","citace","citrus","cizinec","cizost","clona","cokoliv","couvat","ctitel","ctnost","cudnost","cuketa","cukr","cupot","cvaknout","cval","cvik","cvrkot","cyklista","daleko","dareba","datel","datum","dcera","debata","dechovka","decibel","deficit","deflace","dekl","dekret","demokrat","deprese","derby","deska","detektiv","dikobraz","diktovat","dioda","diplom","disk","displej","divadlo","divoch","dlaha","dlouho","dluhopis","dnes","dobro","dobytek","docent","dochutit","dodnes","dohled","dohoda","dohra","dojem","dojnice","doklad","dokola","doktor","dokument","dolar","doleva","dolina","doma","dominant","domluvit","domov","donutit","dopad","dopis","doplnit","doposud","doprovod","dopustit","dorazit","dorost","dort","dosah","doslov","dostatek","dosud","dosyta","dotaz","dotek","dotknout","doufat","doutnat","dovozce","dozadu","doznat","dozorce","drahota","drak","dramatik","dravec","draze","drdol","drobnost","drogerie","drozd","drsnost","drtit","drzost","duben","duchovno","dudek","duha","duhovka","dusit","dusno","dutost","dvojice","dvorec","dynamit","ekolog","ekonomie","elektron","elipsa","email","emise","emoce","empatie","epizoda","epocha","epopej","epos","esej","esence","eskorta","eskymo","etiketa","euforie","evoluce","exekuce","exkurze","expedice","exploze","export","extrakt","facka","fajfka","fakulta","fanatik","fantazie","farmacie","favorit","fazole","federace","fejeton","fenka","fialka","figurant","filozof","filtr","finance","finta","fixace","fjord","flanel","flirt","flotila","fond","fosfor","fotbal","fotka","foton","frakce","freska","fronta","fukar","funkce","fyzika","galeje","garant","genetika","geolog","gilotina","glazura","glejt","golem","golfista","gotika","graf","gramofon","granule","grep","gril","grog","groteska","guma","hadice","hadr","hala","halenka","hanba","hanopis","harfa","harpuna","havran","hebkost","hejkal","hejno","hejtman","hektar","helma","hematom","herec","herna","heslo","hezky","historik","hladovka","hlasivky","hlava","hledat","hlen","hlodavec","hloh","hloupost","hltat","hlubina","hluchota","hmat","hmota","hmyz","hnis","hnojivo","hnout","hoblina","hoboj","hoch","hodiny","hodlat","hodnota","hodovat","hojnost","hokej","holinka","holka","holub","homole","honitba","honorace","horal","horda","horizont","horko","horlivec","hormon","hornina","horoskop","horstvo","hospoda","hostina","hotovost","houba","houf","houpat","houska","hovor","hradba","hranice","hravost","hrazda","hrbolek","hrdina","hrdlo","hrdost","hrnek","hrobka","hromada","hrot","hrouda","hrozen","hrstka","hrubost","hryzat","hubenost","hubnout","hudba","hukot","humr","husita","hustota","hvozd","hybnost","hydrant","hygiena","hymna","hysterik","idylka","ihned","ikona","iluze","imunita","infekce","inflace","inkaso","inovace","inspekce","internet","invalida","investor","inzerce","ironie","jablko","jachta","jahoda","jakmile","jakost","jalovec","jantar","jarmark","jaro","jasan","jasno","jatka","javor","jazyk","jedinec","jedle","jednatel","jehlan","jekot","jelen","jelito","jemnost","jenom","jepice","jeseter","jevit","jezdec","jezero","jinak","jindy","jinoch","jiskra","jistota","jitrnice","jizva","jmenovat","jogurt","jurta","kabaret","kabel","kabinet","kachna","kadet","kadidlo","kahan","kajak","kajuta","kakao","kaktus","kalamita","kalhoty","kalibr","kalnost","kamera","kamkoliv","kamna","kanibal","kanoe","kantor","kapalina","kapela","kapitola","kapka","kaple","kapota","kapr","kapusta","kapybara","karamel","karotka","karton","kasa","katalog","katedra","kauce","kauza","kavalec","kazajka","kazeta","kazivost","kdekoliv","kdesi","kedluben","kemp","keramika","kino","klacek","kladivo","klam","klapot","klasika","klaun","klec","klenba","klepat","klesnout","klid","klima","klisna","klobouk","klokan","klopa","kloub","klubovna","klusat","kluzkost","kmen","kmitat","kmotr","kniha","knot","koalice","koberec","kobka","kobliha","kobyla","kocour","kohout","kojenec","kokos","koktejl","kolaps","koleda","kolize","kolo","komando","kometa","komik","komnata","komora","kompas","komunita","konat","koncept","kondice","konec","konfese","kongres","konina","konkurs","kontakt","konzerva","kopanec","kopie","kopnout","koprovka","korbel","korektor","kormidlo","koroptev","korpus","koruna","koryto","korzet","kosatec","kostka","kotel","kotleta","kotoul","koukat","koupelna","kousek","kouzlo","kovboj","koza","kozoroh","krabice","krach","krajina","kralovat","krasopis","kravata","kredit","krejcar","kresba","kreveta","kriket","kritik","krize","krkavec","krmelec","krmivo","krocan","krok","kronika","kropit","kroupa","krovka","krtek","kruhadlo","krupice","krutost","krvinka","krychle","krypta","krystal","kryt","kudlanka","kufr","kujnost","kukla","kulajda","kulich","kulka","kulomet","kultura","kuna","kupodivu","kurt","kurzor","kutil","kvalita","kvasinka","kvestor","kynolog","kyselina","kytara","kytice","kytka","kytovec","kyvadlo","labrador","lachtan","ladnost","laik","lakomec","lamela","lampa","lanovka","lasice","laso","lastura","latinka","lavina","lebka","leckdy","leden","lednice","ledovka","ledvina","legenda","legie","legrace","lehce","lehkost","lehnout","lektvar","lenochod","lentilka","lepenka","lepidlo","letadlo","letec","letmo","letokruh","levhart","levitace","levobok","libra","lichotka","lidojed","lidskost","lihovina","lijavec","lilek","limetka","linie","linka","linoleum","listopad","litina","litovat","lobista","lodivod","logika","logoped","lokalita","loket","lomcovat","lopata","lopuch","lord","losos","lotr","loudal","louh","louka","louskat","lovec","lstivost","lucerna","lucifer","lump","lusk","lustrace","lvice","lyra","lyrika","lysina","madam","madlo","magistr","mahagon","majetek","majitel","majorita","makak","makovice","makrela","malba","malina","malovat","malvice","maminka","mandle","manko","marnost","masakr","maskot","masopust","matice","matrika","maturita","mazanec","mazivo","mazlit","mazurka","mdloba","mechanik","meditace","medovina","melasa","meloun","mentolka","metla","metoda","metr","mezera","migrace","mihnout","mihule","mikina","mikrofon","milenec","milimetr","milost","mimika","mincovna","minibar","minomet","minulost","miska","mistr","mixovat","mladost","mlha","mlhovina","mlok","mlsat","mluvit","mnich","mnohem","mobil","mocnost","modelka","modlitba","mohyla","mokro","molekula","momentka","monarcha","monokl","monstrum","montovat","monzun","mosaz","moskyt","most","motivace","motorka","motyka","moucha","moudrost","mozaika","mozek","mozol","mramor","mravenec","mrkev","mrtvola","mrzet","mrzutost","mstitel","mudrc","muflon","mulat","mumie","munice","muset","mutace","muzeum","muzikant","myslivec","mzda","nabourat","nachytat","nadace","nadbytek","nadhoz","nadobro","nadpis","nahlas","nahnat","nahodile","nahradit","naivita","najednou","najisto","najmout","naklonit","nakonec","nakrmit","nalevo","namazat","namluvit","nanometr","naoko","naopak","naostro","napadat","napevno","naplnit","napnout","naposled","naprosto","narodit","naruby","narychlo","nasadit","nasekat","naslepo","nastat","natolik","navenek","navrch","navzdory","nazvat","nebe","nechat","necky","nedaleko","nedbat","neduh","negace","nehet","nehoda","nejen","nejprve","neklid","nelibost","nemilost","nemoc","neochota","neonka","nepokoj","nerost","nerv","nesmysl","nesoulad","netvor","neuron","nevina","nezvykle","nicota","nijak","nikam","nikdy","nikl","nikterak","nitro","nocleh","nohavice","nominace","nora","norek","nositel","nosnost","nouze","noviny","novota","nozdra","nuda","nudle","nuget","nutit","nutnost","nutrie","nymfa","obal","obarvit","obava","obdiv","obec","obehnat","obejmout","obezita","obhajoba","obilnice","objasnit","objekt","obklopit","oblast","oblek","obliba","obloha","obluda","obnos","obohatit","obojek","obout","obrazec","obrna","obruba","obrys","obsah","obsluha","obstarat","obuv","obvaz","obvinit","obvod","obvykle","obyvatel","obzor","ocas","ocel","ocenit","ochladit","ochota","ochrana","ocitnout","odboj","odbyt","odchod","odcizit","odebrat","odeslat","odevzdat","odezva","odhadce","odhodit","odjet","odjinud","odkaz","odkoupit","odliv","odluka","odmlka","odolnost","odpad","odpis","odplout","odpor","odpustit","odpykat","odrazka","odsoudit","odstup","odsun","odtok","odtud","odvaha","odveta","odvolat","odvracet","odznak","ofina","ofsajd","ohlas","ohnisko","ohrada","ohrozit","ohryzek","okap","okenice","oklika","okno","okouzlit","okovy","okrasa","okres","okrsek","okruh","okupant","okurka","okusit","olejnina","olizovat","omak","omeleta","omezit","omladina","omlouvat","omluva","omyl","onehdy","opakovat","opasek","operace","opice","opilost","opisovat","opora","opozice","opravdu","oproti","orbital","orchestr","orgie","orlice","orloj","ortel","osada","oschnout","osika","osivo","oslava","oslepit","oslnit","oslovit","osnova","osoba","osolit","ospalec","osten","ostraha","ostuda","ostych","osvojit","oteplit","otisk","otop","otrhat","otrlost","otrok","otruby","otvor","ovanout","ovar","oves","ovlivnit","ovoce","oxid","ozdoba","pachatel","pacient","padouch","pahorek","pakt","palanda","palec","palivo","paluba","pamflet","pamlsek","panenka","panika","panna","panovat","panstvo","pantofle","paprika","parketa","parodie","parta","paruka","paryba","paseka","pasivita","pastelka","patent","patrona","pavouk","pazneht","pazourek","pecka","pedagog","pejsek","peklo","peloton","penalta","pendrek","penze","periskop","pero","pestrost","petarda","petice","petrolej","pevnina","pexeso","pianista","piha","pijavice","pikle","piknik","pilina","pilnost","pilulka","pinzeta","pipeta","pisatel","pistole","pitevna","pivnice","pivovar","placenta","plakat","plamen","planeta","plastika","platit","plavidlo","plaz","plech","plemeno","plenta","ples","pletivo","plevel","plivat","plnit","plno","plocha","plodina","plomba","plout","pluk","plyn","pobavit","pobyt","pochod","pocit","poctivec","podat","podcenit","podepsat","podhled","podivit","podklad","podmanit","podnik","podoba","podpora","podraz","podstata","podvod","podzim","poezie","pohanka","pohnutka","pohovor","pohroma","pohyb","pointa","pojistka","pojmout","pokazit","pokles","pokoj","pokrok","pokuta","pokyn","poledne","polibek","polknout","poloha","polynom","pomalu","pominout","pomlka","pomoc","pomsta","pomyslet","ponechat","ponorka","ponurost","popadat","popel","popisek","poplach","poprosit","popsat","popud","poradce","porce","porod","porucha","poryv","posadit","posed","posila","poskok","poslanec","posoudit","pospolu","postava","posudek","posyp","potah","potkan","potlesk","potomek","potrava","potupa","potvora","poukaz","pouto","pouzdro","povaha","povidla","povlak","povoz","povrch","povstat","povyk","povzdech","pozdrav","pozemek","poznatek","pozor","pozvat","pracovat","prahory","praktika","prales","praotec","praporek","prase","pravda","princip","prkno","probudit","procento","prodej","profese","prohra","projekt","prolomit","promile","pronikat","propad","prorok","prosba","proton","proutek","provaz","prskavka","prsten","prudkost","prut","prvek","prvohory","psanec","psovod","pstruh","ptactvo","puberta","puch","pudl","pukavec","puklina","pukrle","pult","pumpa","punc","pupen","pusa","pusinka","pustina","putovat","putyka","pyramida","pysk","pytel","racek","rachot","radiace","radnice","radon","raft","ragby","raketa","rakovina","rameno","rampouch","rande","rarach","rarita","rasovna","rastr","ratolest","razance","razidlo","reagovat","reakce","recept","redaktor","referent","reflex","rejnok","reklama","rekord","rekrut","rektor","reputace","revize","revma","revolver","rezerva","riskovat","riziko","robotika","rodokmen","rohovka","rokle","rokoko","romaneto","ropovod","ropucha","rorejs","rosol","rostlina","rotmistr","rotoped","rotunda","roubenka","roucho","roup","roura","rovina","rovnice","rozbor","rozchod","rozdat","rozeznat","rozhodce","rozinka","rozjezd","rozkaz","rozloha","rozmar","rozpad","rozruch","rozsah","roztok","rozum","rozvod","rubrika","ruchadlo","rukavice","rukopis","ryba","rybolov","rychlost","rydlo","rypadlo","rytina","ryzost","sadista","sahat","sako","samec","samizdat","samota","sanitka","sardinka","sasanka","satelit","sazba","sazenice","sbor","schovat","sebranka","secese","sedadlo","sediment","sedlo","sehnat","sejmout","sekera","sekta","sekunda","sekvoje","semeno","seno","servis","sesadit","seshora","seskok","seslat","sestra","sesuv","sesypat","setba","setina","setkat","setnout","setrvat","sever","seznam","shoda","shrnout","sifon","silnice","sirka","sirotek","sirup","situace","skafandr","skalisko","skanzen","skaut","skeptik","skica","skladba","sklenice","sklo","skluz","skoba","skokan","skoro","skripta","skrz","skupina","skvost","skvrna","slabika","sladidlo","slanina","slast","slavnost","sledovat","slepec","sleva","slezina","slib","slina","sliznice","slon","sloupek","slovo","sluch","sluha","slunce","slupka","slza","smaragd","smetana","smilstvo","smlouva","smog","smrad","smrk","smrtka","smutek","smysl","snad","snaha","snob","sobota","socha","sodovka","sokol","sopka","sotva","souboj","soucit","soudce","souhlas","soulad","soumrak","souprava","soused","soutok","souviset","spalovna","spasitel","spis","splav","spodek","spojenec","spolu","sponzor","spornost","spousta","sprcha","spustit","sranda","sraz","srdce","srna","srnec","srovnat","srpen","srst","srub","stanice","starosta","statika","stavba","stehno","stezka","stodola","stolek","stopa","storno","stoupat","strach","stres","strhnout","strom","struna","studna","stupnice","stvol","styk","subjekt","subtropy","suchar","sudost","sukno","sundat","sunout","surikata","surovina","svah","svalstvo","svetr","svatba","svazek","svisle","svitek","svoboda","svodidlo","svorka","svrab","sykavka","sykot","synek","synovec","sypat","sypkost","syrovost","sysel","sytost","tabletka","tabule","tahoun","tajemno","tajfun","tajga","tajit","tajnost","taktika","tamhle","tampon","tancovat","tanec","tanker","tapeta","tavenina","tazatel","technika","tehdy","tekutina","telefon","temnota","tendence","tenista","tenor","teplota","tepna","teprve","terapie","termoska","textil","ticho","tiskopis","titulek","tkadlec","tkanina","tlapka","tleskat","tlukot","tlupa","tmel","toaleta","topinka","topol","torzo","touha","toulec","tradice","traktor","tramp","trasa","traverza","trefit","trest","trezor","trhavina","trhlina","trochu","trojice","troska","trouba","trpce","trpitel","trpkost","trubec","truchlit","truhlice","trus","trvat","tudy","tuhnout","tuhost","tundra","turista","turnaj","tuzemsko","tvaroh","tvorba","tvrdost","tvrz","tygr","tykev","ubohost","uboze","ubrat","ubrousek","ubrus","ubytovna","ucho","uctivost","udivit","uhradit","ujednat","ujistit","ujmout","ukazatel","uklidnit","uklonit","ukotvit","ukrojit","ulice","ulita","ulovit","umyvadlo","unavit","uniforma","uniknout","upadnout","uplatnit","uplynout","upoutat","upravit","uran","urazit","usednout","usilovat","usmrtit","usnadnit","usnout","usoudit","ustlat","ustrnout","utahovat","utkat","utlumit","utonout","utopenec","utrousit","uvalit","uvolnit","uvozovka","uzdravit","uzel","uzenina","uzlina","uznat","vagon","valcha","valoun","vana","vandal","vanilka","varan","varhany","varovat","vcelku","vchod","vdova","vedro","vegetace","vejce","velbloud","veletrh","velitel","velmoc","velryba","venkov","veranda","verze","veselka","veskrze","vesnice","vespodu","vesta","veterina","veverka","vibrace","vichr","videohra","vidina","vidle","vila","vinice","viset","vitalita","vize","vizitka","vjezd","vklad","vkus","vlajka","vlak","vlasec","vlevo","vlhkost","vliv","vlnovka","vloupat","vnucovat","vnuk","voda","vodivost","vodoznak","vodstvo","vojensky","vojna","vojsko","volant","volba","volit","volno","voskovka","vozidlo","vozovna","vpravo","vrabec","vracet","vrah","vrata","vrba","vrcholek","vrhat","vrstva","vrtule","vsadit","vstoupit","vstup","vtip","vybavit","vybrat","vychovat","vydat","vydra","vyfotit","vyhledat","vyhnout","vyhodit","vyhradit","vyhubit","vyjasnit","vyjet","vyjmout","vyklopit","vykonat","vylekat","vymazat","vymezit","vymizet","vymyslet","vynechat","vynikat","vynutit","vypadat","vyplatit","vypravit","vypustit","vyrazit","vyrovnat","vyrvat","vyslovit","vysoko","vystavit","vysunout","vysypat","vytasit","vytesat","vytratit","vyvinout","vyvolat","vyvrhel","vyzdobit","vyznat","vzadu","vzbudit","vzchopit","vzdor","vzduch","vzdychat","vzestup","vzhledem","vzkaz","vzlykat","vznik","vzorek","vzpoura","vztah","vztek","xylofon","zabrat","zabydlet","zachovat","zadarmo","zadusit","zafoukat","zahltit","zahodit","zahrada","zahynout","zajatec","zajet","zajistit","zaklepat","zakoupit","zalepit","zamezit","zamotat","zamyslet","zanechat","zanikat","zaplatit","zapojit","zapsat","zarazit","zastavit","zasunout","zatajit","zatemnit","zatknout","zaujmout","zavalit","zavelet","zavinit","zavolat","zavrtat","zazvonit","zbavit","zbrusu","zbudovat","zbytek","zdaleka","zdarma","zdatnost","zdivo","zdobit","zdroj","zdvih","zdymadlo","zelenina","zeman","zemina","zeptat","zezadu","zezdola","zhatit","zhltnout","zhluboka","zhotovit","zhruba","zima","zimnice","zjemnit","zklamat","zkoumat","zkratka","zkumavka","zlato","zlehka","zloba","zlom","zlost","zlozvyk","zmapovat","zmar","zmatek","zmije","zmizet","zmocnit","zmodrat","zmrzlina","zmutovat","znak","znalost","znamenat","znovu","zobrazit","zotavit","zoubek","zoufale","zplodit","zpomalit","zprava","zprostit","zprudka","zprvu","zrada","zranit","zrcadlo","zrnitost","zrno","zrovna","zrychlit","zrzavost","zticha","ztratit","zubovina","zubr","zvednout","zvenku","zvesela","zvon","zvrat","zvukovod","zvyk"]')},function(e){e.exports=JSON.parse('["的","一","是","在","不","了","有","和","人","这","中","大","为","上","个","国","我","以","要","他","时","来","用","们","生","到","作","地","于","出","就","分","对","成","会","可","主","发","年","动","同","工","也","能","下","过","子","说","产","种","面","而","方","后","多","定","行","学","法","所","民","得","经","十","三","之","进","着","等","部","度","家","电","力","里","如","水","化","高","自","二","理","起","小","物","现","实","加","量","都","两","体","制","机","当","使","点","从","业","本","去","把","性","好","应","开","它","合","还","因","由","其","些","然","前","外","天","政","四","日","那","社","义","事","平","形","相","全","表","间","样","与","关","各","重","新","线","内","数","正","心","反","你","明","看","原","又","么","利","比","或","但","质","气","第","向","道","命","此","变","条","只","没","结","解","问","意","建","月","公","无","系","军","很","情","者","最","立","代","想","已","通","并","提","直","题","党","程","展","五","果","料","象","员","革","位","入","常","文","总","次","品","式","活","设","及","管","特","件","长","求","老","头","基","资","边","流","路","级","少","图","山","统","接","知","较","将","组","见","计","别","她","手","角","期","根","论","运","农","指","几","九","区","强","放","决","西","被","干","做","必","战","先","回","则","任","取","据","处","队","南","给","色","光","门","即","保","治","北","造","百","规","热","领","七","海","口","东","导","器","压","志","世","金","增","争","济","阶","油","思","术","极","交","受","联","什","认","六","共","权","收","证","改","清","美","再","采","转","更","单","风","切","打","白","教","速","花","带","安","场","身","车","例","真","务","具","万","每","目","至","达","走","积","示","议","声","报","斗","完","类","八","离","华","名","确","才","科","张","信","马","节","话","米","整","空","元","况","今","集","温","传","土","许","步","群","广","石","记","需","段","研","界","拉","林","律","叫","且","究","观","越","织","装","影","算","低","持","音","众","书","布","复","容","儿","须","际","商","非","验","连","断","深","难","近","矿","千","周","委","素","技","备","半","办","青","省","列","习","响","约","支","般","史","感","劳","便","团","往","酸","历","市","克","何","除","消","构","府","称","太","准","精","值","号","率","族","维","划","选","标","写","存","候","毛","亲","快","效","斯","院","查","江","型","眼","王","按","格","养","易","置","派","层","片","始","却","专","状","育","厂","京","识","适","属","圆","包","火","住","调","满","县","局","照","参","红","细","引","听","该","铁","价","严","首","底","液","官","德","随","病","苏","失","尔","死","讲","配","女","黄","推","显","谈","罪","神","艺","呢","席","含","企","望","密","批","营","项","防","举","球","英","氧","势","告","李","台","落","木","帮","轮","破","亚","师","围","注","远","字","材","排","供","河","态","封","另","施","减","树","溶","怎","止","案","言","士","均","武","固","叶","鱼","波","视","仅","费","紧","爱","左","章","早","朝","害","续","轻","服","试","食","充","兵","源","判","护","司","足","某","练","差","致","板","田","降","黑","犯","负","击","范","继","兴","似","余","坚","曲","输","修","故","城","夫","够","送","笔","船","占","右","财","吃","富","春","职","觉","汉","画","功","巴","跟","虽","杂","飞","检","吸","助","升","阳","互","初","创","抗","考","投","坏","策","古","径","换","未","跑","留","钢","曾","端","责","站","简","述","钱","副","尽","帝","射","草","冲","承","独","令","限","阿","宣","环","双","请","超","微","让","控","州","良","轴","找","否","纪","益","依","优","顶","础","载","倒","房","突","坐","粉","敌","略","客","袁","冷","胜","绝","析","块","剂","测","丝","协","诉","念","陈","仍","罗","盐","友","洋","错","苦","夜","刑","移","频","逐","靠","混","母","短","皮","终","聚","汽","村","云","哪","既","距","卫","停","烈","央","察","烧","迅","境","若","印","洲","刻","括","激","孔","搞","甚","室","待","核","校","散","侵","吧","甲","游","久","菜","味","旧","模","湖","货","损","预","阻","毫","普","稳","乙","妈","植","息","扩","银","语","挥","酒","守","拿","序","纸","医","缺","雨","吗","针","刘","啊","急","唱","误","训","愿","审","附","获","茶","鲜","粮","斤","孩","脱","硫","肥","善","龙","演","父","渐","血","欢","械","掌","歌","沙","刚","攻","谓","盾","讨","晚","粒","乱","燃","矛","乎","杀","药","宁","鲁","贵","钟","煤","读","班","伯","香","介","迫","句","丰","培","握","兰","担","弦","蛋","沉","假","穿","执","答","乐","谁","顺","烟","缩","征","脸","喜","松","脚","困","异","免","背","星","福","买","染","井","概","慢","怕","磁","倍","祖","皇","促","静","补","评","翻","肉","践","尼","衣","宽","扬","棉","希","伤","操","垂","秋","宜","氢","套","督","振","架","亮","末","宪","庆","编","牛","触","映","雷","销","诗","座","居","抓","裂","胞","呼","娘","景","威","绿","晶","厚","盟","衡","鸡","孙","延","危","胶","屋","乡","临","陆","顾","掉","呀","灯","岁","措","束","耐","剧","玉","赵","跳","哥","季","课","凯","胡","额","款","绍","卷","齐","伟","蒸","殖","永","宗","苗","川","炉","岩","弱","零","杨","奏","沿","露","杆","探","滑","镇","饭","浓","航","怀","赶","库","夺","伊","灵","税","途","灭","赛","归","召","鼓","播","盘","裁","险","康","唯","录","菌","纯","借","糖","盖","横","符","私","努","堂","域","枪","润","幅","哈","竟","熟","虫","泽","脑","壤","碳","欧","遍","侧","寨","敢","彻","虑","斜","薄","庭","纳","弹","饲","伸","折","麦","湿","暗","荷","瓦","塞","床","筑","恶","户","访","塔","奇","透","梁","刀","旋","迹","卡","氯","遇","份","毒","泥","退","洗","摆","灰","彩","卖","耗","夏","择","忙","铜","献","硬","予","繁","圈","雪","函","亦","抽","篇","阵","阴","丁","尺","追","堆","雄","迎","泛","爸","楼","避","谋","吨","野","猪","旗","累","偏","典","馆","索","秦","脂","潮","爷","豆","忽","托","惊","塑","遗","愈","朱","替","纤","粗","倾","尚","痛","楚","谢","奋","购","磨","君","池","旁","碎","骨","监","捕","弟","暴","割","贯","殊","释","词","亡","壁","顿","宝","午","尘","闻","揭","炮","残","冬","桥","妇","警","综","招","吴","付","浮","遭","徐","您","摇","谷","赞","箱","隔","订","男","吹","园","纷","唐","败","宋","玻","巨","耕","坦","荣","闭","湾","键","凡","驻","锅","救","恩","剥","凝","碱","齿","截","炼","麻","纺","禁","废","盛","版","缓","净","睛","昌","婚","涉","筒","嘴","插","岸","朗","庄","街","藏","姑","贸","腐","奴","啦","惯","乘","伙","恢","匀","纱","扎","辩","耳","彪","臣","亿","璃","抵","脉","秀","萨","俄","网","舞","店","喷","纵","寸","汗","挂","洪","贺","闪","柬","爆","烯","津","稻","墙","软","勇","像","滚","厘","蒙","芳","肯","坡","柱","荡","腿","仪","旅","尾","轧","冰","贡","登","黎","削","钻","勒","逃","障","氨","郭","峰","币","港","伏","轨","亩","毕","擦","莫","刺","浪","秘","援","株","健","售","股","岛","甘","泡","睡","童","铸","汤","阀","休","汇","舍","牧","绕","炸","哲","磷","绩","朋","淡","尖","启","陷","柴","呈","徒","颜","泪","稍","忘","泵","蓝","拖","洞","授","镜","辛","壮","锋","贫","虚","弯","摩","泰","幼","廷","尊","窗","纲","弄","隶","疑","氏","宫","姐","震","瑞","怪","尤","琴","循","描","膜","违","夹","腰","缘","珠","穷","森","枝","竹","沟","催","绳","忆","邦","剩","幸","浆","栏","拥","牙","贮","礼","滤","钠","纹","罢","拍","咱","喊","袖","埃","勤","罚","焦","潜","伍","墨","欲","缝","姓","刊","饱","仿","奖","铝","鬼","丽","跨","默","挖","链","扫","喝","袋","炭","污","幕","诸","弧","励","梅","奶","洁","灾","舟","鉴","苯","讼","抱","毁","懂","寒","智","埔","寄","届","跃","渡","挑","丹","艰","贝","碰","拔","爹","戴","码","梦","芽","熔","赤","渔","哭","敬","颗","奔","铅","仲","虎","稀","妹","乏","珍","申","桌","遵","允","隆","螺","仓","魏","锐","晓","氮","兼","隐","碍","赫","拨","忠","肃","缸","牵","抢","博","巧","壳","兄","杜","讯","诚","碧","祥","柯","页","巡","矩","悲","灌","龄","伦","票","寻","桂","铺","圣","恐","恰","郑","趣","抬","荒","腾","贴","柔","滴","猛","阔","辆","妻","填","撤","储","签","闹","扰","紫","砂","递","戏","吊","陶","伐","喂","疗","瓶","婆","抚","臂","摸","忍","虾","蜡","邻","胸","巩","挤","偶","弃","槽","劲","乳","邓","吉","仁","烂","砖","租","乌","舰","伴","瓜","浅","丙","暂","燥","橡","柳","迷","暖","牌","秧","胆","详","簧","踏","瓷","谱","呆","宾","糊","洛","辉","愤","竞","隙","怒","粘","乃","绪","肩","籍","敏","涂","熙","皆","侦","悬","掘","享","纠","醒","狂","锁","淀","恨","牲","霸","爬","赏","逆","玩","陵","祝","秒","浙","貌","役","彼","悉","鸭","趋","凤","晨","畜","辈","秩","卵","署","梯","炎","滩","棋","驱","筛","峡","冒","啥","寿","译","浸","泉","帽","迟","硅","疆","贷","漏","稿","冠","嫩","胁","芯","牢","叛","蚀","奥","鸣","岭","羊","凭","串","塘","绘","酵","融","盆","锡","庙","筹","冻","辅","摄","袭","筋","拒","僚","旱","钾","鸟","漆","沈","眉","疏","添","棒","穗","硝","韩","逼","扭","侨","凉","挺","碗","栽","炒","杯","患","馏","劝","豪","辽","勃","鸿","旦","吏","拜","狗","埋","辊","掩","饮","搬","骂","辞","勾","扣","估","蒋","绒","雾","丈","朵","姆","拟","宇","辑","陕","雕","偿","蓄","崇","剪","倡","厅","咬","驶","薯","刷","斥","番","赋","奉","佛","浇","漫","曼","扇","钙","桃","扶","仔","返","俗","亏","腔","鞋","棱","覆","框","悄","叔","撞","骗","勘","旺","沸","孤","吐","孟","渠","屈","疾","妙","惜","仰","狠","胀","谐","抛","霉","桑","岗","嘛","衰","盗","渗","脏","赖","涌","甜","曹","阅","肌","哩","厉","烃","纬","毅","昨","伪","症","煮","叹","钉","搭","茎","笼","酷","偷","弓","锥","恒","杰","坑","鼻","翼","纶","叙","狱","逮","罐","络","棚","抑","膨","蔬","寺","骤","穆","冶","枯","册","尸","凸","绅","坯","牺","焰","轰","欣","晋","瘦","御","锭","锦","丧","旬","锻","垄","搜","扑","邀","亭","酯","迈","舒","脆","酶","闲","忧","酚","顽","羽","涨","卸","仗","陪","辟","惩","杭","姚","肚","捉","飘","漂","昆","欺","吾","郎","烷","汁","呵","饰","萧","雅","邮","迁","燕","撒","姻","赴","宴","烦","债","帐","斑","铃","旨","醇","董","饼","雏","姿","拌","傅","腹","妥","揉","贤","拆","歪","葡","胺","丢","浩","徽","昂","垫","挡","览","贪","慰","缴","汪","慌","冯","诺","姜","谊","凶","劣","诬","耀","昏","躺","盈","骑","乔","溪","丛","卢","抹","闷","咨","刮","驾","缆","悟","摘","铒","掷","颇","幻","柄","惠","惨","佳","仇","腊","窝","涤","剑","瞧","堡","泼","葱","罩","霍","捞","胎","苍","滨","俩","捅","湘","砍","霞","邵","萄","疯","淮","遂","熊","粪","烘","宿","档","戈","驳","嫂","裕","徙","箭","捐","肠","撑","晒","辨","殿","莲","摊","搅","酱","屏","疫","哀","蔡","堵","沫","皱","畅","叠","阁","莱","敲","辖","钩","痕","坝","巷","饿","祸","丘","玄","溜","曰","逻","彭","尝","卿","妨","艇","吞","韦","怨","矮","歇"]')},function(e){e.exports=JSON.parse('["的","一","是","在","不","了","有","和","人","這","中","大","為","上","個","國","我","以","要","他","時","來","用","們","生","到","作","地","於","出","就","分","對","成","會","可","主","發","年","動","同","工","也","能","下","過","子","說","產","種","面","而","方","後","多","定","行","學","法","所","民","得","經","十","三","之","進","著","等","部","度","家","電","力","裡","如","水","化","高","自","二","理","起","小","物","現","實","加","量","都","兩","體","制","機","當","使","點","從","業","本","去","把","性","好","應","開","它","合","還","因","由","其","些","然","前","外","天","政","四","日","那","社","義","事","平","形","相","全","表","間","樣","與","關","各","重","新","線","內","數","正","心","反","你","明","看","原","又","麼","利","比","或","但","質","氣","第","向","道","命","此","變","條","只","沒","結","解","問","意","建","月","公","無","系","軍","很","情","者","最","立","代","想","已","通","並","提","直","題","黨","程","展","五","果","料","象","員","革","位","入","常","文","總","次","品","式","活","設","及","管","特","件","長","求","老","頭","基","資","邊","流","路","級","少","圖","山","統","接","知","較","將","組","見","計","別","她","手","角","期","根","論","運","農","指","幾","九","區","強","放","決","西","被","幹","做","必","戰","先","回","則","任","取","據","處","隊","南","給","色","光","門","即","保","治","北","造","百","規","熱","領","七","海","口","東","導","器","壓","志","世","金","增","爭","濟","階","油","思","術","極","交","受","聯","什","認","六","共","權","收","證","改","清","美","再","採","轉","更","單","風","切","打","白","教","速","花","帶","安","場","身","車","例","真","務","具","萬","每","目","至","達","走","積","示","議","聲","報","鬥","完","類","八","離","華","名","確","才","科","張","信","馬","節","話","米","整","空","元","況","今","集","溫","傳","土","許","步","群","廣","石","記","需","段","研","界","拉","林","律","叫","且","究","觀","越","織","裝","影","算","低","持","音","眾","書","布","复","容","兒","須","際","商","非","驗","連","斷","深","難","近","礦","千","週","委","素","技","備","半","辦","青","省","列","習","響","約","支","般","史","感","勞","便","團","往","酸","歷","市","克","何","除","消","構","府","稱","太","準","精","值","號","率","族","維","劃","選","標","寫","存","候","毛","親","快","效","斯","院","查","江","型","眼","王","按","格","養","易","置","派","層","片","始","卻","專","狀","育","廠","京","識","適","屬","圓","包","火","住","調","滿","縣","局","照","參","紅","細","引","聽","該","鐵","價","嚴","首","底","液","官","德","隨","病","蘇","失","爾","死","講","配","女","黃","推","顯","談","罪","神","藝","呢","席","含","企","望","密","批","營","項","防","舉","球","英","氧","勢","告","李","台","落","木","幫","輪","破","亞","師","圍","注","遠","字","材","排","供","河","態","封","另","施","減","樹","溶","怎","止","案","言","士","均","武","固","葉","魚","波","視","僅","費","緊","愛","左","章","早","朝","害","續","輕","服","試","食","充","兵","源","判","護","司","足","某","練","差","致","板","田","降","黑","犯","負","擊","范","繼","興","似","餘","堅","曲","輸","修","故","城","夫","夠","送","筆","船","佔","右","財","吃","富","春","職","覺","漢","畫","功","巴","跟","雖","雜","飛","檢","吸","助","昇","陽","互","初","創","抗","考","投","壞","策","古","徑","換","未","跑","留","鋼","曾","端","責","站","簡","述","錢","副","盡","帝","射","草","衝","承","獨","令","限","阿","宣","環","雙","請","超","微","讓","控","州","良","軸","找","否","紀","益","依","優","頂","礎","載","倒","房","突","坐","粉","敵","略","客","袁","冷","勝","絕","析","塊","劑","測","絲","協","訴","念","陳","仍","羅","鹽","友","洋","錯","苦","夜","刑","移","頻","逐","靠","混","母","短","皮","終","聚","汽","村","雲","哪","既","距","衛","停","烈","央","察","燒","迅","境","若","印","洲","刻","括","激","孔","搞","甚","室","待","核","校","散","侵","吧","甲","遊","久","菜","味","舊","模","湖","貨","損","預","阻","毫","普","穩","乙","媽","植","息","擴","銀","語","揮","酒","守","拿","序","紙","醫","缺","雨","嗎","針","劉","啊","急","唱","誤","訓","願","審","附","獲","茶","鮮","糧","斤","孩","脫","硫","肥","善","龍","演","父","漸","血","歡","械","掌","歌","沙","剛","攻","謂","盾","討","晚","粒","亂","燃","矛","乎","殺","藥","寧","魯","貴","鐘","煤","讀","班","伯","香","介","迫","句","豐","培","握","蘭","擔","弦","蛋","沉","假","穿","執","答","樂","誰","順","煙","縮","徵","臉","喜","松","腳","困","異","免","背","星","福","買","染","井","概","慢","怕","磁","倍","祖","皇","促","靜","補","評","翻","肉","踐","尼","衣","寬","揚","棉","希","傷","操","垂","秋","宜","氫","套","督","振","架","亮","末","憲","慶","編","牛","觸","映","雷","銷","詩","座","居","抓","裂","胞","呼","娘","景","威","綠","晶","厚","盟","衡","雞","孫","延","危","膠","屋","鄉","臨","陸","顧","掉","呀","燈","歲","措","束","耐","劇","玉","趙","跳","哥","季","課","凱","胡","額","款","紹","卷","齊","偉","蒸","殖","永","宗","苗","川","爐","岩","弱","零","楊","奏","沿","露","桿","探","滑","鎮","飯","濃","航","懷","趕","庫","奪","伊","靈","稅","途","滅","賽","歸","召","鼓","播","盤","裁","險","康","唯","錄","菌","純","借","糖","蓋","橫","符","私","努","堂","域","槍","潤","幅","哈","竟","熟","蟲","澤","腦","壤","碳","歐","遍","側","寨","敢","徹","慮","斜","薄","庭","納","彈","飼","伸","折","麥","濕","暗","荷","瓦","塞","床","築","惡","戶","訪","塔","奇","透","梁","刀","旋","跡","卡","氯","遇","份","毒","泥","退","洗","擺","灰","彩","賣","耗","夏","擇","忙","銅","獻","硬","予","繁","圈","雪","函","亦","抽","篇","陣","陰","丁","尺","追","堆","雄","迎","泛","爸","樓","避","謀","噸","野","豬","旗","累","偏","典","館","索","秦","脂","潮","爺","豆","忽","托","驚","塑","遺","愈","朱","替","纖","粗","傾","尚","痛","楚","謝","奮","購","磨","君","池","旁","碎","骨","監","捕","弟","暴","割","貫","殊","釋","詞","亡","壁","頓","寶","午","塵","聞","揭","炮","殘","冬","橋","婦","警","綜","招","吳","付","浮","遭","徐","您","搖","谷","贊","箱","隔","訂","男","吹","園","紛","唐","敗","宋","玻","巨","耕","坦","榮","閉","灣","鍵","凡","駐","鍋","救","恩","剝","凝","鹼","齒","截","煉","麻","紡","禁","廢","盛","版","緩","淨","睛","昌","婚","涉","筒","嘴","插","岸","朗","莊","街","藏","姑","貿","腐","奴","啦","慣","乘","夥","恢","勻","紗","扎","辯","耳","彪","臣","億","璃","抵","脈","秀","薩","俄","網","舞","店","噴","縱","寸","汗","掛","洪","賀","閃","柬","爆","烯","津","稻","牆","軟","勇","像","滾","厘","蒙","芳","肯","坡","柱","盪","腿","儀","旅","尾","軋","冰","貢","登","黎","削","鑽","勒","逃","障","氨","郭","峰","幣","港","伏","軌","畝","畢","擦","莫","刺","浪","秘","援","株","健","售","股","島","甘","泡","睡","童","鑄","湯","閥","休","匯","舍","牧","繞","炸","哲","磷","績","朋","淡","尖","啟","陷","柴","呈","徒","顏","淚","稍","忘","泵","藍","拖","洞","授","鏡","辛","壯","鋒","貧","虛","彎","摩","泰","幼","廷","尊","窗","綱","弄","隸","疑","氏","宮","姐","震","瑞","怪","尤","琴","循","描","膜","違","夾","腰","緣","珠","窮","森","枝","竹","溝","催","繩","憶","邦","剩","幸","漿","欄","擁","牙","貯","禮","濾","鈉","紋","罷","拍","咱","喊","袖","埃","勤","罰","焦","潛","伍","墨","欲","縫","姓","刊","飽","仿","獎","鋁","鬼","麗","跨","默","挖","鏈","掃","喝","袋","炭","污","幕","諸","弧","勵","梅","奶","潔","災","舟","鑑","苯","訟","抱","毀","懂","寒","智","埔","寄","屆","躍","渡","挑","丹","艱","貝","碰","拔","爹","戴","碼","夢","芽","熔","赤","漁","哭","敬","顆","奔","鉛","仲","虎","稀","妹","乏","珍","申","桌","遵","允","隆","螺","倉","魏","銳","曉","氮","兼","隱","礙","赫","撥","忠","肅","缸","牽","搶","博","巧","殼","兄","杜","訊","誠","碧","祥","柯","頁","巡","矩","悲","灌","齡","倫","票","尋","桂","鋪","聖","恐","恰","鄭","趣","抬","荒","騰","貼","柔","滴","猛","闊","輛","妻","填","撤","儲","簽","鬧","擾","紫","砂","遞","戲","吊","陶","伐","餵","療","瓶","婆","撫","臂","摸","忍","蝦","蠟","鄰","胸","鞏","擠","偶","棄","槽","勁","乳","鄧","吉","仁","爛","磚","租","烏","艦","伴","瓜","淺","丙","暫","燥","橡","柳","迷","暖","牌","秧","膽","詳","簧","踏","瓷","譜","呆","賓","糊","洛","輝","憤","競","隙","怒","粘","乃","緒","肩","籍","敏","塗","熙","皆","偵","懸","掘","享","糾","醒","狂","鎖","淀","恨","牲","霸","爬","賞","逆","玩","陵","祝","秒","浙","貌","役","彼","悉","鴨","趨","鳳","晨","畜","輩","秩","卵","署","梯","炎","灘","棋","驅","篩","峽","冒","啥","壽","譯","浸","泉","帽","遲","矽","疆","貸","漏","稿","冠","嫩","脅","芯","牢","叛","蝕","奧","鳴","嶺","羊","憑","串","塘","繪","酵","融","盆","錫","廟","籌","凍","輔","攝","襲","筋","拒","僚","旱","鉀","鳥","漆","沈","眉","疏","添","棒","穗","硝","韓","逼","扭","僑","涼","挺","碗","栽","炒","杯","患","餾","勸","豪","遼","勃","鴻","旦","吏","拜","狗","埋","輥","掩","飲","搬","罵","辭","勾","扣","估","蔣","絨","霧","丈","朵","姆","擬","宇","輯","陝","雕","償","蓄","崇","剪","倡","廳","咬","駛","薯","刷","斥","番","賦","奉","佛","澆","漫","曼","扇","鈣","桃","扶","仔","返","俗","虧","腔","鞋","棱","覆","框","悄","叔","撞","騙","勘","旺","沸","孤","吐","孟","渠","屈","疾","妙","惜","仰","狠","脹","諧","拋","黴","桑","崗","嘛","衰","盜","滲","臟","賴","湧","甜","曹","閱","肌","哩","厲","烴","緯","毅","昨","偽","症","煮","嘆","釘","搭","莖","籠","酷","偷","弓","錐","恆","傑","坑","鼻","翼","綸","敘","獄","逮","罐","絡","棚","抑","膨","蔬","寺","驟","穆","冶","枯","冊","屍","凸","紳","坯","犧","焰","轟","欣","晉","瘦","禦","錠","錦","喪","旬","鍛","壟","搜","撲","邀","亭","酯","邁","舒","脆","酶","閒","憂","酚","頑","羽","漲","卸","仗","陪","闢","懲","杭","姚","肚","捉","飄","漂","昆","欺","吾","郎","烷","汁","呵","飾","蕭","雅","郵","遷","燕","撒","姻","赴","宴","煩","債","帳","斑","鈴","旨","醇","董","餅","雛","姿","拌","傅","腹","妥","揉","賢","拆","歪","葡","胺","丟","浩","徽","昂","墊","擋","覽","貪","慰","繳","汪","慌","馮","諾","姜","誼","兇","劣","誣","耀","昏","躺","盈","騎","喬","溪","叢","盧","抹","悶","諮","刮","駕","纜","悟","摘","鉺","擲","頗","幻","柄","惠","慘","佳","仇","臘","窩","滌","劍","瞧","堡","潑","蔥","罩","霍","撈","胎","蒼","濱","倆","捅","湘","砍","霞","邵","萄","瘋","淮","遂","熊","糞","烘","宿","檔","戈","駁","嫂","裕","徙","箭","捐","腸","撐","曬","辨","殿","蓮","攤","攪","醬","屏","疫","哀","蔡","堵","沫","皺","暢","疊","閣","萊","敲","轄","鉤","痕","壩","巷","餓","禍","丘","玄","溜","曰","邏","彭","嘗","卿","妨","艇","吞","韋","怨","矮","歇"]')},function(e){e.exports=JSON.parse('["가격","가끔","가난","가능","가득","가르침","가뭄","가방","가상","가슴","가운데","가을","가이드","가입","가장","가정","가족","가죽","각오","각자","간격","간부","간섭","간장","간접","간판","갈등","갈비","갈색","갈증","감각","감기","감소","감수성","감자","감정","갑자기","강남","강당","강도","강력히","강변","강북","강사","강수량","강아지","강원도","강의","강제","강조","같이","개구리","개나리","개방","개별","개선","개성","개인","객관적","거실","거액","거울","거짓","거품","걱정","건강","건물","건설","건조","건축","걸음","검사","검토","게시판","게임","겨울","견해","결과","결국","결론","결석","결승","결심","결정","결혼","경계","경고","경기","경력","경복궁","경비","경상도","경영","경우","경쟁","경제","경주","경찰","경치","경향","경험","계곡","계단","계란","계산","계속","계약","계절","계층","계획","고객","고구려","고궁","고급","고등학생","고무신","고민","고양이","고장","고전","고집","고춧가루","고통","고향","곡식","골목","골짜기","골프","공간","공개","공격","공군","공급","공기","공동","공무원","공부","공사","공식","공업","공연","공원","공장","공짜","공책","공통","공포","공항","공휴일","과목","과일","과장","과정","과학","관객","관계","관광","관념","관람","관련","관리","관습","관심","관점","관찰","광경","광고","광장","광주","괴로움","굉장히","교과서","교문","교복","교실","교양","교육","교장","교직","교통","교환","교훈","구경","구름","구멍","구별","구분","구석","구성","구속","구역","구입","구청","구체적","국가","국기","국내","국립","국물","국민","국수","국어","국왕","국적","국제","국회","군대","군사","군인","궁극적","권리","권위","권투","귀국","귀신","규정","규칙","균형","그날","그냥","그늘","그러나","그룹","그릇","그림","그제서야","그토록","극복","극히","근거","근교","근래","근로","근무","근본","근원","근육","근처","글씨","글자","금강산","금고","금년","금메달","금액","금연","금요일","금지","긍정적","기간","기관","기념","기능","기독교","기둥","기록","기름","기법","기본","기분","기쁨","기숙사","기술","기억","기업","기온","기운","기원","기적","기준","기침","기혼","기획","긴급","긴장","길이","김밥","김치","김포공항","깍두기","깜빡","깨달음","깨소금","껍질","꼭대기","꽃잎","나들이","나란히","나머지","나물","나침반","나흘","낙엽","난방","날개","날씨","날짜","남녀","남대문","남매","남산","남자","남편","남학생","낭비","낱말","내년","내용","내일","냄비","냄새","냇물","냉동","냉면","냉방","냉장고","넥타이","넷째","노동","노란색","노력","노인","녹음","녹차","녹화","논리","논문","논쟁","놀이","농구","농담","농민","농부","농업","농장","농촌","높이","눈동자","눈물","눈썹","뉴욕","느낌","늑대","능동적","능력","다방","다양성","다음","다이어트","다행","단계","단골","단독","단맛","단순","단어","단위","단점","단체","단추","단편","단풍","달걀","달러","달력","달리","닭고기","담당","담배","담요","담임","답변","답장","당근","당분간","당연히","당장","대규모","대낮","대단히","대답","대도시","대략","대량","대륙","대문","대부분","대신","대응","대장","대전","대접","대중","대책","대출","대충","대통령","대학","대한민국","대합실","대형","덩어리","데이트","도대체","도덕","도둑","도망","도서관","도심","도움","도입","도자기","도저히","도전","도중","도착","독감","독립","독서","독일","독창적","동화책","뒷모습","뒷산","딸아이","마누라","마늘","마당","마라톤","마련","마무리","마사지","마약","마요네즈","마을","마음","마이크","마중","마지막","마찬가지","마찰","마흔","막걸리","막내","막상","만남","만두","만세","만약","만일","만점","만족","만화","많이","말기","말씀","말투","맘대로","망원경","매년","매달","매력","매번","매스컴","매일","매장","맥주","먹이","먼저","먼지","멀리","메일","며느리","며칠","면담","멸치","명단","명령","명예","명의","명절","명칭","명함","모금","모니터","모델","모든","모범","모습","모양","모임","모조리","모집","모퉁이","목걸이","목록","목사","목소리","목숨","목적","목표","몰래","몸매","몸무게","몸살","몸속","몸짓","몸통","몹시","무관심","무궁화","무더위","무덤","무릎","무슨","무엇","무역","무용","무조건","무지개","무척","문구","문득","문법","문서","문제","문학","문화","물가","물건","물결","물고기","물론","물리학","물음","물질","물체","미국","미디어","미사일","미술","미역","미용실","미움","미인","미팅","미혼","민간","민족","민주","믿음","밀가루","밀리미터","밑바닥","바가지","바구니","바나나","바늘","바닥","바닷가","바람","바이러스","바탕","박물관","박사","박수","반대","반드시","반말","반발","반성","반응","반장","반죽","반지","반찬","받침","발가락","발걸음","발견","발달","발레","발목","발바닥","발생","발음","발자국","발전","발톱","발표","밤하늘","밥그릇","밥맛","밥상","밥솥","방금","방면","방문","방바닥","방법","방송","방식","방안","방울","방지","방학","방해","방향","배경","배꼽","배달","배드민턴","백두산","백색","백성","백인","백제","백화점","버릇","버섯","버튼","번개","번역","번지","번호","벌금","벌레","벌써","범위","범인","범죄","법률","법원","법적","법칙","베이징","벨트","변경","변동","변명","변신","변호사","변화","별도","별명","별일","병실","병아리","병원","보관","보너스","보라색","보람","보름","보상","보안","보자기","보장","보전","보존","보통","보편적","보험","복도","복사","복숭아","복습","볶음","본격적","본래","본부","본사","본성","본인","본질","볼펜","봉사","봉지","봉투","부근","부끄러움","부담","부동산","부문","부분","부산","부상","부엌","부인","부작용","부장","부정","부족","부지런히","부친","부탁","부품","부회장","북부","북한","분노","분량","분리","분명","분석","분야","분위기","분필","분홍색","불고기","불과","불교","불꽃","불만","불법","불빛","불안","불이익","불행","브랜드","비극","비난","비닐","비둘기","비디오","비로소","비만","비명","비밀","비바람","비빔밥","비상","비용","비율","비중","비타민","비판","빌딩","빗물","빗방울","빗줄기","빛깔","빨간색","빨래","빨리","사건","사계절","사나이","사냥","사람","사랑","사립","사모님","사물","사방","사상","사생활","사설","사슴","사실","사업","사용","사월","사장","사전","사진","사촌","사춘기","사탕","사투리","사흘","산길","산부인과","산업","산책","살림","살인","살짝","삼계탕","삼국","삼십","삼월","삼촌","상관","상금","상대","상류","상반기","상상","상식","상업","상인","상자","상점","상처","상추","상태","상표","상품","상황","새벽","색깔","색연필","생각","생명","생물","생방송","생산","생선","생신","생일","생활","서랍","서른","서명","서민","서비스","서양","서울","서적","서점","서쪽","서클","석사","석유","선거","선물","선배","선생","선수","선원","선장","선전","선택","선풍기","설거지","설날","설렁탕","설명","설문","설사","설악산","설치","설탕","섭씨","성공","성당","성명","성별","성인","성장","성적","성질","성함","세금","세미나","세상","세월","세종대왕","세탁","센터","센티미터","셋째","소규모","소극적","소금","소나기","소년","소득","소망","소문","소설","소속","소아과","소용","소원","소음","소중히","소지품","소질","소풍","소형","속담","속도","속옷","손가락","손길","손녀","손님","손등","손목","손뼉","손실","손질","손톱","손해","솔직히","솜씨","송아지","송이","송편","쇠고기","쇼핑","수건","수년","수단","수돗물","수동적","수면","수명","수박","수상","수석","수술","수시로","수업","수염","수영","수입","수준","수집","수출","수컷","수필","수학","수험생","수화기","숙녀","숙소","숙제","순간","순서","순수","순식간","순위","숟가락","술병","술집","숫자","스님","스물","스스로","스승","스웨터","스위치","스케이트","스튜디오","스트레스","스포츠","슬쩍","슬픔","습관","습기","승객","승리","승부","승용차","승진","시각","시간","시골","시금치","시나리오","시댁","시리즈","시멘트","시민","시부모","시선","시설","시스템","시아버지","시어머니","시월","시인","시일","시작","시장","시절","시점","시중","시즌","시집","시청","시합","시험","식구","식기","식당","식량","식료품","식물","식빵","식사","식생활","식초","식탁","식품","신고","신규","신념","신문","신발","신비","신사","신세","신용","신제품","신청","신체","신화","실감","실내","실력","실례","실망","실수","실습","실시","실장","실정","실질적","실천","실체","실컷","실태","실패","실험","실현","심리","심부름","심사","심장","심정","심판","쌍둥이","씨름","씨앗","아가씨","아나운서","아드님","아들","아쉬움","아스팔트","아시아","아울러","아저씨","아줌마","아직","아침","아파트","아프리카","아픔","아홉","아흔","악기","악몽","악수","안개","안경","안과","안내","안녕","안동","안방","안부","안주","알루미늄","알코올","암시","암컷","압력","앞날","앞문","애인","애정","액수","앨범","야간","야단","야옹","약간","약국","약속","약수","약점","약품","약혼녀","양념","양력","양말","양배추","양주","양파","어둠","어려움","어른","어젯밤","어쨌든","어쩌다가","어쩐지","언니","언덕","언론","언어","얼굴","얼른","얼음","얼핏","엄마","업무","업종","업체","엉덩이","엉망","엉터리","엊그제","에너지","에어컨","엔진","여건","여고생","여관","여군","여권","여대생","여덟","여동생","여든","여론","여름","여섯","여성","여왕","여인","여전히","여직원","여학생","여행","역사","역시","역할","연결","연구","연극","연기","연락","연설","연세","연속","연습","연애","연예인","연인","연장","연주","연출","연필","연합","연휴","열기","열매","열쇠","열심히","열정","열차","열흘","염려","엽서","영국","영남","영상","영양","영역","영웅","영원히","영하","영향","영혼","영화","옆구리","옆방","옆집","예감","예금","예방","예산","예상","예선","예술","예습","예식장","예약","예전","예절","예정","예컨대","옛날","오늘","오락","오랫동안","오렌지","오로지","오른발","오븐","오십","오염","오월","오전","오직","오징어","오페라","오피스텔","오히려","옥상","옥수수","온갖","온라인","온몸","온종일","온통","올가을","올림픽","올해","옷차림","와이셔츠","와인","완성","완전","왕비","왕자","왜냐하면","왠지","외갓집","외국","외로움","외삼촌","외출","외침","외할머니","왼발","왼손","왼쪽","요금","요일","요즘","요청","용기","용서","용어","우산","우선","우승","우연히","우정","우체국","우편","운동","운명","운반","운전","운행","울산","울음","움직임","웃어른","웃음","워낙","원고","원래","원서","원숭이","원인","원장","원피스","월급","월드컵","월세","월요일","웨이터","위반","위법","위성","위원","위험","위협","윗사람","유난히","유럽","유명","유물","유산","유적","유치원","유학","유행","유형","육군","육상","육십","육체","은행","음력","음료","음반","음성","음식","음악","음주","의견","의논","의문","의복","의식","의심","의외로","의욕","의원","의학","이것","이곳","이념","이놈","이달","이대로","이동","이렇게","이력서","이론적","이름","이민","이발소","이별","이불","이빨","이상","이성","이슬","이야기","이용","이웃","이월","이윽고","이익","이전","이중","이튿날","이틀","이혼","인간","인격","인공","인구","인근","인기","인도","인류","인물","인생","인쇄","인연","인원","인재","인종","인천","인체","인터넷","인하","인형","일곱","일기","일단","일대","일등","일반","일본","일부","일상","일생","일손","일요일","일월","일정","일종","일주일","일찍","일체","일치","일행","일회용","임금","임무","입대","입력","입맛","입사","입술","입시","입원","입장","입학","자가용","자격","자극","자동","자랑","자부심","자식","자신","자연","자원","자율","자전거","자정","자존심","자판","작가","작년","작성","작업","작용","작은딸","작품","잔디","잔뜩","잔치","잘못","잠깐","잠수함","잠시","잠옷","잠자리","잡지","장관","장군","장기간","장래","장례","장르","장마","장면","장모","장미","장비","장사","장소","장식","장애인","장인","장점","장차","장학금","재능","재빨리","재산","재생","재작년","재정","재채기","재판","재학","재활용","저것","저고리","저곳","저녁","저런","저렇게","저번","저울","저절로","저축","적극","적당히","적성","적용","적응","전개","전공","전기","전달","전라도","전망","전문","전반","전부","전세","전시","전용","전자","전쟁","전주","전철","전체","전통","전혀","전후","절대","절망","절반","절약","절차","점검","점수","점심","점원","점점","점차","접근","접시","접촉","젓가락","정거장","정도","정류장","정리","정말","정면","정문","정반대","정보","정부","정비","정상","정성","정오","정원","정장","정지","정치","정확히","제공","제과점","제대로","제목","제발","제법","제삿날","제안","제일","제작","제주도","제출","제품","제한","조각","조건","조금","조깅","조명","조미료","조상","조선","조용히","조절","조정","조직","존댓말","존재","졸업","졸음","종교","종로","종류","종소리","종업원","종종","종합","좌석","죄인","주관적","주름","주말","주머니","주먹","주문","주민","주방","주변","주식","주인","주일","주장","주전자","주택","준비","줄거리","줄기","줄무늬","중간","중계방송","중국","중년","중단","중독","중반","중부","중세","중소기업","중순","중앙","중요","중학교","즉석","즉시","즐거움","증가","증거","증권","증상","증세","지각","지갑","지경","지극히","지금","지급","지능","지름길","지리산","지방","지붕","지식","지역","지우개","지원","지적","지점","지진","지출","직선","직업","직원","직장","진급","진동","진로","진료","진리","진짜","진찰","진출","진통","진행","질문","질병","질서","짐작","집단","집안","집중","짜증","찌꺼기","차남","차라리","차량","차림","차별","차선","차츰","착각","찬물","찬성","참가","참기름","참새","참석","참여","참외","참조","찻잔","창가","창고","창구","창문","창밖","창작","창조","채널","채점","책가방","책방","책상","책임","챔피언","처벌","처음","천국","천둥","천장","천재","천천히","철도","철저히","철학","첫날","첫째","청년","청바지","청소","청춘","체계","체력","체온","체육","체중","체험","초등학생","초반","초밥","초상화","초순","초여름","초원","초저녁","초점","초청","초콜릿","촛불","총각","총리","총장","촬영","최근","최상","최선","최신","최악","최종","추석","추억","추진","추천","추측","축구","축소","축제","축하","출근","출발","출산","출신","출연","출입","출장","출판","충격","충고","충돌","충분히","충청도","취업","취직","취향","치약","친구","친척","칠십","칠월","칠판","침대","침묵","침실","칫솔","칭찬","카메라","카운터","칼국수","캐릭터","캠퍼스","캠페인","커튼","컨디션","컬러","컴퓨터","코끼리","코미디","콘서트","콜라","콤플렉스","콩나물","쾌감","쿠데타","크림","큰길","큰딸","큰소리","큰아들","큰어머니","큰일","큰절","클래식","클럽","킬로","타입","타자기","탁구","탁자","탄생","태권도","태양","태풍","택시","탤런트","터널","터미널","테니스","테스트","테이블","텔레비전","토론","토마토","토요일","통계","통과","통로","통신","통역","통일","통장","통제","통증","통합","통화","퇴근","퇴원","퇴직금","튀김","트럭","특급","특별","특성","특수","특징","특히","튼튼히","티셔츠","파란색","파일","파출소","판결","판단","판매","판사","팔십","팔월","팝송","패션","팩스","팩시밀리","팬티","퍼센트","페인트","편견","편의","편지","편히","평가","평균","평생","평소","평양","평일","평화","포스터","포인트","포장","포함","표면","표정","표준","표현","품목","품질","풍경","풍속","풍습","프랑스","프린터","플라스틱","피곤","피망","피아노","필름","필수","필요","필자","필통","핑계","하느님","하늘","하드웨어","하룻밤","하반기","하숙집","하순","하여튼","하지만","하천","하품","하필","학과","학교","학급","학기","학년","학력","학번","학부모","학비","학생","학술","학습","학용품","학원","학위","학자","학점","한계","한글","한꺼번에","한낮","한눈","한동안","한때","한라산","한마디","한문","한번","한복","한식","한여름","한쪽","할머니","할아버지","할인","함께","함부로","합격","합리적","항공","항구","항상","항의","해결","해군","해답","해당","해물","해석","해설","해수욕장","해안","핵심","핸드백","햄버거","햇볕","햇살","행동","행복","행사","행운","행위","향기","향상","향수","허락","허용","헬기","현관","현금","현대","현상","현실","현장","현재","현지","혈액","협력","형부","형사","형수","형식","형제","형태","형편","혜택","호기심","호남","호랑이","호박","호텔","호흡","혹시","홀로","홈페이지","홍보","홍수","홍차","화면","화분","화살","화요일","화장","화학","확보","확인","확장","확정","환갑","환경","환영","환율","환자","활기","활동","활발히","활용","활짝","회견","회관","회복","회색","회원","회장","회전","횟수","횡단보도","효율적","후반","후춧가루","훈련","훨씬","휴식","휴일","흉내","흐름","흑백","흑인","흔적","흔히","흥미","흥분","희곡","희망","희생","흰색","힘껏"]')},function(e){e.exports=JSON.parse('["abaisser","abandon","abdiquer","abeille","abolir","aborder","aboutir","aboyer","abrasif","abreuver","abriter","abroger","abrupt","absence","absolu","absurde","abusif","abyssal","académie","acajou","acarien","accabler","accepter","acclamer","accolade","accroche","accuser","acerbe","achat","acheter","aciduler","acier","acompte","acquérir","acronyme","acteur","actif","actuel","adepte","adéquat","adhésif","adjectif","adjuger","admettre","admirer","adopter","adorer","adoucir","adresse","adroit","adulte","adverbe","aérer","aéronef","affaire","affecter","affiche","affreux","affubler","agacer","agencer","agile","agiter","agrafer","agréable","agrume","aider","aiguille","ailier","aimable","aisance","ajouter","ajuster","alarmer","alchimie","alerte","algèbre","algue","aliéner","aliment","alléger","alliage","allouer","allumer","alourdir","alpaga","altesse","alvéole","amateur","ambigu","ambre","aménager","amertume","amidon","amiral","amorcer","amour","amovible","amphibie","ampleur","amusant","analyse","anaphore","anarchie","anatomie","ancien","anéantir","angle","angoisse","anguleux","animal","annexer","annonce","annuel","anodin","anomalie","anonyme","anormal","antenne","antidote","anxieux","apaiser","apéritif","aplanir","apologie","appareil","appeler","apporter","appuyer","aquarium","aqueduc","arbitre","arbuste","ardeur","ardoise","argent","arlequin","armature","armement","armoire","armure","arpenter","arracher","arriver","arroser","arsenic","artériel","article","aspect","asphalte","aspirer","assaut","asservir","assiette","associer","assurer","asticot","astre","astuce","atelier","atome","atrium","atroce","attaque","attentif","attirer","attraper","aubaine","auberge","audace","audible","augurer","aurore","automne","autruche","avaler","avancer","avarice","avenir","averse","aveugle","aviateur","avide","avion","aviser","avoine","avouer","avril","axial","axiome","badge","bafouer","bagage","baguette","baignade","balancer","balcon","baleine","balisage","bambin","bancaire","bandage","banlieue","bannière","banquier","barbier","baril","baron","barque","barrage","bassin","bastion","bataille","bateau","batterie","baudrier","bavarder","belette","bélier","belote","bénéfice","berceau","berger","berline","bermuda","besace","besogne","bétail","beurre","biberon","bicycle","bidule","bijou","bilan","bilingue","billard","binaire","biologie","biopsie","biotype","biscuit","bison","bistouri","bitume","bizarre","blafard","blague","blanchir","blessant","blinder","blond","bloquer","blouson","bobard","bobine","boire","boiser","bolide","bonbon","bondir","bonheur","bonifier","bonus","bordure","borne","botte","boucle","boueux","bougie","boulon","bouquin","bourse","boussole","boutique","boxeur","branche","brasier","brave","brebis","brèche","breuvage","bricoler","brigade","brillant","brioche","brique","brochure","broder","bronzer","brousse","broyeur","brume","brusque","brutal","bruyant","buffle","buisson","bulletin","bureau","burin","bustier","butiner","butoir","buvable","buvette","cabanon","cabine","cachette","cadeau","cadre","caféine","caillou","caisson","calculer","calepin","calibre","calmer","calomnie","calvaire","camarade","caméra","camion","campagne","canal","caneton","canon","cantine","canular","capable","caporal","caprice","capsule","capter","capuche","carabine","carbone","caresser","caribou","carnage","carotte","carreau","carton","cascade","casier","casque","cassure","causer","caution","cavalier","caverne","caviar","cédille","ceinture","céleste","cellule","cendrier","censurer","central","cercle","cérébral","cerise","cerner","cerveau","cesser","chagrin","chaise","chaleur","chambre","chance","chapitre","charbon","chasseur","chaton","chausson","chavirer","chemise","chenille","chéquier","chercher","cheval","chien","chiffre","chignon","chimère","chiot","chlorure","chocolat","choisir","chose","chouette","chrome","chute","cigare","cigogne","cimenter","cinéma","cintrer","circuler","cirer","cirque","citerne","citoyen","citron","civil","clairon","clameur","claquer","classe","clavier","client","cligner","climat","clivage","cloche","clonage","cloporte","cobalt","cobra","cocasse","cocotier","coder","codifier","coffre","cogner","cohésion","coiffer","coincer","colère","colibri","colline","colmater","colonel","combat","comédie","commande","compact","concert","conduire","confier","congeler","connoter","consonne","contact","convexe","copain","copie","corail","corbeau","cordage","corniche","corpus","correct","cortège","cosmique","costume","coton","coude","coupure","courage","couteau","couvrir","coyote","crabe","crainte","cravate","crayon","créature","créditer","crémeux","creuser","crevette","cribler","crier","cristal","critère","croire","croquer","crotale","crucial","cruel","crypter","cubique","cueillir","cuillère","cuisine","cuivre","culminer","cultiver","cumuler","cupide","curatif","curseur","cyanure","cycle","cylindre","cynique","daigner","damier","danger","danseur","dauphin","débattre","débiter","déborder","débrider","débutant","décaler","décembre","déchirer","décider","déclarer","décorer","décrire","décupler","dédale","déductif","déesse","défensif","défiler","défrayer","dégager","dégivrer","déglutir","dégrafer","déjeuner","délice","déloger","demander","demeurer","démolir","dénicher","dénouer","dentelle","dénuder","départ","dépenser","déphaser","déplacer","déposer","déranger","dérober","désastre","descente","désert","désigner","désobéir","dessiner","destrier","détacher","détester","détourer","détresse","devancer","devenir","deviner","devoir","diable","dialogue","diamant","dicter","différer","digérer","digital","digne","diluer","dimanche","diminuer","dioxyde","directif","diriger","discuter","disposer","dissiper","distance","divertir","diviser","docile","docteur","dogme","doigt","domaine","domicile","dompter","donateur","donjon","donner","dopamine","dortoir","dorure","dosage","doseur","dossier","dotation","douanier","double","douceur","douter","doyen","dragon","draper","dresser","dribbler","droiture","duperie","duplexe","durable","durcir","dynastie","éblouir","écarter","écharpe","échelle","éclairer","éclipse","éclore","écluse","école","économie","écorce","écouter","écraser","écrémer","écrivain","écrou","écume","écureuil","édifier","éduquer","effacer","effectif","effigie","effort","effrayer","effusion","égaliser","égarer","éjecter","élaborer","élargir","électron","élégant","éléphant","élève","éligible","élitisme","éloge","élucider","éluder","emballer","embellir","embryon","émeraude","émission","emmener","émotion","émouvoir","empereur","employer","emporter","emprise","émulsion","encadrer","enchère","enclave","encoche","endiguer","endosser","endroit","enduire","énergie","enfance","enfermer","enfouir","engager","engin","englober","énigme","enjamber","enjeu","enlever","ennemi","ennuyeux","enrichir","enrobage","enseigne","entasser","entendre","entier","entourer","entraver","énumérer","envahir","enviable","envoyer","enzyme","éolien","épaissir","épargne","épatant","épaule","épicerie","épidémie","épier","épilogue","épine","épisode","épitaphe","époque","épreuve","éprouver","épuisant","équerre","équipe","ériger","érosion","erreur","éruption","escalier","espadon","espèce","espiègle","espoir","esprit","esquiver","essayer","essence","essieu","essorer","estime","estomac","estrade","étagère","étaler","étanche","étatique","éteindre","étendoir","éternel","éthanol","éthique","ethnie","étirer","étoffer","étoile","étonnant","étourdir","étrange","étroit","étude","euphorie","évaluer","évasion","éventail","évidence","éviter","évolutif","évoquer","exact","exagérer","exaucer","exceller","excitant","exclusif","excuse","exécuter","exemple","exercer","exhaler","exhorter","exigence","exiler","exister","exotique","expédier","explorer","exposer","exprimer","exquis","extensif","extraire","exulter","fable","fabuleux","facette","facile","facture","faiblir","falaise","fameux","famille","farceur","farfelu","farine","farouche","fasciner","fatal","fatigue","faucon","fautif","faveur","favori","fébrile","féconder","fédérer","félin","femme","fémur","fendoir","féodal","fermer","féroce","ferveur","festival","feuille","feutre","février","fiasco","ficeler","fictif","fidèle","figure","filature","filetage","filière","filleul","filmer","filou","filtrer","financer","finir","fiole","firme","fissure","fixer","flairer","flamme","flasque","flatteur","fléau","flèche","fleur","flexion","flocon","flore","fluctuer","fluide","fluvial","folie","fonderie","fongible","fontaine","forcer","forgeron","formuler","fortune","fossile","foudre","fougère","fouiller","foulure","fourmi","fragile","fraise","franchir","frapper","frayeur","frégate","freiner","frelon","frémir","frénésie","frère","friable","friction","frisson","frivole","froid","fromage","frontal","frotter","fruit","fugitif","fuite","fureur","furieux","furtif","fusion","futur","gagner","galaxie","galerie","gambader","garantir","gardien","garnir","garrigue","gazelle","gazon","géant","gélatine","gélule","gendarme","général","génie","genou","gentil","géologie","géomètre","géranium","germe","gestuel","geyser","gibier","gicler","girafe","givre","glace","glaive","glisser","globe","gloire","glorieux","golfeur","gomme","gonfler","gorge","gorille","goudron","gouffre","goulot","goupille","gourmand","goutte","graduel","graffiti","graine","grand","grappin","gratuit","gravir","grenat","griffure","griller","grimper","grogner","gronder","grotte","groupe","gruger","grutier","gruyère","guépard","guerrier","guide","guimauve","guitare","gustatif","gymnaste","gyrostat","habitude","hachoir","halte","hameau","hangar","hanneton","haricot","harmonie","harpon","hasard","hélium","hématome","herbe","hérisson","hermine","héron","hésiter","heureux","hiberner","hibou","hilarant","histoire","hiver","homard","hommage","homogène","honneur","honorer","honteux","horde","horizon","horloge","hormone","horrible","houleux","housse","hublot","huileux","humain","humble","humide","humour","hurler","hydromel","hygiène","hymne","hypnose","idylle","ignorer","iguane","illicite","illusion","image","imbiber","imiter","immense","immobile","immuable","impact","impérial","implorer","imposer","imprimer","imputer","incarner","incendie","incident","incliner","incolore","indexer","indice","inductif","inédit","ineptie","inexact","infini","infliger","informer","infusion","ingérer","inhaler","inhiber","injecter","injure","innocent","inoculer","inonder","inscrire","insecte","insigne","insolite","inspirer","instinct","insulter","intact","intense","intime","intrigue","intuitif","inutile","invasion","inventer","inviter","invoquer","ironique","irradier","irréel","irriter","isoler","ivoire","ivresse","jaguar","jaillir","jambe","janvier","jardin","jauger","jaune","javelot","jetable","jeton","jeudi","jeunesse","joindre","joncher","jongler","joueur","jouissif","journal","jovial","joyau","joyeux","jubiler","jugement","junior","jupon","juriste","justice","juteux","juvénile","kayak","kimono","kiosque","label","labial","labourer","lacérer","lactose","lagune","laine","laisser","laitier","lambeau","lamelle","lampe","lanceur","langage","lanterne","lapin","largeur","larme","laurier","lavabo","lavoir","lecture","légal","léger","légume","lessive","lettre","levier","lexique","lézard","liasse","libérer","libre","licence","licorne","liège","lièvre","ligature","ligoter","ligue","limer","limite","limonade","limpide","linéaire","lingot","lionceau","liquide","lisière","lister","lithium","litige","littoral","livreur","logique","lointain","loisir","lombric","loterie","louer","lourd","loutre","louve","loyal","lubie","lucide","lucratif","lueur","lugubre","luisant","lumière","lunaire","lundi","luron","lutter","luxueux","machine","magasin","magenta","magique","maigre","maillon","maintien","mairie","maison","majorer","malaxer","maléfice","malheur","malice","mallette","mammouth","mandater","maniable","manquant","manteau","manuel","marathon","marbre","marchand","mardi","maritime","marqueur","marron","marteler","mascotte","massif","matériel","matière","matraque","maudire","maussade","mauve","maximal","méchant","méconnu","médaille","médecin","méditer","méduse","meilleur","mélange","mélodie","membre","mémoire","menacer","mener","menhir","mensonge","mentor","mercredi","mérite","merle","messager","mesure","métal","météore","méthode","métier","meuble","miauler","microbe","miette","mignon","migrer","milieu","million","mimique","mince","minéral","minimal","minorer","minute","miracle","miroiter","missile","mixte","mobile","moderne","moelleux","mondial","moniteur","monnaie","monotone","monstre","montagne","monument","moqueur","morceau","morsure","mortier","moteur","motif","mouche","moufle","moulin","mousson","mouton","mouvant","multiple","munition","muraille","murène","murmure","muscle","muséum","musicien","mutation","muter","mutuel","myriade","myrtille","mystère","mythique","nageur","nappe","narquois","narrer","natation","nation","nature","naufrage","nautique","navire","nébuleux","nectar","néfaste","négation","négliger","négocier","neige","nerveux","nettoyer","neurone","neutron","neveu","niche","nickel","nitrate","niveau","noble","nocif","nocturne","noirceur","noisette","nomade","nombreux","nommer","normatif","notable","notifier","notoire","nourrir","nouveau","novateur","novembre","novice","nuage","nuancer","nuire","nuisible","numéro","nuptial","nuque","nutritif","obéir","objectif","obliger","obscur","observer","obstacle","obtenir","obturer","occasion","occuper","océan","octobre","octroyer","octupler","oculaire","odeur","odorant","offenser","officier","offrir","ogive","oiseau","oisillon","olfactif","olivier","ombrage","omettre","onctueux","onduler","onéreux","onirique","opale","opaque","opérer","opinion","opportun","opprimer","opter","optique","orageux","orange","orbite","ordonner","oreille","organe","orgueil","orifice","ornement","orque","ortie","osciller","osmose","ossature","otarie","ouragan","ourson","outil","outrager","ouvrage","ovation","oxyde","oxygène","ozone","paisible","palace","palmarès","palourde","palper","panache","panda","pangolin","paniquer","panneau","panorama","pantalon","papaye","papier","papoter","papyrus","paradoxe","parcelle","paresse","parfumer","parler","parole","parrain","parsemer","partager","parure","parvenir","passion","pastèque","paternel","patience","patron","pavillon","pavoiser","payer","paysage","peigne","peintre","pelage","pélican","pelle","pelouse","peluche","pendule","pénétrer","pénible","pensif","pénurie","pépite","péplum","perdrix","perforer","période","permuter","perplexe","persil","perte","peser","pétale","petit","pétrir","peuple","pharaon","phobie","phoque","photon","phrase","physique","piano","pictural","pièce","pierre","pieuvre","pilote","pinceau","pipette","piquer","pirogue","piscine","piston","pivoter","pixel","pizza","placard","plafond","plaisir","planer","plaque","plastron","plateau","pleurer","plexus","pliage","plomb","plonger","pluie","plumage","pochette","poésie","poète","pointe","poirier","poisson","poivre","polaire","policier","pollen","polygone","pommade","pompier","ponctuel","pondérer","poney","portique","position","posséder","posture","potager","poteau","potion","pouce","poulain","poumon","pourpre","poussin","pouvoir","prairie","pratique","précieux","prédire","préfixe","prélude","prénom","présence","prétexte","prévoir","primitif","prince","prison","priver","problème","procéder","prodige","profond","progrès","proie","projeter","prologue","promener","propre","prospère","protéger","prouesse","proverbe","prudence","pruneau","psychose","public","puceron","puiser","pulpe","pulsar","punaise","punitif","pupitre","purifier","puzzle","pyramide","quasar","querelle","question","quiétude","quitter","quotient","racine","raconter","radieux","ragondin","raideur","raisin","ralentir","rallonge","ramasser","rapide","rasage","ratisser","ravager","ravin","rayonner","réactif","réagir","réaliser","réanimer","recevoir","réciter","réclamer","récolter","recruter","reculer","recycler","rédiger","redouter","refaire","réflexe","réformer","refrain","refuge","régalien","région","réglage","régulier","réitérer","rejeter","rejouer","relatif","relever","relief","remarque","remède","remise","remonter","remplir","remuer","renard","renfort","renifler","renoncer","rentrer","renvoi","replier","reporter","reprise","reptile","requin","réserve","résineux","résoudre","respect","rester","résultat","rétablir","retenir","réticule","retomber","retracer","réunion","réussir","revanche","revivre","révolte","révulsif","richesse","rideau","rieur","rigide","rigoler","rincer","riposter","risible","risque","rituel","rival","rivière","rocheux","romance","rompre","ronce","rondin","roseau","rosier","rotatif","rotor","rotule","rouge","rouille","rouleau","routine","royaume","ruban","rubis","ruche","ruelle","rugueux","ruiner","ruisseau","ruser","rustique","rythme","sabler","saboter","sabre","sacoche","safari","sagesse","saisir","salade","salive","salon","saluer","samedi","sanction","sanglier","sarcasme","sardine","saturer","saugrenu","saumon","sauter","sauvage","savant","savonner","scalpel","scandale","scélérat","scénario","sceptre","schéma","science","scinder","score","scrutin","sculpter","séance","sécable","sécher","secouer","sécréter","sédatif","séduire","seigneur","séjour","sélectif","semaine","sembler","semence","séminal","sénateur","sensible","sentence","séparer","séquence","serein","sergent","sérieux","serrure","sérum","service","sésame","sévir","sevrage","sextuple","sidéral","siècle","siéger","siffler","sigle","signal","silence","silicium","simple","sincère","sinistre","siphon","sirop","sismique","situer","skier","social","socle","sodium","soigneux","soldat","soleil","solitude","soluble","sombre","sommeil","somnoler","sonde","songeur","sonnette","sonore","sorcier","sortir","sosie","sottise","soucieux","soudure","souffle","soulever","soupape","source","soutirer","souvenir","spacieux","spatial","spécial","sphère","spiral","stable","station","sternum","stimulus","stipuler","strict","studieux","stupeur","styliste","sublime","substrat","subtil","subvenir","succès","sucre","suffixe","suggérer","suiveur","sulfate","superbe","supplier","surface","suricate","surmener","surprise","sursaut","survie","suspect","syllabe","symbole","symétrie","synapse","syntaxe","système","tabac","tablier","tactile","tailler","talent","talisman","talonner","tambour","tamiser","tangible","tapis","taquiner","tarder","tarif","tartine","tasse","tatami","tatouage","taupe","taureau","taxer","témoin","temporel","tenaille","tendre","teneur","tenir","tension","terminer","terne","terrible","tétine","texte","thème","théorie","thérapie","thorax","tibia","tiède","timide","tirelire","tiroir","tissu","titane","titre","tituber","toboggan","tolérant","tomate","tonique","tonneau","toponyme","torche","tordre","tornade","torpille","torrent","torse","tortue","totem","toucher","tournage","tousser","toxine","traction","trafic","tragique","trahir","train","trancher","travail","trèfle","tremper","trésor","treuil","triage","tribunal","tricoter","trilogie","triomphe","tripler","triturer","trivial","trombone","tronc","tropical","troupeau","tuile","tulipe","tumulte","tunnel","turbine","tuteur","tutoyer","tuyau","tympan","typhon","typique","tyran","ubuesque","ultime","ultrason","unanime","unifier","union","unique","unitaire","univers","uranium","urbain","urticant","usage","usine","usuel","usure","utile","utopie","vacarme","vaccin","vagabond","vague","vaillant","vaincre","vaisseau","valable","valise","vallon","valve","vampire","vanille","vapeur","varier","vaseux","vassal","vaste","vecteur","vedette","végétal","véhicule","veinard","véloce","vendredi","vénérer","venger","venimeux","ventouse","verdure","vérin","vernir","verrou","verser","vertu","veston","vétéran","vétuste","vexant","vexer","viaduc","viande","victoire","vidange","vidéo","vignette","vigueur","vilain","village","vinaigre","violon","vipère","virement","virtuose","virus","visage","viseur","vision","visqueux","visuel","vital","vitesse","viticole","vitrine","vivace","vivipare","vocation","voguer","voile","voisin","voiture","volaille","volcan","voltiger","volume","vorace","vortex","voter","vouloir","voyage","voyelle","wagon","xénon","yacht","zèbre","zénith","zeste","zoologie"]')},function(e){e.exports=JSON.parse('["abaco","abbaglio","abbinato","abete","abisso","abolire","abrasivo","abrogato","accadere","accenno","accusato","acetone","achille","acido","acqua","acre","acrilico","acrobata","acuto","adagio","addebito","addome","adeguato","aderire","adipe","adottare","adulare","affabile","affetto","affisso","affranto","aforisma","afoso","africano","agave","agente","agevole","aggancio","agire","agitare","agonismo","agricolo","agrumeto","aguzzo","alabarda","alato","albatro","alberato","albo","albume","alce","alcolico","alettone","alfa","algebra","aliante","alibi","alimento","allagato","allegro","allievo","allodola","allusivo","almeno","alogeno","alpaca","alpestre","altalena","alterno","alticcio","altrove","alunno","alveolo","alzare","amalgama","amanita","amarena","ambito","ambrato","ameba","america","ametista","amico","ammasso","ammenda","ammirare","ammonito","amore","ampio","ampliare","amuleto","anacardo","anagrafe","analista","anarchia","anatra","anca","ancella","ancora","andare","andrea","anello","angelo","angolare","angusto","anima","annegare","annidato","anno","annuncio","anonimo","anticipo","anzi","apatico","apertura","apode","apparire","appetito","appoggio","approdo","appunto","aprile","arabica","arachide","aragosta","araldica","arancio","aratura","arazzo","arbitro","archivio","ardito","arenile","argento","argine","arguto","aria","armonia","arnese","arredato","arringa","arrosto","arsenico","arso","artefice","arzillo","asciutto","ascolto","asepsi","asettico","asfalto","asino","asola","aspirato","aspro","assaggio","asse","assoluto","assurdo","asta","astenuto","astice","astratto","atavico","ateismo","atomico","atono","attesa","attivare","attorno","attrito","attuale","ausilio","austria","autista","autonomo","autunno","avanzato","avere","avvenire","avviso","avvolgere","azione","azoto","azzimo","azzurro","babele","baccano","bacino","baco","badessa","badilata","bagnato","baita","balcone","baldo","balena","ballata","balzano","bambino","bandire","baraonda","barbaro","barca","baritono","barlume","barocco","basilico","basso","batosta","battuto","baule","bava","bavosa","becco","beffa","belgio","belva","benda","benevole","benigno","benzina","bere","berlina","beta","bibita","bici","bidone","bifido","biga","bilancia","bimbo","binocolo","biologo","bipede","bipolare","birbante","birra","biscotto","bisesto","bisnonno","bisonte","bisturi","bizzarro","blando","blatta","bollito","bonifico","bordo","bosco","botanico","bottino","bozzolo","braccio","bradipo","brama","branca","bravura","bretella","brevetto","brezza","briglia","brillante","brindare","broccolo","brodo","bronzina","brullo","bruno","bubbone","buca","budino","buffone","buio","bulbo","buono","burlone","burrasca","bussola","busta","cadetto","caduco","calamaro","calcolo","calesse","calibro","calmo","caloria","cambusa","camerata","camicia","cammino","camola","campale","canapa","candela","cane","canino","canotto","cantina","capace","capello","capitolo","capogiro","cappero","capra","capsula","carapace","carcassa","cardo","carisma","carovana","carretto","cartolina","casaccio","cascata","caserma","caso","cassone","castello","casuale","catasta","catena","catrame","cauto","cavillo","cedibile","cedrata","cefalo","celebre","cellulare","cena","cenone","centesimo","ceramica","cercare","certo","cerume","cervello","cesoia","cespo","ceto","chela","chiaro","chicca","chiedere","chimera","china","chirurgo","chitarra","ciao","ciclismo","cifrare","cigno","cilindro","ciottolo","circa","cirrosi","citrico","cittadino","ciuffo","civetta","civile","classico","clinica","cloro","cocco","codardo","codice","coerente","cognome","collare","colmato","colore","colposo","coltivato","colza","coma","cometa","commando","comodo","computer","comune","conciso","condurre","conferma","congelare","coniuge","connesso","conoscere","consumo","continuo","convegno","coperto","copione","coppia","copricapo","corazza","cordata","coricato","cornice","corolla","corpo","corredo","corsia","cortese","cosmico","costante","cottura","covato","cratere","cravatta","creato","credere","cremoso","crescita","creta","criceto","crinale","crisi","critico","croce","cronaca","crostata","cruciale","crusca","cucire","cuculo","cugino","cullato","cupola","curatore","cursore","curvo","cuscino","custode","dado","daino","dalmata","damerino","daniela","dannoso","danzare","datato","davanti","davvero","debutto","decennio","deciso","declino","decollo","decreto","dedicato","definito","deforme","degno","delegare","delfino","delirio","delta","demenza","denotato","dentro","deposito","derapata","derivare","deroga","descritto","deserto","desiderio","desumere","detersivo","devoto","diametro","dicembre","diedro","difeso","diffuso","digerire","digitale","diluvio","dinamico","dinnanzi","dipinto","diploma","dipolo","diradare","dire","dirotto","dirupo","disagio","discreto","disfare","disgelo","disposto","distanza","disumano","dito","divano","divelto","dividere","divorato","doblone","docente","doganale","dogma","dolce","domato","domenica","dominare","dondolo","dono","dormire","dote","dottore","dovuto","dozzina","drago","druido","dubbio","dubitare","ducale","duna","duomo","duplice","duraturo","ebano","eccesso","ecco","eclissi","economia","edera","edicola","edile","editoria","educare","egemonia","egli","egoismo","egregio","elaborato","elargire","elegante","elencato","eletto","elevare","elfico","elica","elmo","elsa","eluso","emanato","emblema","emesso","emiro","emotivo","emozione","empirico","emulo","endemico","enduro","energia","enfasi","enoteca","entrare","enzima","epatite","epilogo","episodio","epocale","eppure","equatore","erario","erba","erboso","erede","eremita","erigere","ermetico","eroe","erosivo","errante","esagono","esame","esanime","esaudire","esca","esempio","esercito","esibito","esigente","esistere","esito","esofago","esortato","esoso","espanso","espresso","essenza","esso","esteso","estimare","estonia","estroso","esultare","etilico","etnico","etrusco","etto","euclideo","europa","evaso","evidenza","evitato","evoluto","evviva","fabbrica","faccenda","fachiro","falco","famiglia","fanale","fanfara","fango","fantasma","fare","farfalla","farinoso","farmaco","fascia","fastoso","fasullo","faticare","fato","favoloso","febbre","fecola","fede","fegato","felpa","feltro","femmina","fendere","fenomeno","fermento","ferro","fertile","fessura","festivo","fetta","feudo","fiaba","fiducia","fifa","figurato","filo","finanza","finestra","finire","fiore","fiscale","fisico","fiume","flacone","flamenco","flebo","flemma","florido","fluente","fluoro","fobico","focaccia","focoso","foderato","foglio","folata","folclore","folgore","fondente","fonetico","fonia","fontana","forbito","forchetta","foresta","formica","fornaio","foro","fortezza","forzare","fosfato","fosso","fracasso","frana","frassino","fratello","freccetta","frenata","fresco","frigo","frollino","fronde","frugale","frutta","fucilata","fucsia","fuggente","fulmine","fulvo","fumante","fumetto","fumoso","fune","funzione","fuoco","furbo","furgone","furore","fuso","futile","gabbiano","gaffe","galateo","gallina","galoppo","gambero","gamma","garanzia","garbo","garofano","garzone","gasdotto","gasolio","gastrico","gatto","gaudio","gazebo","gazzella","geco","gelatina","gelso","gemello","gemmato","gene","genitore","gennaio","genotipo","gergo","ghepardo","ghiaccio","ghisa","giallo","gilda","ginepro","giocare","gioiello","giorno","giove","girato","girone","gittata","giudizio","giurato","giusto","globulo","glutine","gnomo","gobba","golf","gomito","gommone","gonfio","gonna","governo","gracile","grado","grafico","grammo","grande","grattare","gravoso","grazia","greca","gregge","grifone","grigio","grinza","grotta","gruppo","guadagno","guaio","guanto","guardare","gufo","guidare","ibernato","icona","identico","idillio","idolo","idra","idrico","idrogeno","igiene","ignaro","ignorato","ilare","illeso","illogico","illudere","imballo","imbevuto","imbocco","imbuto","immane","immerso","immolato","impacco","impeto","impiego","importo","impronta","inalare","inarcare","inattivo","incanto","incendio","inchino","incisivo","incluso","incontro","incrocio","incubo","indagine","india","indole","inedito","infatti","infilare","inflitto","ingaggio","ingegno","inglese","ingordo","ingrosso","innesco","inodore","inoltrare","inondato","insano","insetto","insieme","insonnia","insulina","intasato","intero","intonaco","intuito","inumidire","invalido","invece","invito","iperbole","ipnotico","ipotesi","ippica","iride","irlanda","ironico","irrigato","irrorare","isolato","isotopo","isterico","istituto","istrice","italia","iterare","labbro","labirinto","lacca","lacerato","lacrima","lacuna","laddove","lago","lampo","lancetta","lanterna","lardoso","larga","laringe","lastra","latenza","latino","lattuga","lavagna","lavoro","legale","leggero","lembo","lentezza","lenza","leone","lepre","lesivo","lessato","lesto","letterale","leva","levigato","libero","lido","lievito","lilla","limatura","limitare","limpido","lineare","lingua","liquido","lira","lirica","lisca","lite","litigio","livrea","locanda","lode","logica","lombare","londra","longevo","loquace","lorenzo","loto","lotteria","luce","lucidato","lumaca","luminoso","lungo","lupo","luppolo","lusinga","lusso","lutto","macabro","macchina","macero","macinato","madama","magico","maglia","magnete","magro","maiolica","malafede","malgrado","malinteso","malsano","malto","malumore","mana","mancia","mandorla","mangiare","manifesto","mannaro","manovra","mansarda","mantide","manubrio","mappa","maratona","marcire","maretta","marmo","marsupio","maschera","massaia","mastino","materasso","matricola","mattone","maturo","mazurca","meandro","meccanico","mecenate","medesimo","meditare","mega","melassa","melis","melodia","meninge","meno","mensola","mercurio","merenda","merlo","meschino","mese","messere","mestolo","metallo","metodo","mettere","miagolare","mica","micelio","michele","microbo","midollo","miele","migliore","milano","milite","mimosa","minerale","mini","minore","mirino","mirtillo","miscela","missiva","misto","misurare","mitezza","mitigare","mitra","mittente","mnemonico","modello","modifica","modulo","mogano","mogio","mole","molosso","monastero","monco","mondina","monetario","monile","monotono","monsone","montato","monviso","mora","mordere","morsicato","mostro","motivato","motosega","motto","movenza","movimento","mozzo","mucca","mucosa","muffa","mughetto","mugnaio","mulatto","mulinello","multiplo","mummia","munto","muovere","murale","musa","muscolo","musica","mutevole","muto","nababbo","nafta","nanometro","narciso","narice","narrato","nascere","nastrare","naturale","nautica","naviglio","nebulosa","necrosi","negativo","negozio","nemmeno","neofita","neretto","nervo","nessuno","nettuno","neutrale","neve","nevrotico","nicchia","ninfa","nitido","nobile","nocivo","nodo","nome","nomina","nordico","normale","norvegese","nostrano","notare","notizia","notturno","novella","nucleo","nulla","numero","nuovo","nutrire","nuvola","nuziale","oasi","obbedire","obbligo","obelisco","oblio","obolo","obsoleto","occasione","occhio","occidente","occorrere","occultare","ocra","oculato","odierno","odorare","offerta","offrire","offuscato","oggetto","oggi","ognuno","olandese","olfatto","oliato","oliva","ologramma","oltre","omaggio","ombelico","ombra","omega","omissione","ondoso","onere","onice","onnivoro","onorevole","onta","operato","opinione","opposto","oracolo","orafo","ordine","orecchino","orefice","orfano","organico","origine","orizzonte","orma","ormeggio","ornativo","orologio","orrendo","orribile","ortensia","ortica","orzata","orzo","osare","oscurare","osmosi","ospedale","ospite","ossa","ossidare","ostacolo","oste","otite","otre","ottagono","ottimo","ottobre","ovale","ovest","ovino","oviparo","ovocito","ovunque","ovviare","ozio","pacchetto","pace","pacifico","padella","padrone","paese","paga","pagina","palazzina","palesare","pallido","palo","palude","pandoro","pannello","paolo","paonazzo","paprica","parabola","parcella","parere","pargolo","pari","parlato","parola","partire","parvenza","parziale","passivo","pasticca","patacca","patologia","pattume","pavone","peccato","pedalare","pedonale","peggio","peloso","penare","pendice","penisola","pennuto","penombra","pensare","pentola","pepe","pepita","perbene","percorso","perdonato","perforare","pergamena","periodo","permesso","perno","perplesso","persuaso","pertugio","pervaso","pesatore","pesista","peso","pestifero","petalo","pettine","petulante","pezzo","piacere","pianta","piattino","piccino","picozza","piega","pietra","piffero","pigiama","pigolio","pigro","pila","pilifero","pillola","pilota","pimpante","pineta","pinna","pinolo","pioggia","piombo","piramide","piretico","pirite","pirolisi","pitone","pizzico","placebo","planare","plasma","platano","plenario","pochezza","poderoso","podismo","poesia","poggiare","polenta","poligono","pollice","polmonite","polpetta","polso","poltrona","polvere","pomice","pomodoro","ponte","popoloso","porfido","poroso","porpora","porre","portata","posa","positivo","possesso","postulato","potassio","potere","pranzo","prassi","pratica","precluso","predica","prefisso","pregiato","prelievo","premere","prenotare","preparato","presenza","pretesto","prevalso","prima","principe","privato","problema","procura","produrre","profumo","progetto","prolunga","promessa","pronome","proposta","proroga","proteso","prova","prudente","prugna","prurito","psiche","pubblico","pudica","pugilato","pugno","pulce","pulito","pulsante","puntare","pupazzo","pupilla","puro","quadro","qualcosa","quasi","querela","quota","raccolto","raddoppio","radicale","radunato","raffica","ragazzo","ragione","ragno","ramarro","ramingo","ramo","randagio","rantolare","rapato","rapina","rappreso","rasatura","raschiato","rasente","rassegna","rastrello","rata","ravveduto","reale","recepire","recinto","recluta","recondito","recupero","reddito","redimere","regalato","registro","regola","regresso","relazione","remare","remoto","renna","replica","reprimere","reputare","resa","residente","responso","restauro","rete","retina","retorica","rettifica","revocato","riassunto","ribadire","ribelle","ribrezzo","ricarica","ricco","ricevere","riciclato","ricordo","ricreduto","ridicolo","ridurre","rifasare","riflesso","riforma","rifugio","rigare","rigettato","righello","rilassato","rilevato","rimanere","rimbalzo","rimedio","rimorchio","rinascita","rincaro","rinforzo","rinnovo","rinomato","rinsavito","rintocco","rinuncia","rinvenire","riparato","ripetuto","ripieno","riportare","ripresa","ripulire","risata","rischio","riserva","risibile","riso","rispetto","ristoro","risultato","risvolto","ritardo","ritegno","ritmico","ritrovo","riunione","riva","riverso","rivincita","rivolto","rizoma","roba","robotico","robusto","roccia","roco","rodaggio","rodere","roditore","rogito","rollio","romantico","rompere","ronzio","rosolare","rospo","rotante","rotondo","rotula","rovescio","rubizzo","rubrica","ruga","rullino","rumine","rumoroso","ruolo","rupe","russare","rustico","sabato","sabbiare","sabotato","sagoma","salasso","saldatura","salgemma","salivare","salmone","salone","saltare","saluto","salvo","sapere","sapido","saporito","saraceno","sarcasmo","sarto","sassoso","satellite","satira","satollo","saturno","savana","savio","saziato","sbadiglio","sbalzo","sbancato","sbarra","sbattere","sbavare","sbendare","sbirciare","sbloccato","sbocciato","sbrinare","sbruffone","sbuffare","scabroso","scadenza","scala","scambiare","scandalo","scapola","scarso","scatenare","scavato","scelto","scenico","scettro","scheda","schiena","sciarpa","scienza","scindere","scippo","sciroppo","scivolo","sclerare","scodella","scolpito","scomparto","sconforto","scoprire","scorta","scossone","scozzese","scriba","scrollare","scrutinio","scuderia","scultore","scuola","scuro","scusare","sdebitare","sdoganare","seccatura","secondo","sedano","seggiola","segnalato","segregato","seguito","selciato","selettivo","sella","selvaggio","semaforo","sembrare","seme","seminato","sempre","senso","sentire","sepolto","sequenza","serata","serbato","sereno","serio","serpente","serraglio","servire","sestina","setola","settimana","sfacelo","sfaldare","sfamato","sfarzoso","sfaticato","sfera","sfida","sfilato","sfinge","sfocato","sfoderare","sfogo","sfoltire","sforzato","sfratto","sfruttato","sfuggito","sfumare","sfuso","sgabello","sgarbato","sgonfiare","sgorbio","sgrassato","sguardo","sibilo","siccome","sierra","sigla","signore","silenzio","sillaba","simbolo","simpatico","simulato","sinfonia","singolo","sinistro","sino","sintesi","sinusoide","sipario","sisma","sistole","situato","slitta","slogatura","sloveno","smarrito","smemorato","smentito","smeraldo","smilzo","smontare","smottato","smussato","snellire","snervato","snodo","sobbalzo","sobrio","soccorso","sociale","sodale","soffitto","sogno","soldato","solenne","solido","sollazzo","solo","solubile","solvente","somatico","somma","sonda","sonetto","sonnifero","sopire","soppeso","sopra","sorgere","sorpasso","sorriso","sorso","sorteggio","sorvolato","sospiro","sosta","sottile","spada","spalla","spargere","spatola","spavento","spazzola","specie","spedire","spegnere","spelatura","speranza","spessore","spettrale","spezzato","spia","spigoloso","spillato","spinoso","spirale","splendido","sportivo","sposo","spranga","sprecare","spronato","spruzzo","spuntino","squillo","sradicare","srotolato","stabile","stacco","staffa","stagnare","stampato","stantio","starnuto","stasera","statuto","stelo","steppa","sterzo","stiletto","stima","stirpe","stivale","stizzoso","stonato","storico","strappo","stregato","stridulo","strozzare","strutto","stuccare","stufo","stupendo","subentro","succoso","sudore","suggerito","sugo","sultano","suonare","superbo","supporto","surgelato","surrogato","sussurro","sutura","svagare","svedese","sveglio","svelare","svenuto","svezia","sviluppo","svista","svizzera","svolta","svuotare","tabacco","tabulato","tacciare","taciturno","tale","talismano","tampone","tannino","tara","tardivo","targato","tariffa","tarpare","tartaruga","tasto","tattico","taverna","tavolata","tazza","teca","tecnico","telefono","temerario","tempo","temuto","tendone","tenero","tensione","tentacolo","teorema","terme","terrazzo","terzetto","tesi","tesserato","testato","tetro","tettoia","tifare","tigella","timbro","tinto","tipico","tipografo","tiraggio","tiro","titanio","titolo","titubante","tizio","tizzone","toccare","tollerare","tolto","tombola","tomo","tonfo","tonsilla","topazio","topologia","toppa","torba","tornare","torrone","tortora","toscano","tossire","tostatura","totano","trabocco","trachea","trafila","tragedia","tralcio","tramonto","transito","trapano","trarre","trasloco","trattato","trave","treccia","tremolio","trespolo","tributo","tricheco","trifoglio","trillo","trincea","trio","tristezza","triturato","trivella","tromba","trono","troppo","trottola","trovare","truccato","tubatura","tuffato","tulipano","tumulto","tunisia","turbare","turchino","tuta","tutela","ubicato","uccello","uccisore","udire","uditivo","uffa","ufficio","uguale","ulisse","ultimato","umano","umile","umorismo","uncinetto","ungere","ungherese","unicorno","unificato","unisono","unitario","unte","uovo","upupa","uragano","urgenza","urlo","usanza","usato","uscito","usignolo","usuraio","utensile","utilizzo","utopia","vacante","vaccinato","vagabondo","vagliato","valanga","valgo","valico","valletta","valoroso","valutare","valvola","vampata","vangare","vanitoso","vano","vantaggio","vanvera","vapore","varano","varcato","variante","vasca","vedetta","vedova","veduto","vegetale","veicolo","velcro","velina","velluto","veloce","venato","vendemmia","vento","verace","verbale","vergogna","verifica","vero","verruca","verticale","vescica","vessillo","vestale","veterano","vetrina","vetusto","viandante","vibrante","vicenda","vichingo","vicinanza","vidimare","vigilia","vigneto","vigore","vile","villano","vimini","vincitore","viola","vipera","virgola","virologo","virulento","viscoso","visione","vispo","vissuto","visura","vita","vitello","vittima","vivanda","vivido","viziare","voce","voga","volatile","volere","volpe","voragine","vulcano","zampogna","zanna","zappato","zattera","zavorra","zefiro","zelante","zelo","zenzero","zerbino","zibetto","zinco","zircone","zitto","zolla","zotico","zucchero","zufolo","zulu","zuppa"]')},function(e){e.exports=JSON.parse('["ábaco","abdomen","abeja","abierto","abogado","abono","aborto","abrazo","abrir","abuelo","abuso","acabar","academia","acceso","acción","aceite","acelga","acento","aceptar","ácido","aclarar","acné","acoger","acoso","activo","acto","actriz","actuar","acudir","acuerdo","acusar","adicto","admitir","adoptar","adorno","aduana","adulto","aéreo","afectar","afición","afinar","afirmar","ágil","agitar","agonía","agosto","agotar","agregar","agrio","agua","agudo","águila","aguja","ahogo","ahorro","aire","aislar","ajedrez","ajeno","ajuste","alacrán","alambre","alarma","alba","álbum","alcalde","aldea","alegre","alejar","alerta","aleta","alfiler","alga","algodón","aliado","aliento","alivio","alma","almeja","almíbar","altar","alteza","altivo","alto","altura","alumno","alzar","amable","amante","amapola","amargo","amasar","ámbar","ámbito","ameno","amigo","amistad","amor","amparo","amplio","ancho","anciano","ancla","andar","andén","anemia","ángulo","anillo","ánimo","anís","anotar","antena","antiguo","antojo","anual","anular","anuncio","añadir","añejo","año","apagar","aparato","apetito","apio","aplicar","apodo","aporte","apoyo","aprender","aprobar","apuesta","apuro","arado","araña","arar","árbitro","árbol","arbusto","archivo","arco","arder","ardilla","arduo","área","árido","aries","armonía","arnés","aroma","arpa","arpón","arreglo","arroz","arruga","arte","artista","asa","asado","asalto","ascenso","asegurar","aseo","asesor","asiento","asilo","asistir","asno","asombro","áspero","astilla","astro","astuto","asumir","asunto","atajo","ataque","atar","atento","ateo","ático","atleta","átomo","atraer","atroz","atún","audaz","audio","auge","aula","aumento","ausente","autor","aval","avance","avaro","ave","avellana","avena","avestruz","avión","aviso","ayer","ayuda","ayuno","azafrán","azar","azote","azúcar","azufre","azul","baba","babor","bache","bahía","baile","bajar","balanza","balcón","balde","bambú","banco","banda","baño","barba","barco","barniz","barro","báscula","bastón","basura","batalla","batería","batir","batuta","baúl","bazar","bebé","bebida","bello","besar","beso","bestia","bicho","bien","bingo","blanco","bloque","blusa","boa","bobina","bobo","boca","bocina","boda","bodega","boina","bola","bolero","bolsa","bomba","bondad","bonito","bono","bonsái","borde","borrar","bosque","bote","botín","bóveda","bozal","bravo","brazo","brecha","breve","brillo","brinco","brisa","broca","broma","bronce","brote","bruja","brusco","bruto","buceo","bucle","bueno","buey","bufanda","bufón","búho","buitre","bulto","burbuja","burla","burro","buscar","butaca","buzón","caballo","cabeza","cabina","cabra","cacao","cadáver","cadena","caer","café","caída","caimán","caja","cajón","cal","calamar","calcio","caldo","calidad","calle","calma","calor","calvo","cama","cambio","camello","camino","campo","cáncer","candil","canela","canguro","canica","canto","caña","cañón","caoba","caos","capaz","capitán","capote","captar","capucha","cara","carbón","cárcel","careta","carga","cariño","carne","carpeta","carro","carta","casa","casco","casero","caspa","castor","catorce","catre","caudal","causa","cazo","cebolla","ceder","cedro","celda","célebre","celoso","célula","cemento","ceniza","centro","cerca","cerdo","cereza","cero","cerrar","certeza","césped","cetro","chacal","chaleco","champú","chancla","chapa","charla","chico","chiste","chivo","choque","choza","chuleta","chupar","ciclón","ciego","cielo","cien","cierto","cifra","cigarro","cima","cinco","cine","cinta","ciprés","circo","ciruela","cisne","cita","ciudad","clamor","clan","claro","clase","clave","cliente","clima","clínica","cobre","cocción","cochino","cocina","coco","código","codo","cofre","coger","cohete","cojín","cojo","cola","colcha","colegio","colgar","colina","collar","colmo","columna","combate","comer","comida","cómodo","compra","conde","conejo","conga","conocer","consejo","contar","copa","copia","corazón","corbata","corcho","cordón","corona","correr","coser","cosmos","costa","cráneo","cráter","crear","crecer","creído","crema","cría","crimen","cripta","crisis","cromo","crónica","croqueta","crudo","cruz","cuadro","cuarto","cuatro","cubo","cubrir","cuchara","cuello","cuento","cuerda","cuesta","cueva","cuidar","culebra","culpa","culto","cumbre","cumplir","cuna","cuneta","cuota","cupón","cúpula","curar","curioso","curso","curva","cutis","dama","danza","dar","dardo","dátil","deber","débil","década","decir","dedo","defensa","definir","dejar","delfín","delgado","delito","demora","denso","dental","deporte","derecho","derrota","desayuno","deseo","desfile","desnudo","destino","desvío","detalle","detener","deuda","día","diablo","diadema","diamante","diana","diario","dibujo","dictar","diente","dieta","diez","difícil","digno","dilema","diluir","dinero","directo","dirigir","disco","diseño","disfraz","diva","divino","doble","doce","dolor","domingo","don","donar","dorado","dormir","dorso","dos","dosis","dragón","droga","ducha","duda","duelo","dueño","dulce","dúo","duque","durar","dureza","duro","ébano","ebrio","echar","eco","ecuador","edad","edición","edificio","editor","educar","efecto","eficaz","eje","ejemplo","elefante","elegir","elemento","elevar","elipse","élite","elixir","elogio","eludir","embudo","emitir","emoción","empate","empeño","empleo","empresa","enano","encargo","enchufe","encía","enemigo","enero","enfado","enfermo","engaño","enigma","enlace","enorme","enredo","ensayo","enseñar","entero","entrar","envase","envío","época","equipo","erizo","escala","escena","escolar","escribir","escudo","esencia","esfera","esfuerzo","espada","espejo","espía","esposa","espuma","esquí","estar","este","estilo","estufa","etapa","eterno","ética","etnia","evadir","evaluar","evento","evitar","exacto","examen","exceso","excusa","exento","exigir","exilio","existir","éxito","experto","explicar","exponer","extremo","fábrica","fábula","fachada","fácil","factor","faena","faja","falda","fallo","falso","faltar","fama","familia","famoso","faraón","farmacia","farol","farsa","fase","fatiga","fauna","favor","fax","febrero","fecha","feliz","feo","feria","feroz","fértil","fervor","festín","fiable","fianza","fiar","fibra","ficción","ficha","fideo","fiebre","fiel","fiera","fiesta","figura","fijar","fijo","fila","filete","filial","filtro","fin","finca","fingir","finito","firma","flaco","flauta","flecha","flor","flota","fluir","flujo","flúor","fobia","foca","fogata","fogón","folio","folleto","fondo","forma","forro","fortuna","forzar","fosa","foto","fracaso","frágil","franja","frase","fraude","freír","freno","fresa","frío","frito","fruta","fuego","fuente","fuerza","fuga","fumar","función","funda","furgón","furia","fusil","fútbol","futuro","gacela","gafas","gaita","gajo","gala","galería","gallo","gamba","ganar","gancho","ganga","ganso","garaje","garza","gasolina","gastar","gato","gavilán","gemelo","gemir","gen","género","genio","gente","geranio","gerente","germen","gesto","gigante","gimnasio","girar","giro","glaciar","globo","gloria","gol","golfo","goloso","golpe","goma","gordo","gorila","gorra","gota","goteo","gozar","grada","gráfico","grano","grasa","gratis","grave","grieta","grillo","gripe","gris","grito","grosor","grúa","grueso","grumo","grupo","guante","guapo","guardia","guerra","guía","guiño","guion","guiso","guitarra","gusano","gustar","haber","hábil","hablar","hacer","hacha","hada","hallar","hamaca","harina","haz","hazaña","hebilla","hebra","hecho","helado","helio","hembra","herir","hermano","héroe","hervir","hielo","hierro","hígado","higiene","hijo","himno","historia","hocico","hogar","hoguera","hoja","hombre","hongo","honor","honra","hora","hormiga","horno","hostil","hoyo","hueco","huelga","huerta","hueso","huevo","huida","huir","humano","húmedo","humilde","humo","hundir","huracán","hurto","icono","ideal","idioma","ídolo","iglesia","iglú","igual","ilegal","ilusión","imagen","imán","imitar","impar","imperio","imponer","impulso","incapaz","índice","inerte","infiel","informe","ingenio","inicio","inmenso","inmune","innato","insecto","instante","interés","íntimo","intuir","inútil","invierno","ira","iris","ironía","isla","islote","jabalí","jabón","jamón","jarabe","jardín","jarra","jaula","jazmín","jefe","jeringa","jinete","jornada","joroba","joven","joya","juerga","jueves","juez","jugador","jugo","juguete","juicio","junco","jungla","junio","juntar","júpiter","jurar","justo","juvenil","juzgar","kilo","koala","labio","lacio","lacra","lado","ladrón","lagarto","lágrima","laguna","laico","lamer","lámina","lámpara","lana","lancha","langosta","lanza","lápiz","largo","larva","lástima","lata","látex","latir","laurel","lavar","lazo","leal","lección","leche","lector","leer","legión","legumbre","lejano","lengua","lento","leña","león","leopardo","lesión","letal","letra","leve","leyenda","libertad","libro","licor","líder","lidiar","lienzo","liga","ligero","lima","límite","limón","limpio","lince","lindo","línea","lingote","lino","linterna","líquido","liso","lista","litera","litio","litro","llaga","llama","llanto","llave","llegar","llenar","llevar","llorar","llover","lluvia","lobo","loción","loco","locura","lógica","logro","lombriz","lomo","lonja","lote","lucha","lucir","lugar","lujo","luna","lunes","lupa","lustro","luto","luz","maceta","macho","madera","madre","maduro","maestro","mafia","magia","mago","maíz","maldad","maleta","malla","malo","mamá","mambo","mamut","manco","mando","manejar","manga","maniquí","manjar","mano","manso","manta","mañana","mapa","máquina","mar","marco","marea","marfil","margen","marido","mármol","marrón","martes","marzo","masa","máscara","masivo","matar","materia","matiz","matriz","máximo","mayor","mazorca","mecha","medalla","medio","médula","mejilla","mejor","melena","melón","memoria","menor","mensaje","mente","menú","mercado","merengue","mérito","mes","mesón","meta","meter","método","metro","mezcla","miedo","miel","miembro","miga","mil","milagro","militar","millón","mimo","mina","minero","mínimo","minuto","miope","mirar","misa","miseria","misil","mismo","mitad","mito","mochila","moción","moda","modelo","moho","mojar","molde","moler","molino","momento","momia","monarca","moneda","monja","monto","moño","morada","morder","moreno","morir","morro","morsa","mortal","mosca","mostrar","motivo","mover","móvil","mozo","mucho","mudar","mueble","muela","muerte","muestra","mugre","mujer","mula","muleta","multa","mundo","muñeca","mural","muro","músculo","museo","musgo","música","muslo","nácar","nación","nadar","naipe","naranja","nariz","narrar","nasal","natal","nativo","natural","náusea","naval","nave","navidad","necio","néctar","negar","negocio","negro","neón","nervio","neto","neutro","nevar","nevera","nicho","nido","niebla","nieto","niñez","niño","nítido","nivel","nobleza","noche","nómina","noria","norma","norte","nota","noticia","novato","novela","novio","nube","nuca","núcleo","nudillo","nudo","nuera","nueve","nuez","nulo","número","nutria","oasis","obeso","obispo","objeto","obra","obrero","observar","obtener","obvio","oca","ocaso","océano","ochenta","ocho","ocio","ocre","octavo","octubre","oculto","ocupar","ocurrir","odiar","odio","odisea","oeste","ofensa","oferta","oficio","ofrecer","ogro","oído","oír","ojo","ola","oleada","olfato","olivo","olla","olmo","olor","olvido","ombligo","onda","onza","opaco","opción","ópera","opinar","oponer","optar","óptica","opuesto","oración","orador","oral","órbita","orca","orden","oreja","órgano","orgía","orgullo","oriente","origen","orilla","oro","orquesta","oruga","osadía","oscuro","osezno","oso","ostra","otoño","otro","oveja","óvulo","óxido","oxígeno","oyente","ozono","pacto","padre","paella","página","pago","país","pájaro","palabra","palco","paleta","pálido","palma","paloma","palpar","pan","panal","pánico","pantera","pañuelo","papá","papel","papilla","paquete","parar","parcela","pared","parir","paro","párpado","parque","párrafo","parte","pasar","paseo","pasión","paso","pasta","pata","patio","patria","pausa","pauta","pavo","payaso","peatón","pecado","pecera","pecho","pedal","pedir","pegar","peine","pelar","peldaño","pelea","peligro","pellejo","pelo","peluca","pena","pensar","peñón","peón","peor","pepino","pequeño","pera","percha","perder","pereza","perfil","perico","perla","permiso","perro","persona","pesa","pesca","pésimo","pestaña","pétalo","petróleo","pez","pezuña","picar","pichón","pie","piedra","pierna","pieza","pijama","pilar","piloto","pimienta","pino","pintor","pinza","piña","piojo","pipa","pirata","pisar","piscina","piso","pista","pitón","pizca","placa","plan","plata","playa","plaza","pleito","pleno","plomo","pluma","plural","pobre","poco","poder","podio","poema","poesía","poeta","polen","policía","pollo","polvo","pomada","pomelo","pomo","pompa","poner","porción","portal","posada","poseer","posible","poste","potencia","potro","pozo","prado","precoz","pregunta","premio","prensa","preso","previo","primo","príncipe","prisión","privar","proa","probar","proceso","producto","proeza","profesor","programa","prole","promesa","pronto","propio","próximo","prueba","público","puchero","pudor","pueblo","puerta","puesto","pulga","pulir","pulmón","pulpo","pulso","puma","punto","puñal","puño","pupa","pupila","puré","quedar","queja","quemar","querer","queso","quieto","química","quince","quitar","rábano","rabia","rabo","ración","radical","raíz","rama","rampa","rancho","rango","rapaz","rápido","rapto","rasgo","raspa","rato","rayo","raza","razón","reacción","realidad","rebaño","rebote","recaer","receta","rechazo","recoger","recreo","recto","recurso","red","redondo","reducir","reflejo","reforma","refrán","refugio","regalo","regir","regla","regreso","rehén","reino","reír","reja","relato","relevo","relieve","relleno","reloj","remar","remedio","remo","rencor","rendir","renta","reparto","repetir","reposo","reptil","res","rescate","resina","respeto","resto","resumen","retiro","retorno","retrato","reunir","revés","revista","rey","rezar","rico","riego","rienda","riesgo","rifa","rígido","rigor","rincón","riñón","río","riqueza","risa","ritmo","rito","rizo","roble","roce","rociar","rodar","rodeo","rodilla","roer","rojizo","rojo","romero","romper","ron","ronco","ronda","ropa","ropero","rosa","rosca","rostro","rotar","rubí","rubor","rudo","rueda","rugir","ruido","ruina","ruleta","rulo","rumbo","rumor","ruptura","ruta","rutina","sábado","saber","sabio","sable","sacar","sagaz","sagrado","sala","saldo","salero","salir","salmón","salón","salsa","salto","salud","salvar","samba","sanción","sandía","sanear","sangre","sanidad","sano","santo","sapo","saque","sardina","sartén","sastre","satán","sauna","saxofón","sección","seco","secreto","secta","sed","seguir","seis","sello","selva","semana","semilla","senda","sensor","señal","señor","separar","sepia","sequía","ser","serie","sermón","servir","sesenta","sesión","seta","setenta","severo","sexo","sexto","sidra","siesta","siete","siglo","signo","sílaba","silbar","silencio","silla","símbolo","simio","sirena","sistema","sitio","situar","sobre","socio","sodio","sol","solapa","soldado","soledad","sólido","soltar","solución","sombra","sondeo","sonido","sonoro","sonrisa","sopa","soplar","soporte","sordo","sorpresa","sorteo","sostén","sótano","suave","subir","suceso","sudor","suegra","suelo","sueño","suerte","sufrir","sujeto","sultán","sumar","superar","suplir","suponer","supremo","sur","surco","sureño","surgir","susto","sutil","tabaco","tabique","tabla","tabú","taco","tacto","tajo","talar","talco","talento","talla","talón","tamaño","tambor","tango","tanque","tapa","tapete","tapia","tapón","taquilla","tarde","tarea","tarifa","tarjeta","tarot","tarro","tarta","tatuaje","tauro","taza","tazón","teatro","techo","tecla","técnica","tejado","tejer","tejido","tela","teléfono","tema","temor","templo","tenaz","tender","tener","tenis","tenso","teoría","terapia","terco","término","ternura","terror","tesis","tesoro","testigo","tetera","texto","tez","tibio","tiburón","tiempo","tienda","tierra","tieso","tigre","tijera","tilde","timbre","tímido","timo","tinta","tío","típico","tipo","tira","tirón","titán","títere","título","tiza","toalla","tobillo","tocar","tocino","todo","toga","toldo","tomar","tono","tonto","topar","tope","toque","tórax","torero","tormenta","torneo","toro","torpedo","torre","torso","tortuga","tos","tosco","toser","tóxico","trabajo","tractor","traer","tráfico","trago","traje","tramo","trance","trato","trauma","trazar","trébol","tregua","treinta","tren","trepar","tres","tribu","trigo","tripa","triste","triunfo","trofeo","trompa","tronco","tropa","trote","trozo","truco","trueno","trufa","tubería","tubo","tuerto","tumba","tumor","túnel","túnica","turbina","turismo","turno","tutor","ubicar","úlcera","umbral","unidad","unir","universo","uno","untar","uña","urbano","urbe","urgente","urna","usar","usuario","útil","utopía","uva","vaca","vacío","vacuna","vagar","vago","vaina","vajilla","vale","válido","valle","valor","válvula","vampiro","vara","variar","varón","vaso","vecino","vector","vehículo","veinte","vejez","vela","velero","veloz","vena","vencer","venda","veneno","vengar","venir","venta","venus","ver","verano","verbo","verde","vereda","verja","verso","verter","vía","viaje","vibrar","vicio","víctima","vida","vídeo","vidrio","viejo","viernes","vigor","vil","villa","vinagre","vino","viñedo","violín","viral","virgo","virtud","visor","víspera","vista","vitamina","viudo","vivaz","vivero","vivir","vivo","volcán","volumen","volver","voraz","votar","voto","voz","vuelo","vulgar","yacer","yate","yegua","yema","yerno","yeso","yodo","yoga","yogur","zafiro","zanja","zapato","zarza","zona","zorro","zumo","zurdo"]')},function(e){e.exports=JSON.parse('["あいこくしん","あいさつ","あいだ","あおぞら","あかちゃん","あきる","あけがた","あける","あこがれる","あさい","あさひ","あしあと","あじわう","あずかる","あずき","あそぶ","あたえる","あたためる","あたりまえ","あたる","あつい","あつかう","あっしゅく","あつまり","あつめる","あてな","あてはまる","あひる","あぶら","あぶる","あふれる","あまい","あまど","あまやかす","あまり","あみもの","あめりか","あやまる","あゆむ","あらいぐま","あらし","あらすじ","あらためる","あらゆる","あらわす","ありがとう","あわせる","あわてる","あんい","あんがい","あんこ","あんぜん","あんてい","あんない","あんまり","いいだす","いおん","いがい","いがく","いきおい","いきなり","いきもの","いきる","いくじ","いくぶん","いけばな","いけん","いこう","いこく","いこつ","いさましい","いさん","いしき","いじゅう","いじょう","いじわる","いずみ","いずれ","いせい","いせえび","いせかい","いせき","いぜん","いそうろう","いそがしい","いだい","いだく","いたずら","いたみ","いたりあ","いちおう","いちじ","いちど","いちば","いちぶ","いちりゅう","いつか","いっしゅん","いっせい","いっそう","いったん","いっち","いってい","いっぽう","いてざ","いてん","いどう","いとこ","いない","いなか","いねむり","いのち","いのる","いはつ","いばる","いはん","いびき","いひん","いふく","いへん","いほう","いみん","いもうと","いもたれ","いもり","いやがる","いやす","いよかん","いよく","いらい","いらすと","いりぐち","いりょう","いれい","いれもの","いれる","いろえんぴつ","いわい","いわう","いわかん","いわば","いわゆる","いんげんまめ","いんさつ","いんしょう","いんよう","うえき","うえる","うおざ","うがい","うかぶ","うかべる","うきわ","うくらいな","うくれれ","うけたまわる","うけつけ","うけとる","うけもつ","うける","うごかす","うごく","うこん","うさぎ","うしなう","うしろがみ","うすい","うすぎ","うすぐらい","うすめる","うせつ","うちあわせ","うちがわ","うちき","うちゅう","うっかり","うつくしい","うったえる","うつる","うどん","うなぎ","うなじ","うなずく","うなる","うねる","うのう","うぶげ","うぶごえ","うまれる","うめる","うもう","うやまう","うよく","うらがえす","うらぐち","うらない","うりあげ","うりきれ","うるさい","うれしい","うれゆき","うれる","うろこ","うわき","うわさ","うんこう","うんちん","うんてん","うんどう","えいえん","えいが","えいきょう","えいご","えいせい","えいぶん","えいよう","えいわ","えおり","えがお","えがく","えきたい","えくせる","えしゃく","えすて","えつらん","えのぐ","えほうまき","えほん","えまき","えもじ","えもの","えらい","えらぶ","えりあ","えんえん","えんかい","えんぎ","えんげき","えんしゅう","えんぜつ","えんそく","えんちょう","えんとつ","おいかける","おいこす","おいしい","おいつく","おうえん","おうさま","おうじ","おうせつ","おうたい","おうふく","おうべい","おうよう","おえる","おおい","おおう","おおどおり","おおや","おおよそ","おかえり","おかず","おがむ","おかわり","おぎなう","おきる","おくさま","おくじょう","おくりがな","おくる","おくれる","おこす","おこなう","おこる","おさえる","おさない","おさめる","おしいれ","おしえる","おじぎ","おじさん","おしゃれ","おそらく","おそわる","おたがい","おたく","おだやか","おちつく","おっと","おつり","おでかけ","おとしもの","おとなしい","おどり","おどろかす","おばさん","おまいり","おめでとう","おもいで","おもう","おもたい","おもちゃ","おやつ","おやゆび","およぼす","おらんだ","おろす","おんがく","おんけい","おんしゃ","おんせん","おんだん","おんちゅう","おんどけい","かあつ","かいが","がいき","がいけん","がいこう","かいさつ","かいしゃ","かいすいよく","かいぜん","かいぞうど","かいつう","かいてん","かいとう","かいふく","がいへき","かいほう","かいよう","がいらい","かいわ","かえる","かおり","かかえる","かがく","かがし","かがみ","かくご","かくとく","かざる","がぞう","かたい","かたち","がちょう","がっきゅう","がっこう","がっさん","がっしょう","かなざわし","かのう","がはく","かぶか","かほう","かほご","かまう","かまぼこ","かめれおん","かゆい","かようび","からい","かるい","かろう","かわく","かわら","がんか","かんけい","かんこう","かんしゃ","かんそう","かんたん","かんち","がんばる","きあい","きあつ","きいろ","ぎいん","きうい","きうん","きえる","きおう","きおく","きおち","きおん","きかい","きかく","きかんしゃ","ききて","きくばり","きくらげ","きけんせい","きこう","きこえる","きこく","きさい","きさく","きさま","きさらぎ","ぎじかがく","ぎしき","ぎじたいけん","ぎじにってい","ぎじゅつしゃ","きすう","きせい","きせき","きせつ","きそう","きぞく","きぞん","きたえる","きちょう","きつえん","ぎっちり","きつつき","きつね","きてい","きどう","きどく","きない","きなが","きなこ","きぬごし","きねん","きのう","きのした","きはく","きびしい","きひん","きふく","きぶん","きぼう","きほん","きまる","きみつ","きむずかしい","きめる","きもだめし","きもち","きもの","きゃく","きやく","ぎゅうにく","きよう","きょうりゅう","きらい","きらく","きりん","きれい","きれつ","きろく","ぎろん","きわめる","ぎんいろ","きんかくじ","きんじょ","きんようび","ぐあい","くいず","くうかん","くうき","くうぐん","くうこう","ぐうせい","くうそう","ぐうたら","くうふく","くうぼ","くかん","くきょう","くげん","ぐこう","くさい","くさき","くさばな","くさる","くしゃみ","くしょう","くすのき","くすりゆび","くせげ","くせん","ぐたいてき","くださる","くたびれる","くちこみ","くちさき","くつした","ぐっすり","くつろぐ","くとうてん","くどく","くなん","くねくね","くのう","くふう","くみあわせ","くみたてる","くめる","くやくしょ","くらす","くらべる","くるま","くれる","くろう","くわしい","ぐんかん","ぐんしょく","ぐんたい","ぐんて","けあな","けいかく","けいけん","けいこ","けいさつ","げいじゅつ","けいたい","げいのうじん","けいれき","けいろ","けおとす","けおりもの","げきか","げきげん","げきだん","げきちん","げきとつ","げきは","げきやく","げこう","げこくじょう","げざい","けさき","げざん","けしき","けしごむ","けしょう","げすと","けたば","けちゃっぷ","けちらす","けつあつ","けつい","けつえき","けっこん","けつじょ","けっせき","けってい","けつまつ","げつようび","げつれい","けつろん","げどく","けとばす","けとる","けなげ","けなす","けなみ","けぬき","げねつ","けねん","けはい","げひん","けぶかい","げぼく","けまり","けみかる","けむし","けむり","けもの","けらい","けろけろ","けわしい","けんい","けんえつ","けんお","けんか","げんき","けんげん","けんこう","けんさく","けんしゅう","けんすう","げんそう","けんちく","けんてい","けんとう","けんない","けんにん","げんぶつ","けんま","けんみん","けんめい","けんらん","けんり","こあくま","こいぬ","こいびと","ごうい","こうえん","こうおん","こうかん","ごうきゅう","ごうけい","こうこう","こうさい","こうじ","こうすい","ごうせい","こうそく","こうたい","こうちゃ","こうつう","こうてい","こうどう","こうない","こうはい","ごうほう","ごうまん","こうもく","こうりつ","こえる","こおり","ごかい","ごがつ","ごかん","こくご","こくさい","こくとう","こくない","こくはく","こぐま","こけい","こける","ここのか","こころ","こさめ","こしつ","こすう","こせい","こせき","こぜん","こそだて","こたい","こたえる","こたつ","こちょう","こっか","こつこつ","こつばん","こつぶ","こてい","こてん","ことがら","ことし","ことば","ことり","こなごな","こねこね","このまま","このみ","このよ","ごはん","こひつじ","こふう","こふん","こぼれる","ごまあぶら","こまかい","ごますり","こまつな","こまる","こむぎこ","こもじ","こもち","こもの","こもん","こやく","こやま","こゆう","こゆび","こよい","こよう","こりる","これくしょん","ころっけ","こわもて","こわれる","こんいん","こんかい","こんき","こんしゅう","こんすい","こんだて","こんとん","こんなん","こんびに","こんぽん","こんまけ","こんや","こんれい","こんわく","ざいえき","さいかい","さいきん","ざいげん","ざいこ","さいしょ","さいせい","ざいたく","ざいちゅう","さいてき","ざいりょう","さうな","さかいし","さがす","さかな","さかみち","さがる","さぎょう","さくし","さくひん","さくら","さこく","さこつ","さずかる","ざせき","さたん","さつえい","ざつおん","ざっか","ざつがく","さっきょく","ざっし","さつじん","ざっそう","さつたば","さつまいも","さてい","さといも","さとう","さとおや","さとし","さとる","さのう","さばく","さびしい","さべつ","さほう","さほど","さます","さみしい","さみだれ","さむけ","さめる","さやえんどう","さゆう","さよう","さよく","さらだ","ざるそば","さわやか","さわる","さんいん","さんか","さんきゃく","さんこう","さんさい","ざんしょ","さんすう","さんせい","さんそ","さんち","さんま","さんみ","さんらん","しあい","しあげ","しあさって","しあわせ","しいく","しいん","しうち","しえい","しおけ","しかい","しかく","じかん","しごと","しすう","じだい","したうけ","したぎ","したて","したみ","しちょう","しちりん","しっかり","しつじ","しつもん","してい","してき","してつ","じてん","じどう","しなぎれ","しなもの","しなん","しねま","しねん","しのぐ","しのぶ","しはい","しばかり","しはつ","しはらい","しはん","しひょう","しふく","じぶん","しへい","しほう","しほん","しまう","しまる","しみん","しむける","じむしょ","しめい","しめる","しもん","しゃいん","しゃうん","しゃおん","じゃがいも","しやくしょ","しゃくほう","しゃけん","しゃこ","しゃざい","しゃしん","しゃせん","しゃそう","しゃたい","しゃちょう","しゃっきん","じゃま","しゃりん","しゃれい","じゆう","じゅうしょ","しゅくはく","じゅしん","しゅっせき","しゅみ","しゅらば","じゅんばん","しょうかい","しょくたく","しょっけん","しょどう","しょもつ","しらせる","しらべる","しんか","しんこう","じんじゃ","しんせいじ","しんちく","しんりん","すあげ","すあし","すあな","ずあん","すいえい","すいか","すいとう","ずいぶん","すいようび","すうがく","すうじつ","すうせん","すおどり","すきま","すくう","すくない","すける","すごい","すこし","ずさん","すずしい","すすむ","すすめる","すっかり","ずっしり","ずっと","すてき","すてる","すねる","すのこ","すはだ","すばらしい","ずひょう","ずぶぬれ","すぶり","すふれ","すべて","すべる","ずほう","すぼん","すまい","すめし","すもう","すやき","すらすら","するめ","すれちがう","すろっと","すわる","すんぜん","すんぽう","せあぶら","せいかつ","せいげん","せいじ","せいよう","せおう","せかいかん","せきにん","せきむ","せきゆ","せきらんうん","せけん","せこう","せすじ","せたい","せたけ","せっかく","せっきゃく","ぜっく","せっけん","せっこつ","せっさたくま","せつぞく","せつだん","せつでん","せっぱん","せつび","せつぶん","せつめい","せつりつ","せなか","せのび","せはば","せびろ","せぼね","せまい","せまる","せめる","せもたれ","せりふ","ぜんあく","せんい","せんえい","せんか","せんきょ","せんく","せんげん","ぜんご","せんさい","せんしゅ","せんすい","せんせい","せんぞ","せんたく","せんちょう","せんてい","せんとう","せんぬき","せんねん","せんぱい","ぜんぶ","ぜんぽう","せんむ","せんめんじょ","せんもん","せんやく","せんゆう","せんよう","ぜんら","ぜんりゃく","せんれい","せんろ","そあく","そいとげる","そいね","そうがんきょう","そうき","そうご","そうしん","そうだん","そうなん","そうび","そうめん","そうり","そえもの","そえん","そがい","そげき","そこう","そこそこ","そざい","そしな","そせい","そせん","そそぐ","そだてる","そつう","そつえん","そっかん","そつぎょう","そっけつ","そっこう","そっせん","そっと","そとがわ","そとづら","そなえる","そなた","そふぼ","そぼく","そぼろ","そまつ","そまる","そむく","そむりえ","そめる","そもそも","そよかぜ","そらまめ","そろう","そんかい","そんけい","そんざい","そんしつ","そんぞく","そんちょう","ぞんび","ぞんぶん","そんみん","たあい","たいいん","たいうん","たいえき","たいおう","だいがく","たいき","たいぐう","たいけん","たいこ","たいざい","だいじょうぶ","だいすき","たいせつ","たいそう","だいたい","たいちょう","たいてい","だいどころ","たいない","たいねつ","たいのう","たいはん","だいひょう","たいふう","たいへん","たいほ","たいまつばな","たいみんぐ","たいむ","たいめん","たいやき","たいよう","たいら","たいりょく","たいる","たいわん","たうえ","たえる","たおす","たおる","たおれる","たかい","たかね","たきび","たくさん","たこく","たこやき","たさい","たしざん","だじゃれ","たすける","たずさわる","たそがれ","たたかう","たたく","ただしい","たたみ","たちばな","だっかい","だっきゃく","だっこ","だっしゅつ","だったい","たてる","たとえる","たなばた","たにん","たぬき","たのしみ","たはつ","たぶん","たべる","たぼう","たまご","たまる","だむる","ためいき","ためす","ためる","たもつ","たやすい","たよる","たらす","たりきほんがん","たりょう","たりる","たると","たれる","たれんと","たろっと","たわむれる","だんあつ","たんい","たんおん","たんか","たんき","たんけん","たんご","たんさん","たんじょうび","だんせい","たんそく","たんたい","だんち","たんてい","たんとう","だんな","たんにん","だんねつ","たんのう","たんぴん","だんぼう","たんまつ","たんめい","だんれつ","だんろ","だんわ","ちあい","ちあん","ちいき","ちいさい","ちえん","ちかい","ちから","ちきゅう","ちきん","ちけいず","ちけん","ちこく","ちさい","ちしき","ちしりょう","ちせい","ちそう","ちたい","ちたん","ちちおや","ちつじょ","ちてき","ちてん","ちぬき","ちぬり","ちのう","ちひょう","ちへいせん","ちほう","ちまた","ちみつ","ちみどろ","ちめいど","ちゃんこなべ","ちゅうい","ちゆりょく","ちょうし","ちょさくけん","ちらし","ちらみ","ちりがみ","ちりょう","ちるど","ちわわ","ちんたい","ちんもく","ついか","ついたち","つうか","つうじょう","つうはん","つうわ","つかう","つかれる","つくね","つくる","つけね","つける","つごう","つたえる","つづく","つつじ","つつむ","つとめる","つながる","つなみ","つねづね","つのる","つぶす","つまらない","つまる","つみき","つめたい","つもり","つもる","つよい","つるぼ","つるみく","つわもの","つわり","てあし","てあて","てあみ","ていおん","ていか","ていき","ていけい","ていこく","ていさつ","ていし","ていせい","ていたい","ていど","ていねい","ていひょう","ていへん","ていぼう","てうち","ておくれ","てきとう","てくび","でこぼこ","てさぎょう","てさげ","てすり","てそう","てちがい","てちょう","てつがく","てつづき","でっぱ","てつぼう","てつや","でぬかえ","てぬき","てぬぐい","てのひら","てはい","てぶくろ","てふだ","てほどき","てほん","てまえ","てまきずし","てみじか","てみやげ","てらす","てれび","てわけ","てわたし","でんあつ","てんいん","てんかい","てんき","てんぐ","てんけん","てんごく","てんさい","てんし","てんすう","でんち","てんてき","てんとう","てんない","てんぷら","てんぼうだい","てんめつ","てんらんかい","でんりょく","でんわ","どあい","といれ","どうかん","とうきゅう","どうぐ","とうし","とうむぎ","とおい","とおか","とおく","とおす","とおる","とかい","とかす","ときおり","ときどき","とくい","とくしゅう","とくてん","とくに","とくべつ","とけい","とける","とこや","とさか","としょかん","とそう","とたん","とちゅう","とっきゅう","とっくん","とつぜん","とつにゅう","とどける","ととのえる","とない","となえる","となり","とのさま","とばす","どぶがわ","とほう","とまる","とめる","ともだち","ともる","どようび","とらえる","とんかつ","どんぶり","ないかく","ないこう","ないしょ","ないす","ないせん","ないそう","なおす","ながい","なくす","なげる","なこうど","なさけ","なたでここ","なっとう","なつやすみ","ななおし","なにごと","なにもの","なにわ","なのか","なふだ","なまいき","なまえ","なまみ","なみだ","なめらか","なめる","なやむ","ならう","ならび","ならぶ","なれる","なわとび","なわばり","にあう","にいがた","にうけ","におい","にかい","にがて","にきび","にくしみ","にくまん","にげる","にさんかたんそ","にしき","にせもの","にちじょう","にちようび","にっか","にっき","にっけい","にっこう","にっさん","にっしょく","にっすう","にっせき","にってい","になう","にほん","にまめ","にもつ","にやり","にゅういん","にりんしゃ","にわとり","にんい","にんか","にんき","にんげん","にんしき","にんずう","にんそう","にんたい","にんち","にんてい","にんにく","にんぷ","にんまり","にんむ","にんめい","にんよう","ぬいくぎ","ぬかす","ぬぐいとる","ぬぐう","ぬくもり","ぬすむ","ぬまえび","ぬめり","ぬらす","ぬんちゃく","ねあげ","ねいき","ねいる","ねいろ","ねぐせ","ねくたい","ねくら","ねこぜ","ねこむ","ねさげ","ねすごす","ねそべる","ねだん","ねつい","ねっしん","ねつぞう","ねったいぎょ","ねぶそく","ねふだ","ねぼう","ねほりはほり","ねまき","ねまわし","ねみみ","ねむい","ねむたい","ねもと","ねらう","ねわざ","ねんいり","ねんおし","ねんかん","ねんきん","ねんぐ","ねんざ","ねんし","ねんちゃく","ねんど","ねんぴ","ねんぶつ","ねんまつ","ねんりょう","ねんれい","のいず","のおづま","のがす","のきなみ","のこぎり","のこす","のこる","のせる","のぞく","のぞむ","のたまう","のちほど","のっく","のばす","のはら","のべる","のぼる","のみもの","のやま","のらいぬ","のらねこ","のりもの","のりゆき","のれん","のんき","ばあい","はあく","ばあさん","ばいか","ばいく","はいけん","はいご","はいしん","はいすい","はいせん","はいそう","はいち","ばいばい","はいれつ","はえる","はおる","はかい","ばかり","はかる","はくしゅ","はけん","はこぶ","はさみ","はさん","はしご","ばしょ","はしる","はせる","ぱそこん","はそん","はたん","はちみつ","はつおん","はっかく","はづき","はっきり","はっくつ","はっけん","はっこう","はっさん","はっしん","はったつ","はっちゅう","はってん","はっぴょう","はっぽう","はなす","はなび","はにかむ","はぶらし","はみがき","はむかう","はめつ","はやい","はやし","はらう","はろうぃん","はわい","はんい","はんえい","はんおん","はんかく","はんきょう","ばんぐみ","はんこ","はんしゃ","はんすう","はんだん","ぱんち","ぱんつ","はんてい","はんとし","はんのう","はんぱ","はんぶん","はんぺん","はんぼうき","はんめい","はんらん","はんろん","ひいき","ひうん","ひえる","ひかく","ひかり","ひかる","ひかん","ひくい","ひけつ","ひこうき","ひこく","ひさい","ひさしぶり","ひさん","びじゅつかん","ひしょ","ひそか","ひそむ","ひたむき","ひだり","ひたる","ひつぎ","ひっこし","ひっし","ひつじゅひん","ひっす","ひつぜん","ぴったり","ぴっちり","ひつよう","ひてい","ひとごみ","ひなまつり","ひなん","ひねる","ひはん","ひびく","ひひょう","ひほう","ひまわり","ひまん","ひみつ","ひめい","ひめじし","ひやけ","ひやす","ひよう","びょうき","ひらがな","ひらく","ひりつ","ひりょう","ひるま","ひるやすみ","ひれい","ひろい","ひろう","ひろき","ひろゆき","ひんかく","ひんけつ","ひんこん","ひんしゅ","ひんそう","ぴんち","ひんぱん","びんぼう","ふあん","ふいうち","ふうけい","ふうせん","ぷうたろう","ふうとう","ふうふ","ふえる","ふおん","ふかい","ふきん","ふくざつ","ふくぶくろ","ふこう","ふさい","ふしぎ","ふじみ","ふすま","ふせい","ふせぐ","ふそく","ぶたにく","ふたん","ふちょう","ふつう","ふつか","ふっかつ","ふっき","ふっこく","ぶどう","ふとる","ふとん","ふのう","ふはい","ふひょう","ふへん","ふまん","ふみん","ふめつ","ふめん","ふよう","ふりこ","ふりる","ふるい","ふんいき","ぶんがく","ぶんぐ","ふんしつ","ぶんせき","ふんそう","ぶんぽう","へいあん","へいおん","へいがい","へいき","へいげん","へいこう","へいさ","へいしゃ","へいせつ","へいそ","へいたく","へいてん","へいねつ","へいわ","へきが","へこむ","べにいろ","べにしょうが","へらす","へんかん","べんきょう","べんごし","へんさい","へんたい","べんり","ほあん","ほいく","ぼうぎょ","ほうこく","ほうそう","ほうほう","ほうもん","ほうりつ","ほえる","ほおん","ほかん","ほきょう","ぼきん","ほくろ","ほけつ","ほけん","ほこう","ほこる","ほしい","ほしつ","ほしゅ","ほしょう","ほせい","ほそい","ほそく","ほたて","ほたる","ぽちぶくろ","ほっきょく","ほっさ","ほったん","ほとんど","ほめる","ほんい","ほんき","ほんけ","ほんしつ","ほんやく","まいにち","まかい","まかせる","まがる","まける","まこと","まさつ","まじめ","ますく","まぜる","まつり","まとめ","まなぶ","まぬけ","まねく","まほう","まもる","まゆげ","まよう","まろやか","まわす","まわり","まわる","まんが","まんきつ","まんぞく","まんなか","みいら","みうち","みえる","みがく","みかた","みかん","みけん","みこん","みじかい","みすい","みすえる","みせる","みっか","みつかる","みつける","みてい","みとめる","みなと","みなみかさい","みねらる","みのう","みのがす","みほん","みもと","みやげ","みらい","みりょく","みわく","みんか","みんぞく","むいか","むえき","むえん","むかい","むかう","むかえ","むかし","むぎちゃ","むける","むげん","むさぼる","むしあつい","むしば","むじゅん","むしろ","むすう","むすこ","むすぶ","むすめ","むせる","むせん","むちゅう","むなしい","むのう","むやみ","むよう","むらさき","むりょう","むろん","めいあん","めいうん","めいえん","めいかく","めいきょく","めいさい","めいし","めいそう","めいぶつ","めいれい","めいわく","めぐまれる","めざす","めした","めずらしい","めだつ","めまい","めやす","めんきょ","めんせき","めんどう","もうしあげる","もうどうけん","もえる","もくし","もくてき","もくようび","もちろん","もどる","もらう","もんく","もんだい","やおや","やける","やさい","やさしい","やすい","やすたろう","やすみ","やせる","やそう","やたい","やちん","やっと","やっぱり","やぶる","やめる","ややこしい","やよい","やわらかい","ゆうき","ゆうびんきょく","ゆうべ","ゆうめい","ゆけつ","ゆしゅつ","ゆせん","ゆそう","ゆたか","ゆちゃく","ゆでる","ゆにゅう","ゆびわ","ゆらい","ゆれる","ようい","ようか","ようきゅう","ようじ","ようす","ようちえん","よかぜ","よかん","よきん","よくせい","よくぼう","よけい","よごれる","よさん","よしゅう","よそう","よそく","よっか","よてい","よどがわく","よねつ","よやく","よゆう","よろこぶ","よろしい","らいう","らくがき","らくご","らくさつ","らくだ","らしんばん","らせん","らぞく","らたい","らっか","られつ","りえき","りかい","りきさく","りきせつ","りくぐん","りくつ","りけん","りこう","りせい","りそう","りそく","りてん","りねん","りゆう","りゅうがく","りよう","りょうり","りょかん","りょくちゃ","りょこう","りりく","りれき","りろん","りんご","るいけい","るいさい","るいじ","るいせき","るすばん","るりがわら","れいかん","れいぎ","れいせい","れいぞうこ","れいとう","れいぼう","れきし","れきだい","れんあい","れんけい","れんこん","れんさい","れんしゅう","れんぞく","れんらく","ろうか","ろうご","ろうじん","ろうそく","ろくが","ろこつ","ろじうら","ろしゅつ","ろせん","ろてん","ろめん","ろれつ","ろんぎ","ろんぱ","ろんぶん","ろんり","わかす","わかめ","わかやま","わかれる","わしつ","わじまし","わすれもの","わらう","われる"]')},function(e){e.exports=JSON.parse('["abacate","abaixo","abalar","abater","abduzir","abelha","aberto","abismo","abotoar","abranger","abreviar","abrigar","abrupto","absinto","absoluto","absurdo","abutre","acabado","acalmar","acampar","acanhar","acaso","aceitar","acelerar","acenar","acervo","acessar","acetona","achatar","acidez","acima","acionado","acirrar","aclamar","aclive","acolhida","acomodar","acoplar","acordar","acumular","acusador","adaptar","adega","adentro","adepto","adequar","aderente","adesivo","adeus","adiante","aditivo","adjetivo","adjunto","admirar","adorar","adquirir","adubo","adverso","advogado","aeronave","afastar","aferir","afetivo","afinador","afivelar","aflito","afluente","afrontar","agachar","agarrar","agasalho","agenciar","agilizar","agiota","agitado","agora","agradar","agreste","agrupar","aguardar","agulha","ajoelhar","ajudar","ajustar","alameda","alarme","alastrar","alavanca","albergue","albino","alcatra","aldeia","alecrim","alegria","alertar","alface","alfinete","algum","alheio","aliar","alicate","alienar","alinhar","aliviar","almofada","alocar","alpiste","alterar","altitude","alucinar","alugar","aluno","alusivo","alvo","amaciar","amador","amarelo","amassar","ambas","ambiente","ameixa","amenizar","amido","amistoso","amizade","amolador","amontoar","amoroso","amostra","amparar","ampliar","ampola","anagrama","analisar","anarquia","anatomia","andaime","anel","anexo","angular","animar","anjo","anomalia","anotado","ansioso","anterior","anuidade","anunciar","anzol","apagador","apalpar","apanhado","apego","apelido","apertada","apesar","apetite","apito","aplauso","aplicada","apoio","apontar","aposta","aprendiz","aprovar","aquecer","arame","aranha","arara","arcada","ardente","areia","arejar","arenito","aresta","argiloso","argola","arma","arquivo","arraial","arrebate","arriscar","arroba","arrumar","arsenal","arterial","artigo","arvoredo","asfaltar","asilado","aspirar","assador","assinar","assoalho","assunto","astral","atacado","atadura","atalho","atarefar","atear","atender","aterro","ateu","atingir","atirador","ativo","atoleiro","atracar","atrevido","atriz","atual","atum","auditor","aumentar","aura","aurora","autismo","autoria","autuar","avaliar","avante","avaria","avental","avesso","aviador","avisar","avulso","axila","azarar","azedo","azeite","azulejo","babar","babosa","bacalhau","bacharel","bacia","bagagem","baiano","bailar","baioneta","bairro","baixista","bajular","baleia","baliza","balsa","banal","bandeira","banho","banir","banquete","barato","barbado","baronesa","barraca","barulho","baseado","bastante","batata","batedor","batida","batom","batucar","baunilha","beber","beijo","beirada","beisebol","beldade","beleza","belga","beliscar","bendito","bengala","benzer","berimbau","berlinda","berro","besouro","bexiga","bezerro","bico","bicudo","bienal","bifocal","bifurcar","bigorna","bilhete","bimestre","bimotor","biologia","biombo","biosfera","bipolar","birrento","biscoito","bisneto","bispo","bissexto","bitola","bizarro","blindado","bloco","bloquear","boato","bobagem","bocado","bocejo","bochecha","boicotar","bolada","boletim","bolha","bolo","bombeiro","bonde","boneco","bonita","borbulha","borda","boreal","borracha","bovino","boxeador","branco","brasa","braveza","breu","briga","brilho","brincar","broa","brochura","bronzear","broto","bruxo","bucha","budismo","bufar","bule","buraco","busca","busto","buzina","cabana","cabelo","cabide","cabo","cabrito","cacau","cacetada","cachorro","cacique","cadastro","cadeado","cafezal","caiaque","caipira","caixote","cajado","caju","calafrio","calcular","caldeira","calibrar","calmante","calota","camada","cambista","camisa","camomila","campanha","camuflar","canavial","cancelar","caneta","canguru","canhoto","canivete","canoa","cansado","cantar","canudo","capacho","capela","capinar","capotar","capricho","captador","capuz","caracol","carbono","cardeal","careca","carimbar","carneiro","carpete","carreira","cartaz","carvalho","casaco","casca","casebre","castelo","casulo","catarata","cativar","caule","causador","cautelar","cavalo","caverna","cebola","cedilha","cegonha","celebrar","celular","cenoura","censo","centeio","cercar","cerrado","certeiro","cerveja","cetim","cevada","chacota","chaleira","chamado","chapada","charme","chatice","chave","chefe","chegada","cheiro","cheque","chicote","chifre","chinelo","chocalho","chover","chumbo","chutar","chuva","cicatriz","ciclone","cidade","cidreira","ciente","cigana","cimento","cinto","cinza","ciranda","circuito","cirurgia","citar","clareza","clero","clicar","clone","clube","coado","coagir","cobaia","cobertor","cobrar","cocada","coelho","coentro","coeso","cogumelo","coibir","coifa","coiote","colar","coleira","colher","colidir","colmeia","colono","coluna","comando","combinar","comentar","comitiva","comover","complexo","comum","concha","condor","conectar","confuso","congelar","conhecer","conjugar","consumir","contrato","convite","cooperar","copeiro","copiador","copo","coquetel","coragem","cordial","corneta","coronha","corporal","correio","cortejo","coruja","corvo","cosseno","costela","cotonete","couro","couve","covil","cozinha","cratera","cravo","creche","credor","creme","crer","crespo","criada","criminal","crioulo","crise","criticar","crosta","crua","cruzeiro","cubano","cueca","cuidado","cujo","culatra","culminar","culpar","cultura","cumprir","cunhado","cupido","curativo","curral","cursar","curto","cuspir","custear","cutelo","damasco","datar","debater","debitar","deboche","debulhar","decalque","decimal","declive","decote","decretar","dedal","dedicado","deduzir","defesa","defumar","degelo","degrau","degustar","deitado","deixar","delator","delegado","delinear","delonga","demanda","demitir","demolido","dentista","depenado","depilar","depois","depressa","depurar","deriva","derramar","desafio","desbotar","descanso","desenho","desfiado","desgaste","desigual","deslize","desmamar","desova","despesa","destaque","desviar","detalhar","detentor","detonar","detrito","deusa","dever","devido","devotado","dezena","diagrama","dialeto","didata","difuso","digitar","dilatado","diluente","diminuir","dinastia","dinheiro","diocese","direto","discreta","disfarce","disparo","disquete","dissipar","distante","ditador","diurno","diverso","divisor","divulgar","dizer","dobrador","dolorido","domador","dominado","donativo","donzela","dormente","dorsal","dosagem","dourado","doutor","drenagem","drible","drogaria","duelar","duende","dueto","duplo","duquesa","durante","duvidoso","eclodir","ecoar","ecologia","edificar","edital","educado","efeito","efetivar","ejetar","elaborar","eleger","eleitor","elenco","elevador","eliminar","elogiar","embargo","embolado","embrulho","embutido","emenda","emergir","emissor","empatia","empenho","empinado","empolgar","emprego","empurrar","emulador","encaixe","encenado","enchente","encontro","endeusar","endossar","enfaixar","enfeite","enfim","engajado","engenho","englobar","engomado","engraxar","enguia","enjoar","enlatar","enquanto","enraizar","enrolado","enrugar","ensaio","enseada","ensino","ensopado","entanto","enteado","entidade","entortar","entrada","entulho","envergar","enviado","envolver","enxame","enxerto","enxofre","enxuto","epiderme","equipar","ereto","erguido","errata","erva","ervilha","esbanjar","esbelto","escama","escola","escrita","escuta","esfinge","esfolar","esfregar","esfumado","esgrima","esmalte","espanto","espelho","espiga","esponja","espreita","espumar","esquerda","estaca","esteira","esticar","estofado","estrela","estudo","esvaziar","etanol","etiqueta","euforia","europeu","evacuar","evaporar","evasivo","eventual","evidente","evoluir","exagero","exalar","examinar","exato","exausto","excesso","excitar","exclamar","executar","exemplo","exibir","exigente","exonerar","expandir","expelir","expirar","explanar","exposto","expresso","expulsar","externo","extinto","extrato","fabricar","fabuloso","faceta","facial","fada","fadiga","faixa","falar","falta","familiar","fandango","fanfarra","fantoche","fardado","farelo","farinha","farofa","farpa","fartura","fatia","fator","favorita","faxina","fazenda","fechado","feijoada","feirante","felino","feminino","fenda","feno","fera","feriado","ferrugem","ferver","festejar","fetal","feudal","fiapo","fibrose","ficar","ficheiro","figurado","fileira","filho","filme","filtrar","firmeza","fisgada","fissura","fita","fivela","fixador","fixo","flacidez","flamingo","flanela","flechada","flora","flutuar","fluxo","focal","focinho","fofocar","fogo","foguete","foice","folgado","folheto","forjar","formiga","forno","forte","fosco","fossa","fragata","fralda","frango","frasco","fraterno","freira","frente","fretar","frieza","friso","fritura","fronha","frustrar","fruteira","fugir","fulano","fuligem","fundar","fungo","funil","furador","furioso","futebol","gabarito","gabinete","gado","gaiato","gaiola","gaivota","galega","galho","galinha","galocha","ganhar","garagem","garfo","gargalo","garimpo","garoupa","garrafa","gasoduto","gasto","gata","gatilho","gaveta","gazela","gelado","geleia","gelo","gemada","gemer","gemido","generoso","gengiva","genial","genoma","genro","geologia","gerador","germinar","gesso","gestor","ginasta","gincana","gingado","girafa","girino","glacial","glicose","global","glorioso","goela","goiaba","golfe","golpear","gordura","gorjeta","gorro","gostoso","goteira","governar","gracejo","gradual","grafite","gralha","grampo","granada","gratuito","graveto","graxa","grego","grelhar","greve","grilo","grisalho","gritaria","grosso","grotesco","grudado","grunhido","gruta","guache","guarani","guaxinim","guerrear","guiar","guincho","guisado","gula","guloso","guru","habitar","harmonia","haste","haver","hectare","herdar","heresia","hesitar","hiato","hibernar","hidratar","hiena","hino","hipismo","hipnose","hipoteca","hoje","holofote","homem","honesto","honrado","hormonal","hospedar","humorado","iate","ideia","idoso","ignorado","igreja","iguana","ileso","ilha","iludido","iluminar","ilustrar","imagem","imediato","imenso","imersivo","iminente","imitador","imortal","impacto","impedir","implante","impor","imprensa","impune","imunizar","inalador","inapto","inativo","incenso","inchar","incidir","incluir","incolor","indeciso","indireto","indutor","ineficaz","inerente","infantil","infestar","infinito","inflamar","informal","infrator","ingerir","inibido","inicial","inimigo","injetar","inocente","inodoro","inovador","inox","inquieto","inscrito","inseto","insistir","inspetor","instalar","insulto","intacto","integral","intimar","intocado","intriga","invasor","inverno","invicto","invocar","iogurte","iraniano","ironizar","irreal","irritado","isca","isento","isolado","isqueiro","italiano","janeiro","jangada","janta","jararaca","jardim","jarro","jasmim","jato","javali","jazida","jejum","joaninha","joelhada","jogador","joia","jornal","jorrar","jovem","juba","judeu","judoca","juiz","julgador","julho","jurado","jurista","juro","justa","labareda","laboral","lacre","lactante","ladrilho","lagarta","lagoa","laje","lamber","lamentar","laminar","lampejo","lanche","lapidar","lapso","laranja","lareira","largura","lasanha","lastro","lateral","latido","lavanda","lavoura","lavrador","laxante","lazer","lealdade","lebre","legado","legendar","legista","leigo","leiloar","leitura","lembrete","leme","lenhador","lentilha","leoa","lesma","leste","letivo","letreiro","levar","leveza","levitar","liberal","libido","liderar","ligar","ligeiro","limitar","limoeiro","limpador","linda","linear","linhagem","liquidez","listagem","lisura","litoral","livro","lixa","lixeira","locador","locutor","lojista","lombo","lona","longe","lontra","lorde","lotado","loteria","loucura","lousa","louvar","luar","lucidez","lucro","luneta","lustre","lutador","luva","macaco","macete","machado","macio","madeira","madrinha","magnata","magreza","maior","mais","malandro","malha","malote","maluco","mamilo","mamoeiro","mamute","manada","mancha","mandato","manequim","manhoso","manivela","manobrar","mansa","manter","manusear","mapeado","maquinar","marcador","maresia","marfim","margem","marinho","marmita","maroto","marquise","marreco","martelo","marujo","mascote","masmorra","massagem","mastigar","matagal","materno","matinal","matutar","maxilar","medalha","medida","medusa","megafone","meiga","melancia","melhor","membro","memorial","menino","menos","mensagem","mental","merecer","mergulho","mesada","mesclar","mesmo","mesquita","mestre","metade","meteoro","metragem","mexer","mexicano","micro","migalha","migrar","milagre","milenar","milhar","mimado","minerar","minhoca","ministro","minoria","miolo","mirante","mirtilo","misturar","mocidade","moderno","modular","moeda","moer","moinho","moita","moldura","moleza","molho","molinete","molusco","montanha","moqueca","morango","morcego","mordomo","morena","mosaico","mosquete","mostarda","motel","motim","moto","motriz","muda","muito","mulata","mulher","multar","mundial","munido","muralha","murcho","muscular","museu","musical","nacional","nadador","naja","namoro","narina","narrado","nascer","nativa","natureza","navalha","navegar","navio","neblina","nebuloso","negativa","negociar","negrito","nervoso","neta","neural","nevasca","nevoeiro","ninar","ninho","nitidez","nivelar","nobreza","noite","noiva","nomear","nominal","nordeste","nortear","notar","noticiar","noturno","novelo","novilho","novo","nublado","nudez","numeral","nupcial","nutrir","nuvem","obcecado","obedecer","objetivo","obrigado","obscuro","obstetra","obter","obturar","ocidente","ocioso","ocorrer","oculista","ocupado","ofegante","ofensiva","oferenda","oficina","ofuscado","ogiva","olaria","oleoso","olhar","oliveira","ombro","omelete","omisso","omitir","ondulado","oneroso","ontem","opcional","operador","oponente","oportuno","oposto","orar","orbitar","ordem","ordinal","orfanato","orgasmo","orgulho","oriental","origem","oriundo","orla","ortodoxo","orvalho","oscilar","ossada","osso","ostentar","otimismo","ousadia","outono","outubro","ouvido","ovelha","ovular","oxidar","oxigenar","pacato","paciente","pacote","pactuar","padaria","padrinho","pagar","pagode","painel","pairar","paisagem","palavra","palestra","palheta","palito","palmada","palpitar","pancada","panela","panfleto","panqueca","pantanal","papagaio","papelada","papiro","parafina","parcial","pardal","parede","partida","pasmo","passado","pastel","patamar","patente","patinar","patrono","paulada","pausar","peculiar","pedalar","pedestre","pediatra","pedra","pegada","peitoral","peixe","pele","pelicano","penca","pendurar","peneira","penhasco","pensador","pente","perceber","perfeito","pergunta","perito","permitir","perna","perplexo","persiana","pertence","peruca","pescado","pesquisa","pessoa","petiscar","piada","picado","piedade","pigmento","pilastra","pilhado","pilotar","pimenta","pincel","pinguim","pinha","pinote","pintar","pioneiro","pipoca","piquete","piranha","pires","pirueta","piscar","pistola","pitanga","pivete","planta","plaqueta","platina","plebeu","plumagem","pluvial","pneu","poda","poeira","poetisa","polegada","policiar","poluente","polvilho","pomar","pomba","ponderar","pontaria","populoso","porta","possuir","postal","pote","poupar","pouso","povoar","praia","prancha","prato","praxe","prece","predador","prefeito","premiar","prensar","preparar","presilha","pretexto","prevenir","prezar","primata","princesa","prisma","privado","processo","produto","profeta","proibido","projeto","prometer","propagar","prosa","protetor","provador","publicar","pudim","pular","pulmonar","pulseira","punhal","punir","pupilo","pureza","puxador","quadra","quantia","quarto","quase","quebrar","queda","queijo","quente","querido","quimono","quina","quiosque","rabanada","rabisco","rachar","racionar","radial","raiar","rainha","raio","raiva","rajada","ralado","ramal","ranger","ranhura","rapadura","rapel","rapidez","raposa","raquete","raridade","rasante","rascunho","rasgar","raspador","rasteira","rasurar","ratazana","ratoeira","realeza","reanimar","reaver","rebaixar","rebelde","rebolar","recado","recente","recheio","recibo","recordar","recrutar","recuar","rede","redimir","redonda","reduzida","reenvio","refinar","refletir","refogar","refresco","refugiar","regalia","regime","regra","reinado","reitor","rejeitar","relativo","remador","remendo","remorso","renovado","reparo","repelir","repleto","repolho","represa","repudiar","requerer","resenha","resfriar","resgatar","residir","resolver","respeito","ressaca","restante","resumir","retalho","reter","retirar","retomada","retratar","revelar","revisor","revolta","riacho","rica","rigidez","rigoroso","rimar","ringue","risada","risco","risonho","robalo","rochedo","rodada","rodeio","rodovia","roedor","roleta","romano","roncar","rosado","roseira","rosto","rota","roteiro","rotina","rotular","rouco","roupa","roxo","rubro","rugido","rugoso","ruivo","rumo","rupestre","russo","sabor","saciar","sacola","sacudir","sadio","safira","saga","sagrada","saibro","salada","saleiro","salgado","saliva","salpicar","salsicha","saltar","salvador","sambar","samurai","sanar","sanfona","sangue","sanidade","sapato","sarda","sargento","sarjeta","saturar","saudade","saxofone","sazonal","secar","secular","seda","sedento","sediado","sedoso","sedutor","segmento","segredo","segundo","seiva","seleto","selvagem","semanal","semente","senador","senhor","sensual","sentado","separado","sereia","seringa","serra","servo","setembro","setor","sigilo","silhueta","silicone","simetria","simpatia","simular","sinal","sincero","singular","sinopse","sintonia","sirene","siri","situado","soberano","sobra","socorro","sogro","soja","solda","soletrar","solteiro","sombrio","sonata","sondar","sonegar","sonhador","sono","soprano","soquete","sorrir","sorteio","sossego","sotaque","soterrar","sovado","sozinho","suavizar","subida","submerso","subsolo","subtrair","sucata","sucesso","suco","sudeste","sufixo","sugador","sugerir","sujeito","sulfato","sumir","suor","superior","suplicar","suposto","suprimir","surdina","surfista","surpresa","surreal","surtir","suspiro","sustento","tabela","tablete","tabuada","tacho","tagarela","talher","talo","talvez","tamanho","tamborim","tampa","tangente","tanto","tapar","tapioca","tardio","tarefa","tarja","tarraxa","tatuagem","taurino","taxativo","taxista","teatral","tecer","tecido","teclado","tedioso","teia","teimar","telefone","telhado","tempero","tenente","tensor","tentar","termal","terno","terreno","tese","tesoura","testado","teto","textura","texugo","tiara","tigela","tijolo","timbrar","timidez","tingido","tinteiro","tiragem","titular","toalha","tocha","tolerar","tolice","tomada","tomilho","tonel","tontura","topete","tora","torcido","torneio","torque","torrada","torto","tostar","touca","toupeira","toxina","trabalho","tracejar","tradutor","trafegar","trajeto","trama","trancar","trapo","traseiro","tratador","travar","treino","tremer","trepidar","trevo","triagem","tribo","triciclo","tridente","trilogia","trindade","triplo","triturar","triunfal","trocar","trombeta","trova","trunfo","truque","tubular","tucano","tudo","tulipa","tupi","turbo","turma","turquesa","tutelar","tutorial","uivar","umbigo","unha","unidade","uniforme","urologia","urso","urtiga","urubu","usado","usina","usufruir","vacina","vadiar","vagaroso","vaidoso","vala","valente","validade","valores","vantagem","vaqueiro","varanda","vareta","varrer","vascular","vasilha","vassoura","vazar","vazio","veado","vedar","vegetar","veicular","veleiro","velhice","veludo","vencedor","vendaval","venerar","ventre","verbal","verdade","vereador","vergonha","vermelho","verniz","versar","vertente","vespa","vestido","vetorial","viaduto","viagem","viajar","viatura","vibrador","videira","vidraria","viela","viga","vigente","vigiar","vigorar","vilarejo","vinco","vinheta","vinil","violeta","virada","virtude","visitar","visto","vitral","viveiro","vizinho","voador","voar","vogal","volante","voleibol","voltagem","volumoso","vontade","vulto","vuvuzela","xadrez","xarope","xeque","xeretar","xerife","xingar","zangado","zarpar","zebu","zelador","zombar","zoologia","zumbido"]')},function(e){e.exports=JSON.parse('["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"]')},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.BIP32Factory=void 0;const n=r(213),i=r(214),o=r(215),a=r(27),s=r(3),u=r(69),c=(0,o.base58check)(a.sha256),f=e=>c.encode(Uint8Array.from(e)),l=t=>e.from(c.decode(t));t.BIP32Factory=function(t){(0,i.testEcc)(t);const r=s.BufferN(32),o=s.compile({wif:s.UInt8,bip32:{public:s.UInt32,private:s.UInt32}}),a={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},c=Math.pow(2,31)-1;function d(e){return s.String(e)&&null!==e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}function h(e){return s.UInt32(e)&&e<=c}class p{constructor(e,t){this.__D=e,this.__Q=t,this.lowR=!1}get publicKey(){return void 0===this.__Q&&(this.__Q=e.from(t.pointFromScalar(this.__D,!0))),this.__Q}get privateKey(){return this.__D}sign(r,n){if(!this.privateKey)throw new Error("Missing private key");if(void 0===n&&(n=this.lowR),!1===n)return e.from(t.sign(r,this.privateKey));{let n=e.from(t.sign(r,this.privateKey));const i=e.alloc(32,0);let o=0;for(;n[0]>127;)o++,i.writeUIntLE(o,0,6),n=e.from(t.sign(r,this.privateKey,i));return n}}signSchnorr(r){if(!this.privateKey)throw new Error("Missing private key");if(!t.signSchnorr)throw new Error("signSchnorr not supported by ecc library");return e.from(t.signSchnorr(r,this.privateKey))}verify(e,r){return t.verify(e,this.publicKey,r)}verifySchnorr(e,r){if(!t.verifySchnorr)throw new Error("verifySchnorr not supported by ecc library");return t.verifySchnorr(e,this.publicKey.subarray(1,33),r)}}class b extends p{constructor(e,t,r,n,i=0,a=0,u=0){super(e,t),this.chainCode=r,this.network=n,this.__DEPTH=i,this.__INDEX=a,this.__PARENT_FINGERPRINT=u,s(o,n)}get depth(){return this.__DEPTH}get index(){return this.__INDEX}get parentFingerprint(){return this.__PARENT_FINGERPRINT}get identifier(){return n.hash160(this.publicKey)}get fingerprint(){return this.identifier.slice(0,4)}get compressed(){return!0}isNeutered(){return void 0===this.__D}neutered(){return y(this.publicKey,this.chainCode,this.network,this.depth,this.index,this.parentFingerprint)}toBase58(){const t=this.network,r=this.isNeutered()?t.bip32.public:t.bip32.private,n=e.allocUnsafe(78);return n.writeUInt32BE(r,0),n.writeUInt8(this.depth,4),n.writeUInt32BE(this.parentFingerprint,5),n.writeUInt32BE(this.index,9),this.chainCode.copy(n,13),this.isNeutered()?this.publicKey.copy(n,45):(n.writeUInt8(0,45),this.privateKey.copy(n,46)),f(n)}toWIF(){if(!this.privateKey)throw new TypeError("Missing private key");return u.encode(this.network.wif,this.privateKey,!0)}derive(r){s(s.UInt32,r);const i=r>=2147483648,o=e.allocUnsafe(37);if(i){if(this.isNeutered())throw new TypeError("Missing private key for hardened child key");o[0]=0,this.privateKey.copy(o,1),o.writeUInt32BE(r,33)}else this.publicKey.copy(o,0),o.writeUInt32BE(r,33);const a=n.hmacSHA512(this.chainCode,o),u=a.slice(0,32),c=a.slice(32);if(!t.isPrivate(u))return this.derive(r+1);let f;if(this.isNeutered()){const n=e.from(t.pointAddScalar(this.publicKey,u,!0));if(null===n)return this.derive(r+1);f=y(n,c,this.network,this.depth+1,r,this.fingerprint.readUInt32BE(0))}else{const n=e.from(t.privateAdd(this.privateKey,u));if(null==n)return this.derive(r+1);f=g(n,c,this.network,this.depth+1,r,this.fingerprint.readUInt32BE(0))}return f}deriveHardened(e){return s(h,e),this.derive(e+2147483648)}derivePath(e){s(d,e);let t=e.split("/");if("m"===t[0]){if(this.parentFingerprint)throw new TypeError("Expected master, got child");t=t.slice(1)}return t.reduce((e,t)=>{let r;return"'"===t.slice(-1)?(r=parseInt(t.slice(0,-1),10),e.deriveHardened(r)):(r=parseInt(t,10),e.derive(r))},this)}tweak(e){return this.privateKey?this.tweakFromPrivateKey(e):this.tweakFromPublicKey(e)}tweakFromPublicKey(r){const n=32===(i=this.publicKey).length?i:i.slice(1,33);var i;if(!t.xOnlyPointAddTweak)throw new Error("xOnlyPointAddTweak not supported by ecc library");const o=t.xOnlyPointAddTweak(n,r);if(!o||null===o.xOnlyPubkey)throw new Error("Cannot tweak public key!");const a=e.from([0===o.parity?2:3]),s=e.concat([a,o.xOnlyPubkey]);return new p(void 0,s)}tweakFromPrivateKey(r){const n=3===this.publicKey[0]||4===this.publicKey[0]&&1==(1&this.publicKey[64]),i=(()=>{if(n){if(t.privateNegate)return t.privateNegate(this.privateKey);throw new Error("privateNegate not supported by ecc library")}return this.privateKey})(),o=t.privateAdd(i,r);if(!o)throw new Error("Invalid tweaked private key!");return new p(e.from(o),void 0)}}function m(e,t,r){return g(e,t,r)}function g(e,n,i,o,u,c){if(s({privateKey:r,chainCode:r},{privateKey:e,chainCode:n}),i=i||a,!t.isPrivate(e))throw new TypeError("Private key not in range [1, n)");return new b(e,void 0,n,i,o,u,c)}function y(e,n,i,o,u,c){if(s({publicKey:s.BufferN(33),chainCode:r},{publicKey:e,chainCode:n}),i=i||a,!t.isPoint(e))throw new TypeError("Point is not on the curve");return new b(void 0,e,n,i,o,u,c)}return{fromSeed:function(t,r){if(s(s.Buffer,t),t.length<16)throw new TypeError("Seed should be at least 128 bits");if(t.length>64)throw new TypeError("Seed should be at most 512 bits");r=r||a;const i=n.hmacSHA512(e.from("Bitcoin seed","utf8"),t);return m(i.slice(0,32),i.slice(32),r)},fromBase58:function(e,t){const r=l(e);if(78!==r.length)throw new TypeError("Invalid buffer length");t=t||a;const n=r.readUInt32BE(0);if(n!==t.bip32.private&&n!==t.bip32.public)throw new TypeError("Invalid network version");const i=r[4],o=r.readUInt32BE(5);if(0===i&&0!==o)throw new TypeError("Invalid parent fingerprint");const s=r.readUInt32BE(9);if(0===i&&0!==s)throw new TypeError("Invalid index");const u=r.slice(13,45);let c;if(n===t.bip32.private){if(0!==r.readUInt8(45))throw new TypeError("Invalid private key");c=g(r.slice(46,78),u,t,i,s,o)}else{c=y(r.slice(45,78),u,t,i,s,o)}return c},fromPublicKey:function(e,t,r){return y(e,t,r)},fromPrivateKey:m}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.hmacSHA512=t.hash160=void 0;const n=r(68),i=r(92),o=r(27),a=r(97);t.hash160=function(t){const r=(0,o.sha256)(Uint8Array.from(t));return e.from((0,i.ripemd160)(r))},t.hmacSHA512=function(t,r){return e.from((0,n.hmac)(a.sha512,t,r))}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.testEcc=void 0;const r=t=>e.from(t,"hex");function n(e){if(!e)throw new Error("ecc library invalid")}t.testEcc=function(t){if(n(t.isPoint(r("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),n(!t.isPoint(r("030000000000000000000000000000000000000000000000000000000000000005"))),n(t.isPrivate(r("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),n(t.isPrivate(r("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))),n(!t.isPrivate(r("0000000000000000000000000000000000000000000000000000000000000000"))),n(!t.isPrivate(r("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"))),n(!t.isPrivate(r("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142"))),n(e.from(t.pointFromScalar(r("b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af"))).equals(r("02b07ba9dca9523b7ef4bd97703d43d20399eb698e194704791a25ce77a400df99"))),t.xOnlyPointAddTweak){n(null===t.xOnlyPointAddTweak(r("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),r("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140")));let i=t.xOnlyPointAddTweak(r("1617d38ed8d8657da4d4761e8057bc396ea9e4b9d29776d4be096016dbd2509b"),r("a8397a935f0dfceba6ba9618f6451ef4d80637abf4e6af2669fbc9de6a8fd2ac"));n(e.from(i.xOnlyPubkey).equals(r("e478f99dab91052ab39a33ea35fd5e6e4933f4d28023cd597c9a1f6760346adf"))&&1===i.parity),i=t.xOnlyPointAddTweak(r("2c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991"),r("823c3cd2142744b075a87eade7e1b8678ba308d566226a0056ca2b7a76f86b47"))}n(e.from(t.pointAddScalar(r("0379be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),r("0000000000000000000000000000000000000000000000000000000000000003"))).equals(r("02c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5"))),n(e.from(t.privateAdd(r("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e"),r("0000000000000000000000000000000000000000000000000000000000000002"))).equals(r("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))),t.privateNegate&&(n(e.from(t.privateNegate(r("0000000000000000000000000000000000000000000000000000000000000001"))).equals(r("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))),n(e.from(t.privateNegate(r("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e"))).equals(r("0000000000000000000000000000000000000000000000000000000000000003"))),n(e.from(t.privateNegate(r("b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af"))).equals(r("4eede1bf775995d70a494f0a7bb6bc11e0b8cccd41cce8009ab1132c8b0a3792")))),n(e.from(t.sign(r("5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed"),r("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))).equals(r("54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5"))),n(t.verify(r("5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed"),r("0379be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),r("54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5"))),t.signSchnorr&&n(e.from(t.signSchnorr(r("7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c"),r("c90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b14e5c9"),r("c87aa53824b4d7ae2eb035a2b5bbbccc080e76cdc6d1692c4b0b62d798e6d906"))).equals(r("5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7"))),t.verifySchnorr&&n(t.verifySchnorr(r("7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c"),r("dd308afec5777e13121fa72b9cc1b7cc0139715309b086c960e18fd969774eb8"),r("5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7")))}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";
14
14
  /*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */
15
15
  function n(e){if(!Number.isSafeInteger(e))throw new Error("Wrong integer: "+e)}function i(...e){const t=(e,t)=>r=>e(t(r));return{encode:Array.from(e).reverse().reduce((e,r)=>e?t(e,r.encode):r.encode,void 0),decode:e.reduce((e,r)=>e?t(e,r.decode):r.decode,void 0)}}function o(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("alphabet.encode input should be an array of numbers");return t.map(t=>{if(n(t),t<0||t>=e.length)throw new Error(`Digit index outside alphabet: ${t} (alphabet: ${e.length})`);return e[t]})},decode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("alphabet.decode input should be array of strings");return t.map(t=>{if("string"!=typeof t)throw new Error("alphabet.decode: not string element="+t);const r=e.indexOf(t);if(-1===r)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return r})}}}function a(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("join.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error("join.encode: non-string input="+e);return t.join(e)},decode:t=>{if("string"!=typeof t)throw new Error("join.decode input should be string");return t.split(e)}}}function s(e,t="="){if(n(e),"string"!=typeof t)throw new Error("padding chr should be string");return{encode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let e of r)if("string"!=typeof e)throw new Error("padding.encode: non-string input="+e);for(;r.length*e%8;)r.push(t);return r},decode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let e of r)if("string"!=typeof e)throw new Error("padding.decode: non-string input="+e);let n=r.length;if(n*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;n>0&&r[n-1]===t;n--)if(!((n-1)*e%8))throw new Error("Invalid padding: string has too much padding");return r.slice(0,n)}}}function u(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:e=>e,decode:t=>e(t)}}function c(e,t,r){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: wrong to=${r}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let i=0;const o=[],a=Array.from(e);for(a.forEach(e=>{if(n(e),e<0||e>=t)throw new Error("Wrong integer: "+e)});;){let e=0,n=!0;for(let o=i;o<a.length;o++){const s=a[o],u=t*e+s;if(!Number.isSafeInteger(u)||t*e/t!==e||u-s!=t*e)throw new Error("convertRadix: carry overflow");e=u%r;const c=Math.floor(u/r);if(a[o]=c,!Number.isSafeInteger(c)||c*r+e!==u)throw new Error("convertRadix: carry overflow");n&&(c?n=!1:i=o)}if(o.push(e),n)break}for(let t=0;t<e.length-1&&0===e[t];t++)o.push(0);return o.reverse()}r.r(t),r.d(t,"assertNumber",(function(){return n})),r.d(t,"utils",(function(){return g})),r.d(t,"base16",(function(){return y})),r.d(t,"base32",(function(){return v})),r.d(t,"base32hex",(function(){return w})),r.d(t,"base32crockford",(function(){return _})),r.d(t,"base64",(function(){return E})),r.d(t,"base64url",(function(){return k})),r.d(t,"base64urlnopad",(function(){return S})),r.d(t,"base58",(function(){return T})),r.d(t,"base58flickr",(function(){return A})),r.d(t,"base58xrp",(function(){return P})),r.d(t,"base58xmr",(function(){return I})),r.d(t,"base58check",(function(){return B})),r.d(t,"bech32",(function(){return C})),r.d(t,"bech32m",(function(){return H})),r.d(t,"utf8",(function(){return z})),r.d(t,"hex",(function(){return L})),r.d(t,"bytesToString",(function(){return q})),r.d(t,"str",(function(){return K})),r.d(t,"stringToBytes",(function(){return W})),r.d(t,"bytes",(function(){return V}));const f=(e,t)=>t?f(t,e%t):e,l=(e,t)=>e+(t-f(e,t));function d(e,t,r,i){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error("convertRadix2: wrong from="+t);if(r<=0||r>32)throw new Error("convertRadix2: wrong to="+r);if(l(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${l(t,r)}`);let o=0,a=0;const s=2**r-1,u=[];for(const i of e){if(n(i),i>=2**t)throw new Error(`convertRadix2: invalid data word=${i} from=${t}`);if(o=o<<t|i,a+t>32)throw new Error(`convertRadix2: carry overflow pos=${a} from=${t}`);for(a+=t;a>=r;a-=r)u.push((o>>a-r&s)>>>0);o&=2**a-1}if(o=o<<r-a&s,!i&&a>=t)throw new Error("Excess padding");if(!i&&o)throw new Error("Non-zero padding: "+o);return i&&a>0&&u.push(o>>>0),u}function h(e){return n(e),{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return c(Array.from(t),256,e)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix.decode input should be array of strings");return Uint8Array.from(c(t,e,256))}}}function p(e,t=!1){if(n(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(l(8,e)>32||l(e,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!(r instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return d(Array.from(r),8,e,!t)},decode:r=>{if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(d(r,e,8,t))}}}function b(e){if("function"!=typeof e)throw new Error("unsafeWrapper fn should be function");return function(...t){try{return e.apply(null,t)}catch(e){}}}function m(e,t){if(n(e),"function"!=typeof t)throw new Error("checksum fn should be function");return{encode(r){if(!(r instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");const n=t(r).slice(0,e),i=new Uint8Array(r.length+e);return i.set(r),i.set(n,r.length),i},decode(r){if(!(r instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");const n=r.slice(0,-e),i=t(n).slice(0,e),o=r.slice(-e);for(let t=0;t<e;t++)if(i[t]!==o[t])throw new Error("Invalid checksum");return n}}}const g={alphabet:o,chain:i,checksum:m,radix:h,radix2:p,join:a,padding:s},y=i(p(4),o("0123456789ABCDEF"),a("")),v=i(p(5),o("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),s(5),a("")),w=i(p(5),o("0123456789ABCDEFGHIJKLMNOPQRSTUV"),s(5),a("")),_=i(p(5),o("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),a(""),u(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),E=i(p(6),o("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),s(6),a("")),k=i(p(6),o("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),s(6),a("")),S=i(p(6),o("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),a("")),x=e=>i(h(58),o(e),a("")),T=x("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),A=x("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),P=x("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"),O=[0,2,3,5,6,7,9,10,11],I={encode(e){let t="";for(let r=0;r<e.length;r+=8){const n=e.subarray(r,r+8);t+=T.encode(n).padStart(O[n.length],"1")}return t},decode(e){let t=[];for(let r=0;r<e.length;r+=11){const n=e.slice(r,r+11),i=O.indexOf(n.length),o=T.decode(n);for(let e=0;e<o.length-i;e++)if(0!==o[e])throw new Error("base58xmr: wrong padding");t=t.concat(Array.from(o.slice(o.length-i)))}return Uint8Array.from(t)}},B=e=>i(m(4,t=>e(e(t))),T),M=i(o("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),a("")),R=[996825010,642813549,513874426,1027748829,705979059];function N(e){const t=e>>25;let r=(33554431&e)<<5;for(let e=0;e<R.length;e++)1==(t>>e&1)&&(r^=R[e]);return r}function j(e,t,r=1){const n=e.length;let i=1;for(let t=0;t<n;t++){const r=e.charCodeAt(t);if(r<33||r>126)throw new Error(`Invalid prefix (${e})`);i=N(i)^r>>5}i=N(i);for(let t=0;t<n;t++)i=N(i)^31&e.charCodeAt(t);for(let e of t)i=N(i)^e;for(let e=0;e<6;e++)i=N(i);return i^=r,M.encode(d([i%2**30],30,5,!1))}function U(e){const t="bech32"===e?1:734539939,r=p(5),n=r.decode,i=r.encode,o=b(n);function a(e,r=90){if("string"!=typeof e)throw new Error("bech32.decode input should be string, not "+typeof e);if(e.length<8||!1!==r&&e.length>r)throw new TypeError(`Wrong string length: ${e.length} (${e}). Expected (8..${r})`);const n=e.toLowerCase();if(e!==n&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const i=(e=n).lastIndexOf("1");if(0===i||-1===i)throw new Error('Letter "1" must be present between prefix and data only');const o=e.slice(0,i),a=e.slice(i+1);if(a.length<6)throw new Error("Data must be at least 6 characters long");const s=M.decode(a).slice(0,-6),u=j(o,s,t);if(!a.endsWith(u))throw new Error(`Invalid checksum in ${e}: expected "${u}"`);return{prefix:o,words:s}}return{encode:function(e,r,n=90){if("string"!=typeof e)throw new Error("bech32.encode prefix should be string, not "+typeof e);if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("bech32.encode words should be array of numbers, not "+typeof r);const i=e.length+7+r.length;if(!1!==n&&i>n)throw new TypeError(`Length ${i} exceeds limit ${n}`);const o=e.toLowerCase(),a=j(o,r,t);return`${o}1${M.encode(r)}${a}`},decode:a,decodeToBytes:function(e){const{prefix:t,words:r}=a(e,!1);return{prefix:t,words:r,bytes:n(r)}},decodeUnsafe:b(a),fromWords:n,fromWordsUnsafe:o,toWords:i}}const C=U("bech32"),H=U("bech32m"),z={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)},L=i(p(4),o("0123456789abcdef"),a(""),u(e=>{if("string"!=typeof e||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})),D={utf8:z,hex:L,base16:y,base32:v,base64:E,base64url:k,base58:T,base58xmr:I},F="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr",q=(e,t)=>{if("string"!=typeof e||!D.hasOwnProperty(e))throw new TypeError(F);if(!(t instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return D[e].encode(t)},K=q,W=(e,t)=>{if(!D.hasOwnProperty(e))throw new TypeError(F);if("string"!=typeof t)throw new TypeError("stringToBytes() expects string");return D[e].decode(t)},V=W},function(e,t,r){(t=e.exports=r(102)).Stream=t,t.Readable=t,t.Writable=r(106),t.Duplex=r(29),t.Transform=r(108),t.PassThrough=r(222),t.finished=r(71),t.pipeline=r(223)},function(e,t){},function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function o(e,t,r){return(t=s(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var u=r(0).Buffer,c=r(219).inspect,f=c&&c.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r,n;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);for(var t,r,n,i=u.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=i,n=a,u.prototype.copy.call(t,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=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,t}},{key:f,value:function(e,t){return c(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&a(t.prototype,r),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},function(e,t){},function(e,t,r){"use strict";(function(t){var n;function i(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(71),a=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),f=Symbol("lastPromise"),l=Symbol("handlePromise"),d=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[a];if(null!==t){var r=e[d].read();null!==r&&(e[f]=null,e[a]=null,e[s]=null,t(h(r,!1)))}}function b(e){t.nextTick(p,e)}var m=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((i(n={get stream(){return this[d]},next:function(){var e=this,r=this[u];if(null!==r)return Promise.reject(r);if(this[c])return Promise.resolve(h(void 0,!0));if(this[d].destroyed)return new Promise((function(r,n){t.nextTick((function(){e[u]?n(e[u]):r(h(void 0,!0))}))}));var n,i=this[f];if(i)n=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(h(void 0,!0)):t[l](r,n)}),n)}}(i,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(h(o,!1));n=new Promise(this[l])}return this[f]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var e=this;return new Promise((function(t,r){e[d].destroy(null,(function(e){e?r(e):t(h(void 0,!0))}))}))})),n),m);e.exports=function(e){var t,r=Object.create(g,(i(t={},d,{value:e,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,l,{value:function(e,t){var n=r[d].read();n?(r[f]=null,r[a]=null,r[s]=null,e(h(n,!1))):(r[a]=e,r[s]=t)},writable:!0}),t));return r[f]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[s];return null!==t&&(r[f]=null,r[a]=null,r[s]=null,t(e)),void(r[u]=e)}var n=r[a];null!==n&&(r[f]=null,r[a]=null,r[s]=null,n(h(void 0,!0))),r[c]=!0})),e.on("readable",b.bind(null,r)),r}}).call(this,r(10))},function(e,t){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(e,t,r){"use strict";e.exports=i;var n=r(108);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(2)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){"use strict";var n;var i=r(28).codes,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function u(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var s=!1;e.on("close",(function(){s=!0})),void 0===n&&(n=r(71)),n(e,{readable:t,writable:i},(function(e){if(e)return o(e);s=!0,o()}));var u=!1;return function(t){if(!s&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new a("pipe"))}}function c(e){e()}function f(e,t){return e.pipe(t)}function l(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}e.exports=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=l(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var a=t.map((function(e,r){var o=r<t.length-1;return u(e,o,r>0,(function(e){n||(n=e),e&&a.forEach(c),o||(a.forEach(c),i(n))}))}));return t.reduce(f)}},function(e,t,r){var n=r(2),i=r(30),o=r(4).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(e){return e<<30|e>>>2}function f(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^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(e){for(var t,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]=e.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var d=0;d<80;++d){var h=~~(d/20),p=0|((t=n)<<5|t>>>27)+f(h,i,o,s)+u+r[d]+a[h];u=s,s=o,o=c(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 e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,r){var n=r(2),i=r(30),o=r(4).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(e){return e<<5|e>>>27}function f(e){return e<<30|e>>>2}function l(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^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(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,d=0;d<16;++d)r[d]=e.readInt32BE(4*d);for(;d<80;++d)r[d]=(t=r[d-3]^r[d-8]^r[d-14]^r[d-16])<<1|t>>>31;for(var h=0;h<80;++h){var p=~~(h/20),b=c(n)+l(p,i,o,s)+u+r[h]+a[p]|0;u=s,s=o,o=f(i),i=n,n=b}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 e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,r){var n=r(2),i=r(111),o=r(30),a=r(4).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 e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=u},function(e,t,r){var n=r(2),i=r(112),o=r(30),a=r(4).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 e=a.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=u},function(e,t,r){e.exports=i;var n=r(40).EventEmitter;function i(){n.call(this)}r(31)(i,n),i.Readable=r(73),i.Writable=r(235),i.Duplex=r(236),i.Transform=r(237),i.PassThrough=r(238),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(f(),0===n.listenerCount(this,"error"))throw e}function f(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return r.on("error",c),e.on("error",c),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e}},function(e,t){},function(e,t,r){"use strict";var n=r(47).Buffer,i=r(231);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);for(var t,r,i,o=n.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,r=o,i=s,t.copy(r,i),s+=a.data.length,a=a.next;return o},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(233),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(17))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i,o,a,s,u=1,c={},f=!1,l=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){o.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(i=l.documentElement,n=function(e){var t=l.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):n=function(e){setTimeout(p,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),n=function(t){e.postMessage(a+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var i={callback:e,args:t};return c[u]=i,n(u),u++},d.clearImmediate=h}function h(e){delete c[e]}function p(e){if(f)setTimeout(p,0,e);else{var t=c[e];if(t){f=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{h(e),f=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(17),r(10))},function(e,t,r){"use strict";e.exports=o;var n=r(116),i=Object.create(r(42));function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}i.inherits=r(31),i.inherits(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){e.exports=r(74)},function(e,t,r){e.exports=r(23)},function(e,t,r){e.exports=r(73).Transform},function(e,t,r){e.exports=r(73).PassThrough},function(e,t,r){"use strict";var n=r(240),i=r(4).Buffer;e.exports=function(e){function t(t){var r=t.slice(0,-4),n=t.slice(-4),i=e(r);if(!(n[0]^i[0]|n[1]^i[1]|n[2]^i[2]|n[3]^i[3]))return r}return{encode:function(t){var r=e(t);return n.encode(i.concat([t,r],t.length+4))},decode:function(e){var r=t(n.decode(e));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(e){var r=n.decodeUnsafe(e);if(r)return t(r)}}}},function(e,t,r){var n=r(241);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(e,t,r){"use strict";var n=r(4).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),a=o.charCodeAt(0);if(255!==t[a])throw new TypeError(o+" is ambiguous");t[a]=i}var s=e.length,u=e.charAt(0),c=Math.log(s)/Math.log(256),f=Math.log(256)/Math.log(s);function l(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return n.alloc(0);for(var r=0,i=0,o=0;e[r]===u;)i++,r++;for(var a=(e.length-r)*c+1>>>0,f=new Uint8Array(a);e[r];){var l=t[e.charCodeAt(r)];if(255===l)return;for(var d=0,h=a-1;(0!==l||d<o)&&-1!==h;h--,d++)l+=s*f[h]>>>0,f[h]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");o=d,r++}for(var p=a-o;p!==a&&0===f[p];)p++;var b=n.allocUnsafe(i+(a-p));b.fill(0,0,i);for(var m=i;p!==a;)b[m++]=f[p++];return b}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,i=0,o=0,a=t.length;o!==a&&0===t[o];)o++,r++;for(var c=(a-o)*f+1>>>0,l=new Uint8Array(c);o!==a;){for(var d=t[o],h=0,p=c-1;(0!==d||h<i)&&-1!==p;p--,h++)d+=256*l[p]>>>0,l[p]=d%s>>>0,d=d/s>>>0;if(0!==d)throw new Error("Non-zero carry");i=h,o++}for(var b=c-i;b!==c&&0===l[b];)b++;for(var m=u.repeat(r);b<c;++b)m+=e.charAt(l[b]);return m},decodeUnsafe:l,decode:function(e){var t=l(e);if(t)return t;throw new Error("Non-base"+s+" character")}}}},function(e,t,r){"use strict";r.r(t),r.d(t,"CURVE",(function(){return c})),r.d(t,"Point",(function(){return v})),r.d(t,"Signature",(function(){return E})),r.d(t,"getPublicKey",(function(){return X})),r.d(t,"recoverPublicKey",(function(){return Y})),r.d(t,"getSharedSecret",(function(){return J})),r.d(t,"sign",(function(){return ne})),r.d(t,"signSync",(function(){return ie})),r.d(t,"verify",(function(){return ae})),r.d(t,"schnorr",(function(){return pe})),r.d(t,"utils",(function(){return ye}));var n=r(153);
16
16
  /*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */
17
- const i=BigInt(0),o=BigInt(1),a=BigInt(2),s=BigInt(3),u=BigInt(8),c=Object.freeze({a:i,b:BigInt(7),P:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:o,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")}),f=(e,t)=>(e+t/a)/t,l={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar(e){const{n:t}=c,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-o*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=r,s=BigInt("0x100000000000000000000000000000000"),u=f(a*e,t),l=f(-n*e,t);let d=j(e-u*r-l*i,t),h=j(-u*n-l*a,t);const p=d>s,b=h>s;if(p&&(d=t-d),b&&(h=t-h),d>s||h>s)throw new Error("splitScalarEndo: Endomorphism failed, k="+e);return{k1neg:p,k1:d,k2neg:b,k2:h}}};function d(e){const{a:t,b:r}=c,n=j(e*e),i=j(n*e);return j(i+t*e+r)}const h=c.a===i;class p extends Error{constructor(e){super(e)}}function b(e){if(!(e instanceof m))throw new TypeError("JacobianPoint expected")}class m{constructor(e,t,r){this.x=e,this.y=t,this.z=r}static fromAffine(e){if(!(e instanceof v))throw new TypeError("JacobianPoint#fromAffine: expected Point");return e.equals(v.ZERO)?m.ZERO:new m(e.x,e.y,o)}static toAffineBatch(e){const t=function(e,t=c.P){const r=new Array(e.length),n=C(e.reduce((e,n,o)=>n===i?e:(r[o]=e,j(e*n,t)),o),t);return e.reduceRight((e,n,o)=>n===i?e:(r[o]=j(e*r[o],t),j(e*n,t)),n),r}(e.map(e=>e.z));return e.map((e,r)=>e.toAffine(t[r]))}static normalizeZ(e){return m.toAffineBatch(e).map(m.fromAffine)}equals(e){b(e);const{x:t,y:r,z:n}=this,{x:i,y:o,z:a}=e,s=j(n*n),u=j(a*a),c=j(t*u),f=j(i*s),l=j(j(r*a)*u),d=j(j(o*n)*s);return c===f&&l===d}negate(){return new m(this.x,j(-this.y),this.z)}double(){const{x:e,y:t,z:r}=this,n=j(e*e),i=j(t*t),o=j(i*i),c=e+i,f=j(a*(j(c*c)-n-o)),l=j(s*n),d=j(l*l),h=j(d-a*f),p=j(l*(f-h)-u*o),b=j(a*t*r);return new m(h,p,b)}add(e){b(e);const{x:t,y:r,z:n}=this,{x:o,y:s,z:u}=e;if(o===i||s===i)return this;if(t===i||r===i)return e;const c=j(n*n),f=j(u*u),l=j(t*f),d=j(o*c),h=j(j(r*u)*f),p=j(j(s*n)*c),g=j(d-l),y=j(p-h);if(g===i)return y===i?this.double():m.ZERO;const v=j(g*g),w=j(g*v),_=j(l*v),E=j(y*y-w-a*_),k=j(y*(_-E)-h*w),S=j(n*u*g);return new m(E,k,S)}subtract(e){return this.add(e.negate())}multiplyUnsafe(e){const t=m.ZERO;if("bigint"==typeof e&&e===i)return t;let r=N(e);if(r===o)return this;if(!h){let e=t,n=this;for(;r>i;)r&o&&(e=e.add(n)),n=n.double(),r>>=o;return e}let{k1neg:n,k1:a,k2neg:s,k2:u}=l.splitScalar(r),c=t,f=t,d=this;for(;a>i||u>i;)a&o&&(c=c.add(d)),u&o&&(f=f.add(d)),d=d.double(),a>>=o,u>>=o;return n&&(c=c.negate()),s&&(f=f.negate()),f=new m(j(f.x*l.beta),f.y,f.z),c.add(f)}precomputeWindow(e){const t=h?128/e+1:256/e+1,r=[];let n=this,i=n;for(let o=0;o<t;o++){i=n,r.push(i);for(let t=1;t<2**(e-1);t++)i=i.add(n),r.push(i);n=i.double()}return r}wNAF(e,t){!t&&this.equals(m.BASE)&&(t=v.BASE);const r=t&&t._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=t&&y.get(t);n||(n=this.precomputeWindow(r),t&&1!==r&&(n=m.normalizeZ(n),y.set(t,n)));let i=m.ZERO,a=m.BASE;const s=1+(h?128/r:256/r),u=2**(r-1),c=BigInt(2**r-1),f=2**r,l=BigInt(r);for(let t=0;t<s;t++){const r=t*u;let s=Number(e&c);e>>=l,s>u&&(s-=f,e+=o);const d=r,h=r+Math.abs(s)-1,p=t%2!=0,b=s<0;0===s?a=a.add(g(p,n[d])):i=i.add(g(b,n[h]))}return{p:i,f:a}}multiply(e,t){let r,n,i=N(e);if(h){const{k1neg:e,k1:o,k2neg:a,k2:s}=l.splitScalar(i);let{p:u,f:c}=this.wNAF(o,t),{p:f,f:d}=this.wNAF(s,t);u=g(e,u),f=g(a,f),f=new m(j(f.x*l.beta),f.y,f.z),r=u.add(f),n=c.add(d)}else{const{p:e,f:o}=this.wNAF(i,t);r=e,n=o}return m.normalizeZ([r,n])[0]}toAffine(e){const{x:t,y:r,z:n}=this,i=this.equals(m.ZERO);null==e&&(e=i?u:C(n));const a=e,s=j(a*a),c=j(s*a),f=j(t*s),l=j(r*c),d=j(n*a);if(i)return v.ZERO;if(d!==o)throw new Error("invZ was invalid");return new v(f,l)}}function g(e,t){const r=t.negate();return e?r:t}m.BASE=new m(c.Gx,c.Gy,o),m.ZERO=new m(i,o,i);const y=new WeakMap;class v{constructor(e,t){this.x=e,this.y=t}_setWindowSize(e){this._WINDOW_SIZE=e,y.delete(this)}hasEvenY(){return this.y%a===i}static fromCompressedHex(e){const t=32===e.length,r=M(t?e:e.subarray(1));if(!q(r))throw new Error("Point is not on curve");let n=function(e){const{P:t}=c,r=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),u=BigInt(44),f=BigInt(88),l=e*e*e%t,d=l*l*e%t,h=U(d,s)*d%t,p=U(h,s)*d%t,b=U(p,a)*l%t,m=U(b,n)*b%t,g=U(m,i)*m%t,y=U(g,u)*g%t,v=U(y,f)*y%t,w=U(v,u)*g%t,_=U(w,s)*d%t,E=U(_,o)*m%t,k=U(E,r)*l%t,S=U(k,a);if(S*S%t!==e)throw new Error("Cannot find square root");return S}(d(r));const i=(n&o)===o;if(t)i&&(n=j(-n));else{1==(1&e[0])!==i&&(n=j(-n))}const u=new v(r,n);return u.assertValidity(),u}static fromUncompressedHex(e){const t=M(e.subarray(1,33)),r=M(e.subarray(33,65)),n=new v(t,r);return n.assertValidity(),n}static fromHex(e){const t=R(e),r=t.length,n=t[0];if(32===r)return this.fromCompressedHex(t);if(33===r&&(2===n||3===n))return this.fromCompressedHex(t);if(65===r&&4===n)return this.fromUncompressedHex(t);throw new Error("Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not "+r)}static fromPrivateKey(e){return v.BASE.multiply(W(e))}static fromSignature(e,t,r){const{r:n,s:i}=G(t);if(![0,1,2,3].includes(r))throw new Error("Cannot recover: invalid recovery bit");const o=H(R(e)),{n:a}=c,s=2===r||3===r?n+a:n,u=C(s,a),f=j(-o*u,a),l=j(i*u,a),d=1&r?"03":"02",h=v.fromHex(d+A(s)),p=v.BASE.multiplyAndAddUnsafe(h,f,l);if(!p)throw new Error("Cannot recover signature: point at infinify");return p.assertValidity(),p}toRawBytes(e=!1){return B(this.toHex(e))}toHex(e=!1){const t=A(this.x);if(e){return`${this.hasEvenY()?"02":"03"}${t}`}return`04${t}${A(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const e="Point is not on elliptic curve",{x:t,y:r}=this;if(!q(t)||!q(r))throw new Error(e);const n=j(r*r);if(j(n-d(t))!==i)throw new Error(e)}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new v(this.x,j(-this.y))}double(){return m.fromAffine(this).double().toAffine()}add(e){return m.fromAffine(this).add(m.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return m.fromAffine(this).multiply(e,this).toAffine()}multiplyAndAddUnsafe(e,t,r){const n=m.fromAffine(this),a=t===i||t===o||this!==v.BASE?n.multiplyUnsafe(t):n.multiply(t),s=m.fromAffine(e).multiplyUnsafe(r),u=a.add(s);return u.equals(m.ZERO)?void 0:u.toAffine()}}function w(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}function _(e){if(e.length<2||2!==e[0])throw new Error("Invalid signature integer tag: "+x(e));const t=e[1],r=e.subarray(2,t+2);if(!t||r.length!==t)throw new Error("Invalid signature integer: wrong length");if(0===r[0]&&r[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:M(r),left:e.subarray(t+2)}}v.BASE=new v(c.Gx,c.Gy),v.ZERO=new v(i,i);class E{constructor(e,t){this.r=e,this.s=t,this.assertValidity()}static fromCompact(e){const t=e instanceof Uint8Array,r="Signature.fromCompact";if("string"!=typeof e&&!t)throw new TypeError(r+": Expected string or Uint8Array");const n=t?x(e):e;if(128!==n.length)throw new Error(r+": Expected 64-byte hex");return new E(I(n.slice(0,64)),I(n.slice(64,128)))}static fromDER(e){const t=e instanceof Uint8Array;if("string"!=typeof e&&!t)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r:r,s:n}=function(e){if(e.length<2||48!=e[0])throw new Error("Invalid signature tag: "+x(e));if(e[1]!==e.length-2)throw new Error("Invalid signature: incorrect length");const{data:t,left:r}=_(e.subarray(2)),{data:n,left:i}=_(r);if(i.length)throw new Error("Invalid signature: left bytes after parsing: "+x(i));return{r:t,s:n}}(t?e:B(e));return new E(r,n)}static fromHex(e){return this.fromDER(e)}assertValidity(){const{r:e,s:t}=this;if(!F(e))throw new Error("Invalid Signature: r must be 0 < r < n");if(!F(t))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const e=c.n>>o;return this.s>e}normalizeS(){return this.hasHighS()?new E(this.r,j(-this.s,c.n)):this}toDERRawBytes(){return B(this.toDERHex())}toDERHex(){const e=w(O(this.s)),t=w(O(this.r)),r=e.length/2,n=t.length/2,i=O(r),o=O(n);return`30${O(n+r+4)}02${o}${t}02${i}${e}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return B(this.toCompactHex())}toCompactHex(){return A(this.r)+A(this.s)}}function k(...e){if(!e.every(e=>e instanceof Uint8Array))throw new Error("Uint8Array list expected");if(1===e.length)return e[0];const t=e.reduce((e,t)=>e+t.length,0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r}const S=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function x(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");let t="";for(let r=0;r<e.length;r++)t+=S[e[r]];return t}const T=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000");function A(e){if("bigint"!=typeof e)throw new Error("Expected bigint");if(!(i<=e&&e<T))throw new Error("Expected number 0 <= n < 2^256");return e.toString(16).padStart(64,"0")}function P(e){const t=B(A(e));if(32!==t.length)throw new Error("Error: expected 32 bytes");return t}function O(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function I(e){if("string"!=typeof e)throw new TypeError("hexToNumber: expected string, got "+typeof e);return BigInt("0x"+e)}function B(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+e.length);const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");t[r]=o}return t}function M(e){return I(x(e))}function R(e){return e instanceof Uint8Array?Uint8Array.from(e):B(e)}function N(e){if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)return BigInt(e);if("bigint"==typeof e&&F(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function j(e,t=c.P){const r=e%t;return r>=i?r:t+r}function U(e,t){const{P:r}=c;let n=e;for(;t-- >i;)n*=n,n%=r;return n}function C(e,t=c.P){if(e===i||t<=i)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=j(e,t),n=t,a=i,s=o,u=o,f=i;for(;r!==i;){const e=n/r,t=n%r,i=a-u*e,o=s-f*e;n=r,r=t,a=u,s=f,u=i,f=o}if(n!==o)throw new Error("invert: does not exist");return j(a,t)}function H(e,t=!1){const r=function(e){const t=8*e.length-256,r=M(e);return t>0?r>>BigInt(t):r}(e);if(t)return r;const{n:n}=c;return r>=n?r-n:r}let z,L;class D{constructor(e,t){if(this.hashLen=e,this.qByteLen=t,"number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");this.v=new Uint8Array(e).fill(1),this.k=new Uint8Array(e).fill(0),this.counter=0}hmac(...e){return ye.hmacSha256(this.k,...e)}hmacSync(...e){return L(this.k,...e)}checkSync(){if("function"!=typeof L)throw new p("hmacSha256Sync needs to be set")}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(e=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),e),this.v=await this.hmac(this.v),0!==e.length&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),e),this.v=await this.hmac(this.v))}reseedSync(e=new Uint8Array){this.checkSync(),this.k=this.hmacSync(this.v,Uint8Array.from([0]),e),this.v=this.hmacSync(this.v),0!==e.length&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),e),this.v=this.hmacSync(this.v))}async generate(){this.incr();let e=0;const t=[];for(;e<this.qByteLen;){this.v=await this.hmac(this.v);const r=this.v.slice();t.push(r),e+=this.v.length}return k(...t)}generateSync(){this.checkSync(),this.incr();let e=0;const t=[];for(;e<this.qByteLen;){this.v=this.hmacSync(this.v);const r=this.v.slice();t.push(r),e+=this.v.length}return k(...t)}}function F(e){return i<e&&e<c.n}function q(e){return i<e&&e<c.P}function K(e,t,r,n=!0){const{n:a}=c,s=H(e,!0);if(!F(s))return;const u=C(s,a),f=v.BASE.multiply(s),l=j(f.x,a);if(l===i)return;const d=j(u*j(t+r*l,a),a);if(d===i)return;let h=new E(l,d),p=(f.x===h.r?0:2)|Number(f.y&o);return n&&h.hasHighS()&&(h=h.normalizeS(),p^=1),{sig:h,recovery:p}}function W(e){let t;if("bigint"==typeof e)t=e;else if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)t=BigInt(e);else if("string"==typeof e){if(64!==e.length)throw new Error("Expected 32 bytes of private key");t=I(e)}else{if(!(e instanceof Uint8Array))throw new TypeError("Expected valid private key");if(32!==e.length)throw new Error("Expected 32 bytes of private key");t=M(e)}if(!F(t))throw new Error("Expected private key: 0 < key < n");return t}function V(e){return e instanceof v?(e.assertValidity(),e):v.fromHex(e)}function G(e){if(e instanceof E)return e.assertValidity(),e;try{return E.fromDER(e)}catch(t){return E.fromCompact(e)}}function X(e,t=!1){return v.fromPrivateKey(e).toRawBytes(t)}function Y(e,t,r,n=!1){return v.fromSignature(e,t,r).toRawBytes(n)}function $(e){const t=e instanceof Uint8Array,r="string"==typeof e,n=(t||r)&&e.length;return t?33===n||65===n:r?66===n||130===n:e instanceof v}function J(e,t,r=!1){if($(e))throw new TypeError("getSharedSecret: first arg must be private key");if(!$(t))throw new TypeError("getSharedSecret: second arg must be public key");const n=V(t);return n.assertValidity(),n.multiply(W(e)).toRawBytes(r)}function Q(e){return M(e.length>32?e.slice(0,32):e)}function Z(e){const t=Q(e),r=j(t,c.n);return ee(r<i?t:r)}function ee(e){return P(e)}function te(e,t,r){if(null==e)throw new Error(`sign: expected valid message hash, not "${e}"`);const n=R(e),i=W(t),o=[ee(i),Z(n)];if(null!=r){!0===r&&(r=ye.randomBytes(32));const e=R(r);if(32!==e.length)throw new Error("sign: Expected 32 bytes of extra data");o.push(e)}return{seed:k(...o),m:Q(n),d:i}}function re(e,t){const{sig:r,recovery:n}=e,{der:i,recovered:o}=Object.assign({canonical:!0,der:!0},t),a=i?r.toDERRawBytes():r.toCompactRawBytes();return o?[a,n]:a}async function ne(e,t,r={}){const{seed:n,m:i,d:o}=te(e,t,r.extraEntropy),a=new D(32,32);let s;for(await a.reseed(n);!(s=K(await a.generate(),i,o,r.canonical));)await a.reseed();return re(s,r)}function ie(e,t,r={}){const{seed:n,m:i,d:o}=te(e,t,r.extraEntropy),a=new D(32,32);let s;for(a.reseedSync(n);!(s=K(a.generateSync(),i,o,r.canonical));)a.reseedSync();return re(s,r)}const oe={strict:!0};function ae(e,t,r,n=oe){let i;try{i=G(e),t=R(t)}catch(e){return!1}const{r:o,s:a}=i;if(n.strict&&i.hasHighS())return!1;const s=H(t);let u;try{u=V(r)}catch(e){return!1}const{n:f}=c,l=C(a,f),d=j(s*l,f),h=j(o*l,f),p=v.BASE.multiplyAndAddUnsafe(u,d,h);if(!p)return!1;return j(p.x,f)===o}function se(e){return j(M(e),c.n)}class ue{constructor(e,t){this.r=e,this.s=t,this.assertValidity()}static fromHex(e){const t=R(e);if(64!==t.length)throw new TypeError("SchnorrSignature.fromHex: expected 64 bytes, not "+t.length);const r=M(t.subarray(0,32)),n=M(t.subarray(32,64));return new ue(r,n)}assertValidity(){const{r:e,s:t}=this;if(!q(e)||!F(t))throw new Error("Invalid signature")}toHex(){return A(this.r)+A(this.s)}toRawBytes(){return B(this.toHex())}}class ce{constructor(e,t,r=ye.randomBytes()){if(null==e)throw new TypeError(`sign: Expected valid message, not "${e}"`);this.m=R(e);const{x:n,scalar:i}=this.getScalar(W(t));if(this.px=n,this.d=i,this.rand=R(r),32!==this.rand.length)throw new TypeError("sign: Expected 32 bytes of aux randomness")}getScalar(e){const t=v.fromPrivateKey(e),r=t.hasEvenY()?e:c.n-e;return{point:t,scalar:r,x:t.toRawX()}}initNonce(e,t){return P(e^M(t))}finalizeNonce(e){const t=j(M(e),c.n);if(t===i)throw new Error("sign: Creation of signature failed. k is zero");const{point:r,x:n,scalar:o}=this.getScalar(t);return{R:r,rx:n,k:o}}finalizeSig(e,t,r,n){return new ue(e.x,j(t+r*n,c.n)).toRawBytes()}error(){throw new Error("sign: Invalid signature produced")}async calc(){const{m:e,d:t,px:r,rand:n}=this,i=ye.taggedHash,o=this.initNonce(t,await i(me.aux,n)),{R:a,rx:s,k:u}=this.finalizeNonce(await i(me.nonce,o,r,e)),c=se(await i(me.challenge,s,r,e)),f=this.finalizeSig(a,u,c,t);return await de(f,e,r)||this.error(),f}calcSync(){const{m:e,d:t,px:r,rand:n}=this,i=ye.taggedHashSync,o=this.initNonce(t,i(me.aux,n)),{R:a,rx:s,k:u}=this.finalizeNonce(i(me.nonce,o,r,e)),c=se(i(me.challenge,s,r,e)),f=this.finalizeSig(a,u,c,t);return he(f,e,r)||this.error(),f}}function fe(e,t,r){const n=e instanceof ue,i=n?e:ue.fromHex(e);return n&&i.assertValidity(),{...i,m:R(t),P:V(r)}}function le(e,t,r,n){const i=v.BASE.multiplyAndAddUnsafe(t,W(r),j(-n,c.n));return!(!i||!i.hasEvenY()||i.x!==e)}async function de(e,t,r){try{const{r:n,s:i,m:o,P:a}=fe(e,t,r),s=se(await ye.taggedHash(me.challenge,P(n),a.toRawX(),o));return le(n,a,i,s)}catch(e){return!1}}function he(e,t,r){try{const{r:n,s:i,m:o,P:a}=fe(e,t,r),s=se(ye.taggedHashSync(me.challenge,P(n),a.toRawX(),o));return le(n,a,i,s)}catch(e){if(e instanceof p)throw e;return!1}}const pe={Signature:ue,getPublicKey:function(e){return v.fromPrivateKey(e).toRawX()},sign:async function(e,t,r){return new ce(e,t,r).calc()},verify:de,signSync:function(e,t,r){return new ce(e,t,r).calcSync()},verifySync:he};v.BASE._setWindowSize(8);const be={node:n,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0},me={challenge:"BIP0340/challenge",aux:"BIP0340/aux",nonce:"BIP0340/nonce"},ge={},ye={bytesToHex:x,hexToBytes:B,concatBytes:k,mod:j,invert:C,isValidPrivateKey(e){try{return W(e),!0}catch(e){return!1}},_bigintTo32Bytes:P,_normalizePrivateKey:W,hashToPrivateKey:e=>{if((e=R(e)).length<40||e.length>1024)throw new Error("Expected valid bytes of private key as per FIPS 186");return P(j(M(e),c.n-o)+o)},randomBytes:(e=32)=>{if(be.web)return be.web.getRandomValues(new Uint8Array(e));if(be.node){const{randomBytes:t}=be.node;return Uint8Array.from(t(e))}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>ye.hashToPrivateKey(ye.randomBytes(40)),precompute(e=8,t=v.BASE){const r=t===v.BASE?t:new v(t.x,t.y);return r._setWindowSize(e),r.multiply(s),r},sha256:async(...e)=>{if(be.web){const t=await be.web.subtle.digest("SHA-256",k(...e));return new Uint8Array(t)}if(be.node){const{createHash:t}=be.node,r=t("sha256");return e.forEach(e=>r.update(e)),Uint8Array.from(r.digest())}throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(e,...t)=>{if(be.web){const r=await be.web.subtle.importKey("raw",e,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),n=k(...t),i=await be.web.subtle.sign("HMAC",r,n);return new Uint8Array(i)}if(be.node){const{createHmac:r}=be.node,n=r("sha256",e);return t.forEach(e=>n.update(e)),Uint8Array.from(n.digest())}throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:async(e,...t)=>{let r=ge[e];if(void 0===r){const t=await ye.sha256(Uint8Array.from(e,e=>e.charCodeAt(0)));r=k(t,t),ge[e]=r}return ye.sha256(r,...t)},taggedHashSync:(e,...t)=>{if("function"!=typeof z)throw new p("sha256Sync is undefined, you need to set it");let r=ge[e];if(void 0===r){const t=z(Uint8Array.from(e,e=>e.charCodeAt(0)));r=k(t,t),ge[e]=r}return z(r,...t)},_JacobianPoint:m};Object.defineProperties(ye,{sha256Sync:{configurable:!1,get:()=>z,set(e){z||(z=e)}},hmacSha256Sync:{configurable:!1,get:()=>L,set(e){L||(L=e)}}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(244);t.fromSeed=n.fromSeed,t.fromBase58=n.fromBase58,t.fromPublicKey=n.fromPublicKey,t.fromPrivateKey=n.fromPrivateKey},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(245),i=r(39),o=r(248),a=r(3),s=r(69),u=a.BufferN(32),c=a.compile({wif:a.UInt8,bip32:{public:a.UInt32,private:a.UInt32}}),f={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},l=Math.pow(2,31)-1;function d(e){return a.String(e)&&null!==e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}function h(e){return a.UInt32(e)&&e<=l}class p{constructor(e,t,r,n,i=0,o=0,s=0){this.__D=e,this.__Q=t,this.chainCode=r,this.network=n,this.__DEPTH=i,this.__INDEX=o,this.__PARENT_FINGERPRINT=s,a(c,n),this.lowR=!1}get depth(){return this.__DEPTH}get index(){return this.__INDEX}get parentFingerprint(){return this.__PARENT_FINGERPRINT}get publicKey(){return void 0===this.__Q&&(this.__Q=o.pointFromScalar(this.__D,!0)),this.__Q}get privateKey(){return this.__D}get identifier(){return n.hash160(this.publicKey)}get fingerprint(){return this.identifier.slice(0,4)}get compressed(){return!0}isNeutered(){return void 0===this.__D}neutered(){return g(this.publicKey,this.chainCode,this.network,this.depth,this.index,this.parentFingerprint)}toBase58(){const t=this.network,r=this.isNeutered()?t.bip32.public:t.bip32.private,n=e.allocUnsafe(78);return n.writeUInt32BE(r,0),n.writeUInt8(this.depth,4),n.writeUInt32BE(this.parentFingerprint,5),n.writeUInt32BE(this.index,9),this.chainCode.copy(n,13),this.isNeutered()?this.publicKey.copy(n,45):(n.writeUInt8(0,45),this.privateKey.copy(n,46)),i.encode(n)}toWIF(){if(!this.privateKey)throw new TypeError("Missing private key");return s.encode(this.network.wif,this.privateKey,!0)}derive(t){a(a.UInt32,t);const r=t>=2147483648,i=e.allocUnsafe(37);if(r){if(this.isNeutered())throw new TypeError("Missing private key for hardened child key");i[0]=0,this.privateKey.copy(i,1),i.writeUInt32BE(t,33)}else this.publicKey.copy(i,0),i.writeUInt32BE(t,33);const s=n.hmacSHA512(this.chainCode,i),u=s.slice(0,32),c=s.slice(32);if(!o.isPrivate(u))return this.derive(t+1);let f;if(this.isNeutered()){const e=o.pointAddScalar(this.publicKey,u,!0);if(null===e)return this.derive(t+1);f=g(e,c,this.network,this.depth+1,t,this.fingerprint.readUInt32BE(0))}else{const e=o.privateAdd(this.privateKey,u);if(null==e)return this.derive(t+1);f=m(e,c,this.network,this.depth+1,t,this.fingerprint.readUInt32BE(0))}return f}deriveHardened(e){return a(h,e),this.derive(e+2147483648)}derivePath(e){a(d,e);let t=e.split("/");if("m"===t[0]){if(this.parentFingerprint)throw new TypeError("Expected master, got child");t=t.slice(1)}return t.reduce((e,t)=>{let r;return"'"===t.slice(-1)?(r=parseInt(t.slice(0,-1),10),e.deriveHardened(r)):(r=parseInt(t,10),e.derive(r))},this)}sign(t,r){if(!this.privateKey)throw new Error("Missing private key");if(void 0===r&&(r=this.lowR),!1===r)return o.sign(t,this.privateKey);{let r=o.sign(t,this.privateKey);const n=e.alloc(32,0);let i=0;for(;r[0]>127;)i++,n.writeUIntLE(i,0,6),r=o.signWithEntropy(t,this.privateKey,n);return r}}verify(e,t){return o.verify(e,this.publicKey,t)}}function b(e,t,r){return m(e,t,r)}function m(e,t,r,n,i,s){if(a({privateKey:u,chainCode:u},{privateKey:e,chainCode:t}),r=r||f,!o.isPrivate(e))throw new TypeError("Private key not in range [1, n)");return new p(e,void 0,t,r,n,i,s)}function g(e,t,r,n,i,s){if(a({publicKey:a.BufferN(33),chainCode:u},{publicKey:e,chainCode:t}),r=r||f,!o.isPoint(e))throw new TypeError("Point is not on the curve");return new p(void 0,e,t,r,n,i,s)}t.fromBase58=function(e,t){const r=i.decode(e);if(78!==r.length)throw new TypeError("Invalid buffer length");t=t||f;const n=r.readUInt32BE(0);if(n!==t.bip32.private&&n!==t.bip32.public)throw new TypeError("Invalid network version");const o=r[4],a=r.readUInt32BE(5);if(0===o&&0!==a)throw new TypeError("Invalid parent fingerprint");const s=r.readUInt32BE(9);if(0===o&&0!==s)throw new TypeError("Invalid index");const u=r.slice(13,45);let c;if(n===t.bip32.private){if(0!==r.readUInt8(45))throw new TypeError("Invalid private key");c=m(r.slice(46,78),u,t,o,s,a)}else{c=g(r.slice(45,78),u,t,o,s,a)}return c},t.fromPrivateKey=b,t.fromPublicKey=function(e,t,r){return g(e,t,r)},t.fromSeed=function(t,r){if(a(a.Buffer,t),t.length<16)throw new TypeError("Seed should be at least 128 bits");if(t.length>64)throw new TypeError("Seed should be at most 512 bits");r=r||f;const i=n.hmacSHA512(e.from("Bitcoin seed","utf8"),t);return b(i.slice(0,32),i.slice(32),r)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(70),i=r(76);t.hash160=function(e){const t=n("sha256").update(e).digest();try{return n("rmd160").update(t).digest()}catch(e){return n("ripemd160").update(t).digest()}},t.hmacSHA512=function(e,t){return i("sha512",e).update(t).digest()}},function(e,t,r){"use strict";var n=r(2),i=r(4).Buffer,o=r(72),a=i.alloc(128);function s(e,t){o.call(this,"digest"),"string"==typeof t&&(t=i.from(t)),this._alg=e,this._key=t,t.length>64?t=e(t):t.length<64&&(t=i.concat([t,a],64));for(var r=this._ipad=i.allocUnsafe(64),n=this._opad=i.allocUnsafe(64),s=0;s<64;s++)r[s]=54^t[s],n[s]=92^t[s];this._hash=[r]}n(s,o),s.prototype._update=function(e){this._hash.push(e)},s.prototype._final=function(){var e=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,e]))},e.exports=s},function(e,t,r){var n=r(100);e.exports=function(e){return(new n).update(e).digest()}},function(e,t,r){(function(t){const n=r(14),i=new(0,r(118).ec)("secp256k1"),o=r(270),a=t.alloc(32,0),s=t.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),u=t.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","hex"),c=i.curve.n,f=c.shrn(1),l=i.curve.g;function d(e){return t.isBuffer(e)&&32===e.length}function h(e){return!!d(e)&&e.compare(s)<0}function p(e){if(!t.isBuffer(e))return!1;if(e.length<33)return!1;const r=e[0],n=e.slice(1,33);if(0===n.compare(a))return!1;if(n.compare(u)>=0)return!1;if((2===r||3===r)&&33===e.length){try{w(e)}catch(e){return!1}return!0}const i=e.slice(33);return 0!==i.compare(a)&&(!(i.compare(u)>=0)&&(4===r&&65===e.length))}function b(e){return 4!==e[0]}function m(e){return!!d(e)&&(e.compare(a)>0&&e.compare(s)<0)}function g(e,t){return void 0===e&&void 0!==t?b(t):void 0===e||e}function y(e){return new n(e)}function v(e){return e.toArrayLike(t,"be",32)}function w(e){return i.curve.decodePoint(e)}function _(e,r){return t.from(e._encode(r))}function E(e,r,n){if(!d(e))throw new TypeError("Expected Hash");if(!m(r))throw new TypeError("Expected Private");if(void 0!==n&&!d(n))throw new TypeError("Expected Extra Data (32 bytes)");const i=y(r),a=y(e);let s,u;o(e,r,(function(e){const t=y(e),r=l.mul(t);return!r.isInfinity()&&(s=r.x.umod(c),0!==s.isZero()&&(u=t.invm(c).mul(a.add(i.mul(s))).umod(c),0!==u.isZero()))}),m,n),u.cmp(f)>0&&(u=c.sub(u));const h=t.allocUnsafe(64);return v(s).copy(h,0),v(u).copy(h,32),h}e.exports={isPoint:p,isPointCompressed:function(e){return!!p(e)&&b(e)},isPrivate:m,pointAdd:function(e,t,r){if(!p(e))throw new TypeError("Expected Point");if(!p(t))throw new TypeError("Expected Point");const n=w(e),i=w(t),o=n.add(i);return o.isInfinity()?null:_(o,g(r,e))},pointAddScalar:function(e,t,r){if(!p(e))throw new TypeError("Expected Point");if(!h(t))throw new TypeError("Expected Tweak");const n=g(r,e),i=w(e);if(0===t.compare(a))return _(i,n);const o=y(t),s=l.mul(o),u=i.add(s);return u.isInfinity()?null:_(u,n)},pointCompress:function(e,t){if(!p(e))throw new TypeError("Expected Point");const r=w(e);if(r.isInfinity())throw new TypeError("Expected Point");return _(r,g(t,e))},pointFromScalar:function(e,t){if(!m(e))throw new TypeError("Expected Private");const r=y(e),n=l.mul(r);return n.isInfinity()?null:_(n,g(t))},pointMultiply:function(e,t,r){if(!p(e))throw new TypeError("Expected Point");if(!h(t))throw new TypeError("Expected Tweak");const n=g(r,e),i=w(e),o=y(t),a=i.mul(o);return a.isInfinity()?null:_(a,n)},privateAdd:function(e,t){if(!m(e))throw new TypeError("Expected Private");if(!h(t))throw new TypeError("Expected Tweak");const r=y(e),n=y(t),i=v(r.add(n).umod(c));return m(i)?i:null},privateSub:function(e,t){if(!m(e))throw new TypeError("Expected Private");if(!h(t))throw new TypeError("Expected Tweak");const r=y(e),n=y(t),i=v(r.sub(n).umod(c));return m(i)?i:null},sign:function(e,t){return E(e,t)},signWithEntropy:function(e,t,r){return E(e,t,r)},verify:function(e,r,n,i){if(!d(e))throw new TypeError("Expected Hash");if(!p(r))throw new TypeError("Expected Point");if(!function(e){const r=e.slice(0,32),n=e.slice(32,64);return t.isBuffer(e)&&64===e.length&&r.compare(s)<0&&n.compare(s)<0}(n))throw new TypeError("Expected Signature");const o=w(r),a=y(n.slice(0,32)),u=y(n.slice(32,64));if(i&&u.cmp(f)>0)return!1;if(a.gtn(0)<=0)return!1;if(u.gtn(0)<=0)return!1;const h=y(e),b=u.invm(c),m=h.mul(b).umod(c),g=a.mul(b).umod(c),v=l.mulAdd(m,o,g);return!v.isInfinity()&&v.x.umod(c).eq(a)}}}).call(this,r(0).Buffer)},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){},function(e){e.exports=JSON.parse('{"name":"elliptic","version":"6.5.4","description":"EC cryptography","main":"lib/elliptic.js","files":["lib"],"scripts":{"lint":"eslint lib test","lint:fix":"npm run lint -- --fix","unit":"istanbul test _mocha --reporter=spec test/index.js","test":"npm run lint && npm run unit","version":"grunt dist && git add dist/"},"repository":{"type":"git","url":"git@github.com:indutny/elliptic"},"keywords":["EC","Elliptic","curve","Cryptography"],"author":"Fedor Indutny <fedor@indutny.com>","license":"MIT","bugs":{"url":"https://github.com/indutny/elliptic/issues"},"homepage":"https://github.com/indutny/elliptic","devDependencies":{"brfs":"^2.0.2","coveralls":"^3.1.0","eslint":"^7.6.0","grunt":"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.5","mocha":"^8.0.1"},"dependencies":{"bn.js":"^4.11.9","brorand":"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1","inherits":"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}')},function(e,t){},function(e,t,r){"use strict";var n=r(11),i=r(14),o=r(2),a=r(49),s=n.assert;function u(e){a.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,n){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function f(e,t,r,n){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,a),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,n,o,a,s,u,c,f,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),p=new i(1),b=new i(0),m=new i(0),g=new i(1),y=0;0!==d.cmpn(0);){var v=h.div(d);c=h.sub(v.mul(d)),f=m.sub(v.mul(p));var w=g.sub(v.mul(b));if(!n&&c.cmp(l)<0)t=u.neg(),r=p,n=c.neg(),o=f;else if(n&&2==++y)break;u=c,h=d,d=c,m=p,p=f,g=b,b=w}a=c.neg(),s=f;var _=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(_)>=0&&(a=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],u=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),n[2*o]=s,n[2*o+1]=u,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var c=this._wnafMulAdd(1,n,i,2*o,r),f=0;f<2*o;f++)n[f]=null,i[f]=null;return c},o(c,a.BasePoint),u.prototype.point=function(e,t,r){return new c(this,e,t,r)},u.prototype.pointFromJSON=function(e,t){return c.fromJSON(this,e,t)},c.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},c.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},c.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(f,a.BasePoint),u.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),f=c.redMul(s),l=n.redMul(c),d=u.redSqr().redIAdd(f).redISub(l).redISub(l),h=u.redMul(l.redISub(d)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,h,p)},f.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),f=r.redMul(u),l=s.redSqr().redIAdd(c).redISub(f).redISub(f),d=s.redMul(f.redISub(l)).redISub(i.redMul(c)),h=this.z.redMul(a);return this.curve.jpoint(l,d,h)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,u=s.redSqr().redSqr(),c=a.redAdd(a);for(t=0;t<e;t++){var f=o.redSqr(),l=c.redSqr(),d=l.redSqr(),h=f.redAdd(f).redIAdd(f).redIAdd(n.redMul(u)),p=o.redMul(l),b=h.redSqr().redISub(p.redAdd(p)),m=p.redISub(b),g=h.redMul(m);g=g.redIAdd(g).redISub(d);var y=c.redMul(s);t+1<e&&(u=u.redMul(d)),o=b,s=y,c=g}return this.curve.jpoint(o,c.redMul(i),s)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},f.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),u=s.redSqr().redISub(a).redISub(a),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=u,t=s.redMul(a.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),l=this.y.redSqr(),d=l.redSqr(),h=this.x.redAdd(l).redSqr().redISub(f).redISub(d);h=h.redIAdd(h);var p=f.redAdd(f).redIAdd(f),b=p.redSqr(),m=d.redIAdd(d);m=(m=m.redIAdd(m)).redIAdd(m),e=b.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},f.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=s.redSqr().redISub(a).redISub(a);e=u;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=s.redMul(a.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),l=this.y.redSqr(),d=this.x.redMul(l),h=this.x.redSub(f).redMul(this.x.redAdd(f));h=h.redAdd(h).redIAdd(h);var p=d.redIAdd(d),b=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(l).redISub(f);var m=l.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=h.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},f.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),u=t.redAdd(t),c=(u=u.redIAdd(u)).redMul(a),f=s.redSqr().redISub(c.redAdd(c)),l=c.redISub(f),d=a.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=s.redMul(l).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(f,h,p)},f.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(u),f=t.redMul(c);f=(f=f.redIAdd(f)).redIAdd(f);var l=this.x.redMul(s).redISub(f);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.y.redMul(c.redMul(u.redISub(c)).redISub(a.redMul(s)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(l,d,h)},f.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},f.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},f.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},f.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict";var n=r(14),i=r(2),o=r(49),a=r(11);function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},s.prototype.point=function(e,t){return new u(this,e,t)},s.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";var n=r(11),i=r(14),o=r(2),a=r(49),s=n.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,r,n,o){a.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,a),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var u=s.fromRed().isOdd();return(t&&!u||!t&&u)&&(s=s.redNeg()),this.point(e,s)},u.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(c,a.BasePoint),u.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},u.prototype.point=function(e,t,r,n){return new c(this,e,t,r,n)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),u=i.redMul(a),c=o.redMul(s),f=i.redMul(s),l=a.redMul(o);return this.curve.point(u,c,l,f)},c.prototype._projDbl=function(){var e,t,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(s)).redAdd(u);this.zOne?(e=a.redSub(s).redSub(u).redMul(c.redSub(this.curve.two)),t=c.redMul(n.redSub(u)),r=c.redSqr().redSub(c).redSub(c)):(i=this.z.redSqr(),o=c.redSub(i).redISub(i),e=a.redSub(s).redISub(u).redMul(o),t=c.redMul(n.redSub(u)),r=c.redMul(o))}else n=s.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(s.redISub(u)),r=n.redMul(o);return this.curve.point(e,t,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(t),c=o.redMul(a),f=s.redMul(u),l=o.redMul(u),d=a.redMul(s);return this.curve.point(c,f,d,l)},c.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),c=i.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),l=n.redMul(u).redMul(f);return this.curve.twisted?(t=n.redMul(c).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(c)):(t=n.redMul(c).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(l,t,r)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},function(e,t,r){"use strict";t.sha1=r(257),t.sha224=r(258),t.sha256=r(123),t.sha384=r(259),t.sha512=r(124)},function(e,t,r){"use strict";var n=r(15),i=r(43),o=r(122),a=n.rotl32,s=n.sum32,u=n.sum32_5,c=o.ft_1,f=i.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,f),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=a(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],f=this.h[2],d=this.h[3],h=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),b=u(a(i,5),c(p,o,f,d),h,r[n],l[p]);h=d,d=f,f=a(o,30),o=i,i=b}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],f),this.h[3]=s(this.h[3],d),this.h[4]=s(this.h[4],h)},d.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(e,t,r){"use strict";var n=r(15),i=r(123);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},function(e,t,r){"use strict";var n=r(15),i=r(124);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},function(e,t,r){"use strict";var n=r(15),i=r(43),o=n.rotl32,a=n.sum32,s=n.sum32_3,u=n.sum32_4,c=i.BlockHash;function f(){if(!(this instanceof f))return new f;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function l(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function d(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function h(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(f,c),t.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],c=this.h[3],f=this.h[4],y=r,v=n,w=i,_=c,E=f,k=0;k<80;k++){var S=a(o(u(r,l(k,n,i,c),e[p[k]+t],d(k)),m[k]),f);r=f,f=c,c=o(i,10),i=n,n=S,S=a(o(u(y,l(79-k,v,w,_),e[b[k]+t],h(k)),g[k]),E),y=E,E=_,_=o(w,10),w=v,v=S}S=s(this.h[1],i,_),this.h[1]=s(this.h[2],c,E),this.h[2]=s(this.h[3],f,y),this.h[3]=s(this.h[4],r,v),this.h[4]=s(this.h[0],n,w),this.h[0]=S},f.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],b=[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],m=[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],g=[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]},function(e,t,r){"use strict";var n=r(15),i=r(24);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},function(e,t){e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(e,t,r){"use strict";var n=r(14),i=r(264),o=r(11),a=r(77),s=r(120),u=o.assert,c=r(265),f=r(266);function l(e){if(!(this instanceof l))return new l(e);"string"==typeof e&&(u(Object.prototype.hasOwnProperty.call(a,e),"Unknown curve "+e),e=a[e]),e instanceof a.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=l,l.prototype.keyPair=function(e){return new c(this,e)},l.prototype.keyFromPrivate=function(e,t){return c.fromPrivate(this,e,t)},l.prototype.keyFromPublic=function(e,t){return c.fromPublic(this,e,t)},l.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||s(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var a=new n(t.generate(r));if(!(a.cmp(o)>0))return a.iaddn(1),this.keyFromPrivate(a)}},l.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},l.prototype.sign=function(e,t,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var a=this.n.byteLength(),s=t.getPrivate().toArray("be",a),u=e.toArray("be",a),c=new i({hash:this.hash,entropy:s,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),l=this.n.sub(new n(1)),d=0;;d++){var h=o.k?o.k(d):new n(c.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(l)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var b=p.getX(),m=b.umod(this.n);if(0!==m.cmpn(0)){var g=h.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==b.cmp(m)?2:0);return o.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),y^=1),new f({r:m,s:g,recoveryParam:y})}}}}}},l.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new f(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),c=u.mul(e).umod(this.n),l=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),l)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},l.prototype.recoverPubKey=function(e,t,r,i){u((3&r)===r,"The recovery param is more than two bits"),t=new f(t,i);var o=this.n,a=new n(e),s=t.r,c=t.s,l=1&r,d=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");s=d?this.curve.pointFromX(s.add(this.curve.n),l):this.curve.pointFromX(s,l);var h=t.r.invm(o),p=o.sub(a).mul(h).umod(o),b=c.mul(h).umod(o);return this.g.mulAdd(p,s,b)},l.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new f(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";var n=r(78),i=r(119),o=r(24);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=a,a.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},a.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},a.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},a.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var a=o.slice(0,e);return this._update(r),this._reseed++,i.encode(a,t)}},function(e,t,r){"use strict";var n=r(14),i=r(11).assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},function(e,t,r){"use strict";var n=r(14),i=r(11),o=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function u(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function c(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function f(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new s;if(48!==e[r.place++])return!1;var o=u(e,r);if(!1===o)return!1;if(o+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var a=u(e,r);if(!1===a)return!1;var c=e.slice(r.place,a+r.place);if(r.place+=a,2!==e[r.place++])return!1;var f=u(e,r);if(!1===f)return!1;if(e.length!==f+r.place)return!1;var l=e.slice(r.place,f+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}return this.r=new n(c),this.s=new n(l),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,t.length),(n=n.concat(t)).push(2),f(n,r.length);var o=n.concat(r),a=[48];return f(a,o.length),a=a.concat(o),i.encode(a,e)}},function(e,t,r){"use strict";var n=r(78),i=r(77),o=r(11),a=o.assert,s=o.parseBytes,u=r(268),c=r(269);function f(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=f,f.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),u=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},f.prototype.verify=function(e,t,r){e=s(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},f.prototype.keyFromPublic=function(e){return u.fromPublic(this,e)},f.prototype.keyFromSecret=function(e){return u.fromSecret(this,e)},f.prototype.makeSignature=function(e){return e instanceof c?e:new c(this,e)},f.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},f.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},f.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},f.prototype.decodeInt=function(e){return o.intFromLE(e)},f.prototype.isPoint=function(e){return e instanceof this.pointClass}},function(e,t,r){"use strict";var n=r(11),i=n.assert,o=n.parseBytes,a=n.cachedProperty;function s(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}s.fromPublic=function(e,t){return t instanceof s?t:new s(e,{pub:t})},s.fromSecret=function(e,t){return t instanceof s?t:new s(e,{secret:t})},s.prototype.secret=function(){return this._secret},a(s,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),a(s,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),a(s,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),a(s,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),a(s,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),a(s,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),s.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},s.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},s.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},s.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=s},function(e,t,r){"use strict";var n=r(14),i=r(11),o=i.assert,a=i.cachedProperty,s=i.parseBytes;function u(e,t){this.eddsa=e,"object"!=typeof t&&(t=s(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),o(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}a(u,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),a(u,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),a(u,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),a(u,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=u},function(e,t,r){(function(t){const n=r(76),i=t.alloc(1,1),o=t.alloc(1,0);e.exports=function(e,r,a,s,u){let c=t.alloc(32,0),f=t.alloc(32,1);c=n("sha256",c).update(f).update(o).update(r).update(e).update(u||"").digest(),f=n("sha256",c).update(f).digest(),c=n("sha256",c).update(f).update(i).update(r).update(e).update(u||"").digest(),f=n("sha256",c).update(f).digest(),f=n("sha256",c).update(f).digest();let l=f;for(;!s(l)||!a(l);)c=n("sha256",c).update(f).update(o).digest(),f=n("sha256",c).update(f).digest(),f=n("sha256",c).update(f).digest(),l=f;return l}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(12),i=r(1),o=r(26),a=r(3),s=i.OPS;t.p2data=function(e,t){if(!e.data&&!e.output)throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),a({network:a.maybe(a.Object),output:a.maybe(a.Buffer),data:a.maybe(a.arrayOf(a.Buffer))},e);const r={name:"embed",network:e.network||n.bitcoin};if(o.prop(r,"output",()=>{if(e.data)return i.compile([s.OP_RETURN].concat(e.data))}),o.prop(r,"data",()=>{if(e.output)return i.decompile(e.output).slice(1)}),t.validate&&e.output){const t=i.decompile(e.output);if(t[0]!==s.OP_RETURN)throw new TypeError("Output is invalid");if(!t.slice(1).every(a.Buffer))throw new TypeError("Output is invalid");if(e.data&&!function(e,t){return e.length===t.length&&e.every((e,r)=>e.equals(t[r]))}(e.data,r.data))throw new TypeError("Data mismatch")}return Object.assign(r,e)}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e,t,r){t=t||4,r=void 0===r||r;const n=e.length;if(0===n)return 0;if(n>t)throw new TypeError("Script number overflow");if(r&&0==(127&e[n-1])&&(n<=1||0==(128&e[n-2])))throw new Error("Non-minimally encoded script number");if(5===n){const t=e.readUInt32LE(0),r=e.readUInt8(4);return 128&r?-(4294967296*(-129&r)+t):4294967296*r+t}let i=0;for(let t=0;t<n;++t)i|=e[t]<<8*t;return 128&e[n-1]?-(i&~(128<<8*(n-1))):i},t.encode=function(t){let r=Math.abs(t);const n=(i=r)>2147483647?5:i>8388607?4:i>32767?3:i>127?2:i>0?1:0;var i;const o=e.allocUnsafe(n),a=t<0;for(let e=0;e<n;++e)o.writeUInt8(255&r,e),r>>=8;return 128&o[n-1]?o.writeUInt8(a?128:0,n-1):a&&(o[n-1]|=128),o}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(16),i=r(125),o=r(3),a=e.alloc(1,0);function s(t){let r=0;for(;0===t[r];)++r;return r===t.length?a:128&(t=t.slice(r))[0]?e.concat([a,t],1+t.length):t}function u(t){0===t[0]&&(t=t.slice(1));const r=e.alloc(32,0),n=Math.max(0,32-t.length);return t.copy(r,n),r}t.decode=function(t){const r=t.readUInt8(t.length-1),n=-129&r;if(n<=0||n>=4)throw new Error("Invalid hashType "+r);const o=i.decode(t.slice(0,-1)),a=u(o.r),s=u(o.s);return{signature:e.concat([a,s],64),hashType:r}},t.encode=function(t,r){o({signature:n.BufferN(64),hashType:n.UInt8},{signature:t,hashType:r});const a=-129&r;if(a<=0||a>=4)throw new Error("Invalid hashType "+r);const u=e.allocUnsafe(1);u.writeUInt8(r,0);const c=s(t.slice(0,32)),f=s(t.slice(32,64));return e.concat([i.encode(c,f),u])}}).call(this,r(0).Buffer)},function(e,t,r){(function(t){const n=r(76),i=t.alloc(1,1),o=t.alloc(1,0);e.exports=function(e,r,a,s,u){let c=t.alloc(32,0),f=t.alloc(32,1);c=n("sha256",c).update(f).update(o).update(r).update(e).update(u||"").digest(),f=n("sha256",c).update(f).digest(),c=n("sha256",c).update(f).update(i).update(r).update(e).update(u||"").digest(),f=n("sha256",c).update(f).digest(),f=n("sha256",c).update(f).digest();let l=f;for(;!s(l)||!a(l);)c=n("sha256",c).update(f).update(o).digest(),f=n("sha256",c).update(f).digest(),f=n("sha256",c).update(f).digest(),l=f;return l}}).call(this,r(0).Buffer)},function(e,t,r){var n=r(80);function i(e){return e<n.OP_PUSHDATA1?1:e<=255?2:e<=65535?3:5}e.exports={encodingLength:i,encode:function(e,t,r){var o=i(t);return 1===o?e.writeUInt8(t,r):2===o?(e.writeUInt8(n.OP_PUSHDATA1,r),e.writeUInt8(t,r+1)):3===o?(e.writeUInt8(n.OP_PUSHDATA2,r),e.writeUInt16LE(t,r+1)):(e.writeUInt8(n.OP_PUSHDATA4,r),e.writeUInt32LE(t,r+1)),o},decode:function(e,t){var r,i,o=e.readUInt8(t);if(o<n.OP_PUSHDATA1)r=o,i=1;else if(o===n.OP_PUSHDATA1){if(t+2>e.length)return null;r=e.readUInt8(t+1),i=2}else if(o===n.OP_PUSHDATA2){if(t+3>e.length)return null;r=e.readUInt16LE(t+1),i=3}else{if(t+5>e.length)return null;if(o!==n.OP_PUSHDATA4)throw new Error("Unexpected opcode");r=e.readUInt32LE(t+1),i=5}return{opcode:o,number:r,size:i}}}},function(e,t,r){var n=r(80),i={};for(var o in n){i[n[o]]=o}e.exports=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(12),i=r(1),o=r(26),a=i.OPS,s=r(3),u=r(25),c=a.OP_RESERVED;function f(e,t){return e.length===t.length&&e.every((e,r)=>e.equals(t[r]))}t.p2ms=function(e,t){if(!(e.input||e.output||e.pubkeys&&void 0!==e.m||e.signatures))throw new TypeError("Not enough data");function r(e){return i.isCanonicalScriptSignature(e)||void 0!==(t.allowIncomplete&&e===a.OP_0)}t=Object.assign({validate:!0},t||{}),s({network:s.maybe(s.Object),m:s.maybe(s.Number),n:s.maybe(s.Number),output:s.maybe(s.Buffer),pubkeys:s.maybe(s.arrayOf(u.isPoint)),signatures:s.maybe(s.arrayOf(r)),input:s.maybe(s.Buffer)},e);const l={network:e.network||n.bitcoin};let d=[],h=!1;function p(e){h||(h=!0,d=i.decompile(e),l.m=d[0]-c,l.n=d[d.length-2]-c,l.pubkeys=d.slice(1,-2))}if(o.prop(l,"output",()=>{if(e.m&&l.n&&e.pubkeys)return i.compile([].concat(c+e.m,e.pubkeys,c+l.n,a.OP_CHECKMULTISIG))}),o.prop(l,"m",()=>{if(l.output)return p(l.output),l.m}),o.prop(l,"n",()=>{if(l.pubkeys)return l.pubkeys.length}),o.prop(l,"pubkeys",()=>{if(e.output)return p(e.output),l.pubkeys}),o.prop(l,"signatures",()=>{if(e.input)return i.decompile(e.input).slice(1)}),o.prop(l,"input",()=>{if(e.signatures)return i.compile([a.OP_0].concat(e.signatures))}),o.prop(l,"witness",()=>{if(l.input)return[]}),o.prop(l,"name",()=>{if(l.m&&l.n)return`p2ms(${l.m} of ${l.n})`}),t.validate){if(e.output){if(p(e.output),!s.Number(d[0]))throw new TypeError("Output is invalid");if(!s.Number(d[d.length-2]))throw new TypeError("Output is invalid");if(d[d.length-1]!==a.OP_CHECKMULTISIG)throw new TypeError("Output is invalid");if(l.m<=0||l.n>16||l.m>l.n||l.n!==d.length-3)throw new TypeError("Output is invalid");if(!l.pubkeys.every(e=>u.isPoint(e)))throw new TypeError("Output is invalid");if(void 0!==e.m&&e.m!==l.m)throw new TypeError("m mismatch");if(void 0!==e.n&&e.n!==l.n)throw new TypeError("n mismatch");if(e.pubkeys&&!f(e.pubkeys,l.pubkeys))throw new TypeError("Pubkeys mismatch")}if(e.pubkeys){if(void 0!==e.n&&e.n!==e.pubkeys.length)throw new TypeError("Pubkey count mismatch");if(l.n=e.pubkeys.length,l.n<l.m)throw new TypeError("Pubkey count cannot be less than m")}if(e.signatures){if(e.signatures.length<l.m)throw new TypeError("Not enough signatures provided");if(e.signatures.length>l.m)throw new TypeError("Too many signatures provided")}if(e.input){if(e.input[0]!==a.OP_0)throw new TypeError("Input is invalid");if(0===l.signatures.length||!l.signatures.every(r))throw new TypeError("Input has invalid signature(s)");if(e.signatures&&!f(e.signatures,l.signatures))throw new TypeError("Signature mismatch");if(void 0!==e.m&&e.m!==e.signatures.length)throw new TypeError("Signature count mismatch")}}return Object.assign(l,e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(12),i=r(1),o=r(26),a=r(3),s=i.OPS,u=r(25);t.p2pk=function(e,t){if(!(e.input||e.output||e.pubkey||e.input||e.signature))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),a({network:a.maybe(a.Object),output:a.maybe(a.Buffer),pubkey:a.maybe(u.isPoint),signature:a.maybe(i.isCanonicalScriptSignature),input:a.maybe(a.Buffer)},e);const r=o.value(()=>i.decompile(e.input)),c={name:"p2pk",network:e.network||n.bitcoin};if(o.prop(c,"output",()=>{if(e.pubkey)return i.compile([e.pubkey,s.OP_CHECKSIG])}),o.prop(c,"pubkey",()=>{if(e.output)return e.output.slice(1,-1)}),o.prop(c,"signature",()=>{if(e.input)return r()[0]}),o.prop(c,"input",()=>{if(e.signature)return i.compile([e.signature])}),o.prop(c,"witness",()=>{if(c.input)return[]}),t.validate){if(e.output){if(e.output[e.output.length-1]!==s.OP_CHECKSIG)throw new TypeError("Output is invalid");if(!u.isPoint(c.pubkey))throw new TypeError("Output pubkey is invalid");if(e.pubkey&&!e.pubkey.equals(c.pubkey))throw new TypeError("Pubkey mismatch")}if(e.signature&&e.input&&!e.input.equals(c.input))throw new TypeError("Signature mismatch");if(e.input){if(1!==r().length)throw new TypeError("Input is invalid");if(!i.isCanonicalScriptSignature(c.signature))throw new TypeError("Input has invalid signature")}}return Object.assign(c,e)}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(19),i=r(12),o=r(1),a=r(26),s=r(3),u=o.OPS,c=r(25),f=r(39);t.p2pkh=function(t,r){if(!(t.address||t.hash||t.output||t.pubkey||t.input))throw new TypeError("Not enough data");r=Object.assign({validate:!0},r||{}),s({network:s.maybe(s.Object),address:s.maybe(s.String),hash:s.maybe(s.BufferN(20)),output:s.maybe(s.BufferN(25)),pubkey:s.maybe(c.isPoint),signature:s.maybe(o.isCanonicalScriptSignature),input:s.maybe(s.Buffer)},t);const l=a.value(()=>{const e=f.decode(t.address);return{version:e.readUInt8(0),hash:e.slice(1)}}),d=a.value(()=>o.decompile(t.input)),h=t.network||i.bitcoin,p={name:"p2pkh",network:h};if(a.prop(p,"address",()=>{if(!p.hash)return;const t=e.allocUnsafe(21);return t.writeUInt8(h.pubKeyHash,0),p.hash.copy(t,1),f.encode(t)}),a.prop(p,"hash",()=>t.output?t.output.slice(3,23):t.address?l().hash:t.pubkey||p.pubkey?n.hash160(t.pubkey||p.pubkey):void 0),a.prop(p,"output",()=>{if(p.hash)return o.compile([u.OP_DUP,u.OP_HASH160,p.hash,u.OP_EQUALVERIFY,u.OP_CHECKSIG])}),a.prop(p,"pubkey",()=>{if(t.input)return d()[1]}),a.prop(p,"signature",()=>{if(t.input)return d()[0]}),a.prop(p,"input",()=>{if(t.pubkey&&t.signature)return o.compile([t.signature,t.pubkey])}),a.prop(p,"witness",()=>{if(p.input)return[]}),r.validate){let r=e.from([]);if(t.address){if(l().version!==h.pubKeyHash)throw new TypeError("Invalid version or Network mismatch");if(20!==l().hash.length)throw new TypeError("Invalid address");r=l().hash}if(t.hash){if(r.length>0&&!r.equals(t.hash))throw new TypeError("Hash mismatch");r=t.hash}if(t.output){if(25!==t.output.length||t.output[0]!==u.OP_DUP||t.output[1]!==u.OP_HASH160||20!==t.output[2]||t.output[23]!==u.OP_EQUALVERIFY||t.output[24]!==u.OP_CHECKSIG)throw new TypeError("Output is invalid");const e=t.output.slice(3,23);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch");r=e}if(t.pubkey){const e=n.hash160(t.pubkey);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch");r=e}if(t.input){const e=d();if(2!==e.length)throw new TypeError("Input is invalid");if(!o.isCanonicalScriptSignature(e[0]))throw new TypeError("Input has invalid signature");if(!c.isPoint(e[1]))throw new TypeError("Input has invalid pubkey");if(t.signature&&!t.signature.equals(e[0]))throw new TypeError("Signature mismatch");if(t.pubkey&&!t.pubkey.equals(e[1]))throw new TypeError("Pubkey mismatch");const i=n.hash160(e[1]);if(r.length>0&&!r.equals(i))throw new TypeError("Hash mismatch")}}return Object.assign(p,t)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(19),i=r(12),o=r(1),a=r(26),s=r(3),u=o.OPS,c=r(39);t.p2sh=function(t,r){if(!(t.address||t.hash||t.output||t.redeem||t.input))throw new TypeError("Not enough data");r=Object.assign({validate:!0},r||{}),s({network:s.maybe(s.Object),address:s.maybe(s.String),hash:s.maybe(s.BufferN(20)),output:s.maybe(s.BufferN(23)),redeem:s.maybe({network:s.maybe(s.Object),output:s.maybe(s.Buffer),input:s.maybe(s.Buffer),witness:s.maybe(s.arrayOf(s.Buffer))}),input:s.maybe(s.Buffer),witness:s.maybe(s.arrayOf(s.Buffer))},t);let f=t.network;f||(f=t.redeem&&t.redeem.network||i.bitcoin);const l={network:f},d=a.value(()=>{const e=c.decode(t.address);return{version:e.readUInt8(0),hash:e.slice(1)}}),h=a.value(()=>o.decompile(t.input)),p=a.value(()=>{const e=h();return{network:f,output:e[e.length-1],input:o.compile(e.slice(0,-1)),witness:t.witness||[]}});if(a.prop(l,"address",()=>{if(!l.hash)return;const t=e.allocUnsafe(21);return t.writeUInt8(l.network.scriptHash,0),l.hash.copy(t,1),c.encode(t)}),a.prop(l,"hash",()=>t.output?t.output.slice(2,22):t.address?d().hash:l.redeem&&l.redeem.output?n.hash160(l.redeem.output):void 0),a.prop(l,"output",()=>{if(l.hash)return o.compile([u.OP_HASH160,l.hash,u.OP_EQUAL])}),a.prop(l,"redeem",()=>{if(t.input)return p()}),a.prop(l,"input",()=>{if(t.redeem&&t.redeem.input&&t.redeem.output)return o.compile([].concat(o.decompile(t.redeem.input),t.redeem.output))}),a.prop(l,"witness",()=>l.redeem&&l.redeem.witness?l.redeem.witness:l.input?[]:void 0),a.prop(l,"name",()=>{const e=["p2sh"];return void 0!==l.redeem&&e.push(l.redeem.name),e.join("-")}),r.validate){let r=e.from([]);if(t.address){if(d().version!==f.scriptHash)throw new TypeError("Invalid version or Network mismatch");if(20!==d().hash.length)throw new TypeError("Invalid address");r=d().hash}if(t.hash){if(r.length>0&&!r.equals(t.hash))throw new TypeError("Hash mismatch");r=t.hash}if(t.output){if(23!==t.output.length||t.output[0]!==u.OP_HASH160||20!==t.output[1]||t.output[22]!==u.OP_EQUAL)throw new TypeError("Output is invalid");const e=t.output.slice(2,22);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch");r=e}const i=e=>{if(e.output){const t=o.decompile(e.output);if(!t||t.length<1)throw new TypeError("Redeem.output too short");const i=n.hash160(e.output);if(r.length>0&&!r.equals(i))throw new TypeError("Hash mismatch");r=i}if(e.input){const t=e.input.length>0,r=e.witness&&e.witness.length>0;if(!t&&!r)throw new TypeError("Empty input");if(t&&r)throw new TypeError("Input and witness provided");if(t){const t=o.decompile(e.input);if(!o.isPushOnly(t))throw new TypeError("Non push-only scriptSig")}}};if(t.input){const t=h();if(!t||t.length<1)throw new TypeError("Input too short");if(!e.isBuffer(p().output))throw new TypeError("Input is invalid");i(p())}if(t.redeem){if(t.redeem.network&&t.redeem.network!==f)throw new TypeError("Network mismatch");if(t.input){const e=p();if(t.redeem.output&&!t.redeem.output.equals(e.output))throw new TypeError("Redeem.output mismatch");if(t.redeem.input&&!t.redeem.input.equals(e.input))throw new TypeError("Redeem.input mismatch")}i(t.redeem)}if(t.witness&&t.redeem&&t.redeem.witness&&!function(e,t){return e.length===t.length&&e.every((e,r)=>e.equals(t[r]))}(t.redeem.witness,t.witness))throw new TypeError("Witness and redeem.witness mismatch")}return Object.assign(l,t)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(19),i=r(12),o=r(1),a=r(26),s=r(3),u=o.OPS,c=r(25),f=r(81),l=e.alloc(0);t.p2wpkh=function(t,r){if(!(t.address||t.hash||t.output||t.pubkey||t.witness))throw new TypeError("Not enough data");r=Object.assign({validate:!0},r||{}),s({address:s.maybe(s.String),hash:s.maybe(s.BufferN(20)),input:s.maybe(s.BufferN(0)),network:s.maybe(s.Object),output:s.maybe(s.BufferN(22)),pubkey:s.maybe(c.isPoint),signature:s.maybe(o.isCanonicalScriptSignature),witness:s.maybe(s.arrayOf(s.Buffer))},t);const d=a.value(()=>{const r=f.decode(t.address),n=r.words.shift(),i=f.fromWords(r.words);return{version:n,prefix:r.prefix,data:e.from(i)}}),h=t.network||i.bitcoin,p={name:"p2wpkh",network:h};if(a.prop(p,"address",()=>{if(!p.hash)return;const e=f.toWords(p.hash);return e.unshift(0),f.encode(h.bech32,e)}),a.prop(p,"hash",()=>t.output?t.output.slice(2,22):t.address?d().data:t.pubkey||p.pubkey?n.hash160(t.pubkey||p.pubkey):void 0),a.prop(p,"output",()=>{if(p.hash)return o.compile([u.OP_0,p.hash])}),a.prop(p,"pubkey",()=>t.pubkey?t.pubkey:t.witness?t.witness[1]:void 0),a.prop(p,"signature",()=>{if(t.witness)return t.witness[0]}),a.prop(p,"input",()=>{if(p.witness)return l}),a.prop(p,"witness",()=>{if(t.pubkey&&t.signature)return[t.signature,t.pubkey]}),r.validate){let r=e.from([]);if(t.address){if(h&&h.bech32!==d().prefix)throw new TypeError("Invalid prefix or Network mismatch");if(0!==d().version)throw new TypeError("Invalid address version");if(20!==d().data.length)throw new TypeError("Invalid address data");r=d().data}if(t.hash){if(r.length>0&&!r.equals(t.hash))throw new TypeError("Hash mismatch");r=t.hash}if(t.output){if(22!==t.output.length||t.output[0]!==u.OP_0||20!==t.output[1])throw new TypeError("Output is invalid");if(r.length>0&&!r.equals(t.output.slice(2)))throw new TypeError("Hash mismatch");r=t.output.slice(2)}if(t.pubkey){const e=n.hash160(t.pubkey);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch");if(r=e,!c.isPoint(t.pubkey)||33!==t.pubkey.length)throw new TypeError("Invalid pubkey for p2wpkh")}if(t.witness){if(2!==t.witness.length)throw new TypeError("Witness is invalid");if(!o.isCanonicalScriptSignature(t.witness[0]))throw new TypeError("Witness has invalid signature");if(!c.isPoint(t.witness[1])||33!==t.witness[1].length)throw new TypeError("Witness has invalid pubkey");if(t.signature&&!t.signature.equals(t.witness[0]))throw new TypeError("Signature mismatch");if(t.pubkey&&!t.pubkey.equals(t.witness[1]))throw new TypeError("Pubkey mismatch");const e=n.hash160(t.witness[1]);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch")}}return Object.assign(p,t)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(19),i=r(12),o=r(1),a=r(26),s=r(3),u=o.OPS,c=r(25),f=r(81),l=e.alloc(0);function d(t){return!(!e.isBuffer(t)||65!==t.length||4!==t[0]||!c.isPoint(t))}t.p2wsh=function(t,r){if(!(t.address||t.hash||t.output||t.redeem||t.witness))throw new TypeError("Not enough data");r=Object.assign({validate:!0},r||{}),s({network:s.maybe(s.Object),address:s.maybe(s.String),hash:s.maybe(s.BufferN(32)),output:s.maybe(s.BufferN(34)),redeem:s.maybe({input:s.maybe(s.Buffer),network:s.maybe(s.Object),output:s.maybe(s.Buffer),witness:s.maybe(s.arrayOf(s.Buffer))}),input:s.maybe(s.BufferN(0)),witness:s.maybe(s.arrayOf(s.Buffer))},t);const c=a.value(()=>{const r=f.decode(t.address),n=r.words.shift(),i=f.fromWords(r.words);return{version:n,prefix:r.prefix,data:e.from(i)}}),h=a.value(()=>o.decompile(t.redeem.input));let p=t.network;p||(p=t.redeem&&t.redeem.network||i.bitcoin);const b={network:p};if(a.prop(b,"address",()=>{if(!b.hash)return;const e=f.toWords(b.hash);return e.unshift(0),f.encode(p.bech32,e)}),a.prop(b,"hash",()=>t.output?t.output.slice(2):t.address?c().data:b.redeem&&b.redeem.output?n.sha256(b.redeem.output):void 0),a.prop(b,"output",()=>{if(b.hash)return o.compile([u.OP_0,b.hash])}),a.prop(b,"redeem",()=>{if(t.witness)return{output:t.witness[t.witness.length-1],input:l,witness:t.witness.slice(0,-1)}}),a.prop(b,"input",()=>{if(b.witness)return l}),a.prop(b,"witness",()=>{if(t.redeem&&t.redeem.input&&t.redeem.input.length>0&&t.redeem.output&&t.redeem.output.length>0){const e=o.toStack(h());return b.redeem=Object.assign({witness:e},t.redeem),b.redeem.input=l,[].concat(e,t.redeem.output)}if(t.redeem&&t.redeem.output&&t.redeem.witness)return[].concat(t.redeem.witness,t.redeem.output)}),a.prop(b,"name",()=>{const e=["p2wsh"];return void 0!==b.redeem&&e.push(b.redeem.name),e.join("-")}),r.validate){let r=e.from([]);if(t.address){if(c().prefix!==p.bech32)throw new TypeError("Invalid prefix or Network mismatch");if(0!==c().version)throw new TypeError("Invalid address version");if(32!==c().data.length)throw new TypeError("Invalid address data");r=c().data}if(t.hash){if(r.length>0&&!r.equals(t.hash))throw new TypeError("Hash mismatch");r=t.hash}if(t.output){if(34!==t.output.length||t.output[0]!==u.OP_0||32!==t.output[1])throw new TypeError("Output is invalid");const e=t.output.slice(2);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch");r=e}if(t.redeem){if(t.redeem.network&&t.redeem.network!==p)throw new TypeError("Network mismatch");if(t.redeem.input&&t.redeem.input.length>0&&t.redeem.witness&&t.redeem.witness.length>0)throw new TypeError("Ambiguous witness source");if(t.redeem.output){if(0===o.decompile(t.redeem.output).length)throw new TypeError("Redeem.output is invalid");const e=n.sha256(t.redeem.output);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch");r=e}if(t.redeem.input&&!o.isPushOnly(h()))throw new TypeError("Non push-only scriptSig");if(t.witness&&t.redeem.witness&&!function(e,t){return e.length===t.length&&e.every((e,r)=>e.equals(t[r]))}(t.witness,t.redeem.witness))throw new TypeError("Witness and redeem.witness mismatch");if(t.redeem.input&&h().some(d)||t.redeem.output&&(o.decompile(t.redeem.output)||[]).some(d))throw new TypeError("redeem.input or redeem.output contains uncompressed pubkey")}if(t.witness&&t.witness.length>0){const e=t.witness[t.witness.length-1];if(t.redeem&&t.redeem.output&&!t.redeem.output.equals(e))throw new TypeError("Witness and redeem.output mismatch");if(t.witness.some(d)||(o.decompile(e)||[]).some(d))throw new TypeError("Witness contains uncompressed pubkey")}}return Object.assign(b,t)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(t,n){var i=r(4).Buffer,o=t.crypto||t.msCrypto;o&&o.getRandomValues?e.exports=function(e,t){if(e>4294967295)throw new RangeError("requested too many random bytes");var r=i.allocUnsafe(e);if(e>0)if(e>65536)for(var a=0;a<e;a+=65536)o.getRandomValues(r.slice(a,a+65536));else o.getRandomValues(r);if("function"==typeof t)return n.nextTick((function(){t(null,r)}));return r}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,r(17),r(10))},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(51),i=r(19),o=r(52),a=r(16),s=r(126),u=r(3),c=r(37),f=new TypeError("Cannot compute merkle root for zero transactions"),l=new TypeError("Cannot compute witness commit for non-segwit block");class d{constructor(){this.version=1,this.prevHash=void 0,this.merkleRoot=void 0,this.timestamp=0,this.witnessCommit=void 0,this.bits=0,this.nonce=0,this.transactions=void 0}static fromBuffer(e){if(e.length<80)throw new Error("Buffer too small (< 80 bytes)");const t=new n.BufferReader(e),r=new d;if(r.version=t.readInt32(),r.prevHash=t.readSlice(32),r.merkleRoot=t.readSlice(32),r.timestamp=t.readUInt32(),r.bits=t.readUInt32(),r.nonce=t.readUInt32(),80===e.length)return r;const i=()=>{const e=o.Transaction.fromBuffer(t.buffer.slice(t.offset),!0);return t.offset+=e.byteLength(),e},a=t.readVarInt();r.transactions=[];for(let e=0;e<a;++e){const e=i();r.transactions.push(e)}const s=r.getWitnessCommit();return s&&(r.witnessCommit=s),r}static fromHex(t){return d.fromBuffer(e.from(t,"hex"))}static calculateTarget(t){const r=((4278190080&t)>>24)-3,n=8388607&t,i=e.alloc(32,0);return i.writeUIntBE(n,29-r,3),i}static calculateMerkleRoot(t,r){if(u([{getHash:a.Function}],t),0===t.length)throw f;if(r&&!h(t))throw l;const n=t.map(e=>e.getHash(r)),o=s(n,i.hash256);return r?i.hash256(e.concat([o,t[0].ins[0].witness[0]])):o}getWitnessCommit(){if(!h(this.transactions))return null;const t=this.transactions[0].outs.filter(t=>t.script.slice(0,6).equals(e.from("6a24aa21a9ed","hex"))).map(e=>e.script.slice(6,38));if(0===t.length)return null;const r=t[t.length-1];return r instanceof e&&32===r.length?r:null}hasWitnessCommit(){return this.witnessCommit instanceof e&&32===this.witnessCommit.length||null!==this.getWitnessCommit()}hasWitness(){return(e=this.transactions)instanceof Array&&e.some(e=>"object"==typeof e&&e.ins instanceof Array&&e.ins.some(e=>"object"==typeof e&&e.witness instanceof Array&&e.witness.length>0));var e}weight(){return 3*this.byteLength(!1,!1)+this.byteLength(!1,!0)}byteLength(e,t=!0){return e||!this.transactions?80:80+c.encodingLength(this.transactions.length)+this.transactions.reduce((e,r)=>e+r.byteLength(t),0)}getHash(){return i.hash256(this.toBuffer(!0))}getId(){return n.reverseBuffer(this.getHash()).toString("hex")}getUTCDate(){const e=new Date(0);return e.setUTCSeconds(this.timestamp),e}toBuffer(t){const r=e.allocUnsafe(this.byteLength(t)),i=new n.BufferWriter(r);return i.writeInt32(this.version),i.writeSlice(this.prevHash),i.writeSlice(this.merkleRoot),i.writeUInt32(this.timestamp),i.writeUInt32(this.bits),i.writeUInt32(this.nonce),t||!this.transactions||(c.encode(this.transactions.length,r,i.offset),i.offset+=c.encode.bytes,this.transactions.forEach(e=>{const t=e.byteLength();e.toBuffer(r,i.offset),i.offset+=t})),r}toHex(e){return this.toBuffer(e).toString("hex")}checkTxRoots(){const e=this.hasWitnessCommit();return!(!e&&this.hasWitness())&&(this.__checkMerkleRoot()&&(!e||this.__checkWitnessCommit()))}checkProofOfWork(){const e=n.reverseBuffer(this.getHash()),t=d.calculateTarget(this.bits);return e.compare(t)<=0}__checkMerkleRoot(){if(!this.transactions)throw f;const e=d.calculateMerkleRoot(this.transactions);return 0===this.merkleRoot.compare(e)}__checkWitnessCommit(){if(!this.transactions)throw f;if(!this.hasWitnessCommit())throw l;const e=d.calculateMerkleRoot(this.transactions,!0);return 0===this.witnessCommit.compare(e)}}function h(e){return e instanceof Array&&e[0]&&e[0].ins&&e[0].ins instanceof Array&&e[0].ins[0]&&e[0].ins[0].witness&&e[0].ins[0].witness instanceof Array&&e[0].ins[0].witness.length>0}t.Block=d}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(93),i=r(22),o=r(66),a=r(79),s=r(51),u=r(19),c=r(82),f=r(12),l=r(50),d=r(1),h=r(52),p={network:f.bitcoin,maximumFeeRate:5e3};class b{constructor(e={},t=new n.Psbt(new g)){this.data=t,this.opts=Object.assign({},p,e),this.__CACHE={__NON_WITNESS_UTXO_TX_CACHE:[],__NON_WITNESS_UTXO_BUF_CACHE:[],__TX_IN_CACHE:{},__TX:this.data.globalMap.unsignedTx.tx,__UNSAFE_SIGN_NONSEGWIT:!1},0===this.data.inputs.length&&this.setVersion(2);const r=(e,t,r,n)=>Object.defineProperty(e,t,{enumerable:r,writable:n});r(this,"__CACHE",!1,!0),r(this,"opts",!1,!0)}static fromBase64(t,r={}){const n=e.from(t,"base64");return this.fromBuffer(n,r)}static fromHex(t,r={}){const n=e.from(t,"hex");return this.fromBuffer(n,r)}static fromBuffer(e,t={}){const r=n.Psbt.fromBuffer(e,m),i=new b(t,r);var o,a;return o=i.__CACHE.__TX,a=i.__CACHE,o.ins.forEach(e=>{M(a,e)}),i}get inputCount(){return this.data.inputs.length}get version(){return this.__CACHE.__TX.version}set version(e){this.setVersion(e)}get locktime(){return this.__CACHE.__TX.locktime}set locktime(e){this.setLocktime(e)}get txInputs(){return this.__CACHE.__TX.ins.map(e=>({hash:s.cloneBuffer(e.hash),index:e.index,sequence:e.sequence}))}get txOutputs(){return this.__CACHE.__TX.outs.map(e=>{let t;try{t=a.fromOutputScript(e.script,this.opts.network)}catch(e){}return{script:s.cloneBuffer(e.script),value:e.value,address:t}})}combine(...e){return this.data.combine(...e.map(e=>e.data)),this}clone(){const e=b.fromBuffer(this.data.toBuffer());return e.opts=JSON.parse(JSON.stringify(this.opts)),e}setMaximumFeeRate(e){O(e),this.opts.maximumFeeRate=e}setVersion(e){O(e),I(this.data.inputs,"setVersion");const t=this.__CACHE;return t.__TX.version=e,t.__EXTRACTED_TX=void 0,this}setLocktime(e){O(e),I(this.data.inputs,"setLocktime");const t=this.__CACHE;return t.__TX.locktime=e,t.__EXTRACTED_TX=void 0,this}setInputSequence(e,t){O(t),I(this.data.inputs,"setInputSequence");const r=this.__CACHE;if(r.__TX.ins.length<=e)throw new Error("Input index too high");return r.__TX.ins[e].sequence=t,r.__EXTRACTED_TX=void 0,this}addInputs(e){return e.forEach(e=>this.addInput(e)),this}addInput(e){if(arguments.length>1||!e||void 0===e.hash||void 0===e.index)throw new Error("Invalid arguments for Psbt.addInput. Requires single object with at least [hash] and [index]");I(this.data.inputs,"addInput"),e.witnessScript&&Y(e.witnessScript);const t=this.__CACHE;this.data.addInput(e);M(t,t.__TX.ins[t.__TX.ins.length-1]);const r=this.data.inputs.length-1,n=this.data.inputs[r];return n.nonWitnessUtxo&&q(this.__CACHE,n,r),t.__FEE=void 0,t.__FEE_RATE=void 0,t.__EXTRACTED_TX=void 0,this}addOutputs(e){return e.forEach(e=>this.addOutput(e)),this}addOutput(e){if(arguments.length>1||!e||void 0===e.value||void 0===e.address&&void 0===e.script)throw new Error("Invalid arguments for Psbt.addOutput. Requires single object with at least [script or address] and [value]");I(this.data.inputs,"addOutput");const{address:t}=e;if("string"==typeof t){const{network:r}=this.opts,n=a.toOutputScript(t,r);e=Object.assign(e,{script:n})}const r=this.__CACHE;return this.data.addOutput(e),r.__FEE=void 0,r.__FEE_RATE=void 0,r.__EXTRACTED_TX=void 0,this}extractTransaction(e){if(!this.data.inputs.every(w))throw new Error("Not finalized");const t=this.__CACHE;if(e||function(e,t,r){const n=t.__FEE_RATE||e.getFeeRate(),i=t.__EXTRACTED_TX.virtualSize(),o=n*i;if(n>=r.maximumFeeRate)throw new Error(`Warning: You are paying around ${(o/1e8).toFixed(8)} in fees, which is ${n} satoshi per byte for a transaction with a VSize of ${i} bytes (segwit counted as 0.25 byte per byte). Use setMaximumFeeRate method to raise your threshold, or pass true to the first arg of extractTransaction.`)}(this,t,this.opts),t.__EXTRACTED_TX)return t.__EXTRACTED_TX;const r=t.__TX.clone();return K(this.data.inputs,r,t,!0),r}getFeeRate(){return U("__FEE_RATE","fee rate",this.data.inputs,this.__CACHE)}getFee(){return U("__FEE","fee",this.data.inputs,this.__CACHE)}finalizeAllInputs(){return o.checkForInput(this.data.inputs,0),Q(this.data.inputs.length).forEach(e=>this.finalizeInput(e)),this}finalizeInput(e,t=C){const r=o.checkForInput(this.data.inputs,e),{script:n,isP2SH:i,isP2WSH:a,isSegwit:s}=function(e,t,r){const n=r.__TX,i={script:null,isSegwit:!1,isP2SH:!1,isP2WSH:!1};if(i.isP2SH=!!t.redeemScript,i.isP2WSH=!!t.witnessScript,t.witnessScript)i.script=t.witnessScript;else if(t.redeemScript)i.script=t.redeemScript;else if(t.nonWitnessUtxo){const o=W(r,t,e),a=n.ins[e].index;i.script=o.outs[a].script}else t.witnessUtxo&&(i.script=t.witnessUtxo.script);(t.witnessScript||x(i.script))&&(i.isSegwit=!0);return i}(e,r,this.__CACHE);if(!n)throw new Error("No script found for input #"+e);!function(e){if(!e.sighashType||!e.partialSig)return;const{partialSig:t,sighashType:r}=e;t.forEach(e=>{const{hashType:t}=d.signature.decode(e.signature);if(r!==t)throw new Error("Signature sighash does not match input sighash type")})}(r);const{finalScriptSig:u,finalScriptWitness:c}=t(e,r,n,s,i,a);if(u&&this.data.updateInput(e,{finalScriptSig:u}),c&&this.data.updateInput(e,{finalScriptWitness:c}),!u&&!c)throw new Error("Unknown error finalizing input #"+e);return this.data.clearFinalizedInput(e),this}getInputType(t){const r=o.checkForInput(this.data.inputs,t),n=X(V(t,r,this.__CACHE),t,"input",r.redeemScript||function(t){if(!t)return;const r=d.decompile(t);if(!r)return;const n=r[r.length-1];if(!e.isBuffer(n)||G(n)||(i=n,d.isCanonicalScriptSignature(i)))return;var i;if(!d.decompile(n))return;return n}(r.finalScriptSig),r.witnessScript||function(e){if(!e)return;const t=D(e),r=t[t.length-1];if(G(r))return;if(!d.decompile(r))return;return r}(r.finalScriptWitness));return("raw"===n.type?"":n.type+"-")+J(n.meaningfulScript)}inputHasPubkey(e,t){return function(e,t,r,n){const i=V(r,t,n),{meaningfulScript:o}=X(i,r,"input",t.redeemScript,t.witnessScript);return $(e,o)}(t,o.checkForInput(this.data.inputs,e),e,this.__CACHE)}inputHasHDKey(e,t){const r=o.checkForInput(this.data.inputs,e),n=P(t);return!!r.bip32Derivation&&r.bip32Derivation.some(n)}outputHasPubkey(e,t){return function(e,t,r,n){const i=n.__TX.outs[r].script,{meaningfulScript:o}=X(i,r,"output",t.redeemScript,t.witnessScript);return $(e,o)}(t,o.checkForOutput(this.data.outputs,e),e,this.__CACHE)}outputHasHDKey(e,t){const r=o.checkForOutput(this.data.outputs,e),n=P(t);return!!r.bip32Derivation&&r.bip32Derivation.some(n)}validateSignaturesOfAllInputs(){o.checkForInput(this.data.inputs,0);return Q(this.data.inputs.length).map(e=>this.validateSignaturesOfInput(e)).reduce((e,t)=>!0===t&&e,!0)}validateSignaturesOfInput(e,t){const r=this.data.inputs[e],n=(r||{}).partialSig;if(!r||!n||n.length<1)throw new Error("No signatures to validate");const i=t?n.filter(e=>e.pubkey.equals(t)):n;if(i.length<1)throw new Error("No signatures for this pubkey");const o=[];let a,s,u;for(const t of i){const n=d.signature.decode(t.signature),{hash:i,script:f}=u!==n.hashType?z(e,Object.assign({},r,{sighashType:n.hashType}),this.__CACHE,!0):{hash:a,script:s};u=n.hashType,a=i,s=f,B(t.pubkey,f,"verify");const l=c.fromPublicKey(t.pubkey);o.push(l.verify(i,n.signature))}return o.every(e=>!0===e)}signAllInputsHD(e,t=[h.Transaction.SIGHASH_ALL]){if(!e||!e.publicKey||!e.fingerprint)throw new Error("Need HDSigner to sign input");const r=[];for(const n of Q(this.data.inputs.length))try{this.signInputHD(n,e,t),r.push(!0)}catch(e){r.push(!1)}if(r.every(e=>!1===e))throw new Error("No inputs were signed");return this}signAllInputsHDAsync(e,t=[h.Transaction.SIGHASH_ALL]){return new Promise((r,n)=>{if(!e||!e.publicKey||!e.fingerprint)return n(new Error("Need HDSigner to sign input"));const i=[],o=[];for(const r of Q(this.data.inputs.length))o.push(this.signInputHDAsync(r,e,t).then(()=>{i.push(!0)},()=>{i.push(!1)}));return Promise.all(o).then(()=>{if(i.every(e=>!1===e))return n(new Error("No inputs were signed"));r()})})}signInputHD(e,t,r=[h.Transaction.SIGHASH_ALL]){if(!t||!t.publicKey||!t.fingerprint)throw new Error("Need HDSigner to sign input");return L(e,this.data.inputs,t).forEach(t=>this.signInput(e,t,r)),this}signInputHDAsync(e,t,r=[h.Transaction.SIGHASH_ALL]){return new Promise((n,i)=>{if(!t||!t.publicKey||!t.fingerprint)return i(new Error("Need HDSigner to sign input"));const o=L(e,this.data.inputs,t).map(t=>this.signInputAsync(e,t,r));return Promise.all(o).then(()=>{n()}).catch(i)})}signAllInputs(e,t=[h.Transaction.SIGHASH_ALL]){if(!e||!e.publicKey)throw new Error("Need Signer to sign input");const r=[];for(const n of Q(this.data.inputs.length))try{this.signInput(n,e,t),r.push(!0)}catch(e){r.push(!1)}if(r.every(e=>!1===e))throw new Error("No inputs were signed");return this}signAllInputsAsync(e,t=[h.Transaction.SIGHASH_ALL]){return new Promise((r,n)=>{if(!e||!e.publicKey)return n(new Error("Need Signer to sign input"));const i=[],o=[];for(const[r]of this.data.inputs.entries())o.push(this.signInputAsync(r,e,t).then(()=>{i.push(!0)},()=>{i.push(!1)}));return Promise.all(o).then(()=>{if(i.every(e=>!1===e))return n(new Error("No inputs were signed"));r()})})}signInput(e,t,r=[h.Transaction.SIGHASH_ALL]){if(!t||!t.publicKey)throw new Error("Need Signer to sign input");const{hash:n,sighashType:i}=H(this.data.inputs,e,t.publicKey,this.__CACHE,r),o=[{pubkey:t.publicKey,signature:d.signature.encode(t.sign(n),i)}];return this.data.updateInput(e,{partialSig:o}),this}signInputAsync(e,t,r=[h.Transaction.SIGHASH_ALL]){return Promise.resolve().then(()=>{if(!t||!t.publicKey)throw new Error("Need Signer to sign input");const{hash:n,sighashType:i}=H(this.data.inputs,e,t.publicKey,this.__CACHE,r);return Promise.resolve(t.sign(n)).then(r=>{const n=[{pubkey:t.publicKey,signature:d.signature.encode(r,i)}];this.data.updateInput(e,{partialSig:n})})})}toBuffer(){return y(this.__CACHE),this.data.toBuffer()}toHex(){return y(this.__CACHE),this.data.toHex()}toBase64(){return y(this.__CACHE),this.data.toBase64()}updateGlobal(e){return this.data.updateGlobal(e),this}updateInput(e,t){return t.witnessScript&&Y(t.witnessScript),this.data.updateInput(e,t),t.nonWitnessUtxo&&q(this.__CACHE,this.data.inputs[e],e),this}updateOutput(e,t){return this.data.updateOutput(e,t),this}addUnknownKeyValToGlobal(e){return this.data.addUnknownKeyValToGlobal(e),this}addUnknownKeyValToInput(e,t){return this.data.addUnknownKeyValToInput(e,t),this}addUnknownKeyValToOutput(e,t){return this.data.addUnknownKeyValToOutput(e,t),this}clearFinalizedInput(e){return this.data.clearFinalizedInput(e),this}}t.Psbt=b;const m=e=>new g(e);class g{constructor(t=e.from([2,0,0,0,0,0,0,0,0,0])){this.tx=h.Transaction.fromBuffer(t),function(e){if(!e.ins.every(e=>e.script&&0===e.script.length&&e.witness&&0===e.witness.length))throw new Error("Format Error: Transaction ScriptSigs are not empty")}(this.tx),Object.defineProperty(this,"tx",{enumerable:!1,writable:!0})}getInputOutputCounts(){return{inputCount:this.tx.ins.length,outputCount:this.tx.outs.length}}addInput(t){if(void 0===t.hash||void 0===t.index||!e.isBuffer(t.hash)&&"string"!=typeof t.hash||"number"!=typeof t.index)throw new Error("Error adding input.");const r="string"==typeof t.hash?s.reverseBuffer(e.from(t.hash,"hex")):t.hash;this.tx.addInput(r,t.index,t.sequence)}addOutput(t){if(void 0===t.script||void 0===t.value||!e.isBuffer(t.script)||"number"!=typeof t.value)throw new Error("Error adding output.");this.tx.addOutput(t.script,t.value)}toBuffer(){return this.tx.toBuffer()}}function y(e){if(!1!==e.__UNSAFE_SIGN_NONSEGWIT)throw new Error("Not BIP174 compliant, can not export")}function v(e,t,r){if(!t)return!1;let n;if(n=r?r.map(e=>{const r=c.fromPublicKey(e,{compressed:!0}).publicKey;return t.find(e=>e.pubkey.equals(r))}).filter(e=>!!e):t,n.length>e)throw new Error("Too many signatures");return n.length===e}function w(e){return!!e.finalScriptSig||!!e.finalScriptWitness}function _(e){return t=>{try{return e({output:t}),!0}catch(e){return!1}}}const E=_(l.p2ms),k=_(l.p2pk),S=_(l.p2pkh),x=_(l.p2wpkh),T=_(l.p2wsh),A=_(l.p2sh);function P(e){return t=>!!t.masterFingerprint.equals(e.fingerprint)&&!!e.derivePath(t.path).publicKey.equals(t.pubkey)}function O(e){if("number"!=typeof e||e!==Math.floor(e)||e>4294967295||e<0)throw new Error("Invalid 32 bit integer")}function I(t,r){t.forEach(t=>{let n=!1,i=[];if(0===(t.partialSig||[]).length){if(!t.finalScriptSig&&!t.finalScriptWitness)return;i=function(t){const r=t.finalScriptSig&&d.decompile(t.finalScriptSig)||[],n=t.finalScriptWitness&&d.decompile(t.finalScriptWitness)||[];return r.concat(n).filter(t=>e.isBuffer(t)&&d.isCanonicalScriptSignature(t)).map(e=>({signature:e}))}(t)}else i=t.partialSig;if(i.forEach(e=>{const{hashType:t}=d.signature.decode(e.signature),i=[];t&h.Transaction.SIGHASH_ANYONECANPAY&&i.push("addInput");switch(31&t){case h.Transaction.SIGHASH_ALL:break;case h.Transaction.SIGHASH_SINGLE:case h.Transaction.SIGHASH_NONE:i.push("addOutput"),i.push("setInputSequence")}-1===i.indexOf(r)&&(n=!0)}),n)throw new Error("Can not modify transaction, signatures exist.")})}function B(e,t,r){if(!$(e,t))throw new Error(`Can not ${r} for this input with the key ${e.toString("hex")}`)}function M(t,r){const n=s.reverseBuffer(e.from(r.hash)).toString("hex")+":"+r.index;if(t.__TX_IN_CACHE[n])throw new Error("Duplicate input detected.");t.__TX_IN_CACHE[n]=1}function R(e,t){return(r,n,i,o)=>{const a=e({redeem:{output:i}}).output;if(!n.equals(a))throw new Error(`${t} for ${o} #${r} doesn't match the scriptPubKey in the prevout`)}}const N=R(l.p2sh,"Redeem script"),j=R(l.p2wsh,"Witness script");function U(e,t,r,n){if(!r.every(w))throw new Error("PSBT must be finalized to calculate "+t);if("__FEE_RATE"===e&&n.__FEE_RATE)return n.__FEE_RATE;if("__FEE"===e&&n.__FEE)return n.__FEE;let i,o=!0;return n.__EXTRACTED_TX?(i=n.__EXTRACTED_TX,o=!1):i=n.__TX.clone(),K(r,i,n,o),"__FEE_RATE"===e?n.__FEE_RATE:"__FEE"===e?n.__FEE:void 0}function C(e,t,r,n,i,o){const a=J(r);if(!function(e,t,r){switch(r){case"pubkey":case"pubkeyhash":case"witnesspubkeyhash":return v(1,e.partialSig);case"multisig":const r=l.p2ms({output:t});return v(r.m,e.partialSig,r.pubkeys);default:return!1}}(t,r,a))throw new Error("Can not finalize input #"+e);return function(e,t,r,n,i,o){let a,s;const u=function(e,t,r){let n;switch(t){case"multisig":const t=function(e,t){return l.p2ms({output:e}).pubkeys.map(e=>(t.filter(t=>t.pubkey.equals(e))[0]||{}).signature).filter(e=>!!e)}(e,r);n=l.p2ms({output:e,signatures:t});break;case"pubkey":n=l.p2pk({output:e,signature:r[0].signature});break;case"pubkeyhash":n=l.p2pkh({output:e,pubkey:r[0].pubkey,signature:r[0].signature});break;case"witnesspubkeyhash":n=l.p2wpkh({output:e,pubkey:r[0].pubkey,signature:r[0].signature})}return n}(e,t,r),c=o?l.p2wsh({redeem:u}):null,f=i?l.p2sh({redeem:c||u}):null;n?(s=F(c?c.witness:u.witness),f&&(a=f.input)):a=f?f.input:u.input;return{finalScriptSig:a,finalScriptWitness:s}}(r,a,t.partialSig,n,i,o)}function H(e,t,r,n,i){const a=o.checkForInput(e,t),{hash:s,sighashType:u,script:c}=z(t,a,n,!1,i);return B(r,c,"sign"),{hash:s,sighashType:u}}function z(e,t,r,n,i){const o=r.__TX,a=t.sighashType||h.Transaction.SIGHASH_ALL;if(i&&i.indexOf(a)<0){const e=function(e){let t=e&h.Transaction.SIGHASH_ANYONECANPAY?"SIGHASH_ANYONECANPAY | ":"";switch(31&e){case h.Transaction.SIGHASH_ALL:t+="SIGHASH_ALL";break;case h.Transaction.SIGHASH_SINGLE:t+="SIGHASH_SINGLE";break;case h.Transaction.SIGHASH_NONE:t+="SIGHASH_NONE"}return t}(a);throw new Error("Sighash type is not allowed. Retry the sign method passing the sighashTypes array of whitelisted types. Sighash type: "+e)}let s,u;if(t.nonWitnessUtxo){const n=W(r,t,e),i=o.ins[e].hash,a=n.getHash();if(!i.equals(a))throw new Error(`Non-witness UTXO hash for input #${e} doesn't match the hash specified in the prevout`);const s=o.ins[e].index;u=n.outs[s]}else{if(!t.witnessUtxo)throw new Error("Need a Utxo input item for signing");u=t.witnessUtxo}const{meaningfulScript:c,type:f}=X(u.script,e,"input",t.redeemScript,t.witnessScript);if(["p2sh-p2wsh","p2wsh"].indexOf(f)>=0)s=o.hashForWitnessV0(e,c,u.value,a);else if(x(c)){const t=l.p2pkh({hash:c.slice(2)}).output;s=o.hashForWitnessV0(e,t,u.value,a)}else{if(void 0===t.nonWitnessUtxo&&!1===r.__UNSAFE_SIGN_NONSEGWIT)throw new Error(`Input #${e} has witnessUtxo but non-segwit script: `+c.toString("hex"));n||!1===r.__UNSAFE_SIGN_NONSEGWIT||console.warn("Warning: Signing non-segwit inputs without the full parent transaction means there is a chance that a miner could feed you incorrect information to trick you into paying large fees. This behavior is the same as the old TransactionBuilder class when signing non-segwit scripts. You are not able to export this Psbt with toBuffer|toBase64|toHex since it is not BIP174 compliant.\n*********************\nPROCEED WITH CAUTION!\n*********************"),s=o.hashForSignature(e,c,a)}return{script:c,sighashType:a,hash:s}}function L(e,t,r){const n=o.checkForInput(t,e);if(!n.bip32Derivation||0===n.bip32Derivation.length)throw new Error("Need bip32Derivation to sign with HD");const i=n.bip32Derivation.map(e=>e.masterFingerprint.equals(r.fingerprint)?e:void 0).filter(e=>!!e);if(0===i.length)throw new Error("Need one bip32Derivation masterFingerprint to match the HDSigner fingerprint");return i.map(e=>{const t=r.derivePath(e.path);if(!e.pubkey.equals(t.publicKey))throw new Error("pubkey did not match bip32Derivation");return t})}function D(e){let t=0;function r(){const r=i.decode(e,t);return t+=i.decode.bytes,r}function n(){return n=r(),t+=n,e.slice(t-n,t);var n}return function(){const e=r(),t=[];for(let r=0;r<e;r++)t.push(n());return t}()}function F(t){let r=e.allocUnsafe(0);function n(t){const n=r.length,o=i.encodingLength(t);r=e.concat([r,e.allocUnsafe(o)]),i.encode(t,r,n)}function o(t){n(t.length),function(t){r=e.concat([r,e.from(t)])}(t)}var a;return n((a=t).length),a.forEach(o),r}function q(e,t,r){e.__NON_WITNESS_UTXO_BUF_CACHE[r]=t.nonWitnessUtxo;const n=h.Transaction.fromBuffer(t.nonWitnessUtxo);e.__NON_WITNESS_UTXO_TX_CACHE[r]=n;const i=e,o=r;delete t.nonWitnessUtxo,Object.defineProperty(t,"nonWitnessUtxo",{enumerable:!0,get(){const e=i.__NON_WITNESS_UTXO_BUF_CACHE[o],t=i.__NON_WITNESS_UTXO_TX_CACHE[o];if(void 0!==e)return e;{const e=t.toBuffer();return i.__NON_WITNESS_UTXO_BUF_CACHE[o]=e,e}},set(e){i.__NON_WITNESS_UTXO_BUF_CACHE[o]=e}})}function K(e,t,r,n){let i=0;e.forEach((e,o)=>{if(n&&e.finalScriptSig&&(t.ins[o].script=e.finalScriptSig),n&&e.finalScriptWitness&&(t.ins[o].witness=D(e.finalScriptWitness)),e.witnessUtxo)i+=e.witnessUtxo.value;else if(e.nonWitnessUtxo){const n=W(r,e,o),a=t.ins[o].index,s=n.outs[a];i+=s.value}});const o=t.outs.reduce((e,t)=>e+t.value,0),a=i-o;if(a<0)throw new Error("Outputs are spending more than Inputs");const s=t.virtualSize();r.__FEE=a,r.__EXTRACTED_TX=t,r.__FEE_RATE=Math.floor(a/s)}function W(e,t,r){const n=e.__NON_WITNESS_UTXO_TX_CACHE;return n[r]||q(e,t,r),n[r]}function V(e,t,r){if(void 0!==t.witnessUtxo)return t.witnessUtxo.script;if(void 0!==t.nonWitnessUtxo){return W(r,t,e).outs[r.__TX.ins[e].index].script}throw new Error("Can't find pubkey in input without Utxo data")}function G(e){return 33===e.length&&d.isCanonicalPubKey(e)}function X(e,t,r,n,i){const o=A(e),a=o&&n&&T(n),s=T(e);if(o&&void 0===n)throw new Error("scriptPubkey is P2SH but redeemScript missing");if((s||a)&&void 0===i)throw new Error("scriptPubkey or redeemScript is P2WSH but witnessScript missing");let u;return a?(u=i,N(t,e,n,r),j(t,n,i,r),Y(u)):s?(u=i,j(t,e,i,r),Y(u)):o?(u=n,N(t,e,n,r)):u=e,{meaningfulScript:u,type:a?"p2sh-p2wsh":o?"p2sh":s?"p2wsh":"raw"}}function Y(e){if(x(e)||A(e))throw new Error("P2WPKH or P2SH can not be contained within P2WSH")}function $(e,t){const r=u.hash160(e),n=d.decompile(t);if(null===n)throw new Error("Unknown script error");return n.some(t=>"number"!=typeof t&&(t.equals(e)||t.equals(r)))}function J(e){return x(e)?"witnesspubkeyhash":S(e)?"pubkeyhash":E(e)?"multisig":k(e)?"pubkey":"nonstandard"}function Q(e){return[...Array(e).keys()]}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(79),i=r(51),o=r(287),a=r(19),s=r(82),u=r(12),c=r(50),f=r(1),l=r(1),d=r(52),h=r(16),p=r(3),b=o.types,m=new Set(["p2pkh","p2pk","p2wpkh","p2ms","p2sh-p2pkh","p2sh-p2pk","p2sh-p2wpkh","p2sh-p2ms","p2wsh-p2pkh","p2wsh-p2pk","p2wsh-p2ms","p2sh-p2wsh-p2pkh","p2sh-p2wsh-p2pk","p2sh-p2wsh-p2ms"]);function g(e,t,r){try{p(e,t)}catch(e){throw new Error(r)}}class y{constructor(e=u.bitcoin,t=2500){this.network=e,this.maximumFeeRate=t,this.__PREV_TX_SET={},this.__INPUTS=[],this.__TX=new d.Transaction,this.__TX.version=2,this.__USE_LOW_R=!1,console.warn("Deprecation Warning: TransactionBuilder will be removed in the future. (v6.x.x or later) Please use the Psbt class instead. Examples of usage are available in the transactions-psbt.js integration test file on our Github. A high level explanation is available in the psbt.ts and psbt.js files as well.")}static fromTransaction(e,t){const r=new y(t);return r.setVersion(e.version),r.setLockTime(e.locktime),e.outs.forEach(e=>{r.addOutput(e.script,e.value)}),e.ins.forEach(e=>{r.__addInputUnsafe(e.hash,e.index,{sequence:e.sequence,script:e.script,witness:e.witness})}),r.__INPUTS.forEach((t,r)=>{!function(e,t,r){if(e.redeemScriptType!==b.P2MS||!e.redeemScript)return;if(e.pubkeys.length===e.signatures.length)return;const n=e.signatures.concat();e.signatures=e.pubkeys.map(i=>{const o=s.fromPublicKey(i);let a;return n.some((i,s)=>{if(!i)return!1;const u=f.signature.decode(i),c=t.hashForSignature(r,e.redeemScript,u.hashType);return!!o.verify(c,u.signature)&&(n[s]=void 0,a=i,!0)}),a})}(t,e,r)}),r}setLowR(e){return p(p.maybe(p.Boolean),e),void 0===e&&(e=!0),this.__USE_LOW_R=e,e}setLockTime(e){if(p(h.UInt32,e),this.__INPUTS.some(e=>!!e.signatures&&e.signatures.some(e=>void 0!==e)))throw new Error("No, this would invalidate signatures");this.__TX.locktime=e}setVersion(e){p(h.UInt32,e),this.__TX.version=e}addInput(t,r,n,o){if(!this.__canModifyInputs())throw new Error("No, this would invalidate signatures");let a;if("string"==typeof(s=t)||s instanceof String)t=i.reverseBuffer(e.from(t,"hex"));else if(function(e){return e instanceof d.Transaction}(t)){const e=t.outs[r];o=e.script,a=e.value,t=t.getHash(!1)}var s;return this.__addInputUnsafe(t,r,{sequence:n,prevOutScript:o,value:a})}addOutput(e,t){if(!this.__canModifyOutputs())throw new Error("No, this would invalidate signatures");return"string"==typeof e&&(e=n.toOutputScript(e,this.network)),this.__TX.addOutput(e,t)}build(){return this.__build(!1)}buildIncomplete(){return this.__build(!0)}sign(e,t,r,n,i,o){!function({input:e,ourPubKey:t,keyPair:r,signatureHash:n,hashType:i,useLowR:o}){let a=!1;for(const[s,u]of e.pubkeys.entries()){if(!t.equals(u))continue;if(e.signatures[s])throw new Error("Signature already exists");if(33!==t.length&&e.hasWitness)throw new Error("BIP143 rejects uncompressed public keys in P2WPKH or P2WSH");const c=r.sign(n,o);e.signatures[s]=f.signature.encode(c,i),a=!0}if(!a)throw new Error("Key pair cannot sign for this input")}(function(e,t,r,n,i,o,a,s,u,l,y){let _;if("number"==typeof i)console.warn("DEPRECATED: TransactionBuilder sign method arguments will change in v6, please use the TxbSignArg interface"),_=i;else{if("object"!=typeof i)throw new TypeError("TransactionBuilder sign first arg must be TxbSignArg or number");!function(e,t){if(!m.has(t.prevOutScriptType))throw new TypeError(`Unknown prevOutScriptType "${t.prevOutScriptType}"`);g(p.Number,t.vin,"sign must include vin parameter as Number (input index)"),g(h.Signer,t.keyPair,"sign must include keyPair parameter as Signer interface"),g(p.maybe(p.Number),t.hashType,"sign hashType parameter must be a number");const r=(e[t.vin]||[]).prevOutType,n=t.prevOutScriptType;switch(n){case"p2pkh":if(r&&"pubkeyhash"!==r)throw new TypeError(`input #${t.vin} is not of type p2pkh: ${r}`);g(p.value(void 0),t.witnessScript,n+" requires NO witnessScript"),g(p.value(void 0),t.redeemScript,n+" requires NO redeemScript"),g(p.value(void 0),t.witnessValue,n+" requires NO witnessValue");break;case"p2pk":if(r&&"pubkey"!==r)throw new TypeError(`input #${t.vin} is not of type p2pk: ${r}`);g(p.value(void 0),t.witnessScript,n+" requires NO witnessScript"),g(p.value(void 0),t.redeemScript,n+" requires NO redeemScript"),g(p.value(void 0),t.witnessValue,n+" requires NO witnessValue");break;case"p2wpkh":if(r&&"witnesspubkeyhash"!==r)throw new TypeError(`input #${t.vin} is not of type p2wpkh: ${r}`);g(p.value(void 0),t.witnessScript,n+" requires NO witnessScript"),g(p.value(void 0),t.redeemScript,n+" requires NO redeemScript"),g(h.Satoshi,t.witnessValue,n+" requires witnessValue");break;case"p2ms":if(r&&"multisig"!==r)throw new TypeError(`input #${t.vin} is not of type p2ms: ${r}`);g(p.value(void 0),t.witnessScript,n+" requires NO witnessScript"),g(p.value(void 0),t.redeemScript,n+" requires NO redeemScript"),g(p.value(void 0),t.witnessValue,n+" requires NO witnessValue");break;case"p2sh-p2wpkh":if(r&&"scripthash"!==r)throw new TypeError(`input #${t.vin} is not of type p2sh-p2wpkh: ${r}`);g(p.value(void 0),t.witnessScript,n+" requires NO witnessScript"),g(p.Buffer,t.redeemScript,n+" requires redeemScript"),g(h.Satoshi,t.witnessValue,n+" requires witnessValue");break;case"p2sh-p2ms":case"p2sh-p2pk":case"p2sh-p2pkh":if(r&&"scripthash"!==r)throw new TypeError(`input #${t.vin} is not of type ${n}: ${r}`);g(p.value(void 0),t.witnessScript,n+" requires NO witnessScript"),g(p.Buffer,t.redeemScript,n+" requires redeemScript"),g(p.value(void 0),t.witnessValue,n+" requires NO witnessValue");break;case"p2wsh-p2ms":case"p2wsh-p2pk":case"p2wsh-p2pkh":if(r&&"witnessscripthash"!==r)throw new TypeError(`input #${t.vin} is not of type ${n}: ${r}`);g(p.Buffer,t.witnessScript,n+" requires witnessScript"),g(p.value(void 0),t.redeemScript,n+" requires NO redeemScript"),g(h.Satoshi,t.witnessValue,n+" requires witnessValue");break;case"p2sh-p2wsh-p2ms":case"p2sh-p2wsh-p2pk":case"p2sh-p2wsh-p2pkh":if(r&&"scripthash"!==r)throw new TypeError(`input #${t.vin} is not of type ${n}: ${r}`);g(p.Buffer,t.witnessScript,n+" requires witnessScript"),g(p.Buffer,t.redeemScript,n+" requires witnessScript"),g(h.Satoshi,t.witnessValue,n+" requires witnessScript")}}(t,i),({vin:_,keyPair:o,redeemScript:a,hashType:s,witnessValue:u,witnessScript:l}=i)}if(void 0===o)throw new Error("sign requires keypair");if(o.network&&o.network!==e)throw new TypeError("Inconsistent network");if(!t[_])throw new Error("No input at index: "+_);if(s=s||d.Transaction.SIGHASH_ALL,r(s))throw new Error("Transaction needs outputs");const E=t[_];if(void 0!==E.redeemScript&&a&&!E.redeemScript.equals(a))throw new Error("Inconsistent redeemScript");const k=o.publicKey||o.getPublicKey&&o.getPublicKey();if(!w(E)){if(void 0!==u){if(void 0!==E.value&&E.value!==u)throw new Error("Input did not match witnessValue");p(h.Satoshi,u),E.value=u}if(!w(E)){const e=function(e,t,r,n){if(r&&n){const i=c.p2wsh({redeem:{output:n}}),o=c.p2wsh({output:r}),a=c.p2sh({redeem:{output:r}}),s=c.p2sh({redeem:i});if(!i.hash.equals(o.hash))throw new Error("Witness script inconsistent with prevOutScript");if(!a.hash.equals(s.hash))throw new Error("Redeem script inconsistent with prevOutScript");const u=v(i.redeem.output,t);if(!u.pubkeys)throw new Error(u.type+" not supported as witnessScript ("+f.toASM(n)+")");e.signatures&&e.signatures.some(e=>void 0!==e)&&(u.signatures=e.signatures);const l=n;if(u.type===b.P2WPKH)throw new Error("P2SH(P2WSH(P2WPKH)) is a consensus failure");return{redeemScript:r,redeemScriptType:b.P2WSH,witnessScript:n,witnessScriptType:u.type,prevOutType:b.P2SH,prevOutScript:a.output,hasWitness:!0,signScript:l,signType:u.type,pubkeys:u.pubkeys,signatures:u.signatures,maxSignatures:u.maxSignatures}}if(r){const n=c.p2sh({redeem:{output:r}});if(e.prevOutScript){let t;try{t=c.p2sh({output:e.prevOutScript})}catch(e){throw new Error("PrevOutScript must be P2SH")}if(!n.hash.equals(t.hash))throw new Error("Redeem script inconsistent with prevOutScript")}const i=v(n.redeem.output,t);if(!i.pubkeys)throw new Error(i.type+" not supported as redeemScript ("+f.toASM(r)+")");e.signatures&&e.signatures.some(e=>void 0!==e)&&(i.signatures=e.signatures);let o=r;return i.type===b.P2WPKH&&(o=c.p2pkh({pubkey:i.pubkeys[0]}).output),{redeemScript:r,redeemScriptType:i.type,prevOutType:b.P2SH,prevOutScript:n.output,hasWitness:i.type===b.P2WPKH,signScript:o,signType:i.type,pubkeys:i.pubkeys,signatures:i.signatures,maxSignatures:i.maxSignatures}}if(n){const r=c.p2wsh({redeem:{output:n}});if(e.prevOutScript){const t=c.p2wsh({output:e.prevOutScript});if(!r.hash.equals(t.hash))throw new Error("Witness script inconsistent with prevOutScript")}const i=v(r.redeem.output,t);if(!i.pubkeys)throw new Error(i.type+" not supported as witnessScript ("+f.toASM(n)+")");e.signatures&&e.signatures.some(e=>void 0!==e)&&(i.signatures=e.signatures);const o=n;if(i.type===b.P2WPKH)throw new Error("P2WSH(P2WPKH) is a consensus failure");return{witnessScript:n,witnessScriptType:i.type,prevOutType:b.P2WSH,prevOutScript:r.output,hasWitness:!0,signScript:o,signType:i.type,pubkeys:i.pubkeys,signatures:i.signatures,maxSignatures:i.maxSignatures}}if(e.prevOutType&&e.prevOutScript){if(e.prevOutType===b.P2SH)throw new Error("PrevOutScript is "+e.prevOutType+", requires redeemScript");if(e.prevOutType===b.P2WSH)throw new Error("PrevOutScript is "+e.prevOutType+", requires witnessScript");if(!e.prevOutScript)throw new Error("PrevOutScript is missing");const r=v(e.prevOutScript,t);if(!r.pubkeys)throw new Error(r.type+" not supported ("+f.toASM(e.prevOutScript)+")");e.signatures&&e.signatures.some(e=>void 0!==e)&&(r.signatures=e.signatures);let n=e.prevOutScript;return r.type===b.P2WPKH&&(n=c.p2pkh({pubkey:r.pubkeys[0]}).output),{prevOutType:r.type,prevOutScript:e.prevOutScript,hasWitness:r.type===b.P2WPKH,signScript:n,signType:r.type,pubkeys:r.pubkeys,signatures:r.signatures,maxSignatures:r.maxSignatures}}const i=c.p2pkh({pubkey:t}).output;return{prevOutType:b.P2PKH,prevOutScript:i,hasWitness:!1,signScript:i,signType:b.P2PKH,pubkeys:[t],signatures:[void 0]}}(E,k,a,l);Object.assign(E,e)}if(!w(E))throw Error(E.prevOutType+" not supported")}let S;S=E.hasWitness?n.hashForWitnessV0(_,E.signScript,E.value,s):n.hashForSignature(_,E.signScript,s);return{input:E,ourPubKey:k,keyPair:o,signatureHash:S,hashType:s,useLowR:!!y}}(this.network,this.__INPUTS,this.__needsOutputs.bind(this),this.__TX,e,t,r,n,i,o,this.__USE_LOW_R))}__addInputUnsafe(e,t,r){if(d.Transaction.isCoinbaseHash(e))throw new Error("coinbase inputs not supported");const n=e.toString("hex")+":"+t;if(void 0!==this.__PREV_TX_SET[n])throw new Error("Duplicate TxOut: "+n);let i={};if(void 0!==r.script&&(i=function e(t,r,n,i){if(0===t.length&&0===r.length)return{};if(!n){let e=o.input(t,!0),i=o.witness(r,!0);e===b.NONSTANDARD&&(e=void 0),i===b.NONSTANDARD&&(i=void 0),n=e||i}switch(n){case b.P2WPKH:{const{output:e,pubkey:t,signature:n}=c.p2wpkh({witness:r});return{prevOutScript:e,prevOutType:b.P2WPKH,pubkeys:[t],signatures:[n]}}case b.P2PKH:{const{output:e,pubkey:r,signature:n}=c.p2pkh({input:t});return{prevOutScript:e,prevOutType:b.P2PKH,pubkeys:[r],signatures:[n]}}case b.P2PK:{const{signature:e}=c.p2pk({input:t});return{prevOutType:b.P2PK,pubkeys:[void 0],signatures:[e]}}case b.P2MS:{const{m:e,pubkeys:r,signatures:n}=c.p2ms({input:t,output:i},{allowIncomplete:!0});return{prevOutType:b.P2MS,pubkeys:r,signatures:n,maxSignatures:e}}}if(n===b.P2SH){const{output:n,redeem:i}=c.p2sh({input:t,witness:r}),a=o.output(i.output),s=e(i.input,i.witness,a,i.output);return s.prevOutType?{prevOutScript:n,prevOutType:b.P2SH,redeemScript:i.output,redeemScriptType:s.prevOutType,witnessScript:s.witnessScript,witnessScriptType:s.witnessScriptType,pubkeys:s.pubkeys,signatures:s.signatures}:{}}if(n===b.P2WSH){const{output:n,redeem:i}=c.p2wsh({input:t,witness:r}),a=o.output(i.output);let s;return s=a===b.P2WPKH?e(i.input,i.witness,a):e(f.compile(i.witness),[],a,i.output),s.prevOutType?{prevOutScript:n,prevOutType:b.P2WSH,witnessScript:i.output,witnessScriptType:s.prevOutType,pubkeys:s.pubkeys,signatures:s.signatures}:{}}return{prevOutType:b.NONSTANDARD,prevOutScript:t}}(r.script,r.witness||[])),void 0!==r.value&&(i.value=r.value),!i.prevOutScript&&r.prevOutScript){let e;if(!i.pubkeys&&!i.signatures){const t=v(r.prevOutScript);t.pubkeys&&(i.pubkeys=t.pubkeys,i.signatures=t.signatures),e=t.type}i.prevOutScript=r.prevOutScript,i.prevOutType=e||o.output(r.prevOutScript)}const a=this.__TX.addInput(e,t,r.sequence,r.scriptSig);return this.__INPUTS[a]=i,this.__PREV_TX_SET[n]=!0,a}__build(e){if(!e){if(!this.__TX.ins.length)throw new Error("Transaction has no inputs");if(!this.__TX.outs.length)throw new Error("Transaction has no outputs")}const t=this.__TX.clone();if(this.__INPUTS.forEach((r,n)=>{if(!r.prevOutType&&!e)throw new Error("Transaction is not complete");const i=function e(t,r,n){const i=r.pubkeys||[];let o=r.signatures||[];switch(t){case b.P2PKH:if(0===i.length)break;if(0===o.length)break;return c.p2pkh({pubkey:i[0],signature:o[0]});case b.P2WPKH:if(0===i.length)break;if(0===o.length)break;return c.p2wpkh({pubkey:i[0],signature:o[0]});case b.P2PK:if(0===i.length)break;if(0===o.length)break;return c.p2pk({signature:o[0]});case b.P2MS:{const e=r.maxSignatures;o=n?o.map(e=>e||l.OPS.OP_0):o.filter(e=>e);const t=!n||e===o.length;return c.p2ms({m:e,pubkeys:i,signatures:o},{allowIncomplete:n,validate:t})}case b.P2SH:{const t=e(r.redeemScriptType,r,n);if(!t)return;return c.p2sh({redeem:{output:t.output||r.redeemScript,input:t.input,witness:t.witness}})}case b.P2WSH:{const t=e(r.witnessScriptType,r,n);if(!t)return;return c.p2wsh({redeem:{output:r.witnessScript,input:t.input,witness:t.witness}})}}}(r.prevOutType,r,e);if(i)t.setInputScript(n,i.input),t.setWitness(n,i.witness);else{if(!e&&r.prevOutType===b.NONSTANDARD)throw new Error("Unknown input type");if(!e)throw new Error("Not enough information")}}),!e&&this.__overMaximumFees(t.virtualSize()))throw new Error("Transaction has absurd fees");return t}__canModifyInputs(){return this.__INPUTS.every(e=>!e.signatures||e.signatures.every(e=>{if(!e)return!0;return 0!=(_(e)&d.Transaction.SIGHASH_ANYONECANPAY)}))}__needsOutputs(e){return e===d.Transaction.SIGHASH_ALL?0===this.__TX.outs.length:0===this.__TX.outs.length&&this.__INPUTS.some(e=>!!e.signatures&&e.signatures.some(e=>{if(!e)return!1;return!(_(e)&d.Transaction.SIGHASH_NONE)}))}__canModifyOutputs(){const e=this.__TX.ins.length,t=this.__TX.outs.length;return this.__INPUTS.every(r=>void 0===r.signatures||r.signatures.every(r=>{if(!r)return!0;const n=31&_(r);return n===d.Transaction.SIGHASH_NONE||n===d.Transaction.SIGHASH_SINGLE&&e<=t}))}__overMaximumFees(e){return(this.__INPUTS.reduce((e,t)=>e+(t.value>>>0),0)-this.__TX.outs.reduce((e,t)=>e+t.value,0))/e>this.maximumFeeRate}}function v(e,t){p(h.Buffer,e);const r=o.output(e);switch(r){case b.P2PKH:{if(!t)return{type:r};const n=c.p2pkh({output:e}).hash,i=a.hash160(t);return n.equals(i)?{type:r,pubkeys:[t],signatures:[void 0]}:{type:r}}case b.P2WPKH:{if(!t)return{type:r};const n=c.p2wpkh({output:e}).hash,i=a.hash160(t);return n.equals(i)?{type:r,pubkeys:[t],signatures:[void 0]}:{type:r}}case b.P2PK:return{type:r,pubkeys:[c.p2pk({output:e}).pubkey],signatures:[void 0]};case b.P2MS:{const t=c.p2ms({output:e});return{type:r,pubkeys:t.pubkeys,signatures:t.pubkeys.map(()=>{}),maxSignatures:t.m}}}return{type:r}}function w(e){return void 0!==e.signScript&&void 0!==e.signType&&void 0!==e.pubkeys&&void 0!==e.signatures&&e.signatures.length===e.pubkeys.length&&e.pubkeys.length>0&&(!1===e.hasWitness||void 0!==e.value)}function _(e){return e.readUInt8(e.length-1)}t.TransactionBuilder=y}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(83),o=r(290),a=r(84),s=r(85),u=r(295),c=r(298),f=r(300),l=r(302),d={P2MS:"multisig",NONSTANDARD:"nonstandard",NULLDATA:"nulldata",P2PK:"pubkey",P2PKH:"pubkeyhash",P2SH:"scripthash",P2WPKH:"witnesspubkeyhash",P2WSH:"witnessscripthash",WITNESS_COMMITMENT:"witnesscommitment"};t.types=d,t.output=function(e){if(f.output.check(e))return d.P2WPKH;if(l.output.check(e))return d.P2WSH;if(s.output.check(e))return d.P2PKH;if(u.output.check(e))return d.P2SH;const t=n.decompile(e);if(!t)throw new TypeError("Invalid script");return i.output.check(t)?d.P2MS:a.output.check(t)?d.P2PK:c.output.check(t)?d.WITNESS_COMMITMENT:o.output.check(t)?d.NULLDATA:d.NONSTANDARD},t.input=function(e,t){const r=n.decompile(e);if(!r)throw new TypeError("Invalid script");return s.input.check(r)?d.P2PKH:u.input.check(r,t)?d.P2SH:i.input.check(r,t)?d.P2MS:a.input.check(r)?d.P2PK:d.NONSTANDARD},t.witness=function(e,t){const r=n.decompile(e);if(!r)throw new TypeError("Invalid script");return f.input.check(r)?d.P2WPKH:l.input.check(r,t)?d.P2WSH:d.NONSTANDARD}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(1);function o(e){return e===i.OPS.OP_0||n.isCanonicalScriptSignature(e)}function a(e,t){const r=n.decompile(e);return!(r.length<2)&&(r[0]===i.OPS.OP_0&&(t?r.slice(1).every(o):r.slice(1).every(n.isCanonicalScriptSignature)))}t.check=a,a.toJSON=()=>"multisig input"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(1),o=r(16),a=i.OPS.OP_RESERVED;function s(e,t){const r=n.decompile(e);if(r.length<4)return!1;if(r[r.length-1]!==i.OPS.OP_CHECKMULTISIG)return!1;if(!o.Number(r[0]))return!1;if(!o.Number(r[r.length-2]))return!1;const s=r[0]-a,u=r[r.length-2]-a;if(s<=0)return!1;if(u>16)return!1;if(s>u)return!1;if(u!==r.length-3)return!1;if(t)return!0;return r.slice(1,-2).every(n.isCanonicalPubKey)}t.check=s,s.toJSON=()=>"multi-sig output"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=n.OPS;function o(e){const t=n.compile(e);return t.length>1&&t[0]===i.OP_RETURN}t.check=o,o.toJSON=()=>"null data output";const a={check:o};t.output=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1);function i(e){const t=n.decompile(e);return 1===t.length&&n.isCanonicalScriptSignature(t[0])}t.check=i,i.toJSON=()=>"pubKey input"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(1);function o(e){const t=n.decompile(e);return 2===t.length&&n.isCanonicalPubKey(t[0])&&t[1]===i.OPS.OP_CHECKSIG}t.check=o,o.toJSON=()=>"pubKey output"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1);function i(e){const t=n.decompile(e);return 2===t.length&&n.isCanonicalScriptSignature(t[0])&&n.isCanonicalPubKey(t[1])}t.check=i,i.toJSON=()=>"pubKeyHash input"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(1);function o(e){const t=n.compile(e);return 25===t.length&&t[0]===i.OPS.OP_DUP&&t[1]===i.OPS.OP_HASH160&&20===t[2]&&t[23]===i.OPS.OP_EQUALVERIFY&&t[24]===i.OPS.OP_CHECKSIG}t.check=o,o.toJSON=()=>"pubKeyHash output"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(296);t.input=n;const i=r(297);t.output=i},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(83),o=r(84),a=r(85),s=r(127),u=r(128);function c(t,r){const c=n.decompile(t);if(c.length<1)return!1;const f=c[c.length-1];if(!e.isBuffer(f))return!1;const l=n.decompile(n.compile(c.slice(0,-1))),d=n.decompile(f);return!!d&&(!!n.isPushOnly(l)&&(1===c.length?u.check(d)||s.check(d):!(!a.input.check(l)||!a.output.check(d))||(!(!i.input.check(l,r)||!i.output.check(d))||!(!o.input.check(l)||!o.output.check(d)))))}t.check=c,c.toJSON=()=>"scriptHash input"}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(1);function o(e){const t=n.compile(e);return 23===t.length&&t[0]===i.OPS.OP_HASH160&&20===t[1]&&t[22]===i.OPS.OP_EQUAL}t.check=o,o.toJSON=()=>"scriptHash output"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(299);t.output=n},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(1),o=r(16),a=r(3),s=e.from("aa21a9ed","hex");function u(e){const t=n.compile(e);return t.length>37&&t[0]===i.OPS.OP_RETURN&&36===t[1]&&t.slice(2,6).equals(s)}t.check=u,u.toJSON=()=>"Witness commitment output",t.encode=function(t){a(o.Hash256bit,t);const r=e.allocUnsafe(36);return s.copy(r,0),t.copy(r,4),n.compile([i.OPS.OP_RETURN,r])},t.decode=function(e){return a(u,e),n.decompile(e)[1].slice(4,36)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(301);t.input=n;const i=r(127);t.output=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1);function i(e){const t=n.decompile(e);return 2===t.length&&n.isCanonicalScriptSignature(t[0])&&(r=t[1],n.isCanonicalPubKey(r)&&33===r.length);var r}t.check=i,i.toJSON=()=>"witnessPubKeyHash input"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(303);t.input=n;const i=r(128);t.output=i},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(3),o=r(83),a=r(84),s=r(85);function u(t,r){if(i(i.Array,t),t.length<1)return!1;const u=t[t.length-1];if(!e.isBuffer(u))return!1;const c=n.decompile(u);if(!c||0===c.length)return!1;const f=n.compile(t.slice(0,-1));return!(!s.input.check(f)||!s.output.check(c))||(!(!o.input.check(f,r)||!o.output.check(c))||!(!a.input.check(f)||!a.output.check(c)))}t.check=u,u.toJSON=()=>"witnessScriptHash input"}).call(this,r(0).Buffer)},function(e,t,r){(function(t){function r(e,r){for(var n=e.length,i=[],o=0;o<n;o+=2){var a=e[o],s=o+1===n?a:e[o+1],u=t.concat([a,s]);i.push(r(u))}return i}e.exports=function(e,t){if(!Array.isArray(e))throw TypeError("Expected values Array");if("function"!=typeof t)throw TypeError("Expected digest Function");if(1===e.length)return e.concat();var n=[e],i=e;do{i=r(i,t),n.push(i)}while(i.length>1);return[].concat.apply([],n)}}).call(this,r(0).Buffer)},function(e,t,r){(function(t){function r(e){for(var t=1,r=e;r>1;r=r+1>>1)t+=r;return t}function n(e,t){return e+(1<<t)-1>>t}e.exports=function(e,t){var i=e.indexOf(t);if(-1===i)return null;for(var o=e.length,a=[],s=n(o,1);s>0&&r(s)!==o;)--s;if(0===s)throw new Error("Unknown solution");for(var u=0,c=0;c<o-1;){var f=n(s,u);++u;var l=i%2;l&&--i;var d=c+i,h=e[d],p=i===f-1?h:e[d+1];c>0?(a.push(l?h:null),a.push(l?null:p)):(a.push(h),a.push(p)),i=i/2|0,c+=f}return a.push(e[o-1]),a},e.exports.verify=function(e,r){for(var n=e[e.length-1],i=n,o=0;o<e.length-1;o+=2){var a=e[o]||i,s=e[o+1]||i;i=r(t.concat([a,s]))}return i.equals(n)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TeleportDaoPayment=void 0;const i=r(129);class o extends i.BitcoinBase{payBurnRequest(e,t="normal"){return n(this,void 0,void 0,(function*(){if(!(this.currentAccount&&this.currentAccountType&&this.publicKey&&this.privateKey))throw new Error("account not initialized");let r=yield this.getExtendedUtxo({address:this.currentAccount,addressType:this.currentAccountType,publicKey:this.publicKey.toString("hex")}),n=yield this.transactionBuilder._getFeeRate(t),i=yield this.transactionBuilder.processUnsignedTransaction({extendedUtxo:r,targets:e,changeAddress:this.currentAccount,feeRate:n,fullAmount:!1}),o=yield this.signer.signPsbt(i,this.privateKey),a=this.signer.finalizePsbts([o]);return yield this.transactionBuilder.sendTx(a)}))}transferBitcoinToEth({lockerAddress:e,amount:t,fullAmount:r=!1,chainId:i,appId:o,recipientAddress:a,percentageFee:s,speed:u=0,isExchange:c=!1,exchangeTokenAddress:f="0x0000000000000000000000000000000000000000",outputAmount:l=0,deadline:d,isFixedToken:h=!1,feeSpeed:p="normal",staticFeeRate:b}){return n(this,void 0,void 0,(function*(){if(!(this.currentAccount&&this.currentAccountType&&this.publicKey&&this.privateKey))throw new Error("account not initialized");let n=yield this.getExtendedUtxo({address:this.currentAccount,addressType:this.currentAccountType,publicKey:this.publicKey.toString("hex")}),m=yield this.getBitcoinToEthUnsignedPsbt({changeAddress:this.currentAccount,extendedUtxo:n,lockerAddress:e,amount:t,fullAmount:r,chainId:i,appId:o,recipientAddress:a,percentageFee:s,speed:u,isExchange:c,exchangeTokenAddress:f,outputAmount:l,deadline:d,isFixedToken:h,feeSpeed:p,staticFeeRate:b}),g=yield this.signer.signPsbt(m,this.privateKey);return yield this.sendSignedPsbt(g)}))}getBitcoinToEthTargetOutputs({lockerAddress:e,amount:t,fullAmount:r=!1,chainId:i,appId:a,recipientAddress:s,percentageFee:u,speed:c=0,isExchange:f=!1,exchangeTokenAddress:l="0x0000000000000000000000000000000000000000",outputAmount:d=0,deadline:h=0,isFixedToken:p=!1}){return n(this,void 0,void 0,(function*(){let n=o.getTransferOpReturnData({chainId:i,appId:a,recipientAddress:s,percentageFee:u,speed:c,isExchange:f,exchangeTokenAddress:l,outputAmount:d,deadline:h,isFixedToken:p}),b=this.transactionBuilder.getOpReturnTarget(n);return r?[b]:[{address:e,value:t},b]}))}getBitcoinToEthUnsignedPsbt({changeAddress:e,extendedUtxo:t,lockerAddress:r,amount:i,fullAmount:o=!1,chainId:a,appId:s,recipientAddress:u,percentageFee:c,speed:f=0,isExchange:l=!1,exchangeTokenAddress:d="0x0000000000000000000000000000000000000000",outputAmount:h=0,deadline:p=0,isFixedToken:b=!1,feeSpeed:m="normal",staticFeeRate:g}){return n(this,void 0,void 0,(function*(){let n=g||(yield this.transactionBuilder._getFeeRate(m)),y=yield this.getBitcoinToEthTargetOutputs({lockerAddress:r,amount:i,fullAmount:o,chainId:a,appId:s,recipientAddress:u,percentageFee:c,speed:f,isExchange:l,exchangeTokenAddress:d,outputAmount:h,deadline:p,isFixedToken:b});return yield this.transactionBuilder.processUnsignedTransaction({extendedUtxo:t,targets:y,changeAddress:o?r:e,feeRate:n,fullAmount:o})}))}bitcoinToEthLend({lockerAddress:e,amount:t,chainId:r,appId:i,recipientAddress:a,percentageFee:s,mode:u=0,isBorrow:c=!1,tokenAddress:f="0x0000000000000000000000000000000000000000",borrowAmount:l=0,staticFeeRate:d}){return n(this,void 0,void 0,(function*(){if(!(this.currentAccount&&this.currentAccountType&&this.publicKey&&this.privateKey))throw new Error("account not initialized");let n=o.getLendingOpReturnData({chainId:r,appId:i,recipientAddress:a,percentageFee:s,mode:u,isBorrow:c,tokenAddress:f,borrowAmount:l}),h=this.transactionBuilder.getOpReturnTarget(n),p=yield this.transactionBuilder.getExtendedUtxo({address:this.currentAccount,addressType:this.currentAccountType,publicKey:this.publicKey.toString("hex")}),b=yield this.transactionBuilder.processUnsignedTransaction({extendedUtxo:p,targets:[{address:e,value:t},h],changeAddress:this.currentAccount,feeRate:d,fullAmount:!1}),m=yield this.signer.signPsbt(b,this.privateKey),g=this.signer.finalizePsbts([m]);return yield this.transactionBuilder.sendTx(g)}))}static getTransferOpReturnData({chainId:e,appId:t,recipientAddress:r,percentageFee:n,speed:i=0,isExchange:o=!1,exchangeTokenAddress:a="0x0000000000000000000000000000000000000000",outputAmount:s=0,deadline:u,isFixedToken:c=!1}){let f=Number(e).toString(16).padStart(2,"0")+Number(t).toString(16).padStart(4,"0")+r.replace("0x","").toLowerCase().padStart(40,"0")+Number((100*n).toFixed(0)).toString(16).padStart(4,"0")+(i?"01":"00");if(!o){if(52!==f.length)throw new Error("invalid data length");return f}if(f=f+a.replace("0x","").toLowerCase().padStart(40,"0")+Number(s).toString(16).padStart(56,"0")+Number(u).toString(16).padStart(8,"0")+(c?"01":"00"),158!==f.length)throw new Error("invalid data length");return f}static getLendingOpReturnData({chainId:e,appId:t,recipientAddress:r,percentageFee:n,mode:i,isBorrow:o=!1,tokenAddress:a="0x0000000000000000000000000000000000000000",borrowAmount:s=0}){let u=Number(e).toString(16).padStart(2,"0")+Number(t).toString(16).padStart(4,"0")+r.replace("0x","").toLowerCase().padStart(40,"0")+Number((100*n).toFixed(0)).toString(16).padStart(4,"0")+Number(i).toString(16).padStart(2,"0");if(!o){if(52!==u.length)throw new Error("invalid data length");return u}if(u=u+a.replace("0x","").toLowerCase().padStart(40,"0")+Number(s).toString(16).padStart(56,"0"),148!==u.length)throw new Error("invalid data length");return u}}t.TeleportDaoPayment=o,t.default=o},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=s(r(308)),c=r(131),f=o(r(35));class l extends u.default{constructor(e,t,r=f.networks.bitcoin){super({network:r,testnet:null==t?void 0:t.includes("_testnet"),dustLimit:1e3}),this.btcInterface=new c.BitcoinInterface(e,t)}_getUtxo(e){return a(this,void 0,void 0,(function*(){return(yield this.btcInterface.getAddressesUtxo([e])).map(e=>({hash:e.txId,value:+e.value,index:+e.index}))}))}_getFeeRate(e="normal"){return a(this,void 0,void 0,(function*(){return this.btcInterface.getFeeRate(e)}))}_getTransactionHex(e){return a(this,void 0,void 0,(function*(){return this.btcInterface.provider.getRawTransaction(e)}))}sendTx(e){return a(this,void 0,void 0,(function*(){return yield this.btcInterface.provider.sendRawTransaction(e)}))}}t.default=l},function(e,t,r){"use strict";(function(e){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const s=o(r(35)),u=r(34),c=r(309),f=r(311),l=r(130),d={bytePerInput:{p2pkh:148,p2wpkh:88,"p2sh-p2wpkh":91},baseTxBytes:10,bytePerOutput:34};class h{constructor({network:e,testnet:t,feeMin:r=0,dustLimit:n,maximumNumberOfOutputsInTransaction:i=50}){this.testnet=t,this.network=e,this.maximumNumberOfOutputsInTransaction=i,this.feeMin=r,this.dustLimit=n||2*d.bytePerInput.p2pkh}_getUtxo(e){return a(this,void 0,void 0,(function*(){throw new Error("Do not call abstract method directly")}))}_getTransactionHex(e){return a(this,void 0,void 0,(function*(){throw new Error("Do not call abstract method directly")}))}createAddressObject(e){return(0,u.createAddressObjectByPublicKey)(e,this.network)}validateAddress(e){try{return(0,u.getAddressType)(e),!0}catch(e){return!1}}getOpReturnTarget(t){if(!(t.length>0))throw new Error("invalid data in hex");return{script:s.payments.embed({data:[e.from(t,"hex")],network:this.network}).output,value:0}}getExtendedUtxo(e){return a(this,void 0,void 0,(function*(){const t=(yield this._getUtxo(e.address)).map(t=>Object.assign(Object.assign({},t),{signerInfo:e}));if(!t||0===t.length)throw new Error("no utxo found");return t}))}static helperHandleInputsAndOutputs({targets:e,extendedUtxo:t,feeRate:r,changeObject:n,selectType:i="normal"}){let o;switch(i){case"normal":o=c(t,e,Math.round(r));break;case"accumulative":o=l(t,e,Math.round(r));break;case"full":if(!e[0].address)throw new Error;o=f(t,[{address:e[0].address}],Math.round(r))}let{inputs:a,outputs:s,fee:u}=o;if(!a||!s)throw new Error("not enough balance");const h=a.map(e=>d.bytePerInput[e.signerInfo.addressType]),p=s.length*d.bytePerOutput;let b,m=u-(d.baseTxBytes+h.reduce((e,t)=>e+t,0)+p+d.bytePerOutput)*r,g=s.findIndex(e=>!(null==e?void 0:e.address)&&!e.script&&(e.value||0)>0);if(g>=0||m>600){if(g>=0&&(m+=d.bytePerOutput*r),m<0&&(m=0),!n)throw new Error("change not exist");b={address:n.address,value:g>=0?s[g].value+m:m},u-=m,g>=0&&s.splice(g,1)}return{inputs:a,fee:u,outputs:s,change:b}}filterAndConvertTxDataToStandardFormat({extendedUtxo:e,targets:t,changeObject:r,feeRate:n,selectType:i}){return a(this,void 0,void 0,(function*(){let{inputs:o,outputs:a,change:s,fee:u}=h.helperHandleInputsAndOutputs({targets:t,extendedUtxo:e,feeRate:n,changeObject:r,selectType:i});return{inputs:yield this.convertExtendedUtxoToInputs(o),outputs:a,change:s,fee:u,feeRate:n}}))}convertExtendedUtxoToInputs(t=[]){var r;return a(this,void 0,void 0,(function*(){let n=t,i=null,o=null;for(let t in n){let{address:a,publicKey:s,derivationPath:u,masterFingerprint:c,addressType:f}=n[t].signerInfo,l=this.createAddressObject({publicKey:e.from(s,"hex"),addressType:f});if(u&&c&&l.pubkey&&(n[t].bip32Derivation=[{path:u,pubkey:l.pubkey,masterFingerprint:e.from(c,"hex")}]),"p2pkh"===f)o&&i===n[t].hash||(o=yield this._getTransactionHex(n[t].hash),i=n[t].hash),n[t].nonWitnessUtxo=e.from(o,"hex");else if("p2wpkh"===f){if(!l.output)throw new Error("invalid signer info");n[t].witnessUtxo={script:l.output,value:n[t].value},n[t].signerInfo.includeHex&&(o&&i===n[t].hash||(o=yield this._getTransactionHex(n[t].hash),i=n[t].hash),n[t].nonWitnessUtxo=e.from(o,"hex"))}else if("p2sh-p2wpkh"===f){if(!l.output)throw new Error("invalid signer info");if(n[t].witnessUtxo={script:l.output,value:n[t].value},!(null===(r=null==l?void 0:l.redeem)||void 0===r?void 0:r.output))throw new Error("invalid signer info for p2sh address");n[t].redeemScript=l.redeem.output,n[t].signerInfo.includeHex&&(o&&i===n[t].hash||(o=yield this._getTransactionHex(n[t].hash),i=n[t].hash),n[t].nonWitnessUtxo=e.from(o,"hex"))}else if("p2tr"===f){if(!l.output)throw new Error("invalid signer info");if(n[t].witnessUtxo={script:l.output,value:n[t].value},!l.pubkey)throw new Error("invalid signer info for p2tr address (pubkey)");n[t].tapInternalKey=e.from(s,"hex"),n[t].signerInfo.includeHex&&(o&&i===n[t].hash||(o=yield this._getTransactionHex(n[t].hash),i=n[t].hash),n[t].nonWitnessUtxo=e.from(o,"hex"))}}return n}))}createUnsignedTransaction({inputs:e,outputs:t,change:r,fee:n,feeRate:i}){const{network:o}=this,a=new s.Psbt({network:o});a.setMaximumFeeRate(+(i+i/100).toFixed());for(const t of e){let{addressType:e}=t.signerInfo;switch(e){case"p2pkh":{let e={hash:t.hash,index:Number(t.index),nonWitnessUtxo:t.nonWitnessUtxo,sequence:4294967294,bip32Derivation:t.bip32Derivation};e.bip32Derivation||delete e.bip32Derivation,a.addInput(e);break}case"p2wpkh":{let e={hash:t.hash,index:Number(t.index),witnessUtxo:t.witnessUtxo,nonWitnessUtxo:t.nonWitnessUtxo,sequence:4294967294,bip32Derivation:t.bip32Derivation};e.bip32Derivation||delete e.bip32Derivation,e.nonWitnessUtxo||delete e.nonWitnessUtxo,a.addInput(e);break}case"p2sh-p2wpkh":{let e={hash:t.hash,index:Number(t.index),witnessUtxo:t.witnessUtxo,nonWitnessUtxo:t.nonWitnessUtxo,redeemScript:t.redeemScript,sequence:4294967294,bip32Derivation:t.bip32Derivation};e.bip32Derivation||delete e.bip32Derivation,e.nonWitnessUtxo||delete e.nonWitnessUtxo,a.addInput(e);break}case"p2tr":{let e={hash:t.hash,index:Number(t.index),witnessUtxo:t.witnessUtxo,nonWitnessUtxo:t.nonWitnessUtxo,tapInternalKey:t.tapInternalKey,sequence:4294967294,bip32Derivation:t.bip32Derivation};e.bip32Derivation||delete e.bip32Derivation,e.nonWitnessUtxo||delete e.nonWitnessUtxo,a.addInput(e);break}default:throw new Error("address type is incorrect")}}for(const e of t)a.addOutput(Object.assign({},e));if(r&&0!==Object.keys(r).length&&a.addOutput(r),r&&0!==Object.keys(r).length&&a.txOutputs[t.length].address!==r.address)throw new Error("error change address");return{unsignedTransaction:a.toBase64(),outputs:t,inputs:e.map(e=>({hash:e.hash,value:Number(e.value),index:e.index,signerInfo:e.signerInfo})),fee:n,change:r}}processUnsignedTransaction({extendedUtxo:e,targets:t=[],changeAddress:r,fullAmount:n=!1,feeRate:i,selfTransaction:o=!1,selectType:s="normal"}){return a(this,void 0,void 0,(function*(){if(!o&&0===t.length)throw new Error("no target");let a="string"==typeof r?{address:r}:r;const{inputs:u,outputs:c,change:f,fee:l}=yield this.filterAndConvertTxDataToStandardFormat({extendedUtxo:e,targets:t,changeObject:a,feeRate:i,selectType:n?"full":s});return this.createUnsignedTransaction({inputs:u,outputs:c,change:f,fee:l,feeRate:i})}))}}t.default=h}).call(this,r(0).Buffer)},function(e,t,r){var n=r(130),i=r(310),o=r(53);function a(e,t){return e.value-t*o.inputBytes(e)}e.exports=function(e,t,r){e=e.concat().sort((function(e,t){return a(t,r)-a(e,r)}));var o=i(e,t,r);return o.inputs?o:n(e,t,r)}},function(e,t,r){var n=r(53);e.exports=function(e,t,r){if(!isFinite(n.uintOrNaN(r)))return{};for(var i=n.transactionBytes([],t),o=0,a=[],s=n.sumOrNaN(t),u=n.dustThreshold({},r),c=0;c<e.length;++c){var f=e[c],l=n.inputBytes(f),d=r*(i+l),h=n.uintOrNaN(f.value);if(!(o+h>s+d+u)&&(i+=l,o+=h,a.push(f),!(o<s+d)))return n.finalize(a,t,r)}return{fee:r*i}}},function(e,t,r){var n=r(53);e.exports=function(e,t,r){if(!isFinite(n.uintOrNaN(r)))return{};var i=n.transactionBytes(e,t),o=r*i;if(0===t.length)return{fee:o};var a=n.sumOrNaN(e)-n.sumForgiving(t)-o;if(!isFinite(a)||a<0)return{fee:o};var s=t.reduce((function(e,t){return e+!isFinite(t.value)}),0);if(0===a&&0===s)return n.finalize(e,t,r);var u=t.reduce((function(e,t){return void 0!==t.value?e:e+1}),0),c=Math.floor(a/u);return t.every((function(e){return void 0!==e.value||c>n.dustThreshold(e,r)}))?(t=t.map((function(e){if(void 0!==e.value)return e;var t={};for(var r in e)t[r]=e[r];return t.value=c,t})),n.finalize(e,t,r)):{fee:o}}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.bitcoin=void 0,t.bitcoin=o(r(313)),a(r(338),t)},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getApiProvider=t.getRpcProvider=t.ApiProviders=t.RPC=void 0;const s=a(r(314));t.RPC=s.default;const u=o(r(334));t.ApiProviders=u,t.getRpcProvider=function(e){const{url:t,headers:r,auth:n}=e;return new s.default({url:t,headers:r,auth:n})},t.getApiProvider=function(e,t){if(!u[e.provider])throw new Error("provider not supported");let r=!!(null==t?void 0:t.includes("_testnet"));return"NowNodes"===e.provider?new u.NowNodes({token:e.token,timeout:3e4},r):"BlockStream"===e.provider?new u.BlockStream(r,{token:e.token,timeout:3e4}):"MempoolSpace"===e.provider?new u.MempoolSpace(r,{token:e.token,timeout:3e4}):void 0}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const{getAxiosInstance:i}=r(54);class o{constructor({headers:e,url:t,auth:r}){this.axios=o.getAxiosInstance({baseUrl:t,headers:e,auth:r,timeout:18e4})}static getAxiosInstance(e){return i(e)}static getRpcBody(e,t=[]){return{jsonrpc:"2.0",id:"teleport-dao",method:e,params:t}}getChainInfo(){return n(this,void 0,void 0,(function*(){return(yield this.axios.post("/",o.getRpcBody("getblockchaininfo"))).data.result}))}getLatestBlockNumber(){return n(this,void 0,void 0,(function*(){return(yield this.axios.post("/",o.getRpcBody("getblockcount"))).data.result}))}getBlockHash(e){return n(this,void 0,void 0,(function*(){return(yield this.axios.post("/",o.getRpcBody("getblockhash",[Number(e)]))).data.result}))}getBlockByBlockHash(e,t=1){return n(this,void 0,void 0,(function*(){return(yield this.axios.post("/",o.getRpcBody("getblock",[e,Number(t)]))).data.result}))}getBlockHeaderByBlockHash(e){return n(this,void 0,void 0,(function*(){return(yield this.axios.post("/",o.getRpcBody("getblockheader",[e,!1]))).data.result}))}getBlockByBlockNumber(e,t){return n(this,void 0,void 0,(function*(){return this.getBlockByBlockHash(yield this.getBlockHash(e),t)}))}getTransaction(e){return n(this,void 0,void 0,(function*(){let t=(yield this.axios.post("/",o.getRpcBody("getrawtransaction",[e,!0]))).data.result,r=t.blockhash?yield this.getBlockByBlockHash(t.blockhash):{};return{txId:t.txid,version:t.version,locktime:t.locktime,blockNumber:r.height||null,blockHash:t.blockhash||null,vout:t.vout.map(e=>({address:e.scriptPubKey.address||null,script:e.scriptPubKey.hex,value:Number((1e8*Number(e.value)).toFixed())})),vin:t.vin.map(e=>({txId:e.txid,index:e.vout}))}}))}getRawTransaction(e){return n(this,void 0,void 0,(function*(){return(yield this.axios.post("/",o.getRpcBody("getrawtransaction",[e,!0]))).data.result.hex}))}getTxOutProof(e){return n(this,void 0,void 0,(function*(){return(yield this.axios.post("/",o.getRpcBody("gettxoutproof",[e,!0]))).data.result.hex}))}getBlockTransactionIds(e){return n(this,void 0,void 0,(function*(){return(yield this.getBlockByBlockHash(e)).tx}))}sendRawTransaction(e,t=.1){return n(this,void 0,void 0,(function*(){return(yield this.axios.post("/",o.getRpcBody("sendrawtransaction",[e,t]))).data.result}))}getBlockHeaderHex(e){return n(this,void 0,void 0,(function*(){const t=yield this.getBlockHash(e);return yield this.getBlockHeaderByBlockHash(t)}))}getEstimateFeeByNumberOfBlock(e){return n(this,void 0,void 0,(function*(){return(yield this.axios.post("/",o.getRpcBody("estimatesmartfee",[e,"ECONOMICAL"]))).data.result.feerate*Math.pow(10,5)}))}getFeeRate(e="normal"){return n(this,void 0,void 0,(function*(){let t;switch(e){case"slow":t=yield this.getEstimateFeeByNumberOfBlock(10);break;case"normal":t=yield this.getEstimateFeeByNumberOfBlock(6);break;case"fast":t=yield this.getEstimateFeeByNumberOfBlock(3);break;default:t=yield this.getEstimateFeeByNumberOfBlock(6)}return+t.toFixed()}))}}e.exports=o},function(e,t,r){e.exports=r(316)},function(e,t,r){"use strict";var n=r(6),i=r(132),o=r(317),a=r(139);var s=function e(t){var r=new o(t),s=i(o.prototype.request,r);return n.extend(s,o.prototype,r),n.extend(s,r),s.create=function(r){return e(a(t,r))},s}(r(86));s.Axios=o,s.CanceledError=r(55),s.CancelToken=r(331),s.isCancel=r(138),s.VERSION=r(140).version,s.toFormData=r(135),s.AxiosError=r(32),s.Cancel=s.CanceledError,s.all=function(e){return Promise.all(e)},s.spread=r(332),s.isAxiosError=r(333),e.exports=s,e.exports.default=s},function(e,t,r){"use strict";var n=r(6),i=r(133),o=r(318),a=r(319),s=r(139),u=r(137),c=r(330),f=c.validators;function l(e){this.defaults=e,this.interceptors={request:new o,response:new o}}l.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=s(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&c.assertOptions(r,{silentJSONParsing:f.transitional(f.boolean),forcedJSONParsing:f.transitional(f.boolean),clarifyTimeoutError:f.transitional(f.boolean)},!1);var n=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var o,u=[];if(this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)})),!i){var l=[a,void 0];for(Array.prototype.unshift.apply(l,n),l=l.concat(u),o=Promise.resolve(t);l.length;)o=o.then(l.shift(),l.shift());return o}for(var d=t;n.length;){var h=n.shift(),p=n.shift();try{d=h(d)}catch(e){p(e);break}}try{o=a(d)}catch(e){return Promise.reject(e)}for(;u.length;)o=o.then(u.shift(),u.shift());return o},l.prototype.getUri=function(e){e=s(this.defaults,e);var t=u(e.baseURL,e.url);return i(t,e.params,e.paramsSerializer)},n.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,r){return this.request(s(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,i){return this.request(s(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}l.prototype[e]=t(),l.prototype[e+"Form"]=t(!0)})),e.exports=l},function(e,t,r){"use strict";var n=r(6);function i(){this.handlers=[]}i.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},function(e,t,r){"use strict";var n=r(6),i=r(320),o=r(138),a=r(86),s=r(55);function u(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new s}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return u(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(u(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,r){"use strict";var n=r(6),i=r(86);e.exports=function(e,t,r){var o=this||i;return n.forEach(r,(function(r){e=r.call(o,e,t)})),e}},function(e,t,r){"use strict";var n=r(6);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},function(e,t,r){"use strict";var n=r(32);e.exports=function(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(new n("Request failed with status code "+r.status,[n.ERR_BAD_REQUEST,n.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}},function(e,t,r){"use strict";var n=r(6);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,i,o,a){var s=[];s.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),n.isString(i)&&s.push("path="+i),n.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";var n=r(6),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,o,a={};return e?(n.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t){if(a[t]&&i.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([r]):a[t]?a[t]+", "+r:r}})),a):a}},function(e,t,r){"use strict";var n=r(6);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";e.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}},function(e,t){e.exports=null},function(e,t,r){"use strict";var n=r(140).version,i=r(32),o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var a={};o.transitional=function(e,t,r){function o(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,s){if(!1===e)throw new i(o(n," has been removed"+(t?" in "+t:"")),i.ERR_DEPRECATED);return t&&!a[n]&&(a[n]=!0,console.warn(o(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,s)}},e.exports={assertOptions:function(e,t,r){if("object"!=typeof e)throw new i("options must be an object",i.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),o=n.length;o-- >0;){var a=n[o],s=t[a];if(s){var u=e[a],c=void 0===u||s(u,a,e);if(!0!==c)throw new i("option "+a+" must be "+c,i.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new i("Unknown option "+a,i.ERR_BAD_OPTION)}},validators:o}},function(e,t,r){"use strict";var n=r(55);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},i.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";var n=r(6);e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MempoolSpace=t.NowNodes=t.BlockStream=void 0;const i=n(r(335));t.BlockStream=i.default;const o=n(r(336));t.MempoolSpace=o.default;const a=n(r(337));t.NowNodes=a.default},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(r(141));class a extends o.default{constructor(e=!1,t){super(e?"https://blockstream.info/testnet/api":"https://blockstream.info/api")}getRecommendedFeeRate(e="normal"){return n(this,void 0,void 0,(function*(){throw new Error("not supported")}))}}t.default=a},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(141));class o extends i.default{constructor(e=!1,t){super(e?"https://mempool.space/testnet/api":"https://mempool.space/api")}}t.default=o},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const{getAxiosInstance:i}=r(54);e.exports=class{constructor({token:e,timeout:t=3e4},r=!1){this.baseURL=r?"https://btcbook-testnet.nownodes.io/":"https://btcbook.nownodes.io/",this.axios=i({baseUrl:this.baseURL,timeout:t,headers:{"api-key":e}})}getUtxos(e){return n(this,void 0,void 0,(function*(){return(yield this.axios.get("/api/v2/utxo/"+e)).data.map(t=>({address:e,txId:t.txid,index:t.vout,value:Number(t.value),blockNumber:+t.height}))}))}}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TeleportDao=void 0;const i=r(54);class o{constructor(e){const t=e.includes("testnet")?"https://testnet.api.teleportdao.xyz/api/v1":"https://api.teleportdao.xyz/api/v1";this.api=(0,i.getAxiosInstance)({baseUrl:t,headers:{},timeout:18e4})}getLockers(e){return n(this,void 0,void 0,(function*(){return(yield this.api.get("/teleswap/lockers",{params:{network:e}})).data.data.lockers}))}}t.TeleportDao=o,t.default=o},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getAxiosInstance=t.getRandomInteger=t.runWithRetries=t.sleep=void 0;const o=i(r(340));function a(e){return new Promise(t=>setTimeout(t,e))}t.sleep=a,t.runWithRetries=function(e,t={maxTries:2,retrySleep:1e3}){return n(this,void 0,void 0,(function*(){const r=t.maxTries||2,n=t.retrySleep||1e3;let i;for(let t=0;t<r;t+=1){try{return yield e()}catch(e){i=e}yield a(n)}throw i||new Error("function failed after retries")}))},t.getRandomInteger=function(e,t){return Math.floor(Math.random()*(t-e))+e},t.getAxiosInstance=function({baseUrl:e,timeout:t=1e4,headers:r={},auth:n}){let i,a=e;return i=o.default.create({baseURL:a,timeout:t,auth:n,headers:Object.assign({},r)}),i.interceptors.response.use(e=>e,e=>{if(e.response){const t=new Error(JSON.stringify({data:e.response.data,message:e.message}));return Promise.reject(t)}if(e.request){const t=new Error(e.message);return Promise.reject(t)}return Promise.reject(e)}),i}},function(e,t,r){e.exports=r(341)},function(e,t,r){"use strict";var n=r(7),i=r(142),o=r(342),a=r(149);var s=function e(t){var r=new o(t),s=i(o.prototype.request,r);return n.extend(s,o.prototype,r),n.extend(s,r),s.create=function(r){return e(a(t,r))},s}(r(87));s.Axios=o,s.CanceledError=r(56),s.CancelToken=r(356),s.isCancel=r(148),s.VERSION=r(150).version,s.toFormData=r(145),s.AxiosError=r(33),s.Cancel=s.CanceledError,s.all=function(e){return Promise.all(e)},s.spread=r(357),s.isAxiosError=r(358),e.exports=s,e.exports.default=s},function(e,t,r){"use strict";var n=r(7),i=r(143),o=r(343),a=r(344),s=r(149),u=r(147),c=r(355),f=c.validators;function l(e){this.defaults=e,this.interceptors={request:new o,response:new o}}l.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=s(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&c.assertOptions(r,{silentJSONParsing:f.transitional(f.boolean),forcedJSONParsing:f.transitional(f.boolean),clarifyTimeoutError:f.transitional(f.boolean)},!1);var n=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var o,u=[];if(this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)})),!i){var l=[a,void 0];for(Array.prototype.unshift.apply(l,n),l=l.concat(u),o=Promise.resolve(t);l.length;)o=o.then(l.shift(),l.shift());return o}for(var d=t;n.length;){var h=n.shift(),p=n.shift();try{d=h(d)}catch(e){p(e);break}}try{o=a(d)}catch(e){return Promise.reject(e)}for(;u.length;)o=o.then(u.shift(),u.shift());return o},l.prototype.getUri=function(e){e=s(this.defaults,e);var t=u(e.baseURL,e.url);return i(t,e.params,e.paramsSerializer)},n.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,r){return this.request(s(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,i){return this.request(s(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}l.prototype[e]=t(),l.prototype[e+"Form"]=t(!0)})),e.exports=l},function(e,t,r){"use strict";var n=r(7);function i(){this.handlers=[]}i.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},function(e,t,r){"use strict";var n=r(7),i=r(345),o=r(148),a=r(87),s=r(56);function u(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new s}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return u(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(u(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,r){"use strict";var n=r(7),i=r(87);e.exports=function(e,t,r){var o=this||i;return n.forEach(r,(function(r){e=r.call(o,e,t)})),e}},function(e,t,r){"use strict";var n=r(7);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},function(e,t,r){"use strict";var n=r(33);e.exports=function(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(new n("Request failed with status code "+r.status,[n.ERR_BAD_REQUEST,n.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}},function(e,t,r){"use strict";var n=r(7);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,i,o,a){var s=[];s.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),n.isString(i)&&s.push("path="+i),n.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";var n=r(7),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,o,a={};return e?(n.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t){if(a[t]&&i.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([r]):a[t]?a[t]+", "+r:r}})),a):a}},function(e,t,r){"use strict";var n=r(7);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";e.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}},function(e,t){e.exports=null},function(e,t,r){"use strict";var n=r(150).version,i=r(33),o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var a={};o.transitional=function(e,t,r){function o(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,s){if(!1===e)throw new i(o(n," has been removed"+(t?" in "+t:"")),i.ERR_DEPRECATED);return t&&!a[n]&&(a[n]=!0,console.warn(o(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,s)}},e.exports={assertOptions:function(e,t,r){if("object"!=typeof e)throw new i("options must be an object",i.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),o=n.length;o-- >0;){var a=n[o],s=t[a];if(s){var u=e[a],c=void 0===u||s(u,a,e);if(!0!==c)throw new i("option "+a+" must be "+c,i.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new i("Unknown option "+a,i.ERR_BAD_OPTION)}},validators:o}},function(e,t,r){"use strict";var n=r(56);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},i.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";var n=r(7);e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},function(e,t,r){"use strict";const{requestTypes:n}=r(151).teleswap,{BigNumber:i}=r(369);function o(e){let t="4c"===e.slice(2,4)?e.slice(6):e.slice(4),r=(Number("0x"+t.slice(0,2)),t.slice(2,6));if(!r)return{status:!1,message:"invalid OP_RETURN data : "+t,code:"INVALID_APP_ID"};let o=Number("0x"+r);switch(Object.keys(n).find(e=>o>=n[e].appIdRange[0]&&o<=n[e].appIdRange[1])){case"transfer":case"exchange":return function(e){let t={requestType:"transfer"},r=0;return t.chainId=Number("0x"+e.slice(r,r+=2)),t.appId=Number("0x"+e.slice(r,r+=4)),t.recipientAddress="0x"+e.slice(r,r+=40),t.percentageFee=Number("0x"+e.slice(r,r+=4))/100,t.speed="01"===e.slice(r,r+=2),e.length===r?{status:!0,data:t}:(t.requestType="exchange",t.exchangeTokenAddress="0x"+e.slice(r,r+=40),t.outputAmount=new i("0x"+e.slice(r,r+=56)).toFixed(),t.deadline=new i("0x"+e.slice(r,r+=8)).toFixed(),t.isFixedToken="01"===e.slice(r,r+=2),e.length===r?{status:!0,data:t}:{status:!1,message:`invalid OP_RETURN data for requestType: 'transfer or exchange'. invalid data length : ${e.length} - valid length : ${r}`,code:"INVALID_OP_RETURN"})}(t);case"lend":return function(e){let t={requestType:"lend"},r=0;return t.chainId=Number("0x"+e.slice(r,r+=2)),t.appId=Number("0x"+e.slice(r,r+=4)),t.recipientAddress="0x"+e.slice(r,r+=40),t.percentageFee=Number("0x"+e.slice(r,r+=4))/100,t.mode=Number("0x"+e.slice(r,r+=2)),e.length===r?{status:!0,data:t}:(t.requestType="borrow",t.tokenAddress="0x"+e.slice(r,r+=40),t.borrowAmount=Number("0x"+e.slice(r,r+=56)),e.length===r?{status:!0,data:t}:{status:!1,message:`invalid OP_RETURN data for requestType: 'lend or borrow'. invalid data length : ${e.length} - valid length : ${r}`,code:"INVALID_OP_RETURN"})}(t);default:return{status:!1,message:"invalid appId : "+o,code:"INVALID_OP_RETURN"}}}e.exports={checkAndParseProtocolRequest:function(e,t,r={minTeleporterFeeAmount:0}){var n,i;let a=e.findIndex(e=>e.script.startsWith("6a"));if(a>=0){let s=(null===(n=e[a])||void 0===n?void 0:n.script)||null,u=(null===(i=e.findIndex(e=>e.address===t))||void 0===i?void 0:i.value)||0,c=u>=0&&e[u].value||0,f=o(s);return f.status?function(e,t,r,n,{minTeleporterFeeAmount:i=0}){return e?+e.percentageFee>100?{status:!1,message:"percentageFee greater than 100 is invalid. percentageFee: "+e.percentageFee,code:"INVALID_FEE"}:e.percentageFee/100*+r<=i?{status:!1,message:`fee amount is less than or equal minimum teleporter fee amount.percentageFee: ${e.percentageFee} - value: ${r} - feeAmount ${(e.percentageFee/100*+r).toFixed(8)} - minimumFee: ${i}`,code:"NOT_ACCEPTED_BY_TELEPORTER"}:{status:!0,data:e,requestOutputIndex:t,value:r,valueOutputIndex:n}:{status:!1,message:"no data to validate. it should not happen",code:"NOT_ACCEPTED_BY_TELEPORTER"}}(f.data,a,c,u,r):f}return{status:!1,message:"transaction outputs should contain OP_RETURN",code:"NO_OP_RETURN"}}}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.otherTokens=void 0,o(r(361),t),o(r(362),t),t.otherTokens=a(r(363))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.chainInfo=void 0,t.chainInfo={ethereum:{name:"ethereum",chainId:1},ethereum_testnet:{name:"goerli",chainId:3},bsc:{name:"binance_smart_chain",chainId:56},bsc_testnet:{name:"binance_smart_chain_testnet",chainId:97},polygon:{name:"polygon",chainId:137},polygon_testnet:{name:"mumbai",chainId:137}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hdWalletPath=void 0,t.hdWalletPath={bitcoin:{p2pkh:"m/44'/0'/0'",p2wpkh:"m/84'/0'/0'","p2sh-p2wpkh":"m/49'/0'/0'",p2sh:"m/80'/0'/0'",p2wsh:"m/85'/0'/0'","p2sh-p2wsh":"m/90'/0'/0'",p2tr:"m/84'/0'/0'"},ethereum:"m/44'/60'/0'"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bsc=t.polygon=void 0,t.polygon={mainnet:{DAIAddress:"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",USDTAddress:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",USDCAddress:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",WBTCAddress:"0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",SANDAddress:"0xBbba073C31bF03b8ACf7c28EF0738DeCF3695683",WBNBAddress:"",WETHAddress:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",WMATICAddress:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"},testnet:{WMATICAddress:"0x9c3c9283d3e44854697cd22d3faa240cfb032889"}},t.bsc={mainnet:{USDTAddress:"0x55d398326f99059fF775485246999027B3197955",USDCAddress:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",WBNBAddress:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",WETHAddress:"0x5DA5DA6933637c1cAfa5de9FdF2aCb1B3758C9e3"},testnet:{USDTAddress:"",USDCAddress:"",WBNBAddress:"0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd",WETHAddress:"0xd66c6B4F0be8CE5b39D52E0Fd1344c389929B378"}}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.tokensInfo=t.contractsInfo=t.requestTypes=t.bitcoinAddressTypes=void 0;var s=r(365);Object.defineProperty(t,"bitcoinAddressTypes",{enumerable:!0,get:function(){return s.addressTypeHelper}});var u=r(366);Object.defineProperty(t,"requestTypes",{enumerable:!0,get:function(){return a(u).default}}),t.contractsInfo=o(r(367)),t.tokensInfo=o(r(368))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addressTypeHelper=void 0,t.addressTypeHelper={addressTypesNumber:{p2pk:0,p2pkh:1,p2sh:2,p2wpkh:3,p2wsh:4,p2tr:5},addressTypes:["p2pk","p2pkh","p2sh","p2wpkh","p2wsh","p2tr"]},t.default=t.addressTypeHelper},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={transfer:{appIdRange:[1,1],default:1},exchange:{appIdRange:[10,30],default:20},lend:{appIdRange:[100,200],default:100}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bsc=t.polygon=void 0,t.polygon={mainnet:{exchangeConnectorAddress:"0x0C28968d8A3Af022F47D493402D35Cb42EFF0597",exchangeFactoryAddress:"0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32",exchangeRouterAddress:"0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff",priceOracleAddress:"0x96b76ab42289688b68882cdccd071b2c39b0165e",relayAddress:"0x7DeB66341b1d499D7e699589d0cf665De4132EA3",lendingAddress:"",ccTransferAddress:"0x04367D74332137908BEF9acc0Ab00a299A823707",ccExchangeAddress:"0xD1E9Ff33EC28f9Dd8D99E685a2B0F29dCaa095a3",ccBurnAddress:"0x0009876C47F6b2f0BCB41eb9729736757486c75f",lockerAddress:"0xf5D6D369A7F4147F720AEAdd4C4f903aE8046166"},testnet:{exchangeConnectorAddress:"0x0C28968d8A3Af022F47D493402D35Cb42EFF0597",exchangeFactoryAddress:"0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32",exchangeRouterAddress:"0x8954AfA98594b838bda56FE4C12a09D7739D179b",priceOracleAddress:"0x96B76aB42289688b68882CDcCd071B2C39b0165E",relayAddress:"0x5b845e3EB38d78cD5006C04b0Bc78692b5535F56",lendingAddress:"",ccTransferAddress:"0xbD97529bB755ac4f17e3Ef648b6230d3e93F84F0",ccExchangeAddress:"0x9D35634aBF331204CAd28BF9c37B49792A1E69e3",ccBurnAddress:"0x4779BB3c43C86baf60f7b30e0e19872B7d90ae7f",lockerAddress:"0xf5D6D369A7F4147F720AEAdd4C4f903aE8046166"}},t.bsc={mainnet:{exchangeConnectorAddress:"0x856D80F77349F675Ea7E3477aD75Ef57349e777b",exchangeFactoryAddress:"0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73",exchangeRouterAddress:"0x10ED43C718714eb63d5aA57B78B54704E256024E",priceOracleAddress:"0x7Aabb0779782247384A1C91844211516E93b1D63",relayAddress:"0xFcd688999c25D5493571543137cEeb4fbDb44D02",lendingAddress:"",ccTransferAddress:"0xA38aD0d52B89C20c2229E916358D2CeB45BeC5FF",ccExchangeAddress:"0xcA5416364720c7324A547d39b1db496A2DCd4F0D",ccBurnAddress:"0x2787D48e0B74125597DD479978a5DE09Bb9a3C15",lockerAddress:"0x84F74e97ebab432CeE185d601290cE0A483987A5"},testnet:{exchangeConnectorAddress:"0xF789b50D17CF214d5774ce1a52Fb6581d72118fE",exchangeFactoryAddress:"0xB7926C0430Afb07AA7DEfDE6DA862aE0Bde767bc",exchangeRouterAddress:"0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3",priceOracleAddress:"0xF364F92D5d0D4Ee173983da8b74e2eB1D7A319D2",relayAddress:"0x66840C47684338216fE0498CFd649186D662d8a0",lendingAddress:"",ccTransferAddress:"0x699Ab6dE8791B9E895Afa5B1e36a6F8F64294D0a",ccExchangeAddress:"0xA029A35027233C4640A815D3574f36f652A47C41",ccBurnAddress:"0x090aB5B43F440700F8E73fB822f81cAbE82fd05B",lockerAddress:"0xba44564920f2c5b69C7729FFd465b3095e08Ea35"}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bsc=t.polygon=void 0,t.polygon={mainnet:{teleBTCAddress:"0x3BF668Fe1ec79a84cA8481CEAD5dbb30d61cC685"},testnet:{teleBTCAddress:"0x515D720B9D219f1931205D5B8D842bE1Fe2FeBDE"}},t.bsc={mainnet:{teleBTCAddress:"0xC58C1117DA964aEbe91fEF88f6f5703e79bdA574"},testnet:{teleBTCAddress:"0x2dC0a21691a3A0B8ED353Bf43f964966e2a65Cfd"}}},function(e,t,r){var n;!function(i){"use strict";var o,a=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s=Math.ceil,u=Math.floor,c="[BigNumber Error] ",f=c+"Number primitive has more than 15 significant digits: ",l=1e14,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],h=1e9;function p(e){var t=0|e;return e>0||e===t?t:t-1}function b(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(r=14-(t=e[n++]+"").length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function m(e,t){var r,n,i=e.c,o=t.c,a=e.s,s=t.s,u=e.e,c=t.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==c,!i||!o)return n?0:!i^r?1:-1;if(!n)return u>c^r?1:-1;for(s=(u=i.length)<(c=o.length)?u:c,a=0;a<s;a++)if(i[a]!=o[a])return i[a]>o[a]^r?1:-1;return u==c?0:u>c^r?1:-1}function g(e,t,r,n){if(e<t||e>r||e!==u(e))throw Error(c+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function y(e){var t=e.c.length-1;return p(e.e/14)==t&&e.c[t]%2!=0}function v(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function w(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}(o=function e(t){var r,n,i,o,_,E,k,S,x,T=L.prototype={constructor:L,toString:null,valueOf:null},A=new L(1),P=20,O=4,I=-7,B=21,M=-1e7,R=1e7,N=!1,j=1,U=0,C={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},H="0123456789abcdefghijklmnopqrstuvwxyz",z=!0;function L(e,t){var r,o,s,c,l,d,h,p,b=this;if(!(b instanceof L))return new L(e,t);if(null==t){if(e&&!0===e._isBigNumber)return b.s=e.s,void(!e.c||e.e>R?b.c=b.e=null:e.e<M?b.c=[b.e=0]:(b.e=e.e,b.c=e.c.slice()));if((d="number"==typeof e)&&0*e==0){if(b.s=1/e<0?(e=-e,-1):1,e===~~e){for(c=0,l=e;l>=10;l/=10,c++);return void(c>R?b.c=b.e=null:(b.e=c,b.c=[e]))}p=String(e)}else{if(!a.test(p=String(e)))return i(b,p,d);b.s=45==p.charCodeAt(0)?(p=p.slice(1),-1):1}(c=p.indexOf("."))>-1&&(p=p.replace(".","")),(l=p.search(/e/i))>0?(c<0&&(c=l),c+=+p.slice(l+1),p=p.substring(0,l)):c<0&&(c=p.length)}else{if(g(t,2,H.length,"Base"),10==t&&z)return K(b=new L(e),P+b.e+1,O);if(p=String(e),d="number"==typeof e){if(0*e!=0)return i(b,p,d,t);if(b.s=1/e<0?(p=p.slice(1),-1):1,L.DEBUG&&p.replace(/^0\.0*|\./,"").length>15)throw Error(f+e)}else b.s=45===p.charCodeAt(0)?(p=p.slice(1),-1):1;for(r=H.slice(0,t),c=l=0,h=p.length;l<h;l++)if(r.indexOf(o=p.charAt(l))<0){if("."==o){if(l>c){c=h;continue}}else if(!s&&(p==p.toUpperCase()&&(p=p.toLowerCase())||p==p.toLowerCase()&&(p=p.toUpperCase()))){s=!0,l=-1,c=0;continue}return i(b,String(e),d,t)}d=!1,(c=(p=n(p,t,10,b.s)).indexOf("."))>-1?p=p.replace(".",""):c=p.length}for(l=0;48===p.charCodeAt(l);l++);for(h=p.length;48===p.charCodeAt(--h););if(p=p.slice(l,++h)){if(h-=l,d&&L.DEBUG&&h>15&&(e>9007199254740991||e!==u(e)))throw Error(f+b.s*e);if((c=c-l-1)>R)b.c=b.e=null;else if(c<M)b.c=[b.e=0];else{if(b.e=c,b.c=[],l=(c+1)%14,c<0&&(l+=14),l<h){for(l&&b.c.push(+p.slice(0,l)),h-=14;l<h;)b.c.push(+p.slice(l,l+=14));l=14-(p=p.slice(l)).length}else l-=h;for(;l--;p+="0");b.c.push(+p)}}else b.c=[b.e=0]}function D(e,t,r,n){var i,o,a,s,u;if(null==r?r=O:g(r,0,8),!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)u=b(e.c),u=1==n||2==n&&(a<=I||a>=B)?v(u,a):w(u,a,"0");else if(o=(e=K(new L(e),t,r)).e,s=(u=b(e.c)).length,1==n||2==n&&(t<=o||o<=I)){for(;s<t;u+="0",s++);u=v(u,o)}else if(t-=a,u=w(u,o,"0"),o+1>s){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=o-s)>0)for(o+1==s&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function F(e,t){for(var r,n=1,i=new L(e[0]);n<e.length;n++){if(!(r=new L(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function q(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+14*r-1)>R?e.c=e.e=null:r<M?e.c=[e.e=0]:(e.e=r,e.c=t),e}function K(e,t,r,n){var i,o,a,c,f,h,p,b=e.c,m=d;if(b){e:{for(i=1,c=b[0];c>=10;c/=10,i++);if((o=t-i)<0)o+=14,a=t,p=(f=b[h=0])/m[i-a-1]%10|0;else if((h=s((o+1)/14))>=b.length){if(!n)break e;for(;b.length<=h;b.push(0));f=p=0,i=1,a=(o%=14)-14+1}else{for(f=c=b[h],i=1;c>=10;c/=10,i++);p=(a=(o%=14)-14+i)<0?0:f/m[i-a-1]%10|0}if(n=n||t<0||null!=b[h+1]||(a<0?f:f%m[i-a-1]),n=r<4?(p||n)&&(0==r||r==(e.s<0?3:2)):p>5||5==p&&(4==r||n||6==r&&(o>0?a>0?f/m[i-a]:0:b[h-1])%10&1||r==(e.s<0?8:7)),t<1||!b[0])return b.length=0,n?(t-=e.e+1,b[0]=m[(14-t%14)%14],e.e=-t||0):b[0]=e.e=0,e;if(0==o?(b.length=h,c=1,h--):(b.length=h+1,c=m[14-o],b[h]=a>0?u(f/m[i-a]%m[a])*c:0),n)for(;;){if(0==h){for(o=1,a=b[0];a>=10;a/=10,o++);for(a=b[0]+=c,c=1;a>=10;a/=10,c++);o!=c&&(e.e++,b[0]==l&&(b[0]=1));break}if(b[h]+=c,b[h]!=l)break;b[h--]=0,c=1}for(o=b.length;0===b[--o];b.pop());}e.e>R?e.c=e.e=null:e.e<M&&(e.c=[e.e=0])}return e}function W(e){var t,r=e.e;return null===r?e.toString():(t=b(e.c),t=r<=I||r>=B?v(t,r):w(t,r,"0"),e.s<0?"-"+t:t)}return L.clone=e,L.ROUND_UP=0,L.ROUND_DOWN=1,L.ROUND_CEIL=2,L.ROUND_FLOOR=3,L.ROUND_HALF_UP=4,L.ROUND_HALF_DOWN=5,L.ROUND_HALF_EVEN=6,L.ROUND_HALF_CEIL=7,L.ROUND_HALF_FLOOR=8,L.EUCLID=9,L.config=L.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(c+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(g(r=e[t],0,h,t),P=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(g(r=e[t],0,8,t),O=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(g(r[0],-h,0,t),g(r[1],0,h,t),I=r[0],B=r[1]):(g(r,-h,h,t),I=-(B=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)g(r[0],-h,-1,t),g(r[1],1,h,t),M=r[0],R=r[1];else{if(g(r,-h,h,t),!r)throw Error(c+t+" cannot be zero: "+r);M=-(R=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(c+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw N=!r,Error(c+"crypto unavailable");N=r}else N=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(g(r=e[t],0,9,t),j=r),e.hasOwnProperty(t="POW_PRECISION")&&(g(r=e[t],0,h,t),U=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(c+t+" not an object: "+r);C=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(c+t+" invalid: "+r);z="0123456789"==r.slice(0,10),H=r}}return{DECIMAL_PLACES:P,ROUNDING_MODE:O,EXPONENTIAL_AT:[I,B],RANGE:[M,R],CRYPTO:N,MODULO_MODE:j,POW_PRECISION:U,FORMAT:C,ALPHABET:H}},L.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!L.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-h&&i<=h&&i===u(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%14)<1&&(t+=14),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=l||r!==u(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(c+"Invalid BigNumber: "+e)},L.maximum=L.max=function(){return F(arguments,T.lt)},L.minimum=L.min=function(){return F(arguments,T.gt)},L.random=(o=9007199254740992*Math.random()&2097151?function(){return u(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,a,f=0,l=[],p=new L(A);if(null==e?e=P:g(e,0,h),i=s(e/14),N)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));f<i;)(a=131072*t[f]+(t[f+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[f]=r[0],t[f+1]=r[1]):(l.push(a%1e14),f+=2);f=i/2}else{if(!crypto.randomBytes)throw N=!1,Error(c+"crypto unavailable");for(t=crypto.randomBytes(i*=7);f<i;)(a=281474976710656*(31&t[f])+1099511627776*t[f+1]+4294967296*t[f+2]+16777216*t[f+3]+(t[f+4]<<16)+(t[f+5]<<8)+t[f+6])>=9e15?crypto.randomBytes(7).copy(t,f):(l.push(a%1e14),f+=7);f=i/7}if(!N)for(;f<i;)(a=o())<9e15&&(l[f++]=a%1e14);for(e%=14,(i=l[--f])&&e&&(a=d[14-e],l[f]=u(i/a)*a);0===l[f];l.pop(),f--);if(f<0)l=[n=0];else{for(n=-1;0===l[0];l.splice(0,1),n-=14);for(f=1,a=l[0];a>=10;a/=10,f++);f<14&&(n-=14-f)}return p.e=n,p.c=l,p}),L.sum=function(){for(var e=1,t=arguments,r=new L(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){function e(e,t,r,n){for(var i,o,a=[0],s=0,u=e.length;s<u;){for(o=a.length;o--;a[o]*=t);for(a[0]+=n.indexOf(e.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(t,n,i,o,a){var s,u,c,f,l,d,h,p,m=t.indexOf("."),g=P,y=O;for(m>=0&&(f=U,U=0,t=t.replace(".",""),d=(p=new L(n)).pow(t.length-m),U=f,p.c=e(w(b(d.c),d.e,"0"),10,i,"0123456789"),p.e=p.c.length),c=f=(h=e(t,n,i,a?(s=H,"0123456789"):(s="0123456789",H))).length;0==h[--f];h.pop());if(!h[0])return s.charAt(0);if(m<0?--c:(d.c=h,d.e=c,d.s=o,h=(d=r(d,p,g,y,i)).c,l=d.r,c=d.e),m=h[u=c+g+1],f=i/2,l=l||u<0||null!=h[u+1],l=y<4?(null!=m||l)&&(0==y||y==(d.s<0?3:2)):m>f||m==f&&(4==y||l||6==y&&1&h[u-1]||y==(d.s<0?8:7)),u<1||!h[0])t=l?w(s.charAt(1),-g,s.charAt(0)):s.charAt(0);else{if(h.length=u,l)for(--i;++h[--u]>i;)h[u]=0,u||(++c,h=[1].concat(h));for(f=h.length;!h[--f];);for(m=0,t="";m<=f;t+=s.charAt(h[m++]));t=w(t,c,s.charAt(0))}return t}}(),r=function(){function e(e,t,r){var n,i,o,a,s=0,u=e.length,c=t%1e7,f=t/1e7|0;for(e=e.slice();u--;)s=((i=c*(o=e[u]%1e7)+(n=f*o+(a=e[u]/1e7|0)*c)%1e7*1e7+s)/r|0)+(n/1e7|0)+f*a,e[u]=i%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,a,s){var c,f,d,h,b,m,g,y,v,w,_,E,k,S,x,T,A,P=n.s==i.s?1:-1,O=n.c,I=i.c;if(!(O&&O[0]&&I&&I[0]))return new L(n.s&&i.s&&(O?!I||O[0]!=I[0]:I)?O&&0==O[0]||!I?0*P:P/0:NaN);for(v=(y=new L(P)).c=[],P=o+(f=n.e-i.e)+1,s||(s=l,f=p(n.e/14)-p(i.e/14),P=P/14|0),d=0;I[d]==(O[d]||0);d++);if(I[d]>(O[d]||0)&&f--,P<0)v.push(1),h=!0;else{for(S=O.length,T=I.length,d=0,P+=2,(b=u(s/(I[0]+1)))>1&&(I=e(I,b,s),O=e(O,b,s),T=I.length,S=O.length),k=T,_=(w=O.slice(0,T)).length;_<T;w[_++]=0);A=I.slice(),A=[0].concat(A),x=I[0],I[1]>=s/2&&x++;do{if(b=0,(c=t(I,w,T,_))<0){if(E=w[0],T!=_&&(E=E*s+(w[1]||0)),(b=u(E/x))>1)for(b>=s&&(b=s-1),g=(m=e(I,b,s)).length,_=w.length;1==t(m,w,g,_);)b--,r(m,T<g?A:I,g,s),g=m.length,c=1;else 0==b&&(c=b=1),g=(m=I.slice()).length;if(g<_&&(m=[0].concat(m)),r(w,m,_,s),_=w.length,-1==c)for(;t(I,w,T,_)<1;)b++,r(w,T<_?A:I,_,s),_=w.length}else 0===c&&(b++,w=[0]);v[d++]=b,w[0]?w[_++]=O[k]||0:(w=[O[k]],_=1)}while((k++<S||null!=w[0])&&P--);h=null!=w[0],v[0]||v.splice(0,1)}if(s==l){for(d=1,P=v[0];P>=10;P/=10,d++);K(y,o+(y.e=d+14*f-1)+1,a,h)}else y.e=f,y.r=+h;return y}}(),_=/^(-?)0([xbo])(?=\w[\w.]*$)/i,E=/^([^.]+)\.$/,k=/^\.([^.]+)$/,S=/^-?(Infinity|NaN)$/,x=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(x,"");if(S.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(_,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(E,"$1").replace(k,"0.$1")),t!=o))return new L(o,i);if(L.DEBUG)throw Error(c+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},T.absoluteValue=T.abs=function(){var e=new L(this);return e.s<0&&(e.s=1),e},T.comparedTo=function(e,t){return m(this,new L(e,t))},T.decimalPlaces=T.dp=function(e,t){var r,n,i,o=this;if(null!=e)return g(e,0,h),null==t?t=O:g(t,0,8),K(new L(o),e+o.e+1,t);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},T.dividedBy=T.div=function(e,t){return r(this,new L(e,t),P,O)},T.dividedToIntegerBy=T.idiv=function(e,t){return r(this,new L(e,t),0,1)},T.exponentiatedBy=T.pow=function(e,t){var r,n,i,o,a,f,l,d,h=this;if((e=new L(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+W(e));if(null!=t&&(t=new L(t)),a=e.e>14,!h.c||!h.c[0]||1==h.c[0]&&!h.e&&1==h.c.length||!e.c||!e.c[0])return d=new L(Math.pow(+W(h),a?e.s*(2-y(e)):+W(e))),t?d.mod(t):d;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new L(NaN);(n=!f&&h.isInteger()&&t.isInteger())&&(h=h.mod(t))}else{if(e.e>9&&(h.e>0||h.e<-1||(0==h.e?h.c[0]>1||a&&h.c[1]>=24e7:h.c[0]<8e13||a&&h.c[0]<=9999975e7)))return o=h.s<0&&y(e)?-0:0,h.e>-1&&(o=1/o),new L(f?1/o:o);U&&(o=s(U/14+2))}for(a?(r=new L(.5),f&&(e.s=1),l=y(e)):l=(i=Math.abs(+W(e)))%2,d=new L(A);;){if(l){if(!(d=d.times(h)).c)break;o?d.c.length>o&&(d.c.length=o):n&&(d=d.mod(t))}if(i){if(0===(i=u(i/2)))break;l=i%2}else if(K(e=e.times(r),e.e+1,1),e.e>14)l=y(e);else{if(0===(i=+W(e)))break;l=i%2}h=h.times(h),o?h.c&&h.c.length>o&&(h.c.length=o):n&&(h=h.mod(t))}return n?d:(f&&(d=A.div(d)),t?d.mod(t):o?K(d,U,O,void 0):d)},T.integerValue=function(e){var t=new L(this);return null==e?e=O:g(e,0,8),K(t,t.e+1,e)},T.isEqualTo=T.eq=function(e,t){return 0===m(this,new L(e,t))},T.isFinite=function(){return!!this.c},T.isGreaterThan=T.gt=function(e,t){return m(this,new L(e,t))>0},T.isGreaterThanOrEqualTo=T.gte=function(e,t){return 1===(t=m(this,new L(e,t)))||0===t},T.isInteger=function(){return!!this.c&&p(this.e/14)>this.c.length-2},T.isLessThan=T.lt=function(e,t){return m(this,new L(e,t))<0},T.isLessThanOrEqualTo=T.lte=function(e,t){return-1===(t=m(this,new L(e,t)))||0===t},T.isNaN=function(){return!this.s},T.isNegative=function(){return this.s<0},T.isPositive=function(){return this.s>0},T.isZero=function(){return!!this.c&&0==this.c[0]},T.minus=function(e,t){var r,n,i,o,a=this,s=a.s;if(t=(e=new L(e,t)).s,!s||!t)return new L(NaN);if(s!=t)return e.s=-t,a.plus(e);var u=a.e/14,c=e.e/14,f=a.c,d=e.c;if(!u||!c){if(!f||!d)return f?(e.s=-t,e):new L(d?a:NaN);if(!f[0]||!d[0])return d[0]?(e.s=-t,e):new L(f[0]?a:3==O?-0:0)}if(u=p(u),c=p(c),f=f.slice(),s=u-c){for((o=s<0)?(s=-s,i=f):(c=u,i=d),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(n=(o=(s=f.length)<(t=d.length))?s:t,s=t=0;t<n;t++)if(f[t]!=d[t]){o=f[t]<d[t];break}if(o&&(i=f,f=d,d=i,e.s=-e.s),(t=(n=d.length)-(r=f.length))>0)for(;t--;f[r++]=0);for(t=l-1;n>s;){if(f[--n]<d[n]){for(r=n;r&&!f[--r];f[r]=t);--f[r],f[n]+=l}f[n]-=d[n]}for(;0==f[0];f.splice(0,1),--c);return f[0]?q(e,f,c):(e.s=3==O?-1:1,e.c=[e.e=0],e)},T.modulo=T.mod=function(e,t){var n,i,o=this;return e=new L(e,t),!o.c||!e.s||e.c&&!e.c[0]?new L(NaN):!e.c||o.c&&!o.c[0]?new L(o):(9==j?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,j),(e=o.minus(n.times(e))).c[0]||1!=j||(e.s=o.s),e)},T.multipliedBy=T.times=function(e,t){var r,n,i,o,a,s,u,c,f,d,h,b,m,g,y=this,v=y.c,w=(e=new L(e,t)).c;if(!(v&&w&&v[0]&&w[0]))return!y.s||!e.s||v&&!v[0]&&!w||w&&!w[0]&&!v?e.c=e.e=e.s=null:(e.s*=y.s,v&&w?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=p(y.e/14)+p(e.e/14),e.s*=y.s,(u=v.length)<(d=w.length)&&(m=v,v=w,w=m,i=u,u=d,d=i),i=u+d,m=[];i--;m.push(0));for(g=l,1e7,i=d;--i>=0;){for(r=0,h=w[i]%1e7,b=w[i]/1e7|0,o=i+(a=u);o>i;)r=((c=h*(c=v[--a]%1e7)+(s=b*c+(f=v[a]/1e7|0)*h)%1e7*1e7+m[o]+r)/g|0)+(s/1e7|0)+b*f,m[o--]=c%g;m[o]=r}return r?++n:m.splice(0,1),q(e,m,n)},T.negated=function(){var e=new L(this);return e.s=-e.s||null,e},T.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new L(e,t)).s,!i||!t)return new L(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/14,a=e.e/14,s=n.c,u=e.c;if(!o||!a){if(!s||!u)return new L(i/0);if(!s[0]||!u[0])return u[0]?e:new L(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)-(t=u.length)<0&&(r=u,u=s,s=r,t=i),i=0;t;)i=(s[--t]=s[t]+u[t]+i)/l|0,s[t]=l===s[t]?0:s[t]%l;return i&&(s=[i].concat(s),++a),q(e,s,a)},T.precision=T.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return g(e,1,h),null==t?t=O:g(t,0,8),K(new L(o),e,t);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 e&&o.e+1>n&&(n=o.e+1),n},T.shiftedBy=function(e){return g(e,-9007199254740991,9007199254740991),this.times("1e"+e)},T.squareRoot=T.sqrt=function(){var e,t,n,i,o,a=this,s=a.c,u=a.s,c=a.e,f=P+4,l=new L("0.5");if(1!==u||!s||!s[0])return new L(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(u=Math.sqrt(+W(a)))||u==1/0?(((t=b(s)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=p((c+1)/2)-(c<0||c%2),n=new L(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new L(u+""),n.c[0])for((u=(c=n.e)+f)<3&&(u=0);;)if(o=n,n=l.times(o.plus(r(a,o,f,1))),b(o.c).slice(0,u)===(t=b(n.c)).slice(0,u)){if(n.e<c&&--u,"9999"!=(t=t.slice(u-3,u+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(K(n,n.e+P+2,1),e=!n.times(n).eq(a));break}if(!i&&(K(o,o.e+P+2,0),o.times(o).eq(a))){n=o;break}f+=4,u+=4,i=1}return K(n,n.e+P+1,O,e)},T.toExponential=function(e,t){return null!=e&&(g(e,0,h),e++),D(this,e,t,1)},T.toFixed=function(e,t){return null!=e&&(g(e,0,h),e=e+this.e+1),D(this,e,t)},T.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=C;else if("object"!=typeof r)throw Error(c+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,a=n.split("."),s=+r.groupSize,u=+r.secondaryGroupSize,f=r.groupSeparator||"",l=a[0],d=a[1],h=i.s<0,p=h?l.slice(1):l,b=p.length;if(u&&(o=s,s=u,u=o,b-=o),s>0&&b>0){for(o=b%s||s,l=p.substr(0,o);o<b;o+=s)l+=f+p.substr(o,s);u>0&&(l+=f+p.slice(o)),h&&(l="-"+l)}n=d?l+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?d.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):d):l}return(r.prefix||"")+n+(r.suffix||"")},T.toFraction=function(e){var t,n,i,o,a,s,u,f,l,h,p,m,g=this,y=g.c;if(null!=e&&(!(u=new L(e)).isInteger()&&(u.c||1!==u.s)||u.lt(A)))throw Error(c+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+W(u));if(!y)return new L(g);for(t=new L(A),l=n=new L(A),i=f=new L(A),m=b(y),a=t.e=m.length-g.e-1,t.c[0]=d[(s=a%14)<0?14+s:s],e=!e||u.comparedTo(t)>0?a>0?t:l:u,s=R,R=1/0,u=new L(m),f.c[0]=0;h=r(u,t,0,1),1!=(o=n.plus(h.times(i))).comparedTo(e);)n=i,i=o,l=f.plus(h.times(o=l)),f=o,t=u.minus(h.times(o=t)),u=o;return o=r(e.minus(n),i,0,1),f=f.plus(o.times(l)),n=n.plus(o.times(i)),f.s=l.s=g.s,p=r(l,i,a*=2,O).minus(g).abs().comparedTo(r(f,n,a,O).minus(g).abs())<1?[l,i]:[f,n],R=s,p},T.toNumber=function(){return+W(this)},T.toPrecision=function(e,t){return null!=e&&g(e,1,h),D(this,e,t,2)},T.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=I||o>=B?v(b(r.c),o):w(b(r.c),o,"0"):10===e&&z?t=w(b((r=K(new L(r),P+o+1,O)).c),r.e,"0"):(g(e,2,H.length,"Base"),t=n(w(b(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},T.valueOf=T.toJSON=function(){return W(this)},T._isBigNumber=!0,null!=t&&L.set(t),L}()).default=o.BigNumber=o,void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},function(e,t,r){"use strict";e.exports={getBurnTransactionInfo:function(e,t=[],r=[]){let n=t.findIndex(t=>t.address===e);if(n>=0){let i=t[n];i.vinIndex=n;let o=t.reduce((e,t)=>+e+ +t.value,0),a=[],s=[];for(let t in r){let n=Object.assign(Object.assign({},r[t]),{index:t});n.address===e?s.push(n):a.push(n)}return{receivers:a,changes:s,totalInputValue:o,lockerVin:i}}return null}}},function(e,t,r){"use strict";(function(e){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(35),c=s(r(75)),f=o(r(117)).ECPair;function l(t,r={},n){let i=t,o=f.fromPrivateKey(t,{network:n,compressed:!0});if(!o.privateKey)throw new Error("private key not exist");o.publicKey.toString("hex").startsWith("03")&&(i=c.default.privateNegate(o.privateKey));const a=c.default.privateAdd(i,(s=e.from(o.publicKey.toString("hex").slice(2),"hex"),l=null==r?void 0:r.tweakHash,u.crypto.taggedHash("TapTweak",e.concat(l?[s,l]:[s]))));var s,l;if(!a)throw new Error("Invalid tweaked private key!");return f.fromPrivateKey(e.from(a),{network:n})}t.default=class{constructor(e){this.network=e}signPsbt(e,t){return a(this,void 0,void 0,(function*(){const{network:r}=this,n=f.fromPrivateKey(t,{network:r,compressed:!0}),i=u.Psbt.fromBase64(e.unsignedTransaction,{network:r});let o=i.inputCount;for(let e=0;e<o;e+=1){if("nonstandard"===i.getInputType(e)){let r=l(t,void 0,this.network);yield i.signInputAsync(e,r)}else yield i.signInputAsync(e,n)}return i.toBase64()}))}finalizePsbts(e=[]){const t=e.map(e=>u.Psbt.fromBase64(e,{network:this.network})),r=1===t.length?t[0]:new u.Psbt({network:this.network}).combine(...t);return r.finalizeAllInputs(),r.extractTransaction().toHex()}}}).call(this,r(0).Buffer)}])}));
17
+ const i=BigInt(0),o=BigInt(1),a=BigInt(2),s=BigInt(3),u=BigInt(8),c=Object.freeze({a:i,b:BigInt(7),P:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:o,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")}),f=(e,t)=>(e+t/a)/t,l={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar(e){const{n:t}=c,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-o*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=r,s=BigInt("0x100000000000000000000000000000000"),u=f(a*e,t),l=f(-n*e,t);let d=j(e-u*r-l*i,t),h=j(-u*n-l*a,t);const p=d>s,b=h>s;if(p&&(d=t-d),b&&(h=t-h),d>s||h>s)throw new Error("splitScalarEndo: Endomorphism failed, k="+e);return{k1neg:p,k1:d,k2neg:b,k2:h}}};function d(e){const{a:t,b:r}=c,n=j(e*e),i=j(n*e);return j(i+t*e+r)}const h=c.a===i;class p extends Error{constructor(e){super(e)}}function b(e){if(!(e instanceof m))throw new TypeError("JacobianPoint expected")}class m{constructor(e,t,r){this.x=e,this.y=t,this.z=r}static fromAffine(e){if(!(e instanceof v))throw new TypeError("JacobianPoint#fromAffine: expected Point");return e.equals(v.ZERO)?m.ZERO:new m(e.x,e.y,o)}static toAffineBatch(e){const t=function(e,t=c.P){const r=new Array(e.length),n=C(e.reduce((e,n,o)=>n===i?e:(r[o]=e,j(e*n,t)),o),t);return e.reduceRight((e,n,o)=>n===i?e:(r[o]=j(e*r[o],t),j(e*n,t)),n),r}(e.map(e=>e.z));return e.map((e,r)=>e.toAffine(t[r]))}static normalizeZ(e){return m.toAffineBatch(e).map(m.fromAffine)}equals(e){b(e);const{x:t,y:r,z:n}=this,{x:i,y:o,z:a}=e,s=j(n*n),u=j(a*a),c=j(t*u),f=j(i*s),l=j(j(r*a)*u),d=j(j(o*n)*s);return c===f&&l===d}negate(){return new m(this.x,j(-this.y),this.z)}double(){const{x:e,y:t,z:r}=this,n=j(e*e),i=j(t*t),o=j(i*i),c=e+i,f=j(a*(j(c*c)-n-o)),l=j(s*n),d=j(l*l),h=j(d-a*f),p=j(l*(f-h)-u*o),b=j(a*t*r);return new m(h,p,b)}add(e){b(e);const{x:t,y:r,z:n}=this,{x:o,y:s,z:u}=e;if(o===i||s===i)return this;if(t===i||r===i)return e;const c=j(n*n),f=j(u*u),l=j(t*f),d=j(o*c),h=j(j(r*u)*f),p=j(j(s*n)*c),g=j(d-l),y=j(p-h);if(g===i)return y===i?this.double():m.ZERO;const v=j(g*g),w=j(g*v),_=j(l*v),E=j(y*y-w-a*_),k=j(y*(_-E)-h*w),S=j(n*u*g);return new m(E,k,S)}subtract(e){return this.add(e.negate())}multiplyUnsafe(e){const t=m.ZERO;if("bigint"==typeof e&&e===i)return t;let r=N(e);if(r===o)return this;if(!h){let e=t,n=this;for(;r>i;)r&o&&(e=e.add(n)),n=n.double(),r>>=o;return e}let{k1neg:n,k1:a,k2neg:s,k2:u}=l.splitScalar(r),c=t,f=t,d=this;for(;a>i||u>i;)a&o&&(c=c.add(d)),u&o&&(f=f.add(d)),d=d.double(),a>>=o,u>>=o;return n&&(c=c.negate()),s&&(f=f.negate()),f=new m(j(f.x*l.beta),f.y,f.z),c.add(f)}precomputeWindow(e){const t=h?128/e+1:256/e+1,r=[];let n=this,i=n;for(let o=0;o<t;o++){i=n,r.push(i);for(let t=1;t<2**(e-1);t++)i=i.add(n),r.push(i);n=i.double()}return r}wNAF(e,t){!t&&this.equals(m.BASE)&&(t=v.BASE);const r=t&&t._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=t&&y.get(t);n||(n=this.precomputeWindow(r),t&&1!==r&&(n=m.normalizeZ(n),y.set(t,n)));let i=m.ZERO,a=m.BASE;const s=1+(h?128/r:256/r),u=2**(r-1),c=BigInt(2**r-1),f=2**r,l=BigInt(r);for(let t=0;t<s;t++){const r=t*u;let s=Number(e&c);e>>=l,s>u&&(s-=f,e+=o);const d=r,h=r+Math.abs(s)-1,p=t%2!=0,b=s<0;0===s?a=a.add(g(p,n[d])):i=i.add(g(b,n[h]))}return{p:i,f:a}}multiply(e,t){let r,n,i=N(e);if(h){const{k1neg:e,k1:o,k2neg:a,k2:s}=l.splitScalar(i);let{p:u,f:c}=this.wNAF(o,t),{p:f,f:d}=this.wNAF(s,t);u=g(e,u),f=g(a,f),f=new m(j(f.x*l.beta),f.y,f.z),r=u.add(f),n=c.add(d)}else{const{p:e,f:o}=this.wNAF(i,t);r=e,n=o}return m.normalizeZ([r,n])[0]}toAffine(e){const{x:t,y:r,z:n}=this,i=this.equals(m.ZERO);null==e&&(e=i?u:C(n));const a=e,s=j(a*a),c=j(s*a),f=j(t*s),l=j(r*c),d=j(n*a);if(i)return v.ZERO;if(d!==o)throw new Error("invZ was invalid");return new v(f,l)}}function g(e,t){const r=t.negate();return e?r:t}m.BASE=new m(c.Gx,c.Gy,o),m.ZERO=new m(i,o,i);const y=new WeakMap;class v{constructor(e,t){this.x=e,this.y=t}_setWindowSize(e){this._WINDOW_SIZE=e,y.delete(this)}hasEvenY(){return this.y%a===i}static fromCompressedHex(e){const t=32===e.length,r=M(t?e:e.subarray(1));if(!q(r))throw new Error("Point is not on curve");let n=function(e){const{P:t}=c,r=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),u=BigInt(44),f=BigInt(88),l=e*e*e%t,d=l*l*e%t,h=U(d,s)*d%t,p=U(h,s)*d%t,b=U(p,a)*l%t,m=U(b,n)*b%t,g=U(m,i)*m%t,y=U(g,u)*g%t,v=U(y,f)*y%t,w=U(v,u)*g%t,_=U(w,s)*d%t,E=U(_,o)*m%t,k=U(E,r)*l%t,S=U(k,a);if(S*S%t!==e)throw new Error("Cannot find square root");return S}(d(r));const i=(n&o)===o;if(t)i&&(n=j(-n));else{1==(1&e[0])!==i&&(n=j(-n))}const u=new v(r,n);return u.assertValidity(),u}static fromUncompressedHex(e){const t=M(e.subarray(1,33)),r=M(e.subarray(33,65)),n=new v(t,r);return n.assertValidity(),n}static fromHex(e){const t=R(e),r=t.length,n=t[0];if(32===r)return this.fromCompressedHex(t);if(33===r&&(2===n||3===n))return this.fromCompressedHex(t);if(65===r&&4===n)return this.fromUncompressedHex(t);throw new Error("Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not "+r)}static fromPrivateKey(e){return v.BASE.multiply(W(e))}static fromSignature(e,t,r){const{r:n,s:i}=G(t);if(![0,1,2,3].includes(r))throw new Error("Cannot recover: invalid recovery bit");const o=H(R(e)),{n:a}=c,s=2===r||3===r?n+a:n,u=C(s,a),f=j(-o*u,a),l=j(i*u,a),d=1&r?"03":"02",h=v.fromHex(d+A(s)),p=v.BASE.multiplyAndAddUnsafe(h,f,l);if(!p)throw new Error("Cannot recover signature: point at infinify");return p.assertValidity(),p}toRawBytes(e=!1){return B(this.toHex(e))}toHex(e=!1){const t=A(this.x);if(e){return`${this.hasEvenY()?"02":"03"}${t}`}return`04${t}${A(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const e="Point is not on elliptic curve",{x:t,y:r}=this;if(!q(t)||!q(r))throw new Error(e);const n=j(r*r);if(j(n-d(t))!==i)throw new Error(e)}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new v(this.x,j(-this.y))}double(){return m.fromAffine(this).double().toAffine()}add(e){return m.fromAffine(this).add(m.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return m.fromAffine(this).multiply(e,this).toAffine()}multiplyAndAddUnsafe(e,t,r){const n=m.fromAffine(this),a=t===i||t===o||this!==v.BASE?n.multiplyUnsafe(t):n.multiply(t),s=m.fromAffine(e).multiplyUnsafe(r),u=a.add(s);return u.equals(m.ZERO)?void 0:u.toAffine()}}function w(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}function _(e){if(e.length<2||2!==e[0])throw new Error("Invalid signature integer tag: "+x(e));const t=e[1],r=e.subarray(2,t+2);if(!t||r.length!==t)throw new Error("Invalid signature integer: wrong length");if(0===r[0]&&r[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:M(r),left:e.subarray(t+2)}}v.BASE=new v(c.Gx,c.Gy),v.ZERO=new v(i,i);class E{constructor(e,t){this.r=e,this.s=t,this.assertValidity()}static fromCompact(e){const t=e instanceof Uint8Array,r="Signature.fromCompact";if("string"!=typeof e&&!t)throw new TypeError(r+": Expected string or Uint8Array");const n=t?x(e):e;if(128!==n.length)throw new Error(r+": Expected 64-byte hex");return new E(I(n.slice(0,64)),I(n.slice(64,128)))}static fromDER(e){const t=e instanceof Uint8Array;if("string"!=typeof e&&!t)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r:r,s:n}=function(e){if(e.length<2||48!=e[0])throw new Error("Invalid signature tag: "+x(e));if(e[1]!==e.length-2)throw new Error("Invalid signature: incorrect length");const{data:t,left:r}=_(e.subarray(2)),{data:n,left:i}=_(r);if(i.length)throw new Error("Invalid signature: left bytes after parsing: "+x(i));return{r:t,s:n}}(t?e:B(e));return new E(r,n)}static fromHex(e){return this.fromDER(e)}assertValidity(){const{r:e,s:t}=this;if(!F(e))throw new Error("Invalid Signature: r must be 0 < r < n");if(!F(t))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const e=c.n>>o;return this.s>e}normalizeS(){return this.hasHighS()?new E(this.r,j(-this.s,c.n)):this}toDERRawBytes(){return B(this.toDERHex())}toDERHex(){const e=w(O(this.s)),t=w(O(this.r)),r=e.length/2,n=t.length/2,i=O(r),o=O(n);return`30${O(n+r+4)}02${o}${t}02${i}${e}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return B(this.toCompactHex())}toCompactHex(){return A(this.r)+A(this.s)}}function k(...e){if(!e.every(e=>e instanceof Uint8Array))throw new Error("Uint8Array list expected");if(1===e.length)return e[0];const t=e.reduce((e,t)=>e+t.length,0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r}const S=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function x(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");let t="";for(let r=0;r<e.length;r++)t+=S[e[r]];return t}const T=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000");function A(e){if("bigint"!=typeof e)throw new Error("Expected bigint");if(!(i<=e&&e<T))throw new Error("Expected number 0 <= n < 2^256");return e.toString(16).padStart(64,"0")}function P(e){const t=B(A(e));if(32!==t.length)throw new Error("Error: expected 32 bytes");return t}function O(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function I(e){if("string"!=typeof e)throw new TypeError("hexToNumber: expected string, got "+typeof e);return BigInt("0x"+e)}function B(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+e.length);const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");t[r]=o}return t}function M(e){return I(x(e))}function R(e){return e instanceof Uint8Array?Uint8Array.from(e):B(e)}function N(e){if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)return BigInt(e);if("bigint"==typeof e&&F(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function j(e,t=c.P){const r=e%t;return r>=i?r:t+r}function U(e,t){const{P:r}=c;let n=e;for(;t-- >i;)n*=n,n%=r;return n}function C(e,t=c.P){if(e===i||t<=i)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=j(e,t),n=t,a=i,s=o,u=o,f=i;for(;r!==i;){const e=n/r,t=n%r,i=a-u*e,o=s-f*e;n=r,r=t,a=u,s=f,u=i,f=o}if(n!==o)throw new Error("invert: does not exist");return j(a,t)}function H(e,t=!1){const r=function(e){const t=8*e.length-256,r=M(e);return t>0?r>>BigInt(t):r}(e);if(t)return r;const{n:n}=c;return r>=n?r-n:r}let z,L;class D{constructor(e,t){if(this.hashLen=e,this.qByteLen=t,"number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");this.v=new Uint8Array(e).fill(1),this.k=new Uint8Array(e).fill(0),this.counter=0}hmac(...e){return ye.hmacSha256(this.k,...e)}hmacSync(...e){return L(this.k,...e)}checkSync(){if("function"!=typeof L)throw new p("hmacSha256Sync needs to be set")}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(e=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),e),this.v=await this.hmac(this.v),0!==e.length&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),e),this.v=await this.hmac(this.v))}reseedSync(e=new Uint8Array){this.checkSync(),this.k=this.hmacSync(this.v,Uint8Array.from([0]),e),this.v=this.hmacSync(this.v),0!==e.length&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),e),this.v=this.hmacSync(this.v))}async generate(){this.incr();let e=0;const t=[];for(;e<this.qByteLen;){this.v=await this.hmac(this.v);const r=this.v.slice();t.push(r),e+=this.v.length}return k(...t)}generateSync(){this.checkSync(),this.incr();let e=0;const t=[];for(;e<this.qByteLen;){this.v=this.hmacSync(this.v);const r=this.v.slice();t.push(r),e+=this.v.length}return k(...t)}}function F(e){return i<e&&e<c.n}function q(e){return i<e&&e<c.P}function K(e,t,r,n=!0){const{n:a}=c,s=H(e,!0);if(!F(s))return;const u=C(s,a),f=v.BASE.multiply(s),l=j(f.x,a);if(l===i)return;const d=j(u*j(t+r*l,a),a);if(d===i)return;let h=new E(l,d),p=(f.x===h.r?0:2)|Number(f.y&o);return n&&h.hasHighS()&&(h=h.normalizeS(),p^=1),{sig:h,recovery:p}}function W(e){let t;if("bigint"==typeof e)t=e;else if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)t=BigInt(e);else if("string"==typeof e){if(64!==e.length)throw new Error("Expected 32 bytes of private key");t=I(e)}else{if(!(e instanceof Uint8Array))throw new TypeError("Expected valid private key");if(32!==e.length)throw new Error("Expected 32 bytes of private key");t=M(e)}if(!F(t))throw new Error("Expected private key: 0 < key < n");return t}function V(e){return e instanceof v?(e.assertValidity(),e):v.fromHex(e)}function G(e){if(e instanceof E)return e.assertValidity(),e;try{return E.fromDER(e)}catch(t){return E.fromCompact(e)}}function X(e,t=!1){return v.fromPrivateKey(e).toRawBytes(t)}function Y(e,t,r,n=!1){return v.fromSignature(e,t,r).toRawBytes(n)}function $(e){const t=e instanceof Uint8Array,r="string"==typeof e,n=(t||r)&&e.length;return t?33===n||65===n:r?66===n||130===n:e instanceof v}function J(e,t,r=!1){if($(e))throw new TypeError("getSharedSecret: first arg must be private key");if(!$(t))throw new TypeError("getSharedSecret: second arg must be public key");const n=V(t);return n.assertValidity(),n.multiply(W(e)).toRawBytes(r)}function Q(e){return M(e.length>32?e.slice(0,32):e)}function Z(e){const t=Q(e),r=j(t,c.n);return ee(r<i?t:r)}function ee(e){return P(e)}function te(e,t,r){if(null==e)throw new Error(`sign: expected valid message hash, not "${e}"`);const n=R(e),i=W(t),o=[ee(i),Z(n)];if(null!=r){!0===r&&(r=ye.randomBytes(32));const e=R(r);if(32!==e.length)throw new Error("sign: Expected 32 bytes of extra data");o.push(e)}return{seed:k(...o),m:Q(n),d:i}}function re(e,t){const{sig:r,recovery:n}=e,{der:i,recovered:o}=Object.assign({canonical:!0,der:!0},t),a=i?r.toDERRawBytes():r.toCompactRawBytes();return o?[a,n]:a}async function ne(e,t,r={}){const{seed:n,m:i,d:o}=te(e,t,r.extraEntropy),a=new D(32,32);let s;for(await a.reseed(n);!(s=K(await a.generate(),i,o,r.canonical));)await a.reseed();return re(s,r)}function ie(e,t,r={}){const{seed:n,m:i,d:o}=te(e,t,r.extraEntropy),a=new D(32,32);let s;for(a.reseedSync(n);!(s=K(a.generateSync(),i,o,r.canonical));)a.reseedSync();return re(s,r)}const oe={strict:!0};function ae(e,t,r,n=oe){let i;try{i=G(e),t=R(t)}catch(e){return!1}const{r:o,s:a}=i;if(n.strict&&i.hasHighS())return!1;const s=H(t);let u;try{u=V(r)}catch(e){return!1}const{n:f}=c,l=C(a,f),d=j(s*l,f),h=j(o*l,f),p=v.BASE.multiplyAndAddUnsafe(u,d,h);if(!p)return!1;return j(p.x,f)===o}function se(e){return j(M(e),c.n)}class ue{constructor(e,t){this.r=e,this.s=t,this.assertValidity()}static fromHex(e){const t=R(e);if(64!==t.length)throw new TypeError("SchnorrSignature.fromHex: expected 64 bytes, not "+t.length);const r=M(t.subarray(0,32)),n=M(t.subarray(32,64));return new ue(r,n)}assertValidity(){const{r:e,s:t}=this;if(!q(e)||!F(t))throw new Error("Invalid signature")}toHex(){return A(this.r)+A(this.s)}toRawBytes(){return B(this.toHex())}}class ce{constructor(e,t,r=ye.randomBytes()){if(null==e)throw new TypeError(`sign: Expected valid message, not "${e}"`);this.m=R(e);const{x:n,scalar:i}=this.getScalar(W(t));if(this.px=n,this.d=i,this.rand=R(r),32!==this.rand.length)throw new TypeError("sign: Expected 32 bytes of aux randomness")}getScalar(e){const t=v.fromPrivateKey(e),r=t.hasEvenY()?e:c.n-e;return{point:t,scalar:r,x:t.toRawX()}}initNonce(e,t){return P(e^M(t))}finalizeNonce(e){const t=j(M(e),c.n);if(t===i)throw new Error("sign: Creation of signature failed. k is zero");const{point:r,x:n,scalar:o}=this.getScalar(t);return{R:r,rx:n,k:o}}finalizeSig(e,t,r,n){return new ue(e.x,j(t+r*n,c.n)).toRawBytes()}error(){throw new Error("sign: Invalid signature produced")}async calc(){const{m:e,d:t,px:r,rand:n}=this,i=ye.taggedHash,o=this.initNonce(t,await i(me.aux,n)),{R:a,rx:s,k:u}=this.finalizeNonce(await i(me.nonce,o,r,e)),c=se(await i(me.challenge,s,r,e)),f=this.finalizeSig(a,u,c,t);return await de(f,e,r)||this.error(),f}calcSync(){const{m:e,d:t,px:r,rand:n}=this,i=ye.taggedHashSync,o=this.initNonce(t,i(me.aux,n)),{R:a,rx:s,k:u}=this.finalizeNonce(i(me.nonce,o,r,e)),c=se(i(me.challenge,s,r,e)),f=this.finalizeSig(a,u,c,t);return he(f,e,r)||this.error(),f}}function fe(e,t,r){const n=e instanceof ue,i=n?e:ue.fromHex(e);return n&&i.assertValidity(),{...i,m:R(t),P:V(r)}}function le(e,t,r,n){const i=v.BASE.multiplyAndAddUnsafe(t,W(r),j(-n,c.n));return!(!i||!i.hasEvenY()||i.x!==e)}async function de(e,t,r){try{const{r:n,s:i,m:o,P:a}=fe(e,t,r),s=se(await ye.taggedHash(me.challenge,P(n),a.toRawX(),o));return le(n,a,i,s)}catch(e){return!1}}function he(e,t,r){try{const{r:n,s:i,m:o,P:a}=fe(e,t,r),s=se(ye.taggedHashSync(me.challenge,P(n),a.toRawX(),o));return le(n,a,i,s)}catch(e){if(e instanceof p)throw e;return!1}}const pe={Signature:ue,getPublicKey:function(e){return v.fromPrivateKey(e).toRawX()},sign:async function(e,t,r){return new ce(e,t,r).calc()},verify:de,signSync:function(e,t,r){return new ce(e,t,r).calcSync()},verifySync:he};v.BASE._setWindowSize(8);const be={node:n,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0},me={challenge:"BIP0340/challenge",aux:"BIP0340/aux",nonce:"BIP0340/nonce"},ge={},ye={bytesToHex:x,hexToBytes:B,concatBytes:k,mod:j,invert:C,isValidPrivateKey(e){try{return W(e),!0}catch(e){return!1}},_bigintTo32Bytes:P,_normalizePrivateKey:W,hashToPrivateKey:e=>{if((e=R(e)).length<40||e.length>1024)throw new Error("Expected valid bytes of private key as per FIPS 186");return P(j(M(e),c.n-o)+o)},randomBytes:(e=32)=>{if(be.web)return be.web.getRandomValues(new Uint8Array(e));if(be.node){const{randomBytes:t}=be.node;return Uint8Array.from(t(e))}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>ye.hashToPrivateKey(ye.randomBytes(40)),precompute(e=8,t=v.BASE){const r=t===v.BASE?t:new v(t.x,t.y);return r._setWindowSize(e),r.multiply(s),r},sha256:async(...e)=>{if(be.web){const t=await be.web.subtle.digest("SHA-256",k(...e));return new Uint8Array(t)}if(be.node){const{createHash:t}=be.node,r=t("sha256");return e.forEach(e=>r.update(e)),Uint8Array.from(r.digest())}throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(e,...t)=>{if(be.web){const r=await be.web.subtle.importKey("raw",e,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),n=k(...t),i=await be.web.subtle.sign("HMAC",r,n);return new Uint8Array(i)}if(be.node){const{createHmac:r}=be.node,n=r("sha256",e);return t.forEach(e=>n.update(e)),Uint8Array.from(n.digest())}throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:async(e,...t)=>{let r=ge[e];if(void 0===r){const t=await ye.sha256(Uint8Array.from(e,e=>e.charCodeAt(0)));r=k(t,t),ge[e]=r}return ye.sha256(r,...t)},taggedHashSync:(e,...t)=>{if("function"!=typeof z)throw new p("sha256Sync is undefined, you need to set it");let r=ge[e];if(void 0===r){const t=z(Uint8Array.from(e,e=>e.charCodeAt(0)));r=k(t,t),ge[e]=r}return z(r,...t)},_JacobianPoint:m};Object.defineProperties(ye,{sha256Sync:{configurable:!1,get:()=>z,set(e){z||(z=e)}},hmacSha256Sync:{configurable:!1,get:()=>L,set(e){L||(L=e)}}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(244);t.fromSeed=n.fromSeed,t.fromBase58=n.fromBase58,t.fromPublicKey=n.fromPublicKey,t.fromPrivateKey=n.fromPrivateKey},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(245),i=r(39),o=r(248),a=r(3),s=r(69),u=a.BufferN(32),c=a.compile({wif:a.UInt8,bip32:{public:a.UInt32,private:a.UInt32}}),f={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},l=Math.pow(2,31)-1;function d(e){return a.String(e)&&null!==e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}function h(e){return a.UInt32(e)&&e<=l}class p{constructor(e,t,r,n,i=0,o=0,s=0){this.__D=e,this.__Q=t,this.chainCode=r,this.network=n,this.__DEPTH=i,this.__INDEX=o,this.__PARENT_FINGERPRINT=s,a(c,n),this.lowR=!1}get depth(){return this.__DEPTH}get index(){return this.__INDEX}get parentFingerprint(){return this.__PARENT_FINGERPRINT}get publicKey(){return void 0===this.__Q&&(this.__Q=o.pointFromScalar(this.__D,!0)),this.__Q}get privateKey(){return this.__D}get identifier(){return n.hash160(this.publicKey)}get fingerprint(){return this.identifier.slice(0,4)}get compressed(){return!0}isNeutered(){return void 0===this.__D}neutered(){return g(this.publicKey,this.chainCode,this.network,this.depth,this.index,this.parentFingerprint)}toBase58(){const t=this.network,r=this.isNeutered()?t.bip32.public:t.bip32.private,n=e.allocUnsafe(78);return n.writeUInt32BE(r,0),n.writeUInt8(this.depth,4),n.writeUInt32BE(this.parentFingerprint,5),n.writeUInt32BE(this.index,9),this.chainCode.copy(n,13),this.isNeutered()?this.publicKey.copy(n,45):(n.writeUInt8(0,45),this.privateKey.copy(n,46)),i.encode(n)}toWIF(){if(!this.privateKey)throw new TypeError("Missing private key");return s.encode(this.network.wif,this.privateKey,!0)}derive(t){a(a.UInt32,t);const r=t>=2147483648,i=e.allocUnsafe(37);if(r){if(this.isNeutered())throw new TypeError("Missing private key for hardened child key");i[0]=0,this.privateKey.copy(i,1),i.writeUInt32BE(t,33)}else this.publicKey.copy(i,0),i.writeUInt32BE(t,33);const s=n.hmacSHA512(this.chainCode,i),u=s.slice(0,32),c=s.slice(32);if(!o.isPrivate(u))return this.derive(t+1);let f;if(this.isNeutered()){const e=o.pointAddScalar(this.publicKey,u,!0);if(null===e)return this.derive(t+1);f=g(e,c,this.network,this.depth+1,t,this.fingerprint.readUInt32BE(0))}else{const e=o.privateAdd(this.privateKey,u);if(null==e)return this.derive(t+1);f=m(e,c,this.network,this.depth+1,t,this.fingerprint.readUInt32BE(0))}return f}deriveHardened(e){return a(h,e),this.derive(e+2147483648)}derivePath(e){a(d,e);let t=e.split("/");if("m"===t[0]){if(this.parentFingerprint)throw new TypeError("Expected master, got child");t=t.slice(1)}return t.reduce((e,t)=>{let r;return"'"===t.slice(-1)?(r=parseInt(t.slice(0,-1),10),e.deriveHardened(r)):(r=parseInt(t,10),e.derive(r))},this)}sign(t,r){if(!this.privateKey)throw new Error("Missing private key");if(void 0===r&&(r=this.lowR),!1===r)return o.sign(t,this.privateKey);{let r=o.sign(t,this.privateKey);const n=e.alloc(32,0);let i=0;for(;r[0]>127;)i++,n.writeUIntLE(i,0,6),r=o.signWithEntropy(t,this.privateKey,n);return r}}verify(e,t){return o.verify(e,this.publicKey,t)}}function b(e,t,r){return m(e,t,r)}function m(e,t,r,n,i,s){if(a({privateKey:u,chainCode:u},{privateKey:e,chainCode:t}),r=r||f,!o.isPrivate(e))throw new TypeError("Private key not in range [1, n)");return new p(e,void 0,t,r,n,i,s)}function g(e,t,r,n,i,s){if(a({publicKey:a.BufferN(33),chainCode:u},{publicKey:e,chainCode:t}),r=r||f,!o.isPoint(e))throw new TypeError("Point is not on the curve");return new p(void 0,e,t,r,n,i,s)}t.fromBase58=function(e,t){const r=i.decode(e);if(78!==r.length)throw new TypeError("Invalid buffer length");t=t||f;const n=r.readUInt32BE(0);if(n!==t.bip32.private&&n!==t.bip32.public)throw new TypeError("Invalid network version");const o=r[4],a=r.readUInt32BE(5);if(0===o&&0!==a)throw new TypeError("Invalid parent fingerprint");const s=r.readUInt32BE(9);if(0===o&&0!==s)throw new TypeError("Invalid index");const u=r.slice(13,45);let c;if(n===t.bip32.private){if(0!==r.readUInt8(45))throw new TypeError("Invalid private key");c=m(r.slice(46,78),u,t,o,s,a)}else{c=g(r.slice(45,78),u,t,o,s,a)}return c},t.fromPrivateKey=b,t.fromPublicKey=function(e,t,r){return g(e,t,r)},t.fromSeed=function(t,r){if(a(a.Buffer,t),t.length<16)throw new TypeError("Seed should be at least 128 bits");if(t.length>64)throw new TypeError("Seed should be at most 512 bits");r=r||f;const i=n.hmacSHA512(e.from("Bitcoin seed","utf8"),t);return b(i.slice(0,32),i.slice(32),r)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(70),i=r(76);t.hash160=function(e){const t=n("sha256").update(e).digest();try{return n("rmd160").update(t).digest()}catch(e){return n("ripemd160").update(t).digest()}},t.hmacSHA512=function(e,t){return i("sha512",e).update(t).digest()}},function(e,t,r){"use strict";var n=r(2),i=r(4).Buffer,o=r(72),a=i.alloc(128);function s(e,t){o.call(this,"digest"),"string"==typeof t&&(t=i.from(t)),this._alg=e,this._key=t,t.length>64?t=e(t):t.length<64&&(t=i.concat([t,a],64));for(var r=this._ipad=i.allocUnsafe(64),n=this._opad=i.allocUnsafe(64),s=0;s<64;s++)r[s]=54^t[s],n[s]=92^t[s];this._hash=[r]}n(s,o),s.prototype._update=function(e){this._hash.push(e)},s.prototype._final=function(){var e=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,e]))},e.exports=s},function(e,t,r){var n=r(100);e.exports=function(e){return(new n).update(e).digest()}},function(e,t,r){(function(t){const n=r(14),i=new(0,r(118).ec)("secp256k1"),o=r(270),a=t.alloc(32,0),s=t.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),u=t.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","hex"),c=i.curve.n,f=c.shrn(1),l=i.curve.g;function d(e){return t.isBuffer(e)&&32===e.length}function h(e){return!!d(e)&&e.compare(s)<0}function p(e){if(!t.isBuffer(e))return!1;if(e.length<33)return!1;const r=e[0],n=e.slice(1,33);if(0===n.compare(a))return!1;if(n.compare(u)>=0)return!1;if((2===r||3===r)&&33===e.length){try{w(e)}catch(e){return!1}return!0}const i=e.slice(33);return 0!==i.compare(a)&&(!(i.compare(u)>=0)&&(4===r&&65===e.length))}function b(e){return 4!==e[0]}function m(e){return!!d(e)&&(e.compare(a)>0&&e.compare(s)<0)}function g(e,t){return void 0===e&&void 0!==t?b(t):void 0===e||e}function y(e){return new n(e)}function v(e){return e.toArrayLike(t,"be",32)}function w(e){return i.curve.decodePoint(e)}function _(e,r){return t.from(e._encode(r))}function E(e,r,n){if(!d(e))throw new TypeError("Expected Hash");if(!m(r))throw new TypeError("Expected Private");if(void 0!==n&&!d(n))throw new TypeError("Expected Extra Data (32 bytes)");const i=y(r),a=y(e);let s,u;o(e,r,(function(e){const t=y(e),r=l.mul(t);return!r.isInfinity()&&(s=r.x.umod(c),0!==s.isZero()&&(u=t.invm(c).mul(a.add(i.mul(s))).umod(c),0!==u.isZero()))}),m,n),u.cmp(f)>0&&(u=c.sub(u));const h=t.allocUnsafe(64);return v(s).copy(h,0),v(u).copy(h,32),h}e.exports={isPoint:p,isPointCompressed:function(e){return!!p(e)&&b(e)},isPrivate:m,pointAdd:function(e,t,r){if(!p(e))throw new TypeError("Expected Point");if(!p(t))throw new TypeError("Expected Point");const n=w(e),i=w(t),o=n.add(i);return o.isInfinity()?null:_(o,g(r,e))},pointAddScalar:function(e,t,r){if(!p(e))throw new TypeError("Expected Point");if(!h(t))throw new TypeError("Expected Tweak");const n=g(r,e),i=w(e);if(0===t.compare(a))return _(i,n);const o=y(t),s=l.mul(o),u=i.add(s);return u.isInfinity()?null:_(u,n)},pointCompress:function(e,t){if(!p(e))throw new TypeError("Expected Point");const r=w(e);if(r.isInfinity())throw new TypeError("Expected Point");return _(r,g(t,e))},pointFromScalar:function(e,t){if(!m(e))throw new TypeError("Expected Private");const r=y(e),n=l.mul(r);return n.isInfinity()?null:_(n,g(t))},pointMultiply:function(e,t,r){if(!p(e))throw new TypeError("Expected Point");if(!h(t))throw new TypeError("Expected Tweak");const n=g(r,e),i=w(e),o=y(t),a=i.mul(o);return a.isInfinity()?null:_(a,n)},privateAdd:function(e,t){if(!m(e))throw new TypeError("Expected Private");if(!h(t))throw new TypeError("Expected Tweak");const r=y(e),n=y(t),i=v(r.add(n).umod(c));return m(i)?i:null},privateSub:function(e,t){if(!m(e))throw new TypeError("Expected Private");if(!h(t))throw new TypeError("Expected Tweak");const r=y(e),n=y(t),i=v(r.sub(n).umod(c));return m(i)?i:null},sign:function(e,t){return E(e,t)},signWithEntropy:function(e,t,r){return E(e,t,r)},verify:function(e,r,n,i){if(!d(e))throw new TypeError("Expected Hash");if(!p(r))throw new TypeError("Expected Point");if(!function(e){const r=e.slice(0,32),n=e.slice(32,64);return t.isBuffer(e)&&64===e.length&&r.compare(s)<0&&n.compare(s)<0}(n))throw new TypeError("Expected Signature");const o=w(r),a=y(n.slice(0,32)),u=y(n.slice(32,64));if(i&&u.cmp(f)>0)return!1;if(a.gtn(0)<=0)return!1;if(u.gtn(0)<=0)return!1;const h=y(e),b=u.invm(c),m=h.mul(b).umod(c),g=a.mul(b).umod(c),v=l.mulAdd(m,o,g);return!v.isInfinity()&&v.x.umod(c).eq(a)}}}).call(this,r(0).Buffer)},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){},function(e){e.exports=JSON.parse('{"name":"elliptic","version":"6.5.4","description":"EC cryptography","main":"lib/elliptic.js","files":["lib"],"scripts":{"lint":"eslint lib test","lint:fix":"npm run lint -- --fix","unit":"istanbul test _mocha --reporter=spec test/index.js","test":"npm run lint && npm run unit","version":"grunt dist && git add dist/"},"repository":{"type":"git","url":"git@github.com:indutny/elliptic"},"keywords":["EC","Elliptic","curve","Cryptography"],"author":"Fedor Indutny <fedor@indutny.com>","license":"MIT","bugs":{"url":"https://github.com/indutny/elliptic/issues"},"homepage":"https://github.com/indutny/elliptic","devDependencies":{"brfs":"^2.0.2","coveralls":"^3.1.0","eslint":"^7.6.0","grunt":"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.5","mocha":"^8.0.1"},"dependencies":{"bn.js":"^4.11.9","brorand":"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1","inherits":"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}')},function(e,t){},function(e,t,r){"use strict";var n=r(11),i=r(14),o=r(2),a=r(49),s=n.assert;function u(e){a.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,n){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function f(e,t,r,n){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,a),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,n,o,a,s,u,c,f,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),p=new i(1),b=new i(0),m=new i(0),g=new i(1),y=0;0!==d.cmpn(0);){var v=h.div(d);c=h.sub(v.mul(d)),f=m.sub(v.mul(p));var w=g.sub(v.mul(b));if(!n&&c.cmp(l)<0)t=u.neg(),r=p,n=c.neg(),o=f;else if(n&&2==++y)break;u=c,h=d,d=c,m=p,p=f,g=b,b=w}a=c.neg(),s=f;var _=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(_)>=0&&(a=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],u=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),n[2*o]=s,n[2*o+1]=u,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var c=this._wnafMulAdd(1,n,i,2*o,r),f=0;f<2*o;f++)n[f]=null,i[f]=null;return c},o(c,a.BasePoint),u.prototype.point=function(e,t,r){return new c(this,e,t,r)},u.prototype.pointFromJSON=function(e,t){return c.fromJSON(this,e,t)},c.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},c.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},c.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(f,a.BasePoint),u.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),f=c.redMul(s),l=n.redMul(c),d=u.redSqr().redIAdd(f).redISub(l).redISub(l),h=u.redMul(l.redISub(d)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,h,p)},f.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),f=r.redMul(u),l=s.redSqr().redIAdd(c).redISub(f).redISub(f),d=s.redMul(f.redISub(l)).redISub(i.redMul(c)),h=this.z.redMul(a);return this.curve.jpoint(l,d,h)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,u=s.redSqr().redSqr(),c=a.redAdd(a);for(t=0;t<e;t++){var f=o.redSqr(),l=c.redSqr(),d=l.redSqr(),h=f.redAdd(f).redIAdd(f).redIAdd(n.redMul(u)),p=o.redMul(l),b=h.redSqr().redISub(p.redAdd(p)),m=p.redISub(b),g=h.redMul(m);g=g.redIAdd(g).redISub(d);var y=c.redMul(s);t+1<e&&(u=u.redMul(d)),o=b,s=y,c=g}return this.curve.jpoint(o,c.redMul(i),s)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},f.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),u=s.redSqr().redISub(a).redISub(a),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=u,t=s.redMul(a.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),l=this.y.redSqr(),d=l.redSqr(),h=this.x.redAdd(l).redSqr().redISub(f).redISub(d);h=h.redIAdd(h);var p=f.redAdd(f).redIAdd(f),b=p.redSqr(),m=d.redIAdd(d);m=(m=m.redIAdd(m)).redIAdd(m),e=b.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},f.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=s.redSqr().redISub(a).redISub(a);e=u;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=s.redMul(a.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),l=this.y.redSqr(),d=this.x.redMul(l),h=this.x.redSub(f).redMul(this.x.redAdd(f));h=h.redAdd(h).redIAdd(h);var p=d.redIAdd(d),b=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(l).redISub(f);var m=l.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=h.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},f.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),u=t.redAdd(t),c=(u=u.redIAdd(u)).redMul(a),f=s.redSqr().redISub(c.redAdd(c)),l=c.redISub(f),d=a.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=s.redMul(l).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(f,h,p)},f.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(u),f=t.redMul(c);f=(f=f.redIAdd(f)).redIAdd(f);var l=this.x.redMul(s).redISub(f);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.y.redMul(c.redMul(u.redISub(c)).redISub(a.redMul(s)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(l,d,h)},f.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},f.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},f.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},f.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict";var n=r(14),i=r(2),o=r(49),a=r(11);function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},s.prototype.point=function(e,t){return new u(this,e,t)},s.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";var n=r(11),i=r(14),o=r(2),a=r(49),s=n.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,r,n,o){a.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,a),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var u=s.fromRed().isOdd();return(t&&!u||!t&&u)&&(s=s.redNeg()),this.point(e,s)},u.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(c,a.BasePoint),u.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},u.prototype.point=function(e,t,r,n){return new c(this,e,t,r,n)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),u=i.redMul(a),c=o.redMul(s),f=i.redMul(s),l=a.redMul(o);return this.curve.point(u,c,l,f)},c.prototype._projDbl=function(){var e,t,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(s)).redAdd(u);this.zOne?(e=a.redSub(s).redSub(u).redMul(c.redSub(this.curve.two)),t=c.redMul(n.redSub(u)),r=c.redSqr().redSub(c).redSub(c)):(i=this.z.redSqr(),o=c.redSub(i).redISub(i),e=a.redSub(s).redISub(u).redMul(o),t=c.redMul(n.redSub(u)),r=c.redMul(o))}else n=s.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(s.redISub(u)),r=n.redMul(o);return this.curve.point(e,t,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(t),c=o.redMul(a),f=s.redMul(u),l=o.redMul(u),d=a.redMul(s);return this.curve.point(c,f,d,l)},c.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),c=i.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),l=n.redMul(u).redMul(f);return this.curve.twisted?(t=n.redMul(c).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(c)):(t=n.redMul(c).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(l,t,r)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},function(e,t,r){"use strict";t.sha1=r(257),t.sha224=r(258),t.sha256=r(123),t.sha384=r(259),t.sha512=r(124)},function(e,t,r){"use strict";var n=r(15),i=r(43),o=r(122),a=n.rotl32,s=n.sum32,u=n.sum32_5,c=o.ft_1,f=i.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,f),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=a(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],f=this.h[2],d=this.h[3],h=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),b=u(a(i,5),c(p,o,f,d),h,r[n],l[p]);h=d,d=f,f=a(o,30),o=i,i=b}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],f),this.h[3]=s(this.h[3],d),this.h[4]=s(this.h[4],h)},d.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(e,t,r){"use strict";var n=r(15),i=r(123);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},function(e,t,r){"use strict";var n=r(15),i=r(124);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},function(e,t,r){"use strict";var n=r(15),i=r(43),o=n.rotl32,a=n.sum32,s=n.sum32_3,u=n.sum32_4,c=i.BlockHash;function f(){if(!(this instanceof f))return new f;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function l(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function d(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function h(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(f,c),t.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],c=this.h[3],f=this.h[4],y=r,v=n,w=i,_=c,E=f,k=0;k<80;k++){var S=a(o(u(r,l(k,n,i,c),e[p[k]+t],d(k)),m[k]),f);r=f,f=c,c=o(i,10),i=n,n=S,S=a(o(u(y,l(79-k,v,w,_),e[b[k]+t],h(k)),g[k]),E),y=E,E=_,_=o(w,10),w=v,v=S}S=s(this.h[1],i,_),this.h[1]=s(this.h[2],c,E),this.h[2]=s(this.h[3],f,y),this.h[3]=s(this.h[4],r,v),this.h[4]=s(this.h[0],n,w),this.h[0]=S},f.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],b=[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],m=[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],g=[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]},function(e,t,r){"use strict";var n=r(15),i=r(24);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},function(e,t){e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(e,t,r){"use strict";var n=r(14),i=r(264),o=r(11),a=r(77),s=r(120),u=o.assert,c=r(265),f=r(266);function l(e){if(!(this instanceof l))return new l(e);"string"==typeof e&&(u(Object.prototype.hasOwnProperty.call(a,e),"Unknown curve "+e),e=a[e]),e instanceof a.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=l,l.prototype.keyPair=function(e){return new c(this,e)},l.prototype.keyFromPrivate=function(e,t){return c.fromPrivate(this,e,t)},l.prototype.keyFromPublic=function(e,t){return c.fromPublic(this,e,t)},l.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||s(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var a=new n(t.generate(r));if(!(a.cmp(o)>0))return a.iaddn(1),this.keyFromPrivate(a)}},l.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},l.prototype.sign=function(e,t,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var a=this.n.byteLength(),s=t.getPrivate().toArray("be",a),u=e.toArray("be",a),c=new i({hash:this.hash,entropy:s,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),l=this.n.sub(new n(1)),d=0;;d++){var h=o.k?o.k(d):new n(c.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(l)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var b=p.getX(),m=b.umod(this.n);if(0!==m.cmpn(0)){var g=h.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==b.cmp(m)?2:0);return o.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),y^=1),new f({r:m,s:g,recoveryParam:y})}}}}}},l.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new f(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),c=u.mul(e).umod(this.n),l=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),l)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},l.prototype.recoverPubKey=function(e,t,r,i){u((3&r)===r,"The recovery param is more than two bits"),t=new f(t,i);var o=this.n,a=new n(e),s=t.r,c=t.s,l=1&r,d=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");s=d?this.curve.pointFromX(s.add(this.curve.n),l):this.curve.pointFromX(s,l);var h=t.r.invm(o),p=o.sub(a).mul(h).umod(o),b=c.mul(h).umod(o);return this.g.mulAdd(p,s,b)},l.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new f(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";var n=r(78),i=r(119),o=r(24);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=a,a.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},a.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},a.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},a.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var a=o.slice(0,e);return this._update(r),this._reseed++,i.encode(a,t)}},function(e,t,r){"use strict";var n=r(14),i=r(11).assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},function(e,t,r){"use strict";var n=r(14),i=r(11),o=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function u(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function c(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function f(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new s;if(48!==e[r.place++])return!1;var o=u(e,r);if(!1===o)return!1;if(o+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var a=u(e,r);if(!1===a)return!1;var c=e.slice(r.place,a+r.place);if(r.place+=a,2!==e[r.place++])return!1;var f=u(e,r);if(!1===f)return!1;if(e.length!==f+r.place)return!1;var l=e.slice(r.place,f+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}return this.r=new n(c),this.s=new n(l),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,t.length),(n=n.concat(t)).push(2),f(n,r.length);var o=n.concat(r),a=[48];return f(a,o.length),a=a.concat(o),i.encode(a,e)}},function(e,t,r){"use strict";var n=r(78),i=r(77),o=r(11),a=o.assert,s=o.parseBytes,u=r(268),c=r(269);function f(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=f,f.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),u=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},f.prototype.verify=function(e,t,r){e=s(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},f.prototype.keyFromPublic=function(e){return u.fromPublic(this,e)},f.prototype.keyFromSecret=function(e){return u.fromSecret(this,e)},f.prototype.makeSignature=function(e){return e instanceof c?e:new c(this,e)},f.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},f.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},f.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},f.prototype.decodeInt=function(e){return o.intFromLE(e)},f.prototype.isPoint=function(e){return e instanceof this.pointClass}},function(e,t,r){"use strict";var n=r(11),i=n.assert,o=n.parseBytes,a=n.cachedProperty;function s(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}s.fromPublic=function(e,t){return t instanceof s?t:new s(e,{pub:t})},s.fromSecret=function(e,t){return t instanceof s?t:new s(e,{secret:t})},s.prototype.secret=function(){return this._secret},a(s,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),a(s,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),a(s,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),a(s,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),a(s,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),a(s,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),s.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},s.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},s.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},s.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=s},function(e,t,r){"use strict";var n=r(14),i=r(11),o=i.assert,a=i.cachedProperty,s=i.parseBytes;function u(e,t){this.eddsa=e,"object"!=typeof t&&(t=s(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),o(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}a(u,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),a(u,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),a(u,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),a(u,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=u},function(e,t,r){(function(t){const n=r(76),i=t.alloc(1,1),o=t.alloc(1,0);e.exports=function(e,r,a,s,u){let c=t.alloc(32,0),f=t.alloc(32,1);c=n("sha256",c).update(f).update(o).update(r).update(e).update(u||"").digest(),f=n("sha256",c).update(f).digest(),c=n("sha256",c).update(f).update(i).update(r).update(e).update(u||"").digest(),f=n("sha256",c).update(f).digest(),f=n("sha256",c).update(f).digest();let l=f;for(;!s(l)||!a(l);)c=n("sha256",c).update(f).update(o).digest(),f=n("sha256",c).update(f).digest(),f=n("sha256",c).update(f).digest(),l=f;return l}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(12),i=r(1),o=r(26),a=r(3),s=i.OPS;t.p2data=function(e,t){if(!e.data&&!e.output)throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),a({network:a.maybe(a.Object),output:a.maybe(a.Buffer),data:a.maybe(a.arrayOf(a.Buffer))},e);const r={name:"embed",network:e.network||n.bitcoin};if(o.prop(r,"output",()=>{if(e.data)return i.compile([s.OP_RETURN].concat(e.data))}),o.prop(r,"data",()=>{if(e.output)return i.decompile(e.output).slice(1)}),t.validate&&e.output){const t=i.decompile(e.output);if(t[0]!==s.OP_RETURN)throw new TypeError("Output is invalid");if(!t.slice(1).every(a.Buffer))throw new TypeError("Output is invalid");if(e.data&&!function(e,t){return e.length===t.length&&e.every((e,r)=>e.equals(t[r]))}(e.data,r.data))throw new TypeError("Data mismatch")}return Object.assign(r,e)}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e,t,r){t=t||4,r=void 0===r||r;const n=e.length;if(0===n)return 0;if(n>t)throw new TypeError("Script number overflow");if(r&&0==(127&e[n-1])&&(n<=1||0==(128&e[n-2])))throw new Error("Non-minimally encoded script number");if(5===n){const t=e.readUInt32LE(0),r=e.readUInt8(4);return 128&r?-(4294967296*(-129&r)+t):4294967296*r+t}let i=0;for(let t=0;t<n;++t)i|=e[t]<<8*t;return 128&e[n-1]?-(i&~(128<<8*(n-1))):i},t.encode=function(t){let r=Math.abs(t);const n=(i=r)>2147483647?5:i>8388607?4:i>32767?3:i>127?2:i>0?1:0;var i;const o=e.allocUnsafe(n),a=t<0;for(let e=0;e<n;++e)o.writeUInt8(255&r,e),r>>=8;return 128&o[n-1]?o.writeUInt8(a?128:0,n-1):a&&(o[n-1]|=128),o}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(16),i=r(125),o=r(3),a=e.alloc(1,0);function s(t){let r=0;for(;0===t[r];)++r;return r===t.length?a:128&(t=t.slice(r))[0]?e.concat([a,t],1+t.length):t}function u(t){0===t[0]&&(t=t.slice(1));const r=e.alloc(32,0),n=Math.max(0,32-t.length);return t.copy(r,n),r}t.decode=function(t){const r=t.readUInt8(t.length-1),n=-129&r;if(n<=0||n>=4)throw new Error("Invalid hashType "+r);const o=i.decode(t.slice(0,-1)),a=u(o.r),s=u(o.s);return{signature:e.concat([a,s],64),hashType:r}},t.encode=function(t,r){o({signature:n.BufferN(64),hashType:n.UInt8},{signature:t,hashType:r});const a=-129&r;if(a<=0||a>=4)throw new Error("Invalid hashType "+r);const u=e.allocUnsafe(1);u.writeUInt8(r,0);const c=s(t.slice(0,32)),f=s(t.slice(32,64));return e.concat([i.encode(c,f),u])}}).call(this,r(0).Buffer)},function(e,t,r){(function(t){const n=r(76),i=t.alloc(1,1),o=t.alloc(1,0);e.exports=function(e,r,a,s,u){let c=t.alloc(32,0),f=t.alloc(32,1);c=n("sha256",c).update(f).update(o).update(r).update(e).update(u||"").digest(),f=n("sha256",c).update(f).digest(),c=n("sha256",c).update(f).update(i).update(r).update(e).update(u||"").digest(),f=n("sha256",c).update(f).digest(),f=n("sha256",c).update(f).digest();let l=f;for(;!s(l)||!a(l);)c=n("sha256",c).update(f).update(o).digest(),f=n("sha256",c).update(f).digest(),f=n("sha256",c).update(f).digest(),l=f;return l}}).call(this,r(0).Buffer)},function(e,t,r){var n=r(80);function i(e){return e<n.OP_PUSHDATA1?1:e<=255?2:e<=65535?3:5}e.exports={encodingLength:i,encode:function(e,t,r){var o=i(t);return 1===o?e.writeUInt8(t,r):2===o?(e.writeUInt8(n.OP_PUSHDATA1,r),e.writeUInt8(t,r+1)):3===o?(e.writeUInt8(n.OP_PUSHDATA2,r),e.writeUInt16LE(t,r+1)):(e.writeUInt8(n.OP_PUSHDATA4,r),e.writeUInt32LE(t,r+1)),o},decode:function(e,t){var r,i,o=e.readUInt8(t);if(o<n.OP_PUSHDATA1)r=o,i=1;else if(o===n.OP_PUSHDATA1){if(t+2>e.length)return null;r=e.readUInt8(t+1),i=2}else if(o===n.OP_PUSHDATA2){if(t+3>e.length)return null;r=e.readUInt16LE(t+1),i=3}else{if(t+5>e.length)return null;if(o!==n.OP_PUSHDATA4)throw new Error("Unexpected opcode");r=e.readUInt32LE(t+1),i=5}return{opcode:o,number:r,size:i}}}},function(e,t,r){var n=r(80),i={};for(var o in n){i[n[o]]=o}e.exports=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(12),i=r(1),o=r(26),a=i.OPS,s=r(3),u=r(25),c=a.OP_RESERVED;function f(e,t){return e.length===t.length&&e.every((e,r)=>e.equals(t[r]))}t.p2ms=function(e,t){if(!(e.input||e.output||e.pubkeys&&void 0!==e.m||e.signatures))throw new TypeError("Not enough data");function r(e){return i.isCanonicalScriptSignature(e)||void 0!==(t.allowIncomplete&&e===a.OP_0)}t=Object.assign({validate:!0},t||{}),s({network:s.maybe(s.Object),m:s.maybe(s.Number),n:s.maybe(s.Number),output:s.maybe(s.Buffer),pubkeys:s.maybe(s.arrayOf(u.isPoint)),signatures:s.maybe(s.arrayOf(r)),input:s.maybe(s.Buffer)},e);const l={network:e.network||n.bitcoin};let d=[],h=!1;function p(e){h||(h=!0,d=i.decompile(e),l.m=d[0]-c,l.n=d[d.length-2]-c,l.pubkeys=d.slice(1,-2))}if(o.prop(l,"output",()=>{if(e.m&&l.n&&e.pubkeys)return i.compile([].concat(c+e.m,e.pubkeys,c+l.n,a.OP_CHECKMULTISIG))}),o.prop(l,"m",()=>{if(l.output)return p(l.output),l.m}),o.prop(l,"n",()=>{if(l.pubkeys)return l.pubkeys.length}),o.prop(l,"pubkeys",()=>{if(e.output)return p(e.output),l.pubkeys}),o.prop(l,"signatures",()=>{if(e.input)return i.decompile(e.input).slice(1)}),o.prop(l,"input",()=>{if(e.signatures)return i.compile([a.OP_0].concat(e.signatures))}),o.prop(l,"witness",()=>{if(l.input)return[]}),o.prop(l,"name",()=>{if(l.m&&l.n)return`p2ms(${l.m} of ${l.n})`}),t.validate){if(e.output){if(p(e.output),!s.Number(d[0]))throw new TypeError("Output is invalid");if(!s.Number(d[d.length-2]))throw new TypeError("Output is invalid");if(d[d.length-1]!==a.OP_CHECKMULTISIG)throw new TypeError("Output is invalid");if(l.m<=0||l.n>16||l.m>l.n||l.n!==d.length-3)throw new TypeError("Output is invalid");if(!l.pubkeys.every(e=>u.isPoint(e)))throw new TypeError("Output is invalid");if(void 0!==e.m&&e.m!==l.m)throw new TypeError("m mismatch");if(void 0!==e.n&&e.n!==l.n)throw new TypeError("n mismatch");if(e.pubkeys&&!f(e.pubkeys,l.pubkeys))throw new TypeError("Pubkeys mismatch")}if(e.pubkeys){if(void 0!==e.n&&e.n!==e.pubkeys.length)throw new TypeError("Pubkey count mismatch");if(l.n=e.pubkeys.length,l.n<l.m)throw new TypeError("Pubkey count cannot be less than m")}if(e.signatures){if(e.signatures.length<l.m)throw new TypeError("Not enough signatures provided");if(e.signatures.length>l.m)throw new TypeError("Too many signatures provided")}if(e.input){if(e.input[0]!==a.OP_0)throw new TypeError("Input is invalid");if(0===l.signatures.length||!l.signatures.every(r))throw new TypeError("Input has invalid signature(s)");if(e.signatures&&!f(e.signatures,l.signatures))throw new TypeError("Signature mismatch");if(void 0!==e.m&&e.m!==e.signatures.length)throw new TypeError("Signature count mismatch")}}return Object.assign(l,e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(12),i=r(1),o=r(26),a=r(3),s=i.OPS,u=r(25);t.p2pk=function(e,t){if(!(e.input||e.output||e.pubkey||e.input||e.signature))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),a({network:a.maybe(a.Object),output:a.maybe(a.Buffer),pubkey:a.maybe(u.isPoint),signature:a.maybe(i.isCanonicalScriptSignature),input:a.maybe(a.Buffer)},e);const r=o.value(()=>i.decompile(e.input)),c={name:"p2pk",network:e.network||n.bitcoin};if(o.prop(c,"output",()=>{if(e.pubkey)return i.compile([e.pubkey,s.OP_CHECKSIG])}),o.prop(c,"pubkey",()=>{if(e.output)return e.output.slice(1,-1)}),o.prop(c,"signature",()=>{if(e.input)return r()[0]}),o.prop(c,"input",()=>{if(e.signature)return i.compile([e.signature])}),o.prop(c,"witness",()=>{if(c.input)return[]}),t.validate){if(e.output){if(e.output[e.output.length-1]!==s.OP_CHECKSIG)throw new TypeError("Output is invalid");if(!u.isPoint(c.pubkey))throw new TypeError("Output pubkey is invalid");if(e.pubkey&&!e.pubkey.equals(c.pubkey))throw new TypeError("Pubkey mismatch")}if(e.signature&&e.input&&!e.input.equals(c.input))throw new TypeError("Signature mismatch");if(e.input){if(1!==r().length)throw new TypeError("Input is invalid");if(!i.isCanonicalScriptSignature(c.signature))throw new TypeError("Input has invalid signature")}}return Object.assign(c,e)}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(19),i=r(12),o=r(1),a=r(26),s=r(3),u=o.OPS,c=r(25),f=r(39);t.p2pkh=function(t,r){if(!(t.address||t.hash||t.output||t.pubkey||t.input))throw new TypeError("Not enough data");r=Object.assign({validate:!0},r||{}),s({network:s.maybe(s.Object),address:s.maybe(s.String),hash:s.maybe(s.BufferN(20)),output:s.maybe(s.BufferN(25)),pubkey:s.maybe(c.isPoint),signature:s.maybe(o.isCanonicalScriptSignature),input:s.maybe(s.Buffer)},t);const l=a.value(()=>{const e=f.decode(t.address);return{version:e.readUInt8(0),hash:e.slice(1)}}),d=a.value(()=>o.decompile(t.input)),h=t.network||i.bitcoin,p={name:"p2pkh",network:h};if(a.prop(p,"address",()=>{if(!p.hash)return;const t=e.allocUnsafe(21);return t.writeUInt8(h.pubKeyHash,0),p.hash.copy(t,1),f.encode(t)}),a.prop(p,"hash",()=>t.output?t.output.slice(3,23):t.address?l().hash:t.pubkey||p.pubkey?n.hash160(t.pubkey||p.pubkey):void 0),a.prop(p,"output",()=>{if(p.hash)return o.compile([u.OP_DUP,u.OP_HASH160,p.hash,u.OP_EQUALVERIFY,u.OP_CHECKSIG])}),a.prop(p,"pubkey",()=>{if(t.input)return d()[1]}),a.prop(p,"signature",()=>{if(t.input)return d()[0]}),a.prop(p,"input",()=>{if(t.pubkey&&t.signature)return o.compile([t.signature,t.pubkey])}),a.prop(p,"witness",()=>{if(p.input)return[]}),r.validate){let r=e.from([]);if(t.address){if(l().version!==h.pubKeyHash)throw new TypeError("Invalid version or Network mismatch");if(20!==l().hash.length)throw new TypeError("Invalid address");r=l().hash}if(t.hash){if(r.length>0&&!r.equals(t.hash))throw new TypeError("Hash mismatch");r=t.hash}if(t.output){if(25!==t.output.length||t.output[0]!==u.OP_DUP||t.output[1]!==u.OP_HASH160||20!==t.output[2]||t.output[23]!==u.OP_EQUALVERIFY||t.output[24]!==u.OP_CHECKSIG)throw new TypeError("Output is invalid");const e=t.output.slice(3,23);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch");r=e}if(t.pubkey){const e=n.hash160(t.pubkey);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch");r=e}if(t.input){const e=d();if(2!==e.length)throw new TypeError("Input is invalid");if(!o.isCanonicalScriptSignature(e[0]))throw new TypeError("Input has invalid signature");if(!c.isPoint(e[1]))throw new TypeError("Input has invalid pubkey");if(t.signature&&!t.signature.equals(e[0]))throw new TypeError("Signature mismatch");if(t.pubkey&&!t.pubkey.equals(e[1]))throw new TypeError("Pubkey mismatch");const i=n.hash160(e[1]);if(r.length>0&&!r.equals(i))throw new TypeError("Hash mismatch")}}return Object.assign(p,t)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(19),i=r(12),o=r(1),a=r(26),s=r(3),u=o.OPS,c=r(39);t.p2sh=function(t,r){if(!(t.address||t.hash||t.output||t.redeem||t.input))throw new TypeError("Not enough data");r=Object.assign({validate:!0},r||{}),s({network:s.maybe(s.Object),address:s.maybe(s.String),hash:s.maybe(s.BufferN(20)),output:s.maybe(s.BufferN(23)),redeem:s.maybe({network:s.maybe(s.Object),output:s.maybe(s.Buffer),input:s.maybe(s.Buffer),witness:s.maybe(s.arrayOf(s.Buffer))}),input:s.maybe(s.Buffer),witness:s.maybe(s.arrayOf(s.Buffer))},t);let f=t.network;f||(f=t.redeem&&t.redeem.network||i.bitcoin);const l={network:f},d=a.value(()=>{const e=c.decode(t.address);return{version:e.readUInt8(0),hash:e.slice(1)}}),h=a.value(()=>o.decompile(t.input)),p=a.value(()=>{const e=h();return{network:f,output:e[e.length-1],input:o.compile(e.slice(0,-1)),witness:t.witness||[]}});if(a.prop(l,"address",()=>{if(!l.hash)return;const t=e.allocUnsafe(21);return t.writeUInt8(l.network.scriptHash,0),l.hash.copy(t,1),c.encode(t)}),a.prop(l,"hash",()=>t.output?t.output.slice(2,22):t.address?d().hash:l.redeem&&l.redeem.output?n.hash160(l.redeem.output):void 0),a.prop(l,"output",()=>{if(l.hash)return o.compile([u.OP_HASH160,l.hash,u.OP_EQUAL])}),a.prop(l,"redeem",()=>{if(t.input)return p()}),a.prop(l,"input",()=>{if(t.redeem&&t.redeem.input&&t.redeem.output)return o.compile([].concat(o.decompile(t.redeem.input),t.redeem.output))}),a.prop(l,"witness",()=>l.redeem&&l.redeem.witness?l.redeem.witness:l.input?[]:void 0),a.prop(l,"name",()=>{const e=["p2sh"];return void 0!==l.redeem&&e.push(l.redeem.name),e.join("-")}),r.validate){let r=e.from([]);if(t.address){if(d().version!==f.scriptHash)throw new TypeError("Invalid version or Network mismatch");if(20!==d().hash.length)throw new TypeError("Invalid address");r=d().hash}if(t.hash){if(r.length>0&&!r.equals(t.hash))throw new TypeError("Hash mismatch");r=t.hash}if(t.output){if(23!==t.output.length||t.output[0]!==u.OP_HASH160||20!==t.output[1]||t.output[22]!==u.OP_EQUAL)throw new TypeError("Output is invalid");const e=t.output.slice(2,22);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch");r=e}const i=e=>{if(e.output){const t=o.decompile(e.output);if(!t||t.length<1)throw new TypeError("Redeem.output too short");const i=n.hash160(e.output);if(r.length>0&&!r.equals(i))throw new TypeError("Hash mismatch");r=i}if(e.input){const t=e.input.length>0,r=e.witness&&e.witness.length>0;if(!t&&!r)throw new TypeError("Empty input");if(t&&r)throw new TypeError("Input and witness provided");if(t){const t=o.decompile(e.input);if(!o.isPushOnly(t))throw new TypeError("Non push-only scriptSig")}}};if(t.input){const t=h();if(!t||t.length<1)throw new TypeError("Input too short");if(!e.isBuffer(p().output))throw new TypeError("Input is invalid");i(p())}if(t.redeem){if(t.redeem.network&&t.redeem.network!==f)throw new TypeError("Network mismatch");if(t.input){const e=p();if(t.redeem.output&&!t.redeem.output.equals(e.output))throw new TypeError("Redeem.output mismatch");if(t.redeem.input&&!t.redeem.input.equals(e.input))throw new TypeError("Redeem.input mismatch")}i(t.redeem)}if(t.witness&&t.redeem&&t.redeem.witness&&!function(e,t){return e.length===t.length&&e.every((e,r)=>e.equals(t[r]))}(t.redeem.witness,t.witness))throw new TypeError("Witness and redeem.witness mismatch")}return Object.assign(l,t)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(19),i=r(12),o=r(1),a=r(26),s=r(3),u=o.OPS,c=r(25),f=r(81),l=e.alloc(0);t.p2wpkh=function(t,r){if(!(t.address||t.hash||t.output||t.pubkey||t.witness))throw new TypeError("Not enough data");r=Object.assign({validate:!0},r||{}),s({address:s.maybe(s.String),hash:s.maybe(s.BufferN(20)),input:s.maybe(s.BufferN(0)),network:s.maybe(s.Object),output:s.maybe(s.BufferN(22)),pubkey:s.maybe(c.isPoint),signature:s.maybe(o.isCanonicalScriptSignature),witness:s.maybe(s.arrayOf(s.Buffer))},t);const d=a.value(()=>{const r=f.decode(t.address),n=r.words.shift(),i=f.fromWords(r.words);return{version:n,prefix:r.prefix,data:e.from(i)}}),h=t.network||i.bitcoin,p={name:"p2wpkh",network:h};if(a.prop(p,"address",()=>{if(!p.hash)return;const e=f.toWords(p.hash);return e.unshift(0),f.encode(h.bech32,e)}),a.prop(p,"hash",()=>t.output?t.output.slice(2,22):t.address?d().data:t.pubkey||p.pubkey?n.hash160(t.pubkey||p.pubkey):void 0),a.prop(p,"output",()=>{if(p.hash)return o.compile([u.OP_0,p.hash])}),a.prop(p,"pubkey",()=>t.pubkey?t.pubkey:t.witness?t.witness[1]:void 0),a.prop(p,"signature",()=>{if(t.witness)return t.witness[0]}),a.prop(p,"input",()=>{if(p.witness)return l}),a.prop(p,"witness",()=>{if(t.pubkey&&t.signature)return[t.signature,t.pubkey]}),r.validate){let r=e.from([]);if(t.address){if(h&&h.bech32!==d().prefix)throw new TypeError("Invalid prefix or Network mismatch");if(0!==d().version)throw new TypeError("Invalid address version");if(20!==d().data.length)throw new TypeError("Invalid address data");r=d().data}if(t.hash){if(r.length>0&&!r.equals(t.hash))throw new TypeError("Hash mismatch");r=t.hash}if(t.output){if(22!==t.output.length||t.output[0]!==u.OP_0||20!==t.output[1])throw new TypeError("Output is invalid");if(r.length>0&&!r.equals(t.output.slice(2)))throw new TypeError("Hash mismatch");r=t.output.slice(2)}if(t.pubkey){const e=n.hash160(t.pubkey);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch");if(r=e,!c.isPoint(t.pubkey)||33!==t.pubkey.length)throw new TypeError("Invalid pubkey for p2wpkh")}if(t.witness){if(2!==t.witness.length)throw new TypeError("Witness is invalid");if(!o.isCanonicalScriptSignature(t.witness[0]))throw new TypeError("Witness has invalid signature");if(!c.isPoint(t.witness[1])||33!==t.witness[1].length)throw new TypeError("Witness has invalid pubkey");if(t.signature&&!t.signature.equals(t.witness[0]))throw new TypeError("Signature mismatch");if(t.pubkey&&!t.pubkey.equals(t.witness[1]))throw new TypeError("Pubkey mismatch");const e=n.hash160(t.witness[1]);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch")}}return Object.assign(p,t)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(19),i=r(12),o=r(1),a=r(26),s=r(3),u=o.OPS,c=r(25),f=r(81),l=e.alloc(0);function d(t){return!(!e.isBuffer(t)||65!==t.length||4!==t[0]||!c.isPoint(t))}t.p2wsh=function(t,r){if(!(t.address||t.hash||t.output||t.redeem||t.witness))throw new TypeError("Not enough data");r=Object.assign({validate:!0},r||{}),s({network:s.maybe(s.Object),address:s.maybe(s.String),hash:s.maybe(s.BufferN(32)),output:s.maybe(s.BufferN(34)),redeem:s.maybe({input:s.maybe(s.Buffer),network:s.maybe(s.Object),output:s.maybe(s.Buffer),witness:s.maybe(s.arrayOf(s.Buffer))}),input:s.maybe(s.BufferN(0)),witness:s.maybe(s.arrayOf(s.Buffer))},t);const c=a.value(()=>{const r=f.decode(t.address),n=r.words.shift(),i=f.fromWords(r.words);return{version:n,prefix:r.prefix,data:e.from(i)}}),h=a.value(()=>o.decompile(t.redeem.input));let p=t.network;p||(p=t.redeem&&t.redeem.network||i.bitcoin);const b={network:p};if(a.prop(b,"address",()=>{if(!b.hash)return;const e=f.toWords(b.hash);return e.unshift(0),f.encode(p.bech32,e)}),a.prop(b,"hash",()=>t.output?t.output.slice(2):t.address?c().data:b.redeem&&b.redeem.output?n.sha256(b.redeem.output):void 0),a.prop(b,"output",()=>{if(b.hash)return o.compile([u.OP_0,b.hash])}),a.prop(b,"redeem",()=>{if(t.witness)return{output:t.witness[t.witness.length-1],input:l,witness:t.witness.slice(0,-1)}}),a.prop(b,"input",()=>{if(b.witness)return l}),a.prop(b,"witness",()=>{if(t.redeem&&t.redeem.input&&t.redeem.input.length>0&&t.redeem.output&&t.redeem.output.length>0){const e=o.toStack(h());return b.redeem=Object.assign({witness:e},t.redeem),b.redeem.input=l,[].concat(e,t.redeem.output)}if(t.redeem&&t.redeem.output&&t.redeem.witness)return[].concat(t.redeem.witness,t.redeem.output)}),a.prop(b,"name",()=>{const e=["p2wsh"];return void 0!==b.redeem&&e.push(b.redeem.name),e.join("-")}),r.validate){let r=e.from([]);if(t.address){if(c().prefix!==p.bech32)throw new TypeError("Invalid prefix or Network mismatch");if(0!==c().version)throw new TypeError("Invalid address version");if(32!==c().data.length)throw new TypeError("Invalid address data");r=c().data}if(t.hash){if(r.length>0&&!r.equals(t.hash))throw new TypeError("Hash mismatch");r=t.hash}if(t.output){if(34!==t.output.length||t.output[0]!==u.OP_0||32!==t.output[1])throw new TypeError("Output is invalid");const e=t.output.slice(2);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch");r=e}if(t.redeem){if(t.redeem.network&&t.redeem.network!==p)throw new TypeError("Network mismatch");if(t.redeem.input&&t.redeem.input.length>0&&t.redeem.witness&&t.redeem.witness.length>0)throw new TypeError("Ambiguous witness source");if(t.redeem.output){if(0===o.decompile(t.redeem.output).length)throw new TypeError("Redeem.output is invalid");const e=n.sha256(t.redeem.output);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch");r=e}if(t.redeem.input&&!o.isPushOnly(h()))throw new TypeError("Non push-only scriptSig");if(t.witness&&t.redeem.witness&&!function(e,t){return e.length===t.length&&e.every((e,r)=>e.equals(t[r]))}(t.witness,t.redeem.witness))throw new TypeError("Witness and redeem.witness mismatch");if(t.redeem.input&&h().some(d)||t.redeem.output&&(o.decompile(t.redeem.output)||[]).some(d))throw new TypeError("redeem.input or redeem.output contains uncompressed pubkey")}if(t.witness&&t.witness.length>0){const e=t.witness[t.witness.length-1];if(t.redeem&&t.redeem.output&&!t.redeem.output.equals(e))throw new TypeError("Witness and redeem.output mismatch");if(t.witness.some(d)||(o.decompile(e)||[]).some(d))throw new TypeError("Witness contains uncompressed pubkey")}}return Object.assign(b,t)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(t,n){var i=r(4).Buffer,o=t.crypto||t.msCrypto;o&&o.getRandomValues?e.exports=function(e,t){if(e>4294967295)throw new RangeError("requested too many random bytes");var r=i.allocUnsafe(e);if(e>0)if(e>65536)for(var a=0;a<e;a+=65536)o.getRandomValues(r.slice(a,a+65536));else o.getRandomValues(r);if("function"==typeof t)return n.nextTick((function(){t(null,r)}));return r}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,r(17),r(10))},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(51),i=r(19),o=r(52),a=r(16),s=r(126),u=r(3),c=r(37),f=new TypeError("Cannot compute merkle root for zero transactions"),l=new TypeError("Cannot compute witness commit for non-segwit block");class d{constructor(){this.version=1,this.prevHash=void 0,this.merkleRoot=void 0,this.timestamp=0,this.witnessCommit=void 0,this.bits=0,this.nonce=0,this.transactions=void 0}static fromBuffer(e){if(e.length<80)throw new Error("Buffer too small (< 80 bytes)");const t=new n.BufferReader(e),r=new d;if(r.version=t.readInt32(),r.prevHash=t.readSlice(32),r.merkleRoot=t.readSlice(32),r.timestamp=t.readUInt32(),r.bits=t.readUInt32(),r.nonce=t.readUInt32(),80===e.length)return r;const i=()=>{const e=o.Transaction.fromBuffer(t.buffer.slice(t.offset),!0);return t.offset+=e.byteLength(),e},a=t.readVarInt();r.transactions=[];for(let e=0;e<a;++e){const e=i();r.transactions.push(e)}const s=r.getWitnessCommit();return s&&(r.witnessCommit=s),r}static fromHex(t){return d.fromBuffer(e.from(t,"hex"))}static calculateTarget(t){const r=((4278190080&t)>>24)-3,n=8388607&t,i=e.alloc(32,0);return i.writeUIntBE(n,29-r,3),i}static calculateMerkleRoot(t,r){if(u([{getHash:a.Function}],t),0===t.length)throw f;if(r&&!h(t))throw l;const n=t.map(e=>e.getHash(r)),o=s(n,i.hash256);return r?i.hash256(e.concat([o,t[0].ins[0].witness[0]])):o}getWitnessCommit(){if(!h(this.transactions))return null;const t=this.transactions[0].outs.filter(t=>t.script.slice(0,6).equals(e.from("6a24aa21a9ed","hex"))).map(e=>e.script.slice(6,38));if(0===t.length)return null;const r=t[t.length-1];return r instanceof e&&32===r.length?r:null}hasWitnessCommit(){return this.witnessCommit instanceof e&&32===this.witnessCommit.length||null!==this.getWitnessCommit()}hasWitness(){return(e=this.transactions)instanceof Array&&e.some(e=>"object"==typeof e&&e.ins instanceof Array&&e.ins.some(e=>"object"==typeof e&&e.witness instanceof Array&&e.witness.length>0));var e}weight(){return 3*this.byteLength(!1,!1)+this.byteLength(!1,!0)}byteLength(e,t=!0){return e||!this.transactions?80:80+c.encodingLength(this.transactions.length)+this.transactions.reduce((e,r)=>e+r.byteLength(t),0)}getHash(){return i.hash256(this.toBuffer(!0))}getId(){return n.reverseBuffer(this.getHash()).toString("hex")}getUTCDate(){const e=new Date(0);return e.setUTCSeconds(this.timestamp),e}toBuffer(t){const r=e.allocUnsafe(this.byteLength(t)),i=new n.BufferWriter(r);return i.writeInt32(this.version),i.writeSlice(this.prevHash),i.writeSlice(this.merkleRoot),i.writeUInt32(this.timestamp),i.writeUInt32(this.bits),i.writeUInt32(this.nonce),t||!this.transactions||(c.encode(this.transactions.length,r,i.offset),i.offset+=c.encode.bytes,this.transactions.forEach(e=>{const t=e.byteLength();e.toBuffer(r,i.offset),i.offset+=t})),r}toHex(e){return this.toBuffer(e).toString("hex")}checkTxRoots(){const e=this.hasWitnessCommit();return!(!e&&this.hasWitness())&&(this.__checkMerkleRoot()&&(!e||this.__checkWitnessCommit()))}checkProofOfWork(){const e=n.reverseBuffer(this.getHash()),t=d.calculateTarget(this.bits);return e.compare(t)<=0}__checkMerkleRoot(){if(!this.transactions)throw f;const e=d.calculateMerkleRoot(this.transactions);return 0===this.merkleRoot.compare(e)}__checkWitnessCommit(){if(!this.transactions)throw f;if(!this.hasWitnessCommit())throw l;const e=d.calculateMerkleRoot(this.transactions,!0);return 0===this.witnessCommit.compare(e)}}function h(e){return e instanceof Array&&e[0]&&e[0].ins&&e[0].ins instanceof Array&&e[0].ins[0]&&e[0].ins[0].witness&&e[0].ins[0].witness instanceof Array&&e[0].ins[0].witness.length>0}t.Block=d}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(93),i=r(22),o=r(66),a=r(79),s=r(51),u=r(19),c=r(82),f=r(12),l=r(50),d=r(1),h=r(52),p={network:f.bitcoin,maximumFeeRate:5e3};class b{constructor(e={},t=new n.Psbt(new g)){this.data=t,this.opts=Object.assign({},p,e),this.__CACHE={__NON_WITNESS_UTXO_TX_CACHE:[],__NON_WITNESS_UTXO_BUF_CACHE:[],__TX_IN_CACHE:{},__TX:this.data.globalMap.unsignedTx.tx,__UNSAFE_SIGN_NONSEGWIT:!1},0===this.data.inputs.length&&this.setVersion(2);const r=(e,t,r,n)=>Object.defineProperty(e,t,{enumerable:r,writable:n});r(this,"__CACHE",!1,!0),r(this,"opts",!1,!0)}static fromBase64(t,r={}){const n=e.from(t,"base64");return this.fromBuffer(n,r)}static fromHex(t,r={}){const n=e.from(t,"hex");return this.fromBuffer(n,r)}static fromBuffer(e,t={}){const r=n.Psbt.fromBuffer(e,m),i=new b(t,r);var o,a;return o=i.__CACHE.__TX,a=i.__CACHE,o.ins.forEach(e=>{M(a,e)}),i}get inputCount(){return this.data.inputs.length}get version(){return this.__CACHE.__TX.version}set version(e){this.setVersion(e)}get locktime(){return this.__CACHE.__TX.locktime}set locktime(e){this.setLocktime(e)}get txInputs(){return this.__CACHE.__TX.ins.map(e=>({hash:s.cloneBuffer(e.hash),index:e.index,sequence:e.sequence}))}get txOutputs(){return this.__CACHE.__TX.outs.map(e=>{let t;try{t=a.fromOutputScript(e.script,this.opts.network)}catch(e){}return{script:s.cloneBuffer(e.script),value:e.value,address:t}})}combine(...e){return this.data.combine(...e.map(e=>e.data)),this}clone(){const e=b.fromBuffer(this.data.toBuffer());return e.opts=JSON.parse(JSON.stringify(this.opts)),e}setMaximumFeeRate(e){O(e),this.opts.maximumFeeRate=e}setVersion(e){O(e),I(this.data.inputs,"setVersion");const t=this.__CACHE;return t.__TX.version=e,t.__EXTRACTED_TX=void 0,this}setLocktime(e){O(e),I(this.data.inputs,"setLocktime");const t=this.__CACHE;return t.__TX.locktime=e,t.__EXTRACTED_TX=void 0,this}setInputSequence(e,t){O(t),I(this.data.inputs,"setInputSequence");const r=this.__CACHE;if(r.__TX.ins.length<=e)throw new Error("Input index too high");return r.__TX.ins[e].sequence=t,r.__EXTRACTED_TX=void 0,this}addInputs(e){return e.forEach(e=>this.addInput(e)),this}addInput(e){if(arguments.length>1||!e||void 0===e.hash||void 0===e.index)throw new Error("Invalid arguments for Psbt.addInput. Requires single object with at least [hash] and [index]");I(this.data.inputs,"addInput"),e.witnessScript&&Y(e.witnessScript);const t=this.__CACHE;this.data.addInput(e);M(t,t.__TX.ins[t.__TX.ins.length-1]);const r=this.data.inputs.length-1,n=this.data.inputs[r];return n.nonWitnessUtxo&&q(this.__CACHE,n,r),t.__FEE=void 0,t.__FEE_RATE=void 0,t.__EXTRACTED_TX=void 0,this}addOutputs(e){return e.forEach(e=>this.addOutput(e)),this}addOutput(e){if(arguments.length>1||!e||void 0===e.value||void 0===e.address&&void 0===e.script)throw new Error("Invalid arguments for Psbt.addOutput. Requires single object with at least [script or address] and [value]");I(this.data.inputs,"addOutput");const{address:t}=e;if("string"==typeof t){const{network:r}=this.opts,n=a.toOutputScript(t,r);e=Object.assign(e,{script:n})}const r=this.__CACHE;return this.data.addOutput(e),r.__FEE=void 0,r.__FEE_RATE=void 0,r.__EXTRACTED_TX=void 0,this}extractTransaction(e){if(!this.data.inputs.every(w))throw new Error("Not finalized");const t=this.__CACHE;if(e||function(e,t,r){const n=t.__FEE_RATE||e.getFeeRate(),i=t.__EXTRACTED_TX.virtualSize(),o=n*i;if(n>=r.maximumFeeRate)throw new Error(`Warning: You are paying around ${(o/1e8).toFixed(8)} in fees, which is ${n} satoshi per byte for a transaction with a VSize of ${i} bytes (segwit counted as 0.25 byte per byte). Use setMaximumFeeRate method to raise your threshold, or pass true to the first arg of extractTransaction.`)}(this,t,this.opts),t.__EXTRACTED_TX)return t.__EXTRACTED_TX;const r=t.__TX.clone();return K(this.data.inputs,r,t,!0),r}getFeeRate(){return U("__FEE_RATE","fee rate",this.data.inputs,this.__CACHE)}getFee(){return U("__FEE","fee",this.data.inputs,this.__CACHE)}finalizeAllInputs(){return o.checkForInput(this.data.inputs,0),Q(this.data.inputs.length).forEach(e=>this.finalizeInput(e)),this}finalizeInput(e,t=C){const r=o.checkForInput(this.data.inputs,e),{script:n,isP2SH:i,isP2WSH:a,isSegwit:s}=function(e,t,r){const n=r.__TX,i={script:null,isSegwit:!1,isP2SH:!1,isP2WSH:!1};if(i.isP2SH=!!t.redeemScript,i.isP2WSH=!!t.witnessScript,t.witnessScript)i.script=t.witnessScript;else if(t.redeemScript)i.script=t.redeemScript;else if(t.nonWitnessUtxo){const o=W(r,t,e),a=n.ins[e].index;i.script=o.outs[a].script}else t.witnessUtxo&&(i.script=t.witnessUtxo.script);(t.witnessScript||x(i.script))&&(i.isSegwit=!0);return i}(e,r,this.__CACHE);if(!n)throw new Error("No script found for input #"+e);!function(e){if(!e.sighashType||!e.partialSig)return;const{partialSig:t,sighashType:r}=e;t.forEach(e=>{const{hashType:t}=d.signature.decode(e.signature);if(r!==t)throw new Error("Signature sighash does not match input sighash type")})}(r);const{finalScriptSig:u,finalScriptWitness:c}=t(e,r,n,s,i,a);if(u&&this.data.updateInput(e,{finalScriptSig:u}),c&&this.data.updateInput(e,{finalScriptWitness:c}),!u&&!c)throw new Error("Unknown error finalizing input #"+e);return this.data.clearFinalizedInput(e),this}getInputType(t){const r=o.checkForInput(this.data.inputs,t),n=X(V(t,r,this.__CACHE),t,"input",r.redeemScript||function(t){if(!t)return;const r=d.decompile(t);if(!r)return;const n=r[r.length-1];if(!e.isBuffer(n)||G(n)||(i=n,d.isCanonicalScriptSignature(i)))return;var i;if(!d.decompile(n))return;return n}(r.finalScriptSig),r.witnessScript||function(e){if(!e)return;const t=D(e),r=t[t.length-1];if(G(r))return;if(!d.decompile(r))return;return r}(r.finalScriptWitness));return("raw"===n.type?"":n.type+"-")+J(n.meaningfulScript)}inputHasPubkey(e,t){return function(e,t,r,n){const i=V(r,t,n),{meaningfulScript:o}=X(i,r,"input",t.redeemScript,t.witnessScript);return $(e,o)}(t,o.checkForInput(this.data.inputs,e),e,this.__CACHE)}inputHasHDKey(e,t){const r=o.checkForInput(this.data.inputs,e),n=P(t);return!!r.bip32Derivation&&r.bip32Derivation.some(n)}outputHasPubkey(e,t){return function(e,t,r,n){const i=n.__TX.outs[r].script,{meaningfulScript:o}=X(i,r,"output",t.redeemScript,t.witnessScript);return $(e,o)}(t,o.checkForOutput(this.data.outputs,e),e,this.__CACHE)}outputHasHDKey(e,t){const r=o.checkForOutput(this.data.outputs,e),n=P(t);return!!r.bip32Derivation&&r.bip32Derivation.some(n)}validateSignaturesOfAllInputs(){o.checkForInput(this.data.inputs,0);return Q(this.data.inputs.length).map(e=>this.validateSignaturesOfInput(e)).reduce((e,t)=>!0===t&&e,!0)}validateSignaturesOfInput(e,t){const r=this.data.inputs[e],n=(r||{}).partialSig;if(!r||!n||n.length<1)throw new Error("No signatures to validate");const i=t?n.filter(e=>e.pubkey.equals(t)):n;if(i.length<1)throw new Error("No signatures for this pubkey");const o=[];let a,s,u;for(const t of i){const n=d.signature.decode(t.signature),{hash:i,script:f}=u!==n.hashType?z(e,Object.assign({},r,{sighashType:n.hashType}),this.__CACHE,!0):{hash:a,script:s};u=n.hashType,a=i,s=f,B(t.pubkey,f,"verify");const l=c.fromPublicKey(t.pubkey);o.push(l.verify(i,n.signature))}return o.every(e=>!0===e)}signAllInputsHD(e,t=[h.Transaction.SIGHASH_ALL]){if(!e||!e.publicKey||!e.fingerprint)throw new Error("Need HDSigner to sign input");const r=[];for(const n of Q(this.data.inputs.length))try{this.signInputHD(n,e,t),r.push(!0)}catch(e){r.push(!1)}if(r.every(e=>!1===e))throw new Error("No inputs were signed");return this}signAllInputsHDAsync(e,t=[h.Transaction.SIGHASH_ALL]){return new Promise((r,n)=>{if(!e||!e.publicKey||!e.fingerprint)return n(new Error("Need HDSigner to sign input"));const i=[],o=[];for(const r of Q(this.data.inputs.length))o.push(this.signInputHDAsync(r,e,t).then(()=>{i.push(!0)},()=>{i.push(!1)}));return Promise.all(o).then(()=>{if(i.every(e=>!1===e))return n(new Error("No inputs were signed"));r()})})}signInputHD(e,t,r=[h.Transaction.SIGHASH_ALL]){if(!t||!t.publicKey||!t.fingerprint)throw new Error("Need HDSigner to sign input");return L(e,this.data.inputs,t).forEach(t=>this.signInput(e,t,r)),this}signInputHDAsync(e,t,r=[h.Transaction.SIGHASH_ALL]){return new Promise((n,i)=>{if(!t||!t.publicKey||!t.fingerprint)return i(new Error("Need HDSigner to sign input"));const o=L(e,this.data.inputs,t).map(t=>this.signInputAsync(e,t,r));return Promise.all(o).then(()=>{n()}).catch(i)})}signAllInputs(e,t=[h.Transaction.SIGHASH_ALL]){if(!e||!e.publicKey)throw new Error("Need Signer to sign input");const r=[];for(const n of Q(this.data.inputs.length))try{this.signInput(n,e,t),r.push(!0)}catch(e){r.push(!1)}if(r.every(e=>!1===e))throw new Error("No inputs were signed");return this}signAllInputsAsync(e,t=[h.Transaction.SIGHASH_ALL]){return new Promise((r,n)=>{if(!e||!e.publicKey)return n(new Error("Need Signer to sign input"));const i=[],o=[];for(const[r]of this.data.inputs.entries())o.push(this.signInputAsync(r,e,t).then(()=>{i.push(!0)},()=>{i.push(!1)}));return Promise.all(o).then(()=>{if(i.every(e=>!1===e))return n(new Error("No inputs were signed"));r()})})}signInput(e,t,r=[h.Transaction.SIGHASH_ALL]){if(!t||!t.publicKey)throw new Error("Need Signer to sign input");const{hash:n,sighashType:i}=H(this.data.inputs,e,t.publicKey,this.__CACHE,r),o=[{pubkey:t.publicKey,signature:d.signature.encode(t.sign(n),i)}];return this.data.updateInput(e,{partialSig:o}),this}signInputAsync(e,t,r=[h.Transaction.SIGHASH_ALL]){return Promise.resolve().then(()=>{if(!t||!t.publicKey)throw new Error("Need Signer to sign input");const{hash:n,sighashType:i}=H(this.data.inputs,e,t.publicKey,this.__CACHE,r);return Promise.resolve(t.sign(n)).then(r=>{const n=[{pubkey:t.publicKey,signature:d.signature.encode(r,i)}];this.data.updateInput(e,{partialSig:n})})})}toBuffer(){return y(this.__CACHE),this.data.toBuffer()}toHex(){return y(this.__CACHE),this.data.toHex()}toBase64(){return y(this.__CACHE),this.data.toBase64()}updateGlobal(e){return this.data.updateGlobal(e),this}updateInput(e,t){return t.witnessScript&&Y(t.witnessScript),this.data.updateInput(e,t),t.nonWitnessUtxo&&q(this.__CACHE,this.data.inputs[e],e),this}updateOutput(e,t){return this.data.updateOutput(e,t),this}addUnknownKeyValToGlobal(e){return this.data.addUnknownKeyValToGlobal(e),this}addUnknownKeyValToInput(e,t){return this.data.addUnknownKeyValToInput(e,t),this}addUnknownKeyValToOutput(e,t){return this.data.addUnknownKeyValToOutput(e,t),this}clearFinalizedInput(e){return this.data.clearFinalizedInput(e),this}}t.Psbt=b;const m=e=>new g(e);class g{constructor(t=e.from([2,0,0,0,0,0,0,0,0,0])){this.tx=h.Transaction.fromBuffer(t),function(e){if(!e.ins.every(e=>e.script&&0===e.script.length&&e.witness&&0===e.witness.length))throw new Error("Format Error: Transaction ScriptSigs are not empty")}(this.tx),Object.defineProperty(this,"tx",{enumerable:!1,writable:!0})}getInputOutputCounts(){return{inputCount:this.tx.ins.length,outputCount:this.tx.outs.length}}addInput(t){if(void 0===t.hash||void 0===t.index||!e.isBuffer(t.hash)&&"string"!=typeof t.hash||"number"!=typeof t.index)throw new Error("Error adding input.");const r="string"==typeof t.hash?s.reverseBuffer(e.from(t.hash,"hex")):t.hash;this.tx.addInput(r,t.index,t.sequence)}addOutput(t){if(void 0===t.script||void 0===t.value||!e.isBuffer(t.script)||"number"!=typeof t.value)throw new Error("Error adding output.");this.tx.addOutput(t.script,t.value)}toBuffer(){return this.tx.toBuffer()}}function y(e){if(!1!==e.__UNSAFE_SIGN_NONSEGWIT)throw new Error("Not BIP174 compliant, can not export")}function v(e,t,r){if(!t)return!1;let n;if(n=r?r.map(e=>{const r=c.fromPublicKey(e,{compressed:!0}).publicKey;return t.find(e=>e.pubkey.equals(r))}).filter(e=>!!e):t,n.length>e)throw new Error("Too many signatures");return n.length===e}function w(e){return!!e.finalScriptSig||!!e.finalScriptWitness}function _(e){return t=>{try{return e({output:t}),!0}catch(e){return!1}}}const E=_(l.p2ms),k=_(l.p2pk),S=_(l.p2pkh),x=_(l.p2wpkh),T=_(l.p2wsh),A=_(l.p2sh);function P(e){return t=>!!t.masterFingerprint.equals(e.fingerprint)&&!!e.derivePath(t.path).publicKey.equals(t.pubkey)}function O(e){if("number"!=typeof e||e!==Math.floor(e)||e>4294967295||e<0)throw new Error("Invalid 32 bit integer")}function I(t,r){t.forEach(t=>{let n=!1,i=[];if(0===(t.partialSig||[]).length){if(!t.finalScriptSig&&!t.finalScriptWitness)return;i=function(t){const r=t.finalScriptSig&&d.decompile(t.finalScriptSig)||[],n=t.finalScriptWitness&&d.decompile(t.finalScriptWitness)||[];return r.concat(n).filter(t=>e.isBuffer(t)&&d.isCanonicalScriptSignature(t)).map(e=>({signature:e}))}(t)}else i=t.partialSig;if(i.forEach(e=>{const{hashType:t}=d.signature.decode(e.signature),i=[];t&h.Transaction.SIGHASH_ANYONECANPAY&&i.push("addInput");switch(31&t){case h.Transaction.SIGHASH_ALL:break;case h.Transaction.SIGHASH_SINGLE:case h.Transaction.SIGHASH_NONE:i.push("addOutput"),i.push("setInputSequence")}-1===i.indexOf(r)&&(n=!0)}),n)throw new Error("Can not modify transaction, signatures exist.")})}function B(e,t,r){if(!$(e,t))throw new Error(`Can not ${r} for this input with the key ${e.toString("hex")}`)}function M(t,r){const n=s.reverseBuffer(e.from(r.hash)).toString("hex")+":"+r.index;if(t.__TX_IN_CACHE[n])throw new Error("Duplicate input detected.");t.__TX_IN_CACHE[n]=1}function R(e,t){return(r,n,i,o)=>{const a=e({redeem:{output:i}}).output;if(!n.equals(a))throw new Error(`${t} for ${o} #${r} doesn't match the scriptPubKey in the prevout`)}}const N=R(l.p2sh,"Redeem script"),j=R(l.p2wsh,"Witness script");function U(e,t,r,n){if(!r.every(w))throw new Error("PSBT must be finalized to calculate "+t);if("__FEE_RATE"===e&&n.__FEE_RATE)return n.__FEE_RATE;if("__FEE"===e&&n.__FEE)return n.__FEE;let i,o=!0;return n.__EXTRACTED_TX?(i=n.__EXTRACTED_TX,o=!1):i=n.__TX.clone(),K(r,i,n,o),"__FEE_RATE"===e?n.__FEE_RATE:"__FEE"===e?n.__FEE:void 0}function C(e,t,r,n,i,o){const a=J(r);if(!function(e,t,r){switch(r){case"pubkey":case"pubkeyhash":case"witnesspubkeyhash":return v(1,e.partialSig);case"multisig":const r=l.p2ms({output:t});return v(r.m,e.partialSig,r.pubkeys);default:return!1}}(t,r,a))throw new Error("Can not finalize input #"+e);return function(e,t,r,n,i,o){let a,s;const u=function(e,t,r){let n;switch(t){case"multisig":const t=function(e,t){return l.p2ms({output:e}).pubkeys.map(e=>(t.filter(t=>t.pubkey.equals(e))[0]||{}).signature).filter(e=>!!e)}(e,r);n=l.p2ms({output:e,signatures:t});break;case"pubkey":n=l.p2pk({output:e,signature:r[0].signature});break;case"pubkeyhash":n=l.p2pkh({output:e,pubkey:r[0].pubkey,signature:r[0].signature});break;case"witnesspubkeyhash":n=l.p2wpkh({output:e,pubkey:r[0].pubkey,signature:r[0].signature})}return n}(e,t,r),c=o?l.p2wsh({redeem:u}):null,f=i?l.p2sh({redeem:c||u}):null;n?(s=F(c?c.witness:u.witness),f&&(a=f.input)):a=f?f.input:u.input;return{finalScriptSig:a,finalScriptWitness:s}}(r,a,t.partialSig,n,i,o)}function H(e,t,r,n,i){const a=o.checkForInput(e,t),{hash:s,sighashType:u,script:c}=z(t,a,n,!1,i);return B(r,c,"sign"),{hash:s,sighashType:u}}function z(e,t,r,n,i){const o=r.__TX,a=t.sighashType||h.Transaction.SIGHASH_ALL;if(i&&i.indexOf(a)<0){const e=function(e){let t=e&h.Transaction.SIGHASH_ANYONECANPAY?"SIGHASH_ANYONECANPAY | ":"";switch(31&e){case h.Transaction.SIGHASH_ALL:t+="SIGHASH_ALL";break;case h.Transaction.SIGHASH_SINGLE:t+="SIGHASH_SINGLE";break;case h.Transaction.SIGHASH_NONE:t+="SIGHASH_NONE"}return t}(a);throw new Error("Sighash type is not allowed. Retry the sign method passing the sighashTypes array of whitelisted types. Sighash type: "+e)}let s,u;if(t.nonWitnessUtxo){const n=W(r,t,e),i=o.ins[e].hash,a=n.getHash();if(!i.equals(a))throw new Error(`Non-witness UTXO hash for input #${e} doesn't match the hash specified in the prevout`);const s=o.ins[e].index;u=n.outs[s]}else{if(!t.witnessUtxo)throw new Error("Need a Utxo input item for signing");u=t.witnessUtxo}const{meaningfulScript:c,type:f}=X(u.script,e,"input",t.redeemScript,t.witnessScript);if(["p2sh-p2wsh","p2wsh"].indexOf(f)>=0)s=o.hashForWitnessV0(e,c,u.value,a);else if(x(c)){const t=l.p2pkh({hash:c.slice(2)}).output;s=o.hashForWitnessV0(e,t,u.value,a)}else{if(void 0===t.nonWitnessUtxo&&!1===r.__UNSAFE_SIGN_NONSEGWIT)throw new Error(`Input #${e} has witnessUtxo but non-segwit script: `+c.toString("hex"));n||!1===r.__UNSAFE_SIGN_NONSEGWIT||console.warn("Warning: Signing non-segwit inputs without the full parent transaction means there is a chance that a miner could feed you incorrect information to trick you into paying large fees. This behavior is the same as the old TransactionBuilder class when signing non-segwit scripts. You are not able to export this Psbt with toBuffer|toBase64|toHex since it is not BIP174 compliant.\n*********************\nPROCEED WITH CAUTION!\n*********************"),s=o.hashForSignature(e,c,a)}return{script:c,sighashType:a,hash:s}}function L(e,t,r){const n=o.checkForInput(t,e);if(!n.bip32Derivation||0===n.bip32Derivation.length)throw new Error("Need bip32Derivation to sign with HD");const i=n.bip32Derivation.map(e=>e.masterFingerprint.equals(r.fingerprint)?e:void 0).filter(e=>!!e);if(0===i.length)throw new Error("Need one bip32Derivation masterFingerprint to match the HDSigner fingerprint");return i.map(e=>{const t=r.derivePath(e.path);if(!e.pubkey.equals(t.publicKey))throw new Error("pubkey did not match bip32Derivation");return t})}function D(e){let t=0;function r(){const r=i.decode(e,t);return t+=i.decode.bytes,r}function n(){return n=r(),t+=n,e.slice(t-n,t);var n}return function(){const e=r(),t=[];for(let r=0;r<e;r++)t.push(n());return t}()}function F(t){let r=e.allocUnsafe(0);function n(t){const n=r.length,o=i.encodingLength(t);r=e.concat([r,e.allocUnsafe(o)]),i.encode(t,r,n)}function o(t){n(t.length),function(t){r=e.concat([r,e.from(t)])}(t)}var a;return n((a=t).length),a.forEach(o),r}function q(e,t,r){e.__NON_WITNESS_UTXO_BUF_CACHE[r]=t.nonWitnessUtxo;const n=h.Transaction.fromBuffer(t.nonWitnessUtxo);e.__NON_WITNESS_UTXO_TX_CACHE[r]=n;const i=e,o=r;delete t.nonWitnessUtxo,Object.defineProperty(t,"nonWitnessUtxo",{enumerable:!0,get(){const e=i.__NON_WITNESS_UTXO_BUF_CACHE[o],t=i.__NON_WITNESS_UTXO_TX_CACHE[o];if(void 0!==e)return e;{const e=t.toBuffer();return i.__NON_WITNESS_UTXO_BUF_CACHE[o]=e,e}},set(e){i.__NON_WITNESS_UTXO_BUF_CACHE[o]=e}})}function K(e,t,r,n){let i=0;e.forEach((e,o)=>{if(n&&e.finalScriptSig&&(t.ins[o].script=e.finalScriptSig),n&&e.finalScriptWitness&&(t.ins[o].witness=D(e.finalScriptWitness)),e.witnessUtxo)i+=e.witnessUtxo.value;else if(e.nonWitnessUtxo){const n=W(r,e,o),a=t.ins[o].index,s=n.outs[a];i+=s.value}});const o=t.outs.reduce((e,t)=>e+t.value,0),a=i-o;if(a<0)throw new Error("Outputs are spending more than Inputs");const s=t.virtualSize();r.__FEE=a,r.__EXTRACTED_TX=t,r.__FEE_RATE=Math.floor(a/s)}function W(e,t,r){const n=e.__NON_WITNESS_UTXO_TX_CACHE;return n[r]||q(e,t,r),n[r]}function V(e,t,r){if(void 0!==t.witnessUtxo)return t.witnessUtxo.script;if(void 0!==t.nonWitnessUtxo){return W(r,t,e).outs[r.__TX.ins[e].index].script}throw new Error("Can't find pubkey in input without Utxo data")}function G(e){return 33===e.length&&d.isCanonicalPubKey(e)}function X(e,t,r,n,i){const o=A(e),a=o&&n&&T(n),s=T(e);if(o&&void 0===n)throw new Error("scriptPubkey is P2SH but redeemScript missing");if((s||a)&&void 0===i)throw new Error("scriptPubkey or redeemScript is P2WSH but witnessScript missing");let u;return a?(u=i,N(t,e,n,r),j(t,n,i,r),Y(u)):s?(u=i,j(t,e,i,r),Y(u)):o?(u=n,N(t,e,n,r)):u=e,{meaningfulScript:u,type:a?"p2sh-p2wsh":o?"p2sh":s?"p2wsh":"raw"}}function Y(e){if(x(e)||A(e))throw new Error("P2WPKH or P2SH can not be contained within P2WSH")}function $(e,t){const r=u.hash160(e),n=d.decompile(t);if(null===n)throw new Error("Unknown script error");return n.some(t=>"number"!=typeof t&&(t.equals(e)||t.equals(r)))}function J(e){return x(e)?"witnesspubkeyhash":S(e)?"pubkeyhash":E(e)?"multisig":k(e)?"pubkey":"nonstandard"}function Q(e){return[...Array(e).keys()]}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(79),i=r(51),o=r(287),a=r(19),s=r(82),u=r(12),c=r(50),f=r(1),l=r(1),d=r(52),h=r(16),p=r(3),b=o.types,m=new Set(["p2pkh","p2pk","p2wpkh","p2ms","p2sh-p2pkh","p2sh-p2pk","p2sh-p2wpkh","p2sh-p2ms","p2wsh-p2pkh","p2wsh-p2pk","p2wsh-p2ms","p2sh-p2wsh-p2pkh","p2sh-p2wsh-p2pk","p2sh-p2wsh-p2ms"]);function g(e,t,r){try{p(e,t)}catch(e){throw new Error(r)}}class y{constructor(e=u.bitcoin,t=2500){this.network=e,this.maximumFeeRate=t,this.__PREV_TX_SET={},this.__INPUTS=[],this.__TX=new d.Transaction,this.__TX.version=2,this.__USE_LOW_R=!1,console.warn("Deprecation Warning: TransactionBuilder will be removed in the future. (v6.x.x or later) Please use the Psbt class instead. Examples of usage are available in the transactions-psbt.js integration test file on our Github. A high level explanation is available in the psbt.ts and psbt.js files as well.")}static fromTransaction(e,t){const r=new y(t);return r.setVersion(e.version),r.setLockTime(e.locktime),e.outs.forEach(e=>{r.addOutput(e.script,e.value)}),e.ins.forEach(e=>{r.__addInputUnsafe(e.hash,e.index,{sequence:e.sequence,script:e.script,witness:e.witness})}),r.__INPUTS.forEach((t,r)=>{!function(e,t,r){if(e.redeemScriptType!==b.P2MS||!e.redeemScript)return;if(e.pubkeys.length===e.signatures.length)return;const n=e.signatures.concat();e.signatures=e.pubkeys.map(i=>{const o=s.fromPublicKey(i);let a;return n.some((i,s)=>{if(!i)return!1;const u=f.signature.decode(i),c=t.hashForSignature(r,e.redeemScript,u.hashType);return!!o.verify(c,u.signature)&&(n[s]=void 0,a=i,!0)}),a})}(t,e,r)}),r}setLowR(e){return p(p.maybe(p.Boolean),e),void 0===e&&(e=!0),this.__USE_LOW_R=e,e}setLockTime(e){if(p(h.UInt32,e),this.__INPUTS.some(e=>!!e.signatures&&e.signatures.some(e=>void 0!==e)))throw new Error("No, this would invalidate signatures");this.__TX.locktime=e}setVersion(e){p(h.UInt32,e),this.__TX.version=e}addInput(t,r,n,o){if(!this.__canModifyInputs())throw new Error("No, this would invalidate signatures");let a;if("string"==typeof(s=t)||s instanceof String)t=i.reverseBuffer(e.from(t,"hex"));else if(function(e){return e instanceof d.Transaction}(t)){const e=t.outs[r];o=e.script,a=e.value,t=t.getHash(!1)}var s;return this.__addInputUnsafe(t,r,{sequence:n,prevOutScript:o,value:a})}addOutput(e,t){if(!this.__canModifyOutputs())throw new Error("No, this would invalidate signatures");return"string"==typeof e&&(e=n.toOutputScript(e,this.network)),this.__TX.addOutput(e,t)}build(){return this.__build(!1)}buildIncomplete(){return this.__build(!0)}sign(e,t,r,n,i,o){!function({input:e,ourPubKey:t,keyPair:r,signatureHash:n,hashType:i,useLowR:o}){let a=!1;for(const[s,u]of e.pubkeys.entries()){if(!t.equals(u))continue;if(e.signatures[s])throw new Error("Signature already exists");if(33!==t.length&&e.hasWitness)throw new Error("BIP143 rejects uncompressed public keys in P2WPKH or P2WSH");const c=r.sign(n,o);e.signatures[s]=f.signature.encode(c,i),a=!0}if(!a)throw new Error("Key pair cannot sign for this input")}(function(e,t,r,n,i,o,a,s,u,l,y){let _;if("number"==typeof i)console.warn("DEPRECATED: TransactionBuilder sign method arguments will change in v6, please use the TxbSignArg interface"),_=i;else{if("object"!=typeof i)throw new TypeError("TransactionBuilder sign first arg must be TxbSignArg or number");!function(e,t){if(!m.has(t.prevOutScriptType))throw new TypeError(`Unknown prevOutScriptType "${t.prevOutScriptType}"`);g(p.Number,t.vin,"sign must include vin parameter as Number (input index)"),g(h.Signer,t.keyPair,"sign must include keyPair parameter as Signer interface"),g(p.maybe(p.Number),t.hashType,"sign hashType parameter must be a number");const r=(e[t.vin]||[]).prevOutType,n=t.prevOutScriptType;switch(n){case"p2pkh":if(r&&"pubkeyhash"!==r)throw new TypeError(`input #${t.vin} is not of type p2pkh: ${r}`);g(p.value(void 0),t.witnessScript,n+" requires NO witnessScript"),g(p.value(void 0),t.redeemScript,n+" requires NO redeemScript"),g(p.value(void 0),t.witnessValue,n+" requires NO witnessValue");break;case"p2pk":if(r&&"pubkey"!==r)throw new TypeError(`input #${t.vin} is not of type p2pk: ${r}`);g(p.value(void 0),t.witnessScript,n+" requires NO witnessScript"),g(p.value(void 0),t.redeemScript,n+" requires NO redeemScript"),g(p.value(void 0),t.witnessValue,n+" requires NO witnessValue");break;case"p2wpkh":if(r&&"witnesspubkeyhash"!==r)throw new TypeError(`input #${t.vin} is not of type p2wpkh: ${r}`);g(p.value(void 0),t.witnessScript,n+" requires NO witnessScript"),g(p.value(void 0),t.redeemScript,n+" requires NO redeemScript"),g(h.Satoshi,t.witnessValue,n+" requires witnessValue");break;case"p2ms":if(r&&"multisig"!==r)throw new TypeError(`input #${t.vin} is not of type p2ms: ${r}`);g(p.value(void 0),t.witnessScript,n+" requires NO witnessScript"),g(p.value(void 0),t.redeemScript,n+" requires NO redeemScript"),g(p.value(void 0),t.witnessValue,n+" requires NO witnessValue");break;case"p2sh-p2wpkh":if(r&&"scripthash"!==r)throw new TypeError(`input #${t.vin} is not of type p2sh-p2wpkh: ${r}`);g(p.value(void 0),t.witnessScript,n+" requires NO witnessScript"),g(p.Buffer,t.redeemScript,n+" requires redeemScript"),g(h.Satoshi,t.witnessValue,n+" requires witnessValue");break;case"p2sh-p2ms":case"p2sh-p2pk":case"p2sh-p2pkh":if(r&&"scripthash"!==r)throw new TypeError(`input #${t.vin} is not of type ${n}: ${r}`);g(p.value(void 0),t.witnessScript,n+" requires NO witnessScript"),g(p.Buffer,t.redeemScript,n+" requires redeemScript"),g(p.value(void 0),t.witnessValue,n+" requires NO witnessValue");break;case"p2wsh-p2ms":case"p2wsh-p2pk":case"p2wsh-p2pkh":if(r&&"witnessscripthash"!==r)throw new TypeError(`input #${t.vin} is not of type ${n}: ${r}`);g(p.Buffer,t.witnessScript,n+" requires witnessScript"),g(p.value(void 0),t.redeemScript,n+" requires NO redeemScript"),g(h.Satoshi,t.witnessValue,n+" requires witnessValue");break;case"p2sh-p2wsh-p2ms":case"p2sh-p2wsh-p2pk":case"p2sh-p2wsh-p2pkh":if(r&&"scripthash"!==r)throw new TypeError(`input #${t.vin} is not of type ${n}: ${r}`);g(p.Buffer,t.witnessScript,n+" requires witnessScript"),g(p.Buffer,t.redeemScript,n+" requires witnessScript"),g(h.Satoshi,t.witnessValue,n+" requires witnessScript")}}(t,i),({vin:_,keyPair:o,redeemScript:a,hashType:s,witnessValue:u,witnessScript:l}=i)}if(void 0===o)throw new Error("sign requires keypair");if(o.network&&o.network!==e)throw new TypeError("Inconsistent network");if(!t[_])throw new Error("No input at index: "+_);if(s=s||d.Transaction.SIGHASH_ALL,r(s))throw new Error("Transaction needs outputs");const E=t[_];if(void 0!==E.redeemScript&&a&&!E.redeemScript.equals(a))throw new Error("Inconsistent redeemScript");const k=o.publicKey||o.getPublicKey&&o.getPublicKey();if(!w(E)){if(void 0!==u){if(void 0!==E.value&&E.value!==u)throw new Error("Input did not match witnessValue");p(h.Satoshi,u),E.value=u}if(!w(E)){const e=function(e,t,r,n){if(r&&n){const i=c.p2wsh({redeem:{output:n}}),o=c.p2wsh({output:r}),a=c.p2sh({redeem:{output:r}}),s=c.p2sh({redeem:i});if(!i.hash.equals(o.hash))throw new Error("Witness script inconsistent with prevOutScript");if(!a.hash.equals(s.hash))throw new Error("Redeem script inconsistent with prevOutScript");const u=v(i.redeem.output,t);if(!u.pubkeys)throw new Error(u.type+" not supported as witnessScript ("+f.toASM(n)+")");e.signatures&&e.signatures.some(e=>void 0!==e)&&(u.signatures=e.signatures);const l=n;if(u.type===b.P2WPKH)throw new Error("P2SH(P2WSH(P2WPKH)) is a consensus failure");return{redeemScript:r,redeemScriptType:b.P2WSH,witnessScript:n,witnessScriptType:u.type,prevOutType:b.P2SH,prevOutScript:a.output,hasWitness:!0,signScript:l,signType:u.type,pubkeys:u.pubkeys,signatures:u.signatures,maxSignatures:u.maxSignatures}}if(r){const n=c.p2sh({redeem:{output:r}});if(e.prevOutScript){let t;try{t=c.p2sh({output:e.prevOutScript})}catch(e){throw new Error("PrevOutScript must be P2SH")}if(!n.hash.equals(t.hash))throw new Error("Redeem script inconsistent with prevOutScript")}const i=v(n.redeem.output,t);if(!i.pubkeys)throw new Error(i.type+" not supported as redeemScript ("+f.toASM(r)+")");e.signatures&&e.signatures.some(e=>void 0!==e)&&(i.signatures=e.signatures);let o=r;return i.type===b.P2WPKH&&(o=c.p2pkh({pubkey:i.pubkeys[0]}).output),{redeemScript:r,redeemScriptType:i.type,prevOutType:b.P2SH,prevOutScript:n.output,hasWitness:i.type===b.P2WPKH,signScript:o,signType:i.type,pubkeys:i.pubkeys,signatures:i.signatures,maxSignatures:i.maxSignatures}}if(n){const r=c.p2wsh({redeem:{output:n}});if(e.prevOutScript){const t=c.p2wsh({output:e.prevOutScript});if(!r.hash.equals(t.hash))throw new Error("Witness script inconsistent with prevOutScript")}const i=v(r.redeem.output,t);if(!i.pubkeys)throw new Error(i.type+" not supported as witnessScript ("+f.toASM(n)+")");e.signatures&&e.signatures.some(e=>void 0!==e)&&(i.signatures=e.signatures);const o=n;if(i.type===b.P2WPKH)throw new Error("P2WSH(P2WPKH) is a consensus failure");return{witnessScript:n,witnessScriptType:i.type,prevOutType:b.P2WSH,prevOutScript:r.output,hasWitness:!0,signScript:o,signType:i.type,pubkeys:i.pubkeys,signatures:i.signatures,maxSignatures:i.maxSignatures}}if(e.prevOutType&&e.prevOutScript){if(e.prevOutType===b.P2SH)throw new Error("PrevOutScript is "+e.prevOutType+", requires redeemScript");if(e.prevOutType===b.P2WSH)throw new Error("PrevOutScript is "+e.prevOutType+", requires witnessScript");if(!e.prevOutScript)throw new Error("PrevOutScript is missing");const r=v(e.prevOutScript,t);if(!r.pubkeys)throw new Error(r.type+" not supported ("+f.toASM(e.prevOutScript)+")");e.signatures&&e.signatures.some(e=>void 0!==e)&&(r.signatures=e.signatures);let n=e.prevOutScript;return r.type===b.P2WPKH&&(n=c.p2pkh({pubkey:r.pubkeys[0]}).output),{prevOutType:r.type,prevOutScript:e.prevOutScript,hasWitness:r.type===b.P2WPKH,signScript:n,signType:r.type,pubkeys:r.pubkeys,signatures:r.signatures,maxSignatures:r.maxSignatures}}const i=c.p2pkh({pubkey:t}).output;return{prevOutType:b.P2PKH,prevOutScript:i,hasWitness:!1,signScript:i,signType:b.P2PKH,pubkeys:[t],signatures:[void 0]}}(E,k,a,l);Object.assign(E,e)}if(!w(E))throw Error(E.prevOutType+" not supported")}let S;S=E.hasWitness?n.hashForWitnessV0(_,E.signScript,E.value,s):n.hashForSignature(_,E.signScript,s);return{input:E,ourPubKey:k,keyPair:o,signatureHash:S,hashType:s,useLowR:!!y}}(this.network,this.__INPUTS,this.__needsOutputs.bind(this),this.__TX,e,t,r,n,i,o,this.__USE_LOW_R))}__addInputUnsafe(e,t,r){if(d.Transaction.isCoinbaseHash(e))throw new Error("coinbase inputs not supported");const n=e.toString("hex")+":"+t;if(void 0!==this.__PREV_TX_SET[n])throw new Error("Duplicate TxOut: "+n);let i={};if(void 0!==r.script&&(i=function e(t,r,n,i){if(0===t.length&&0===r.length)return{};if(!n){let e=o.input(t,!0),i=o.witness(r,!0);e===b.NONSTANDARD&&(e=void 0),i===b.NONSTANDARD&&(i=void 0),n=e||i}switch(n){case b.P2WPKH:{const{output:e,pubkey:t,signature:n}=c.p2wpkh({witness:r});return{prevOutScript:e,prevOutType:b.P2WPKH,pubkeys:[t],signatures:[n]}}case b.P2PKH:{const{output:e,pubkey:r,signature:n}=c.p2pkh({input:t});return{prevOutScript:e,prevOutType:b.P2PKH,pubkeys:[r],signatures:[n]}}case b.P2PK:{const{signature:e}=c.p2pk({input:t});return{prevOutType:b.P2PK,pubkeys:[void 0],signatures:[e]}}case b.P2MS:{const{m:e,pubkeys:r,signatures:n}=c.p2ms({input:t,output:i},{allowIncomplete:!0});return{prevOutType:b.P2MS,pubkeys:r,signatures:n,maxSignatures:e}}}if(n===b.P2SH){const{output:n,redeem:i}=c.p2sh({input:t,witness:r}),a=o.output(i.output),s=e(i.input,i.witness,a,i.output);return s.prevOutType?{prevOutScript:n,prevOutType:b.P2SH,redeemScript:i.output,redeemScriptType:s.prevOutType,witnessScript:s.witnessScript,witnessScriptType:s.witnessScriptType,pubkeys:s.pubkeys,signatures:s.signatures}:{}}if(n===b.P2WSH){const{output:n,redeem:i}=c.p2wsh({input:t,witness:r}),a=o.output(i.output);let s;return s=a===b.P2WPKH?e(i.input,i.witness,a):e(f.compile(i.witness),[],a,i.output),s.prevOutType?{prevOutScript:n,prevOutType:b.P2WSH,witnessScript:i.output,witnessScriptType:s.prevOutType,pubkeys:s.pubkeys,signatures:s.signatures}:{}}return{prevOutType:b.NONSTANDARD,prevOutScript:t}}(r.script,r.witness||[])),void 0!==r.value&&(i.value=r.value),!i.prevOutScript&&r.prevOutScript){let e;if(!i.pubkeys&&!i.signatures){const t=v(r.prevOutScript);t.pubkeys&&(i.pubkeys=t.pubkeys,i.signatures=t.signatures),e=t.type}i.prevOutScript=r.prevOutScript,i.prevOutType=e||o.output(r.prevOutScript)}const a=this.__TX.addInput(e,t,r.sequence,r.scriptSig);return this.__INPUTS[a]=i,this.__PREV_TX_SET[n]=!0,a}__build(e){if(!e){if(!this.__TX.ins.length)throw new Error("Transaction has no inputs");if(!this.__TX.outs.length)throw new Error("Transaction has no outputs")}const t=this.__TX.clone();if(this.__INPUTS.forEach((r,n)=>{if(!r.prevOutType&&!e)throw new Error("Transaction is not complete");const i=function e(t,r,n){const i=r.pubkeys||[];let o=r.signatures||[];switch(t){case b.P2PKH:if(0===i.length)break;if(0===o.length)break;return c.p2pkh({pubkey:i[0],signature:o[0]});case b.P2WPKH:if(0===i.length)break;if(0===o.length)break;return c.p2wpkh({pubkey:i[0],signature:o[0]});case b.P2PK:if(0===i.length)break;if(0===o.length)break;return c.p2pk({signature:o[0]});case b.P2MS:{const e=r.maxSignatures;o=n?o.map(e=>e||l.OPS.OP_0):o.filter(e=>e);const t=!n||e===o.length;return c.p2ms({m:e,pubkeys:i,signatures:o},{allowIncomplete:n,validate:t})}case b.P2SH:{const t=e(r.redeemScriptType,r,n);if(!t)return;return c.p2sh({redeem:{output:t.output||r.redeemScript,input:t.input,witness:t.witness}})}case b.P2WSH:{const t=e(r.witnessScriptType,r,n);if(!t)return;return c.p2wsh({redeem:{output:r.witnessScript,input:t.input,witness:t.witness}})}}}(r.prevOutType,r,e);if(i)t.setInputScript(n,i.input),t.setWitness(n,i.witness);else{if(!e&&r.prevOutType===b.NONSTANDARD)throw new Error("Unknown input type");if(!e)throw new Error("Not enough information")}}),!e&&this.__overMaximumFees(t.virtualSize()))throw new Error("Transaction has absurd fees");return t}__canModifyInputs(){return this.__INPUTS.every(e=>!e.signatures||e.signatures.every(e=>{if(!e)return!0;return 0!=(_(e)&d.Transaction.SIGHASH_ANYONECANPAY)}))}__needsOutputs(e){return e===d.Transaction.SIGHASH_ALL?0===this.__TX.outs.length:0===this.__TX.outs.length&&this.__INPUTS.some(e=>!!e.signatures&&e.signatures.some(e=>{if(!e)return!1;return!(_(e)&d.Transaction.SIGHASH_NONE)}))}__canModifyOutputs(){const e=this.__TX.ins.length,t=this.__TX.outs.length;return this.__INPUTS.every(r=>void 0===r.signatures||r.signatures.every(r=>{if(!r)return!0;const n=31&_(r);return n===d.Transaction.SIGHASH_NONE||n===d.Transaction.SIGHASH_SINGLE&&e<=t}))}__overMaximumFees(e){return(this.__INPUTS.reduce((e,t)=>e+(t.value>>>0),0)-this.__TX.outs.reduce((e,t)=>e+t.value,0))/e>this.maximumFeeRate}}function v(e,t){p(h.Buffer,e);const r=o.output(e);switch(r){case b.P2PKH:{if(!t)return{type:r};const n=c.p2pkh({output:e}).hash,i=a.hash160(t);return n.equals(i)?{type:r,pubkeys:[t],signatures:[void 0]}:{type:r}}case b.P2WPKH:{if(!t)return{type:r};const n=c.p2wpkh({output:e}).hash,i=a.hash160(t);return n.equals(i)?{type:r,pubkeys:[t],signatures:[void 0]}:{type:r}}case b.P2PK:return{type:r,pubkeys:[c.p2pk({output:e}).pubkey],signatures:[void 0]};case b.P2MS:{const t=c.p2ms({output:e});return{type:r,pubkeys:t.pubkeys,signatures:t.pubkeys.map(()=>{}),maxSignatures:t.m}}}return{type:r}}function w(e){return void 0!==e.signScript&&void 0!==e.signType&&void 0!==e.pubkeys&&void 0!==e.signatures&&e.signatures.length===e.pubkeys.length&&e.pubkeys.length>0&&(!1===e.hasWitness||void 0!==e.value)}function _(e){return e.readUInt8(e.length-1)}t.TransactionBuilder=y}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(83),o=r(290),a=r(84),s=r(85),u=r(295),c=r(298),f=r(300),l=r(302),d={P2MS:"multisig",NONSTANDARD:"nonstandard",NULLDATA:"nulldata",P2PK:"pubkey",P2PKH:"pubkeyhash",P2SH:"scripthash",P2WPKH:"witnesspubkeyhash",P2WSH:"witnessscripthash",WITNESS_COMMITMENT:"witnesscommitment"};t.types=d,t.output=function(e){if(f.output.check(e))return d.P2WPKH;if(l.output.check(e))return d.P2WSH;if(s.output.check(e))return d.P2PKH;if(u.output.check(e))return d.P2SH;const t=n.decompile(e);if(!t)throw new TypeError("Invalid script");return i.output.check(t)?d.P2MS:a.output.check(t)?d.P2PK:c.output.check(t)?d.WITNESS_COMMITMENT:o.output.check(t)?d.NULLDATA:d.NONSTANDARD},t.input=function(e,t){const r=n.decompile(e);if(!r)throw new TypeError("Invalid script");return s.input.check(r)?d.P2PKH:u.input.check(r,t)?d.P2SH:i.input.check(r,t)?d.P2MS:a.input.check(r)?d.P2PK:d.NONSTANDARD},t.witness=function(e,t){const r=n.decompile(e);if(!r)throw new TypeError("Invalid script");return f.input.check(r)?d.P2WPKH:l.input.check(r,t)?d.P2WSH:d.NONSTANDARD}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(1);function o(e){return e===i.OPS.OP_0||n.isCanonicalScriptSignature(e)}function a(e,t){const r=n.decompile(e);return!(r.length<2)&&(r[0]===i.OPS.OP_0&&(t?r.slice(1).every(o):r.slice(1).every(n.isCanonicalScriptSignature)))}t.check=a,a.toJSON=()=>"multisig input"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(1),o=r(16),a=i.OPS.OP_RESERVED;function s(e,t){const r=n.decompile(e);if(r.length<4)return!1;if(r[r.length-1]!==i.OPS.OP_CHECKMULTISIG)return!1;if(!o.Number(r[0]))return!1;if(!o.Number(r[r.length-2]))return!1;const s=r[0]-a,u=r[r.length-2]-a;if(s<=0)return!1;if(u>16)return!1;if(s>u)return!1;if(u!==r.length-3)return!1;if(t)return!0;return r.slice(1,-2).every(n.isCanonicalPubKey)}t.check=s,s.toJSON=()=>"multi-sig output"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=n.OPS;function o(e){const t=n.compile(e);return t.length>1&&t[0]===i.OP_RETURN}t.check=o,o.toJSON=()=>"null data output";const a={check:o};t.output=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1);function i(e){const t=n.decompile(e);return 1===t.length&&n.isCanonicalScriptSignature(t[0])}t.check=i,i.toJSON=()=>"pubKey input"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(1);function o(e){const t=n.decompile(e);return 2===t.length&&n.isCanonicalPubKey(t[0])&&t[1]===i.OPS.OP_CHECKSIG}t.check=o,o.toJSON=()=>"pubKey output"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1);function i(e){const t=n.decompile(e);return 2===t.length&&n.isCanonicalScriptSignature(t[0])&&n.isCanonicalPubKey(t[1])}t.check=i,i.toJSON=()=>"pubKeyHash input"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(1);function o(e){const t=n.compile(e);return 25===t.length&&t[0]===i.OPS.OP_DUP&&t[1]===i.OPS.OP_HASH160&&20===t[2]&&t[23]===i.OPS.OP_EQUALVERIFY&&t[24]===i.OPS.OP_CHECKSIG}t.check=o,o.toJSON=()=>"pubKeyHash output"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(296);t.input=n;const i=r(297);t.output=i},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(83),o=r(84),a=r(85),s=r(127),u=r(128);function c(t,r){const c=n.decompile(t);if(c.length<1)return!1;const f=c[c.length-1];if(!e.isBuffer(f))return!1;const l=n.decompile(n.compile(c.slice(0,-1))),d=n.decompile(f);return!!d&&(!!n.isPushOnly(l)&&(1===c.length?u.check(d)||s.check(d):!(!a.input.check(l)||!a.output.check(d))||(!(!i.input.check(l,r)||!i.output.check(d))||!(!o.input.check(l)||!o.output.check(d)))))}t.check=c,c.toJSON=()=>"scriptHash input"}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(1);function o(e){const t=n.compile(e);return 23===t.length&&t[0]===i.OPS.OP_HASH160&&20===t[1]&&t[22]===i.OPS.OP_EQUAL}t.check=o,o.toJSON=()=>"scriptHash output"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(299);t.output=n},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(1),o=r(16),a=r(3),s=e.from("aa21a9ed","hex");function u(e){const t=n.compile(e);return t.length>37&&t[0]===i.OPS.OP_RETURN&&36===t[1]&&t.slice(2,6).equals(s)}t.check=u,u.toJSON=()=>"Witness commitment output",t.encode=function(t){a(o.Hash256bit,t);const r=e.allocUnsafe(36);return s.copy(r,0),t.copy(r,4),n.compile([i.OPS.OP_RETURN,r])},t.decode=function(e){return a(u,e),n.decompile(e)[1].slice(4,36)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(301);t.input=n;const i=r(127);t.output=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1);function i(e){const t=n.decompile(e);return 2===t.length&&n.isCanonicalScriptSignature(t[0])&&(r=t[1],n.isCanonicalPubKey(r)&&33===r.length);var r}t.check=i,i.toJSON=()=>"witnessPubKeyHash input"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(303);t.input=n;const i=r(128);t.output=i},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(3),o=r(83),a=r(84),s=r(85);function u(t,r){if(i(i.Array,t),t.length<1)return!1;const u=t[t.length-1];if(!e.isBuffer(u))return!1;const c=n.decompile(u);if(!c||0===c.length)return!1;const f=n.compile(t.slice(0,-1));return!(!s.input.check(f)||!s.output.check(c))||(!(!o.input.check(f,r)||!o.output.check(c))||!(!a.input.check(f)||!a.output.check(c)))}t.check=u,u.toJSON=()=>"witnessScriptHash input"}).call(this,r(0).Buffer)},function(e,t,r){(function(t){function r(e,r){for(var n=e.length,i=[],o=0;o<n;o+=2){var a=e[o],s=o+1===n?a:e[o+1],u=t.concat([a,s]);i.push(r(u))}return i}e.exports=function(e,t){if(!Array.isArray(e))throw TypeError("Expected values Array");if("function"!=typeof t)throw TypeError("Expected digest Function");if(1===e.length)return e.concat();var n=[e],i=e;do{i=r(i,t),n.push(i)}while(i.length>1);return[].concat.apply([],n)}}).call(this,r(0).Buffer)},function(e,t,r){(function(t){function r(e){for(var t=1,r=e;r>1;r=r+1>>1)t+=r;return t}function n(e,t){return e+(1<<t)-1>>t}e.exports=function(e,t){var i=e.indexOf(t);if(-1===i)return null;for(var o=e.length,a=[],s=n(o,1);s>0&&r(s)!==o;)--s;if(0===s)throw new Error("Unknown solution");for(var u=0,c=0;c<o-1;){var f=n(s,u);++u;var l=i%2;l&&--i;var d=c+i,h=e[d],p=i===f-1?h:e[d+1];c>0?(a.push(l?h:null),a.push(l?null:p)):(a.push(h),a.push(p)),i=i/2|0,c+=f}return a.push(e[o-1]),a},e.exports.verify=function(e,r){for(var n=e[e.length-1],i=n,o=0;o<e.length-1;o+=2){var a=e[o]||i,s=e[o+1]||i;i=r(t.concat([a,s]))}return i.equals(n)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TeleportDaoPayment=void 0;const i=r(129);class o extends i.BitcoinBase{payBurnRequest(e,t="normal"){return n(this,void 0,void 0,(function*(){if(!(this.currentAccount&&this.currentAccountType&&this.publicKey&&this.privateKey))throw new Error("account not initialized");let r=yield this.getExtendedUtxo({address:this.currentAccount,addressType:this.currentAccountType,publicKey:this.publicKey.toString("hex")}),n=yield this.transactionBuilder._getFeeRate(t),i=yield this.transactionBuilder.processUnsignedTransaction({extendedUtxo:r,targets:e,changeAddress:this.currentAccount,feeRate:n,fullAmount:!1}),o=yield this.signer.signPsbt(i,this.privateKey),a=this.signer.finalizePsbts([o]);return yield this.transactionBuilder.sendTx(a)}))}transferBitcoinToEth({lockerAddress:e,amount:t,fullAmount:r=!1,chainId:i,appId:o,recipientAddress:a,percentageFee:s,speed:u=0,isExchange:c=!1,exchangeTokenAddress:f="0x0000000000000000000000000000000000000000",outputAmount:l=0,deadline:d,isFixedToken:h=!1,feeSpeed:p="normal",staticFeeRate:b}){return n(this,void 0,void 0,(function*(){if(!(this.currentAccount&&this.currentAccountType&&this.publicKey&&this.privateKey))throw new Error("account not initialized");let n=yield this.getExtendedUtxo({address:this.currentAccount,addressType:this.currentAccountType,publicKey:this.publicKey.toString("hex")}),m=yield this.getBitcoinToEthUnsignedPsbt({changeAddress:this.currentAccount,extendedUtxo:n,lockerAddress:e,amount:t,fullAmount:r,chainId:i,appId:o,recipientAddress:a,percentageFee:s,speed:u,isExchange:c,exchangeTokenAddress:f,outputAmount:l,deadline:d,isFixedToken:h,feeSpeed:p,staticFeeRate:b}),g=yield this.signer.signPsbt(m,this.privateKey);return yield this.sendSignedPsbt(g)}))}getBitcoinToEthTargetOutputs({lockerAddress:e,amount:t,fullAmount:r=!1,chainId:i,appId:a,recipientAddress:s,percentageFee:u,speed:c=0,isExchange:f=!1,exchangeTokenAddress:l="0x0000000000000000000000000000000000000000",outputAmount:d=0,deadline:h=0,isFixedToken:p=!1}){return n(this,void 0,void 0,(function*(){let n=o.getTransferOpReturnData({chainId:i,appId:a,recipientAddress:s,percentageFee:u,speed:c,isExchange:f,exchangeTokenAddress:l,outputAmount:d,deadline:h,isFixedToken:p}),b=this.transactionBuilder.getOpReturnTarget(n);return r?[b]:[{address:e,value:t},b]}))}getBitcoinToEthUnsignedPsbt({changeAddress:e,extendedUtxo:t,lockerAddress:r,amount:i,fullAmount:o=!1,chainId:a,appId:s,recipientAddress:u,percentageFee:c,speed:f=0,isExchange:l=!1,exchangeTokenAddress:d="0x0000000000000000000000000000000000000000",outputAmount:h=0,deadline:p=0,isFixedToken:b=!1,feeSpeed:m="normal",staticFeeRate:g}){return n(this,void 0,void 0,(function*(){let n=g||(yield this.transactionBuilder._getFeeRate(m)),y=yield this.getBitcoinToEthTargetOutputs({lockerAddress:r,amount:i,fullAmount:o,chainId:a,appId:s,recipientAddress:u,percentageFee:c,speed:f,isExchange:l,exchangeTokenAddress:d,outputAmount:h,deadline:p,isFixedToken:b});return yield this.transactionBuilder.processUnsignedTransaction({extendedUtxo:t,targets:y,changeAddress:o?r:e,feeRate:n,fullAmount:o})}))}bitcoinToEthLend({lockerAddress:e,amount:t,chainId:r,appId:i,recipientAddress:a,percentageFee:s,mode:u=0,isBorrow:c=!1,tokenAddress:f="0x0000000000000000000000000000000000000000",borrowAmount:l=0,staticFeeRate:d}){return n(this,void 0,void 0,(function*(){if(!(this.currentAccount&&this.currentAccountType&&this.publicKey&&this.privateKey))throw new Error("account not initialized");let n=o.getLendingOpReturnData({chainId:r,appId:i,recipientAddress:a,percentageFee:s,mode:u,isBorrow:c,tokenAddress:f,borrowAmount:l}),h=this.transactionBuilder.getOpReturnTarget(n),p=yield this.transactionBuilder.getExtendedUtxo({address:this.currentAccount,addressType:this.currentAccountType,publicKey:this.publicKey.toString("hex")}),b=yield this.transactionBuilder.processUnsignedTransaction({extendedUtxo:p,targets:[{address:e,value:t},h],changeAddress:this.currentAccount,feeRate:d,fullAmount:!1}),m=yield this.signer.signPsbt(b,this.privateKey),g=this.signer.finalizePsbts([m]);return yield this.transactionBuilder.sendTx(g)}))}static getTransferOpReturnData({chainId:e,appId:t,recipientAddress:r,percentageFee:n,speed:i=0,isExchange:o=!1,exchangeTokenAddress:a="0x0000000000000000000000000000000000000000",outputAmount:s=0,deadline:u,isFixedToken:c=!1}){let f=Number(e).toString(16).padStart(2,"0")+Number(t).toString(16).padStart(4,"0")+r.replace("0x","").toLowerCase().padStart(40,"0")+Number((100*n).toFixed(0)).toString(16).padStart(4,"0")+(i?"01":"00");if(!o){if(52!==f.length)throw new Error("invalid data length");return f}if(f=f+a.replace("0x","").toLowerCase().padStart(40,"0")+Number(s).toString(16).padStart(56,"0")+Number(u).toString(16).padStart(8,"0")+(c?"01":"00"),158!==f.length)throw new Error("invalid data length");return f}static getLendingOpReturnData({chainId:e,appId:t,recipientAddress:r,percentageFee:n,mode:i,isBorrow:o=!1,tokenAddress:a="0x0000000000000000000000000000000000000000",borrowAmount:s=0}){let u=Number(e).toString(16).padStart(2,"0")+Number(t).toString(16).padStart(4,"0")+r.replace("0x","").toLowerCase().padStart(40,"0")+Number((100*n).toFixed(0)).toString(16).padStart(4,"0")+Number(i).toString(16).padStart(2,"0");if(!o){if(52!==u.length)throw new Error("invalid data length");return u}if(u=u+a.replace("0x","").toLowerCase().padStart(40,"0")+Number(s).toString(16).padStart(56,"0"),148!==u.length)throw new Error("invalid data length");return u}}t.TeleportDaoPayment=o,t.default=o},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=s(r(308)),c=r(131),f=o(r(35));class l extends u.default{constructor(e,t,r=f.networks.bitcoin){super({network:r,testnet:null==t?void 0:t.includes("_testnet"),dustLimit:1e3}),this.btcInterface=new c.BitcoinInterface(e,t)}_getUtxo(e){return a(this,void 0,void 0,(function*(){return(yield this.btcInterface.getAddressesUtxo([e])).map(e=>({hash:e.txId,value:+e.value,index:+e.index}))}))}_getFeeRate(e="normal"){return a(this,void 0,void 0,(function*(){return this.btcInterface.getFeeRate(e)}))}_getTransactionHex(e){return a(this,void 0,void 0,(function*(){return this.btcInterface.provider.getRawTransaction(e)}))}sendTx(e){return a(this,void 0,void 0,(function*(){return yield this.btcInterface.provider.sendRawTransaction(e)}))}}t.default=l},function(e,t,r){"use strict";(function(e){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const s=o(r(35)),u=r(34),c=r(309),f=r(311),l=r(130),d={bytePerInput:{p2pkh:148,p2wpkh:68,"p2sh-p2wpkh":91,p2tr:58},baseTxBytes:12,bytePerOutput:{p2pkh:34,p2wpkh:31,p2sh:32,p2tr:43,default:35},opReturn:{dataLessThan75:31,dataMoreThan75:91}};class h{constructor({network:e,testnet:t,feeMin:r=0,dustLimit:n,maximumNumberOfOutputsInTransaction:i=50}){this.testnet=t,this.network=e,this.maximumNumberOfOutputsInTransaction=i,this.feeMin=r,this.dustLimit=n||2*d.bytePerInput.p2pkh}_getUtxo(e){return a(this,void 0,void 0,(function*(){throw new Error("Do not call abstract method directly")}))}_getTransactionHex(e){return a(this,void 0,void 0,(function*(){throw new Error("Do not call abstract method directly")}))}createAddressObject(e){return(0,u.createAddressObjectByPublicKey)(e,this.network)}validateAddress(e){try{return(0,u.getAddressType)(e),!0}catch(e){return!1}}getOpReturnTarget(t){if(!(t.length>0))throw new Error("invalid data in hex");return{script:s.payments.embed({data:[e.from(t,"hex")],network:this.network}).output,value:0}}getExtendedUtxo(e){return a(this,void 0,void 0,(function*(){const t=(yield this._getUtxo(e.address)).map(t=>Object.assign(Object.assign({},t),{signerInfo:e}));if(!t||0===t.length)throw new Error("no utxo found");return t}))}static helperHandleInputsAndOutputs({targets:e,extendedUtxo:t,feeRate:r,changeObject:n,selectType:i="normal"}){const o=t.filter(e=>e.value>+r*d.bytePerInput[e.signerInfo.addressType]);let a;switch(i){case"normal":a=c(o,e,Math.round(r));break;case"accumulative":a=l(o,e,Math.round(r));break;case"full":if(!e[0].address)throw new Error;a=f(o,[{address:e[0].address}],Math.round(r))}let{inputs:s,outputs:h,fee:p}=a;s&&h||(s=o,h=e,p=s.reduce((e,t)=>e+t.value,0)-h.reduce((e,t)=>e+t.value,0));const b=s.map(e=>d.bytePerInput[e.signerInfo.addressType]),m=h.map(e=>{if(e.address){let t="default";try{t=(0,u.getAddressType)(e.address)}catch(e){t="default"}return d.bytePerOutput[t]}return e.script?e.script.byteLength<75?d.opReturn.dataLessThan75:d.opReturn.dataMoreThan75:d.bytePerOutput.default}),g=(d.baseTxBytes+b.reduce((e,t)=>e+t,0)+m.reduce((e,t)=>e+t,0)+d.bytePerOutput.default)*Math.round(r);if(s.reduce((e,t)=>e+t.value,0)-h.reduce((e,t)=>e+t.value,0)-g<1e3)throw new Error("not enough balance");let y,v=p-g,w=h.findIndex(e=>!(null==e?void 0:e.address)&&!e.script&&(e.value||0)>0);if(w>=0||v>1e3){if(w>=0&&(v+=d.bytePerOutput.default*Math.round(r)),v<0&&(v=0),"full"===i)h[0].value=h[0].value+v,p-=v;else{if(!n)throw new Error("change not exist");y={address:n.address,value:w>=0?h[w].value+v:v},p-=v}w>=0&&h.splice(w,1)}return{inputs:s,fee:p,outputs:h,change:y}}filterAndConvertTxDataToStandardFormat({extendedUtxo:e,targets:t,changeObject:r,feeRate:n,selectType:i}){return a(this,void 0,void 0,(function*(){let{inputs:o,outputs:a,change:s,fee:u}=h.helperHandleInputsAndOutputs({targets:t,extendedUtxo:e,feeRate:n,changeObject:r,selectType:i});return{inputs:yield this.convertExtendedUtxoToInputs(o),outputs:a,change:s,fee:u,feeRate:n}}))}convertExtendedUtxoToInputs(t=[]){var r;return a(this,void 0,void 0,(function*(){let n=t,i=null,o=null;for(let t in n){let{address:a,publicKey:s,derivationPath:u,masterFingerprint:c,addressType:f}=n[t].signerInfo,l=this.createAddressObject({publicKey:e.from(s,"hex"),addressType:f});if(u&&c&&l.pubkey&&(n[t].bip32Derivation=[{path:u,pubkey:l.pubkey,masterFingerprint:e.from(c,"hex")}]),"p2pkh"===f)o&&i===n[t].hash||(o=yield this._getTransactionHex(n[t].hash),i=n[t].hash),n[t].nonWitnessUtxo=e.from(o,"hex");else if("p2wpkh"===f){if(!l.output)throw new Error("invalid signer info");n[t].witnessUtxo={script:l.output,value:n[t].value},n[t].signerInfo.includeHex&&(o&&i===n[t].hash||(o=yield this._getTransactionHex(n[t].hash),i=n[t].hash),n[t].nonWitnessUtxo=e.from(o,"hex"))}else if("p2sh-p2wpkh"===f){if(!l.output)throw new Error("invalid signer info");if(n[t].witnessUtxo={script:l.output,value:n[t].value},!(null===(r=null==l?void 0:l.redeem)||void 0===r?void 0:r.output))throw new Error("invalid signer info for p2sh address");n[t].redeemScript=l.redeem.output,n[t].signerInfo.includeHex&&(o&&i===n[t].hash||(o=yield this._getTransactionHex(n[t].hash),i=n[t].hash),n[t].nonWitnessUtxo=e.from(o,"hex"))}else if("p2tr"===f){if(!l.output)throw new Error("invalid signer info");if(n[t].witnessUtxo={script:l.output,value:n[t].value},!l.pubkey)throw new Error("invalid signer info for p2tr address (pubkey)");n[t].tapInternalKey=l.internalPubkey,n[t].signerInfo.includeHex&&(o&&i===n[t].hash||(o=yield this._getTransactionHex(n[t].hash),i=n[t].hash),n[t].nonWitnessUtxo=e.from(o,"hex"))}}return n}))}createUnsignedTransaction({inputs:e,outputs:t,change:r,fee:n,feeRate:i}){const{network:o}=this,a=new s.Psbt({network:o});a.setMaximumFeeRate(+(i+i/100).toFixed());for(const t of e){let{addressType:e}=t.signerInfo;switch(e){case"p2pkh":{let e={hash:t.hash,index:Number(t.index),nonWitnessUtxo:t.nonWitnessUtxo,sequence:4294967294,bip32Derivation:t.bip32Derivation};e.bip32Derivation||delete e.bip32Derivation,a.addInput(e);break}case"p2wpkh":{let e={hash:t.hash,index:Number(t.index),witnessUtxo:t.witnessUtxo,nonWitnessUtxo:t.nonWitnessUtxo,sequence:4294967294,bip32Derivation:t.bip32Derivation};e.bip32Derivation||delete e.bip32Derivation,e.nonWitnessUtxo||delete e.nonWitnessUtxo,a.addInput(e);break}case"p2sh-p2wpkh":{let e={hash:t.hash,index:Number(t.index),witnessUtxo:t.witnessUtxo,nonWitnessUtxo:t.nonWitnessUtxo,redeemScript:t.redeemScript,sequence:4294967294,bip32Derivation:t.bip32Derivation};e.bip32Derivation||delete e.bip32Derivation,e.nonWitnessUtxo||delete e.nonWitnessUtxo,a.addInput(e);break}case"p2tr":{let e={hash:t.hash,index:Number(t.index),witnessUtxo:t.witnessUtxo,nonWitnessUtxo:t.nonWitnessUtxo,tapInternalKey:t.tapInternalKey,sequence:4294967294,bip32Derivation:t.bip32Derivation};e.bip32Derivation||delete e.bip32Derivation,e.nonWitnessUtxo||delete e.nonWitnessUtxo,a.addInput(e);break}default:throw new Error("address type is incorrect")}}for(const e of t)a.addOutput(e);if(r&&0!==Object.keys(r).length&&a.addOutput(r),r&&0!==Object.keys(r).length&&a.txOutputs[t.length].address!==r.address)throw new Error("error change address");return{unsignedTransaction:a.toBase64(),outputs:t,inputs:e.map(e=>({hash:e.hash,value:Number(e.value),index:e.index,signerInfo:e.signerInfo})),fee:n,change:r}}processUnsignedTransaction({extendedUtxo:e,targets:t=[],changeAddress:r,fullAmount:n=!1,feeRate:i,selfTransaction:o=!1,selectType:s="normal"}){return a(this,void 0,void 0,(function*(){if(!o&&0===t.length)throw new Error("no target");let a="string"==typeof r?{address:r}:r;const{inputs:u,outputs:c,change:f,fee:l}=yield this.filterAndConvertTxDataToStandardFormat({extendedUtxo:e,targets:t,changeObject:a,feeRate:i,selectType:n?"full":s});return this.createUnsignedTransaction({inputs:u,outputs:c,change:f,fee:l,feeRate:i})}))}}t.default=h}).call(this,r(0).Buffer)},function(e,t,r){var n=r(130),i=r(310),o=r(53);function a(e,t){return e.value-t*o.inputBytes(e)}e.exports=function(e,t,r){e=e.concat().sort((function(e,t){return a(t,r)-a(e,r)}));var o=i(e,t,r);return o.inputs?o:n(e,t,r)}},function(e,t,r){var n=r(53);e.exports=function(e,t,r){if(!isFinite(n.uintOrNaN(r)))return{};for(var i=n.transactionBytes([],t),o=0,a=[],s=n.sumOrNaN(t),u=n.dustThreshold({},r),c=0;c<e.length;++c){var f=e[c],l=n.inputBytes(f),d=r*(i+l),h=n.uintOrNaN(f.value);if(!(o+h>s+d+u)&&(i+=l,o+=h,a.push(f),!(o<s+d)))return n.finalize(a,t,r)}return{fee:r*i}}},function(e,t,r){var n=r(53);e.exports=function(e,t,r){if(!isFinite(n.uintOrNaN(r)))return{};var i=n.transactionBytes(e,t),o=r*i;if(0===t.length)return{fee:o};var a=n.sumOrNaN(e)-n.sumForgiving(t)-o;if(!isFinite(a)||a<0)return{fee:o};var s=t.reduce((function(e,t){return e+!isFinite(t.value)}),0);if(0===a&&0===s)return n.finalize(e,t,r);var u=t.reduce((function(e,t){return void 0!==t.value?e:e+1}),0),c=Math.floor(a/u);return t.every((function(e){return void 0!==e.value||c>n.dustThreshold(e,r)}))?(t=t.map((function(e){if(void 0!==e.value)return e;var t={};for(var r in e)t[r]=e[r];return t.value=c,t})),n.finalize(e,t,r)):{fee:o}}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.bitcoin=void 0,t.bitcoin=o(r(313)),a(r(338),t)},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getApiProvider=t.getRpcProvider=t.ApiProviders=t.RPC=void 0;const s=a(r(314));t.RPC=s.default;const u=o(r(334));t.ApiProviders=u,t.getRpcProvider=function(e){const{url:t,headers:r,auth:n}=e;return new s.default({url:t,headers:r,auth:n})},t.getApiProvider=function(e,t){if(!u[e.provider])throw new Error("provider not supported");let r=!!(null==t?void 0:t.includes("_testnet"));return"NowNodes"===e.provider?new u.NowNodes({token:e.token,timeout:3e4},r):"BlockStream"===e.provider?new u.BlockStream(r,{token:e.token,timeout:3e4}):"MempoolSpace"===e.provider?new u.MempoolSpace(r,{token:e.token,timeout:3e4}):void 0}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const{getAxiosInstance:i}=r(54);class o{constructor({headers:e,url:t,auth:r}){this.axios=o.getAxiosInstance({baseUrl:t,headers:e,auth:r,timeout:18e4})}static getAxiosInstance(e){return i(e)}static getRpcBody(e,t=[]){return{jsonrpc:"2.0",id:"teleport-dao",method:e,params:t}}getChainInfo(){return n(this,void 0,void 0,(function*(){return(yield this.axios.post("/",o.getRpcBody("getblockchaininfo"))).data.result}))}getLatestBlockNumber(){return n(this,void 0,void 0,(function*(){return(yield this.axios.post("/",o.getRpcBody("getblockcount"))).data.result}))}getBlockHash(e){return n(this,void 0,void 0,(function*(){return(yield this.axios.post("/",o.getRpcBody("getblockhash",[Number(e)]))).data.result}))}getBlockByBlockHash(e,t=1){return n(this,void 0,void 0,(function*(){return(yield this.axios.post("/",o.getRpcBody("getblock",[e,Number(t)]))).data.result}))}getBlockHeaderByBlockHash(e){return n(this,void 0,void 0,(function*(){return(yield this.axios.post("/",o.getRpcBody("getblockheader",[e,!1]))).data.result}))}getBlockByBlockNumber(e,t){return n(this,void 0,void 0,(function*(){return this.getBlockByBlockHash(yield this.getBlockHash(e),t)}))}getTransaction(e){return n(this,void 0,void 0,(function*(){let t=(yield this.axios.post("/",o.getRpcBody("getrawtransaction",[e,!0]))).data.result,r=t.blockhash?yield this.getBlockByBlockHash(t.blockhash):{};return{txId:t.txid,version:t.version,locktime:t.locktime,blockNumber:r.height||null,blockHash:t.blockhash||null,vout:t.vout.map(e=>({address:e.scriptPubKey.address||null,script:e.scriptPubKey.hex,value:Number((1e8*Number(e.value)).toFixed())})),vin:t.vin.map(e=>({txId:e.txid,index:e.vout}))}}))}getRawTransaction(e){return n(this,void 0,void 0,(function*(){return(yield this.axios.post("/",o.getRpcBody("getrawtransaction",[e,!0]))).data.result.hex}))}getTxOutProof(e){return n(this,void 0,void 0,(function*(){return(yield this.axios.post("/",o.getRpcBody("gettxoutproof",[e,!0]))).data.result.hex}))}getBlockTransactionIds(e){return n(this,void 0,void 0,(function*(){return(yield this.getBlockByBlockHash(e)).tx}))}sendRawTransaction(e,t=.1){return n(this,void 0,void 0,(function*(){return(yield this.axios.post("/",o.getRpcBody("sendrawtransaction",[e,t]))).data.result}))}getBlockHeaderHex(e){return n(this,void 0,void 0,(function*(){const t=yield this.getBlockHash(e);return yield this.getBlockHeaderByBlockHash(t)}))}getEstimateFeeByNumberOfBlock(e){return n(this,void 0,void 0,(function*(){return(yield this.axios.post("/",o.getRpcBody("estimatesmartfee",[e,"ECONOMICAL"]))).data.result.feerate*Math.pow(10,5)}))}getFeeRate(e="normal"){return n(this,void 0,void 0,(function*(){let t;switch(e){case"slow":t=yield this.getEstimateFeeByNumberOfBlock(10);break;case"normal":t=yield this.getEstimateFeeByNumberOfBlock(6);break;case"fast":t=yield this.getEstimateFeeByNumberOfBlock(3);break;default:t=yield this.getEstimateFeeByNumberOfBlock(6)}return+t.toFixed()}))}}e.exports=o},function(e,t,r){e.exports=r(316)},function(e,t,r){"use strict";var n=r(6),i=r(132),o=r(317),a=r(139);var s=function e(t){var r=new o(t),s=i(o.prototype.request,r);return n.extend(s,o.prototype,r),n.extend(s,r),s.create=function(r){return e(a(t,r))},s}(r(86));s.Axios=o,s.CanceledError=r(55),s.CancelToken=r(331),s.isCancel=r(138),s.VERSION=r(140).version,s.toFormData=r(135),s.AxiosError=r(32),s.Cancel=s.CanceledError,s.all=function(e){return Promise.all(e)},s.spread=r(332),s.isAxiosError=r(333),e.exports=s,e.exports.default=s},function(e,t,r){"use strict";var n=r(6),i=r(133),o=r(318),a=r(319),s=r(139),u=r(137),c=r(330),f=c.validators;function l(e){this.defaults=e,this.interceptors={request:new o,response:new o}}l.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=s(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&c.assertOptions(r,{silentJSONParsing:f.transitional(f.boolean),forcedJSONParsing:f.transitional(f.boolean),clarifyTimeoutError:f.transitional(f.boolean)},!1);var n=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var o,u=[];if(this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)})),!i){var l=[a,void 0];for(Array.prototype.unshift.apply(l,n),l=l.concat(u),o=Promise.resolve(t);l.length;)o=o.then(l.shift(),l.shift());return o}for(var d=t;n.length;){var h=n.shift(),p=n.shift();try{d=h(d)}catch(e){p(e);break}}try{o=a(d)}catch(e){return Promise.reject(e)}for(;u.length;)o=o.then(u.shift(),u.shift());return o},l.prototype.getUri=function(e){e=s(this.defaults,e);var t=u(e.baseURL,e.url);return i(t,e.params,e.paramsSerializer)},n.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,r){return this.request(s(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,i){return this.request(s(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}l.prototype[e]=t(),l.prototype[e+"Form"]=t(!0)})),e.exports=l},function(e,t,r){"use strict";var n=r(6);function i(){this.handlers=[]}i.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},function(e,t,r){"use strict";var n=r(6),i=r(320),o=r(138),a=r(86),s=r(55);function u(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new s}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return u(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(u(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,r){"use strict";var n=r(6),i=r(86);e.exports=function(e,t,r){var o=this||i;return n.forEach(r,(function(r){e=r.call(o,e,t)})),e}},function(e,t,r){"use strict";var n=r(6);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},function(e,t,r){"use strict";var n=r(32);e.exports=function(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(new n("Request failed with status code "+r.status,[n.ERR_BAD_REQUEST,n.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}},function(e,t,r){"use strict";var n=r(6);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,i,o,a){var s=[];s.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),n.isString(i)&&s.push("path="+i),n.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";var n=r(6),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,o,a={};return e?(n.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t){if(a[t]&&i.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([r]):a[t]?a[t]+", "+r:r}})),a):a}},function(e,t,r){"use strict";var n=r(6);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";e.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}},function(e,t){e.exports=null},function(e,t,r){"use strict";var n=r(140).version,i=r(32),o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var a={};o.transitional=function(e,t,r){function o(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,s){if(!1===e)throw new i(o(n," has been removed"+(t?" in "+t:"")),i.ERR_DEPRECATED);return t&&!a[n]&&(a[n]=!0,console.warn(o(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,s)}},e.exports={assertOptions:function(e,t,r){if("object"!=typeof e)throw new i("options must be an object",i.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),o=n.length;o-- >0;){var a=n[o],s=t[a];if(s){var u=e[a],c=void 0===u||s(u,a,e);if(!0!==c)throw new i("option "+a+" must be "+c,i.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new i("Unknown option "+a,i.ERR_BAD_OPTION)}},validators:o}},function(e,t,r){"use strict";var n=r(55);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},i.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";var n=r(6);e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MempoolSpace=t.NowNodes=t.BlockStream=void 0;const i=n(r(335));t.BlockStream=i.default;const o=n(r(336));t.MempoolSpace=o.default;const a=n(r(337));t.NowNodes=a.default},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(r(141));class a extends o.default{constructor(e=!1,t){super(e?"https://blockstream.info/testnet/api":"https://blockstream.info/api")}getRecommendedFeeRate(e="normal"){return n(this,void 0,void 0,(function*(){throw new Error("not supported")}))}}t.default=a},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(141));class o extends i.default{constructor(e=!1,t){super(e?"https://mempool.space/testnet/api":"https://mempool.space/api")}}t.default=o},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};const{getAxiosInstance:i}=r(54);e.exports=class{constructor({token:e,timeout:t=3e4},r=!1){this.baseURL=r?"https://btcbook-testnet.nownodes.io/":"https://btcbook.nownodes.io/",this.axios=i({baseUrl:this.baseURL,timeout:t,headers:{"api-key":e}})}getUtxos(e){return n(this,void 0,void 0,(function*(){return(yield this.axios.get("/api/v2/utxo/"+e)).data.map(t=>({address:e,txId:t.txid,index:t.vout,value:Number(t.value),blockNumber:+t.height}))}))}}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TeleportDao=void 0;const i=r(54);class o{constructor(e){const t=e.includes("testnet")?"https://testnet.api.teleportdao.xyz/api/v1":"https://api.teleportdao.xyz/api/v1";this.api=(0,i.getAxiosInstance)({baseUrl:t,headers:{},timeout:18e4})}getLockers(e){return n(this,void 0,void 0,(function*(){return(yield this.api.get("/teleswap/lockers",{params:{network:e}})).data.data.lockers}))}}t.TeleportDao=o,t.default=o},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getAxiosInstance=t.getRandomInteger=t.runWithRetries=t.sleep=void 0;const o=i(r(340));function a(e){return new Promise(t=>setTimeout(t,e))}t.sleep=a,t.runWithRetries=function(e,t={maxTries:2,retrySleep:1e3}){return n(this,void 0,void 0,(function*(){const r=t.maxTries||2,n=t.retrySleep||1e3;let i;for(let t=0;t<r;t+=1){try{return yield e()}catch(e){i=e}yield a(n)}throw i||new Error("function failed after retries")}))},t.getRandomInteger=function(e,t){return Math.floor(Math.random()*(t-e))+e},t.getAxiosInstance=function({baseUrl:e,timeout:t=1e4,headers:r={},auth:n}){let i,a=e;return i=o.default.create({baseURL:a,timeout:t,auth:n,headers:Object.assign({},r)}),i.interceptors.response.use(e=>e,e=>{if(e.response){const t=new Error(JSON.stringify({data:e.response.data,message:e.message}));return Promise.reject(t)}if(e.request){const t=new Error(e.message);return Promise.reject(t)}return Promise.reject(e)}),i}},function(e,t,r){e.exports=r(341)},function(e,t,r){"use strict";var n=r(7),i=r(142),o=r(342),a=r(149);var s=function e(t){var r=new o(t),s=i(o.prototype.request,r);return n.extend(s,o.prototype,r),n.extend(s,r),s.create=function(r){return e(a(t,r))},s}(r(87));s.Axios=o,s.CanceledError=r(56),s.CancelToken=r(356),s.isCancel=r(148),s.VERSION=r(150).version,s.toFormData=r(145),s.AxiosError=r(33),s.Cancel=s.CanceledError,s.all=function(e){return Promise.all(e)},s.spread=r(357),s.isAxiosError=r(358),e.exports=s,e.exports.default=s},function(e,t,r){"use strict";var n=r(7),i=r(143),o=r(343),a=r(344),s=r(149),u=r(147),c=r(355),f=c.validators;function l(e){this.defaults=e,this.interceptors={request:new o,response:new o}}l.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=s(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&c.assertOptions(r,{silentJSONParsing:f.transitional(f.boolean),forcedJSONParsing:f.transitional(f.boolean),clarifyTimeoutError:f.transitional(f.boolean)},!1);var n=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var o,u=[];if(this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)})),!i){var l=[a,void 0];for(Array.prototype.unshift.apply(l,n),l=l.concat(u),o=Promise.resolve(t);l.length;)o=o.then(l.shift(),l.shift());return o}for(var d=t;n.length;){var h=n.shift(),p=n.shift();try{d=h(d)}catch(e){p(e);break}}try{o=a(d)}catch(e){return Promise.reject(e)}for(;u.length;)o=o.then(u.shift(),u.shift());return o},l.prototype.getUri=function(e){e=s(this.defaults,e);var t=u(e.baseURL,e.url);return i(t,e.params,e.paramsSerializer)},n.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,r){return this.request(s(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,i){return this.request(s(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}l.prototype[e]=t(),l.prototype[e+"Form"]=t(!0)})),e.exports=l},function(e,t,r){"use strict";var n=r(7);function i(){this.handlers=[]}i.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},function(e,t,r){"use strict";var n=r(7),i=r(345),o=r(148),a=r(87),s=r(56);function u(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new s}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return u(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(u(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,r){"use strict";var n=r(7),i=r(87);e.exports=function(e,t,r){var o=this||i;return n.forEach(r,(function(r){e=r.call(o,e,t)})),e}},function(e,t,r){"use strict";var n=r(7);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},function(e,t,r){"use strict";var n=r(33);e.exports=function(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(new n("Request failed with status code "+r.status,[n.ERR_BAD_REQUEST,n.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}},function(e,t,r){"use strict";var n=r(7);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,i,o,a){var s=[];s.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),n.isString(i)&&s.push("path="+i),n.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,r){"use strict";var n=r(7),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,o,a={};return e?(n.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t){if(a[t]&&i.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([r]):a[t]?a[t]+", "+r:r}})),a):a}},function(e,t,r){"use strict";var n=r(7);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";e.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}},function(e,t){e.exports=null},function(e,t,r){"use strict";var n=r(150).version,i=r(33),o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var a={};o.transitional=function(e,t,r){function o(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,s){if(!1===e)throw new i(o(n," has been removed"+(t?" in "+t:"")),i.ERR_DEPRECATED);return t&&!a[n]&&(a[n]=!0,console.warn(o(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,s)}},e.exports={assertOptions:function(e,t,r){if("object"!=typeof e)throw new i("options must be an object",i.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),o=n.length;o-- >0;){var a=n[o],s=t[a];if(s){var u=e[a],c=void 0===u||s(u,a,e);if(!0!==c)throw new i("option "+a+" must be "+c,i.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new i("Unknown option "+a,i.ERR_BAD_OPTION)}},validators:o}},function(e,t,r){"use strict";var n=r(56);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},i.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";var n=r(7);e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},function(e,t,r){"use strict";const{requestTypes:n}=r(151).teleswap,{BigNumber:i}=r(369);function o(e){let t="4c"===e.slice(2,4)?e.slice(6):e.slice(4),r=(Number("0x"+t.slice(0,2)),t.slice(2,6));if(!r)return{status:!1,message:"invalid OP_RETURN data : "+t,code:"INVALID_APP_ID"};let o=Number("0x"+r);switch(Object.keys(n).find(e=>o>=n[e].appIdRange[0]&&o<=n[e].appIdRange[1])){case"transfer":case"exchange":return function(e){let t={requestType:"transfer"},r=0;return t.chainId=Number("0x"+e.slice(r,r+=2)),t.appId=Number("0x"+e.slice(r,r+=4)),t.recipientAddress="0x"+e.slice(r,r+=40),t.percentageFee=Number("0x"+e.slice(r,r+=4))/100,t.speed="01"===e.slice(r,r+=2),e.length===r?{status:!0,data:t}:(t.requestType="exchange",t.exchangeTokenAddress="0x"+e.slice(r,r+=40),t.outputAmount=new i("0x"+e.slice(r,r+=56)).toFixed(),t.deadline=new i("0x"+e.slice(r,r+=8)).toFixed(),t.isFixedToken="01"===e.slice(r,r+=2),e.length===r?{status:!0,data:t}:{status:!1,message:`invalid OP_RETURN data for requestType: 'transfer or exchange'. invalid data length : ${e.length} - valid length : ${r}`,code:"INVALID_OP_RETURN"})}(t);case"lend":return function(e){let t={requestType:"lend"},r=0;return t.chainId=Number("0x"+e.slice(r,r+=2)),t.appId=Number("0x"+e.slice(r,r+=4)),t.recipientAddress="0x"+e.slice(r,r+=40),t.percentageFee=Number("0x"+e.slice(r,r+=4))/100,t.mode=Number("0x"+e.slice(r,r+=2)),e.length===r?{status:!0,data:t}:(t.requestType="borrow",t.tokenAddress="0x"+e.slice(r,r+=40),t.borrowAmount=Number("0x"+e.slice(r,r+=56)),e.length===r?{status:!0,data:t}:{status:!1,message:`invalid OP_RETURN data for requestType: 'lend or borrow'. invalid data length : ${e.length} - valid length : ${r}`,code:"INVALID_OP_RETURN"})}(t);default:return{status:!1,message:"invalid appId : "+o,code:"INVALID_OP_RETURN"}}}e.exports={checkAndParseProtocolRequest:function(e,t,r={minTeleporterFeeAmount:0}){var n,i;let a=e.findIndex(e=>e.script.startsWith("6a"));if(a>=0){let s=(null===(n=e[a])||void 0===n?void 0:n.script)||null,u=(null===(i=e.findIndex(e=>e.address===t))||void 0===i?void 0:i.value)||0,c=u>=0&&e[u].value||0,f=o(s);return f.status?function(e,t,r,n,{minTeleporterFeeAmount:i=0}){return e?+e.percentageFee>100?{status:!1,message:"percentageFee greater than 100 is invalid. percentageFee: "+e.percentageFee,code:"INVALID_FEE"}:e.percentageFee/100*+r<=i?{status:!1,message:`fee amount is less than or equal minimum teleporter fee amount.percentageFee: ${e.percentageFee} - value: ${r} - feeAmount ${(e.percentageFee/100*+r).toFixed(8)} - minimumFee: ${i}`,code:"NOT_ACCEPTED_BY_TELEPORTER"}:{status:!0,data:e,requestOutputIndex:t,value:r,valueOutputIndex:n}:{status:!1,message:"no data to validate. it should not happen",code:"NOT_ACCEPTED_BY_TELEPORTER"}}(f.data,a,c,u,r):f}return{status:!1,message:"transaction outputs should contain OP_RETURN",code:"NO_OP_RETURN"}}}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)},a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.otherTokens=void 0,o(r(361),t),o(r(362),t),t.otherTokens=a(r(363))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.chainInfo=void 0,t.chainInfo={ethereum:{name:"ethereum",chainId:1},ethereum_testnet:{name:"goerli",chainId:3},bsc:{name:"binance_smart_chain",chainId:56},bsc_testnet:{name:"binance_smart_chain_testnet",chainId:97},polygon:{name:"polygon",chainId:137},polygon_testnet:{name:"mumbai",chainId:137}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hdWalletPath=void 0,t.hdWalletPath={bitcoin:{p2pkh:"m/44'/0'/0'",p2wpkh:"m/84'/0'/0'","p2sh-p2wpkh":"m/49'/0'/0'",p2sh:"m/80'/0'/0'",p2wsh:"m/85'/0'/0'","p2sh-p2wsh":"m/90'/0'/0'",p2tr:"m/84'/0'/0'"},ethereum:"m/44'/60'/0'"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bsc=t.polygon=void 0,t.polygon={mainnet:{DAIAddress:"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",USDTAddress:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",USDCAddress:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",WBTCAddress:"0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",SANDAddress:"0xBbba073C31bF03b8ACf7c28EF0738DeCF3695683",WBNBAddress:"",WETHAddress:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",WMATICAddress:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"},testnet:{WMATICAddress:"0x9c3c9283d3e44854697cd22d3faa240cfb032889"}},t.bsc={mainnet:{USDTAddress:"0x55d398326f99059fF775485246999027B3197955",USDCAddress:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",WBNBAddress:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",WETHAddress:"0x5DA5DA6933637c1cAfa5de9FdF2aCb1B3758C9e3"},testnet:{USDTAddress:"",USDCAddress:"",WBNBAddress:"0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd",WETHAddress:"0xd66c6B4F0be8CE5b39D52E0Fd1344c389929B378"}}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.tokensInfo=t.contractsInfo=t.requestTypes=t.bitcoinAddressTypes=void 0;var s=r(365);Object.defineProperty(t,"bitcoinAddressTypes",{enumerable:!0,get:function(){return s.addressTypeHelper}});var u=r(366);Object.defineProperty(t,"requestTypes",{enumerable:!0,get:function(){return a(u).default}}),t.contractsInfo=o(r(367)),t.tokensInfo=o(r(368))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addressTypeHelper=void 0,t.addressTypeHelper={addressTypesNumber:{p2pk:0,p2pkh:1,p2sh:2,p2wpkh:3,p2wsh:4,p2tr:5},addressTypes:["p2pk","p2pkh","p2sh","p2wpkh","p2wsh","p2tr"]},t.default=t.addressTypeHelper},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={transfer:{appIdRange:[1,1],default:1},exchange:{appIdRange:[10,30],default:20},lend:{appIdRange:[100,200],default:100}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bsc=t.polygon=void 0,t.polygon={mainnet:{exchangeConnectorAddress:"0x0C28968d8A3Af022F47D493402D35Cb42EFF0597",exchangeFactoryAddress:"0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32",exchangeRouterAddress:"0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff",priceOracleAddress:"0x96b76ab42289688b68882cdccd071b2c39b0165e",relayAddress:"0x7DeB66341b1d499D7e699589d0cf665De4132EA3",lendingAddress:"",ccTransferAddress:"0x04367D74332137908BEF9acc0Ab00a299A823707",ccExchangeAddress:"0xD1E9Ff33EC28f9Dd8D99E685a2B0F29dCaa095a3",ccBurnAddress:"0x0009876C47F6b2f0BCB41eb9729736757486c75f",lockerAddress:"0xf5D6D369A7F4147F720AEAdd4C4f903aE8046166"},testnet:{exchangeConnectorAddress:"0x0C28968d8A3Af022F47D493402D35Cb42EFF0597",exchangeFactoryAddress:"0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32",exchangeRouterAddress:"0x8954AfA98594b838bda56FE4C12a09D7739D179b",priceOracleAddress:"0x96B76aB42289688b68882CDcCd071B2C39b0165E",relayAddress:"0x5b845e3EB38d78cD5006C04b0Bc78692b5535F56",lendingAddress:"",ccTransferAddress:"0xbD97529bB755ac4f17e3Ef648b6230d3e93F84F0",ccExchangeAddress:"0x9D35634aBF331204CAd28BF9c37B49792A1E69e3",ccBurnAddress:"0x4779BB3c43C86baf60f7b30e0e19872B7d90ae7f",lockerAddress:"0xf5D6D369A7F4147F720AEAdd4C4f903aE8046166"}},t.bsc={mainnet:{exchangeConnectorAddress:"0x856D80F77349F675Ea7E3477aD75Ef57349e777b",exchangeFactoryAddress:"0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73",exchangeRouterAddress:"0x10ED43C718714eb63d5aA57B78B54704E256024E",priceOracleAddress:"0x7Aabb0779782247384A1C91844211516E93b1D63",relayAddress:"0xFcd688999c25D5493571543137cEeb4fbDb44D02",lendingAddress:"",ccTransferAddress:"0xA38aD0d52B89C20c2229E916358D2CeB45BeC5FF",ccExchangeAddress:"0xcA5416364720c7324A547d39b1db496A2DCd4F0D",ccBurnAddress:"0x2787D48e0B74125597DD479978a5DE09Bb9a3C15",lockerAddress:"0x84F74e97ebab432CeE185d601290cE0A483987A5"},testnet:{exchangeConnectorAddress:"0xF789b50D17CF214d5774ce1a52Fb6581d72118fE",exchangeFactoryAddress:"0xB7926C0430Afb07AA7DEfDE6DA862aE0Bde767bc",exchangeRouterAddress:"0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3",priceOracleAddress:"0xF364F92D5d0D4Ee173983da8b74e2eB1D7A319D2",relayAddress:"0x66840C47684338216fE0498CFd649186D662d8a0",lendingAddress:"",ccTransferAddress:"0x699Ab6dE8791B9E895Afa5B1e36a6F8F64294D0a",ccExchangeAddress:"0xA029A35027233C4640A815D3574f36f652A47C41",ccBurnAddress:"0x090aB5B43F440700F8E73fB822f81cAbE82fd05B",lockerAddress:"0xba44564920f2c5b69C7729FFd465b3095e08Ea35"}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bsc=t.polygon=void 0,t.polygon={mainnet:{teleBTCAddress:"0x3BF668Fe1ec79a84cA8481CEAD5dbb30d61cC685"},testnet:{teleBTCAddress:"0x515D720B9D219f1931205D5B8D842bE1Fe2FeBDE"}},t.bsc={mainnet:{teleBTCAddress:"0xC58C1117DA964aEbe91fEF88f6f5703e79bdA574"},testnet:{teleBTCAddress:"0x2dC0a21691a3A0B8ED353Bf43f964966e2a65Cfd"}}},function(e,t,r){var n;!function(i){"use strict";var o,a=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s=Math.ceil,u=Math.floor,c="[BigNumber Error] ",f=c+"Number primitive has more than 15 significant digits: ",l=1e14,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],h=1e9;function p(e){var t=0|e;return e>0||e===t?t:t-1}function b(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(r=14-(t=e[n++]+"").length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function m(e,t){var r,n,i=e.c,o=t.c,a=e.s,s=t.s,u=e.e,c=t.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==c,!i||!o)return n?0:!i^r?1:-1;if(!n)return u>c^r?1:-1;for(s=(u=i.length)<(c=o.length)?u:c,a=0;a<s;a++)if(i[a]!=o[a])return i[a]>o[a]^r?1:-1;return u==c?0:u>c^r?1:-1}function g(e,t,r,n){if(e<t||e>r||e!==u(e))throw Error(c+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function y(e){var t=e.c.length-1;return p(e.e/14)==t&&e.c[t]%2!=0}function v(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function w(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}(o=function e(t){var r,n,i,o,_,E,k,S,x,T=L.prototype={constructor:L,toString:null,valueOf:null},A=new L(1),P=20,O=4,I=-7,B=21,M=-1e7,R=1e7,N=!1,j=1,U=0,C={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},H="0123456789abcdefghijklmnopqrstuvwxyz",z=!0;function L(e,t){var r,o,s,c,l,d,h,p,b=this;if(!(b instanceof L))return new L(e,t);if(null==t){if(e&&!0===e._isBigNumber)return b.s=e.s,void(!e.c||e.e>R?b.c=b.e=null:e.e<M?b.c=[b.e=0]:(b.e=e.e,b.c=e.c.slice()));if((d="number"==typeof e)&&0*e==0){if(b.s=1/e<0?(e=-e,-1):1,e===~~e){for(c=0,l=e;l>=10;l/=10,c++);return void(c>R?b.c=b.e=null:(b.e=c,b.c=[e]))}p=String(e)}else{if(!a.test(p=String(e)))return i(b,p,d);b.s=45==p.charCodeAt(0)?(p=p.slice(1),-1):1}(c=p.indexOf("."))>-1&&(p=p.replace(".","")),(l=p.search(/e/i))>0?(c<0&&(c=l),c+=+p.slice(l+1),p=p.substring(0,l)):c<0&&(c=p.length)}else{if(g(t,2,H.length,"Base"),10==t&&z)return K(b=new L(e),P+b.e+1,O);if(p=String(e),d="number"==typeof e){if(0*e!=0)return i(b,p,d,t);if(b.s=1/e<0?(p=p.slice(1),-1):1,L.DEBUG&&p.replace(/^0\.0*|\./,"").length>15)throw Error(f+e)}else b.s=45===p.charCodeAt(0)?(p=p.slice(1),-1):1;for(r=H.slice(0,t),c=l=0,h=p.length;l<h;l++)if(r.indexOf(o=p.charAt(l))<0){if("."==o){if(l>c){c=h;continue}}else if(!s&&(p==p.toUpperCase()&&(p=p.toLowerCase())||p==p.toLowerCase()&&(p=p.toUpperCase()))){s=!0,l=-1,c=0;continue}return i(b,String(e),d,t)}d=!1,(c=(p=n(p,t,10,b.s)).indexOf("."))>-1?p=p.replace(".",""):c=p.length}for(l=0;48===p.charCodeAt(l);l++);for(h=p.length;48===p.charCodeAt(--h););if(p=p.slice(l,++h)){if(h-=l,d&&L.DEBUG&&h>15&&(e>9007199254740991||e!==u(e)))throw Error(f+b.s*e);if((c=c-l-1)>R)b.c=b.e=null;else if(c<M)b.c=[b.e=0];else{if(b.e=c,b.c=[],l=(c+1)%14,c<0&&(l+=14),l<h){for(l&&b.c.push(+p.slice(0,l)),h-=14;l<h;)b.c.push(+p.slice(l,l+=14));l=14-(p=p.slice(l)).length}else l-=h;for(;l--;p+="0");b.c.push(+p)}}else b.c=[b.e=0]}function D(e,t,r,n){var i,o,a,s,u;if(null==r?r=O:g(r,0,8),!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)u=b(e.c),u=1==n||2==n&&(a<=I||a>=B)?v(u,a):w(u,a,"0");else if(o=(e=K(new L(e),t,r)).e,s=(u=b(e.c)).length,1==n||2==n&&(t<=o||o<=I)){for(;s<t;u+="0",s++);u=v(u,o)}else if(t-=a,u=w(u,o,"0"),o+1>s){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=o-s)>0)for(o+1==s&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function F(e,t){for(var r,n=1,i=new L(e[0]);n<e.length;n++){if(!(r=new L(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function q(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+14*r-1)>R?e.c=e.e=null:r<M?e.c=[e.e=0]:(e.e=r,e.c=t),e}function K(e,t,r,n){var i,o,a,c,f,h,p,b=e.c,m=d;if(b){e:{for(i=1,c=b[0];c>=10;c/=10,i++);if((o=t-i)<0)o+=14,a=t,p=(f=b[h=0])/m[i-a-1]%10|0;else if((h=s((o+1)/14))>=b.length){if(!n)break e;for(;b.length<=h;b.push(0));f=p=0,i=1,a=(o%=14)-14+1}else{for(f=c=b[h],i=1;c>=10;c/=10,i++);p=(a=(o%=14)-14+i)<0?0:f/m[i-a-1]%10|0}if(n=n||t<0||null!=b[h+1]||(a<0?f:f%m[i-a-1]),n=r<4?(p||n)&&(0==r||r==(e.s<0?3:2)):p>5||5==p&&(4==r||n||6==r&&(o>0?a>0?f/m[i-a]:0:b[h-1])%10&1||r==(e.s<0?8:7)),t<1||!b[0])return b.length=0,n?(t-=e.e+1,b[0]=m[(14-t%14)%14],e.e=-t||0):b[0]=e.e=0,e;if(0==o?(b.length=h,c=1,h--):(b.length=h+1,c=m[14-o],b[h]=a>0?u(f/m[i-a]%m[a])*c:0),n)for(;;){if(0==h){for(o=1,a=b[0];a>=10;a/=10,o++);for(a=b[0]+=c,c=1;a>=10;a/=10,c++);o!=c&&(e.e++,b[0]==l&&(b[0]=1));break}if(b[h]+=c,b[h]!=l)break;b[h--]=0,c=1}for(o=b.length;0===b[--o];b.pop());}e.e>R?e.c=e.e=null:e.e<M&&(e.c=[e.e=0])}return e}function W(e){var t,r=e.e;return null===r?e.toString():(t=b(e.c),t=r<=I||r>=B?v(t,r):w(t,r,"0"),e.s<0?"-"+t:t)}return L.clone=e,L.ROUND_UP=0,L.ROUND_DOWN=1,L.ROUND_CEIL=2,L.ROUND_FLOOR=3,L.ROUND_HALF_UP=4,L.ROUND_HALF_DOWN=5,L.ROUND_HALF_EVEN=6,L.ROUND_HALF_CEIL=7,L.ROUND_HALF_FLOOR=8,L.EUCLID=9,L.config=L.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(c+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(g(r=e[t],0,h,t),P=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(g(r=e[t],0,8,t),O=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(g(r[0],-h,0,t),g(r[1],0,h,t),I=r[0],B=r[1]):(g(r,-h,h,t),I=-(B=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)g(r[0],-h,-1,t),g(r[1],1,h,t),M=r[0],R=r[1];else{if(g(r,-h,h,t),!r)throw Error(c+t+" cannot be zero: "+r);M=-(R=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(c+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw N=!r,Error(c+"crypto unavailable");N=r}else N=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(g(r=e[t],0,9,t),j=r),e.hasOwnProperty(t="POW_PRECISION")&&(g(r=e[t],0,h,t),U=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(c+t+" not an object: "+r);C=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(c+t+" invalid: "+r);z="0123456789"==r.slice(0,10),H=r}}return{DECIMAL_PLACES:P,ROUNDING_MODE:O,EXPONENTIAL_AT:[I,B],RANGE:[M,R],CRYPTO:N,MODULO_MODE:j,POW_PRECISION:U,FORMAT:C,ALPHABET:H}},L.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!L.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-h&&i<=h&&i===u(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%14)<1&&(t+=14),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=l||r!==u(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(c+"Invalid BigNumber: "+e)},L.maximum=L.max=function(){return F(arguments,T.lt)},L.minimum=L.min=function(){return F(arguments,T.gt)},L.random=(o=9007199254740992*Math.random()&2097151?function(){return u(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,a,f=0,l=[],p=new L(A);if(null==e?e=P:g(e,0,h),i=s(e/14),N)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));f<i;)(a=131072*t[f]+(t[f+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[f]=r[0],t[f+1]=r[1]):(l.push(a%1e14),f+=2);f=i/2}else{if(!crypto.randomBytes)throw N=!1,Error(c+"crypto unavailable");for(t=crypto.randomBytes(i*=7);f<i;)(a=281474976710656*(31&t[f])+1099511627776*t[f+1]+4294967296*t[f+2]+16777216*t[f+3]+(t[f+4]<<16)+(t[f+5]<<8)+t[f+6])>=9e15?crypto.randomBytes(7).copy(t,f):(l.push(a%1e14),f+=7);f=i/7}if(!N)for(;f<i;)(a=o())<9e15&&(l[f++]=a%1e14);for(e%=14,(i=l[--f])&&e&&(a=d[14-e],l[f]=u(i/a)*a);0===l[f];l.pop(),f--);if(f<0)l=[n=0];else{for(n=-1;0===l[0];l.splice(0,1),n-=14);for(f=1,a=l[0];a>=10;a/=10,f++);f<14&&(n-=14-f)}return p.e=n,p.c=l,p}),L.sum=function(){for(var e=1,t=arguments,r=new L(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){function e(e,t,r,n){for(var i,o,a=[0],s=0,u=e.length;s<u;){for(o=a.length;o--;a[o]*=t);for(a[0]+=n.indexOf(e.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(t,n,i,o,a){var s,u,c,f,l,d,h,p,m=t.indexOf("."),g=P,y=O;for(m>=0&&(f=U,U=0,t=t.replace(".",""),d=(p=new L(n)).pow(t.length-m),U=f,p.c=e(w(b(d.c),d.e,"0"),10,i,"0123456789"),p.e=p.c.length),c=f=(h=e(t,n,i,a?(s=H,"0123456789"):(s="0123456789",H))).length;0==h[--f];h.pop());if(!h[0])return s.charAt(0);if(m<0?--c:(d.c=h,d.e=c,d.s=o,h=(d=r(d,p,g,y,i)).c,l=d.r,c=d.e),m=h[u=c+g+1],f=i/2,l=l||u<0||null!=h[u+1],l=y<4?(null!=m||l)&&(0==y||y==(d.s<0?3:2)):m>f||m==f&&(4==y||l||6==y&&1&h[u-1]||y==(d.s<0?8:7)),u<1||!h[0])t=l?w(s.charAt(1),-g,s.charAt(0)):s.charAt(0);else{if(h.length=u,l)for(--i;++h[--u]>i;)h[u]=0,u||(++c,h=[1].concat(h));for(f=h.length;!h[--f];);for(m=0,t="";m<=f;t+=s.charAt(h[m++]));t=w(t,c,s.charAt(0))}return t}}(),r=function(){function e(e,t,r){var n,i,o,a,s=0,u=e.length,c=t%1e7,f=t/1e7|0;for(e=e.slice();u--;)s=((i=c*(o=e[u]%1e7)+(n=f*o+(a=e[u]/1e7|0)*c)%1e7*1e7+s)/r|0)+(n/1e7|0)+f*a,e[u]=i%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,a,s){var c,f,d,h,b,m,g,y,v,w,_,E,k,S,x,T,A,P=n.s==i.s?1:-1,O=n.c,I=i.c;if(!(O&&O[0]&&I&&I[0]))return new L(n.s&&i.s&&(O?!I||O[0]!=I[0]:I)?O&&0==O[0]||!I?0*P:P/0:NaN);for(v=(y=new L(P)).c=[],P=o+(f=n.e-i.e)+1,s||(s=l,f=p(n.e/14)-p(i.e/14),P=P/14|0),d=0;I[d]==(O[d]||0);d++);if(I[d]>(O[d]||0)&&f--,P<0)v.push(1),h=!0;else{for(S=O.length,T=I.length,d=0,P+=2,(b=u(s/(I[0]+1)))>1&&(I=e(I,b,s),O=e(O,b,s),T=I.length,S=O.length),k=T,_=(w=O.slice(0,T)).length;_<T;w[_++]=0);A=I.slice(),A=[0].concat(A),x=I[0],I[1]>=s/2&&x++;do{if(b=0,(c=t(I,w,T,_))<0){if(E=w[0],T!=_&&(E=E*s+(w[1]||0)),(b=u(E/x))>1)for(b>=s&&(b=s-1),g=(m=e(I,b,s)).length,_=w.length;1==t(m,w,g,_);)b--,r(m,T<g?A:I,g,s),g=m.length,c=1;else 0==b&&(c=b=1),g=(m=I.slice()).length;if(g<_&&(m=[0].concat(m)),r(w,m,_,s),_=w.length,-1==c)for(;t(I,w,T,_)<1;)b++,r(w,T<_?A:I,_,s),_=w.length}else 0===c&&(b++,w=[0]);v[d++]=b,w[0]?w[_++]=O[k]||0:(w=[O[k]],_=1)}while((k++<S||null!=w[0])&&P--);h=null!=w[0],v[0]||v.splice(0,1)}if(s==l){for(d=1,P=v[0];P>=10;P/=10,d++);K(y,o+(y.e=d+14*f-1)+1,a,h)}else y.e=f,y.r=+h;return y}}(),_=/^(-?)0([xbo])(?=\w[\w.]*$)/i,E=/^([^.]+)\.$/,k=/^\.([^.]+)$/,S=/^-?(Infinity|NaN)$/,x=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(x,"");if(S.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(_,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(E,"$1").replace(k,"0.$1")),t!=o))return new L(o,i);if(L.DEBUG)throw Error(c+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},T.absoluteValue=T.abs=function(){var e=new L(this);return e.s<0&&(e.s=1),e},T.comparedTo=function(e,t){return m(this,new L(e,t))},T.decimalPlaces=T.dp=function(e,t){var r,n,i,o=this;if(null!=e)return g(e,0,h),null==t?t=O:g(t,0,8),K(new L(o),e+o.e+1,t);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},T.dividedBy=T.div=function(e,t){return r(this,new L(e,t),P,O)},T.dividedToIntegerBy=T.idiv=function(e,t){return r(this,new L(e,t),0,1)},T.exponentiatedBy=T.pow=function(e,t){var r,n,i,o,a,f,l,d,h=this;if((e=new L(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+W(e));if(null!=t&&(t=new L(t)),a=e.e>14,!h.c||!h.c[0]||1==h.c[0]&&!h.e&&1==h.c.length||!e.c||!e.c[0])return d=new L(Math.pow(+W(h),a?e.s*(2-y(e)):+W(e))),t?d.mod(t):d;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new L(NaN);(n=!f&&h.isInteger()&&t.isInteger())&&(h=h.mod(t))}else{if(e.e>9&&(h.e>0||h.e<-1||(0==h.e?h.c[0]>1||a&&h.c[1]>=24e7:h.c[0]<8e13||a&&h.c[0]<=9999975e7)))return o=h.s<0&&y(e)?-0:0,h.e>-1&&(o=1/o),new L(f?1/o:o);U&&(o=s(U/14+2))}for(a?(r=new L(.5),f&&(e.s=1),l=y(e)):l=(i=Math.abs(+W(e)))%2,d=new L(A);;){if(l){if(!(d=d.times(h)).c)break;o?d.c.length>o&&(d.c.length=o):n&&(d=d.mod(t))}if(i){if(0===(i=u(i/2)))break;l=i%2}else if(K(e=e.times(r),e.e+1,1),e.e>14)l=y(e);else{if(0===(i=+W(e)))break;l=i%2}h=h.times(h),o?h.c&&h.c.length>o&&(h.c.length=o):n&&(h=h.mod(t))}return n?d:(f&&(d=A.div(d)),t?d.mod(t):o?K(d,U,O,void 0):d)},T.integerValue=function(e){var t=new L(this);return null==e?e=O:g(e,0,8),K(t,t.e+1,e)},T.isEqualTo=T.eq=function(e,t){return 0===m(this,new L(e,t))},T.isFinite=function(){return!!this.c},T.isGreaterThan=T.gt=function(e,t){return m(this,new L(e,t))>0},T.isGreaterThanOrEqualTo=T.gte=function(e,t){return 1===(t=m(this,new L(e,t)))||0===t},T.isInteger=function(){return!!this.c&&p(this.e/14)>this.c.length-2},T.isLessThan=T.lt=function(e,t){return m(this,new L(e,t))<0},T.isLessThanOrEqualTo=T.lte=function(e,t){return-1===(t=m(this,new L(e,t)))||0===t},T.isNaN=function(){return!this.s},T.isNegative=function(){return this.s<0},T.isPositive=function(){return this.s>0},T.isZero=function(){return!!this.c&&0==this.c[0]},T.minus=function(e,t){var r,n,i,o,a=this,s=a.s;if(t=(e=new L(e,t)).s,!s||!t)return new L(NaN);if(s!=t)return e.s=-t,a.plus(e);var u=a.e/14,c=e.e/14,f=a.c,d=e.c;if(!u||!c){if(!f||!d)return f?(e.s=-t,e):new L(d?a:NaN);if(!f[0]||!d[0])return d[0]?(e.s=-t,e):new L(f[0]?a:3==O?-0:0)}if(u=p(u),c=p(c),f=f.slice(),s=u-c){for((o=s<0)?(s=-s,i=f):(c=u,i=d),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(n=(o=(s=f.length)<(t=d.length))?s:t,s=t=0;t<n;t++)if(f[t]!=d[t]){o=f[t]<d[t];break}if(o&&(i=f,f=d,d=i,e.s=-e.s),(t=(n=d.length)-(r=f.length))>0)for(;t--;f[r++]=0);for(t=l-1;n>s;){if(f[--n]<d[n]){for(r=n;r&&!f[--r];f[r]=t);--f[r],f[n]+=l}f[n]-=d[n]}for(;0==f[0];f.splice(0,1),--c);return f[0]?q(e,f,c):(e.s=3==O?-1:1,e.c=[e.e=0],e)},T.modulo=T.mod=function(e,t){var n,i,o=this;return e=new L(e,t),!o.c||!e.s||e.c&&!e.c[0]?new L(NaN):!e.c||o.c&&!o.c[0]?new L(o):(9==j?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,j),(e=o.minus(n.times(e))).c[0]||1!=j||(e.s=o.s),e)},T.multipliedBy=T.times=function(e,t){var r,n,i,o,a,s,u,c,f,d,h,b,m,g,y=this,v=y.c,w=(e=new L(e,t)).c;if(!(v&&w&&v[0]&&w[0]))return!y.s||!e.s||v&&!v[0]&&!w||w&&!w[0]&&!v?e.c=e.e=e.s=null:(e.s*=y.s,v&&w?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=p(y.e/14)+p(e.e/14),e.s*=y.s,(u=v.length)<(d=w.length)&&(m=v,v=w,w=m,i=u,u=d,d=i),i=u+d,m=[];i--;m.push(0));for(g=l,1e7,i=d;--i>=0;){for(r=0,h=w[i]%1e7,b=w[i]/1e7|0,o=i+(a=u);o>i;)r=((c=h*(c=v[--a]%1e7)+(s=b*c+(f=v[a]/1e7|0)*h)%1e7*1e7+m[o]+r)/g|0)+(s/1e7|0)+b*f,m[o--]=c%g;m[o]=r}return r?++n:m.splice(0,1),q(e,m,n)},T.negated=function(){var e=new L(this);return e.s=-e.s||null,e},T.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new L(e,t)).s,!i||!t)return new L(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/14,a=e.e/14,s=n.c,u=e.c;if(!o||!a){if(!s||!u)return new L(i/0);if(!s[0]||!u[0])return u[0]?e:new L(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)-(t=u.length)<0&&(r=u,u=s,s=r,t=i),i=0;t;)i=(s[--t]=s[t]+u[t]+i)/l|0,s[t]=l===s[t]?0:s[t]%l;return i&&(s=[i].concat(s),++a),q(e,s,a)},T.precision=T.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return g(e,1,h),null==t?t=O:g(t,0,8),K(new L(o),e,t);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 e&&o.e+1>n&&(n=o.e+1),n},T.shiftedBy=function(e){return g(e,-9007199254740991,9007199254740991),this.times("1e"+e)},T.squareRoot=T.sqrt=function(){var e,t,n,i,o,a=this,s=a.c,u=a.s,c=a.e,f=P+4,l=new L("0.5");if(1!==u||!s||!s[0])return new L(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(u=Math.sqrt(+W(a)))||u==1/0?(((t=b(s)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=p((c+1)/2)-(c<0||c%2),n=new L(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new L(u+""),n.c[0])for((u=(c=n.e)+f)<3&&(u=0);;)if(o=n,n=l.times(o.plus(r(a,o,f,1))),b(o.c).slice(0,u)===(t=b(n.c)).slice(0,u)){if(n.e<c&&--u,"9999"!=(t=t.slice(u-3,u+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(K(n,n.e+P+2,1),e=!n.times(n).eq(a));break}if(!i&&(K(o,o.e+P+2,0),o.times(o).eq(a))){n=o;break}f+=4,u+=4,i=1}return K(n,n.e+P+1,O,e)},T.toExponential=function(e,t){return null!=e&&(g(e,0,h),e++),D(this,e,t,1)},T.toFixed=function(e,t){return null!=e&&(g(e,0,h),e=e+this.e+1),D(this,e,t)},T.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=C;else if("object"!=typeof r)throw Error(c+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,a=n.split("."),s=+r.groupSize,u=+r.secondaryGroupSize,f=r.groupSeparator||"",l=a[0],d=a[1],h=i.s<0,p=h?l.slice(1):l,b=p.length;if(u&&(o=s,s=u,u=o,b-=o),s>0&&b>0){for(o=b%s||s,l=p.substr(0,o);o<b;o+=s)l+=f+p.substr(o,s);u>0&&(l+=f+p.slice(o)),h&&(l="-"+l)}n=d?l+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?d.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):d):l}return(r.prefix||"")+n+(r.suffix||"")},T.toFraction=function(e){var t,n,i,o,a,s,u,f,l,h,p,m,g=this,y=g.c;if(null!=e&&(!(u=new L(e)).isInteger()&&(u.c||1!==u.s)||u.lt(A)))throw Error(c+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+W(u));if(!y)return new L(g);for(t=new L(A),l=n=new L(A),i=f=new L(A),m=b(y),a=t.e=m.length-g.e-1,t.c[0]=d[(s=a%14)<0?14+s:s],e=!e||u.comparedTo(t)>0?a>0?t:l:u,s=R,R=1/0,u=new L(m),f.c[0]=0;h=r(u,t,0,1),1!=(o=n.plus(h.times(i))).comparedTo(e);)n=i,i=o,l=f.plus(h.times(o=l)),f=o,t=u.minus(h.times(o=t)),u=o;return o=r(e.minus(n),i,0,1),f=f.plus(o.times(l)),n=n.plus(o.times(i)),f.s=l.s=g.s,p=r(l,i,a*=2,O).minus(g).abs().comparedTo(r(f,n,a,O).minus(g).abs())<1?[l,i]:[f,n],R=s,p},T.toNumber=function(){return+W(this)},T.toPrecision=function(e,t){return null!=e&&g(e,1,h),D(this,e,t,2)},T.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=I||o>=B?v(b(r.c),o):w(b(r.c),o,"0"):10===e&&z?t=w(b((r=K(new L(r),P+o+1,O)).c),r.e,"0"):(g(e,2,H.length,"Base"),t=n(w(b(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},T.valueOf=T.toJSON=function(){return W(this)},T._isBigNumber=!0,null!=t&&L.set(t),L}()).default=o.BigNumber=o,void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},function(e,t,r){"use strict";e.exports={getBurnTransactionInfo:function(e,t=[],r=[]){let n=t.findIndex(t=>t.address===e);if(n>=0){let i=t[n];i.vinIndex=n;let o=t.reduce((e,t)=>+e+ +t.value,0),a=[],s=[];for(let t in r){let n=Object.assign(Object.assign({},r[t]),{index:t});n.address===e?s.push(n):a.push(n)}return{receivers:a,changes:s,totalInputValue:o,lockerVin:i}}return null}}},function(e,t,r){"use strict";(function(e){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=r(35),c=s(r(75)),f=o(r(117)).ECPair;function l(t,r={},n){let i=t,o=f.fromPrivateKey(t,{network:n,compressed:!0});if(!o.privateKey)throw new Error("private key not exist");o.publicKey.toString("hex").startsWith("03")&&(i=c.default.privateNegate(o.privateKey));const a=c.default.privateAdd(i,(s=e.from(o.publicKey.toString("hex").slice(2),"hex"),l=null==r?void 0:r.tweakHash,u.crypto.taggedHash("TapTweak",e.concat(l?[s,l]:[s]))));var s,l;if(!a)throw new Error("Invalid tweaked private key!");return f.fromPrivateKey(e.from(a),{network:n})}t.default=class{constructor(e){this.network=e}signPsbt(e,t){return a(this,void 0,void 0,(function*(){const{network:r}=this,n=f.fromPrivateKey(t,{network:r,compressed:!0}),i=u.Psbt.fromBase64(e.unsignedTransaction,{network:r});let o=i.inputCount;for(let e=0;e<o;e+=1){if("nonstandard"===i.getInputType(e)){let r=l(t,void 0,this.network);yield i.signInputAsync(e,r)}else yield i.signInputAsync(e,n)}return i.toBase64()}))}finalizePsbts(e=[]){const t=e.map(e=>u.Psbt.fromBase64(e,{network:this.network})),r=1===t.length?t[0]:new u.Psbt({network:this.network}).combine(...t);return r.finalizeAllInputs(),r.extractTransaction().toHex()}}}).call(this,r(0).Buffer)}])}));