var Defire=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=70)}([function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=n(r(13)),a=n(r(136)),s=r(6),u=i(r(8));e.amountToString=function(t){if("string"==typeof t)return t;if("number"==typeof t)return t.toString();if(t instanceof o.default)return t.toString(10);throw new Error("Invalid amount type.")},e.stripHexPrefix=function(t){if("string"!=typeof t)throw new Error("Invalid string.");return e.isHexPrefixed(t)?t.slice(2):t},e.isHexPrefixed=function(t){if("string"!=typeof t)throw new Error("Invalid string.");return"0x"===t.slice(0,2)},e.validateAddress=function(t,e){if(!u.isValidAddress(t))throw e},e.validateArray=function(t,e,r){if(!Array.isArray(t)||t.length1)return a.default.encodeParameters(t,e);if(1===t.length)return a.default.encodeParameter(t[0],e[0]);throw new Error("Wrong params to encode")},e.encodeFunctionCall=function(t){for(var r=[],n=1;n1)return a.default.decodeParameters(t,e);if(1===t.length)return a.default.decodeParameter(t[0],e);throw new Error("Wrong params to decode")}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},function(t,e,r){"use strict";(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ var n=r(75),i=r(76),o=r(41);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(t).length;default:if(n)return U(t).length;e=(""+e).toLowerCase(),n=!0}}function b(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return k(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function v(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:g(t,e,r,n,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):g(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(t,e,r,n,i){var o,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}function f(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var h=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var c=!0,l=0;li&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:f>223?3:f>191?2:1;if(i+c<=r)switch(c){case 1:f<128&&(h=f);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&f)<<6|63&o)>127&&(h=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&f)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(h=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&f)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(h=u)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=c}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},u.prototype.compare=function(t,e,r,n,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(o,a),f=this.slice(n,i),h=t.slice(e,r),c=0;ci)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return y(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return M(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function B(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function C(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function N(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function R(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,o){return o||R(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function L(t,e,r,n,o){return o||R(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return e||P(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||P(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||P(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||P(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||P(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||P(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||P(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||P(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||P(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||P(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||P(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||B(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):C(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):C(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):N(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);B(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);B(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):C(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):C(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):N(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||B(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return L(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return L(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function z(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(j,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(7))},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a=r(101).Buffer}catch(t){}function s(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,f=0,h=r;h1&&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?""};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"],h=[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],c=[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 l(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var f=1;f>>26,c=67108863&u,l=Math.min(f,e.length-1),d=Math.max(0,f-t.length+1);d<=l;d++){var p=f-d|0;h+=(a=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&a}r.words[f]=0|c,u=0|h}return 0!==u?r.words[f]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>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%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=h[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?b+r:f[l-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=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 t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,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"===e,f=new t(o),h=this.clone();if(u){for(s=0;!h.isZero();s++)a=h.andln(255),h.iushrn(8),f[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,b=d>>>13,m=0|a[2],v=8191&m,g=m>>>13,y=0|a[3],_=8191&y,w=y>>>13,M=0|a[4],A=8191&M,E=M>>>13,S=0|a[5],x=8191&S,I=S>>>13,k=0|a[6],T=8191&k,O=k>>>13,P=0|a[7],B=8191&P,C=P>>>13,N=0|a[8],R=8191&N,D=N>>>13,L=0|a[9],j=8191&L,F=L>>>13,U=0|s[0],z=8191&U,q=U>>>13,H=0|s[1],V=8191&H,G=H>>>13,K=0|s[2],Y=8191&K,W=K>>>13,Z=0|s[3],J=8191&Z,X=Z>>>13,$=0|s[4],Q=8191&$,tt=$>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ft=st>>>13,ht=0|s[8],ct=8191&ht,lt=ht>>>13,dt=0|s[9],pt=8191&dt,bt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(f+(n=Math.imul(c,z))|0)+((8191&(i=(i=Math.imul(c,q))+Math.imul(l,z)|0))<<13)|0;f=((o=Math.imul(l,q))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,z),i=(i=Math.imul(p,q))+Math.imul(b,z)|0,o=Math.imul(b,q);var vt=(f+(n=n+Math.imul(c,V)|0)|0)+((8191&(i=(i=i+Math.imul(c,G)|0)+Math.imul(l,V)|0))<<13)|0;f=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,z),i=(i=Math.imul(v,q))+Math.imul(g,z)|0,o=Math.imul(g,q),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,G)|0;var gt=(f+(n=n+Math.imul(c,Y)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(l,Y)|0))<<13)|0;f=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(_,z),i=(i=Math.imul(_,q))+Math.imul(w,z)|0,o=Math.imul(w,q),n=n+Math.imul(v,V)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,G)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,W)|0;var yt=(f+(n=n+Math.imul(c,J)|0)|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(l,J)|0))<<13)|0;f=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(A,z),i=(i=Math.imul(A,q))+Math.imul(E,z)|0,o=Math.imul(E,q),n=n+Math.imul(_,V)|0,i=(i=i+Math.imul(_,G)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,G)|0,n=n+Math.imul(v,Y)|0,i=(i=i+Math.imul(v,W)|0)+Math.imul(g,Y)|0,o=o+Math.imul(g,W)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(b,J)|0,o=o+Math.imul(b,X)|0;var _t=(f+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(l,Q)|0))<<13)|0;f=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(x,z),i=(i=Math.imul(x,q))+Math.imul(I,z)|0,o=Math.imul(I,q),n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,n=n+Math.imul(_,Y)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,W)|0,n=n+Math.imul(v,J)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var wt=(f+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(l,rt)|0))<<13)|0;f=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(T,z),i=(i=Math.imul(T,q))+Math.imul(O,z)|0,o=Math.imul(O,q),n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(I,V)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(_,J)|0,i=(i=i+Math.imul(_,X)|0)+Math.imul(w,J)|0,o=o+Math.imul(w,X)|0,n=n+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0;var Mt=(f+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,at)|0)+Math.imul(l,ot)|0))<<13)|0;f=((o=o+Math.imul(l,at)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,z),i=(i=Math.imul(B,q))+Math.imul(C,z)|0,o=Math.imul(C,q),n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,W)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,at)|0;var At=(f+(n=n+Math.imul(c,ut)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(l,ut)|0))<<13)|0;f=((o=o+Math.imul(l,ft)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(R,z),i=(i=Math.imul(R,q))+Math.imul(D,z)|0,o=Math.imul(D,q),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,nt)|0,n=n+Math.imul(v,ot)|0,i=(i=i+Math.imul(v,at)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ft)|0;var Et=(f+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;f=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(j,z),i=(i=Math.imul(j,q))+Math.imul(F,z)|0,o=Math.imul(F,q),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,W)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,n=n+Math.imul(v,ut)|0,i=(i=i+Math.imul(v,ft)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,ft)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,lt)|0;var St=(f+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,bt)|0)+Math.imul(l,pt)|0))<<13)|0;f=((o=o+Math.imul(l,bt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(j,V),i=(i=Math.imul(j,G))+Math.imul(F,V)|0,o=Math.imul(F,G),n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,W)|0,n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(C,J)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,at)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,at)|0,n=n+Math.imul(_,ut)|0,i=(i=i+Math.imul(_,ft)|0)+Math.imul(w,ut)|0,o=o+Math.imul(w,ft)|0,n=n+Math.imul(v,ct)|0,i=(i=i+Math.imul(v,lt)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,lt)|0;var xt=(f+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;f=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(j,Y),i=(i=Math.imul(j,W))+Math.imul(F,Y)|0,o=Math.imul(F,W),n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,at)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,at)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ft)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ft)|0,n=n+Math.imul(_,ct)|0,i=(i=i+Math.imul(_,lt)|0)+Math.imul(w,ct)|0,o=o+Math.imul(w,lt)|0;var It=(f+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,bt)|0)+Math.imul(g,pt)|0))<<13)|0;f=((o=o+Math.imul(g,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(j,J),i=(i=Math.imul(j,X))+Math.imul(F,J)|0,o=Math.imul(F,X),n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ft)|0,n=n+Math.imul(A,ct)|0,i=(i=i+Math.imul(A,lt)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,lt)|0;var kt=(f+(n=n+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,bt)|0)+Math.imul(w,pt)|0))<<13)|0;f=((o=o+Math.imul(w,bt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(j,Q),i=(i=Math.imul(j,tt))+Math.imul(F,Q)|0,o=Math.imul(F,tt),n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,at)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,at)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ft)|0,n=n+Math.imul(x,ct)|0,i=(i=i+Math.imul(x,lt)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,lt)|0;var Tt=(f+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,bt)|0)+Math.imul(E,pt)|0))<<13)|0;f=((o=o+Math.imul(E,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(j,rt),i=(i=Math.imul(j,nt))+Math.imul(F,rt)|0,o=Math.imul(F,nt),n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,at)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ft)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ft)|0,n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,lt)|0)+Math.imul(O,ct)|0,o=o+Math.imul(O,lt)|0;var Ot=(f+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,bt)|0)+Math.imul(I,pt)|0))<<13)|0;f=((o=o+Math.imul(I,bt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(j,ot),i=(i=Math.imul(j,at))+Math.imul(F,ot)|0,o=Math.imul(F,at),n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ft)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ft)|0,n=n+Math.imul(B,ct)|0,i=(i=i+Math.imul(B,lt)|0)+Math.imul(C,ct)|0,o=o+Math.imul(C,lt)|0;var Pt=(f+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,bt)|0)+Math.imul(O,pt)|0))<<13)|0;f=((o=o+Math.imul(O,bt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(j,ut),i=(i=Math.imul(j,ft))+Math.imul(F,ut)|0,o=Math.imul(F,ft),n=n+Math.imul(R,ct)|0,i=(i=i+Math.imul(R,lt)|0)+Math.imul(D,ct)|0,o=o+Math.imul(D,lt)|0;var Bt=(f+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,bt)|0)+Math.imul(C,pt)|0))<<13)|0;f=((o=o+Math.imul(C,bt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(j,ct),i=(i=Math.imul(j,lt))+Math.imul(F,ct)|0,o=Math.imul(F,lt);var Ct=(f+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,bt)|0)+Math.imul(D,pt)|0))<<13)|0;f=((o=o+Math.imul(D,bt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var Nt=(f+(n=Math.imul(j,pt))|0)+((8191&(i=(i=Math.imul(j,bt))+Math.imul(F,pt)|0))<<13)|0;return f=((o=Math.imul(F,bt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=mt,u[1]=vt,u[2]=gt,u[3]=yt,u[4]=_t,u[5]=wt,u[6]=Mt,u[7]=At,u[8]=Et,u[9]=St,u[10]=xt,u[11]=It,u[12]=kt,u[13]=Tt,u[14]=Ot,u[15]=Pt,u[16]=Bt,u[17]=Ct,u[18]=Nt,0!==f&&(u[19]=f,r.length++),r};function p(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(d=l),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>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,t,e):p(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,f=0;f=0&&(0!==h||f>=i);f--){var c=0|this.words[f];this.words[f]=h<<26-o|c>>>o,h=c&s}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,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"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var f=0;f=0;c--){var l=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(l=Math.min(l/a|0,67108863),n._ishlnsubmul(i,l,c);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);s&&(s.words[c]=l)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),f=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++f;for(var h=r.clone(),c=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(h),a.isub(c)),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(h),u.isub(c)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,h=1;0==(e.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(e.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var c=0,l=1;0==(r.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(r.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>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(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},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(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){M.call(this,t),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)}v.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(g,v),g.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},g.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new g;else if("p224"===t)e=new y;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return m[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,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(),f=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,f).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var b=d,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m=0;n--){for(var f=e.words[n],h=u-1;h>=0;h--){var c=f>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==a?(a<<=1,a|=c,(4===++s||0===n&&0===h)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new A(t)},i(A,M),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),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)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),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)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(23)(t))},function(t,e,r){var n=r(2),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},function(t,e,r){"use strict";var n=e,i=r(3),o=r(12),a=r(51);n.assert=o,n.toArray=a.toArray,n.zero2=a.zero2,n.toHex=a.toHex,n.encode=a.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0;t.cmpn(-n)>0||e.cmpn(-i)>0;){var o,a,s,u=t.andln(3)+n&3,f=e.andln(3)+i&3;if(3===u&&(u=-1),3===f&&(f=-1),0==(1&u))o=0;else o=3!==(s=t.andln(7)+n&7)&&5!==s||2!==f?u:-u;if(r[0].push(o),0==(1&f))a=0;else a=3!==(s=e.andln(7)+i&7)&&5!==s||2!==u?f:-f;r[1].push(a),2*n===o+1&&(n=1-n),2*i===a+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(){var e=t.call(this,"Network needs to be set to 'rinkeby'")||this;return e.name=e.constructor.name,e}return i(e,t),e}(Error);e.InvalidRinkebyConfigurationError=o;var a=function(t){function e(){var e=t.call(this)||this;return e.name=e.constructor.name,e}return i(e,t),e}(Error);e.InvalidPrivateKeyError=a;var s=function(t){function e(){var e=t.call(this)||this;return e.name=e.constructor.name,e}return i(e,t),e}(Error);e.InvalidParams=s;var u=function(t){function e(){var e=t.call(this)||this;return e.name=e.constructor.name,e}return i(e,t),e}(Error);e.InvalidAddress=u;var f=function(t){function e(e){var r=this;return(r=e?t.call(this,e)||this:t.call(this)||this).name=r.constructor.name,r}return i(e,t),e}(Error);e.InvalidConnector=f;var h=function(t){function e(e){var r=t.call(this,e)||this;return r.name=r.constructor.name,r}return i(e,t),e}(Error);e.ActionFailed=h;var c=function(t){function e(e){var r=t.call(this,e)||this;return r.name=r.constructor.name,r}return i(e,t),e}(Error);e.InvalidArray=c;var l=function(t){function e(e){var r=t.call(this,e)||this;return r.name=r.constructor.name,r}return i(e,t),e}(Error);e.MissingField=l;var d=function(t){function e(e){var r=t.call(this,e)||this;return r.name=r.constructor.name,r}return i(e,t),e}(Error);e.InvalidFormat=d},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0});var i=r(29);e.secp256k1=i;var o=r(19),a=r(3);e.BN=a;var s=r(37);e.rlp=s,Object.assign(e,o),n(r(122)),n(r(123)),n(r(38)),n(r(134)),n(r(20)),n(r(135))},function(t,e,r){"use strict";var n=r(12),i=r(1);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function a(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function u(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i>6|192,r[n++]=63&a|128):o(t,i)?(a=65536+((1023&a)<<10)+(1023&t.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>>0}return a},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,a=(o>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,o,a,s){var u=0,f=e;return u+=(f=f+n>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,r,n,i,o,a,s){return e+n+o+s>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,a,s,u,f){var h=0,c=e;return h+=(c=c+n>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,r,n,i,o,a,s,u,f){return e+n+o+s+f>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var u,f=[],h=!1,c=-1;function l(){h&&u&&(h=!1,u.length?f=u.concat(f):c=-1,f.length&&d())}function d(){if(!h){var t=s(l);h=!0;for(var e=f.length;e;){for(u=f,f=[];++c1)for(var r=1;rh.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return(r=f(this,i(h).call(this,t))).sign=e,r}return n(h,e),r(h,[{key:"toDebugString",value:function(){var t=["BigInt["],e=!0,r=!1,n=void 0;try{for(var i,o,a=this[Symbol.iterator]();!(e=(i=a.next()).done);e=!0)o=i.value,t.push((o?(o>>>0).toString(16):o)+", ")}catch(t){r=!0,n=t}finally{try{e||null==a.return||a.return()}finally{if(r)throw n}}return t.push("]"),t.join("")}},{key:"toString",value:function(){var t=0t||36this.length&&(r=this.length);for(var n=65535&t,i=t>>>16,o=0,a=65535&e,u=e>>>16,f=0;f>>16,d=s(c,n),p=s(c,i),b=s(l,n),m=s(l,i),v=a+(65535&d),g=u+o+(v>>>16)+(d>>>16)+(65535&p)+(65535&b);o=(a=(p>>>16)+(b>>>16)+(65535&m)+(g>>>16))>>>16,a&=65535,u=m>>>16,this.__setDigit(f,65535&v|g<<16)}if(0!==o||0!==a||0!==u)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(t,e,r){for(var n,i=0,o=0;o>>16,this.__setHalfDigit(e+o,n);return i}},{key:"__inplaceSub",value:function(t,e,r){var n=0;if(1&e){e>>=1;for(var i=this.__digit(e),o=65535&i,a=0;a>>1;a++){var s=t.__digit(a),u=(i>>>16)-(65535&s)-n;n=1&u>>>16,this.__setDigit(e+a,u<<16|65535&o),n=1&(o=(65535&(i=this.__digit(e+a+1)))-(s>>>16)-n)>>>16}var f=t.__digit(a),h=(i>>>16)-(65535&f)-n;if(n=1&h>>>16,this.__setDigit(e+a,h<<16|65535&o),e+a+1>=this.length)throw new RangeError("out of bounds");0==(1&r)&&(n=1&(o=(65535&(i=this.__digit(e+a+1)))-(f>>>16)-n)>>>16,this.__setDigit(e+t.length,4294901760&i|65535&o))}else{e>>=1;for(var c=0;c>>16)-(d>>>16)-(n=1&p>>>16);n=1&b>>>16,this.__setDigit(e+c,b<<16|65535&p)}var m=this.__digit(e+c),v=t.__digit(c),g=(65535&m)-(65535&v)-n;n=1&g>>>16;var y=0;0==(1&r)&&(n=1&(y=(m>>>16)-(v>>>16)-n)>>>16),this.__setDigit(e+c,y<<16|65535&g)}return n}},{key:"__inplaceRightShift",value:function(t){if(0!==t){for(var e,r=this.__digit(0)>>>t,n=this.length-1,i=0;i>>t;this.__setDigit(n,r)}}},{key:"__digit",value:function(t){return this[t]}},{key:"__unsignedDigit",value:function(t){return this[t]>>>0}},{key:"__setDigit",value:function(t,e){this[t]=0|e}},{key:"__setDigitGrow",value:function(t,e){this[t]=0|e}},{key:"__halfDigitLength",value:function(){var t=this.length;return 65535>=this.__unsignedDigit(t-1)?2*t-1:2*t}},{key:"__halfDigit",value:function(t){return 65535&this[t>>>1]>>>((1&t)<<4)}},{key:"__setHalfDigit",value:function(t,e){var r=t>>>1,n=this.__digit(r),i=1&t?65535&n|e<<16:4294901760&n|65535&e;this.__setDigit(r,i)}}],[{key:"BigInt",value:function(e){var r=Math.floor,n=Number.isFinite;if("number"==typeof e){if(0===e)return h.__zero();if((0|e)===e)return 0>e?h.__oneDigit(-e,!0):h.__oneDigit(e,!1);if(!n(e)||r(e)!==e)throw new RangeError("The number "+e+" cannot be converted to BigInt because it is not an integer");return h.__fromDouble(e)}if("string"==typeof e){var i=h.__fromString(e);if(null===i)throw new SyntaxError("Cannot convert "+e+" to a BigInt");return i}if("boolean"==typeof e)return!0===e?h.__oneDigit(1,!1):h.__zero();if("object"===t(e)){if(e.constructor===h)return e;var o=h.__toPrimitive(e);return h.BigInt(o)}throw new TypeError("Cannot convert "+e+" to a BigInt")}},{key:"toNumber",value:function(t){var e=t.length;if(0===e)return 0;if(1===e){var r=t.__unsignedDigit(0);return t.sign?-r:r}var n=t.__digit(e-1),i=u(n),o=32*e-i;if(1024>>=12;var d=c-12,p=12<=c?0:s<<20+c,b=20+c;0>>32-d,p=s<>>32-b,b-=32);var m=h.__decideRounding(t,b,f,s);if((1===m||0===m&&1==(1&p))&&0==(p=p+1>>>0)&&0!=++l>>>20&&(l=0,1023<++a))return t.sign?-1/0:1/0;var v=t.sign?-2147483648:0;return a=a+1023<<20,h.__kBitConversionInts[1]=v|a|l,h.__kBitConversionInts[0]=p,h.__kBitConversionDouble[0]}},{key:"unaryMinus",value:function(t){if(0===t.length)return t;var e=t.__copy();return e.sign=!t.sign,e}},{key:"bitwiseNot",value:function(t){return t.sign?h.__absoluteSubOne(t).__trim():h.__absoluteAddOne(t,!0)}},{key:"exponentiate",value:function(t,e){if(e.sign)throw new RangeError("Exponent must be positive");if(0===e.length)return h.__oneDigit(1,!1);if(0===t.length)return t;if(1===t.length&&1===t.__digit(0))return t.sign&&0==(1&e.__digit(0))?h.unaryMinus(t):t;if(1=h.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===t.length&&2===t.__digit(0)){var n=1+(r>>>5),i=new h(n,t.sign&&0!=(1&r));i.__initializeDigits();var o=1<<(31&r);return i.__setDigit(n-1,o),i}var a=null,s=t;for(0!=(1&r)&&(a=t),r>>=1;0!==r;r>>=1)s=h.multiply(s,s),0!=(1&r)&&(a=null===a?s:h.multiply(a,s));return a}},{key:"multiply",value:function(t,e){if(0===t.length)return t;if(0===e.length)return e;var r=t.length+e.length;32<=t.__clzmsd()+e.__clzmsd()&&r--;var n=new h(r,t.sign!==e.sign);n.__initializeDigits();for(var i=0;ih.__absoluteCompare(t,e))return h.__zero();var r,n=t.sign!==e.sign,i=e.__unsignedDigit(0);if(1===e.length&&65535>=i){if(1===i)return n===t.sign?t:h.unaryMinus(t);r=h.__absoluteDivSmall(t,i,null)}else r=h.__absoluteDivLarge(t,e,!0,!1);return r.sign=n,r.__trim()}},{key:"remainder",value:function(t,e){if(0===e.length)throw new RangeError("Division by zero");if(0>h.__absoluteCompare(t,e))return t;var r=e.__unsignedDigit(0);if(1===e.length&&65535>=r){if(1===r)return h.__zero();var n=h.__absoluteModSmall(t,r);return 0===n?h.__zero():h.__oneDigit(n,t.sign)}var i=h.__absoluteDivLarge(t,e,!1,!0);return i.sign=t.sign,i.__trim()}},{key:"add",value:function(t,e){var r=t.sign;return r===e.sign?h.__absoluteAdd(t,e,r):0<=h.__absoluteCompare(t,e)?h.__absoluteSub(t,e,r):h.__absoluteSub(e,t,!r)}},{key:"subtract",value:function(t,e){var r=t.sign;return r===e.sign?0<=h.__absoluteCompare(t,e)?h.__absoluteSub(t,e,r):h.__absoluteSub(e,t,!r):h.__absoluteAdd(t,e,r)}},{key:"leftShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?h.__rightShiftByAbsolute(t,e):h.__leftShiftByAbsolute(t,e)}},{key:"signedRightShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?h.__leftShiftByAbsolute(t,e):h.__rightShiftByAbsolute(t,e)}},{key:"unsignedRightShift",value:function(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}},{key:"lessThan",value:function(t,e){return 0>h.__compareToBigInt(t,e)}},{key:"lessThanOrEqual",value:function(t,e){return 0>=h.__compareToBigInt(t,e)}},{key:"greaterThan",value:function(t,e){return 0=h.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.lengthh.__kMaxLengthBits)throw new RangeError("BigInt too big");return h.__truncateAndSubFromPowerOfTwo(t,e,!1)}if(t>=h.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.length>>n)return e}return h.__truncateToNBits(t,e)}},{key:"ADD",value:function(t,e){if(t=h.__toPrimitive(t),e=h.__toPrimitive(e),"string"==typeof t)return"string"!=typeof e&&(e=e.toString()),t+e;if("string"==typeof e)return t.toString()+e;if(t=h.__toNumeric(t),e=h.__toNumeric(e),h.__isBigInt(t)&&h.__isBigInt(e))return h.add(t,e);if("number"==typeof t&&"number"==typeof e)return t+e;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}},{key:"LT",value:function(t,e){return h.__compare(t,e,0)}},{key:"LE",value:function(t,e){return h.__compare(t,e,1)}},{key:"GT",value:function(t,e){return h.__compare(t,e,2)}},{key:"GE",value:function(t,e){return h.__compare(t,e,3)}},{key:"EQ",value:function(e,r){for(;;){if(h.__isBigInt(e))return h.__isBigInt(r)?h.equal(e,r):h.EQ(r,e);if("number"==typeof e){if(h.__isBigInt(r))return h.__equalToNumber(r,e);if("object"!==t(r))return e==r;r=h.__toPrimitive(r)}else if("string"==typeof e){if(h.__isBigInt(r))return null!==(e=h.__fromString(e))&&h.equal(e,r);if("object"!==t(r))return e==r;r=h.__toPrimitive(r)}else if("boolean"==typeof e){if(h.__isBigInt(r))return h.__equalToNumber(r,+e);if("object"!==t(r))return e==r;r=h.__toPrimitive(r)}else if("symbol"===t(e)){if(h.__isBigInt(r))return!1;if("object"!==t(r))return e==r;r=h.__toPrimitive(r)}else{if("object"!==t(e))return e==r;if("object"===t(r)&&r.constructor!==h)return e==r;e=h.__toPrimitive(e)}}}},{key:"NE",value:function(t,e){return!h.EQ(t,e)}},{key:"__zero",value:function(){return new h(0,!1)}},{key:"__oneDigit",value:function(t,e){var r=new h(1,e);return r.__setDigit(0,t),r}},{key:"__decideRounding",value:function(t,e,r,n){if(0e)i=-e-1;else{if(0===r)return-1;r--,n=t.__digit(r),i=31}var o=1<>>20)-1023,n=1+(r>>>5),i=new h(n,0>t),o=1048575&h.__kBitConversionInts[1]|1048576,a=h.__kBitConversionInts[0],s=31&r,u=0;if(s<20){var f=20-s;u=f+32,e=o>>>f,o=o<<32-f|a>>>f,a<<=32-f}else if(20===s)u=32,e=o,o=a;else{var c=s-20;u=32-c,e=o<>>32-c,o=a<=t&&9<=t)||(159>=t?32==t:131071>=t?160==t||5760==t:196607>=t?10>=(t&=131071)||40==t||41==t||47==t||95==t||4096==t:65279==t)}},{key:"__fromString",value:function(t){var e=11073741824/s)return null;var f=s*a+u>>>h.__kBitsPerCharTableShift,c=new h(f+31>>>5,!1),l=10>e?e:10,d=10>=h.__kBitsPerCharTableShift;var p=[],b=[],m=!1;do{for(var v,g=0,y=0;;){if(v=void 0,o-48>>>0>>0>>0>>0>>h.__kBitsPerCharTableShift+5;c.__inplaceMultiplyAdd(E,A,x)}while(!_)}if(i!==n){if(!h.__isWhitespace(o))return null;for(i++;i>>u-(o-=32))}if(0!==i){if(n>=t.length)throw new Error("implementation bug");t.__setDigit(n++,i)}for(;n>>1)+(85&n))>>>2)+(51&n))>>>4)+(15&n),o=e-1,a=t.__digit(r-1),s=0|(32*r-u(a)+i-1)/i;if(t.sign&&s++,268435456>>v,d=32-v;d>=i;)f[c--]=h.__kConversionChars[l&o],l>>>=i,d-=i}var g=(l|a<>>i-d;0!==l;)f[c--]=h.__kConversionChars[l&o],l>>>=i;if(t.sign&&(f[c--]="-"),-1!==c)throw new Error("implementation bug");return f.join("")}},{key:"__toStringGeneric",value:function(t,e,r){var n=t.length;if(0===n)return"";if(1===n){var i=t.__unsignedDigit(0).toString(e);return!1===r&&t.sign&&(i="-"+i),i}var o,a,s=32*n-u(t.__digit(n-1)),f=h.__kMaxBitsPerChar[e]-1,c=s*h.__kBitsPerCharTableMultiplier,l=1+(c=0|(c+=f-1)/f)>>1,d=h.exponentiate(h.__oneDigit(e,!1),h.__oneDigit(l,!1)),p=d.__unsignedDigit(0);if(1===d.length&&65535>=p){(o=new h(t.length,!1)).__initializeDigits();for(var b,m=0,v=2*t.length-1;0<=v;v--)b=m<<16|t.__halfDigit(v),o.__setHalfDigit(v,0|b/p),m=0|b%p;a=m.toString(e)}else{var g=h.__absoluteDivLarge(t,d,!0,!0);o=g.quotient;var y=g.remainder.__trim();a=h.__toStringGeneric(y,e,!0)}o.__trim();for(var _=h.__toStringGeneric(o,e,!0);a.lengthn?h.__absoluteLess(r):0}},{key:"__compareToNumber",value:function(t,e){if(!0|e){var r=t.sign,n=0>e;if(r!==n)return h.__unequalSign(r);if(0===t.length){if(n)throw new Error("implementation bug");return 0===e?0:-1}if(1i?h.__absoluteGreater(r):ae)return h.__unequalSign(r);if(0===e)throw new Error("implementation bug: should be handled elsewhere");if(0===t.length)return-1;h.__kBitConversionDouble[0]=e;var n=2047&h.__kBitConversionInts[1]>>>20;if(2047==n)throw new Error("implementation bug: handled elsewhere");var i=n-1023;if(0>i)return h.__absoluteGreater(r);var o=t.length,a=t.__digit(o-1),s=u(a),f=32*o-s,c=i+1;if(fc)return h.__absoluteGreater(r);var l=1048576|1048575&h.__kBitConversionInts[1],d=h.__kBitConversionInts[0],p=31-s;if(p!==(f-1)%31)throw new Error("implementation bug");var b,m=0;if(p<20){var v=20-p;m=v+32,b=l>>>v,l=l<<32-v|d>>>v,d<<=32-v}else if(20===p)m=32,b=l,l=d;else{var g=p-20;m=32-g,b=l<>>32-g,l=d<>>=0)>(b>>>=0))return h.__absoluteGreater(r);if(a>>0,l=d,d=0):b=0;var _=t.__unsignedDigit(y);if(_>b)return h.__absoluteGreater(r);if(_e&&t.__unsignedDigit(0)===o(e):0===h.__compareToDouble(t,e)}},{key:"__comparisonResultToBool",value:function(t,e){switch(e){case 0:return 0>t;case 1:return 0>=t;case 2:return 0e;case 3:return t>=e}if(h.__isBigInt(t)&&"string"==typeof e)return null!==(e=h.__fromString(e))&&h.__comparisonResultToBool(h.__compareToBigInt(t,e),r);if("string"==typeof t&&h.__isBigInt(e))return null!==(t=h.__fromString(t))&&h.__comparisonResultToBool(h.__compareToBigInt(t,e),r);if(t=h.__toNumeric(t),e=h.__toNumeric(e),h.__isBigInt(t)){if(h.__isBigInt(e))return h.__comparisonResultToBool(h.__compareToBigInt(t,e),r);if("number"!=typeof e)throw new Error("implementation bug");return h.__comparisonResultToBool(h.__compareToNumber(t,e),r)}if("number"!=typeof t)throw new Error("implementation bug");if(h.__isBigInt(e))return h.__comparisonResultToBool(h.__compareToNumber(e,t),2^r);if("number"!=typeof e)throw new Error("implementation bug");return 0===r?te:3===r?t>=e:void 0}},{key:"__absoluteAdd",value:function(t,e,r){if(t.length>>16)+(s>>>16)+(f>>>16);o=c>>>16,i.__setDigit(a,65535&f|c<<16)}for(;a>>16)+(d>>>16);o=p>>>16,i.__setDigit(a,65535&d|p<<16)}return a>>16)-(s>>>16)-(i=1&u>>>16);i=1&f>>>16,n.__setDigit(o,65535&u|f<<16)}for(;o>>16)-(i=1&l>>>16);i=1&d>>>16,n.__setDigit(o,65535&l|d<<16)}return n.__trim()}},{key:"__absoluteAddOne",value:function(t,e){var r=2n?0:t.__unsignedDigit(n)>e.__unsignedDigit(n)?1:-1}},{key:"__multiplyAccumulate",value:function(t,e,r,n){if(0!==e){for(var i=65535&e,o=e>>>16,a=0,u=0,f=0,h=0;h>>16,p=t.__digit(h),b=65535&p,m=p>>>16,v=s(b,i),g=s(b,o),y=s(m,i),_=s(m,o);a=(u=(g>>>16)+(y>>>16)+(65535&_)+(a=(d+=f+a+((l+=u+(65535&v))>>>16)+(v>>>16)+(65535&g)+(65535&y))>>>16))>>>16,u&=65535,f=_>>>16,c=65535&l|d<<16,r.__setDigit(n,c)}for(;0!==a||0!==u||0!==f;n++){var w=r.__digit(n),M=(65535&w)+u,A=(w>>>16)+(M>>>16)+f+a;u=0,f=0,a=A>>>16,w=65535&M|A<<16,r.__setDigit(n,w)}}}},{key:"__internalMultiplyAdd",value:function(t,e,r,n,i){for(var o=r,a=0,u=0;u>>16;var l=s(f>>>16,e),d=(65535&l)+(h>>>16)+o;o=d>>>16,a=l>>>16,i.__setDigit(u,d<<16|65535&c)}if(i.length>n)for(i.__setDigit(n++,o+a);n>>0,a=0|o/e,s=0|(o=((n=0|o%e)<<16|t.__halfDigit(i-1))>>>0)/e;n=0|o%e,r.__setDigit(i>>>1,a<<16|s)}return r}},{key:"__absoluteModSmall",value:function(t,e){for(var r=0,n=2*t.length-1;0<=n;n--)r=0|((r<<16|t.__halfDigit(n))>>>0)%e;return r}},{key:"__absoluteDivLarge",value:function(t,e,r,n){var i=e.__halfDigitLength(),o=e.length,a=t.__halfDigitLength()-i,u=null;r&&(u=new h(a+2>>>1,!1)).__initializeDigits();var f=new h(i+2>>>1,!1);f.__initializeDigits();var c=h.__clz16(e.__halfDigit(i-1));0>>0;m=0|g/d;for(var y=0|g%d,_=e.__halfDigit(i-2),w=l.__halfDigit(b+i-2);s(m,_)>>>0>(y<<16|w)>>>0&&(m--,!(65535<(y+=d))););}h.__internalMultiplyAdd(e,m,0,o,f);var M=l.__inplaceSub(f,b,i+1);0!==M&&(M=l.__inplaceAdd(e,b,i),l.__setHalfDigit(b+i,l.__halfDigit(b+i)+M),m--),r&&(1&b?p=m<<16:u.__setDigit(b>>>1,p|m))}return n?(l.__inplaceRightShift(c),r?{quotient:u,remainder:l}:l):r?u:void 0}},{key:"__clz16",value:function(t){return u(t)-16}},{key:"__specialLeftShift",value:function(t,e,r){var n=t.length,i=new h(n+r,!1);if(0===e){for(var o=0;o>>32-e;return 0r)throw new RangeError("BigInt too big");var n=r>>>5,i=31&r,o=t.length,a=0!==i&&0!=t.__digit(o-1)>>>32-i,s=o+n+(a?1:0),u=new h(s,t.sign);if(0===i){for(var f=0;f>>32-i;if(a)u.__setDigit(o+n,c);else if(0!==c)throw new Error("implementation bug")}return u.__trim()}},{key:"__rightShiftByAbsolute",value:function(t,e){var r=t.length,n=t.sign,i=h.__toShiftAmount(e);if(0>i)return h.__rightShiftByMaximum(n);var o=i>>>5,a=31&i,s=r-o;if(0>=s)return h.__rightShiftByMaximum(n);var u=!1;if(n)if(0!=(t.__digit(o)&(1<>>a,b=r-o-1,m=0;m>>a;c.__setDigit(b,p)}return u&&(c=h.__absoluteAddOne(c,!0,c)),c.__trim()}},{key:"__rightShiftByMaximum",value:function(t){return t?h.__oneDigit(1,!0):h.__zero()}},{key:"__toShiftAmount",value:function(t){if(1h.__kMaxLengthBits?-1:e}},{key:"__toPrimitive",value:function(e){var r=1>>5,n=new h(r,e.sign),i=r-1,o=0;o>>s}return n.__setDigit(i,a),n.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(t,e,r){for(var n=Math.min,i=t+31>>>5,o=new h(i,r),a=0,s=i-1,u=0,f=n(s,e.length);a>>16)-(u=1&l>>>16);u=1&d>>>16,o.__setDigit(a,65535&l|d<<16)}for(;a>>16)-(u=1&v>>>16)<<16}else{var g=32-m,y=1<<32-g,_=(65535&y)-(65535&(b=b<>>g))-u;p=65535&_|(y>>>16)-(b>>>16)-(u=1&_>>>16)<<16,p&=y-1}return o.__setDigit(s,p),o.__trim()}},{key:"__digitPow",value:function(t,e){for(var r=1;0>>=1,t*=t;return r}}]),h}(u(Array));return h.__kMaxLength=33554432,h.__kMaxLengthBits=h.__kMaxLength<<5,h.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],h.__kBitsPerCharTableShift=5,h.__kBitsPerCharTableMultiplier=1<0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(62),i=r(26);function o(t){return t instanceof n.BigNumber}function a(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(t,e))}),t}function s(t){if(!t||parseInt(String(t.length))!=t.length||"string"==typeof t)return!1;for(var e=0;e=256||parseInt(String(r))!=r)return!1}return!0}function u(t){if(null==t&&i.throwError("cannot convert null value to array",i.INVALID_ARGUMENT,{arg:"value",value:t}),o(t)&&(t=t.toHexString()),"string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&i.throwError("hex string must have 0x prefix",i.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],n=0;n>4]+"0123456789abcdef"[15&u])}return"0x"+n.join("")}return i.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function l(t,e){for(h(t)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function d(t){var e,r=0,n="0x",o="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&i.throwError("at least on of recoveryParam or v must be specified",i.INVALID_ARGUMENT,{argument:"signature",value:t}),n=l(t.r,32),o=l(t.s,32),"string"==typeof(r=t.v)&&(r=parseInt(r,16));var a=t.recoveryParam;null==a&&null!=t.v&&(a=1-r%2),r=27+a}else{var s=u(t);if(65!==s.length)throw new Error("invalid signature");n=c(s.slice(0,32)),o=c(s.slice(32,64)),27!==(r=s[64])&&28!==r&&(r=27+r%2)}return{r:n,s:o,recoveryParam:r-27,v:r}}e.hexlify=c,e.hexDataLength=function(t){return h(t)&&t.length%2==0?(t.length-2)/2:null},e.hexDataSlice=function(t,e,r){return h(t)||i.throwError("invalid hex data",i.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&i.throwError("hex data length must be even",i.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,e+2*r):"0x"+t.substring(e)},e.hexStripZeros=function(t){for(h(t)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:t});t.length>3&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},e.hexZeroPad=l,e.splitSignature=d,e.joinSignature=function(t){return c(f([(t=d(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},function(t,e,r){(function(t){function r(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===r(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===r(t)},e.isObject=function(t){return"object"==typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===r(t)},e.isError=function(t){return"[object Error]"===r(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=t.isBuffer}).call(this,r(2).Buffer)},function(t,e,r){"use strict";var n=r(9),i=r(12);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=o,o.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o=0}))},intToBuffer:function(t){var r=a(t);return new e(o(r.slice(2)),"hex")},getBinarySize:function(t){if("string"!=typeof t)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof t+"'.");return e.byteLength(t,"utf8")},isHexPrefixed:n,stripHexPrefix:i,padToEven:o,intToHex:a,fromAscii:function(t){for(var e="",r=0;r0&&"0"===e.toString();)e=(t=t.slice(1))[0];return t},e.stripZeros=e.unpad,e.toBuffer=function(e){if(!t.isBuffer(e))if(Array.isArray(e))e=t.from(e);else if("string"==typeof e){if(!n.isHexString(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+e);e=t.from(n.padToEven(n.stripHexPrefix(e)),"hex")}else if("number"==typeof e)e=n.intToBuffer(e);else if(null==e)e=t.allocUnsafe(0);else if(i.isBN(e))e=e.toArrayLike(t);else{if(!e.toArray)throw new Error("invalid type");e=t.from(e.toArray())}return e},e.bufferToInt=function(t){return new i(e.toBuffer(t)).toNumber()},e.bufferToHex=function(t){return"0x"+(t=e.toBuffer(t)).toString("hex")},e.fromSigned=function(t){return new i(t).fromTwos(256)},e.toUnsigned=function(e){return t.from(e.toTwos(256).toArray())},e.addHexPrefix=function(t){return"string"!=typeof t||n.isHexPrefixed(t)?t:"0x"+t},e.baToJSON=function(r){if(t.isBuffer(r))return"0x"+r.toString("hex");if(r instanceof Array){for(var n=[],i=0;i0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function f(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){s(t.precomputed);var r=t._getDoubles(),n=o(e,1,this._bitLength),i=(1<=u;e--)f=(f<<1)+n[e];a.push(f)}for(var h=this.jpoint(null,null,null),c=this.jpoint(null,null,null),l=i;l>0;l--){for(u=0;u=0;f--){for(e=0;f>=0&&0===a[f];f--)e++;if(f>=0&&e++,u=u.dblp(e),f<0)break;var h=a[f];s(0!==h),u="affine"===t.type?h>0?u.mixedAdd(i[h-1>>1]):u.mixedAdd(i[-h-1>>1].neg()):h>0?u.add(i[h-1>>1]):u.add(i[-h-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,n,i){for(var s=this._wnafT1,u=this._wnafT2,f=this._wnafT3,h=0,c=0;c=1;c-=2){var d=c-1,p=c;if(1===s[d]&&1===s[p]){var b=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(b[1]=e[d].add(e[p]),b[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(b[1]=e[d].toJ().mixedAdd(e[p]),b[2]=e[d].add(e[p].neg())):(b[1]=e[d].toJ().mixedAdd(e[p]),b[2]=e[d].toJ().mixedAdd(e[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],v=a(r[d],r[p]);h=Math.max(v[0].length,h),f[d]=new Array(h),f[p]=new Array(h);for(var g=0;g=0;c--){for(var A=0;c>=0;){var E=!0;for(g=0;g=0&&A++,w=w.dblp(A),c<0)break;for(g=0;g0?S=u[g][x-1>>1]:x<0&&(S=u[g][-x-1>>1].neg()),w="affine"===S.type?w.mixedAdd(S):w.add(S))}}for(c=0;c=Math.ceil((t.bitLength()+1)/e.step)},f.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&e<=x};v.each=v.forEach=function(t,e,r){var n,i;if(e=y(e,r),k(t))for(n=0,i=t.length;n0?0:a-1;for(i||(n=e[o?o[s]:s],s+=t);s>=0&&s=3;return e(t,y(r,i,4),n,o)}};v.reduce=v.foldl=v.inject=T(1),v.reduceRight=v.foldr=T(-1),v.find=v.detect=function(t,e,r){var n=(k(t)?v.findIndex:v.findKey)(t,e,r);if(void 0!==n&&-1!==n)return t[n]},v.filter=v.select=function(t,e,r){var n=[];return e=_(e,r),v.each(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n},v.reject=function(t,e,r){return v.filter(t,v.negate(_(e)),r)},v.every=v.all=function(t,e,r){e=_(e,r);for(var n=!k(t)&&v.keys(t),i=(n||t).length,o=0;o=0},v.invoke=w((function(t,e,r){var n,i;return v.isFunction(e)?i=e:v.isArray(e)&&(n=e.slice(0,-1),e=e[e.length-1]),v.map(t,(function(t){var o=i;if(!o){if(n&&n.length&&(t=S(t,n)),null==t)return;o=t[e]}return null==o?o:o.apply(t,r)}))})),v.pluck=function(t,e){return v.map(t,v.property(e))},v.where=function(t,e){return v.filter(t,v.matcher(e))},v.findWhere=function(t,e){return v.find(t,v.matcher(e))},v.max=function(t,e,r){var n,i,o=-1/0,a=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,u=(t=k(t)?t:v.values(t)).length;so&&(o=n);else e=_(e,r),v.each(t,(function(t,r,n){((i=e(t,r,n))>a||i===-1/0&&o===-1/0)&&(o=t,a=i)}));return o},v.min=function(t,e,r){var n,i,o=1/0,a=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,u=(t=k(t)?t:v.values(t)).length;sn||void 0===r)return 1;if(r0?0:i-1;o>=0&&o0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(r&&o&&s)return n[o=r(n,i)]===i?o:-1;if(i!=i)return(o=e(h.call(n,a,s),v.isNaN))>=0?o+a:-1;for(o=t>0?a:s-1;o>=0&&oe?(n&&(clearTimeout(n),n=null),s=f,a=t.apply(i,o),n||(i=o=null)):n||!1===r.trailing||(n=setTimeout(u,h)),a};return f.cancel=function(){clearTimeout(n),s=0,n=i=o=null},f},v.debounce=function(t,e,r){var n,i,o=function(e,r){n=null,r&&(i=t.apply(e,r))},a=w((function(a){if(n&&clearTimeout(n),r){var s=!n;n=setTimeout(o,e),s&&(i=t.apply(this,a))}else n=v.delay(o,e,this,a);return i}));return a.cancel=function(){clearTimeout(n),n=null},a},v.wrap=function(t,e){return v.partial(e,t)},v.negate=function(t){return function(){return!t.apply(this,arguments)}},v.compose=function(){var t=arguments,e=t.length-1;return function(){for(var r=e,n=t[e].apply(this,arguments);r--;)n=t[r].call(this,n);return n}},v.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},v.before=function(t,e){var r;return function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=null),r}},v.once=v.partial(v.before,2),v.restArguments=w;var D=!{toString:null}.propertyIsEnumerable("toString"),L=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],j=function(t,e){var r=L.length,n=t.constructor,i=v.isFunction(n)&&n.prototype||s,o="constructor";for(E(t,o)&&!v.contains(e,o)&&e.push(o);r--;)(o=L[r])in t&&t[o]!==i[o]&&!v.contains(e,o)&&e.push(o)};v.keys=function(t){if(!v.isObject(t))return[];if(p)return p(t);var e=[];for(var r in t)E(t,r)&&e.push(r);return D&&j(t,e),e},v.allKeys=function(t){if(!v.isObject(t))return[];var e=[];for(var r in t)e.push(r);return D&&j(t,e),e},v.values=function(t){for(var e=v.keys(t),r=e.length,n=Array(r),i=0;i1&&(n=y(n,e[1])),e=v.allKeys(t)):(n=q,e=B(e,!1,!1),t=Object(t));for(var i=0,o=e.length;i1&&(r=e[1])):(e=v.map(B(e,!1,!1),String),n=function(t,r){return!v.contains(e,r)}),v.pick(t,n,r)})),v.defaults=F(v.allKeys,!0),v.create=function(t,e){var r=M(t);return e&&v.extendOwn(r,e),r},v.clone=function(t){return v.isObject(t)?v.isArray(t)?t.slice():v.extend({},t):t},v.tap=function(t,e){return e(t),t},v.isMatch=function(t,e){var r=v.keys(e),n=r.length;if(null==t)return!n;for(var i=Object(t),o=0;o":">",'"':""","'":"'","`":"`"},G=v.invert(V),K=function(t){var e=function(e){return t[e]},r="(?:"+v.keys(t).join("|")+")",n=RegExp(r),i=RegExp(r,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(i,e):t}};v.escape=K(V),v.unescape=K(G),v.result=function(t,e,r){v.isArray(e)||(e=[e]);var n=e.length;if(!n)return v.isFunction(r)?r.call(t):r;for(var i=0;i/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var W=/(.)^/,Z={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},J=/\\|'|\r|\n|\u2028|\u2029/g,X=function(t){return"\\"+Z[t]};v.template=function(t,e,r){!e&&r&&(e=r),e=v.defaults({},e,v.templateSettings);var n,i=RegExp([(e.escape||W).source,(e.interpolate||W).source,(e.evaluate||W).source].join("|")+"|$","g"),o=0,a="__p+='";t.replace(i,(function(e,r,n,i,s){return a+=t.slice(o,s).replace(J,X),o=s+e.length,r?a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?a+="'+\n((__t=("+n+"))==null?'':__t)+\n'":i&&(a+="';\n"+i+"\n__p+='"),e})),a+="';\n",e.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{n=new Function(e.variable||"obj","_",a)}catch(t){throw t.source=a,t}var s=function(t){return n.call(this,t,v)},u=e.variable||"obj";return s.source="function("+u+"){\n"+a+"}",s},v.chain=function(t){var e=v(t);return e._chain=!0,e};var $=function(t,e){return t._chain?v(e).chain():e};v.mixin=function(t){return v.each(v.functions(t),(function(e){var r=v[e]=t[e];v.prototype[e]=function(){var t=[this._wrapped];return f.apply(t,arguments),$(this,r.apply(v,t))}})),v},v.mixin(v),v.each(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=a[t];v.prototype[t]=function(){var r=this._wrapped;return e.apply(r,arguments),"shift"!==t&&"splice"!==t||0!==r.length||delete r[0],$(this,r)}})),v.each(["concat","join","slice"],(function(t){var e=a[t];v.prototype[t]=function(){return $(this,e.apply(this._wrapped,arguments))}})),v.prototype.value=function(){return this._wrapped},v.prototype.valueOf=v.prototype.toJSON=v.prototype.value,v.prototype.toString=function(){return String(this._wrapped)},void 0===(n=function(){return v}.apply(e,[]))||(r.exports=n)}()}).call(this,r(7),r(23)(t))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.MISSING_NEW="MISSING_NEW",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.NUMERIC_FAULT="NUMERIC_FAULT",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,i=!1;function o(t,r,n){if(i)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var o=[];Object.keys(n).forEach((function(t){try{o.push(t+"="+JSON.stringify(n[t]))}catch(e){o.push(t+"="+JSON.stringify(n[t].toString()))}}));var a=t;o.length&&(t+=" ("+o.join(", ")+")");var s=new Error(t);throw s.reason=a,s.code=r,Object.keys(n).forEach((function(t){s[t]=n[t]})),s}e.throwError=o,e.checkNew=function(t,r){t instanceof r||o("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,n){n||(n=""),tr&&o("too many arguments"+n,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&o("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),i=!!t,n=!!r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=function(){function t(t){this.address=t}return t.prototype.allowance=function(t,e){return n.encodeFunctionCall("allowance(address,address)",t,e)},t.prototype.balanceOf=function(t){return n.encodeFunctionCall("balanceOf(address)",t)},t.prototype.totalSupply=function(){return n.encodeFunctionCall("totalSupply()")},t.prototype.approve=function(t,e){return n.encodeFunctionCall("approve(address,uint256)",t,e)},t}();e.ERC20=i},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function p(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(a=e[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[t];if(void 0===u)return!1;if("function"==typeof u)o(u,this,e);else{var f=u.length,h=m(u,f);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return p(this,t,!0)},s.prototype.rawListeners=function(t){return p(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):b.call(t,e)},s.prototype.listenerCount=b,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){(e=t.exports=r(45)).Stream=e,e.Readable=e,e.Writable=r(33),e.Duplex=r(11),e.Transform=r(48),e.PassThrough=r(89)},function(t,e,r){var n=r(2),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},function(t,e,r){"use strict";(function(e,n,i){var o=r(22);function a(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=g;var s,u=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?n:o.nextTick;g.WritableState=v;var f=Object.create(r(17));f.inherits=r(1);var h={deprecate:r(88)},c=r(46),l=r(32).Buffer,d=i.Uint8Array||function(){};var p,b=r(47);function m(){}function v(t,e){s=s||r(11),t=t||{};var n=e instanceof s;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,f=t.writableHighWaterMark,h=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(f||0===f)?f:h,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 c=!1===t.decodeStrings;this.decodeStrings=!c,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(o.nextTick(i,n),o.nextTick(E,t,e),t._writableState.errorEmitted=!0,t.emit("error",n)):(i(n),t._writableState.errorEmitted=!0,t.emit("error",n),E(t,e))}(t,r,n,e,i);else{var a=M(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||w(t,r),n?u(_,t,r,a,i):_(t,r,a,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function g(t){if(s=s||r(11),!(p.call(g,this)||this instanceof s))return new g(t);this._writableState=new v(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),c.call(this)}function y(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function _(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),E(t,e)}function w(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,y(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new a(e),e.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,h=r.encoding,c=r.callback;if(y(t,e,!1,e.objectMode?1:f.length,f,h,c),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function M(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function A(t,e){t._final((function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),E(t,e)}))}function E(t,e){var r=M(e);return r&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(A,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}f.inherits(g,c),v.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(v.prototype,"buffer",{get:h.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(t){return!!p.call(this,t)||this===g&&(t&&t._writableState instanceof v)}})):p=function(t){return t instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(t,e,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=t,l.isBuffer(n)||n instanceof d);return s&&!l.isBuffer(t)&&(t=function(t){return l.from(t)}(t)),"function"==typeof e&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=m),i.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),o.nextTick(e,r)}(this,r):(s||function(t,e,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(t.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,t,r))&&(i.pendingcb++,a=function(t,e,r,n,i,o){if(!r){var a=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=l.from(e,r));return e}(e,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=e.objectMode?1:n.length;e.length+=s;var u=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(t,e,r){e.ending=!0,E(t,e),r&&(e.finished?o.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),g.prototype.destroy=b.destroy,g.prototype._undestroy=b.undestroy,g.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,r(10),r(86).setImmediate,r(7))},function(t,e,r){"use strict";var n=r(4).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=f,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=h,this.end=c,e=3;break;default:return this.write=l,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function f(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function h(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,r){"use strict";var n,i=e,o=r(36),a=r(53),s=r(5).assert;function u(t){"short"===t.type?this.curve=new a.short(t):"edwards"===t.type?this.curve=new a.edwards(t):this.curve=new a.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function f(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new u(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,f("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"]}),f("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"]}),f("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"]}),f("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"]}),f("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"]}),f("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"]}),f("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(114)}catch(t){n=void 0}f("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(t,e,r){var n=e;n.utils=r(9),n.common=r(18),n.sha=r(108),n.ripemd=r(112),n.hmac=r(113),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(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var n=r(3);function i(t,e){if("00"===t.slice(0,2))throw new Error("invalid RLP: extra zeros");return parseInt(t,e)}function o(e,r){if(e<56)return t.from([e+r]);var n=s(e),i=s(r+55+n.length/2);return t.from(i+n,"hex")}function a(t){return"0x"===t.slice(0,2)}function s(t){if(t<0)throw new Error("Invalid integer as argument, must be unsigned!");var e=t.toString(16);return e.length%2?"0"+e:e}function u(e){if(!t.isBuffer(e)){if("string"==typeof e)return a(e)?t.from((i="string"!=typeof(o=e)?o:a(o)?o.slice(2):o).length%2?"0"+i:i,"hex"):t.from(e);if("number"==typeof e)return e?(r=s(e),t.from(r,"hex")):t.from([]);if(null==e)return t.from([]);if(e instanceof Uint8Array)return t.from(e);if(n.isBN(e))return t.from(e.toArray());throw new Error("invalid type")}var r,i,o;return e}e.encode=function e(r){if(Array.isArray(r)){for(var n=[],i=0;ir.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(s=r.slice(o,c)).length)throw new Error("invalid rlp, List has a invalid length");for(;s.length;)u=e(s),f.push(u.data),s=u.remainder;return{data:f,remainder:r.slice(c)}}(u(e));if(r)return n;if(0!==n.remainder.length)throw new Error("invalid remainder");return n.data},e.getLength=function(e){if(!e||0===e.length)return t.from([]);var r=u(e),n=r[0];if(n<=127)return r.length;if(n<=183)return n-127;if(n<=191)return n-182;if(n<=247)return n-191;var o=n-246;return o+i(r.slice(1,o).toString("hex"),16)}}).call(this,r(2).Buffer)},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var n=r(128),i=r(43),o=r(19),a=r(37),s=r(20);e.keccak=function(e,r){return void 0===r&&(r=256),e="string"!=typeof e||o.isHexString(e)?s.toBuffer(e):t.from(e,"utf8"),r||(r=256),n("keccak"+r).update(e).digest()},e.keccak256=function(t){return e.keccak(t)},e.sha256=function(t){return t=s.toBuffer(t),i("sha256").update(t).digest()},e.ripemd160=function(t,e){t=s.toBuffer(t);var r=i("rmd160").update(t).digest();return!0===e?s.setLength(r,32):r},e.rlphash=function(t){return e.keccak(a.encode(t))}}).call(this,r(2).Buffer)},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},function(t,e,r){"use strict";(function(e,n){var i=r(22);t.exports=y;var o,a=r(41);y.ReadableState=g;r(30).EventEmitter;var s=function(t,e){return t.listeners(e).length},u=r(46),f=r(32).Buffer,h=e.Uint8Array||function(){};var c=Object.create(r(17));c.inherits=r(1);var l=r(83),d=void 0;d=l&&l.debuglog?l.debuglog("stream"):function(){};var p,b=r(84),m=r(47);c.inherits(y,u);var v=["error","close","destroy","pause","resume"];function g(t,e){t=t||{};var n=e instanceof(o=o||r(11));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,a=t.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new 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=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=r(34).StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function y(t){if(o=o||r(11),!(this instanceof y))return new y(t);this._readableState=new g(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),u.call(this)}function _(t,e,r,n,i){var o,a=t._readableState;null===e?(a.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,A(t)}(t,a)):(i||(o=function(t,e){var r;n=e,f.isBuffer(n)||n instanceof h||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(a,e)),o?t.emit("error",o):a.objectMode||e&&e.length>0?("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===f.prototype||(e=function(t){return f.from(t)}(e)),n?a.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):w(t,a,e,!0):a.ended?t.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?w(t,a,e,!1):S(t,a)):w(t,a,e,!1))):n||(a.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=8388608?t=8388608:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function A(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(d("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(E,t):E(t))}function E(t){d("emit readable"),t.emit("readable"),T(t)}function S(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(x,t,e))}function x(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;to.length?o.length:t;if(a===o.length?i+=o:i+=o.slice(0,t),0===(t-=a)){a===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=f.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,a),0===(t-=a)){a===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(a));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function P(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(B,e,t))}function B(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function C(t,e){for(var r=0,n=t.length;r=e.highWaterMark||e.ended))return d("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?P(this):A(this),null;if(0===(t=M(t,e))&&e.ended)return 0===e.length&&P(this),null;var n,i=e.needReadable;return d("need readable",i),(0===e.length||e.length-t0?O(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&P(this)),null!==n&&this.emit("data",n),n},y.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},y.prototype.pipe=function(t,e){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?h:y;function f(e,n){d("onunpipe"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d("cleanup"),t.removeListener("close",v),t.removeListener("finish",g),t.removeListener("drain",c),t.removeListener("error",m),t.removeListener("unpipe",f),r.removeListener("end",h),r.removeListener("end",y),r.removeListener("data",b),l=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}function h(){d("onend"),t.end()}o.endEmitted?i.nextTick(u):r.once("end",u),t.on("unpipe",f);var c=function(t){return function(){var e=t._readableState;d("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,T(t))}}(r);t.on("drain",c);var l=!1;var p=!1;function b(e){d("ondata"),p=!1,!1!==t.write(e)||p||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==C(o.pipes,t))&&!l&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function m(e){d("onerror",e),y(),t.removeListener("error",m),0===s(t,"error")&&t.emit("error",e)}function v(){t.removeListener("finish",g),y()}function g(){d("onfinish"),t.removeListener("close",v),y()}function y(){d("unpipe"),r.unpipe(t)}return r.on("data",b),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?a(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",m),t.once("close",v),t.once("finish",g),t.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),t},y.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function l(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,p=0|this._f,b=0|this._g,m=0|this._h,v=0;v<16;++v)r[v]=t.readInt32BE(4*v);for(;v<64;++v)r[v]=0|(((e=r[v-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[v-7]+d(r[v-15])+r[v-16];for(var g=0;g<64;++g){var y=m+l(u)+f(u,p,b)+a[g]+r[g]|0,_=c(n)+h(n,i,o)|0;m=b,b=p,p=u,u=s+y|0,s=o,o=i,i=n,n=y+_|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 t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=u},function(t,e,r){var n=r(1),i=r(15),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 f(t,e,r){return r^t&(e^r)}function h(t,e,r){return t&e|r&(t|e)}function c(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function l(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function b(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function m(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function v(t,e){return t>>>0>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,u=0|this._fh,g=0|this._gh,y=0|this._hh,_=0|this._al,w=0|this._bl,M=0|this._cl,A=0|this._dl,E=0|this._el,S=0|this._fl,x=0|this._gl,I=0|this._hl,k=0;k<32;k+=2)e[k]=t.readInt32BE(4*k),e[k+1]=t.readInt32BE(4*k+4);for(;k<160;k+=2){var T=e[k-30],O=e[k-30+1],P=d(T,O),B=p(O,T),C=b(T=e[k-4],O=e[k-4+1]),N=m(O,T),R=e[k-14],D=e[k-14+1],L=e[k-32],j=e[k-32+1],F=B+D|0,U=P+R+v(F,B)|0;U=(U=U+C+v(F=F+N|0,N)|0)+L+v(F=F+j|0,j)|0,e[k]=U,e[k+1]=F}for(var z=0;z<160;z+=2){U=e[z],F=e[z+1];var q=h(r,n,i),H=h(_,w,M),V=c(r,_),G=c(_,r),K=l(s,E),Y=l(E,s),W=a[z],Z=a[z+1],J=f(s,u,g),X=f(E,S,x),$=I+Y|0,Q=y+K+v($,I)|0;Q=(Q=(Q=Q+J+v($=$+X|0,X)|0)+W+v($=$+Z|0,Z)|0)+U+v($=$+F|0,F)|0;var tt=G+H|0,et=V+q+v(tt,G)|0;y=g,I=x,g=u,x=S,u=s,S=E,s=o+Q+v(E=A+$|0,A)|0,o=i,A=M,i=n,M=w,n=r,w=_,r=Q+et+v(_=$+tt|0,$)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+M|0,this._dl=this._dl+A|0,this._el=this._el+E|0,this._fl=this._fl+S|0,this._gl=this._gl+x|0,this._hl=this._hl+I|0,this._ah=this._ah+r+v(this._al,_)|0,this._bh=this._bh+n+v(this._bl,w)|0,this._ch=this._ch+i+v(this._cl,M)|0,this._dh=this._dh+o+v(this._dl,A)|0,this._eh=this._eh+s+v(this._el,E)|0,this._fh=this._fh+u+v(this._fl,S)|0,this._gh=this._gh+g+v(this._gl,x)|0,this._hh=this._hh+y+v(this._hl,I)|0},u.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=u},function(t,e,r){"use strict";var n=e;function i(t){return 1===t.length?"0"+t:t}function o(t){for(var e="",r=0;r>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(t,e){return"hex"===e?o(t):t}},function(t,e,r){var n;function i(t){this.rand=t}if(t.exports=function(t){return n||(n=new i(null)),n.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},function(t,e,r){"use strict";var n=r(9),i=r(18),o=r(54),a=r(12),s=n.sum32,u=n.sum32_4,f=n.sum32_5,h=o.ch32,c=o.maj32,l=o.s0_256,d=o.s1_256,p=o.g0_256,b=o.g1_256,m=i.BlockHash,v=[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 g(){if(!(this instanceof g))return new g;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=v,this.W=new Array(64)}n.inherits(g,m),t.exports=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n * @license MIT */function i(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i=0;f--)if(h[f]!==c[f])return!1;for(f=h.length-1;f>=0;f--)if(s=h[f],!y(t[s],e[s],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function _(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function w(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function M(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&v(i,r,"Missing expected exception"+n);var o="string"==typeof n,s=!t&&i&&!r;if((!t&&a.isError(i)&&o&&w(i,r)||s)&&v(i,r,"Got unwanted exception"+n),t&&i&&r&&!w(i,r)||!t&&i)throw i}l.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return b(m(t.actual),128)+" "+t.operator+" "+b(m(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||v;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=p(e),o=n.indexOf("\n"+i);if(o>=0){var a=n.indexOf("\n",o+1);n=n.substring(a+1)}this.stack=n}}},a.inherits(l.AssertionError,Error),l.fail=v,l.ok=g,l.equal=function(t,e,r){t!=e&&v(t,e,r,"==",l.equal)},l.notEqual=function(t,e,r){t==e&&v(t,e,r,"!=",l.notEqual)},l.deepEqual=function(t,e,r){y(t,e,!1)||v(t,e,r,"deepEqual",l.deepEqual)},l.deepStrictEqual=function(t,e,r){y(t,e,!0)||v(t,e,r,"deepStrictEqual",l.deepStrictEqual)},l.notDeepEqual=function(t,e,r){y(t,e,!1)&&v(t,e,r,"notDeepEqual",l.notDeepEqual)},l.notDeepStrictEqual=function t(e,r,n){y(e,r,!0)&&v(e,r,n,"notDeepStrictEqual",t)},l.strictEqual=function(t,e,r){t!==e&&v(t,e,r,"===",l.strictEqual)},l.notStrictEqual=function(t,e,r){t===e&&v(t,e,r,"!==",l.notStrictEqual)},l.throws=function(t,e,r){M(!0,t,e,r)},l.doesNotThrow=function(t,e,r){M(!1,t,e,r)},l.ifError=function(t){if(t)throw t},l.strict=n((function t(e,r){e||v(e,!0,r,"==",t)}),l,{equal:l.strictEqual,deepEqual:l.deepStrictEqual,notEqual:l.notStrictEqual,notDeepEqual:l.notDeepStrictEqual}),l.strict.strict=l.strict;var A=Object.keys||function(t){var e=[];for(var r in t)s.call(t,r)&&e.push(r);return e}}).call(this,r(7))},function(t,e,r){var n=r(140),i=r(58);t.exports=function(t){if("string"==typeof t||"number"==typeof t){var e=new n(1),r=String(t).toLowerCase().trim(),o="0x"===r.substr(0,2)||"-0x"===r.substr(0,3),a=i(r);if("-"===a.substr(0,1)&&(a=i(a.slice(1)),e=new n(-1,10)),!(a=""===a?"0":a).match(/^-?[0-9]+$/)&&a.match(/^[0-9A-Fa-f]+$/)||a.match(/^[a-fA-F]+$/)||!0===o&&a.match(/^[0-9A-Fa-f]+$/))return new n(a,16).mul(e);if((a.match(/^-?[0-9]+$/)||""===a)&&!1===o)return new n(a,10).mul(e)}else if("object"==typeof t&&t.toString&&!t.pop&&!t.push&&t.toString(10).match(/^-?[0-9]+$/)&&(t.mul||t.dividedToIntegerBy))return new n(t.toString(10),10);throw new Error("[number-to-bn] while converting number "+JSON.stringify(t)+" to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.")}},function(t,e,r){(function(e){var n=r(25),i=r(3),o=r(60),a=r(141),s=r(142),u=r(143),f=function(t){return i.isBN(t)},h=function(t){return t&&t.constructor&&"BigNumber"===t.constructor.name},c=function(t){try{return o.apply(null,arguments)}catch(e){throw new Error(e+' Given value: "'+t+'"')}},l=function(t){return!!/^(0x)?[0-9a-f]{40}$/i.test(t)&&(!(!/^(0x|0X)?[0-9a-f]{40}$/.test(t)&&!/^(0x|0X)?[0-9A-F]{40}$/.test(t))||d(t))},d=function(t){t=t.replace(/^0x/i,"");for(var e=y(t.toLowerCase()).replace(/^0x/i,""),r=0;r<40;r++)if(parseInt(e[r],16)>7&&t[r].toUpperCase()!==t[r]||parseInt(e[r],16)<=7&&t[r].toLowerCase()!==t[r])return!1;return!0},p=function(t){var e="";t=(t=(t=(t=(t=a.encode(t)).replace(/^(?:\u0000)*/,"")).split("").reverse().join("")).replace(/^(?:\u0000)*/,"")).split("").reverse().join("");for(var r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return"0x"+e.join("")},isHex:function(t){return(n.isString(t)||n.isNumber(t))&&/^(-0x|0x)?[0-9a-f]*$/i.test(t)},isHexStrict:v,leftPad:function(t,e,r){var n=/^0x/i.test(t)||"number"==typeof t,i=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(i).join(r||"0")+t},rightPad:function(t,e,r){var n=/^0x/i.test(t)||"number"==typeof t,i=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(i).join(r||"0")},toTwosComplement:function(t){return"0x"+c(t).toTwos(256).toString(16,64)},sha3:y,sha3Raw:function(t){return null===(t=y(t))?g:t}}}).call(this,r(2).Buffer)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){};e.BigNumber=n;var i=function(){};e.Indexed=i;var o=function(){};e.MinimalProvider=o;var a=function(){};e.Signer=a;var s=function(){};e.HDNode=s},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defineReadOnly=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})},e.defineFrozen=function(t,e,r){var n=JSON.stringify(r);Object.defineProperty(t,e,{enumerable:!0,get:function(){return JSON.parse(n)}})},e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach((function(n){var i=t[n];i instanceof Promise?r.push(i.then((function(t){return e[n]=t,null}))):e[n]=i})),Promise.all(r).then((function(){return e}))},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e},e.jsonCopy=function(t){return JSON.parse(JSON.stringify(t))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(65);e.Transaction=n.default;var i=r(175);e.FakeTransaction=i.default},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r=2*this.getChainId()+35&&this._common.gteHardfork("spuriousDragon");this._senderPubKey=i.ecrecover(t,e,this.r,this.s,r?this.getChainId():void 0)}catch(t){return!1}return!!this._senderPubKey},t.prototype.sign=function(t){this.v=new a.Buffer([]),this.s=new a.Buffer([]),this.r=new a.Buffer([]);var e=this.hash(!1),r=i.ecsign(e,t);this._implementsEIP155()&&(r.v+=2*this.getChainId()+8),Object.assign(this,r)},t.prototype.getDataFee=function(){for(var t=this.raw[5],e=new i.BN(0),r=0;r0&&e.push(["gas limit is too low. Need at least "+this.getBaseFee()]),!1===t?0===e.length:e.join(" ")},t.prototype.serialize=function(){return i.rlp.encode(this.raw)},t.prototype.toJSON=function(t){return void 0===t&&(t=!1),{}},t.prototype._validateV=function(t){if(void 0!==t&&0!==t.length&&this._common.gteHardfork("spuriousDragon")){var e=i.bufferToInt(t);if(27!==e&&28!==e)if(!(e===2*this.getChainId()+35||e===2*this.getChainId()+36))throw new Error("Incompatible EIP155-based V "+e+" and chain id "+this.getChainId()+". See the second parameter of the Transaction constructor to set the chain id.")}},t.prototype._isSigned=function(){return this.v.length>0&&this.r.length>0&&this.s.length>0},t.prototype._overrideVSetterWithValidation=function(){var t=this,e=Object.getOwnPropertyDescriptor(this,"v");Object.defineProperty(this,"v",n({},e,{set:function(r){void 0!==r&&t._validateV(i.toBuffer(r)),e.set(r)}}))},t.prototype._implementsEIP155=function(){var t=this._common.gteHardfork("spuriousDragon");if(!this._isSigned())return t;var e=i.bufferToInt(this.v);return(e===2*this.getChainId()+35||e===2*this.getChainId()+36)&&t},t}();e.default=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.loadAssets=function(t){return{ETH:t.contracts.ETH,DAI:t.contracts.DAI,USDC:t.contracts.USDC,WBTC:t.contracts.WBTC,CDAI:t.contracts.CDAI,CUSDC:t.contracts.CUSDC,CWBTC:t.contracts.CWBTC,CETH:t.contracts.CETH,WETH:t.contracts.WETH}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(194),i=r(197),o=function(t,e,r){this.config=t,this.address=e,this.account=r,this.query=new n.Query(this.address,this.account),this.actions=new i.Actions(this.address,this.account)};e.Fund=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(198),i=r(199),o=function(t,e,r){this.config=t,this.address=e,this.account=r,this.query=new n.Query(this.address,this.account),this.actions=new i.Actions(this.address,this.account)};e.Portfolio=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=function(){function t(t){this.address=t}return t.prototype.isOwner=function(t){return n.encodeFunctionCall("isPortfolioOwner(address)",t)},t.prototype.isMainOwner=function(t){return n.encodeFunctionCall("isPortfolioMainOwner(address)",t)},t.prototype.addOwner=function(t){return n.encodeFunctionCall("addPortfolioOwner(address)",t)},t.prototype.removeOwner=function(t){return n.encodeFunctionCall("removePortfolioOwner(address)",t)},t.prototype.withdraw=function(t,e,r){return n.encodeFunctionCall("withdraw(address[],uint256[],address)",t,e,r)},t}();e.Portfolio=i},function(t,e,r){t.exports=r(71)},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(72),o=r(74),a=r(66),s=r(182),u=r(192),f=r(200),h=n(r(13));function c(t,e){var r=i.loadConfig(e),n=o.loadAccount(r,t);return{Assets:a.loadAssets(r),Operations:s.loadOperations(r,n),query:new u.Query(r,n),actions:new f.Actions(r,n),account:n,address:n.address,JSBI:h.default}}e.Defire=c,t.exports=c},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(73),i=r(6);e.loadConfig=function(t){if(!t)throw new i.InvalidRinkebyConfigurationError;if(t&&t.network){if("rinkeby"==t.network)return Object.assign(n.config,t);if("development"==t.network)return t}throw new i.InvalidRinkebyConfigurationError}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.config={provider:"https://rinkeby.infura.io/v3/16a0047fb26c46498ffb464f22567147",gasPrice:2e9,gasLimit:45e5,contracts:{ETH:"0x0000000000000000000000000000000000000000",DAI:"0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa",WETH:"0xc778417E063141139Fce010982780140Aa0cD5Ab",USDC:"0x4DBCdF9B62e891a7cec5A2568C3F4FAF9E8Abe2b",WBTC:"0x577D296678535e4903D59A4C929B718e1D575e0A",CDAI:"0x6D7F0754FFeb405d23C51CE938289d4835bE3b14",CUSDC:"0x5B281A6DdA0B271e91ae35DE655Ad301C976edb1",CWBTC:"0x0014F450B8Ae7708593F4A46F8fa6E5D50620F96",CETH:"0xd6801a1DfFCd0a410336Ef88DeF4320D6DF1883e",UNISWAP_EXCHANGE_DAI_ETH:"0xaF51BaAA766b65E8B3Ee0C2c33186325ED01eBD5",UNISWAP_EXCHANGE_USDC_ETH:"0x693967a12952E2da9486f4A9fB286cacDdbA4f6a",UNISWAP_EXCHANGE_WBTC_ETH:"0xA877a64c1d419E4FBf74fEB0E44b520C0bC03bf7",FUND_REGISTRY:"0x6018F287Df3B95fE0De85Ef88Af43fBd68396BBa",OPERATION_REGISTRY:"0x8ec824eDc622545D570F02f2B5DB9193BA8a8694",ASSET_REGISTRY:"0x60fa9d9202e45E8fC922Ddf8d622Aa1489bF6713",PORTFOLIO_FACTORY:"0xBF4bfeDe2575d39CF1f0C4a5F110a7185FfcB767",FUND_FACTORY:"0x97dfC845F05c97EAED77CA63F6923AEA48a9F3cD",DEFIRE_ACCOUNT:"0x597806FAbdBAaF8208ac5F93AFdC7bF16d3d0500",OP_COMPOUND_CETH_TO_ETH:"0x34f2410b4A3D8627a6aC1a18BA5E741720547ed6",OP_COMPOUND_ETH_TO_CETH:"0xaf0B90B22625aB1B50E41F734Ce20609B61F852A",OP_COMPOUND_CDAI_TO_DAI:"0x4c2Bd8AA633319f75f44c053dF183a843293D021",OP_COMPOUND_DAI_TO_CDAI:"0xa1cFC9116dB2e5Cd00Fa2492fdB4340390b0a0E3",OP_COMPOUND_CUSDC_TO_USDC:"0x3e22c31d6A14F778A6E6E4571655Dde923272a11",OP_COMPOUND_USDC_TO_CUSDC:"0xC31A5088D89F7A3640D1Ae210e53EA3E386A48C9",OP_COMPOUND_CWBTC_TO_WBTC:"0x6771f2EA104125B6267D27023dc45Ee96E142e28",OP_COMPOUND_WBTC_TO_CWBTC:"0xD3B2953F8Cb3A6d5b253bd69af70A596B3BAEb8B",OP_UNISWAP_DAI_TO_ETH:"0x000Ed6ae0008500Ed3f700a5bb43d8ddabEBD7d0",OP_UNISWAP_ETH_TO_DAI:"0x26B28b552069489d063F4Cf1FB30483Ff3fD49B4",OP_UNISWAP_USDC_TO_ETH:"0x3E990E6F44d93262ec9F32bBf5808a864EF752f8",OP_UNISWAP_ETH_TO_USDC:"0xAD54EDb1788A890cc19017cB99642b71B5Ed1DC9",OP_UNISWAP_WBTC_TO_ETH:"0x84b64953F8936eAB9E2C6D71db23BCe808d6F60f",OP_UNISWAP_ETH_TO_WBTC:"0x74368B7Ea63B4fFf13652286C7ED3c1c8b31A015",OP_WRAP_ETH:"0xd5799cDa6F5cBDCea4524d931EF810f2D5998065",OP_UNWRAP_ETH:"0x8B7459E73966366029d8950f5711206BbfcfadFf",OP_FUND_DEPOSIT_WITHDRAW:"0x09D51Db0D7F722590b7d60Bc0B1f7EC7c52918E5"}}},function(t,e,r){"use strict";(function(t){var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(8)),o=r(0),a=r(6),s=r(156),u=r(178),f=r(179),h=r(180),c=r(181);e.loadAccountFromConnector=function(t,e,r){if("function"==typeof e.sign&&"function"==typeof e.send){if(i.isValidAddress(r))return new c.ConnectorAccount(t,e,i.toChecksumAddress(r));throw new a.InvalidAddress}throw new a.InvalidConnector},e.loadAccount=function(r,n){if(o.hasField(n,"privateKey"))return function(e,r,n){var u=o.stripHexPrefix(r);if(i.isValidPrivate(t.from(u,"hex")))return new s.PrivateKeyAccount(e,u,n);throw new a.InvalidPrivateKeyError}(r,n.privateKey,n.provider);if(o.hasField(n,"web3js"))return function(t,e,r){if(i.isValidAddress(r))return new u.Web3jsAccount(t,e,i.toChecksumAddress(r));throw new a.InvalidAddress}(r,n.web3js,n.address);if(o.hasField(n,"ethersjs"))return function(t,e,r){if(i.isValidAddress(r))return new f.EthersjsAccount(t,e,i.toChecksumAddress(r));throw new a.InvalidAddress}(r,n.ethersjs,n.address);if(o.hasField(n,"ethjs"))return function(t,e,r){if(i.isValidAddress(r))return new h.EthjsAccount(t,e,i.toChecksumAddress(r));throw new a.InvalidAddress}(r,n.ethjs,n.address);if(o.hasField(n,"connector"))return e.loadAccountFromConnector(r,n.connector,n.address);throw new Error("Invalid intialization params")}}).call(this,r(2).Buffer)},function(t,e,r){"use strict";e.byteLength=function(t){var e=f(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=f(t),a=n[0],s=n[1],u=new o(function(t,e,r){return 3*(e+r)/4-r}(0,a,s)),h=0,c=s>0?a-4:a;for(r=0;r>16&255,u[h++]=e>>8&255,u[h++]=255&e;2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[h++]=255&e);1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[h++]=e>>8&255,u[h++]=255&e);return u},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function h(t,e,r){for(var i,o,a=[],s=e;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,h=-7,c=r?i-1:0,l=r?-1:1,d=t[e+c];for(c+=l,o=d&(1<<-h)-1,d>>=-h,h+=s;h>0;o=256*o+t[e+c],c+=l,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=256*a+t[e+c],c+=l,h-=8);if(0===o)o=1-f;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=f}return(d?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,u,f=8*o-i-1,h=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+c>=1?l/u:l*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=h?(s=0,a=h):a+c>=1?(s=(e*u-1)*Math.pow(2,i),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;t[r+d]=255&a,d+=p,a/=256,f-=8);t[r+d-p]|=128*b}},function(t,e,r){"use strict";var n=r(78),i=r(79),o=r(42);function a(t,e){return void 0===t?e:(n.isBoolean(t,o.COMPRESSED_TYPE_INVALID),t)}t.exports=function(t){return{privateKeyVerify:function(e){return n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),32===e.length&&t.privateKeyVerify(e)},privateKeyExport:function(e,r){n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(e,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),r=a(r,!0);var s=t.privateKeyExport(e,r);return i.privateKeyExport(e,s,r)},privateKeyImport:function(e){if(n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),(e=i.privateKeyImport(e))&&32===e.length&&t.privateKeyVerify(e))return e;throw new Error(o.EC_PRIVATE_KEY_IMPORT_DER_FAIL)},privateKeyNegate:function(e){return n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(e,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),t.privateKeyNegate(e)},privateKeyModInverse:function(e){return n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(e,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),t.privateKeyModInverse(e)},privateKeyTweakAdd:function(e,r){return n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(e,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),t.privateKeyTweakAdd(e,r)},privateKeyTweakMul:function(e,r){return n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(e,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),t.privateKeyTweakMul(e,r)},publicKeyCreate:function(e,r){return n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(e,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),r=a(r,!0),t.publicKeyCreate(e,r)},publicKeyConvert:function(e,r){return n.isBuffer(e,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(e,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),r=a(r,!0),t.publicKeyConvert(e,r)},publicKeyVerify:function(e){return n.isBuffer(e,o.EC_PUBLIC_KEY_TYPE_INVALID),t.publicKeyVerify(e)},publicKeyTweakAdd:function(e,r,i){return n.isBuffer(e,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(e,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),i=a(i,!0),t.publicKeyTweakAdd(e,r,i)},publicKeyTweakMul:function(e,r,i){return n.isBuffer(e,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(e,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),i=a(i,!0),t.publicKeyTweakMul(e,r,i)},publicKeyCombine:function(e,r){n.isArray(e,o.EC_PUBLIC_KEYS_TYPE_INVALID),n.isLengthGTZero(e,o.EC_PUBLIC_KEYS_LENGTH_INVALID);for(var i=0;i=r)throw RangeError(n)}}).call(this,r(2).Buffer)},function(t,e,r){"use strict";var n=r(4).Buffer,i=r(80),o=n.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,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,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),a=n.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,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,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);e.privateKeyExport=function(t,e,r){var i=n.from(r?o:a);return t.copy(i,r?8:9),e.copy(i,r?181:214),i},e.privateKeyImport=function(t){var e=t.length,r=0;if(!(e2||e1?t[r+n-2]<<8:0);if(!(e<(r+=n)+i||e32||e1&&0===e[o]&&!(128&e[o+1]);--r,++o);for(var a=n.concat([n.from([0]),t.s]),s=33,u=0;s>1&&0===a[u]&&!(128&a[u+1]);--s,++u);return i.encode(e.slice(o),a.slice(u))},e.signatureImport=function(t){var e=n.alloc(32,0),r=n.alloc(32,0);try{var o=i.decode(t);if(33===o.r.length&&0===o.r[0]&&(o.r=o.r.slice(1)),o.r.length>32)throw new Error("R length is too long");if(33===o.s.length&&0===o.s[0]&&(o.s=o.s.slice(1)),o.s.length>32)throw new Error("S length is too long")}catch(t){return}return o.r.copy(e,32-o.r.length),o.s.copy(r,32-o.s.length),{r:e,s:r}},e.signatureImportLax=function(t){var e=n.alloc(32,0),r=n.alloc(32,0),i=t.length,o=0;if(48===t[o++]){var a=t[o++];if(!(128&a&&(o+=a-128)>i)&&2===t[o++]){var s=t[o++];if(128&s){if(o+(a=s-128)>i)return;for(;a>0&&0===t[o];o+=1,a-=1);for(s=0;a>0;o+=1,a-=1)s=(s<<8)+t[o]}if(!(s>i-o)){var u=o;if(o+=s,2===t[o++]){var f=t[o++];if(128&f){if(o+(a=f-128)>i)return;for(;a>0&&0===t[o];o+=1,a-=1);for(f=0;a>0;o+=1,a-=1)f=(f<<8)+t[o]}if(!(f>i-o)){var h=o;for(o+=f;s>0&&0===t[u];s-=1,u+=1);if(!(s>32)){var c=t.slice(u,u+s);for(c.copy(e,32-c.length);f>0&&0===t[h];f-=1,h+=1);if(!(f>32)){var l=t.slice(h,h+f);return l.copy(r,32-l.length),{r:e,s:r}}}}}}}}}},function(t,e,r){var n=r(4).Buffer;t.exports={check:function(t){if(t.length<8)return!1;if(t.length>72)return!1;if(48!==t[0])return!1;if(t[1]!==t.length-2)return!1;if(2!==t[2])return!1;var e=t[3];if(0===e)return!1;if(5+e>=t.length)return!1;if(2!==t[4+e])return!1;var r=t[5+e];return 0!==r&&(6+e+r===t.length&&(!(128&t[4])&&(!(e>1&&0===t[4]&&!(128&t[5]))&&(!(128&t[e+6])&&!(r>1&&0===t[e+6]&&!(128&t[e+7]))))))},decode:function(t){if(t.length<8)throw new Error("DER sequence length is too short");if(t.length>72)throw new Error("DER sequence length is too long");if(48!==t[0])throw new Error("Expected DER sequence");if(t[1]!==t.length-2)throw new Error("DER sequence length is invalid");if(2!==t[2])throw new Error("Expected DER integer");var e=t[3];if(0===e)throw new Error("R length is zero");if(5+e>=t.length)throw new Error("R length is too long");if(2!==t[4+e])throw new Error("Expected DER integer (2)");var r=t[5+e];if(0===r)throw new Error("S length is zero");if(6+e+r!==t.length)throw new Error("S length is invalid");if(128&t[4])throw new Error("R value is negative");if(e>1&&0===t[4]&&!(128&t[5]))throw new Error("R value excessively padded");if(128&t[e+6])throw new Error("S value is negative");if(r>1&&0===t[e+6]&&!(128&t[e+7]))throw new Error("S value excessively padded");return{r:t.slice(4,4+e),s:t.slice(6+e)}},encode:function(t,e){var r=t.length,i=e.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&t[0])throw new Error("R value is negative");if(128&e[0])throw new Error("S value is negative");if(r>1&&0===t[0]&&!(128&t[1]))throw new Error("R value excessively padded");if(i>1&&0===e[0]&&!(128&e[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]=t.length,t.copy(o,4),o[4+r]=2,o[5+r]=e.length,e.copy(o,6+r),o}}},function(t,e,r){"use strict";var n=r(4).Buffer,i=r(43),o=r(3),a=r(102).ec,s=r(42),u=new a("secp256k1"),f=u.curve;function h(t){var e=t[0];switch(e){case 2:case 3:return 33!==t.length?null:function(t,e){var r=new o(e);if(r.cmp(f.p)>=0)return null;var n=(r=r.toRed(f.red)).redSqr().redIMul(r).redIAdd(f.b).redSqrt();return 3===t!==n.isOdd()&&(n=n.redNeg()),u.keyPair({pub:{x:r,y:n}})}(e,t.slice(1,33));case 4:case 6:case 7:return 65!==t.length?null:function(t,e,r){var n=new o(e),i=new o(r);if(n.cmp(f.p)>=0||i.cmp(f.p)>=0)return null;if(n=n.toRed(f.red),i=i.toRed(f.red),(6===t||7===t)&&i.isOdd()!==(7===t))return null;var a=n.redSqr().redIMul(n);return i.redSqr().redISub(a.redIAdd(f.b)).isZero()?u.keyPair({pub:{x:n,y:i}}):null}(e,t.slice(1,33),t.slice(33,65));default:return null}}e.privateKeyVerify=function(t){var e=new o(t);return e.cmp(f.n)<0&&!e.isZero()},e.privateKeyExport=function(t,e){var r=new o(t);if(r.cmp(f.n)>=0||r.isZero())throw new Error(s.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return n.from(u.keyFromPrivate(t).getPublic(e,!0))},e.privateKeyNegate=function(t){var e=new o(t);return e.isZero()?n.alloc(32):f.n.sub(e).umod(f.n).toArrayLike(n,"be",32)},e.privateKeyModInverse=function(t){var e=new o(t);if(e.cmp(f.n)>=0||e.isZero())throw new Error(s.EC_PRIVATE_KEY_RANGE_INVALID);return e.invm(f.n).toArrayLike(n,"be",32)},e.privateKeyTweakAdd=function(t,e){var r=new o(e);if(r.cmp(f.n)>=0)throw new Error(s.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(r.iadd(new o(t)),r.cmp(f.n)>=0&&r.isub(f.n),r.isZero())throw new Error(s.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return r.toArrayLike(n,"be",32)},e.privateKeyTweakMul=function(t,e){var r=new o(e);if(r.cmp(f.n)>=0||r.isZero())throw new Error(s.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);return r.imul(new o(t)),r.cmp(f.n)&&(r=r.umod(f.n)),r.toArrayLike(n,"be",32)},e.publicKeyCreate=function(t,e){var r=new o(t);if(r.cmp(f.n)>=0||r.isZero())throw new Error(s.EC_PUBLIC_KEY_CREATE_FAIL);return n.from(u.keyFromPrivate(t).getPublic(e,!0))},e.publicKeyConvert=function(t,e){var r=h(t);if(null===r)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);return n.from(r.getPublic(e,!0))},e.publicKeyVerify=function(t){return null!==h(t)},e.publicKeyTweakAdd=function(t,e,r){var i=h(t);if(null===i)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);if((e=new o(e)).cmp(f.n)>=0)throw new Error(s.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);var a=f.g.mul(e).add(i.pub);if(a.isInfinity())throw new Error(s.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return n.from(a.encode(!0,r))},e.publicKeyTweakMul=function(t,e,r){var i=h(t);if(null===i)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);if((e=new o(e)).cmp(f.n)>=0||e.isZero())throw new Error(s.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return n.from(i.pub.mul(e).encode(!0,r))},e.publicKeyCombine=function(t,e){for(var r=new Array(t.length),i=0;i=0||r.cmp(f.n)>=0)throw new Error(s.ECDSA_SIGNATURE_PARSE_FAIL);var i=n.from(t);return 1===r.cmp(u.nh)&&f.n.sub(r).toArrayLike(n,"be",32).copy(i,32),i},e.signatureExport=function(t){var e=t.slice(0,32),r=t.slice(32,64);if(new o(e).cmp(f.n)>=0||new o(r).cmp(f.n)>=0)throw new Error(s.ECDSA_SIGNATURE_PARSE_FAIL);return{r:e,s:r}},e.signatureImport=function(t){var e=new o(t.r);e.cmp(f.n)>=0&&(e=new o(0));var r=new o(t.s);return r.cmp(f.n)>=0&&(r=new o(0)),n.concat([e.toArrayLike(n,"be",32),r.toArrayLike(n,"be",32)])},e.sign=function(t,e,r,i){if("function"==typeof r){var a=r;r=function(r){var u=a(t,e,null,i,r);if(!n.isBuffer(u)||32!==u.length)throw new Error(s.ECDSA_SIGN_FAIL);return new o(u)}}var h=new o(e);if(h.cmp(f.n)>=0||h.isZero())throw new Error(s.ECDSA_SIGN_FAIL);var c=u.sign(t,e,{canonical:!0,k:r,pers:i});return{signature:n.concat([c.r.toArrayLike(n,"be",32),c.s.toArrayLike(n,"be",32)]),recovery:c.recoveryParam}},e.verify=function(t,e,r){var n={r:e.slice(0,32),s:e.slice(32,64)},i=new o(n.r),a=new o(n.s);if(i.cmp(f.n)>=0||a.cmp(f.n)>=0)throw new Error(s.ECDSA_SIGNATURE_PARSE_FAIL);if(1===a.cmp(u.nh)||i.isZero()||a.isZero())return!1;var c=h(r);if(null===c)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);return u.verify(t,n,{x:c.pub.x,y:c.pub.y})},e.recover=function(t,e,r,i){var a={r:e.slice(0,32),s:e.slice(32,64)},h=new o(a.r),c=new o(a.s);if(h.cmp(f.n)>=0||c.cmp(f.n)>=0)throw new Error(s.ECDSA_SIGNATURE_PARSE_FAIL);try{if(h.isZero()||c.isZero())throw new Error;var l=u.recoverPubKey(t,a,r);return n.from(l.encode(!0,i))}catch(t){throw new Error(s.ECDSA_RECOVER_FAIL)}},e.ecdh=function(t,r){var n=e.ecdhUnsafe(t,r,!0);return i("sha256").update(n).digest()},e.ecdhUnsafe=function(t,e,r){var i=h(t);if(null===i)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);var a=new o(e);if(a.cmp(f.n)>=0||a.isZero())throw new Error(s.ECDH_FAIL);return n.from(i.pub.mul(a).encode(!0,r))}},function(t,e,r){"use strict";var n=r(1),i=r(44),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(t,e){return t<>>32-e}function f(t,e,r,n,i,o,a){return u(t+(e&r|~e&n)+i+o|0,a)+e|0}function h(t,e,r,n,i,o,a){return u(t+(e&n|r&~n)+i+o|0,a)+e|0}function c(t,e,r,n,i,o,a){return u(t+(e^r^n)+i+o|0,a)+e|0}function l(t,e,r,n,i,o,a){return u(t+(r^(e|~n))+i+o|0,a)+e|0}n(s,i),s.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,o=this._d;r=f(r,n,i,o,t[0],3614090360,7),o=f(o,r,n,i,t[1],3905402710,12),i=f(i,o,r,n,t[2],606105819,17),n=f(n,i,o,r,t[3],3250441966,22),r=f(r,n,i,o,t[4],4118548399,7),o=f(o,r,n,i,t[5],1200080426,12),i=f(i,o,r,n,t[6],2821735955,17),n=f(n,i,o,r,t[7],4249261313,22),r=f(r,n,i,o,t[8],1770035416,7),o=f(o,r,n,i,t[9],2336552879,12),i=f(i,o,r,n,t[10],4294925233,17),n=f(n,i,o,r,t[11],2304563134,22),r=f(r,n,i,o,t[12],1804603682,7),o=f(o,r,n,i,t[13],4254626195,12),i=f(i,o,r,n,t[14],2792965006,17),r=h(r,n=f(n,i,o,r,t[15],1236535329,22),i,o,t[1],4129170786,5),o=h(o,r,n,i,t[6],3225465664,9),i=h(i,o,r,n,t[11],643717713,14),n=h(n,i,o,r,t[0],3921069994,20),r=h(r,n,i,o,t[5],3593408605,5),o=h(o,r,n,i,t[10],38016083,9),i=h(i,o,r,n,t[15],3634488961,14),n=h(n,i,o,r,t[4],3889429448,20),r=h(r,n,i,o,t[9],568446438,5),o=h(o,r,n,i,t[14],3275163606,9),i=h(i,o,r,n,t[3],4107603335,14),n=h(n,i,o,r,t[8],1163531501,20),r=h(r,n,i,o,t[13],2850285829,5),o=h(o,r,n,i,t[2],4243563512,9),i=h(i,o,r,n,t[7],1735328473,14),r=c(r,n=h(n,i,o,r,t[12],2368359562,20),i,o,t[5],4294588738,4),o=c(o,r,n,i,t[8],2272392833,11),i=c(i,o,r,n,t[11],1839030562,16),n=c(n,i,o,r,t[14],4259657740,23),r=c(r,n,i,o,t[1],2763975236,4),o=c(o,r,n,i,t[4],1272893353,11),i=c(i,o,r,n,t[7],4139469664,16),n=c(n,i,o,r,t[10],3200236656,23),r=c(r,n,i,o,t[13],681279174,4),o=c(o,r,n,i,t[0],3936430074,11),i=c(i,o,r,n,t[3],3572445317,16),n=c(n,i,o,r,t[6],76029189,23),r=c(r,n,i,o,t[9],3654602809,4),o=c(o,r,n,i,t[12],3873151461,11),i=c(i,o,r,n,t[15],530742520,16),r=l(r,n=c(n,i,o,r,t[2],3299628645,23),i,o,t[0],4096336452,6),o=l(o,r,n,i,t[7],1126891415,10),i=l(i,o,r,n,t[14],2878612391,15),n=l(n,i,o,r,t[5],4237533241,21),r=l(r,n,i,o,t[12],1700485571,6),o=l(o,r,n,i,t[3],2399980690,10),i=l(i,o,r,n,t[10],4293915773,15),n=l(n,i,o,r,t[1],2240044497,21),r=l(r,n,i,o,t[8],1873313359,6),o=l(o,r,n,i,t[15],4264355552,10),i=l(i,o,r,n,t[6],2734768916,15),n=l(n,i,o,r,t[13],1309151649,21),r=l(r,n,i,o,t[4],4149444226,6),o=l(o,r,n,i,t[11],3174756917,10),i=l(i,o,r,n,t[2],718787259,15),n=l(n,i,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=s},function(t,e){},function(t,e,r){"use strict";var n=r(32).Buffer,i=r(85);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var e,r,i,o=n.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,r=o,i=s,e.copy(r,i),s+=a.data.length,a=a.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,r){(function(t){var n=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(87),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(7))},function(t,e,r){(function(t,e){!function(t,r){"use strict";if(!t.setImmediate){var n,i,o,a,s,u=1,f={},h=!1,c=t.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(t);l=l&&l.setTimeout?l:t,"[object process]"==={}.toString.call(t.process)?n=function(t){e.nextTick((function(){p(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},n=function(t){o.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(i=c.documentElement,n=function(t){var e=c.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):n=function(t){setTimeout(p,0,t)}:(a="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&p(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),n=function(e){t.postMessage(a+e,"*")}),l.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r>>32-e}function b(t,e,r,n,i,o,a,s){return p(t+(e^r^n)+o+a|0,s)+i|0}function m(t,e,r,n,i,o,a,s){return p(t+(e&r|~e&n)+o+a|0,s)+i|0}function v(t,e,r,n,i,o,a,s){return p(t+((e|~r)^n)+o+a|0,s)+i|0}function g(t,e,r,n,i,o,a,s){return p(t+(e&n|r&~n)+o+a|0,s)+i|0}function y(t,e,r,n,i,o,a,s){return p(t+(e^(r|~n))+o+a|0,s)+i|0}i(d,o),d.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,d=0|this._e,_=0|this._a,w=0|this._b,M=0|this._c,A=0|this._d,E=0|this._e,S=0;S<80;S+=1){var x,I;S<16?(x=b(r,n,i,o,d,t[s[S]],c[0],f[S]),I=y(_,w,M,A,E,t[u[S]],l[0],h[S])):S<32?(x=m(r,n,i,o,d,t[s[S]],c[1],f[S]),I=g(_,w,M,A,E,t[u[S]],l[1],h[S])):S<48?(x=v(r,n,i,o,d,t[s[S]],c[2],f[S]),I=v(_,w,M,A,E,t[u[S]],l[2],h[S])):S<64?(x=g(r,n,i,o,d,t[s[S]],c[3],f[S]),I=m(_,w,M,A,E,t[u[S]],l[3],h[S])):(x=y(r,n,i,o,d,t[s[S]],c[4],f[S]),I=b(_,w,M,A,E,t[u[S]],l[4],h[S])),r=d,d=o,o=p(i,10),i=n,n=x,_=E,E=A,A=p(M,10),M=w,w=I}var k=this._b+i+A|0;this._b=this._c+o+E|0,this._c=this._d+d+_|0,this._d=this._e+r+w|0,this._e=this._a+n+M|0,this._a=k},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=n.alloc?n.alloc(20):new n(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=d},function(t,e,r){(e=t.exports=function(t){t=t.toLowerCase();var r=e[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r}).sha=r(96),e.sha1=r(97),e.sha224=r(98),e.sha256=r(49),e.sha384=r(99),e.sha512=r(50)},function(t,e,r){var n=r(1),i=r(15),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 f(t){return t<<30|t>>>2}function h(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,c=0;c<16;++c)r[c]=t.readInt32BE(4*c);for(;c<80;++c)r[c]=r[c-3]^r[c-8]^r[c-14]^r[c-16];for(var l=0;l<80;++l){var d=~~(l/20),p=0|((e=n)<<5|e>>>27)+h(d,i,o,s)+u+r[l]+a[d];u=s,s=o,o=f(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},function(t,e,r){var n=r(1),i=r(15),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 f(t){return t<<5|t>>>27}function h(t){return t<<30|t>>>2}function c(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,l=0;l<16;++l)r[l]=t.readInt32BE(4*l);for(;l<80;++l)r[l]=(e=r[l-3]^r[l-8]^r[l-14]^r[l-16])<<1|e>>>31;for(var d=0;d<80;++d){var p=~~(d/20),b=f(n)+c(p,i,o,s)+u+r[d]+a[p]|0;u=s,s=o,o=h(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 t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},function(t,e,r){var n=r(1),i=r(49),o=r(15),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 t=a.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=u},function(t,e,r){var n=r(1),i=r(50),o=r(15),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 t=a.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=u},function(t,e,r){var n=r(4).Buffer,i=r(21).Transform,o=r(34).StringDecoder;function a(t){i.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(1)(a,i),a.prototype.update=function(t,e,r){"string"==typeof t&&(t=n.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},a.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},a.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return t&&(e=this._toString(e,t,!0)),e},a.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},t.exports=a},function(t,e){},function(t,e,r){"use strict";var n=e;n.version=r(103).version,n.utils=r(5),n.rand=r(52),n.curve=r(53),n.curves=r(35),n.ec=r(115),n.eddsa=r(119)},function(t){t.exports=JSON.parse('{"name":"elliptic","version":"6.5.2","description":"EC cryptography","main":"lib/elliptic.js","files":["lib"],"scripts":{"jscs":"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js","jshint":"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js","lint":"npm run jscs && npm run jshint","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 ","license":"MIT","bugs":{"url":"https://github.com/indutny/elliptic/issues"},"homepage":"https://github.com/indutny/elliptic","devDependencies":{"brfs":"^1.4.3","coveralls":"^3.0.8","grunt":"^1.0.4","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.2","jscs":"^3.0.7","jshint":"^2.10.3","mocha":"^6.2.2"},"dependencies":{"bn.js":"^4.4.0","brorand":"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0","inherits":"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"}}')},function(t,e){},function(t,e,r){"use strict";var n=r(5),i=r(3),o=r(1),a=r(24),s=n.assert;function u(t){a.call(this,"short",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.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(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function f(t,e,r,n){a.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,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 h(t,e,r,n){a.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,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),t.exports=u,u.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new i(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new i(t.a,16),b:new i(t.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),o=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(t){for(var e,r,n,o,a,s,u,f,h,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=t,d=this.n.clone(),p=new i(1),b=new i(0),m=new i(0),v=new i(1),g=0;0!==l.cmpn(0);){var y=d.div(l);f=d.sub(y.mul(l)),h=m.sub(y.mul(p));var _=v.sub(y.mul(b));if(!n&&f.cmp(c)<0)e=u.neg(),r=p,n=f.neg(),o=h;else if(n&&2==++g)break;u=f,d=l,l=f,m=p,p=h,v=b,b=_}a=f.neg(),s=h;var w=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(w)>=0&&(a=e,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(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),f=o.mul(n.b);return{k1:t.sub(a).sub(s),k2:u.add(f).neg()}},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.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(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},u.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},f.prototype.isInfinity=function(){return this.inf},f.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},f.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).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)},f.prototype.getX=function(){return this.x.fromRed()},f.prototype.getY=function(){return this.y.fromRed()},f.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},f.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},f.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},f.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},f.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.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 e},f.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(h,a.BasePoint),u.prototype.jpoint=function(t,e,r){return new h(this,t,e,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),a=t.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 f=s.redSqr(),h=f.redMul(s),c=n.redMul(f),l=u.redSqr().redIAdd(h).redISub(c).redISub(c),d=u.redMul(c.redISub(l)).redISub(o.redMul(h)),p=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(l,d,p)},h.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).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(),f=u.redMul(a),h=r.redMul(u),c=s.redSqr().redIAdd(f).redISub(h).redISub(h),l=s.redMul(h.redISub(c)).redISub(i.redMul(f)),d=this.z.redMul(a);return this.curve.jpoint(c,l,d)},h.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},h.prototype.inspect=function(){return this.isInfinity()?"":""},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(t,e,r){"use strict";var n=r(3),i=r(1),o=r(24),a=r(5);function s(t){o.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.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(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,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),t.exports=s,s.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),s.prototype.decodePoint=function(t,e){return this.point(a.toArray(t,e),1)},s.prototype.point=function(t,e){return new u(this,t,e)},s.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(t,e){return new u(t,e[0],e[1]||t.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.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(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),a=i.redMul(n),s=e.z.redMul(o.redAdd(a).redSqr()),u=e.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.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(t){return 0===this.getX().cmp(t.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(t,e,r){"use strict";var n=r(5),i=r(3),o=r(1),a=r(24),s=n.assert;function u(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,a.call(this,"edwards",t),this.a=new i(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(t.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|t.c)}function f(t,e,r,n,o){a.BasePoint.call(this,t,"projective"),null===e&&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(e,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),t.exports=u,u.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},u.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},u.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.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(e&&!u||!e&&u)&&(s=s.redNeg()),this.point(t,s)},u.prototype.pointFromY=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.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(e)throw new Error("invalid point");return this.point(this.zero,t)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==e&&(s=s.redNeg()),this.point(s,t)},u.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},o(f,a.BasePoint),u.prototype.pointFromJSON=function(t){return f.fromJSON(this,t)},u.prototype.point=function(t,e,r,n){return new f(this,t,e,r,n)},f.fromJSON=function(t,e){return new f(t,e[0],e[1],e[2])},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),a=o.redSub(r),s=n.redSub(e),u=i.redMul(a),f=o.redMul(s),h=i.redMul(s),c=a.redMul(o);return this.curve.point(u,f,c,h)},f.prototype._projDbl=function(){var t,e,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(f=this.curve._mulA(i)).redAdd(o);if(this.zOne)t=n.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),e=a.redMul(f.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);t=n.redSub(i).redISub(o).redMul(u),e=a.redMul(f.redSub(o)),r=a.redMul(u)}}else{var f=i.redAdd(o);s=this.curve._mulC(this.z).redSqr(),u=f.redSub(s).redSub(s);t=this.curve._mulC(n.redISub(f)).redMul(u),e=this.curve._mulC(f).redMul(i.redISub(o)),r=f.redMul(u)}return this.curve.point(t,e,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(e),f=o.redMul(a),h=s.redMul(u),c=o.redMul(u),l=a.redMul(s);return this.curve.point(f,h,l,c)},f.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),a=this.y.redMul(t.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),f=i.redAdd(s),h=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(a),c=n.redMul(u).redMul(h);return this.curve.twisted?(e=n.redMul(f).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(f)):(e=n.redMul(f).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(f)),this.curve.point(c,e,r)},f.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},f.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},f.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},f.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},f.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},f.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},function(t,e,r){"use strict";e.sha1=r(109),e.sha224=r(110),e.sha256=r(55),e.sha384=r(111),e.sha512=r(56)},function(t,e,r){"use strict";var n=r(9),i=r(18),o=r(54),a=n.rotl32,s=n.sum32,u=n.sum32_5,f=o.ft_1,h=i.BlockHash,c=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(l,h),t.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;nthis.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e0))return a.iaddn(1),this.keyFromPrivate(a)}},c.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},c.prototype.sign=function(t,e,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var a=this.n.byteLength(),s=e.getPrivate().toArray("be",a),u=t.toArray("be",a),f=new i({hash:this.hash,entropy:s,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),c=this.n.sub(new n(1)),l=0;;l++){var d=o.k?o.k(l):new n(f.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(c)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var b=p.getX(),m=b.umod(this.n);if(0!==m.cmpn(0)){var v=d.invm(this.n).mul(m.mul(e.getPrivate()).iadd(t));if(0!==(v=v.umod(this.n)).cmpn(0)){var g=(p.getY().isOdd()?1:0)|(0!==b.cmp(m)?2:0);return o.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),g^=1),new h({r:m,s:v,recoveryParam:g})}}}}}},c.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var o=(e=new h(e,"hex")).r,a=e.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),f=u.mul(t).umod(this.n),c=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(f,r.getPublic(),c)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(f,r.getPublic(),c)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},c.prototype.recoverPubKey=function(t,e,r,i){u((3&r)===r,"The recovery param is more than two bits"),e=new h(e,i);var o=this.n,a=new n(t),s=e.r,f=e.s,c=1&r,l=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");s=l?this.curve.pointFromX(s.add(this.curve.n),c):this.curve.pointFromX(s,c);var d=e.r.invm(o),p=o.sub(a).mul(d).umod(o),b=f.mul(d).umod(o);return this.g.mulAdd(p,s,b)},c.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new h(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(t,e,r){"use strict";var n=r(36),i=r(51),o=r(12);function a(t){if(!(this instanceof a))return new a(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}t.exports=a,a.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},a.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length"}},function(t,e,r){"use strict";var n=r(3),i=r(5),o=i.assert;function a(t,e){if(t instanceof a)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function s(){this.place=0}function u(t,e){var r=t[e.place++];if(!(128&r))return r;for(var n=15&r,i=0,o=0,a=e.place;o>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=a,a.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new s;if(48!==t[r.place++])return!1;if(u(t,r)+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=u(t,r),a=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var f=u(t,r);if(t.length!==f+r.place)return!1;var h=t.slice(r.place,f+r.place);return 0===a[0]&&128&a[1]&&(a=a.slice(1)),0===h[0]&&128&h[1]&&(h=h.slice(1)),this.r=new n(a),this.s=new n(h),this.recoveryParam=null,!0},a.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=f(e),r=f(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];h(n,e.length),(n=n.concat(e)).push(2),h(n,r.length);var o=n.concat(r),a=[48];return h(a,o.length),a=a.concat(o),i.encode(a,t)}},function(t,e,r){"use strict";var n=r(36),i=r(35),o=r(5),a=o.assert,s=o.parseBytes,u=r(120),f=r(121);function h(t){if(a("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof h))return new h(t);t=i[t].curve;this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}t.exports=h,h.prototype.sign=function(t,e){t=s(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),u=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},h.prototype.verify=function(t,e,r){t=s(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},h.prototype.hashInt=function(){for(var t=this.hash(),e=0;e=8?o+=t[a].toUpperCase():o+=t[a];return o},e.isValidChecksumAddress=function(t,r){return e.isValidAddress(t)&&e.toChecksumAddress(t,r)===t},e.generateAddress=function(e,r){e=s.toBuffer(e);var n=new a(r);return n.isZero()?u.rlphash([e,null]).slice(-20):u.rlphash([e,t.from(n.toArray())]).slice(-20)},e.generateAddress2=function(e,r,i){var o=s.toBuffer(e),a=s.toBuffer(r),f=s.toBuffer(i);return n(20===o.length),n(32===a.length),u.keccak256(t.concat([t.from("ff","hex"),o,a,u.keccak256(f)])).slice(-20)},e.isPrecompiled=function(t){var e=s.unpad(t);return 1===e.length&&e[0]>=1&&e[0]<=8},e.isValidPrivate=function(t){return o.privateKeyVerify(t)},e.isValidPublic=function(e,r){return void 0===r&&(r=!1),64===e.length?o.publicKeyVerify(t.concat([t.from([4]),e])):!!r&&o.publicKeyVerify(e)},e.pubToAddress=function(t,e){return void 0===e&&(e=!1),t=s.toBuffer(t),e&&64!==t.length&&(t=o.publicKeyConvert(t,!1).slice(1)),n(64===t.length),u.keccak(t).slice(-20)},e.publicToAddress=e.pubToAddress,e.privateToAddress=function(t){return e.publicToAddress(e.privateToPublic(t))},e.privateToPublic=function(t){return t=s.toBuffer(t),o.publicKeyCreate(t,!1).slice(1)},e.importPublic=function(t){return 64!==(t=s.toBuffer(t)).length&&(t=o.publicKeyConvert(t,!1).slice(1)),t}}).call(this,r(2).Buffer)},function(t,e,r){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT */var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,s,u=a(t),f=1;f=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),u=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&e._extend(n,r),g(n.showHidden)&&(n.showHidden=!1),g(n.depth)&&(n.depth=2),g(n.colors)&&(n.colors=!1),g(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),h(n,t,n.depth)}function u(t,e){var r=s.styles[e];return r?"["+s.colors[r][0]+"m"+t+"["+s.colors[r][1]+"m":t}function f(t,e){return t}function h(t,r,n){if(t.customInspect&&r&&A(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return v(i)||(i=h(t,i,n)),i}var o=function(t,e){if(g(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(m(e))return t.stylize(""+e,"number");if(p(e))return t.stylize(""+e,"boolean");if(b(e))return t.stylize("null","null")}(t,r);if(o)return o;var a=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),M(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return c(r);if(0===a.length){if(A(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(y(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return t.stylize(Date.prototype.toString.call(r),"date");if(M(r))return c(r)}var f,_="",E=!1,S=["{","}"];(d(r)&&(E=!0,S=["[","]"]),A(r))&&(_=" [Function"+(r.name?": "+r.name:"")+"]");return y(r)&&(_=" "+RegExp.prototype.toString.call(r)),w(r)&&(_=" "+Date.prototype.toUTCString.call(r)),M(r)&&(_=" "+c(r)),0!==a.length||E&&0!=r.length?n<0?y(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),f=E?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(f,_,S)):S[0]+_+S[1]}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function l(t,e,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),k(n,i)||(a="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=b(r)?h(t,u.value,null):h(t,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),g(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function d(t){return Array.isArray(t)}function p(t){return"boolean"==typeof t}function b(t){return null===t}function m(t){return"number"==typeof t}function v(t){return"string"==typeof t}function g(t){return void 0===t}function y(t){return _(t)&&"[object RegExp]"===E(t)}function _(t){return"object"==typeof t&&null!==t}function w(t){return _(t)&&"[object Date]"===E(t)}function M(t){return _(t)&&("[object Error]"===E(t)||t instanceof Error)}function A(t){return"function"==typeof t}function E(t){return Object.prototype.toString.call(t)}function S(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(r){if(g(o)&&(o=t.env.NODE_DEBUG||""),r=r.toUpperCase(),!a[r])if(new RegExp("\\b"+r+"\\b","i").test(o)){var n=t.pid;a[r]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",r,n,t)}}else a[r]=function(){};return a[r]},e.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=d,e.isBoolean=p,e.isNull=b,e.isNullOrUndefined=function(t){return null==t},e.isNumber=m,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=g,e.isRegExp=y,e.isObject=_,e.isDate=w,e.isError=M,e.isFunction=A,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(126);var x=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(){var t=new Date,e=[S(t.getHours()),S(t.getMinutes()),S(t.getSeconds())].join(":");return[t.getDate(),x[t.getMonth()],e].join(" ")}function k(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",I(),e.format.apply(e,arguments))},e.inherits=r(127),e._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var T="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function O(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(T&&t[T]){var e;if("function"!=typeof(e=t[T]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,T,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(i.p1600(this.state),this.count=0);return e},o.prototype.copy=function(t){for(let e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing},t.exports=o},function(t,e,r){"use strict";const n=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];e.p1600=function(t){for(let e=0;e<24;++e){const r=t[0]^t[10]^t[20]^t[30]^t[40],i=t[1]^t[11]^t[21]^t[31]^t[41],o=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],s=t[4]^t[14]^t[24]^t[34]^t[44],u=t[5]^t[15]^t[25]^t[35]^t[45],f=t[6]^t[16]^t[26]^t[36]^t[46],h=t[7]^t[17]^t[27]^t[37]^t[47],c=t[8]^t[18]^t[28]^t[38]^t[48],l=t[9]^t[19]^t[29]^t[39]^t[49];let d=c^(o<<1|a>>>31),p=l^(a<<1|o>>>31);const b=t[0]^d,m=t[1]^p,v=t[10]^d,g=t[11]^p,y=t[20]^d,_=t[21]^p,w=t[30]^d,M=t[31]^p,A=t[40]^d,E=t[41]^p;d=r^(s<<1|u>>>31),p=i^(u<<1|s>>>31);const S=t[2]^d,x=t[3]^p,I=t[12]^d,k=t[13]^p,T=t[22]^d,O=t[23]^p,P=t[32]^d,B=t[33]^p,C=t[42]^d,N=t[43]^p;d=o^(f<<1|h>>>31),p=a^(h<<1|f>>>31);const R=t[4]^d,D=t[5]^p,L=t[14]^d,j=t[15]^p,F=t[24]^d,U=t[25]^p,z=t[34]^d,q=t[35]^p,H=t[44]^d,V=t[45]^p;d=s^(c<<1|l>>>31),p=u^(l<<1|c>>>31);const G=t[6]^d,K=t[7]^p,Y=t[16]^d,W=t[17]^p,Z=t[26]^d,J=t[27]^p,X=t[36]^d,$=t[37]^p,Q=t[46]^d,tt=t[47]^p;d=f^(r<<1|i>>>31),p=h^(i<<1|r>>>31);const et=t[8]^d,rt=t[9]^p,nt=t[18]^d,it=t[19]^p,ot=t[28]^d,at=t[29]^p,st=t[38]^d,ut=t[39]^p,ft=t[48]^d,ht=t[49]^p,ct=b,lt=m,dt=g<<4|v>>>28,pt=v<<4|g>>>28,bt=y<<3|_>>>29,mt=_<<3|y>>>29,vt=M<<9|w>>>23,gt=w<<9|M>>>23,yt=A<<18|E>>>14,_t=E<<18|A>>>14,wt=S<<1|x>>>31,Mt=x<<1|S>>>31,At=k<<12|I>>>20,Et=I<<12|k>>>20,St=T<<10|O>>>22,xt=O<<10|T>>>22,It=B<<13|P>>>19,kt=P<<13|B>>>19,Tt=C<<2|N>>>30,Ot=N<<2|C>>>30,Pt=D<<30|R>>>2,Bt=R<<30|D>>>2,Ct=L<<6|j>>>26,Nt=j<<6|L>>>26,Rt=U<<11|F>>>21,Dt=F<<11|U>>>21,Lt=z<<15|q>>>17,jt=q<<15|z>>>17,Ft=V<<29|H>>>3,Ut=H<<29|V>>>3,zt=G<<28|K>>>4,qt=K<<28|G>>>4,Ht=W<<23|Y>>>9,Vt=Y<<23|W>>>9,Gt=Z<<25|J>>>7,Kt=J<<25|Z>>>7,Yt=X<<21|$>>>11,Wt=$<<21|X>>>11,Zt=tt<<24|Q>>>8,Jt=Q<<24|tt>>>8,Xt=et<<27|rt>>>5,$t=rt<<27|et>>>5,Qt=nt<<20|it>>>12,te=it<<20|nt>>>12,ee=at<<7|ot>>>25,re=ot<<7|at>>>25,ne=st<<8|ut>>>24,ie=ut<<8|st>>>24,oe=ft<<14|ht>>>18,ae=ht<<14|ft>>>18;t[0]=ct^~At&Rt,t[1]=lt^~Et&Dt,t[10]=zt^~Qt&bt,t[11]=qt^~te&mt,t[20]=wt^~Ct&Gt,t[21]=Mt^~Nt&Kt,t[30]=Xt^~dt&St,t[31]=$t^~pt&xt,t[40]=Pt^~Ht&ee,t[41]=Bt^~Vt&re,t[2]=At^~Rt&Yt,t[3]=Et^~Dt&Wt,t[12]=Qt^~bt&It,t[13]=te^~mt&kt,t[22]=Ct^~Gt&ne,t[23]=Nt^~Kt&ie,t[32]=dt^~St&Lt,t[33]=pt^~xt&jt,t[42]=Ht^~ee&vt,t[43]=Vt^~re>,t[4]=Rt^~Yt&oe,t[5]=Dt^~Wt&ae,t[14]=bt^~It&Ft,t[15]=mt^~kt&Ut,t[24]=Gt^~ne&yt,t[25]=Kt^~ie&_t,t[34]=St^~Lt&Zt,t[35]=xt^~jt&Jt,t[44]=ee^~vt&Tt,t[45]=re^~gt&Ot,t[6]=Yt^~oe&ct,t[7]=Wt^~ae<,t[16]=It^~Ft&zt,t[17]=kt^~Ut&qt,t[26]=ne^~yt&wt,t[27]=ie^~_t&Mt,t[36]=Lt^~Zt&Xt,t[37]=jt^~Jt&$t,t[46]=vt^~Tt&Pt,t[47]=gt^~Ot&Bt,t[8]=oe^~ct&At,t[9]=ae^~lt&Et,t[18]=Ft^~zt&Qt,t[19]=Ut^~qt&te,t[28]=yt^~wt&Ct,t[29]=_t^~Mt&Nt,t[38]=Zt^~Xt&dt,t[39]=Jt^~$t&pt,t[48]=Tt^~Pt&Ht,t[49]=Ot^~Bt&Vt,t[0]^=n[2*e],t[1]^=n[2*e+1]}}},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var n=r(29),i=r(3),o=r(20),a=r(38);function s(t,e){return e?t-(2*e+35):t-27}function u(t){return 0===t||1===t}e.ecsign=function(t,e,r){var i=n.sign(t,e),o=i.recovery;return{r:i.signature.slice(0,32),s:i.signature.slice(32,64),v:r?o+(2*r+35):o+27}},e.ecrecover=function(e,r,i,a,f){var h=t.concat([o.setLength(i,32),o.setLength(a,32)],64),c=s(r,f);if(!u(c))throw new Error("Invalid signature v value");var l=n.recover(e,h,c);return n.publicKeyConvert(l,!1).slice(1)},e.toRpcSig=function(e,r,n,i){if(!u(s(e,i)))throw new Error("Invalid signature v value");return o.bufferToHex(t.concat([o.setLengthLeft(r,32),o.setLengthLeft(n,32),o.toBuffer(e)]))},e.fromRpcSig=function(t){var e=o.toBuffer(t);if(65!==e.length)throw new Error("Invalid signature length");var r=e[64];return r<27&&(r+=27),{v:r,r:e.slice(0,32),s:e.slice(32,64)}},e.isValidSignature=function(t,e,r,n,o){void 0===n&&(n=!0);var a=new i("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),f=new i("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==e.length||32!==r.length)return!1;if(!u(s(t,o)))return!1;var h=new i(e),c=new i(r);return!(h.isZero()||h.gt(f)||c.isZero()||c.gt(f))&&(!n||1!==c.cmp(a))},e.hashPersonalMessage=function(e){var r=t.from("Ethereum Signed Message:\n"+e.length.toString(),"utf-8");return a.keccak(t.concat([r,e]))}}).call(this,r(2).Buffer)},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var n=r(59),i=r(19),o=r(37),a=r(20);e.defineProperties=function(e,r,s){if(e.raw=[],e._fields=[],e.toJSON=function(t){if(void 0===t&&(t=!1),t){var r={};return e._fields.forEach((function(t){r[t]="0x"+e[t].toString("hex")})),r}return a.baToJSON(e.raw)},e.serialize=function(){return o.encode(e.raw)},r.forEach((function(r,i){function o(){return e.raw[i]}function s(o){"00"!==(o=a.toBuffer(o)).toString("hex")||r.allowZero||(o=t.allocUnsafe(0)),r.allowLess&&r.length?(o=a.stripZeros(o),n(r.length>=o.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===o.length||!r.length||n(r.length===o.length,"The field "+r.name+" must have byte length of "+r.length),e.raw[i]=o}e._fields.push(r.name),Object.defineProperty(e,r.name,{enumerable:!0,configurable:!0,get:o,set:s}),r.default&&(e[r.name]=r.default),r.alias&&Object.defineProperty(e,r.alias,{enumerable:!1,configurable:!0,set:s,get:o})})),s)if("string"==typeof s&&(s=t.from(i.stripHexPrefix(s),"hex")),t.isBuffer(s)&&(s=o.decode(s)),Array.isArray(s)){if(s.length>e._fields.length)throw new Error("wrong number of fields in data");s.forEach((function(t,r){e[e._fields[r]]=a.toBuffer(t)}))}else{if("object"!=typeof s)throw new Error("invalid data");var u=Object.keys(s);r.forEach((function(t){-1!==u.indexOf(t.name)&&(e[t.name]=s[t.name]),-1!==u.indexOf(t.alias)&&(e[t.alias]=s[t.alias])}))}}}).call(this,r(2).Buffer)},function(t,e,r){var n=r(25),i=r(137),o=new(0,r(149).AbiCoder)((function(t,e){return!t.match(/^u?int/)||n.isArray(e)||n.isObject(e)&&"BN"===e.constructor.name?e:e.toString()}));function a(){}var s=function(){};s.prototype.encodeFunctionSignature=function(t){return n.isObject(t)&&(t=i._jsonInterfaceMethodToString(t)),i.sha3(t).slice(0,10)},s.prototype.encodeEventSignature=function(t){return n.isObject(t)&&(t=i._jsonInterfaceMethodToString(t)),i.sha3(t)},s.prototype.encodeParameter=function(t,e){return this.encodeParameters([t],[e])},s.prototype.encodeParameters=function(t,e){return o.encode(this.mapTypes(t),e.map((function(t){return i.isBN(t)||i.isBigNumber(t)?t.toString(10):t})))},s.prototype.mapTypes=function(t){var e=this,r=[];return t.forEach((function(t){if(e.isSimplifiedStructFormat(t)){var n=Object.keys(t)[0];r.push(Object.assign(e.mapStructNameAndType(n),{components:e.mapStructToCoderFormat(t[n])}))}else r.push(t)})),r},s.prototype.isSimplifiedStructFormat=function(t){return"object"==typeof t&&void 0===t.components&&void 0===t.name},s.prototype.mapStructNameAndType=function(t){var e="tuple";return t.indexOf("[]")>-1&&(e="tuple[]",t=t.slice(0,-2)),{type:e,name:t}},s.prototype.mapStructToCoderFormat=function(t){var e=this,r=[];return Object.keys(t).forEach((function(n){"object"!=typeof t[n]?r.push({name:n,type:t[n]}):r.push(Object.assign(e.mapStructNameAndType(n),{components:e.mapStructToCoderFormat(t[n])}))})),r},s.prototype.encodeFunctionCall=function(t,e){return this.encodeFunctionSignature(t)+this.encodeParameters(t.inputs,e).replace("0x","")},s.prototype.decodeParameter=function(t,e){return this.decodeParameters([t],e)[0]},s.prototype.decodeParameters=function(t,e){if(t.length>0&&(!e||"0x"===e||"0X"===e))throw new Error("Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.");var r=o.decode(this.mapTypes(t),"0x"+e.replace(/0x/i,"")),i=new a;return i.__length__=0,t.forEach((function(t,e){var o=r[i.__length__];o="0x"===o?null:o,i[e]=o,n.isObject(t)&&t.name&&(i[t.name]=o),i.__length__++})),i},s.prototype.decodeLog=function(t,e,r){var i=this;r=n.isArray(r)?r:[r],e=e||"";var o=[],s=[],u=0;t.forEach((function(t,e){t.indexed?(s[e]=["bool","int","uint","address","fixed","ufixed"].find((function(e){return-1!==t.type.indexOf(e)}))?i.decodeParameter(t.type,r[u]):r[u],u++):o[e]=t}));var f=e,h=f?this.decodeParameters(o,f):[],c=new a;return c.__length__=0,t.forEach((function(t,e){c[e]="string"===t.type?"":null,void 0!==h[e]&&(c[e]=h[e]),void 0!==s[e]&&(c[e]=s[e]),t.name&&(c[t.name]=c[e]),c.__length__++})),c};var u=new s;t.exports=u},function(t,e,r){var n=r(25),i=r(138),o=r(61),a=r(147),s=r(148),u=function(t,e){var r=[];return e.forEach((function(e){if("object"==typeof e.components){if("tuple"!==e.type.substring(0,5))throw new Error("components found but type is not tuple; report on GitHub");var i="",o=e.type.indexOf("[");o>=0&&(i=e.type.substring(o));var a=u(t,e.components);n.isArray(a)&&t?r.push("tuple("+a.join(",")+")"+i):t?r.push("("+a+")"):r.push("("+a.join(",")+")"+i)}else r.push(e.type)})),r},f=function(t){if(!o.isHexStrict(t))throw new Error("The parameter must be a valid HEX string.");var e="",r=0,n=t.length;for("0x"===t.substring(0,2)&&(r=2);r7?r+=t[n].toUpperCase():r+=t[n];return r},toHex:o.toHex,toBN:o.toBN,bytesToHex:o.bytesToHex,hexToBytes:o.hexToBytes,hexToNumberString:o.hexToNumberString,hexToNumber:o.hexToNumber,toDecimal:o.hexToNumber,numberToHex:o.numberToHex,fromDecimal:o.numberToHex,hexToUtf8:o.hexToUtf8,hexToString:o.hexToUtf8,toUtf8:o.hexToUtf8,utf8ToHex:o.utf8ToHex,stringToHex:o.utf8ToHex,fromUtf8:o.utf8ToHex,hexToAscii:f,toAscii:f,asciiToHex:h,fromAscii:h,unitMap:i.unitMap,toWei:function(t,e){if(e=c(e),!o.isBN(t)&&!n.isString(t))throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return o.isBN(t)?i.toWei(t,e):i.toWei(t,e).toString(10)},fromWei:function(t,e){if(e=c(e),!o.isBN(t)&&!n.isString(t))throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return o.isBN(t)?i.fromWei(t,e):i.fromWei(t,e).toString(10)},padLeft:o.leftPad,leftPad:o.leftPad,padRight:o.rightPad,rightPad:o.rightPad,toTwosComplement:o.toTwosComplement,isBloom:o.isBloom,isUserEthereumAddressInBloom:o.isUserEthereumAddressInBloom,isContractAddressInBloom:o.isContractAddressInBloom,isTopic:o.isTopic,isTopicInBloom:o.isTopicInBloom,isInBloom:o.isInBloom}},function(t,e,r){"use strict";var n=r(139),i=r(60),o=new n(0),a=new n(-1),s={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"};function u(t){var e=t?t.toLowerCase():"ether",r=s[e];if("string"!=typeof r)throw new Error("[ethjs-unit] the unit provided "+t+" doesn't exists, please use the one of the following units "+JSON.stringify(s,null,2));return new n(r,10)}function f(t){if("string"==typeof t){if(!t.match(/^-?[0-9.]+$/))throw new Error("while converting number to string, invalid number value '"+t+"', should be a number matching (^-?[0-9.]+).");return t}if("number"==typeof t)return String(t);if("object"==typeof t&&t.toString&&(t.toTwos||t.dividedToIntegerBy))return t.toPrecision?String(t.toPrecision()):t.toString(10);throw new Error("while converting number to string, invalid number value '"+t+"' type "+typeof t+".")}t.exports={unitMap:s,numberToString:f,getValueOfUnit:u,fromWei:function(t,e,r){var n=i(t),f=n.lt(o),h=u(e),c=s[e].length-1||1,l=r||{};f&&(n=n.mul(a));for(var d=n.mod(h).toString(10);d.length2)throw new Error("[ethjs-unit] while converting number "+t+" to wei, too many decimal points");var l=c[0],d=c[1];if(l||(l="0"),d||(d="0"),d.length>o)throw new Error("[ethjs-unit] while converting number "+t+" to wei, too many decimal places");for(;d.length=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,f=0,h=r;h1&&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?""};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"],h=[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],c=[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 l(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var f=1;f>>26,c=67108863&u,l=Math.min(f,e.length-1),d=Math.max(0,f-t.length+1);d<=l;d++){var p=f-d|0;h+=(a=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&a}r.words[f]=0|c,u=0|h}return 0!==u?r.words[f]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>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%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=h[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?b+r:f[l-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=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 t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,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"===e,f=new t(o),h=this.clone();if(u){for(s=0;!h.isZero();s++)a=h.andln(255),h.iushrn(8),f[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,b=d>>>13,m=0|a[2],v=8191&m,g=m>>>13,y=0|a[3],_=8191&y,w=y>>>13,M=0|a[4],A=8191&M,E=M>>>13,S=0|a[5],x=8191&S,I=S>>>13,k=0|a[6],T=8191&k,O=k>>>13,P=0|a[7],B=8191&P,C=P>>>13,N=0|a[8],R=8191&N,D=N>>>13,L=0|a[9],j=8191&L,F=L>>>13,U=0|s[0],z=8191&U,q=U>>>13,H=0|s[1],V=8191&H,G=H>>>13,K=0|s[2],Y=8191&K,W=K>>>13,Z=0|s[3],J=8191&Z,X=Z>>>13,$=0|s[4],Q=8191&$,tt=$>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ft=st>>>13,ht=0|s[8],ct=8191&ht,lt=ht>>>13,dt=0|s[9],pt=8191&dt,bt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(f+(n=Math.imul(c,z))|0)+((8191&(i=(i=Math.imul(c,q))+Math.imul(l,z)|0))<<13)|0;f=((o=Math.imul(l,q))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,z),i=(i=Math.imul(p,q))+Math.imul(b,z)|0,o=Math.imul(b,q);var vt=(f+(n=n+Math.imul(c,V)|0)|0)+((8191&(i=(i=i+Math.imul(c,G)|0)+Math.imul(l,V)|0))<<13)|0;f=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,z),i=(i=Math.imul(v,q))+Math.imul(g,z)|0,o=Math.imul(g,q),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,G)|0;var gt=(f+(n=n+Math.imul(c,Y)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(l,Y)|0))<<13)|0;f=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(_,z),i=(i=Math.imul(_,q))+Math.imul(w,z)|0,o=Math.imul(w,q),n=n+Math.imul(v,V)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,G)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,W)|0;var yt=(f+(n=n+Math.imul(c,J)|0)|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(l,J)|0))<<13)|0;f=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(A,z),i=(i=Math.imul(A,q))+Math.imul(E,z)|0,o=Math.imul(E,q),n=n+Math.imul(_,V)|0,i=(i=i+Math.imul(_,G)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,G)|0,n=n+Math.imul(v,Y)|0,i=(i=i+Math.imul(v,W)|0)+Math.imul(g,Y)|0,o=o+Math.imul(g,W)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(b,J)|0,o=o+Math.imul(b,X)|0;var _t=(f+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(l,Q)|0))<<13)|0;f=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(x,z),i=(i=Math.imul(x,q))+Math.imul(I,z)|0,o=Math.imul(I,q),n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,n=n+Math.imul(_,Y)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,W)|0,n=n+Math.imul(v,J)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var wt=(f+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(l,rt)|0))<<13)|0;f=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(T,z),i=(i=Math.imul(T,q))+Math.imul(O,z)|0,o=Math.imul(O,q),n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(I,V)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(_,J)|0,i=(i=i+Math.imul(_,X)|0)+Math.imul(w,J)|0,o=o+Math.imul(w,X)|0,n=n+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0;var Mt=(f+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,at)|0)+Math.imul(l,ot)|0))<<13)|0;f=((o=o+Math.imul(l,at)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,z),i=(i=Math.imul(B,q))+Math.imul(C,z)|0,o=Math.imul(C,q),n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,W)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,at)|0;var At=(f+(n=n+Math.imul(c,ut)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(l,ut)|0))<<13)|0;f=((o=o+Math.imul(l,ft)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(R,z),i=(i=Math.imul(R,q))+Math.imul(D,z)|0,o=Math.imul(D,q),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,nt)|0,n=n+Math.imul(v,ot)|0,i=(i=i+Math.imul(v,at)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ft)|0;var Et=(f+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;f=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(j,z),i=(i=Math.imul(j,q))+Math.imul(F,z)|0,o=Math.imul(F,q),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,W)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,n=n+Math.imul(v,ut)|0,i=(i=i+Math.imul(v,ft)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,ft)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,lt)|0;var St=(f+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,bt)|0)+Math.imul(l,pt)|0))<<13)|0;f=((o=o+Math.imul(l,bt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(j,V),i=(i=Math.imul(j,G))+Math.imul(F,V)|0,o=Math.imul(F,G),n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,W)|0,n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(C,J)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,at)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,at)|0,n=n+Math.imul(_,ut)|0,i=(i=i+Math.imul(_,ft)|0)+Math.imul(w,ut)|0,o=o+Math.imul(w,ft)|0,n=n+Math.imul(v,ct)|0,i=(i=i+Math.imul(v,lt)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,lt)|0;var xt=(f+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;f=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(j,Y),i=(i=Math.imul(j,W))+Math.imul(F,Y)|0,o=Math.imul(F,W),n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,at)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,at)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ft)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ft)|0,n=n+Math.imul(_,ct)|0,i=(i=i+Math.imul(_,lt)|0)+Math.imul(w,ct)|0,o=o+Math.imul(w,lt)|0;var It=(f+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,bt)|0)+Math.imul(g,pt)|0))<<13)|0;f=((o=o+Math.imul(g,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(j,J),i=(i=Math.imul(j,X))+Math.imul(F,J)|0,o=Math.imul(F,X),n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ft)|0,n=n+Math.imul(A,ct)|0,i=(i=i+Math.imul(A,lt)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,lt)|0;var kt=(f+(n=n+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,bt)|0)+Math.imul(w,pt)|0))<<13)|0;f=((o=o+Math.imul(w,bt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(j,Q),i=(i=Math.imul(j,tt))+Math.imul(F,Q)|0,o=Math.imul(F,tt),n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,at)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,at)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ft)|0,n=n+Math.imul(x,ct)|0,i=(i=i+Math.imul(x,lt)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,lt)|0;var Tt=(f+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,bt)|0)+Math.imul(E,pt)|0))<<13)|0;f=((o=o+Math.imul(E,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(j,rt),i=(i=Math.imul(j,nt))+Math.imul(F,rt)|0,o=Math.imul(F,nt),n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,at)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ft)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ft)|0,n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,lt)|0)+Math.imul(O,ct)|0,o=o+Math.imul(O,lt)|0;var Ot=(f+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,bt)|0)+Math.imul(I,pt)|0))<<13)|0;f=((o=o+Math.imul(I,bt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(j,ot),i=(i=Math.imul(j,at))+Math.imul(F,ot)|0,o=Math.imul(F,at),n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ft)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ft)|0,n=n+Math.imul(B,ct)|0,i=(i=i+Math.imul(B,lt)|0)+Math.imul(C,ct)|0,o=o+Math.imul(C,lt)|0;var Pt=(f+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,bt)|0)+Math.imul(O,pt)|0))<<13)|0;f=((o=o+Math.imul(O,bt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(j,ut),i=(i=Math.imul(j,ft))+Math.imul(F,ut)|0,o=Math.imul(F,ft),n=n+Math.imul(R,ct)|0,i=(i=i+Math.imul(R,lt)|0)+Math.imul(D,ct)|0,o=o+Math.imul(D,lt)|0;var Bt=(f+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,bt)|0)+Math.imul(C,pt)|0))<<13)|0;f=((o=o+Math.imul(C,bt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(j,ct),i=(i=Math.imul(j,lt))+Math.imul(F,ct)|0,o=Math.imul(F,lt);var Ct=(f+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,bt)|0)+Math.imul(D,pt)|0))<<13)|0;f=((o=o+Math.imul(D,bt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var Nt=(f+(n=Math.imul(j,pt))|0)+((8191&(i=(i=Math.imul(j,bt))+Math.imul(F,pt)|0))<<13)|0;return f=((o=Math.imul(F,bt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=mt,u[1]=vt,u[2]=gt,u[3]=yt,u[4]=_t,u[5]=wt,u[6]=Mt,u[7]=At,u[8]=Et,u[9]=St,u[10]=xt,u[11]=It,u[12]=kt,u[13]=Tt,u[14]=Ot,u[15]=Pt,u[16]=Bt,u[17]=Ct,u[18]=Nt,0!==f&&(u[19]=f,r.length++),r};function p(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(d=l),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>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,t,e):p(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,f=0;f=0&&(0!==h||f>=i);f--){var c=0|this.words[f];this.words[f]=h<<26-o|c>>>o,h=c&s}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,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"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var f=0;f=0;c--){var l=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(l=Math.min(l/a|0,67108863),n._ishlnsubmul(i,l,c);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);s&&(s.words[c]=l)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),f=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++f;for(var h=r.clone(),c=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(h),a.isub(c)),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(h),u.isub(c)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,h=1;0==(e.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(e.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var c=0,l=1;0==(r.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(r.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>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(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},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(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){M.call(this,t),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)}v.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(g,v),g.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},g.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new g;else if("p224"===t)e=new y;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return m[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,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(),f=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,f).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var b=d,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m=0;n--){for(var f=e.words[n],h=u-1;h>=0;h--){var c=f>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==a?(a<<=1,a|=c,(4===++s||0===n&&0===h)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new A(t)},i(A,M),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),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)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),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)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(23)(t))},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a=r(2).Buffer}catch(t){}function s(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,f=0,h=r;h1&&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?""};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"],h=[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],c=[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 l(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var f=1;f>>26,c=67108863&u,l=Math.min(f,e.length-1),d=Math.max(0,f-t.length+1);d<=l;d++){var p=f-d|0;h+=(a=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&a}r.words[f]=0|c,u=0|h}return 0!==u?r.words[f]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>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%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=h[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?b+r:f[l-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=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 t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,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"===e,f=new t(o),h=this.clone();if(u){for(s=0;!h.isZero();s++)a=h.andln(255),h.iushrn(8),f[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,b=d>>>13,m=0|a[2],v=8191&m,g=m>>>13,y=0|a[3],_=8191&y,w=y>>>13,M=0|a[4],A=8191&M,E=M>>>13,S=0|a[5],x=8191&S,I=S>>>13,k=0|a[6],T=8191&k,O=k>>>13,P=0|a[7],B=8191&P,C=P>>>13,N=0|a[8],R=8191&N,D=N>>>13,L=0|a[9],j=8191&L,F=L>>>13,U=0|s[0],z=8191&U,q=U>>>13,H=0|s[1],V=8191&H,G=H>>>13,K=0|s[2],Y=8191&K,W=K>>>13,Z=0|s[3],J=8191&Z,X=Z>>>13,$=0|s[4],Q=8191&$,tt=$>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ft=st>>>13,ht=0|s[8],ct=8191&ht,lt=ht>>>13,dt=0|s[9],pt=8191&dt,bt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(f+(n=Math.imul(c,z))|0)+((8191&(i=(i=Math.imul(c,q))+Math.imul(l,z)|0))<<13)|0;f=((o=Math.imul(l,q))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,z),i=(i=Math.imul(p,q))+Math.imul(b,z)|0,o=Math.imul(b,q);var vt=(f+(n=n+Math.imul(c,V)|0)|0)+((8191&(i=(i=i+Math.imul(c,G)|0)+Math.imul(l,V)|0))<<13)|0;f=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,z),i=(i=Math.imul(v,q))+Math.imul(g,z)|0,o=Math.imul(g,q),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,G)|0;var gt=(f+(n=n+Math.imul(c,Y)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(l,Y)|0))<<13)|0;f=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(_,z),i=(i=Math.imul(_,q))+Math.imul(w,z)|0,o=Math.imul(w,q),n=n+Math.imul(v,V)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,G)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,W)|0;var yt=(f+(n=n+Math.imul(c,J)|0)|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(l,J)|0))<<13)|0;f=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(A,z),i=(i=Math.imul(A,q))+Math.imul(E,z)|0,o=Math.imul(E,q),n=n+Math.imul(_,V)|0,i=(i=i+Math.imul(_,G)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,G)|0,n=n+Math.imul(v,Y)|0,i=(i=i+Math.imul(v,W)|0)+Math.imul(g,Y)|0,o=o+Math.imul(g,W)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(b,J)|0,o=o+Math.imul(b,X)|0;var _t=(f+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(l,Q)|0))<<13)|0;f=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(x,z),i=(i=Math.imul(x,q))+Math.imul(I,z)|0,o=Math.imul(I,q),n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,G)|0,n=n+Math.imul(_,Y)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,W)|0,n=n+Math.imul(v,J)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var wt=(f+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(l,rt)|0))<<13)|0;f=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(T,z),i=(i=Math.imul(T,q))+Math.imul(O,z)|0,o=Math.imul(O,q),n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(I,V)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(_,J)|0,i=(i=i+Math.imul(_,X)|0)+Math.imul(w,J)|0,o=o+Math.imul(w,X)|0,n=n+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0;var Mt=(f+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,at)|0)+Math.imul(l,ot)|0))<<13)|0;f=((o=o+Math.imul(l,at)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,z),i=(i=Math.imul(B,q))+Math.imul(C,z)|0,o=Math.imul(C,q),n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,W)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,at)|0;var At=(f+(n=n+Math.imul(c,ut)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(l,ut)|0))<<13)|0;f=((o=o+Math.imul(l,ft)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(R,z),i=(i=Math.imul(R,q))+Math.imul(D,z)|0,o=Math.imul(D,q),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,nt)|0,n=n+Math.imul(v,ot)|0,i=(i=i+Math.imul(v,at)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ft)|0;var Et=(f+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;f=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(j,z),i=(i=Math.imul(j,q))+Math.imul(F,z)|0,o=Math.imul(F,q),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,W)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,n=n+Math.imul(v,ut)|0,i=(i=i+Math.imul(v,ft)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,ft)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,lt)|0;var St=(f+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,bt)|0)+Math.imul(l,pt)|0))<<13)|0;f=((o=o+Math.imul(l,bt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(j,V),i=(i=Math.imul(j,G))+Math.imul(F,V)|0,o=Math.imul(F,G),n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,W)|0,n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(C,J)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,at)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,at)|0,n=n+Math.imul(_,ut)|0,i=(i=i+Math.imul(_,ft)|0)+Math.imul(w,ut)|0,o=o+Math.imul(w,ft)|0,n=n+Math.imul(v,ct)|0,i=(i=i+Math.imul(v,lt)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,lt)|0;var xt=(f+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;f=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(j,Y),i=(i=Math.imul(j,W))+Math.imul(F,Y)|0,o=Math.imul(F,W),n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,X)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,at)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,at)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ft)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ft)|0,n=n+Math.imul(_,ct)|0,i=(i=i+Math.imul(_,lt)|0)+Math.imul(w,ct)|0,o=o+Math.imul(w,lt)|0;var It=(f+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,bt)|0)+Math.imul(g,pt)|0))<<13)|0;f=((o=o+Math.imul(g,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(j,J),i=(i=Math.imul(j,X))+Math.imul(F,J)|0,o=Math.imul(F,X),n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ft)|0,n=n+Math.imul(A,ct)|0,i=(i=i+Math.imul(A,lt)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,lt)|0;var kt=(f+(n=n+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,bt)|0)+Math.imul(w,pt)|0))<<13)|0;f=((o=o+Math.imul(w,bt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(j,Q),i=(i=Math.imul(j,tt))+Math.imul(F,Q)|0,o=Math.imul(F,tt),n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,at)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,at)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ft)|0,n=n+Math.imul(x,ct)|0,i=(i=i+Math.imul(x,lt)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,lt)|0;var Tt=(f+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,bt)|0)+Math.imul(E,pt)|0))<<13)|0;f=((o=o+Math.imul(E,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(j,rt),i=(i=Math.imul(j,nt))+Math.imul(F,rt)|0,o=Math.imul(F,nt),n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,at)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ft)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ft)|0,n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,lt)|0)+Math.imul(O,ct)|0,o=o+Math.imul(O,lt)|0;var Ot=(f+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,bt)|0)+Math.imul(I,pt)|0))<<13)|0;f=((o=o+Math.imul(I,bt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(j,ot),i=(i=Math.imul(j,at))+Math.imul(F,ot)|0,o=Math.imul(F,at),n=n+Math.imul(R,ut)|0,i=(i=i+Math.imul(R,ft)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ft)|0,n=n+Math.imul(B,ct)|0,i=(i=i+Math.imul(B,lt)|0)+Math.imul(C,ct)|0,o=o+Math.imul(C,lt)|0;var Pt=(f+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,bt)|0)+Math.imul(O,pt)|0))<<13)|0;f=((o=o+Math.imul(O,bt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(j,ut),i=(i=Math.imul(j,ft))+Math.imul(F,ut)|0,o=Math.imul(F,ft),n=n+Math.imul(R,ct)|0,i=(i=i+Math.imul(R,lt)|0)+Math.imul(D,ct)|0,o=o+Math.imul(D,lt)|0;var Bt=(f+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,bt)|0)+Math.imul(C,pt)|0))<<13)|0;f=((o=o+Math.imul(C,bt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(j,ct),i=(i=Math.imul(j,lt))+Math.imul(F,ct)|0,o=Math.imul(F,lt);var Ct=(f+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,bt)|0)+Math.imul(D,pt)|0))<<13)|0;f=((o=o+Math.imul(D,bt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863;var Nt=(f+(n=Math.imul(j,pt))|0)+((8191&(i=(i=Math.imul(j,bt))+Math.imul(F,pt)|0))<<13)|0;return f=((o=Math.imul(F,bt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=mt,u[1]=vt,u[2]=gt,u[3]=yt,u[4]=_t,u[5]=wt,u[6]=Mt,u[7]=At,u[8]=Et,u[9]=St,u[10]=xt,u[11]=It,u[12]=kt,u[13]=Tt,u[14]=Ot,u[15]=Pt,u[16]=Bt,u[17]=Ct,u[18]=Nt,0!==f&&(u[19]=f,r.length++),r};function p(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(d=l),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>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,t,e):p(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,f=0;f=0&&(0!==h||f>=i);f--){var c=0|this.words[f];this.words[f]=h<<26-o|c>>>o,h=c&s}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,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"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var f=0;f=0;c--){var l=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(l=Math.min(l/a|0,67108863),n._ishlnsubmul(i,l,c);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);s&&(s.words[c]=l)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),f=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++f;for(var h=r.clone(),c=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(h),a.isub(c)),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(h),u.isub(c)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,h=1;0==(e.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(e.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var c=0,l=1;0==(r.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(r.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>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(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},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(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){M.call(this,t),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)}v.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(g,v),g.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},g.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new g;else if("p224"===t)e=new y;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return m[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,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(),f=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,f).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var b=d,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m=0;n--){for(var f=e.words[n],h=u-1;h>=0;h--){var c=f>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==a?(a<<=1,a|=c,(4===++s||0===n&&0===h)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new A(t)},i(A,M),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),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)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),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)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(23)(t))},function(t,e,r){!function(t){var e,r,n,i=String.fromCharCode;function o(t){for(var e,r,n=[],i=0,o=t.length;i=55296&&e<=56319&&i=55296&&t<=57343)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function s(t,e){return i(t>>e&63|128)}function u(t){if(0==(4294967168&t))return i(t);var e="";return 0==(4294965248&t)?e=i(t>>6&31|192):0==(4294901760&t)?(a(t),e=i(t>>12&15|224),e+=s(t,6)):0==(4292870144&t)&&(e=i(t>>18&7|240),e+=s(t,12),e+=s(t,6)),e+=i(63&t|128)}function f(){if(n>=r)throw Error("Invalid byte index");var t=255&e[n];if(n++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function h(){var t,i;if(n>r)throw Error("Invalid byte index");if(n==r)return!1;if(t=255&e[n],n++,0==(128&t))return t;if(192==(224&t)){if((i=(31&t)<<6|f())>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&t)){if((i=(15&t)<<12|f()<<6|f())>=2048)return a(i),i;throw Error("Invalid continuation byte")}if(240==(248&t)&&(i=(7&t)<<18|f()<<12|f()<<6|f())>=65536&&i<=1114111)return i;throw Error("Invalid UTF-8 detected")}t.version="3.0.0",t.encode=function(t){for(var e=o(t),r=e.length,n=-1,i="";++n65535&&(o+=i((e-=65536)>>>10&1023|55296),e=56320|1023&e),o+=i(e);return o}(s)}}(e)},function(t,e){var r="0123456789abcdef".split(""),n=[1,256,65536,16777216],i=[0,8,16,24],o=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=function(t){var e,r,n,i,a,s,u,f,h,c,l,d,p,b,m,v,g,y,_,w,M,A,E,S,x,I,k,T,O,P,B,C,N,R,D,L,j,F,U,z,q,H,V,G,K,Y,W,Z,J,X,$,Q,tt,et,rt,nt,it,ot,at,st,ut,ft,ht;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],a=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],f=t[4]^t[14]^t[24]^t[34]^t[44],h=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(f<<1|h>>>31),r=a^(h<<1|f>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(c<<1|l>>>31),r=u^(l<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=f^(d<<1|p>>>31),r=h^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(i<<1|a>>>31),r=l^(a<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,b=t[0],m=t[1],Y=t[11]<<4|t[10]>>>28,W=t[10]<<4|t[11]>>>28,T=t[20]<<3|t[21]>>>29,O=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,V=t[41]<<18|t[40]>>>14,R=t[2]<<1|t[3]>>>31,D=t[3]<<1|t[2]>>>31,v=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,Z=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,P=t[33]<<13|t[32]>>>19,B=t[32]<<13|t[33]>>>19,ft=t[42]<<2|t[43]>>>30,ht=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,j=t[15]<<6|t[14]>>>26,y=t[25]<<11|t[24]>>>21,_=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,$=t[35]<<15|t[34]>>>17,C=t[45]<<29|t[44]>>>3,N=t[44]<<29|t[45]>>>3,S=t[6]<<28|t[7]>>>4,x=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,F=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,w=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,G=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,k=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,at=t[28]<<7|t[29]>>>25,z=t[38]<<8|t[39]>>>24,q=t[39]<<8|t[38]>>>24,A=t[48]<<14|t[49]>>>18,E=t[49]<<14|t[48]>>>18,t[0]=b^~v&y,t[1]=m^~g&_,t[10]=S^~I&T,t[11]=x^~k&O,t[20]=R^~L&F,t[21]=D^~j&U,t[30]=G^~Y&Z,t[31]=K^~W&J,t[40]=et^~nt&ot,t[41]=rt^~it&at,t[2]=v^~y&w,t[3]=g^~_&M,t[12]=I^~T&P,t[13]=k^~O&B,t[22]=L^~F&z,t[23]=j^~U&q,t[32]=Y^~Z&X,t[33]=W^~J&$,t[42]=nt^~ot&st,t[43]=it^~at&ut,t[4]=y^~w&A,t[5]=_^~M&E,t[14]=T^~P&C,t[15]=O^~B&N,t[24]=F^~z&H,t[25]=U^~q&V,t[34]=Z^~X&Q,t[35]=J^~$&tt,t[44]=ot^~st&ft,t[45]=at^~ut&ht,t[6]=w^~A&b,t[7]=M^~E&m,t[16]=P^~C&S,t[17]=B^~N&x,t[26]=z^~H&R,t[27]=q^~V&D,t[36]=X^~Q&G,t[37]=$^~tt&K,t[46]=st^~ft&et,t[47]=ut^~ht&rt,t[8]=A^~b&v,t[9]=E^~m&g,t[18]=C^~S&I,t[19]=N^~x&k,t[28]=H^~R&L,t[29]=V^~D&j,t[38]=Q^~G&Y,t[39]=tt^~K&W,t[48]=ft^~et&nt,t[49]=ht^~rt&it,t[0]^=o[n],t[1]^=o[n+1]},s=function(t){return function(e){var o;if("0x"===e.slice(0,2)){o=[];for(var s=2,u=e.length;s>2]|=e[d]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(u[m>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=f){for(t.start=m-f,t.block=u[h],m=0;m>2]|=n[3&m],t.lastByteIndex===f)for(u[0]=u[h],m=1;m>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];v%h==0&&(a(l),m=0)}return"0x"+b}(function(t){return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e}(t),o)}};t.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(144);function i(t){return"string"==typeof t&&(!!/^(0x)?[0-9a-f]{512}$/i.test(t)&&!(!/^(0x)?[0-9a-f]{512}$/.test(t)&&!/^(0x)?[0-9A-F]{512}$/.test(t)))}function o(t,e){"object"==typeof e&&e.constructor===Uint8Array&&(e=n.bytesToHex(e));const r=n.keccak256(e).replace("0x","");for(let e=0;e<12;e+=4){const n=(parseInt(r.substr(e,2),16)<<8)+parseInt(r.substr(e+2,2),16)&2047,i=1<=48&&t<=57)return t-48;if(t>=65&&t<=70)return t-55;if(t>=97&&t<=102)return t-87;throw new Error("invalid bloom")}function s(t){return"string"==typeof t&&(!!/^(0x)?[0-9a-f]{64}$/i.test(t)&&!(!/^(0x)?[0-9a-f]{64}$/.test(t)&&!/^(0x)?[0-9A-F]{64}$/.test(t)))}function u(t){return"string"==typeof t&&(!!t.match(/^(0x)?[0-9a-fA-F]{40}$/)||!!t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/))}e.isBloom=i,e.isInBloom=o,e.isUserEthereumAddressInBloom=function(t,e){if(!i(t))throw new Error("Invalid bloom given");if(!u(e))throw new Error(`Invalid ethereum address given: "${e}"`);return o(t,n.padLeft(e,64))},e.isContractAddressInBloom=function(t,e){if(!i(t))throw new Error("Invalid bloom given");if(!u(e))throw new Error(`Invalid contract address given: "${e}"`);return o(t,e)},e.isTopicInBloom=function(t,e){if(!i(t))throw new Error("Invalid bloom given");if(!s(e))throw new Error("Invalid topic");return o(t,e)},e.isTopic=s,e.isAddress=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(145);function i(t){if(null==t)throw new Error("cannot convert null value to array");if("string"==typeof t){const e=t.match(/^(0x)?[0-9a-fA-F]*$/);if(!e)throw new Error("invalid hexidecimal string");if("0x"!==e[1])throw new Error("hex string must have 0x prefix");(t=t.substring(2)).length%2&&(t="0"+t);const r=[];for(let e=0;e=256||parseInt(String(r))!=r)return!1}return!0}(t))return o(new Uint8Array(t));throw new Error("invalid arrayify value")}function o(t){return void 0!==t.slice||(t.slice=()=>{const e=Array.prototype.slice.call(arguments);return o(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}e.keccak256=function(t){return"0x"+n.keccak_256(i(t))},e.padLeft=(t,e)=>{const r=/^0x/i.test(t)||"number"==typeof t,n=e-(t=t.toString().replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(r?"0x":"")+new Array(n).join("0")+t},e.bytesToHex=function(t){const e=[];for(let r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return"0x"+e.join("").replace(/^0+/,"")},e.toByteArray=i},function(t,e,r){(function(n,i){var o; /** * [js-sha3]{@link https://github.com/emn178/js-sha3} * * @version 0.8.0 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2015-2018 * @license MIT */!function(){"use strict";var a="input is invalid type",s="object"==typeof window,u=s?window:{};u.JS_SHA3_NO_WINDOW&&(s=!1);var f=!s&&"object"==typeof self;!u.JS_SHA3_NO_NODE_JS&&"object"==typeof n&&n.versions&&n.versions.node?u=i:f&&(u=self);var h=!u.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,c=r(146),l=!u.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),p=[4,1024,262144,67108864],b=[0,8,16,24],m=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],v=[224,256,384,512],g=[128,256],y=["hex","buffer","arrayBuffer","array","digest"],_={128:168,256:136};!u.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!l||!u.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var w=function(t,e,r){return function(n){return new D(t,e,t).update(n)[r]()}},M=function(t,e,r){return function(n,i){return new D(t,e,i).update(n)[r]()}},A=function(t,e,r){return function(e,n,i,o){return k["cshake"+t].update(e,n,i,o)[r]()}},E=function(t,e,r){return function(e,n,i,o){return k["kmac"+t].update(e,n,i,o)[r]()}},S=function(t,e,r,n){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function L(t,e,r){D.call(this,t,e,r)}D.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(a);if(null===t)throw new Error(a);if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||l&&ArrayBuffer.isView(t)))throw new Error(a);e=!0}for(var n,i,o=this.blocks,s=this.byteCount,u=t.length,f=this.blockCount,h=0,c=this.s;h>2]|=t[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(o[n>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=s){for(this.start=n-s,this.block=o[f],n=0;n>=8);r>0;)i.unshift(r),r=255&(t>>=8),++n;return e?i.push(n):i.unshift(n),this.update(i),i.length},D.prototype.encodeString=function(t){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(a);if(null===t)throw new Error(a);if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||l&&ArrayBuffer.isView(t)))throw new Error(a);e=!0}var n=0,i=t.length;if(e)n=i;else for(var o=0;o=57344?n+=3:(s=65536+((1023&s)<<10|1023&t.charCodeAt(++o)),n+=4)}return n+=this.encode(8*n),this.update(t),n},D.prototype.bytepad=function(t,e){for(var r=this.encode(e),n=0;n>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+d[15&t]+d[t>>12&15]+d[t>>8&15]+d[t>>20&15]+d[t>>16&15]+d[t>>28&15]+d[t>>24&15];a%e==0&&(j(r),o=0)}return i&&(t=r[o],s+=d[t>>4&15]+d[15&t],i>1&&(s+=d[t>>12&15]+d[t>>8&15]),i>2&&(s+=d[t>>20&15]+d[t>>16&15])),s},D.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(t);a>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;s%r==0&&j(n)}return o&&(t=s<<2,e=n[a],u[t]=255&e,o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u},L.prototype=new D,L.prototype.finalize=function(){return this.encode(this.outputBits,!0),D.prototype.finalize.call(this)};var j=function(t){var e,r,n,i,o,a,s,u,f,h,c,l,d,p,b,v,g,y,_,w,M,A,E,S,x,I,k,T,O,P,B,C,N,R,D,L,j,F,U,z,q,H,V,G,K,Y,W,Z,J,X,$,Q,tt,et,rt,nt,it,ot,at,st,ut,ft,ht;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],f=t[5]^t[15]^t[25]^t[35]^t[45],h=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(l=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|s>>>31),r=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(s<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(u<<1|f>>>31),r=o^(f<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(h<<1|c>>>31),r=s^(c<<1|h>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(l<<1|d>>>31),r=f^(d<<1|l>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=h^(i<<1|o>>>31),r=c^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],b=t[1],Y=t[11]<<4|t[10]>>>28,W=t[10]<<4|t[11]>>>28,T=t[20]<<3|t[21]>>>29,O=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,V=t[41]<<18|t[40]>>>14,R=t[2]<<1|t[3]>>>31,D=t[3]<<1|t[2]>>>31,v=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,Z=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,P=t[33]<<13|t[32]>>>19,B=t[32]<<13|t[33]>>>19,ft=t[42]<<2|t[43]>>>30,ht=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,j=t[15]<<6|t[14]>>>26,y=t[25]<<11|t[24]>>>21,_=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,$=t[35]<<15|t[34]>>>17,C=t[45]<<29|t[44]>>>3,N=t[44]<<29|t[45]>>>3,S=t[6]<<28|t[7]>>>4,x=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,F=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,w=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,G=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,k=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,at=t[28]<<7|t[29]>>>25,z=t[38]<<8|t[39]>>>24,q=t[39]<<8|t[38]>>>24,A=t[48]<<14|t[49]>>>18,E=t[49]<<14|t[48]>>>18,t[0]=p^~v&y,t[1]=b^~g&_,t[10]=S^~I&T,t[11]=x^~k&O,t[20]=R^~L&F,t[21]=D^~j&U,t[30]=G^~Y&Z,t[31]=K^~W&J,t[40]=et^~nt&ot,t[41]=rt^~it&at,t[2]=v^~y&w,t[3]=g^~_&M,t[12]=I^~T&P,t[13]=k^~O&B,t[22]=L^~F&z,t[23]=j^~U&q,t[32]=Y^~Z&X,t[33]=W^~J&$,t[42]=nt^~ot&st,t[43]=it^~at&ut,t[4]=y^~w&A,t[5]=_^~M&E,t[14]=T^~P&C,t[15]=O^~B&N,t[24]=F^~z&H,t[25]=U^~q&V,t[34]=Z^~X&Q,t[35]=J^~$&tt,t[44]=ot^~st&ft,t[45]=at^~ut&ht,t[6]=w^~A&p,t[7]=M^~E&b,t[16]=P^~C&S,t[17]=B^~N&x,t[26]=z^~H&R,t[27]=q^~V&D,t[36]=X^~Q&G,t[37]=$^~tt&K,t[46]=st^~ft&et,t[47]=ut^~ht&rt,t[8]=A^~p&v,t[9]=E^~b&g,t[18]=C^~S&I,t[19]=N^~x&k,t[28]=H^~R&L,t[29]=V^~D&j,t[38]=Q^~G&Y,t[39]=tt^~K&W,t[48]=ft^~et&nt,t[49]=ht^~rt&it,t[0]^=m[n],t[1]^=m[n+1]};if(h)t.exports=k;else{for(O=0;O32||n256)throw new Error("Invalid uint"+n+" size");if((s=a(e)).bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+s.bitLength());if(s.lt(new i(0)))throw new Error("Supplied uint "+s.toString()+" is negative");return n?o.leftPad(s.toString("hex"),n/8*2):s}if(t.startsWith("int")){if(n%8||n<8||n>256)throw new Error("Invalid int"+n+" size");if((s=a(e)).bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+s.bitLength());return s.lt(new i(0))?s.toTwos(n).toString("hex"):n?o.leftPad(s.toString("hex"),n/8*2):s}throw new Error("Unsupported or invalid type: "+t)},u=function(t){if(n.isArray(t))throw new Error("Autodetection of array types is not supported.");var e,r,a="";if(n.isObject(t)&&(t.hasOwnProperty("v")||t.hasOwnProperty("t")||t.hasOwnProperty("value")||t.hasOwnProperty("type"))?(e=t.hasOwnProperty("t")?t.t:t.type,a=t.hasOwnProperty("v")?t.v:t.value):(e=o.toHex(t,!0),a=o.toHex(t),e.startsWith("int")||e.startsWith("uint")||(e="bytes")),!e.startsWith("int")&&!e.startsWith("uint")||"string"!=typeof a||/^(-)?0x/i.test(a)||(a=new i(a)),n.isArray(a)){if((r=function(t){var e=/^\D+\d*\[(\d+)\]$/.exec(t);return e?parseInt(e[1],10):null}(e))&&a.length!==r)throw new Error(e+" is not matching the given array "+JSON.stringify(a));r=a.length}return n.isArray(a)?a.map((function(t){return s(e,t,r).toString("hex").replace("0x","")})).join(""):s(e,a,r).toString("hex").replace("0x","")};t.exports={soliditySha3:function(){var t=Array.prototype.slice.call(arguments),e=n.map(t,u);return o.sha3("0x"+e.join(""))},soliditySha3Raw:function(){return o.sha3Raw("0x"+n.map(Array.prototype.slice.call(arguments),u).join(""))}}},function(t,e,r){"use strict";(function(e,n){var i=r(4).Buffer,o=e.crypto||e.msCrypto;o&&o.getRandomValues?t.exports=function(t,e){if(t>4294967295)throw new RangeError("requested too many random bytes");var r=i.allocUnsafe(t);if(t>0)if(t>65536)for(var a=0;a1){var i=r[1].match(b);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");L(i[2]).forEach((function(t){e.outputs.push(g(t))}))}return e}(t.trim()));throw new Error("unknown signature")};var _=function(t,e,r,n,i){this.coerceFunc=t,this.name=e,this.type=r,this.localName=n,this.dynamic=i},w=function(t){function e(e){var r=t.call(this,e.coerceFunc,e.name,e.type,void 0,e.dynamic)||this;return h.defineReadOnly(r,"coder",e),r}return i(e,t),e.prototype.encode=function(t){return this.coder.encode(t)},e.prototype.decode=function(t,e){return this.coder.decode(t,e)},e}(_),M=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return i(e,t),e.prototype.encode=function(t){return u.arrayify([])},e.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},e}(_),A=function(t){function e(e,r,n,i){var o=this,a=(n?"int":"uint")+8*r;return(o=t.call(this,e,a,a,i,!1)||this).size=r,o.signed=n,o}return i(e,t),e.prototype.encode=function(t){try{var e=s.bigNumberify(t);return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),u.padZeros(u.arrayify(e),32)}catch(e){c.throwError("invalid number value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length32)throw new Error;e.set(r)}catch(e){c.throwError("invalid "+this.name+" value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},e.prototype.decode=function(t,e){return t.length=0?n:"")+"]",s=-1===n||r.dynamic;return(o=t.call(this,e,"array",a,i,s)||this).coder=r,o.length=n,o}return i(e,t),e.prototype.encode=function(t){Array.isArray(t)||c.throwError("expected array value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=E.encode(e)),c.checkArgumentCount(e,t.length,"in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&c.throwError("invalid "+r[1]+" bit length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new A(t,i/8,"int"===r[1],e.name);if(r=e.type.match(l))return(0===(i=parseInt(r[1]))||i>32)&&c.throwError("invalid bytes length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new x(t,i,e.name);if(r=e.type.match(p)){var i=parseInt(r[2]||"-1");return(e=h.jsonCopy(e)).type=r[1],new R(t,F(t,e),i,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var n=[];return e.forEach((function(e){n.push(F(t,e))})),new D(t,n,r)}(t,e.components,e.name):""===e.type?new M(t,e.name):(c.throwError("invalid type",c.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var U=function(){function t(r){c.checkNew(this,t),r||(r=e.defaultCoerceFunc),h.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&c.throwError("types/values length mismatch",c.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach((function(t){var e=null;e="string"==typeof t?g(t):t,r.push(F(this.coerceFunc,e))}),this),u.hexlify(new D(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach((function(t){var e=null;e="string"==typeof t?g(t):h.jsonCopy(t),r.push(F(this.coerceFunc,e))}),this),new D(this.coerceFunc,r,"_").decode(u.arrayify(e),0).value},t}();e.AbiCoder=U,e.defaultAbiCoder=new U},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(3)),o=r(16),a=r(151),s=r(153),u=r(26);function f(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);r=o.arrayify(a.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(15&r[i>>1])>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var h={},c=0;c<10;c++)h[String(c)]=String(c);for(c=0;c<26;c++)h[String.fromCharCode(65+c)]=String(10+c);var l,d=Math.floor((l=9007199254740991,Math.log10?Math.log10(l):Math.log(l)/Math.LN10));function p(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=h[t]}));e.length>=d;){var r=e.substring(0,d);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function b(t){var e=null;if("string"!=typeof t&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=f(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:t}),e=new i.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=f("0x"+e)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=b,e.getIcapAddress=function(t){for(var e=new i.default.BN(b(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e},e.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return b("0x"+a.keccak256(s.encode([b(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(152),i=r(16);e.keccak256=function(t){return"0x"+n.keccak_256(i.arrayify(t))}},function(t,e,r){(function(e,r){ /** * [js-sha3]{@link https://github.com/emn178/js-sha3} * * @version 0.5.7 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2015-2016 * @license MIT */ !function(){"use strict";var n="object"==typeof window?window:{};!n.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(n=r);for(var i=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),a=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],u=[224,256,384,512],f=["hex","buffer","arrayBuffer","array"],h=function(t,e,r){return function(n){return new w(t,e,t).update(n)[r]()}},c=function(t,e,r){return function(n,i){return new w(t,e,i).update(n)[r]()}},l=function(t,e){var r=h(t,e,"hex");r.create=function(){return new w(t,e,t)},r.update=function(t){return r.create().update(t)};for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}w.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,s=this.byteCount,u=this.blockCount,f=0,h=this.s;f>2]|=t[f]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[r>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=s){for(this.start=r-s,this.block=o[u],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];s%e==0&&(M(r),a=0)}return i&&(t=r[a],i>0&&(u+=o[t>>4&15]+o[15&t]),i>1&&(u+=o[t>>12&15]+o[t>>8&15]),i>2&&(u+=o[t>>20&15]+o[t>>16&15])),u},w.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(t);a>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;s%r==0&&M(n)}return o&&(t=s<<2,e=n[a],o>0&&(u[t]=255&e),o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u};var M=function(t){var e,r,n,i,o,a,u,f,h,c,l,d,p,b,m,v,g,y,_,w,M,A,E,S,x,I,k,T,O,P,B,C,N,R,D,L,j,F,U,z,q,H,V,G,K,Y,W,Z,J,X,$,Q,tt,et,rt,nt,it,ot,at,st,ut,ft,ht;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],f=t[4]^t[14]^t[24]^t[34]^t[44],h=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(f<<1|h>>>31),r=o^(h<<1|f>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(c<<1|l>>>31),r=u^(l<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=f^(d<<1|p>>>31),r=h^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(i<<1|o>>>31),r=l^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,b=t[0],m=t[1],Y=t[11]<<4|t[10]>>>28,W=t[10]<<4|t[11]>>>28,T=t[20]<<3|t[21]>>>29,O=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,V=t[41]<<18|t[40]>>>14,R=t[2]<<1|t[3]>>>31,D=t[3]<<1|t[2]>>>31,v=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,Z=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,P=t[33]<<13|t[32]>>>19,B=t[32]<<13|t[33]>>>19,ft=t[42]<<2|t[43]>>>30,ht=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,j=t[15]<<6|t[14]>>>26,y=t[25]<<11|t[24]>>>21,_=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,$=t[35]<<15|t[34]>>>17,C=t[45]<<29|t[44]>>>3,N=t[44]<<29|t[45]>>>3,S=t[6]<<28|t[7]>>>4,x=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,F=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,w=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,G=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,k=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,at=t[28]<<7|t[29]>>>25,z=t[38]<<8|t[39]>>>24,q=t[39]<<8|t[38]>>>24,A=t[48]<<14|t[49]>>>18,E=t[49]<<14|t[48]>>>18,t[0]=b^~v&y,t[1]=m^~g&_,t[10]=S^~I&T,t[11]=x^~k&O,t[20]=R^~L&F,t[21]=D^~j&U,t[30]=G^~Y&Z,t[31]=K^~W&J,t[40]=et^~nt&ot,t[41]=rt^~it&at,t[2]=v^~y&w,t[3]=g^~_&M,t[12]=I^~T&P,t[13]=k^~O&B,t[22]=L^~F&z,t[23]=j^~U&q,t[32]=Y^~Z&X,t[33]=W^~J&$,t[42]=nt^~ot&st,t[43]=it^~at&ut,t[4]=y^~w&A,t[5]=_^~M&E,t[14]=T^~P&C,t[15]=O^~B&N,t[24]=F^~z&H,t[25]=U^~q&V,t[34]=Z^~X&Q,t[35]=J^~$&tt,t[44]=ot^~st&ft,t[45]=at^~ut&ht,t[6]=w^~A&b,t[7]=M^~E&m,t[16]=P^~C&S,t[17]=B^~N&x,t[26]=z^~H&R,t[27]=q^~V&D,t[36]=X^~Q&G,t[37]=$^~tt&K,t[46]=st^~ft&et,t[47]=ut^~ht&rt,t[8]=A^~b&v,t[9]=E^~m&g,t[18]=C^~S&I,t[19]=N^~x&k,t[28]=H^~R&L,t[29]=V^~D&j,t[38]=Q^~G&Y,t[39]=tt^~K&W,t[48]=ft^~et&nt,t[49]=ht^~rt&it,t[0]^=s[n],t[1]^=s[n+1]};if(i)t.exports=p;else for(m=0;m>=8;return e}function o(t,e,r){for(var n=0,i=0;ie+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}function s(t,e){if(0===t.length)throw new Error("invalid rlp data");if(t[e]>=248){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(i=o(t,e+1,r))>t.length)throw new Error("to short");return a(t,e,e+1+r,r+i)}if(t[e]>=192){if(e+1+(i=t[e]-192)>t.length)throw new Error("invalid rlp data");return a(t,e,e+1,i)}if(t[e]>=184){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(i=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(t.slice(e+1+r,e+1+r+i))}}if(t[e]>=128){var i;if(e+1+(i=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+i,result:n.hexlify(t.slice(e+1,e+1+i))}}return{consumed:1,result:n.hexlify(t[e])}}e.encode=function(t){return n.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach((function(e){r=r.concat(t(e))})),r.length<=55?(r.unshift(192+r.length),r):((o=i(r.length)).unshift(247+o.length),o.concat(r))}var o,a=Array.prototype.slice.call(n.arrayify(e));return 1===a.length&&a[0]<=127?a:a.length<=55?(a.unshift(128+a.length),a):((o=i(a.length)).unshift(183+o.length),o.concat(a))}(t))},e.decode=function(t){var e=n.arrayify(t),r=s(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var s=o(r(3)),u=r(16),f=r(63),h=r(62),c=a(r(26)),l=new s.default.BN(-1);function d(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function p(t){return v(t)._bn}function b(t){return new m(d(t))}var m=function(t){function e(r){var n=t.call(this)||this;if(c.checkNew(n,e),"string"==typeof r)u.isHexString(r)?("0x"==r&&(r="0x0"),f.defineReadOnly(n,"_hex",r)):"-"===r[0]&&u.isHexString(r.substring(1))?f.defineReadOnly(n,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),f.defineReadOnly(n,"_hex",d(new s.default.BN(r)))):c.throwError("invalid BigNumber string value",c.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(String(r))!==r&&c.throwError("underflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(String(r))});try{f.defineReadOnly(n,"_hex",d(new s.default.BN(r)))}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else r instanceof e?f.defineReadOnly(n,"_hex",r._hex):r.toHexString?f.defineReadOnly(n,"_hex",d(p(r.toHexString()))):u.isArrayish(r)?f.defineReadOnly(n,"_hex",d(new s.default.BN(u.hexlify(r).substring(2),16))):c.throwError("invalid BigNumber value",c.INVALID_ARGUMENT,{arg:"value",value:r});return n}return i(e,t),Object.defineProperty(e.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new s.default.BN(this._hex.substring(3),16).mul(l):new s.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),e.prototype.fromTwos=function(t){return b(this._bn.fromTwos(t))},e.prototype.toTwos=function(t){return b(this._bn.toTwos(t))},e.prototype.add=function(t){return b(this._bn.add(p(t)))},e.prototype.sub=function(t){return b(this._bn.sub(p(t)))},e.prototype.div=function(t){return v(t).isZero()&&c.throwError("division by zero",c.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),b(this._bn.div(p(t)))},e.prototype.mul=function(t){return b(this._bn.mul(p(t)))},e.prototype.mod=function(t){return b(this._bn.mod(p(t)))},e.prototype.pow=function(t){return b(this._bn.pow(p(t)))},e.prototype.maskn=function(t){return b(this._bn.maskn(t))},e.prototype.eq=function(t){return this._bn.eq(p(t))},e.prototype.lt=function(t){return this._bn.lt(p(t))},e.prototype.lte=function(t){return this._bn.lte(p(t))},e.prototype.gt=function(t){return this._bn.gt(p(t))},e.prototype.gte=function(t){return this._bn.gte(p(t))},e.prototype.isZero=function(){return this._bn.isZero()},e.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},e.prototype.toString=function(){return this._bn.toString(10)},e.prototype.toHexString=function(){return this._hex},e}(h.BigNumber);function v(t){return t instanceof m?t:new m(t)}e.bigNumberify=v,e.ConstantNegativeOne=v(-1),e.ConstantZero=v(0),e.ConstantOne=v(1),e.ConstantTwo=v(2),e.ConstantWeiPerEther=v("1000000000000000000")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=r(16);!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(n=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=function(t,e){void 0===e&&(e=n.current),e!=n.current&&(t=t.normalize(e));for(var r=[],o=0,a=0;a>6|192,r[o++]=63&s|128):55296==(64512&s)&&a+1>18|240,r[o++]=s>>12&63|128,r[o++]=s>>6&63|128,r[o++]=63&s|128):(r[o++]=s>>12|224,r[o++]=s>>6&63|128,r[o++]=63&s|128)}return i.arrayify(r)},e.toUtf8String=function(t){t=i.arrayify(t);for(var e="",r=0;r>7!=0){if(n>>6!=2){var o=null;if(n>>5==6)o=1;else if(n>>4==14)o=2;else if(n>>3==30)o=3;else if(n>>2==62)o=4;else{if(n>>1!=126)continue;o=5}if(r+o>t.length){for(;r>6==2;r++);if(r!=t.length)continue;return e}var a,s=n&(1<<8-o-1)-1;for(a=0;a>6!=2)break;s=s<<6|63&u}a==o?s<=65535?e+=String.fromCharCode(s):(s-=65536,e+=String.fromCharCode(55296+(s>>10&1023),56320+(1023&s))):r--}}else e+=String.fromCharCode(n)}return e}},function(t,e,r){"use strict";(function(t){var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0))return!0;for(var e=0,r=this._supportedHardforks;e=i},t.prototype.activeOnBlock=function(t,e){return this.hardforkIsActiveOnBlock(null,t,e)},t.prototype.hardforkGteHardfork=function(t,e,r){var n=void 0!==(r=void 0!==r?r:{}).onlyActive&&r.onlyActive;t=this._chooseHardfork(t,r.onlySupported);for(var i=-1,o=-1,a=0,s=0,u=n?this.activeHardforks(null,r):this.hardforks();s=o},t.prototype.gteHardfork=function(t,e){return this.hardforkGteHardfork(null,t,e)},t.prototype.hardforkIsActiveOnChain=function(t,e){var r=void 0!==(e=void 0!==e?e:{}).onlySupported&&e.onlySupported;t=this._chooseHardfork(t,r);for(var n=0,i=this.hardforks();n0)return r[r.length-1].name;throw new Error("No (supported) active hardfork found")},t.prototype.hardforkBlock=function(t){return t=this._chooseHardfork(t,!1),this._getHardfork(t).block},t.prototype.isHardforkBlock=function(t,e){return e=this._chooseHardfork(e,!1),this.hardforkBlock(e)===t},t.prototype.consensus=function(t){return t=this._chooseHardfork(t),this._getHardfork(t).consensus},t.prototype.finality=function(t){return t=this._chooseHardfork(t),this._getHardfork(t).finality},t.prototype.genesis=function(){return this._chainParams.genesis},t.prototype.hardforks=function(){return this._chainParams.hardforks},t.prototype.bootstrapNodes=function(){return this._chainParams.bootstrapNodes},t.prototype.hardfork=function(){return this._hardfork},t.prototype.chainId=function(){return this._chainParams.chainId},t.prototype.chainName=function(){return i.chains.names[this.chainId()]||this._chainParams.name},t.prototype.networkId=function(){return this._chainParams.networkId},t}();e.default=a},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.chains={names:{1:"mainnet",3:"ropsten",4:"rinkeby",42:"kovan",6284:"goerli"},mainnet:r(159),ropsten:r(160),rinkeby:r(161),kovan:r(162),goerli:r(163)}},function(t){t.exports=JSON.parse('{"name":"mainnet","chainId":1,"networkId":1,"comment":"The Ethereum main chain","url":"https://ethstats.net/","genesis":{"hash":"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3","timestamp":null,"gasLimit":5000,"difficulty":17179869184,"nonce":"0x0000000000000042","extraData":"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa","stateRoot":"0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544"},"hardforks":[{"name":"chainstart","block":0,"consensus":"pow","finality":null},{"name":"homestead","block":1150000,"consensus":"pow","finality":null},{"name":"dao","block":1920000,"consensus":"pow","finality":null},{"name":"tangerineWhistle","block":2463000,"consensus":"pow","finality":null},{"name":"spuriousDragon","block":2675000,"consensus":"pow","finality":null},{"name":"byzantium","block":4370000,"consensus":"pow","finality":null},{"name":"constantinople","block":7280000,"consensus":"pow","finality":null},{"name":"petersburg","block":7280000,"consensus":"pow","finality":null},{"name":"istanbul","block":9069000,"consensus":"pow","finality":null},{"name":"muirGlacier","block":9200000,"consensus":"pow","finality":null}],"bootstrapNodes":[{"ip":"13.93.211.84","port":30303,"id":"3f1d12044546b76342d59d4a05532c14b85aa669704bfe1f864fe079415aa2c02d743e03218e57a33fb94523adb54032871a6c51b2cc5514cb7c7e35b3ed0a99","location":"US-WEST","comment":"Go Bootnode"},{"ip":"191.235.84.50","port":30303,"id":"78de8a0916848093c73790ead81d1928bec737d565119932b98c6b100d944b7a95e94f847f689fc723399d2e31129d182f7ef3863f2b4c820abbf3ab2722344d","location":"BR","comment":"Go Bootnode"},{"ip":"13.75.154.138","port":30303,"id":"158f8aab45f6d19c6cbf4a089c2670541a8da11978a2f90dbf6a502a4a3bab80d288afdbeb7ec0ef6d92de563767f3b1ea9e8e334ca711e9f8e2df5a0385e8e6","location":"AU","comment":"Go Bootnode"},{"ip":"52.74.57.123","port":30303,"id":"1118980bf48b0a3640bdba04e0fe78b1add18e1cd99bf22d53daac1fd9972ad650df52176e7c7d89d1114cfef2bc23a2959aa54998a46afcf7d91809f0855082","location":"SG","comment":"Go Bootnode"}]}')},function(t){t.exports=JSON.parse('{"name":"ropsten","chainId":3,"networkId":3,"comment":"PoW test network","url":"https://github.com/ethereum/ropsten","genesis":{"hash":"0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d","timestamp":null,"gasLimit":16777216,"difficulty":1048576,"nonce":"0x0000000000000042","extraData":"0x3535353535353535353535353535353535353535353535353535353535353535","stateRoot":"0x217b0bbcfb72e2d57e28f33cb361b9983513177755dc3f33ce3e7022ed62b77b"},"hardforks":[{"name":"chainstart","block":0,"consensus":"pow","finality":null},{"name":"homestead","block":0,"consensus":"pow","finality":null},{"name":"dao","block":null,"consensus":"pow","finality":null},{"name":"tangerineWhistle","block":0,"consensus":"pow","finality":null},{"name":"spuriousDragon","block":10,"consensus":"pow","finality":null},{"name":"byzantium","block":1700000,"consensus":"pow","finality":null},{"name":"constantinople","block":4230000,"consensus":"pow","finality":null},{"name":"petersburg","block":4939394,"consensus":"pow","finality":null},{"name":"istanbul","block":6485846,"consensus":"pow","finality":null},{"name":"muirGlacier","block":7117117,"consensus":"pow","finality":null}],"bootstrapNodes":[{"ip":"52.176.7.10","port":"30303","id":"30b7ab30a01c124a6cceca36863ece12c4f5fa68e3ba9b0b51407ccc002eeed3b3102d20a88f1c1d3c3154e2449317b8ef95090e77b312d5cc39354f86d5d606","network":"Ropsten","chainId":3,"location":"US","comment":"US-Azure geth"},{"ip":"52.176.100.77","port":"30303","id":"865a63255b3bb68023b6bffd5095118fcc13e79dcf014fe4e47e065c350c7cc72af2e53eff895f11ba1bbb6a2b33271c1116ee870f266618eadfc2e78aa7349c","network":"Ropsten","chainId":3,"location":"US","comment":"US-Azure parity"},{"ip":"52.232.243.152","port":"30303","id":"6332792c4a00e3e4ee0926ed89e0d27ef985424d97b6a45bf0f23e51f0dcb5e66b875777506458aea7af6f9e4ffb69f43f3778ee73c81ed9d34c51c4b16b0b0f","network":"Ropsten","chainId":3,"location":"US","comment":"Parity"},{"ip":"192.81.208.223","port":"30303","id":"94c15d1b9e2fe7ce56e458b9a3b672ef11894ddedd0c6f247e0f1d3487f52b66208fb4aeb8179fce6e3a749ea93ed147c37976d67af557508d199d9594c35f09","network":"Ropsten","chainId":3,"location":"US","comment":"@gpip"}]}')},function(t){t.exports=JSON.parse('{"name":"rinkeby","chainId":4,"networkId":4,"comment":"PoA test network","url":"https://www.rinkeby.io","genesis":{"hash":"0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177","timestamp":"0x58ee40ba","gasLimit":4700000,"difficulty":1,"nonce":"0x0000000000000000","extraData":"0x52657370656374206d7920617574686f7269746168207e452e436172746d616e42eb768f2244c8811c63729a21a3569731535f067ffc57839b00206d1ad20c69a1981b489f772031b279182d99e65703f0076e4812653aab85fca0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","stateRoot":"0x53580584816f617295ea26c0e17641e0120cab2f0a8ffb53a866fd53aa8e8c2d"},"hardforks":[{"name":"chainstart","block":0,"consensus":"poa","finality":null},{"name":"homestead","block":1,"consensus":"poa","finality":null},{"name":"dao","block":null,"consensus":"poa","finality":null},{"name":"tangerineWhistle","block":2,"consensus":"poa","finality":null},{"name":"spuriousDragon","block":3,"consensus":"poa","finality":null},{"name":"byzantium","block":1035301,"consensus":"poa","finality":null},{"name":"constantinople","block":3660663,"consensus":"poa","finality":null},{"name":"petersburg","block":4321234,"consensus":"poa","finality":null},{"name":"istanbul","block":5435345,"consensus":"poa","finality":null}],"bootstrapNodes":[{"ip":"52.169.42.101","port":30303,"id":"a24ac7c5484ef4ed0c5eb2d36620ba4e4aa13b8c84684e1b4aab0cebea2ae45cb4d375b77eab56516d34bfbd3c1a833fc51296ff084b770b94fb9028c4d25ccf","location":"IE","comment":""},{"ip":"52.3.158.184","port":30303,"id":"343149e4feefa15d882d9fe4ac7d88f885bd05ebb735e547f12e12080a9fa07c8014ca6fd7f373123488102fe5e34111f8509cf0b7de3f5b44339c9f25e87cb8","location":"","comment":"INFURA"}]}')},function(t){t.exports=JSON.parse('{"name":"kovan","chainId":42,"networkId":42,"comment":"Parity PoA test network","url":"https://kovan-testnet.github.io/website/","genesis":{"hash":"0xa3c565fc15c7478862d50ccd6561e3c06b24cc509bf388941c25ea985ce32cb9","timestamp":null,"gasLimit":6000000,"difficulty":131072,"nonce":"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","extraData":"0x","stateRoot":"0x2480155b48a1cea17d67dbfdfaafe821c1d19cdd478c5358e8ec56dec24502b2"},"hardforks":[{"name":"chainstart","block":0,"consensus":"poa","finality":null},{"name":"homestead","block":0,"consensus":"poa","finality":null},{"name":"dao","block":0,"consensus":"poa","finality":null},{"name":"tangerineWhistle","block":0,"consensus":"poa","finality":null},{"name":"spuriousDragon","block":0,"consensus":"poa","finality":null},{"name":"byzantium","block":5067000,"consensus":"poa","finality":null},{"name":"constantinople","block":9200000,"consensus":"poa","finality":null},{"name":"petersburg","block":10255201,"consensus":"poa","finality":null},{"name":"istanbul","block":14111141,"consensus":"poa","finality":null}],"bootstrapNodes":[{"ip":"40.71.221.215","port":30303,"id":"56abaf065581a5985b8c5f4f88bd202526482761ba10be9bfdcd14846dd01f652ec33fde0f8c0fd1db19b59a4c04465681fcef50e11380ca88d25996191c52de","location":"","comment":"Parity Bootnode"},{"ip":"52.166.117.77","port":30303,"id":"d07827483dc47b368eaf88454fb04b41b7452cf454e194e2bd4c14f98a3278fed5d819dbecd0d010407fc7688d941ee1e58d4f9c6354d3da3be92f55c17d7ce3","location":"","comment":"Parity Bootnode"},{"ip":"52.165.239.18","port":30303,"id":"8fa162563a8e5a05eef3e1cd5abc5828c71344f7277bb788a395cce4a0e30baf2b34b92fe0b2dbbba2313ee40236bae2aab3c9811941b9f5a7e8e90aaa27ecba","location":"","comment":"Parity Bootnode"},{"ip":"52.243.47.56","port":30303,"id":"7e2e7f00784f516939f94e22bdc6cf96153603ca2b5df1c7cc0f90a38e7a2f218ffb1c05b156835e8b49086d11fdd1b3e2965be16baa55204167aa9bf536a4d9","location":"","comment":"Parity Bootnode"},{"ip":"40.68.248.100","port":30303,"id":"0518a3d35d4a7b3e8c433e7ffd2355d84a1304ceb5ef349787b556197f0c87fad09daed760635b97d52179d645d3e6d16a37d2cc0a9945c2ddf585684beb39ac","location":"","comment":"Parity Bootnode"}]}')},function(t){t.exports=JSON.parse('{"name":"goerli","chainId":5,"networkId":5,"comment":"Cross-client PoA test network","url":"https://github.com/goerli/testnet","genesis":{"hash":"0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a","timestamp":"0x5c51a607","gasLimit":10485760,"difficulty":1,"nonce":"0x0000000000000000","extraData":"0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","stateRoot":"0x5d6cded585e73c4e322c30c2f782a336316f17dd85a4863b9d838d2d4b8b3008"},"hardforks":[{"name":"chainstart","block":0,"consensus":"poa","finality":null},{"name":"homestead","block":0,"consensus":"poa","finality":null},{"name":"dao","block":0,"consensus":"poa","finality":null},{"name":"tangerineWhistle","block":0,"consensus":"poa","finality":null},{"name":"spuriousDragon","block":0,"consensus":"poa","finality":null},{"name":"byzantium","block":0,"consensus":"poa","finality":null},{"name":"constantinople","block":0,"consensus":"poa","finality":null},{"name":"petersburg","block":0,"consensus":"poa","finality":null},{"name":"istanbul","block":1561651,"consensus":"poa","finality":null}],"bootstrapNodes":[{"ip":"51.141.78.53","port":30303,"id":"011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a","location":"","comment":"Source: https://github.com/goerli/testnet/blob/master/bootnodes.txt"},{"ip":"13.93.54.137","port":30303,"id":"176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b","location":"","comment":"Source: https://github.com/goerli/testnet/blob/master/bootnodes.txt"},{"ip":"94.237.54.114","port":30313,"id":"46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291","location":"","comment":"Source: https://github.com/goerli/testnet/blob/master/bootnodes.txt"},{"ip":"52.64.155.147","port":30303,"id":"c1f8b7c2ac4453271fa07d8e9ecf9a2e8285aa0bd0c07df0131f47153306b0736fd3db8924e7a9bf0bed6b1d8d4f87362a71b033dc7c64547728d953e43e59b2","location":"","comment":"Source: https://github.com/goerli/testnet/blob/master/bootnodes.txt"},{"ip":"213.186.16.82","port":30303,"id":"f4a9c6ee28586009fb5a96c8af13a58ed6d8315a9eee4772212c1d4d9cebe5a8b8a78ea4434f318726317d04a3f531a1ef0420cf9752605a562cfe858c46e263","location":"","comment":"Source: https://github.com/goerli/testnet/blob/master/bootnodes.txt"}]}')},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hardforks=[["chainstart",r(165)],["homestead",r(166)],["dao",r(167)],["tangerineWhistle",r(168)],["spuriousDragon",r(169)],["byzantium",r(170)],["constantinople",r(171)],["petersburg",r(172)],["istanbul",r(173)],["muirGlacier",r(174)]]},function(t){t.exports=JSON.parse('{"name":"chainstart","comment":"Start of the Ethereum main chain","eip":{"url":"","status":""},"status":"","gasConfig":{"minGasLimit":{"v":5000,"d":"Minimum the gas limit may ever be"},"gasLimitBoundDivisor":{"v":1024,"d":"The bound divisor of the gas limit, used in update calculations"}},"gasPrices":{"base":{"v":2,"d":"Gas base cost, used e.g. for ChainID opcode (Istanbul)"},"tierStep":{"v":[0,2,3,5,8,10,20],"d":"Once per operation, for a selection of them"},"exp":{"v":10,"d":"Once per EXP instuction"},"expByte":{"v":10,"d":"Times ceil(log256(exponent)) for the EXP instruction"},"sha3":{"v":30,"d":"Once per SHA3 operation"},"sha3Word":{"v":6,"d":"Once per word of the SHA3 operation\'s data"},"sload":{"v":50,"d":"Once per SLOAD operation"},"sstoreSet":{"v":20000,"d":"Once per SSTORE operation if the zeroness changes from zero"},"sstoreReset":{"v":5000,"d":"Once per SSTORE operation if the zeroness does not change from zero"},"sstoreRefund":{"v":15000,"d":"Once per SSTORE operation if the zeroness changes to zero"},"jumpdest":{"v":1,"d":"Refunded gas, once per SSTORE operation if the zeroness changes to zero"},"log":{"v":375,"d":"Per LOG* operation"},"logData":{"v":8,"d":"Per byte in a LOG* operation\'s data"},"logTopic":{"v":375,"d":"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas"},"create":{"v":32000,"d":"Once per CREATE operation & contract-creation transaction"},"call":{"v":40,"d":"Once per CALL operation & message call transaction"},"callStipend":{"v":2300,"d":"Free gas given at beginning of call"},"callValueTransfer":{"v":9000,"d":"Paid for CALL when the value transfor is non-zero"},"callNewAccount":{"v":25000,"d":"Paid for CALL when the destination address didn\'t exist prior"},"selfdestructRefund":{"v":24000,"d":"Refunded following a selfdestruct operation"},"memory":{"v":3,"d":"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL"},"quadCoeffDiv":{"v":512,"d":"Divisor for the quadratic particle of the memory cost equation"},"createData":{"v":200,"d":""},"tx":{"v":21000,"d":"Per transaction. NOTE: Not payable on data of calls between transactions"},"txCreation":{"v":32000,"d":"The cost of creating a contract via tx"},"txDataZero":{"v":4,"d":"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions"},"txDataNonZero":{"v":68,"d":"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},"copy":{"v":3,"d":"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added"},"ecRecover":{"v":3000,"d":""},"sha256":{"v":60,"d":""},"sha256Word":{"v":12,"d":""},"ripemd160":{"v":600,"d":""},"ripemd160Word":{"v":120,"d":""},"identity":{"v":15,"d":""},"identityWord":{"v":3,"d":""}},"vm":{"stackLimit":{"v":1024,"d":"Maximum size of VM stack allowed"},"callCreateDepth":{"v":1024,"d":"Maximum depth of call/create stack"},"maxExtraDataSize":{"v":32,"d":"Maximum size extra data may be after Genesis"}},"pow":{"minimumDifficulty":{"v":131072,"d":"The minimum that the difficulty may ever be"},"difficultyBoundDivisor":{"v":2048,"d":"The bound divisor of the difficulty, used in the update calculations"},"durationLimit":{"v":13,"d":"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not"},"epochDuration":{"v":30000,"d":"Duration between proof-of-work epochs"},"timebombPeriod":{"v":100000,"d":"Exponential difficulty timebomb period"},"minerReward":{"v":"5000000000000000000","d":"the amount a miner get rewarded for mining a block"}},"casper":{},"sharding":{}}')},function(t){t.exports=JSON.parse('{"name":"homestead","comment":"Homestead hardfork with protocol and network changes","eip":{"url":"https://eips.ethereum.org/EIPS/eip-606","status":"Final"},"gasConfig":{},"gasPrices":{},"vm":{},"pow":{},"casper":{},"sharding":{}}')},function(t){t.exports=JSON.parse('{"name":"dao","comment":"DAO rescue hardfork","eip":{"url":"https://eips.ethereum.org/EIPS/eip-779","status":"Final"},"gasConfig":{},"gasPrices":{},"vm":{},"pow":{},"casper":{},"sharding":{}}')},function(t){t.exports=JSON.parse('{"name":"tangerineWhistle","comment":"Hardfork with gas cost changes for IO-heavy operations","eip":{"url":"https://eips.ethereum.org/EIPS/eip-608","status":"Final"},"gasConfig":{},"gasPrices":{"sload":{"v":200,"d":"Once per SLOAD operation"},"call":{"v":700,"d":"Once per CALL operation & message call transaction"}},"vm":{},"pow":{},"casper":{},"sharding":{}}')},function(t){t.exports=JSON.parse('{"name":"spuriousDragon","comment":"HF with EIPs for simple replay attack protection, EXP cost increase, state trie clearing, contract code size limit","eip":{"url":"https://eips.ethereum.org/EIPS/eip-607","status":"Final"},"gasConfig":{},"gasPrices":{"expByte":{"v":50,"d":"Times ceil(log256(exponent)) for the EXP instruction"}},"vm":{"maxCodeSize":{"v":24576,"d":"Maximum length of contract code"}},"pow":{},"casper":{},"sharding":{}}')},function(t){t.exports=JSON.parse('{"name":"byzantium","comment":"Hardfork with new precompiles, instructions and other protocol changes","eip":{"url":"https://eips.ethereum.org/EIPS/eip-609","status":"Final"},"gasConfig":{},"gasPrices":{"modexpGquaddivisor":{"v":20,"d":"Gquaddivisor from modexp precompile for gas calculation"},"ecAdd":{"v":500,"d":"Gas costs for curve addition precompile"},"ecMul":{"v":40000,"d":"Gas costs for curve multiplication precompile"},"ecPairing":{"v":100000,"d":"Base gas costs for curve pairing precompile"},"ecPairingWord":{"v":80000,"d":"Gas costs regarding curve pairing precompile input length"}},"vm":{},"pow":{"minerReward":{"v":"3000000000000000000","d":"the amount a miner get rewarded for mining a block"}},"casper":{},"sharding":{}}')},function(t){t.exports=JSON.parse('{"name":"constantinople","comment":"Postponed hardfork including EIP-1283 (SSTORE gas metering changes)","eip":{"url":"https://eips.ethereum.org/EIPS/eip-1013","status":"Final"},"gasConfig":{},"gasPrices":{"netSstoreNoopGas":{"v":200,"d":"Once per SSTORE operation if the value doesn\'t change"},"netSstoreInitGas":{"v":20000,"d":"Once per SSTORE operation from clean zero"},"netSstoreCleanGas":{"v":5000,"d":"Once per SSTORE operation from clean non-zero"},"netSstoreDirtyGas":{"v":200,"d":"Once per SSTORE operation from dirty"},"netSstoreClearRefund":{"v":15000,"d":"Once per SSTORE operation for clearing an originally existing storage slot"},"netSstoreResetRefund":{"v":4800,"d":"Once per SSTORE operation for resetting to the original non-zero value"},"netSstoreResetClearRefund":{"v":19800,"d":"Once per SSTORE operation for resetting to the original zero value"}},"vm":{},"pow":{"minerReward":{"v":"2000000000000000000","d":"The amount a miner gets rewarded for mining a block"}},"casper":{},"sharding":{}}')},function(t){t.exports=JSON.parse('{"name":"petersburg","comment":"Aka constantinopleFix, removes EIP-1283, activate together with or after constantinople","eip":{"url":"https://github.com/ethereum/EIPs/pull/1716","status":"Draft"},"gasConfig":{},"gasPrices":{"netSstoreNoopGas":{"v":null,"d":"Removed along EIP-1283"},"netSstoreInitGas":{"v":null,"d":"Removed along EIP-1283"},"netSstoreCleanGas":{"v":null,"d":"Removed along EIP-1283"},"netSstoreDirtyGas":{"v":null,"d":"Removed along EIP-1283"},"netSstoreClearRefund":{"v":null,"d":"Removed along EIP-1283"},"netSstoreResetRefund":{"v":null,"d":"Removed along EIP-1283"},"netSstoreResetClearRefund":{"v":null,"d":"Removed along EIP-1283"}},"vm":{},"pow":{},"casper":{},"sharding":{}}')},function(t){t.exports=JSON.parse('{"name":"istanbul","comment":"HF targeted for December 2019 following the Constantinople/Petersburg HF","eip":{"url":"https://eips.ethereum.org/EIPS/eip-1679","status":"Draft"},"gasConfig":{},"gasPrices":{"blake2Round":{"v":1,"d":"Gas cost per round for the Blake2 F precompile"},"ecAdd":{"v":150,"d":"Gas costs for curve addition precompile"},"ecMul":{"v":6000,"d":"Gas costs for curve multiplication precompile"},"ecPairing":{"v":45000,"d":"Base gas costs for curve pairing precompile"},"ecPairingWord":{"v":34000,"d":"Gas costs regarding curve pairing precompile input length"},"txDataNonZero":{"v":16,"d":"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},"sstoreSentryGasEIP2200":{"v":2300,"d":"Minimum gas required to be present for an SSTORE call, not consumed"},"sstoreNoopGasEIP2200":{"v":800,"d":"Once per SSTORE operation if the value doesn\'t change"},"sstoreDirtyGasEIP2200":{"v":800,"d":"Once per SSTORE operation if a dirty value is changed"},"sstoreInitGasEIP2200":{"v":20000,"d":"Once per SSTORE operation from clean zero to non-zero"},"sstoreInitRefundEIP2200":{"v":19200,"d":"Once per SSTORE operation for resetting to the original zero value"},"sstoreCleanGasEIP2200":{"v":5000,"d":"Once per SSTORE operation from clean non-zero to something else"},"sstoreCleanRefundEIP2200":{"v":4200,"d":"Once per SSTORE operation for resetting to the original non-zero value"},"sstoreClearRefundEIP2200":{"v":15000,"d":"Once per SSTORE operation for clearing an originally existing storage slot"}},"vm":{},"pow":{},"casper":{},"sharding":{}}')},function(t){t.exports=JSON.parse('{"name":"muirGlacier","comment":"HF to delay the difficulty bomb","eip":{"url":"https://eips.ethereum.org/EIPS/eip-2384","status":"Last Call"},"gasConfig":{},"gasPrices":{},"vm":{},"pow":{},"casper":{},"sharding":{}}')},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0});var o=r(8),a=r(2),s=function(t){function e(e,r){void 0===e&&(e={}),void 0===r&&(r={});var n=t.call(this,e,r)||this;Object.defineProperty(n,"from",{enumerable:!0,configurable:!0,get:function(){return n.getSenderAddress()},set:function(t){t&&(n._from=o.toBuffer(t))}});var i=e;return i.from&&(n.from=o.toBuffer(i.from)),n}return i(e,t),e.prototype.hash=function(e){if(void 0===e&&(e=!0),e&&this._from&&""!==this._from.toString("hex")){var r=a.Buffer.concat([this._from,this._from.slice(0,12)]);this.sign(r)}return t.prototype.hash.call(this,e)},e}(r(65).default);e.default=s},function(t,e,r){r(177),t.exports=self.fetch.bind(self)},function(t,e,r){"use strict";r.r(e),r.d(e,"Headers",(function(){return d})),r.d(e,"Request",(function(){return _})),r.d(e,"Response",(function(){return M})),r.d(e,"DOMException",(function(){return E})),r.d(e,"fetch",(function(){return S}));var n="URLSearchParams"in self,i="Symbol"in self&&"iterator"in Symbol,o="FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(t){return!1}}(),a="FormData"in self,s="ArrayBuffer"in self;if(s)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(t){return t&&u.indexOf(Object.prototype.toString.call(t))>-1};function h(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function c(t){return"string"!=typeof t&&(t=String(t)),t}function l(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return i&&(e[Symbol.iterator]=function(){return e}),e}function d(t){this.map={},t instanceof d?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function p(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function b(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function m(t){var e=new FileReader,r=b(e);return e.readAsArrayBuffer(t),r}function v(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:o&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:a&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:n&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():s&&o&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=v(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(t)||f(t))?this._bodyArrayBuffer=v(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var t=p(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(m)}),this.text=function(){var t,e,r,n=p(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=b(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function M(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}_.prototype.clone=function(){return new _(this,{body:this._bodyInit})},g.call(_.prototype),g.call(M.prototype),M.prototype.clone=function(){return new M(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},M.error=function(){var t=new M(null,{status:0,statusText:""});return t.type="error",t};var A=[301,302,303,307,308];M.redirect=function(t,e){if(-1===A.indexOf(e))throw new RangeError("Invalid status code");return new M(null,{status:e,headers:{location:t}})};var E=self.DOMException;try{new E}catch(t){(E=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack}).prototype=Object.create(Error.prototype),E.prototype.constructor=E}function S(t,e){return new Promise((function(r,n){var i=new _(t,e);if(i.signal&&i.signal.aborted)return n(new E("Aborted","AbortError"));var a=new XMLHttpRequest;function s(){a.abort()}a.onload=function(){var t,e,n={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new d,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}})),e)};n.url="responseURL"in a?a.responseURL:n.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;r(new M(i,n))},a.onerror=function(){n(new TypeError("Network request failed"))},a.ontimeout=function(){n(new TypeError("Network request failed"))},a.onabort=function(){n(new E("Aborted","AbortError"))},a.open(i.method,i.url,!0),"include"===i.credentials?a.withCredentials=!0:"omit"===i.credentials&&(a.withCredentials=!1),"responseType"in a&&o&&(a.responseType="blob"),i.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),i.signal&&(i.signal.addEventListener("abort",s),a.onreadystatechange=function(){4===a.readyState&&i.signal.removeEventListener("abort",s)}),a.send(void 0===i._bodyInit?null:i._bodyInit)}))}S.polyfill=!0,self.fetch||(self.fetch=S,self.Headers=d,self.Request=_,self.Response=M)},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]