diff --git a/dist/js/statuswidget.js b/dist/js/statuswidget.js index 1e0d917..5bde571 100644 --- a/dist/js/statuswidget.js +++ b/dist/js/statuswidget.js @@ -1,11 +1,11 @@ -!function(n){var e={};function t(r){if(e[r])return e[r].exports;var a=e[r]={i:r,l:!1,exports:{}};return n[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}t.m=n,t.c=e,t.d=function(n,e,r){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:r})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var a in n)t.d(r,a,function(e){return n[e]}.bind(null,a));return r},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="",t(t.s=161)}([function(n,e){"function"==typeof Object.create?n.exports=function(n,e){n.super_=e,n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}})}:n.exports=function(n,e){n.super_=e;var t=function(){};t.prototype=e.prototype,n.prototype=new t,n.prototype.constructor=n}},function(n,e,t){var r=t(2),a=r.Buffer;function i(n,e){for(var t in n)e[t]=n[t]}function s(n,e,t){return a(n,e,t)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?n.exports=r:(i(r,e),e.Buffer=s),i(a,s),s.from=function(n,e,t){if("number"==typeof n)throw new TypeError("Argument must not be a number");return a(n,e,t)},s.alloc=function(n,e,t){if("number"!=typeof n)throw new TypeError("Argument must be a number");var r=a(n);return void 0!==e?"string"==typeof t?r.fill(e,t):r.fill(e):r.fill(0),r},s.allocUnsafe=function(n){if("number"!=typeof n)throw new TypeError("Argument must be a number");return a(n)},s.allocUnsafeSlow=function(n){if("number"!=typeof n)throw new TypeError("Argument must be a number");return r.SlowBuffer(n)}},function(n,e,t){"use strict";(function(n){ +!function(n){var e={};function t(r){if(e[r])return e[r].exports;var a=e[r]={i:r,l:!1,exports:{}};return n[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}t.m=n,t.c=e,t.d=function(n,e,r){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:r})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var a in n)t.d(r,a,function(e){return n[e]}.bind(null,a));return r},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="",t(t.s=163)}([function(n,e){"function"==typeof Object.create?n.exports=function(n,e){n.super_=e,n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}})}:n.exports=function(n,e){n.super_=e;var t=function(){};t.prototype=e.prototype,n.prototype=new t,n.prototype.constructor=n}},function(n,e,t){var r=t(2),a=r.Buffer;function i(n,e){for(var t in n)e[t]=n[t]}function s(n,e,t){return a(n,e,t)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?n.exports=r:(i(r,e),e.Buffer=s),i(a,s),s.from=function(n,e,t){if("number"==typeof n)throw new TypeError("Argument must not be a number");return a(n,e,t)},s.alloc=function(n,e,t){if("number"!=typeof n)throw new TypeError("Argument must be a number");var r=a(n);return void 0!==e?"string"==typeof t?r.fill(e,t):r.fill(e):r.fill(0),r},s.allocUnsafe=function(n){if("number"!=typeof n)throw new TypeError("Argument must be a number");return a(n)},s.allocUnsafeSlow=function(n){if("number"!=typeof n)throw new TypeError("Argument must be a number");return r.SlowBuffer(n)}},function(n,e,t){"use strict";(function(n){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ -var r=t(207),a=t(208),i=t(94);function s(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(n,e){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|n}function p(n,e){if(l.isBuffer(n))return n.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(n)||n instanceof ArrayBuffer))return n.byteLength;"string"!=typeof n&&(n=""+n);var t=n.length;if(0===t)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return F(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t;case"hex":return t>>>1;case"base64":return U(n).length;default:if(r)return F(n).length;e=(""+e).toLowerCase(),r=!0}}function m(n,e,t){var r=n[e];n[e]=n[t],n[t]=r}function b(n,e,t,r,a){if(0===n.length)return-1;if("string"==typeof t?(r=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=a?0:n.length-1),t<0&&(t=n.length+t),t>=n.length){if(a)return-1;t=n.length-1}else if(t<0){if(!a)return-1;t=0}if("string"==typeof e&&(e=l.from(e,r)),l.isBuffer(e))return 0===e.length?-1:g(n,e,t,r,a);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(n,e,t):Uint8Array.prototype.lastIndexOf.call(n,e,t):g(n,[e],t,r,a);throw new TypeError("val must be string, number or Buffer")}function g(n,e,t,r,a){var i,s=1,o=n.length,l=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(n.length<2||e.length<2)return-1;s=2,o/=2,l/=2,t/=2}function c(n,e){return 1===s?n[e]:n.readUInt16BE(e*s)}if(a){var u=-1;for(i=t;io&&(t=o-l),i=t;i>=0;i--){for(var d=!0,f=0;fa&&(r=a):r=a;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var s=0;s>8,a=t%256,i.push(a),i.push(r);return i}(e,n.length-t),n,t,r)}function S(n,e,t){return 0===e&&t===n.length?r.fromByteArray(n):r.fromByteArray(n.slice(e,t))}function A(n,e,t){t=Math.min(n.length,t);for(var r=[],a=e;a239?4:c>223?3:c>191?2:1;if(a+d<=t)switch(d){case 1:c<128&&(u=c);break;case 2:128==(192&(i=n[a+1]))&&(l=(31&c)<<6|63&i)>127&&(u=l);break;case 3:i=n[a+1],s=n[a+2],128==(192&i)&&128==(192&s)&&(l=(15&c)<<12|(63&i)<<6|63&s)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:i=n[a+1],s=n[a+2],o=n[a+3],128==(192&i)&&128==(192&s)&&128==(192&o)&&(l=(15&c)<<18|(63&i)<<12|(63&s)<<6|63&o)>65535&&l<1114112&&(u=l)}null===u?(u=65533,d=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),a+=d}return function(n){var e=n.length;if(e<=E)return String.fromCharCode.apply(String,n);var t="",r=0;for(;rthis.length)return"";if((void 0===t||t>this.length)&&(t=this.length),t<=0)return"";if((t>>>=0)<=(e>>>=0))return"";for(n||(n="utf8");;)switch(n){case"hex":return I(this,e,t);case"utf8":case"utf-8":return A(this,e,t);case"ascii":return T(this,e,t);case"latin1":case"binary":return C(this,e,t);case"base64":return S(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),r=!0}}.apply(this,arguments)},l.prototype.equals=function(n){if(!l.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n||0===l.compare(this,n)},l.prototype.inspect=function(){var n="",t=e.INSPECT_MAX_BYTES;return this.length>0&&(n=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(n+=" ... ")),""},l.prototype.compare=function(n,e,t,r,a){if(!l.isBuffer(n))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===t&&(t=n?n.length:0),void 0===r&&(r=0),void 0===a&&(a=this.length),e<0||t>n.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&e>=t)return 0;if(r>=a)return-1;if(e>=t)return 1;if(this===n)return 0;for(var i=(a>>>=0)-(r>>>=0),s=(t>>>=0)-(e>>>=0),o=Math.min(i,s),c=this.slice(r,a),u=n.slice(e,t),d=0;da)&&(t=a),n.length>0&&(t<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return y(this,n,e,t);case"utf8":case"utf-8":return v(this,n,e,t);case"ascii":return _(this,n,e,t);case"latin1":case"binary":return w(this,n,e,t);case"base64":return k(this,n,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,n,e,t);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function T(n,e,t){var r="";t=Math.min(n.length,t);for(var a=e;ar)&&(t=r);for(var a="",i=e;it)throw new RangeError("Trying to access beyond buffer length")}function B(n,e,t,r,a,i){if(!l.isBuffer(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||en.length)throw new RangeError("Index out of range")}function M(n,e,t,r){e<0&&(e=65535+e+1);for(var a=0,i=Math.min(n.length-t,2);a>>8*(r?a:1-a)}function N(n,e,t,r){e<0&&(e=4294967295+e+1);for(var a=0,i=Math.min(n.length-t,4);a>>8*(r?a:3-a)&255}function P(n,e,t,r,a,i){if(t+r>n.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function O(n,e,t,r,i){return i||P(n,0,t,4),a.write(n,e,t,r,23,4),t+4}function L(n,e,t,r,i){return i||P(n,0,t,8),a.write(n,e,t,r,52,8),t+8}l.prototype.slice=function(n,e){var t,r=this.length;if((n=~~n)<0?(n+=r)<0&&(n=0):n>r&&(n=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e0&&(a*=256);)r+=this[n+--e]*a;return r},l.prototype.readUInt8=function(n,e){return e||R(n,1,this.length),this[n]},l.prototype.readUInt16LE=function(n,e){return e||R(n,2,this.length),this[n]|this[n+1]<<8},l.prototype.readUInt16BE=function(n,e){return e||R(n,2,this.length),this[n]<<8|this[n+1]},l.prototype.readUInt32LE=function(n,e){return e||R(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+16777216*this[n+3]},l.prototype.readUInt32BE=function(n,e){return e||R(n,4,this.length),16777216*this[n]+(this[n+1]<<16|this[n+2]<<8|this[n+3])},l.prototype.readIntLE=function(n,e,t){n|=0,e|=0,t||R(n,e,this.length);for(var r=this[n],a=1,i=0;++i=(a*=128)&&(r-=Math.pow(2,8*e)),r},l.prototype.readIntBE=function(n,e,t){n|=0,e|=0,t||R(n,e,this.length);for(var r=e,a=1,i=this[n+--r];r>0&&(a*=256);)i+=this[n+--r]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*e)),i},l.prototype.readInt8=function(n,e){return e||R(n,1,this.length),128&this[n]?-1*(255-this[n]+1):this[n]},l.prototype.readInt16LE=function(n,e){e||R(n,2,this.length);var t=this[n]|this[n+1]<<8;return 32768&t?4294901760|t:t},l.prototype.readInt16BE=function(n,e){e||R(n,2,this.length);var t=this[n+1]|this[n]<<8;return 32768&t?4294901760|t:t},l.prototype.readInt32LE=function(n,e){return e||R(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},l.prototype.readInt32BE=function(n,e){return e||R(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},l.prototype.readFloatLE=function(n,e){return e||R(n,4,this.length),a.read(this,n,!0,23,4)},l.prototype.readFloatBE=function(n,e){return e||R(n,4,this.length),a.read(this,n,!1,23,4)},l.prototype.readDoubleLE=function(n,e){return e||R(n,8,this.length),a.read(this,n,!0,52,8)},l.prototype.readDoubleBE=function(n,e){return e||R(n,8,this.length),a.read(this,n,!1,52,8)},l.prototype.writeUIntLE=function(n,e,t,r){(n=+n,e|=0,t|=0,r)||B(this,n,e,t,Math.pow(2,8*t)-1,0);var a=1,i=0;for(this[e]=255&n;++i=0&&(i*=256);)this[e+a]=n/i&255;return e+t},l.prototype.writeUInt8=function(n,e,t){return n=+n,e|=0,t||B(this,n,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),this[e]=255&n,e+1},l.prototype.writeUInt16LE=function(n,e,t){return n=+n,e|=0,t||B(this,n,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&n,this[e+1]=n>>>8):M(this,n,e,!0),e+2},l.prototype.writeUInt16BE=function(n,e,t){return n=+n,e|=0,t||B(this,n,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=n>>>8,this[e+1]=255&n):M(this,n,e,!1),e+2},l.prototype.writeUInt32LE=function(n,e,t){return n=+n,e|=0,t||B(this,n,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=n>>>24,this[e+2]=n>>>16,this[e+1]=n>>>8,this[e]=255&n):N(this,n,e,!0),e+4},l.prototype.writeUInt32BE=function(n,e,t){return n=+n,e|=0,t||B(this,n,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=n>>>24,this[e+1]=n>>>16,this[e+2]=n>>>8,this[e+3]=255&n):N(this,n,e,!1),e+4},l.prototype.writeIntLE=function(n,e,t,r){if(n=+n,e|=0,!r){var a=Math.pow(2,8*t-1);B(this,n,e,t,a-1,-a)}var i=0,s=1,o=0;for(this[e]=255&n;++i>0)-o&255;return e+t},l.prototype.writeIntBE=function(n,e,t,r){if(n=+n,e|=0,!r){var a=Math.pow(2,8*t-1);B(this,n,e,t,a-1,-a)}var i=t-1,s=1,o=0;for(this[e+i]=255&n;--i>=0&&(s*=256);)n<0&&0===o&&0!==this[e+i+1]&&(o=1),this[e+i]=(n/s>>0)-o&255;return e+t},l.prototype.writeInt8=function(n,e,t){return n=+n,e|=0,t||B(this,n,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),n<0&&(n=255+n+1),this[e]=255&n,e+1},l.prototype.writeInt16LE=function(n,e,t){return n=+n,e|=0,t||B(this,n,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&n,this[e+1]=n>>>8):M(this,n,e,!0),e+2},l.prototype.writeInt16BE=function(n,e,t){return n=+n,e|=0,t||B(this,n,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=n>>>8,this[e+1]=255&n):M(this,n,e,!1),e+2},l.prototype.writeInt32LE=function(n,e,t){return n=+n,e|=0,t||B(this,n,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&n,this[e+1]=n>>>8,this[e+2]=n>>>16,this[e+3]=n>>>24):N(this,n,e,!0),e+4},l.prototype.writeInt32BE=function(n,e,t){return n=+n,e|=0,t||B(this,n,e,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),l.TYPED_ARRAY_SUPPORT?(this[e]=n>>>24,this[e+1]=n>>>16,this[e+2]=n>>>8,this[e+3]=255&n):N(this,n,e,!1),e+4},l.prototype.writeFloatLE=function(n,e,t){return O(this,n,e,!0,t)},l.prototype.writeFloatBE=function(n,e,t){return O(this,n,e,!1,t)},l.prototype.writeDoubleLE=function(n,e,t){return L(this,n,e,!0,t)},l.prototype.writeDoubleBE=function(n,e,t){return L(this,n,e,!1,t)},l.prototype.copy=function(n,e,t,r){if(t||(t=0),r||0===r||(r=this.length),e>=n.length&&(e=n.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),n.length-e=0;--a)n[a+e]=this[a+t];else if(i<1e3||!l.TYPED_ARRAY_SUPPORT)for(a=0;a>>=0,t=void 0===t?this.length:t>>>0,n||(n=0),"number"==typeof n)for(i=e;i55295&&t<57344){if(!a){if(t>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&i.push(239,191,189);continue}a=t;continue}if(t<56320){(e-=3)>-1&&i.push(239,191,189),a=t;continue}t=65536+(a-55296<<10|t-56320)}else a&&(e-=3)>-1&&i.push(239,191,189);if(a=null,t<128){if((e-=1)<0)break;i.push(t)}else if(t<2048){if((e-=2)<0)break;i.push(t>>6|192,63&t|128)}else if(t<65536){if((e-=3)<0)break;i.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return i}function U(n){return r.toByteArray(function(n){if((n=function(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}(n).replace(D,"")).length<2)return"";for(;n.length%4!=0;)n+="=";return n}(n))}function z(n,e,t,r){for(var a=0;a=e.length||a>=n.length);++a)e[a+t]=n[a];return a}}).call(this,t(4))},function(n,e,t){(function(n){!function(n,e){"use strict";function r(n,e){if(!n)throw new Error(e||"Assertion failed")}function a(n,e){n.super_=e;var t=function(){};t.prototype=e.prototype,n.prototype=new t,n.prototype.constructor=n}function i(n,e,t){if(i.isBN(n))return n;this.negative=0,this.words=null,this.length=0,this.red=null,null!==n&&("le"!==e&&"be"!==e||(t=e,e=10),this._init(n||0,e||10,t||"be"))}var s;"object"==typeof n?n.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{s=t(259).Buffer}catch(n){}function o(n,e,t){for(var r=0,a=Math.min(n.length,t),i=e;i=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return r}function l(n,e,t,r){for(var a=0,i=Math.min(n.length,t),s=e;s=49?o-49+10:o>=17?o-17+10:o}return a}i.isBN=function(n){return n instanceof i||null!==n&&"object"==typeof n&&n.constructor.wordSize===i.wordSize&&Array.isArray(n.words)},i.max=function(n,e){return n.cmp(e)>0?n:e},i.min=function(n,e){return n.cmp(e)<0?n:e},i.prototype._init=function(n,e,t){if("number"==typeof n)return this._initNumber(n,e,t);if("object"==typeof n)return this._initArray(n,e,t);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var a=0;"-"===(n=n.toString().replace(/\s+/g,""))[0]&&a++,16===e?this._parseHex(n,a):this._parseBase(n,e,a),"-"===n[0]&&(this.negative=1),this.strip(),"le"===t&&this._initArray(this.toArray(),e,t)},i.prototype._initNumber=function(n,e,t){n<0&&(this.negative=1,n=-n),n<67108864?(this.words=[67108863&n],this.length=1):n<4503599627370496?(this.words=[67108863&n,n/67108864&67108863],this.length=2):(r(n<9007199254740992),this.words=[67108863&n,n/67108864&67108863,1],this.length=3),"le"===t&&this._initArray(this.toArray(),e,t)},i.prototype._initArray=function(n,e,t){if(r("number"==typeof n.length),n.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(n.length/3),this.words=new Array(this.length);for(var a=0;a=0;a-=3)s=n[a]|n[a-1]<<8|n[a-2]<<16,this.words[i]|=s<>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);else if("le"===t)for(a=0,i=0;a>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);return this.strip()},i.prototype._parseHex=function(n,e){this.length=Math.ceil((n.length-e)/6),this.words=new Array(this.length);for(var t=0;t=e;t-=6)a=o(n,t,t+6),this.words[r]|=a<>>26-i&4194303,(i+=24)>=26&&(i-=26,r++);t+6!==e&&(a=o(n,e,t+6),this.words[r]|=a<>>26-i&4194303),this.strip()},i.prototype._parseBase=function(n,e,t){this.words=[0],this.length=1;for(var r=0,a=1;a<=67108863;a*=e)r++;r--,a=a/e|0;for(var i=n.length-t,s=i%r,o=Math.min(i,i-s)+t,c=0,u=t;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var c=["","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"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(n,e,t){t.negative=e.negative^n.negative;var r=n.length+e.length|0;t.length=r,r=r-1|0;var a=0|n.words[0],i=0|e.words[0],s=a*i,o=67108863&s,l=s/67108864|0;t.words[0]=o;for(var c=1;c>>26,d=67108863&l,f=Math.min(c,e.length-1),h=Math.max(0,c-n.length+1);h<=f;h++){var p=c-h|0;u+=(s=(a=0|n.words[p])*(i=0|e.words[h])+d)/67108864|0,d=67108863&s}t.words[c]=0|d,l=0|u}return 0!==l?t.words[c]=0|l:t.length--,t.strip()}i.prototype.toString=function(n,e){var t;if(e=0|e||1,16===(n=n||10)||"hex"===n){t="";for(var a=0,i=0,s=0;s>>24-a&16777215)||s!==this.length-1?c[6-l.length]+l+t:l+t,(a+=2)>=26&&(a-=26,s--)}for(0!==i&&(t=i.toString(16)+t);t.length%e!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(n===(0|n)&&n>=2&&n<=36){var f=u[n],h=d[n];t="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(h).toString(n);t=(p=p.idivn(h)).isZero()?m+t:c[f-m.length]+m+t}for(this.isZero()&&(t="0"+t);t.length%e!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var n=this.words[0];return 2===this.length?n+=67108864*this.words[1]:3===this.length&&1===this.words[2]?n+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-n:n},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(n,e){return r(void 0!==s),this.toArrayLike(s,n,e)},i.prototype.toArray=function(n,e){return this.toArrayLike(Array,n,e)},i.prototype.toArrayLike=function(n,e,t){var a=this.byteLength(),i=t||Math.max(1,a);r(a<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var s,o,l="le"===e,c=new n(i),u=this.clone();if(l){for(o=0;!u.isZero();o++)s=u.andln(255),u.iushrn(8),c[o]=s;for(;o=4096&&(t+=13,e>>>=13),e>=64&&(t+=7,e>>>=7),e>=8&&(t+=4,e>>>=4),e>=2&&(t+=2,e>>>=2),t+e},i.prototype._zeroBits=function(n){if(0===n)return 26;var e=n,t=0;return 0==(8191&e)&&(t+=13,e>>>=13),0==(127&e)&&(t+=7,e>>>=7),0==(15&e)&&(t+=4,e>>>=4),0==(3&e)&&(t+=2,e>>>=2),0==(1&e)&&t++,t},i.prototype.bitLength=function(){var n=this.words[this.length-1],e=this._countBits(n);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var n=0,e=0;en.length?this.clone().ior(n):n.clone().ior(this)},i.prototype.uor=function(n){return this.length>n.length?this.clone().iuor(n):n.clone().iuor(this)},i.prototype.iuand=function(n){var e;e=this.length>n.length?n:this;for(var t=0;tn.length?this.clone().iand(n):n.clone().iand(this)},i.prototype.uand=function(n){return this.length>n.length?this.clone().iuand(n):n.clone().iuand(this)},i.prototype.iuxor=function(n){var e,t;this.length>n.length?(e=this,t=n):(e=n,t=this);for(var r=0;rn.length?this.clone().ixor(n):n.clone().ixor(this)},i.prototype.uxor=function(n){return this.length>n.length?this.clone().iuxor(n):n.clone().iuxor(this)},i.prototype.inotn=function(n){r("number"==typeof n&&n>=0);var e=0|Math.ceil(n/26),t=n%26;this._expand(e),t>0&&e--;for(var a=0;a0&&(this.words[a]=~this.words[a]&67108863>>26-t),this.strip()},i.prototype.notn=function(n){return this.clone().inotn(n)},i.prototype.setn=function(n,e){r("number"==typeof n&&n>=0);var t=n/26|0,a=n%26;return this._expand(t+1),this.words[t]=e?this.words[t]|1<n.length?(t=this,r=n):(t=n,r=this);for(var a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=t.length,0!==a)this.words[this.length]=a,this.length++;else if(t!==this)for(;in.length?this.clone().iadd(n):n.clone().iadd(this)},i.prototype.isub=function(n){if(0!==n.negative){n.negative=0;var e=this.iadd(n);return n.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(n),this.negative=1,this._normSign();var t,r,a=this.cmp(n);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(t=this,r=n):(t=n,r=this);for(var i=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==i&&s>26,this.words[s]=67108863&e;if(0===i&&s>>13,h=0|s[1],p=8191&h,m=h>>>13,b=0|s[2],g=8191&b,y=b>>>13,v=0|s[3],_=8191&v,w=v>>>13,k=0|s[4],x=8191&k,S=k>>>13,A=0|s[5],E=8191&A,T=A>>>13,C=0|s[6],I=8191&C,j=C>>>13,R=0|s[7],B=8191&R,M=R>>>13,N=0|s[8],P=8191&N,O=N>>>13,L=0|s[9],D=8191&L,q=L>>>13,F=0|o[0],U=8191&F,z=F>>>13,K=0|o[1],H=8191&K,G=K>>>13,V=0|o[2],W=8191&V,Y=V>>>13,X=0|o[3],J=8191&X,Z=X>>>13,$=0|o[4],Q=8191&$,nn=$>>>13,en=0|o[5],tn=8191&en,rn=en>>>13,an=0|o[6],sn=8191&an,on=an>>>13,ln=0|o[7],cn=8191&ln,un=ln>>>13,dn=0|o[8],fn=8191&dn,hn=dn>>>13,pn=0|o[9],mn=8191&pn,bn=pn>>>13;t.negative=n.negative^e.negative,t.length=19;var gn=(c+(r=Math.imul(d,U))|0)+((8191&(a=(a=Math.imul(d,z))+Math.imul(f,U)|0))<<13)|0;c=((i=Math.imul(f,z))+(a>>>13)|0)+(gn>>>26)|0,gn&=67108863,r=Math.imul(p,U),a=(a=Math.imul(p,z))+Math.imul(m,U)|0,i=Math.imul(m,z);var yn=(c+(r=r+Math.imul(d,H)|0)|0)+((8191&(a=(a=a+Math.imul(d,G)|0)+Math.imul(f,H)|0))<<13)|0;c=((i=i+Math.imul(f,G)|0)+(a>>>13)|0)+(yn>>>26)|0,yn&=67108863,r=Math.imul(g,U),a=(a=Math.imul(g,z))+Math.imul(y,U)|0,i=Math.imul(y,z),r=r+Math.imul(p,H)|0,a=(a=a+Math.imul(p,G)|0)+Math.imul(m,H)|0,i=i+Math.imul(m,G)|0;var vn=(c+(r=r+Math.imul(d,W)|0)|0)+((8191&(a=(a=a+Math.imul(d,Y)|0)+Math.imul(f,W)|0))<<13)|0;c=((i=i+Math.imul(f,Y)|0)+(a>>>13)|0)+(vn>>>26)|0,vn&=67108863,r=Math.imul(_,U),a=(a=Math.imul(_,z))+Math.imul(w,U)|0,i=Math.imul(w,z),r=r+Math.imul(g,H)|0,a=(a=a+Math.imul(g,G)|0)+Math.imul(y,H)|0,i=i+Math.imul(y,G)|0,r=r+Math.imul(p,W)|0,a=(a=a+Math.imul(p,Y)|0)+Math.imul(m,W)|0,i=i+Math.imul(m,Y)|0;var _n=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(a=(a=a+Math.imul(d,Z)|0)+Math.imul(f,J)|0))<<13)|0;c=((i=i+Math.imul(f,Z)|0)+(a>>>13)|0)+(_n>>>26)|0,_n&=67108863,r=Math.imul(x,U),a=(a=Math.imul(x,z))+Math.imul(S,U)|0,i=Math.imul(S,z),r=r+Math.imul(_,H)|0,a=(a=a+Math.imul(_,G)|0)+Math.imul(w,H)|0,i=i+Math.imul(w,G)|0,r=r+Math.imul(g,W)|0,a=(a=a+Math.imul(g,Y)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,Y)|0,r=r+Math.imul(p,J)|0,a=(a=a+Math.imul(p,Z)|0)+Math.imul(m,J)|0,i=i+Math.imul(m,Z)|0;var wn=(c+(r=r+Math.imul(d,Q)|0)|0)+((8191&(a=(a=a+Math.imul(d,nn)|0)+Math.imul(f,Q)|0))<<13)|0;c=((i=i+Math.imul(f,nn)|0)+(a>>>13)|0)+(wn>>>26)|0,wn&=67108863,r=Math.imul(E,U),a=(a=Math.imul(E,z))+Math.imul(T,U)|0,i=Math.imul(T,z),r=r+Math.imul(x,H)|0,a=(a=a+Math.imul(x,G)|0)+Math.imul(S,H)|0,i=i+Math.imul(S,G)|0,r=r+Math.imul(_,W)|0,a=(a=a+Math.imul(_,Y)|0)+Math.imul(w,W)|0,i=i+Math.imul(w,Y)|0,r=r+Math.imul(g,J)|0,a=(a=a+Math.imul(g,Z)|0)+Math.imul(y,J)|0,i=i+Math.imul(y,Z)|0,r=r+Math.imul(p,Q)|0,a=(a=a+Math.imul(p,nn)|0)+Math.imul(m,Q)|0,i=i+Math.imul(m,nn)|0;var kn=(c+(r=r+Math.imul(d,tn)|0)|0)+((8191&(a=(a=a+Math.imul(d,rn)|0)+Math.imul(f,tn)|0))<<13)|0;c=((i=i+Math.imul(f,rn)|0)+(a>>>13)|0)+(kn>>>26)|0,kn&=67108863,r=Math.imul(I,U),a=(a=Math.imul(I,z))+Math.imul(j,U)|0,i=Math.imul(j,z),r=r+Math.imul(E,H)|0,a=(a=a+Math.imul(E,G)|0)+Math.imul(T,H)|0,i=i+Math.imul(T,G)|0,r=r+Math.imul(x,W)|0,a=(a=a+Math.imul(x,Y)|0)+Math.imul(S,W)|0,i=i+Math.imul(S,Y)|0,r=r+Math.imul(_,J)|0,a=(a=a+Math.imul(_,Z)|0)+Math.imul(w,J)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(g,Q)|0,a=(a=a+Math.imul(g,nn)|0)+Math.imul(y,Q)|0,i=i+Math.imul(y,nn)|0,r=r+Math.imul(p,tn)|0,a=(a=a+Math.imul(p,rn)|0)+Math.imul(m,tn)|0,i=i+Math.imul(m,rn)|0;var xn=(c+(r=r+Math.imul(d,sn)|0)|0)+((8191&(a=(a=a+Math.imul(d,on)|0)+Math.imul(f,sn)|0))<<13)|0;c=((i=i+Math.imul(f,on)|0)+(a>>>13)|0)+(xn>>>26)|0,xn&=67108863,r=Math.imul(B,U),a=(a=Math.imul(B,z))+Math.imul(M,U)|0,i=Math.imul(M,z),r=r+Math.imul(I,H)|0,a=(a=a+Math.imul(I,G)|0)+Math.imul(j,H)|0,i=i+Math.imul(j,G)|0,r=r+Math.imul(E,W)|0,a=(a=a+Math.imul(E,Y)|0)+Math.imul(T,W)|0,i=i+Math.imul(T,Y)|0,r=r+Math.imul(x,J)|0,a=(a=a+Math.imul(x,Z)|0)+Math.imul(S,J)|0,i=i+Math.imul(S,Z)|0,r=r+Math.imul(_,Q)|0,a=(a=a+Math.imul(_,nn)|0)+Math.imul(w,Q)|0,i=i+Math.imul(w,nn)|0,r=r+Math.imul(g,tn)|0,a=(a=a+Math.imul(g,rn)|0)+Math.imul(y,tn)|0,i=i+Math.imul(y,rn)|0,r=r+Math.imul(p,sn)|0,a=(a=a+Math.imul(p,on)|0)+Math.imul(m,sn)|0,i=i+Math.imul(m,on)|0;var Sn=(c+(r=r+Math.imul(d,cn)|0)|0)+((8191&(a=(a=a+Math.imul(d,un)|0)+Math.imul(f,cn)|0))<<13)|0;c=((i=i+Math.imul(f,un)|0)+(a>>>13)|0)+(Sn>>>26)|0,Sn&=67108863,r=Math.imul(P,U),a=(a=Math.imul(P,z))+Math.imul(O,U)|0,i=Math.imul(O,z),r=r+Math.imul(B,H)|0,a=(a=a+Math.imul(B,G)|0)+Math.imul(M,H)|0,i=i+Math.imul(M,G)|0,r=r+Math.imul(I,W)|0,a=(a=a+Math.imul(I,Y)|0)+Math.imul(j,W)|0,i=i+Math.imul(j,Y)|0,r=r+Math.imul(E,J)|0,a=(a=a+Math.imul(E,Z)|0)+Math.imul(T,J)|0,i=i+Math.imul(T,Z)|0,r=r+Math.imul(x,Q)|0,a=(a=a+Math.imul(x,nn)|0)+Math.imul(S,Q)|0,i=i+Math.imul(S,nn)|0,r=r+Math.imul(_,tn)|0,a=(a=a+Math.imul(_,rn)|0)+Math.imul(w,tn)|0,i=i+Math.imul(w,rn)|0,r=r+Math.imul(g,sn)|0,a=(a=a+Math.imul(g,on)|0)+Math.imul(y,sn)|0,i=i+Math.imul(y,on)|0,r=r+Math.imul(p,cn)|0,a=(a=a+Math.imul(p,un)|0)+Math.imul(m,cn)|0,i=i+Math.imul(m,un)|0;var An=(c+(r=r+Math.imul(d,fn)|0)|0)+((8191&(a=(a=a+Math.imul(d,hn)|0)+Math.imul(f,fn)|0))<<13)|0;c=((i=i+Math.imul(f,hn)|0)+(a>>>13)|0)+(An>>>26)|0,An&=67108863,r=Math.imul(D,U),a=(a=Math.imul(D,z))+Math.imul(q,U)|0,i=Math.imul(q,z),r=r+Math.imul(P,H)|0,a=(a=a+Math.imul(P,G)|0)+Math.imul(O,H)|0,i=i+Math.imul(O,G)|0,r=r+Math.imul(B,W)|0,a=(a=a+Math.imul(B,Y)|0)+Math.imul(M,W)|0,i=i+Math.imul(M,Y)|0,r=r+Math.imul(I,J)|0,a=(a=a+Math.imul(I,Z)|0)+Math.imul(j,J)|0,i=i+Math.imul(j,Z)|0,r=r+Math.imul(E,Q)|0,a=(a=a+Math.imul(E,nn)|0)+Math.imul(T,Q)|0,i=i+Math.imul(T,nn)|0,r=r+Math.imul(x,tn)|0,a=(a=a+Math.imul(x,rn)|0)+Math.imul(S,tn)|0,i=i+Math.imul(S,rn)|0,r=r+Math.imul(_,sn)|0,a=(a=a+Math.imul(_,on)|0)+Math.imul(w,sn)|0,i=i+Math.imul(w,on)|0,r=r+Math.imul(g,cn)|0,a=(a=a+Math.imul(g,un)|0)+Math.imul(y,cn)|0,i=i+Math.imul(y,un)|0,r=r+Math.imul(p,fn)|0,a=(a=a+Math.imul(p,hn)|0)+Math.imul(m,fn)|0,i=i+Math.imul(m,hn)|0;var En=(c+(r=r+Math.imul(d,mn)|0)|0)+((8191&(a=(a=a+Math.imul(d,bn)|0)+Math.imul(f,mn)|0))<<13)|0;c=((i=i+Math.imul(f,bn)|0)+(a>>>13)|0)+(En>>>26)|0,En&=67108863,r=Math.imul(D,H),a=(a=Math.imul(D,G))+Math.imul(q,H)|0,i=Math.imul(q,G),r=r+Math.imul(P,W)|0,a=(a=a+Math.imul(P,Y)|0)+Math.imul(O,W)|0,i=i+Math.imul(O,Y)|0,r=r+Math.imul(B,J)|0,a=(a=a+Math.imul(B,Z)|0)+Math.imul(M,J)|0,i=i+Math.imul(M,Z)|0,r=r+Math.imul(I,Q)|0,a=(a=a+Math.imul(I,nn)|0)+Math.imul(j,Q)|0,i=i+Math.imul(j,nn)|0,r=r+Math.imul(E,tn)|0,a=(a=a+Math.imul(E,rn)|0)+Math.imul(T,tn)|0,i=i+Math.imul(T,rn)|0,r=r+Math.imul(x,sn)|0,a=(a=a+Math.imul(x,on)|0)+Math.imul(S,sn)|0,i=i+Math.imul(S,on)|0,r=r+Math.imul(_,cn)|0,a=(a=a+Math.imul(_,un)|0)+Math.imul(w,cn)|0,i=i+Math.imul(w,un)|0,r=r+Math.imul(g,fn)|0,a=(a=a+Math.imul(g,hn)|0)+Math.imul(y,fn)|0,i=i+Math.imul(y,hn)|0;var Tn=(c+(r=r+Math.imul(p,mn)|0)|0)+((8191&(a=(a=a+Math.imul(p,bn)|0)+Math.imul(m,mn)|0))<<13)|0;c=((i=i+Math.imul(m,bn)|0)+(a>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,r=Math.imul(D,W),a=(a=Math.imul(D,Y))+Math.imul(q,W)|0,i=Math.imul(q,Y),r=r+Math.imul(P,J)|0,a=(a=a+Math.imul(P,Z)|0)+Math.imul(O,J)|0,i=i+Math.imul(O,Z)|0,r=r+Math.imul(B,Q)|0,a=(a=a+Math.imul(B,nn)|0)+Math.imul(M,Q)|0,i=i+Math.imul(M,nn)|0,r=r+Math.imul(I,tn)|0,a=(a=a+Math.imul(I,rn)|0)+Math.imul(j,tn)|0,i=i+Math.imul(j,rn)|0,r=r+Math.imul(E,sn)|0,a=(a=a+Math.imul(E,on)|0)+Math.imul(T,sn)|0,i=i+Math.imul(T,on)|0,r=r+Math.imul(x,cn)|0,a=(a=a+Math.imul(x,un)|0)+Math.imul(S,cn)|0,i=i+Math.imul(S,un)|0,r=r+Math.imul(_,fn)|0,a=(a=a+Math.imul(_,hn)|0)+Math.imul(w,fn)|0,i=i+Math.imul(w,hn)|0;var Cn=(c+(r=r+Math.imul(g,mn)|0)|0)+((8191&(a=(a=a+Math.imul(g,bn)|0)+Math.imul(y,mn)|0))<<13)|0;c=((i=i+Math.imul(y,bn)|0)+(a>>>13)|0)+(Cn>>>26)|0,Cn&=67108863,r=Math.imul(D,J),a=(a=Math.imul(D,Z))+Math.imul(q,J)|0,i=Math.imul(q,Z),r=r+Math.imul(P,Q)|0,a=(a=a+Math.imul(P,nn)|0)+Math.imul(O,Q)|0,i=i+Math.imul(O,nn)|0,r=r+Math.imul(B,tn)|0,a=(a=a+Math.imul(B,rn)|0)+Math.imul(M,tn)|0,i=i+Math.imul(M,rn)|0,r=r+Math.imul(I,sn)|0,a=(a=a+Math.imul(I,on)|0)+Math.imul(j,sn)|0,i=i+Math.imul(j,on)|0,r=r+Math.imul(E,cn)|0,a=(a=a+Math.imul(E,un)|0)+Math.imul(T,cn)|0,i=i+Math.imul(T,un)|0,r=r+Math.imul(x,fn)|0,a=(a=a+Math.imul(x,hn)|0)+Math.imul(S,fn)|0,i=i+Math.imul(S,hn)|0;var In=(c+(r=r+Math.imul(_,mn)|0)|0)+((8191&(a=(a=a+Math.imul(_,bn)|0)+Math.imul(w,mn)|0))<<13)|0;c=((i=i+Math.imul(w,bn)|0)+(a>>>13)|0)+(In>>>26)|0,In&=67108863,r=Math.imul(D,Q),a=(a=Math.imul(D,nn))+Math.imul(q,Q)|0,i=Math.imul(q,nn),r=r+Math.imul(P,tn)|0,a=(a=a+Math.imul(P,rn)|0)+Math.imul(O,tn)|0,i=i+Math.imul(O,rn)|0,r=r+Math.imul(B,sn)|0,a=(a=a+Math.imul(B,on)|0)+Math.imul(M,sn)|0,i=i+Math.imul(M,on)|0,r=r+Math.imul(I,cn)|0,a=(a=a+Math.imul(I,un)|0)+Math.imul(j,cn)|0,i=i+Math.imul(j,un)|0,r=r+Math.imul(E,fn)|0,a=(a=a+Math.imul(E,hn)|0)+Math.imul(T,fn)|0,i=i+Math.imul(T,hn)|0;var jn=(c+(r=r+Math.imul(x,mn)|0)|0)+((8191&(a=(a=a+Math.imul(x,bn)|0)+Math.imul(S,mn)|0))<<13)|0;c=((i=i+Math.imul(S,bn)|0)+(a>>>13)|0)+(jn>>>26)|0,jn&=67108863,r=Math.imul(D,tn),a=(a=Math.imul(D,rn))+Math.imul(q,tn)|0,i=Math.imul(q,rn),r=r+Math.imul(P,sn)|0,a=(a=a+Math.imul(P,on)|0)+Math.imul(O,sn)|0,i=i+Math.imul(O,on)|0,r=r+Math.imul(B,cn)|0,a=(a=a+Math.imul(B,un)|0)+Math.imul(M,cn)|0,i=i+Math.imul(M,un)|0,r=r+Math.imul(I,fn)|0,a=(a=a+Math.imul(I,hn)|0)+Math.imul(j,fn)|0,i=i+Math.imul(j,hn)|0;var Rn=(c+(r=r+Math.imul(E,mn)|0)|0)+((8191&(a=(a=a+Math.imul(E,bn)|0)+Math.imul(T,mn)|0))<<13)|0;c=((i=i+Math.imul(T,bn)|0)+(a>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,r=Math.imul(D,sn),a=(a=Math.imul(D,on))+Math.imul(q,sn)|0,i=Math.imul(q,on),r=r+Math.imul(P,cn)|0,a=(a=a+Math.imul(P,un)|0)+Math.imul(O,cn)|0,i=i+Math.imul(O,un)|0,r=r+Math.imul(B,fn)|0,a=(a=a+Math.imul(B,hn)|0)+Math.imul(M,fn)|0,i=i+Math.imul(M,hn)|0;var Bn=(c+(r=r+Math.imul(I,mn)|0)|0)+((8191&(a=(a=a+Math.imul(I,bn)|0)+Math.imul(j,mn)|0))<<13)|0;c=((i=i+Math.imul(j,bn)|0)+(a>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,r=Math.imul(D,cn),a=(a=Math.imul(D,un))+Math.imul(q,cn)|0,i=Math.imul(q,un),r=r+Math.imul(P,fn)|0,a=(a=a+Math.imul(P,hn)|0)+Math.imul(O,fn)|0,i=i+Math.imul(O,hn)|0;var Mn=(c+(r=r+Math.imul(B,mn)|0)|0)+((8191&(a=(a=a+Math.imul(B,bn)|0)+Math.imul(M,mn)|0))<<13)|0;c=((i=i+Math.imul(M,bn)|0)+(a>>>13)|0)+(Mn>>>26)|0,Mn&=67108863,r=Math.imul(D,fn),a=(a=Math.imul(D,hn))+Math.imul(q,fn)|0,i=Math.imul(q,hn);var Nn=(c+(r=r+Math.imul(P,mn)|0)|0)+((8191&(a=(a=a+Math.imul(P,bn)|0)+Math.imul(O,mn)|0))<<13)|0;c=((i=i+Math.imul(O,bn)|0)+(a>>>13)|0)+(Nn>>>26)|0,Nn&=67108863;var Pn=(c+(r=Math.imul(D,mn))|0)+((8191&(a=(a=Math.imul(D,bn))+Math.imul(q,mn)|0))<<13)|0;return c=((i=Math.imul(q,bn))+(a>>>13)|0)+(Pn>>>26)|0,Pn&=67108863,l[0]=gn,l[1]=yn,l[2]=vn,l[3]=_n,l[4]=wn,l[5]=kn,l[6]=xn,l[7]=Sn,l[8]=An,l[9]=En,l[10]=Tn,l[11]=Cn,l[12]=In,l[13]=jn,l[14]=Rn,l[15]=Bn,l[16]=Mn,l[17]=Nn,l[18]=Pn,0!==c&&(l[19]=c,t.length++),t};function p(n,e,t){return(new m).mulp(n,e,t)}function m(n,e){this.x=n,this.y=e}Math.imul||(h=f),i.prototype.mulTo=function(n,e){var t=this.length+n.length;return 10===this.length&&10===n.length?h(this,n,e):t<63?f(this,n,e):t<1024?function(n,e,t){t.negative=e.negative^n.negative,t.length=n.length+e.length;for(var r=0,a=0,i=0;i>>26)|0)>>>26,s&=67108863}t.words[i]=o,r=s,s=a}return 0!==r?t.words[i]=r:t.length--,t.strip()}(this,n,e):p(this,n,e)},m.prototype.makeRBT=function(n){for(var e=new Array(n),t=i.prototype._countBits(n)-1,r=0;r>=1;return r},m.prototype.permute=function(n,e,t,r,a,i){for(var s=0;s>>=1)a++;return 1<>>=13,t[2*s+1]=8191&i,i>>>=13;for(s=2*e;s>=26,e+=a/67108864|0,e+=i>>>26,this.words[t]=67108863&i}return 0!==e&&(this.words[t]=e,this.length++),this},i.prototype.muln=function(n){return this.clone().imuln(n)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(n){var e=function(n){for(var e=new Array(n.bitLength()),t=0;t>>a}return e}(n);if(0===e.length)return new i(1);for(var t=this,r=0;r=0);var e,t=n%26,a=(n-t)/26,i=67108863>>>26-t<<26-t;if(0!==t){var s=0;for(e=0;e>>26-t}s&&(this.words[e]=s,this.length++)}if(0!==a){for(e=this.length-1;e>=0;e--)this.words[e+a]=this.words[e];for(e=0;e=0),a=e?(e-e%26)/26:0;var i=n%26,s=Math.min((n-i)/26,this.length),o=67108863^67108863>>>i<s)for(this.length-=s,c=0;c=0&&(0!==u||c>=a);c--){var d=0|this.words[c];this.words[c]=u<<26-i|d>>>i,u=d&o}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(n,e,t){return r(0===this.negative),this.iushrn(n,e,t)},i.prototype.shln=function(n){return this.clone().ishln(n)},i.prototype.ushln=function(n){return this.clone().iushln(n)},i.prototype.shrn=function(n){return this.clone().ishrn(n)},i.prototype.ushrn=function(n){return this.clone().iushrn(n)},i.prototype.testn=function(n){r("number"==typeof n&&n>=0);var e=n%26,t=(n-e)/26,a=1<=0);var e=n%26,t=(n-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==e&&t++,this.length=Math.min(t,this.length),0!==e){var a=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},i.prototype.isubn=function(n){if(r("number"==typeof n),r(n<67108864),n<0)return this.iaddn(-n);if(0!==this.negative)return this.negative=0,this.iaddn(n),this.negative=1,this;if(this.words[0]-=n,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[a+t]=67108863&i}for(;a>26,this.words[a+t]=67108863&i;if(0===o)return this.strip();for(r(-1===o),o=0,a=0;a>26,this.words[a]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(n,e){var t=(this.length,n.length),r=this.clone(),a=n,s=0|a.words[a.length-1];0!==(t=26-this._countBits(s))&&(a=a.ushln(t),r.iushln(t),s=0|a.words[a.length-1]);var o,l=r.length-a.length;if("mod"!==e){(o=new i(null)).length=l+1,o.words=new Array(o.length);for(var c=0;c=0;d--){var f=67108864*(0|r.words[a.length+d])+(0|r.words[a.length+d-1]);for(f=Math.min(f/s|0,67108863),r._ishlnsubmul(a,f,d);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(a,1,d),r.isZero()||(r.negative^=1);o&&(o.words[d]=f)}return o&&o.strip(),r.strip(),"div"!==e&&0!==t&&r.iushrn(t),{div:o||null,mod:r}},i.prototype.divmod=function(n,e,t){return r(!n.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===n.negative?(o=this.neg().divmod(n,e),"mod"!==e&&(a=o.div.neg()),"div"!==e&&(s=o.mod.neg(),t&&0!==s.negative&&s.iadd(n)),{div:a,mod:s}):0===this.negative&&0!==n.negative?(o=this.divmod(n.neg(),e),"mod"!==e&&(a=o.div.neg()),{div:a,mod:o.mod}):0!=(this.negative&n.negative)?(o=this.neg().divmod(n.neg(),e),"div"!==e&&(s=o.mod.neg(),t&&0!==s.negative&&s.isub(n)),{div:o.div,mod:s}):n.length>this.length||this.cmp(n)<0?{div:new i(0),mod:this}:1===n.length?"div"===e?{div:this.divn(n.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(n.words[0]))}:{div:this.divn(n.words[0]),mod:new i(this.modn(n.words[0]))}:this._wordDiv(n,e);var a,s,o},i.prototype.div=function(n){return this.divmod(n,"div",!1).div},i.prototype.mod=function(n){return this.divmod(n,"mod",!1).mod},i.prototype.umod=function(n){return this.divmod(n,"mod",!0).mod},i.prototype.divRound=function(n){var e=this.divmod(n);if(e.mod.isZero())return e.div;var t=0!==e.div.negative?e.mod.isub(n):e.mod,r=n.ushrn(1),a=n.andln(1),i=t.cmp(r);return i<0||1===a&&0===i?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(n){r(n<=67108863);for(var e=(1<<26)%n,t=0,a=this.length-1;a>=0;a--)t=(e*t+(0|this.words[a]))%n;return t},i.prototype.idivn=function(n){r(n<=67108863);for(var e=0,t=this.length-1;t>=0;t--){var a=(0|this.words[t])+67108864*e;this.words[t]=a/n|0,e=a%n}return this.strip()},i.prototype.divn=function(n){return this.clone().idivn(n)},i.prototype.egcd=function(n){r(0===n.negative),r(!n.isZero());var e=this,t=n.clone();e=0!==e.negative?e.umod(n):e.clone();for(var a=new i(1),s=new i(0),o=new i(0),l=new i(1),c=0;e.isEven()&&t.isEven();)e.iushrn(1),t.iushrn(1),++c;for(var u=t.clone(),d=e.clone();!e.isZero();){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()||s.isOdd())&&(a.iadd(u),s.isub(d)),a.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(t.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(t.iushrn(p);p-- >0;)(o.isOdd()||l.isOdd())&&(o.iadd(u),l.isub(d)),o.iushrn(1),l.iushrn(1);e.cmp(t)>=0?(e.isub(t),a.isub(o),s.isub(l)):(t.isub(e),o.isub(a),l.isub(s))}return{a:o,b:l,gcd:t.iushln(c)}},i.prototype._invmp=function(n){r(0===n.negative),r(!n.isZero());var e=this,t=n.clone();e=0!==e.negative?e.umod(n):e.clone();for(var a,s=new i(1),o=new i(0),l=t.clone();e.cmpn(1)>0&&t.cmpn(1)>0;){for(var c=0,u=1;0==(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);for(var d=0,f=1;0==(t.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(t.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);e.cmp(t)>=0?(e.isub(t),s.isub(o)):(t.isub(e),o.isub(s))}return(a=0===e.cmpn(1)?s:o).cmpn(0)<0&&a.iadd(n),a},i.prototype.gcd=function(n){if(this.isZero())return n.abs();if(n.isZero())return this.abs();var e=this.clone(),t=n.clone();e.negative=0,t.negative=0;for(var r=0;e.isEven()&&t.isEven();r++)e.iushrn(1),t.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;t.isEven();)t.iushrn(1);var a=e.cmp(t);if(a<0){var i=e;e=t,t=i}else if(0===a||0===t.cmpn(1))break;e.isub(t)}return t.iushln(r)},i.prototype.invm=function(n){return this.egcd(n).a.umod(n)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(n){return this.words[0]&n},i.prototype.bincn=function(n){r("number"==typeof n);var e=n%26,t=(n-e)/26,a=1<>>26,o&=67108863,this.words[s]=o}return 0!==i&&(this.words[s]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(n){var e,t=n<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)e=1;else{t&&(n=-n),r(n<=67108863,"Number is too big");var a=0|this.words[0];e=a===n?0:an.length)return 1;if(this.length=0;t--){var r=0|this.words[t],a=0|n.words[t];if(r!==a){ra&&(e=1);break}}return e},i.prototype.gtn=function(n){return 1===this.cmpn(n)},i.prototype.gt=function(n){return 1===this.cmp(n)},i.prototype.gten=function(n){return this.cmpn(n)>=0},i.prototype.gte=function(n){return this.cmp(n)>=0},i.prototype.ltn=function(n){return-1===this.cmpn(n)},i.prototype.lt=function(n){return-1===this.cmp(n)},i.prototype.lten=function(n){return this.cmpn(n)<=0},i.prototype.lte=function(n){return this.cmp(n)<=0},i.prototype.eqn=function(n){return 0===this.cmpn(n)},i.prototype.eq=function(n){return 0===this.cmp(n)},i.red=function(n){return new k(n)},i.prototype.toRed=function(n){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),n.convertTo(this)._forceRed(n)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(n){return this.red=n,this},i.prototype.forceRed=function(n){return r(!this.red,"Already a number in reduction context"),this._forceRed(n)},i.prototype.redAdd=function(n){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,n)},i.prototype.redIAdd=function(n){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,n)},i.prototype.redSub=function(n){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,n)},i.prototype.redISub=function(n){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,n)},i.prototype.redShl=function(n){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,n)},i.prototype.redMul=function(n){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,n),this.red.mul(this,n)},i.prototype.redIMul=function(n){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,n),this.red.imul(this,n)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(n){return r(this.red&&!n.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,n)};var b={k256:null,p224:null,p192:null,p25519:null};function g(n,e){this.name=n,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(n){if("string"==typeof n){var e=i._prime(n);this.m=e.p,this.prime=e}else r(n.gtn(1),"modulus must be greater than 1"),this.m=n,this.prime=null}function x(n){k.call(this,n),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}g.prototype._tmp=function(){var n=new i(null);return n.words=new Array(Math.ceil(this.n/13)),n},g.prototype.ireduce=function(n){var e,t=n;do{this.split(t,this.tmp),e=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?t.isub(this.p):t.strip(),t},g.prototype.split=function(n,e){n.iushrn(this.n,0,e)},g.prototype.imulK=function(n){return n.imul(this.k)},a(y,g),y.prototype.split=function(n,e){for(var t=Math.min(n.length,9),r=0;r>>22,a=i}a>>>=22,n.words[r-10]=a,0===a&&n.length>10?n.length-=10:n.length-=9},y.prototype.imulK=function(n){n.words[n.length]=0,n.words[n.length+1]=0,n.length+=2;for(var e=0,t=0;t>>=26,n.words[t]=a,e=r}return 0!==e&&(n.words[n.length++]=e),n},i._prime=function(n){if(b[n])return b[n];var e;if("k256"===n)e=new y;else if("p224"===n)e=new v;else if("p192"===n)e=new _;else{if("p25519"!==n)throw new Error("Unknown prime "+n);e=new w}return b[n]=e,e},k.prototype._verify1=function(n){r(0===n.negative,"red works only with positives"),r(n.red,"red works only with red numbers")},k.prototype._verify2=function(n,e){r(0==(n.negative|e.negative),"red works only with positives"),r(n.red&&n.red===e.red,"red works only with red numbers")},k.prototype.imod=function(n){return this.prime?this.prime.ireduce(n)._forceRed(this):n.umod(this.m)._forceRed(this)},k.prototype.neg=function(n){return n.isZero()?n.clone():this.m.sub(n)._forceRed(this)},k.prototype.add=function(n,e){this._verify2(n,e);var t=n.add(e);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},k.prototype.iadd=function(n,e){this._verify2(n,e);var t=n.iadd(e);return t.cmp(this.m)>=0&&t.isub(this.m),t},k.prototype.sub=function(n,e){this._verify2(n,e);var t=n.sub(e);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},k.prototype.isub=function(n,e){this._verify2(n,e);var t=n.isub(e);return t.cmpn(0)<0&&t.iadd(this.m),t},k.prototype.shl=function(n,e){return this._verify1(n),this.imod(n.ushln(e))},k.prototype.imul=function(n,e){return this._verify2(n,e),this.imod(n.imul(e))},k.prototype.mul=function(n,e){return this._verify2(n,e),this.imod(n.mul(e))},k.prototype.isqr=function(n){return this.imul(n,n.clone())},k.prototype.sqr=function(n){return this.mul(n,n)},k.prototype.sqrt=function(n){if(n.isZero())return n.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var t=this.m.add(new i(1)).iushrn(2);return this.pow(n,t)}for(var a=this.m.subn(1),s=0;!a.isZero()&&0===a.andln(1);)s++,a.iushrn(1);r(!a.isZero());var o=new i(1).toRed(this),l=o.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var d=this.pow(u,a),f=this.pow(n,a.addn(1).iushrn(1)),h=this.pow(n,a),p=s;0!==h.cmp(o);){for(var m=h,b=0;0!==m.cmp(o);b++)m=m.redSqr();r(b=0;r--){for(var c=e.words[r],u=l-1;u>=0;u--){var d=c>>u&1;a!==t[0]&&(a=this.sqr(a)),0!==d||0!==s?(s<<=1,s|=d,(4===++o||0===r&&0===u)&&(a=this.mul(a,t[s]),o=0,s=0)):o=0}l=26}return a},k.prototype.convertTo=function(n){var e=n.umod(this.m);return e===n?e.clone():e},k.prototype.convertFrom=function(n){var e=n.clone();return e.red=null,e},i.mont=function(n){return new x(n)},a(x,k),x.prototype.convertTo=function(n){return this.imod(n.ushln(this.shift))},x.prototype.convertFrom=function(n){var e=this.imod(n.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(n,e){if(n.isZero()||e.isZero())return n.words[0]=0,n.length=1,n;var t=n.imul(e),r=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=t.isub(r).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},x.prototype.mul=function(n,e){if(n.isZero()||e.isZero())return new i(0)._forceRed(this);var t=n.mul(e),r=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=t.isub(r).iushrn(this.shift),s=a;return a.cmp(this.m)>=0?s=a.isub(this.m):a.cmpn(0)<0&&(s=a.iadd(this.m)),s._forceRed(this)},x.prototype.invm=function(n){return this.imod(n._invmp(this.m).mul(this.r2))._forceRed(this)}}(n,this)}).call(this,t(18)(n))},function(n,e){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch(n){"object"==typeof window&&(t=window)}n.exports=t},function(n,e,t){var r;(function(){var t=this,a=t._,i=Array.prototype,s=Object.prototype,o=Function.prototype,l=i.push,c=i.slice,u=s.toString,d=s.hasOwnProperty,f=Array.isArray,h=Object.keys,p=o.bind,m=Object.create,b=function(){},g=function(n){return n instanceof g?n:this instanceof g?void(this._wrapped=n):new g(n)};n.exports&&(e=n.exports=g),e._=g,g.VERSION="1.8.3";var y=function(n,e,t){if(void 0===e)return n;switch(null==t?3:t){case 1:return function(t){return n.call(e,t)};case 2:return function(t,r){return n.call(e,t,r)};case 3:return function(t,r,a){return n.call(e,t,r,a)};case 4:return function(t,r,a,i){return n.call(e,t,r,a,i)}}return function(){return n.apply(e,arguments)}},v=function(n,e,t){return null==n?g.identity:g.isFunction(n)?y(n,e,t):g.isObject(n)?g.matcher(n):g.property(n)};g.iteratee=function(n,e){return v(n,e,1/0)};var _=function(n,e){return function(t){var r=arguments.length;if(r<2||null==t)return t;for(var a=1;a=0&&e<=x};function E(n){return function(e,t,r,a){t=y(t,a,4);var i=!A(e)&&g.keys(e),s=(i||e).length,o=n>0?0:s-1;return arguments.length<3&&(r=e[i?i[o]:o],o+=n),function(e,t,r,a,i,s){for(;i>=0&&i=0},g.invoke=function(n,e){var t=c.call(arguments,2),r=g.isFunction(e);return g.map(n,function(n){var a=r?e:n[e];return null==a?a:a.apply(n,t)})},g.pluck=function(n,e){return g.map(n,g.property(e))},g.where=function(n,e){return g.filter(n,g.matcher(e))},g.findWhere=function(n,e){return g.find(n,g.matcher(e))},g.max=function(n,e,t){var r,a,i=-1/0,s=-1/0;if(null==e&&null!=n)for(var o=0,l=(n=A(n)?n:g.values(n)).length;oi&&(i=r);else e=v(e,t),g.each(n,function(n,t,r){((a=e(n,t,r))>s||a===-1/0&&i===-1/0)&&(i=n,s=a)});return i},g.min=function(n,e,t){var r,a,i=1/0,s=1/0;if(null==e&&null!=n)for(var o=0,l=(n=A(n)?n:g.values(n)).length;or||void 0===t)return 1;if(t0?0:a-1;i>=0&&i0?s=i>=0?i:Math.max(i+o,s):o=i>=0?Math.min(i+1,o):i+o+1;else if(t&&i&&o)return r[i=t(r,a)]===a?i:-1;if(a!=a)return(i=e(c.call(r,s,o),g.isNaN))>=0?i+s:-1;for(i=n>0?s:o-1;i>=0&&ie?(s&&(clearTimeout(s),s=null),o=c,i=n.apply(r,a),s||(r=a=null)):s||!1===t.trailing||(s=setTimeout(l,u)),i}},g.debounce=function(n,e,t){var r,a,i,s,o,l=function(){var c=g.now()-s;c=0?r=setTimeout(l,e-c):(r=null,t||(o=n.apply(i,a),r||(i=a=null)))};return function(){i=this,a=arguments,s=g.now();var c=t&&!r;return r||(r=setTimeout(l,e)),c&&(o=n.apply(i,a),i=a=null),o}},g.wrap=function(n,e){return g.partial(e,n)},g.negate=function(n){return function(){return!n.apply(this,arguments)}},g.compose=function(){var n=arguments,e=n.length-1;return function(){for(var t=e,r=n[e].apply(this,arguments);t--;)r=n[t].call(this,r);return r}},g.after=function(n,e){return function(){if(--n<1)return e.apply(this,arguments)}},g.before=function(n,e){var t;return function(){return--n>0&&(t=e.apply(this,arguments)),n<=1&&(e=null),t}},g.once=g.partial(g.before,2);var B=!{toString:null}.propertyIsEnumerable("toString"),M=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];function N(n,e){var t=M.length,r=n.constructor,a=g.isFunction(r)&&r.prototype||s,i="constructor";for(g.has(n,i)&&!g.contains(e,i)&&e.push(i);t--;)(i=M[t])in n&&n[i]!==a[i]&&!g.contains(e,i)&&e.push(i)}g.keys=function(n){if(!g.isObject(n))return[];if(h)return h(n);var e=[];for(var t in n)g.has(n,t)&&e.push(t);return B&&N(n,e),e},g.allKeys=function(n){if(!g.isObject(n))return[];var e=[];for(var t in n)e.push(t);return B&&N(n,e),e},g.values=function(n){for(var e=g.keys(n),t=e.length,r=Array(t),a=0;a":">",'"':""","'":"'","`":"`"},L=g.invert(O),D=function(n){var e=function(e){return n[e]},t="(?:"+g.keys(n).join("|")+")",r=RegExp(t),a=RegExp(t,"g");return function(n){return n=null==n?"":""+n,r.test(n)?n.replace(a,e):n}};g.escape=D(O),g.unescape=D(L),g.result=function(n,e,t){var r=null==n?void 0:n[e];return void 0===r&&(r=t),g.isFunction(r)?r.call(n):r};var q=0;g.uniqueId=function(n){var e=++q+"";return n?n+e:e},g.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var F=/(.)^/,U={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},z=/\\|'|\r|\n|\u2028|\u2029/g,K=function(n){return"\\"+U[n]};g.template=function(n,e,t){!e&&t&&(e=t),e=g.defaults({},e,g.templateSettings);var r=RegExp([(e.escape||F).source,(e.interpolate||F).source,(e.evaluate||F).source].join("|")+"|$","g"),a=0,i="__p+='";n.replace(r,function(e,t,r,s,o){return i+=n.slice(a,o).replace(z,K),a=o+e.length,t?i+="'+\n((__t=("+t+"))==null?'':_.escape(__t))+\n'":r?i+="'+\n((__t=("+r+"))==null?'':__t)+\n'":s&&(i+="';\n"+s+"\n__p+='"),e}),i+="';\n",e.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var s=new Function(e.variable||"obj","_",i)}catch(n){throw n.source=i,n}var o=function(n){return s.call(this,n,g)},l=e.variable||"obj";return o.source="function("+l+"){\n"+i+"}",o},g.chain=function(n){var e=g(n);return e._chain=!0,e};var H=function(n,e){return n._chain?g(e).chain():e};g.mixin=function(n){g.each(g.functions(n),function(e){var t=g[e]=n[e];g.prototype[e]=function(){var n=[this._wrapped];return l.apply(n,arguments),H(this,t.apply(g,n))}})},g.mixin(g),g.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var e=i[n];g.prototype[n]=function(){var t=this._wrapped;return e.apply(t,arguments),"shift"!==n&&"splice"!==n||0!==t.length||delete t[0],H(this,t)}}),g.each(["concat","join","slice"],function(n){var e=i[n];g.prototype[n]=function(){return H(this,e.apply(this._wrapped,arguments))}}),g.prototype.value=function(){return this._wrapped},g.prototype.valueOf=g.prototype.toJSON=g.prototype.value,g.prototype.toString=function(){return""+this._wrapped},void 0===(r=function(){return g}.apply(e,[]))||(n.exports=r)}).call(this)},function(n,e,t){"use strict";var r=e;r.version=t(307).version,r.utils=t(308),r.rand=t(134),r.curve=t(49),r.curves=t(313),r.ec=t(321),r.eddsa=t(325)},function(n,e,t){"use strict";var r=t(203),a=t(204);n.exports={errors:r,formatters:a}},function(n,e){var t,r,a=n.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(n){if(t===setTimeout)return setTimeout(n,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(n,0);try{return t(n,0)}catch(e){try{return t.call(null,n,0)}catch(e){return t.call(this,n,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(n){t=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(n){r=s}}();var l,c=[],u=!1,d=-1;function f(){u&&l&&(u=!1,l.length?c=l.concat(c):d=-1,c.length&&h())}function h(){if(!u){var n=o(f);u=!0;for(var e=c.length;e;){for(l=c,c=[];++d1)for(var t=1;t=0&&(a=e.type.substring(i));var s=l(n,e.components);r.isArray(s)&&n?t.push("tuple("+s.join(",")+")"+a):n?t.push("("+s+")"):t.push("("+s.join(",")+")"+a)}else t.push(e.type)}),t},c=function(n){if(!i.isHexStrict(n))throw new Error("The parameter must be a valid HEX string.");var e="",t=0,r=n.length;for("0x"===n.substring(0,2)&&(t=2);t7?t+=n[r].toUpperCase():t+=n[r];return t},toHex:i.toHex,toBN:i.toBN,bytesToHex:i.bytesToHex,hexToBytes:i.hexToBytes,hexToNumberString:i.hexToNumberString,hexToNumber:i.hexToNumber,toDecimal:i.hexToNumber,numberToHex:i.numberToHex,fromDecimal:i.numberToHex,hexToUtf8:i.hexToUtf8,hexToString:i.hexToUtf8,toUtf8:i.hexToUtf8,utf8ToHex:i.utf8ToHex,stringToHex:i.utf8ToHex,fromUtf8:i.utf8ToHex,hexToAscii:c,toAscii:c,asciiToHex:u,fromAscii:u,unitMap:a.unitMap,toWei:function(n,e){if(e=d(e),!i.isBN(n)&&!r.isString(n))throw new Error("Please pass numbers as strings or BigNumber objects to avoid precision errors.");return i.isBN(n)?a.toWei(n,e):a.toWei(n,e).toString(10)},fromWei:function(n,e){if(e=d(e),!i.isBN(n)&&!r.isString(n))throw new Error("Please pass numbers as strings or BigNumber objects to avoid precision errors.");return i.isBN(n)?a.fromWei(n,e):a.fromWei(n,e).toString(10)},padLeft:i.leftPad,leftPad:i.leftPad,padRight:i.rightPad,rightPad:i.rightPad,toTwosComplement:i.toTwosComplement}},function(n,e,t){"use strict";var r=t(9),a=t(0);function i(n,e){return 55296==(64512&n.charCodeAt(e))&&(!(e<0||e+1>=n.length)&&56320==(64512&n.charCodeAt(e+1)))}function s(n){return(n>>>24|n>>>8&65280|n<<8&16711680|(255&n)<<24)>>>0}function o(n){return 1===n.length?"0"+n:n}function l(n){return 7===n.length?"0"+n:6===n.length?"00"+n:5===n.length?"000"+n:4===n.length?"0000"+n:3===n.length?"00000"+n:2===n.length?"000000"+n:1===n.length?"0000000"+n:n}e.inherits=a,e.toArray=function(n,e){if(Array.isArray(n))return n.slice();if(!n)return[];var t=[];if("string"==typeof n)if(e){if("hex"===e)for((n=n.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(n="0"+n),a=0;a>6|192,t[r++]=63&s|128):i(n,a)?(s=65536+((1023&s)<<10)+(1023&n.charCodeAt(++a)),t[r++]=s>>18|240,t[r++]=s>>12&63|128,t[r++]=s>>6&63|128,t[r++]=63&s|128):(t[r++]=s>>12|224,t[r++]=s>>6&63|128,t[r++]=63&s|128)}else for(a=0;a>>0}return s},e.split32=function(n,e){for(var t=new Array(4*n.length),r=0,a=0;r>>24,t[a+1]=i>>>16&255,t[a+2]=i>>>8&255,t[a+3]=255&i):(t[a+3]=i>>>24,t[a+2]=i>>>16&255,t[a+1]=i>>>8&255,t[a]=255&i)}return t},e.rotr32=function(n,e){return n>>>e|n<<32-e},e.rotl32=function(n,e){return n<>>32-e},e.sum32=function(n,e){return n+e>>>0},e.sum32_3=function(n,e,t){return n+e+t>>>0},e.sum32_4=function(n,e,t,r){return n+e+t+r>>>0},e.sum32_5=function(n,e,t,r,a){return n+e+t+r+a>>>0},e.sum64=function(n,e,t,r){var a=n[e],i=r+n[e+1]>>>0,s=(i>>0,n[e+1]=i},e.sum64_hi=function(n,e,t,r){return(e+r>>>0>>0},e.sum64_lo=function(n,e,t,r){return e+r>>>0},e.sum64_4_hi=function(n,e,t,r,a,i,s,o){var l=0,c=e;return l+=(c=c+r>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(n,e,t,r,a,i,s,o){return e+r+i+o>>>0},e.sum64_5_hi=function(n,e,t,r,a,i,s,o,l,c){var u=0,d=e;return u+=(d=d+r>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(n,e,t,r,a,i,s,o,l,c){return e+r+i+o+c>>>0},e.rotr64_hi=function(n,e,t){return(e<<32-t|n>>>t)>>>0},e.rotr64_lo=function(n,e,t){return(n<<32-t|e>>>t)>>>0},e.shr64_hi=function(n,e,t){return n>>>t},e.shr64_lo=function(n,e,t){return(n<<32-t|e>>>t)>>>0}},function(n,e){n.exports=function(n){return"object"==typeof n?null!==n:"function"==typeof n}},function(n,e){var t=n.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},function(n,e,t){var r=t(90)("wks"),a=t(57),i=t(13).Symbol,s="function"==typeof i;(n.exports=function(n){return r[n]||(r[n]=s&&i[n]||(s?i:a)("Symbol."+n))}).store=r},function(n,e,t){var r=t(1).Buffer,a=t(71).Transform,i=t(67).StringDecoder;function s(n){a.call(this),this.hashMode="string"==typeof n,this.hashMode?this[n]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}t(0)(s,a),s.prototype.update=function(n,e,t){"string"==typeof n&&(n=r.from(n,e));var a=this._update(n);return this.hashMode?this:(t&&(a=this._toString(a,t)),a)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(n,e,t){var r;try{this.hashMode?this._update(n):this.push(this._update(n))}catch(n){r=n}finally{t(r)}},s.prototype._flush=function(n){var e;try{this.push(this.__final())}catch(n){e=n}n(e)},s.prototype._finalOrDigest=function(n){var e=this.__final()||r.alloc(0);return n&&(e=this._toString(e,n,!0)),e},s.prototype._toString=function(n,e,t){if(this._decoder||(this._decoder=new i(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var r=this._decoder.write(n);return t&&(r+=this._decoder.end()),r},n.exports=s},function(n,e,t){var r=t(28),a=t(86);n.exports=t(29)?function(n,e,t){return r.f(n,e,a(1,t))}:function(n,e,t){return n[e]=t,n}},function(n,e,t){"use strict";var r=t(202),a=t(248);n.exports={packageInit:function(n,e){if(e=Array.prototype.slice.call(e),!n)throw new Error('You need to instantiate using the "new" keyword.');Object.defineProperty(n,"currentProvider",{get:function(){return n._provider},set:function(e){return n.setProvider(e)},enumerable:!0,configurable:!0}),e[0]&&e[0]._requestManager?n._requestManager=new r.Manager(e[0].currentProvider):(n._requestManager=new r.Manager,n._requestManager.setProvider(e[0],e[1])),n.givenProvider=r.Manager.givenProvider,n.providers=r.Manager.providers,n._provider=n._requestManager.provider,n.setProvider||(n.setProvider=function(e,t){return n._requestManager.setProvider(e,t),n._provider=n._requestManager.provider,!0}),n.BatchRequest=r.BatchManager.bind(null,n._requestManager),n.extend=a(n)},addProviders:function(n){n.givenProvider=r.Manager.givenProvider,n.providers=r.Manager.providers}}},function(n,e){n.exports=function(n){return n.webpackPolyfill||(n.deprecate=function(){},n.paths=[],n.children||(n.children=[]),Object.defineProperty(n,"loaded",{enumerable:!0,get:function(){return n.l}}),Object.defineProperty(n,"id",{enumerable:!0,get:function(){return n.i}}),n.webpackPolyfill=1),n}},function(n,e,t){"use strict";var r=t(41),a=Object.keys||function(n){var e=[];for(var t in n)e.push(t);return e};n.exports=d;var i=t(33);i.inherits=t(0);var s=t(104),o=t(66);i.inherits(d,s);for(var l=a(o.prototype),c=0;c1?(n[t[0]]=n[t[0]]||{},n[t[0]][t[1]]=e):n[t[0]]=e},c.prototype.getCall=function(n){return r.isFunction(this.call)?this.call(n):this.call},c.prototype.extractCallback=function(n){if(r.isFunction(n[n.length-1]))return n.pop()},c.prototype.validateArgs=function(n){if(n.length!==this.params)throw a.InvalidNumberOfParams(n.length,this.params,this.name)},c.prototype.formatInput=function(n){var e=this;return this.inputFormatter?this.inputFormatter.map(function(t,r){return t?t.call(e,n[r]):n[r]}):n},c.prototype.formatOutput=function(n){var e=this;return r.isArray(n)?n.map(function(n){return e.outputFormatter&&n?e.outputFormatter(n):n}):this.outputFormatter&&n?this.outputFormatter(n):n},c.prototype.toPayload=function(n){var e=this.getCall(n),t=this.extractCallback(n),r=this.formatInput(n);this.validateArgs(r);var a={method:e,params:r,callback:t};return this.transformPayload&&(a=this.transformPayload(a)),a},c.prototype._confirmTransaction=function(n,e,t){var a=this,u=!1,d=!0,f=0,h=0,p=null,m="",b=r.isObject(t.params[0])&&t.params[0].gas?t.params[0].gas:null,g=r.isObject(t.params[0])&&t.params[0].data&&t.params[0].from&&!t.params[0].to,y=[new c({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:i.outputTransactionReceiptFormatter}),new c({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[i.inputAddressFormatter,i.inputDefaultBlockNumberFormatter]}),new l({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:i.outputBlockFormatter}}})],v={};r.each(y,function(n){n.attachToObject(v),n.requestManager=a.requestManager});var _=function(t,r,i,l,c){if(!i)return c||(c={unsubscribe:function(){clearInterval(p)}}),(t?o.resolve(t):v.getTransactionReceipt(e)).catch(function(e){c.unsubscribe(),u=!0,s._fireError({message:"Failed to check for transaction receipt:",data:e},n.eventEmitter,n.reject)}).then(function(e){if(!e||!e.blockHash)throw new Error("Receipt missing or blockHash null");return a.extraFormatters&&a.extraFormatters.receiptFormatter&&(e=a.extraFormatters.receiptFormatter(e)),n.eventEmitter.listeners("confirmation").length>0&&(void 0!==t&&0===h||n.eventEmitter.emit("confirmation",h,e),d=!1,25===++h&&(c.unsubscribe(),n.eventEmitter.removeAllListeners())),e}).then(function(e){if(g&&!u){if(!e.contractAddress)return d&&(c.unsubscribe(),u=!0),void s._fireError(new Error("The transaction receipt didn't contain a contract address."),n.eventEmitter,n.reject);v.getCode(e.contractAddress,function(t,r){r&&(r.length>2?(n.eventEmitter.emit("receipt",e),a.extraFormatters&&a.extraFormatters.contractDeployFormatter?n.resolve(a.extraFormatters.contractDeployFormatter(e)):n.resolve(e),d&&n.eventEmitter.removeAllListeners()):s._fireError(new Error("The contract code couldn't be stored, please check your gas limit."),n.eventEmitter,n.reject),d&&c.unsubscribe(),u=!0)})}return e}).then(function(e){g||u||(e.outOfGas||b&&b===e.gasUsed||!0!==e.status&&"0x1"!==e.status&&void 0!==e.status?(m=JSON.stringify(e,null,2),!1===e.status||"0x0"===e.status?s._fireError(new Error("Transaction has been reverted by the EVM:\n"+m),n.eventEmitter,n.reject):s._fireError(new Error("Transaction ran out of gas. Please provide more gas:\n"+m),n.eventEmitter,n.reject)):(n.eventEmitter.emit("receipt",e),n.resolve(e),d&&n.eventEmitter.removeAllListeners()),d&&c.unsubscribe(),u=!0)}).catch(function(){f++,r?f-1>=750&&(c.unsubscribe(),u=!0,s._fireError(new Error("Transaction was not mined within750 seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!"),n.eventEmitter,n.reject)):f-1>=50&&(c.unsubscribe(),u=!0,s._fireError(new Error("Transaction was not mined within 50 blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!"),n.eventEmitter,n.reject))});c.unsubscribe(),u=!0,s._fireError({message:"Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.",data:i},n.eventEmitter,n.reject)},w=function(n){r.isFunction(this.requestManager.provider.on)?v.subscribe("newBlockHeaders",_.bind(null,n,!1)):p=setInterval(_.bind(null,n,!0),1e3)}.bind(this);v.getTransactionReceipt(e).then(function(e){e&&e.blockHash?(n.eventEmitter.listeners("confirmation").length>0&&w(e),_(e,!1)):u||w()}).catch(function(){u||w()})};var u=function(n,e){return r.isNumber(n)?e.wallet[n]:r.isObject(n)&&n.address&&n.privateKey?n:e.wallet[n.toLowerCase()]};c.prototype.buildCall=function(){var n=this,e="eth_sendTransaction"===n.call||"eth_sendRawTransaction"===n.call,t=function(){var t=o(!e),a=n.toPayload(Array.prototype.slice.call(arguments)),i=function(r,i){try{i=n.formatOutput(i)}catch(n){r=n}if(i instanceof Error&&(r=i),r)return r.error&&(r=r.error),s._fireError(r,t.eventEmitter,t.reject,a.callback);a.callback&&a.callback(null,i),e?(t.eventEmitter.emit("transactionHash",i),n._confirmTransaction(t,i,a)):r||t.resolve(i)},l=function(e){var t=r.extend({},a,{method:"eth_sendRawTransaction",params:[e.rawTransaction]});n.requestManager.send(t,i)},d=function(n,e){var a;if(e&&e.accounts&&e.accounts.wallet&&e.accounts.wallet.length)if("eth_sendTransaction"===n.method){var s=n.params[0];if((a=u(r.isObject(s)?s.from:null,e.accounts))&&a.privateKey)return e.accounts.signTransaction(r.omit(s,"from"),a.privateKey).then(l)}else if("eth_sign"===n.method){var o=n.params[1];if((a=u(n.params[0],e.accounts))&&a.privateKey){var c=e.accounts.sign(o,a.privateKey);return n.callback&&n.callback(null,c.signature),void t.resolve(c.signature)}}return e.requestManager.send(n,i)};e&&r.isObject(a.params[0])&&void 0===a.params[0].gasPrice?new c({name:"getGasPrice",call:"eth_gasPrice",params:0}).createFunction(n.requestManager)(function(e,t){t&&(a.params[0].gasPrice=t),d(a,n)}):d(a,n);return t.eventEmitter};return t.method=n,t.request=this.request.bind(this),t},c.prototype.request=function(){var n=this.toPayload(Array.prototype.slice.call(arguments));return n.format=this.formatOutput.bind(this),n},n.exports=c},function(n,e,t){var r=t(12);n.exports=function(n){if(!r(n))throw TypeError(n+" is not an object!");return n}},function(n,e){var t={}.hasOwnProperty;n.exports=function(n,e){return t.call(n,e)}},function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=t(45);function a(n){return!!n._bn}function i(n){return n.slice?n:(n.slice=function(){var e=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(n,e))},n)}function s(n){if(!n||parseInt(String(n.length))!=n.length||"string"==typeof n)return!1;for(var e=0;e=256||parseInt(String(t))!=t)return!1}return!0}function o(n){if(null==n&&r.throwError("cannot convert null value to array",r.INVALID_ARGUMENT,{arg:"value",value:n}),a(n)&&(n=n.toHexString()),"string"==typeof n){var e=n.match(/^(0x)?[0-9a-fA-F]*$/);e||r.throwError("invalid hexidecimal string",r.INVALID_ARGUMENT,{arg:"value",value:n}),"0x"!==e[1]&&r.throwError("hex string must have 0x prefix",r.INVALID_ARGUMENT,{arg:"value",value:n}),(n=n.substring(2)).length%2&&(n="0"+n);for(var t=[],o=0;o>4]+u[15&l])}return"0x"+i.join("")}return r.throwError("invalid hexlify value",null,{arg:"value",value:n}),"never"}function f(n,e){for(c(n)||r.throwError("invalid hex string",r.INVALID_ARGUMENT,{arg:"value",value:n});n.length<2*e+2;)n="0x0"+n.substring(2);return n}function h(n){var e,t=0,a="0x",i="0x";if((e=n)&&null!=e.r&&null!=e.s){null==n.v&&null==n.recoveryParam&&r.throwError("at least on of recoveryParam or v must be specified",r.INVALID_ARGUMENT,{argument:"signature",value:n}),a=f(n.r,32),i=f(n.s,32),"string"==typeof(t=n.v)&&(t=parseInt(t,16));var s=n.recoveryParam;null==s&&null!=n.v&&(s=1-t%2),t=27+s}else{var l=o(n);if(65!==l.length)throw new Error("invalid signature");a=d(l.slice(0,32)),i=d(l.slice(32,64)),27!==(t=l[64])&&28!==t&&(t=27+t%2)}return{r:a,s:i,recoveryParam:t-27,v:t}}e.hexlify=d,e.hexDataLength=function(n){return c(n)&&n.length%2==0?(n.length-2)/2:null},e.hexDataSlice=function(n,e,t){return c(n)||r.throwError("invalid hex data",r.INVALID_ARGUMENT,{arg:"value",value:n}),n.length%2!=0&&r.throwError("hex data length must be even",r.INVALID_ARGUMENT,{arg:"value",value:n}),e=2+2*e,null!=t?"0x"+n.substring(e,e+2*t):"0x"+n.substring(e)},e.hexStripZeros=function(n){for(c(n)||r.throwError("invalid hex string",r.INVALID_ARGUMENT,{arg:"value",value:n});n.length>3&&"0x0"===n.substring(0,3);)n="0x"+n.substring(3);return n},e.hexZeroPad=f,e.splitSignature=h,e.joinSignature=function(n){return d(l([(n=h(n)).r,n.s,n.recoveryParam?"0x1c":"0x1b"]))}},function(n,e,t){"use strict";(function(e,r){var a=65536,i=4294967295;var s=t(1).Buffer,o=e.crypto||e.msCrypto;o&&o.getRandomValues?n.exports=function(n,e){if(n>i)throw new RangeError("requested too many random bytes");var t=s.allocUnsafe(n);if(n>0)if(n>a)for(var l=0;l=this._finalSize&&(this._update(this._block),this._block.fill(0));var t=8*this._len;if(t<=4294967295)this._block.writeUInt32BE(t,this._blockSize-4);else{var r=(4294967295&t)>>>0,a=(t-r)/4294967296;this._block.writeUInt32BE(a,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var i=this._hash();return n?i.toString(n):i},a.prototype._update=function(){throw new Error("_update must be implemented by subclass")},n.exports=a},function(n,e){n.exports={}},function(n,e){var t=n.exports={version:"2.6.5"};"number"==typeof __e&&(__e=t)},function(n,e,t){var r=t(21),a=t(171),i=t(172),s=Object.defineProperty;e.f=t(29)?Object.defineProperty:function(n,e,t){if(r(n),e=i(e,!0),r(t),a)try{return s(n,e,t)}catch(n){}if("get"in t||"set"in t)throw TypeError("Accessors not supported!");return"value"in t&&(n[e]=t.value),n}},function(n,e,t){n.exports=!t(30)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(n,e){n.exports=function(n){try{return!!n()}catch(n){return!0}}},function(n,e,t){"use strict";var r=t(101),a=t(224);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}e.parse=v,e.resolve=function(n,e){return v(n,!1,!0).resolve(e)},e.resolveObject=function(n,e){return n?v(n,!1,!0).resolveObject(e):e},e.format=function(n){a.isString(n)&&(n=v(n));return n instanceof i?n.format():i.prototype.format.call(n)},e.Url=i;var s=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,l=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(c),d=["%","/","?",";","#"].concat(u),f=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=t(225);function v(n,e,t){if(n&&a.isObject(n)&&n instanceof i)return n;var r=new i;return r.parse(n,e,t),r}i.prototype.parse=function(n,e,t){if(!a.isString(n))throw new TypeError("Parameter 'url' must be a string, not "+typeof n);var i=n.indexOf("?"),o=-1!==i&&i127?M+="x":M+=B[N];if(!M.match(h)){var O=j.slice(0,T),L=j.slice(T+1),D=B.match(p);D&&(O.push(D[1]),L.unshift(D[2])),L.length&&(v="/"+L.join(".")+v),this.hostname=O.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),I||(this.hostname=r.toASCII(this.hostname));var q=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+q,this.href+=this.host,I&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!m[k])for(T=0,R=u.length;T0)&&t.host.split("@"))&&(t.auth=I.shift(),t.host=t.hostname=I.shift());return t.search=n.search,t.query=n.query,a.isNull(t.pathname)&&a.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t}if(!x.length)return t.pathname=null,t.search?t.path="/"+t.search:t.path=null,t.href=t.format(),t;for(var A=x.slice(-1)[0],E=(t.host||n.host||x.length>1)&&("."===A||".."===A)||""===A,T=0,C=x.length;C>=0;C--)"."===(A=x[C])?x.splice(C,1):".."===A?(x.splice(C,1),T++):T&&(x.splice(C,1),T--);if(!w&&!k)for(;T--;T)x.unshift("..");!w||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),E&&"/"!==x.join("/").substr(-1)&&x.push("");var I,j=""===x[0]||x[0]&&"/"===x[0].charAt(0);S&&(t.hostname=t.host=j?"":x.length?x.shift():"",(I=!!(t.host&&t.host.indexOf("@")>0)&&t.host.split("@"))&&(t.auth=I.shift(),t.host=t.hostname=I.shift()));return(w=w||t.host&&x.length)&&!j&&x.unshift(""),x.length?t.pathname=x.join("/"):(t.pathname=null,t.path=null),a.isNull(t.pathname)&&a.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.auth=n.auth||t.auth,t.slashes=t.slashes||n.slashes,t.href=t.format(),t},i.prototype.parseHost=function(){var n=this.host,e=o.exec(n);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),n=n.substr(0,n.length-e.length)),n&&(this.hostname=n)}},function(n,e,t){(e=n.exports=t(104)).Stream=e,e.Readable=e,e.Writable=t(66),e.Duplex=t(19),e.Transform=t(107),e.PassThrough=t(238)},function(n,e,t){(function(n){function t(n){return Object.prototype.toString.call(n)}e.isArray=function(n){return Array.isArray?Array.isArray(n):"[object Array]"===t(n)},e.isBoolean=function(n){return"boolean"==typeof n},e.isNull=function(n){return null===n},e.isNullOrUndefined=function(n){return null==n},e.isNumber=function(n){return"number"==typeof n},e.isString=function(n){return"string"==typeof n},e.isSymbol=function(n){return"symbol"==typeof n},e.isUndefined=function(n){return void 0===n},e.isRegExp=function(n){return"[object RegExp]"===t(n)},e.isObject=function(n){return"object"==typeof n&&null!==n},e.isDate=function(n){return"[object Date]"===t(n)},e.isError=function(n){return"[object Error]"===t(n)||n instanceof Error},e.isFunction=function(n){return"function"==typeof n},e.isPrimitive=function(n){return null===n||"boolean"==typeof n||"number"==typeof n||"string"==typeof n||"symbol"==typeof n||void 0===n},e.isBuffer=n.isBuffer}).call(this,t(2).Buffer)},function(n,e,t){"use strict";var r=t(0),a=t(70),i=t(72),s=t(73),o=t(15);function l(n){o.call(this,"digest"),this._hash=n}r(l,o),l.prototype._update=function(n){this._hash.update(n)},l.prototype._final=function(){return this._hash.digest()},n.exports=function(n){return"md5"===(n=n.toLowerCase())?new a:"rmd160"===n||"ripemd160"===n?new i:new l(s(n))}},function(n,e,t){(function(e){n.exports=function(n,t){for(var r=Math.min(n.length,t.length),a=new e(r),i=0;i=this._delta8){var t=(n=this.pending).length%this._delta8;this.pending=n.slice(n.length-t,n.length),0===this.pending.length&&(this.pending=null),n=r.join32(n,0,n.length-t,this.endian);for(var a=0;a>>24&255,r[a++]=n>>>16&255,r[a++]=n>>>8&255,r[a++]=255&n}else for(r[a++]=255&n,r[a++]=n>>>8&255,r[a++]=n>>>16&255,r[a++]=n>>>24&255,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,i=8;i1?(n[t[0]]=n[t[0]]||{},n[t[0]][t[1]]=e):n[t[0]]=e},a.prototype.buildCall=function(){var n=this;return function(){n.subscriptions[arguments[0]]||console.warn("Subscription "+JSON.stringify(arguments[0])+" doesn't exist. Subscribing anyway.");var e=new r({subscription:n.subscriptions[arguments[0]],requestManager:n.requestManager,type:n.type});return e.subscribe.apply(e,arguments)}},n.exports={subscriptions:a,subscription:r}},function(n,e,t){"use strict";var r=t(17),a=t(20),i=t(10),s=function(){var n=this;r.packageInit(this,arguments),[new a({name:"getId",call:"net_version",params:0,outputFormatter:i.hexToNumber}),new a({name:"isListening",call:"net_listening",params:0}),new a({name:"getPeerCount",call:"net_peerCount",params:0,outputFormatter:i.hexToNumber})].forEach(function(e){e.attachToObject(n),e.setRequestManager(n._requestManager)})};r.addProviders(s),n.exports=s},function(n,e,t){"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 r=!1,a=!1;function i(n,t,r){if(a)throw new Error("unknown error");t||(t=e.UNKNOWN_ERROR),r||(r={});var i=[];Object.keys(r).forEach(function(n){try{i.push(n+"="+JSON.stringify(r[n]))}catch(e){i.push(n+"="+JSON.stringify(r[n].toString()))}});var s=n;i.length&&(n+=" ("+i.join(", ")+")");var o=new Error(n);throw o.reason=s,o.code=t,Object.keys(r).forEach(function(n){o[n]=r[n]}),o}e.throwError=i,e.checkNew=function(n,t){n instanceof t||i("missing new",e.MISSING_NEW,{name:t.name})},e.checkArgumentCount=function(n,t,r){r||(r=""),nt&&i("too many arguments"+r,e.UNEXPECTED_ARGUMENT,{count:n,expectedCount:t})},e.setCensorship=function(n,t){r&&i("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),a=!!n,r=!!t}},function(n,e,t){"use strict";e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=t(24),e.createHash=e.Hash=t(34),e.createHmac=e.Hmac=t(121);var r=t(282),a=Object.keys(r),i=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(a);e.getHashes=function(){return i};var s=t(74);e.pbkdf2=s.pbkdf2,e.pbkdf2Sync=s.pbkdf2Sync;var o=t(284);e.Cipher=o.Cipher,e.createCipher=o.createCipher,e.Cipheriv=o.Cipheriv,e.createCipheriv=o.createCipheriv,e.Decipher=o.Decipher,e.createDecipher=o.createDecipher,e.Decipheriv=o.Decipheriv,e.createDecipheriv=o.createDecipheriv,e.getCiphers=o.getCiphers,e.listCiphers=o.listCiphers;var l=t(301);e.DiffieHellmanGroup=l.DiffieHellmanGroup,e.createDiffieHellmanGroup=l.createDiffieHellmanGroup,e.getDiffieHellman=l.getDiffieHellman,e.createDiffieHellman=l.createDiffieHellman,e.DiffieHellman=l.DiffieHellman;var c=t(305);e.createSign=c.createSign,e.Sign=c.Sign,e.createVerify=c.createVerify,e.Verify=c.Verify,e.createECDH=t(343);var u=t(344);e.publicEncrypt=u.publicEncrypt,e.privateEncrypt=u.privateEncrypt,e.publicDecrypt=u.publicDecrypt,e.privateDecrypt=u.privateDecrypt;var d=t(347);e.randomFill=d.randomFill,e.randomFillSync=d.randomFillSync,e.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},function(n,e,t){var r=t(1).Buffer;function a(n){r.isBuffer(n)||(n=r.from(n));for(var e=n.length/4|0,t=new Array(e),a=0;a>>24]^u[p>>>16&255]^d[m>>>8&255]^f[255&b]^e[g++],s=c[p>>>24]^u[m>>>16&255]^d[b>>>8&255]^f[255&h]^e[g++],o=c[m>>>24]^u[b>>>16&255]^d[h>>>8&255]^f[255&p]^e[g++],l=c[b>>>24]^u[h>>>16&255]^d[p>>>8&255]^f[255&m]^e[g++],h=i,p=s,m=o,b=l;return i=(r[h>>>24]<<24|r[p>>>16&255]<<16|r[m>>>8&255]<<8|r[255&b])^e[g++],s=(r[p>>>24]<<24|r[m>>>16&255]<<16|r[b>>>8&255]<<8|r[255&h])^e[g++],o=(r[m>>>24]<<24|r[b>>>16&255]<<16|r[h>>>8&255]<<8|r[255&p])^e[g++],l=(r[b>>>24]<<24|r[h>>>16&255]<<16|r[p>>>8&255]<<8|r[255&m])^e[g++],[i>>>=0,s>>>=0,o>>>=0,l>>>=0]}var o=[0,1,2,4,8,16,32,64,128,27,54],l=function(){for(var n=new Array(256),e=0;e<256;e++)n[e]=e<128?e<<1:e<<1^283;for(var t=[],r=[],a=[[],[],[],[]],i=[[],[],[],[]],s=0,o=0,l=0;l<256;++l){var c=o^o<<1^o<<2^o<<3^o<<4;c=c>>>8^255&c^99,t[s]=c,r[c]=s;var u=n[s],d=n[u],f=n[d],h=257*n[c]^16843008*c;a[0][s]=h<<24|h>>>8,a[1][s]=h<<16|h>>>16,a[2][s]=h<<8|h>>>24,a[3][s]=h,h=16843009*f^65537*d^257*u^16843008*s,i[0][c]=h<<24|h>>>8,i[1][c]=h<<16|h>>>16,i[2][c]=h<<8|h>>>24,i[3][c]=h,0===s?s=o=1:(s=u^n[n[n[f^u]]],o^=n[n[o]])}return{SBOX:t,INV_SBOX:r,SUB_MIX:a,INV_SUB_MIX:i}}();function c(n){this._key=a(n),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var n=this._key,e=n.length,t=e+6,r=4*(t+1),a=[],i=0;i>>24,s=l.SBOX[s>>>24]<<24|l.SBOX[s>>>16&255]<<16|l.SBOX[s>>>8&255]<<8|l.SBOX[255&s],s^=o[i/e|0]<<24):e>6&&i%e==4&&(s=l.SBOX[s>>>24]<<24|l.SBOX[s>>>16&255]<<16|l.SBOX[s>>>8&255]<<8|l.SBOX[255&s]),a[i]=a[i-e]^s}for(var c=[],u=0;u>>24]]^l.INV_SUB_MIX[1][l.SBOX[f>>>16&255]]^l.INV_SUB_MIX[2][l.SBOX[f>>>8&255]]^l.INV_SUB_MIX[3][l.SBOX[255&f]]}this._nRounds=t,this._keySchedule=a,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(n){return s(n=a(n),this._keySchedule,l.SUB_MIX,l.SBOX,this._nRounds)},c.prototype.encryptBlock=function(n){var e=this.encryptBlockRaw(n),t=r.allocUnsafe(16);return t.writeUInt32BE(e[0],0),t.writeUInt32BE(e[1],4),t.writeUInt32BE(e[2],8),t.writeUInt32BE(e[3],12),t},c.prototype.decryptBlock=function(n){var e=(n=a(n))[1];n[1]=n[3],n[3]=e;var t=s(n,this._invKeySchedule,l.INV_SUB_MIX,l.INV_SBOX,this._nRounds),i=r.allocUnsafe(16);return i.writeUInt32BE(t[0],0),i.writeUInt32BE(t[3],4),i.writeUInt32BE(t[2],8),i.writeUInt32BE(t[1],12),i},c.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},n.exports.AES=c},function(n,e,t){var r=t(1).Buffer,a=t(70);n.exports=function(n,e,t,i){if(r.isBuffer(n)||(n=r.from(n,"binary")),e&&(r.isBuffer(e)||(e=r.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=t/8,o=r.alloc(s),l=r.alloc(i||0),c=r.alloc(0);s>0||i>0;){var u=new a;u.update(c),u.update(n),e&&u.update(e),c=u.digest();var d=0;if(s>0){var f=o.length-s;d=Math.min(s,c.length),c.copy(o,f,0,d),s-=d}if(d0){var h=l.length-i,p=Math.min(i,c.length-d);c.copy(l,h,d,d+p),i-=p}}return c.fill(0),{key:o,iv:l}}},function(n,e,t){"use strict";var r=e;r.base=t(309),r.short=t(310),r.mont=t(311),r.edwards=t(312)},function(n,e,t){var r=t(328),a=t(340),i=t(341),s=t(76),o=t(74),l=t(1).Buffer;function c(n){var e;"object"!=typeof n||l.isBuffer(n)||(e=n.passphrase,n=n.key),"string"==typeof n&&(n=l.from(n));var t,c,u=i(n,e),d=u.tag,f=u.data;switch(d){case"CERTIFICATE":c=r.certificate.decode(f,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(c||(c=r.PublicKey.decode(f,"der")),t=c.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return r.RSAPublicKey.decode(c.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return c.subjectPrivateKey=c.subjectPublicKey,{type:"ec",data:c};case"1.2.840.10040.4.1":return c.algorithm.params.pub_key=r.DSAparam.decode(c.subjectPublicKey.data,"der"),{type:"dsa",data:c.algorithm.params};default:throw new Error("unknown key id "+t)}throw new Error("unknown key type "+d);case"ENCRYPTED PRIVATE KEY":f=function(n,e){var t=n.algorithm.decrypt.kde.kdeparams.salt,r=parseInt(n.algorithm.decrypt.kde.kdeparams.iters.toString(),10),i=a[n.algorithm.decrypt.cipher.algo.join(".")],c=n.algorithm.decrypt.cipher.iv,u=n.subjectPrivateKey,d=parseInt(i.split("-")[1],10)/8,f=o.pbkdf2Sync(e,t,r,d,"sha1"),h=s.createDecipheriv(i,f,c),p=[];return p.push(h.update(u)),p.push(h.final()),l.concat(p)}(f=r.EncryptedPrivateKey.decode(f,"der"),e);case"PRIVATE KEY":switch(t=(c=r.PrivateKey.decode(f,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return r.RSAPrivateKey.decode(c.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:c.algorithm.curve,privateKey:r.ECPrivateKey.decode(c.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return c.algorithm.params.priv_key=r.DSAparam.decode(c.subjectPrivateKey,"der"),{type:"dsa",params:c.algorithm.params};default:throw new Error("unknown key id "+t)}throw new Error("unknown key type "+d);case"RSA PUBLIC KEY":return r.RSAPublicKey.decode(f,"der");case"RSA PRIVATE KEY":return r.RSAPrivateKey.decode(f,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:r.DSAPrivateKey.decode(f,"der")};case"EC PRIVATE KEY":return{curve:(f=r.ECPrivateKey.decode(f,"der")).parameters.value,privateKey:f.privateKey};default:throw new Error("unknown key type "+d)}}n.exports=c,c.signature=r.signature},function(n,e){n.exports=function(n){return n&&n.__esModule?n:{default:n}}},function(n,e,t){var r=t(53),a=t(82);n.exports=function(n){return r(a(n))}},function(n,e,t){var r=t(54);n.exports=Object("z").propertyIsEnumerable(0)?Object:function(n){return"String"==r(n)?n.split(""):Object(n)}},function(n,e){var t={}.toString;n.exports=function(n){return t.call(n).slice(8,-1)}},function(n,e,t){var r=t(89),a=Math.min;n.exports=function(n){return n>0?a(r(n),9007199254740991):0}},function(n,e,t){var r=t(90)("keys"),a=t(57);n.exports=function(n){return r[n]||(r[n]=a(n))}},function(n,e){var t=0,r=Math.random();n.exports=function(n){return"Symbol(".concat(void 0===n?"":n,")_",(++t+r).toString(36))}},function(n,e,t){var r=t(28).f,a=t(22),i=t(14)("toStringTag");n.exports=function(n,e,t){n&&!a(n=t?n:n.prototype,i)&&r(n,i,{configurable:!0,value:e})}},function(n,e,t){var r=t(82);n.exports=function(n){return Object(r(n))}},function(n,e,t){var r=t(40),a=t(53),i=t(59),s=t(55),o=t(182);n.exports=function(n,e){var t=1==n,l=2==n,c=3==n,u=4==n,d=6==n,f=5==n||d,h=e||o;return function(e,o,p){for(var m,b,g=i(e),y=a(g),v=r(o,p,3),_=s(y.length),w=0,k=t?h(e,_):l?h(e,0):void 0;_>w;w++)if((f||w in y)&&(b=v(m=y[w],w,g),n))if(t)k[w]=b;else if(b)switch(n){case 3:return!0;case 5:return m;case 6:return w;case 2:k.push(m)}else if(u)return!1;return d?-1:c||u?u:k}}},function(n,e,t){var r=t(57)("meta"),a=t(12),i=t(22),s=t(28).f,o=0,l=Object.isExtensible||function(){return!0},c=!t(30)(function(){return l(Object.preventExtensions({}))}),u=function(n){s(n,r,{value:{i:"O"+ ++o,w:{}}})},d=n.exports={KEY:r,NEED:!1,fastKey:function(n,e){if(!a(n))return"symbol"==typeof n?n:("string"==typeof n?"S":"P")+n;if(!i(n,r)){if(!l(n))return"F";if(!e)return"E";u(n)}return n[r].i},getWeak:function(n,e){if(!i(n,r)){if(!l(n))return!0;if(!e)return!1;u(n)}return n[r].w},onFreeze:function(n){return c&&d.NEED&&l(n)&&!i(n,r)&&u(n),n}}},function(n,e,t){var r=t(40),a=t(189),i=t(190),s=t(21),o=t(55),l=t(191),c={},u={};(e=n.exports=function(n,e,t,d,f){var h,p,m,b,g=f?function(){return n}:l(n),y=r(t,d,e?2:1),v=0;if("function"!=typeof g)throw TypeError(n+" is not iterable!");if(i(g)){for(h=o(n.length);h>v;v++)if((b=e?y(s(p=n[v])[0],p[1]):y(n[v]))===c||b===u)return b}else for(m=g.call(n);!(p=m.next()).done;)if((b=a(m,y,p.value,e))===c||b===u)return b}).BREAK=c,e.RETURN=u},function(n,e,t){var r=t(12);n.exports=function(n,e){if(!r(n)||n._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return n}},function(n,e,t){(function(n){var r=t(231),a=t(103),i=t(108),s=t(240),o=t(31),l=e;l.request=function(e,t){e="string"==typeof e?o.parse(e):i(e);var a=-1===n.location.protocol.search(/^https?:$/)?"http:":"",s=e.protocol||a,l=e.hostname||e.host,c=e.port,u=e.path||"/";l&&-1!==l.indexOf(":")&&(l="["+l+"]"),e.url=(l?s+"//"+l:"")+(c?":"+c:"")+u,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var d=new r(e);return t&&d.on("response",t),d},l.get=function(n,e){var t=l.request(n,e);return t.end(),t},l.ClientRequest=r,l.IncomingMessage=a.IncomingMessage,l.Agent=function(){},l.Agent.defaultMaxSockets=4,l.globalAgent=new l.Agent,l.STATUS_CODES=s,l.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,t(4))},function(n,e,t){"use strict";var r,a="object"==typeof Reflect?Reflect:null,i=a&&"function"==typeof a.apply?a.apply:function(n,e,t){return Function.prototype.apply.call(n,e,t)};r=a&&"function"==typeof a.ownKeys?a.ownKeys:Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:function(n){return Object.getOwnPropertyNames(n)};var s=Number.isNaN||function(n){return n!=n};function o(){o.init.call(this)}n.exports=o,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var l=10;function c(n){return void 0===n._maxListeners?o.defaultMaxListeners:n._maxListeners}function u(n,e,t,r){var a,i,s,o;if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);if(void 0===(i=n._events)?(i=n._events=Object.create(null),n._eventsCount=0):(void 0!==i.newListener&&(n.emit("newListener",e,t.listener?t.listener:t),i=n._events),s=i[e]),void 0===s)s=i[e]=t,++n._eventsCount;else if("function"==typeof s?s=i[e]=r?[t,s]:[s,t]:r?s.unshift(t):s.push(t),(a=c(n))>0&&s.length>a&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=n,l.type=e,l.count=s.length,o=l,console&&console.warn&&console.warn(o)}return n}function d(n,e,t){var r={fired:!1,wrapFn:void 0,target:n,type:e,listener:t},a=function(){for(var n=[],e=0;e0&&(s=e[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var l=a[n];if(void 0===l)return!1;if("function"==typeof l)i(l,this,e);else{var c=l.length,u=p(l,c);for(t=0;t=0;i--)if(t[i]===e||t[i].listener===e){s=t[i].listener,a=i;break}if(a<0)return this;0===a?t.shift():function(n,e){for(;e+1=0;r--)this.removeListener(n,e[r]);return this},o.prototype.listeners=function(n){return f(this,n,!0)},o.prototype.rawListeners=function(n){return f(this,n,!1)},o.listenerCount=function(n,e){return"function"==typeof n.listenerCount?n.listenerCount(e):h.call(n,e)},o.prototype.listenerCount=h,o.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(n,e,t){"use strict";(function(e,r,a){var i=t(41);function s(n){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(n,e,t){var r=n.entry;n.entry=null;for(;r;){var a=r.callback;e.pendingcb--,a(t),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=n:e.corkedRequestsFree=n}(e,n)}}n.exports=y;var o,l=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?r:i.nextTick;y.WritableState=g;var c=t(33);c.inherits=t(0);var u={deprecate:t(237)},d=t(105),f=t(1).Buffer,h=a.Uint8Array||function(){};var p,m=t(106);function b(){}function g(n,e){o=o||t(19),n=n||{};var r=e instanceof o;this.objectMode=!!n.objectMode,r&&(this.objectMode=this.objectMode||!!n.writableObjectMode);var a=n.highWaterMark,c=n.writableHighWaterMark,u=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:r&&(c||0===c)?c:u,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 d=!1===n.decodeStrings;this.decodeStrings=!d,this.defaultEncoding=n.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){!function(n,e){var t=n._writableState,r=t.sync,a=t.writecb;if(function(n){n.writing=!1,n.writecb=null,n.length-=n.writelen,n.writelen=0}(t),e)!function(n,e,t,r,a){--e.pendingcb,t?(i.nextTick(a,r),i.nextTick(S,n,e),n._writableState.errorEmitted=!0,n.emit("error",r)):(a(r),n._writableState.errorEmitted=!0,n.emit("error",r),S(n,e))}(n,t,r,e,a);else{var s=k(t);s||t.corked||t.bufferProcessing||!t.bufferedRequest||w(n,t),r?l(_,n,t,s,a):_(n,t,s,a)}}(e,n)},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 s(this)}function y(n){if(o=o||t(19),!(p.call(y,this)||this instanceof o))return new y(n);this._writableState=new g(n,this),this.writable=!0,n&&("function"==typeof n.write&&(this._write=n.write),"function"==typeof n.writev&&(this._writev=n.writev),"function"==typeof n.destroy&&(this._destroy=n.destroy),"function"==typeof n.final&&(this._final=n.final)),d.call(this)}function v(n,e,t,r,a,i,s){e.writelen=r,e.writecb=s,e.writing=!0,e.sync=!0,t?n._writev(a,e.onwrite):n._write(a,i,e.onwrite),e.sync=!1}function _(n,e,t,r){t||function(n,e){0===e.length&&e.needDrain&&(e.needDrain=!1,n.emit("drain"))}(n,e),e.pendingcb--,r(),S(n,e)}function w(n,e){e.bufferProcessing=!0;var t=e.bufferedRequest;if(n._writev&&t&&t.next){var r=e.bufferedRequestCount,a=new Array(r),i=e.corkedRequestsFree;i.entry=t;for(var o=0,l=!0;t;)a[o]=t,t.isBuf||(l=!1),t=t.next,o+=1;a.allBuffers=l,v(n,e,!0,e.length,a,"",i.finish),e.pendingcb++,e.lastBufferedRequest=null,i.next?(e.corkedRequestsFree=i.next,i.next=null):e.corkedRequestsFree=new s(e),e.bufferedRequestCount=0}else{for(;t;){var c=t.chunk,u=t.encoding,d=t.callback;if(v(n,e,!1,e.objectMode?1:c.length,c,u,d),t=t.next,e.bufferedRequestCount--,e.writing)break}null===t&&(e.lastBufferedRequest=null)}e.bufferedRequest=t,e.bufferProcessing=!1}function k(n){return n.ending&&0===n.length&&null===n.bufferedRequest&&!n.finished&&!n.writing}function x(n,e){n._final(function(t){e.pendingcb--,t&&n.emit("error",t),e.prefinished=!0,n.emit("prefinish"),S(n,e)})}function S(n,e){var t=k(e);return t&&(!function(n,e){e.prefinished||e.finalCalled||("function"==typeof n._final?(e.pendingcb++,e.finalCalled=!0,i.nextTick(x,n,e)):(e.prefinished=!0,n.emit("prefinish")))}(n,e),0===e.pendingcb&&(e.finished=!0,n.emit("finish"))),t}c.inherits(y,d),g.prototype.getBuffer=function(){for(var n=this.bufferedRequest,e=[];n;)e.push(n),n=n.next;return e},function(){try{Object.defineProperty(g.prototype,"buffer",{get:u.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(n){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(n){return!!p.call(this,n)||this===y&&(n&&n._writableState instanceof g)}})):p=function(n){return n instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(n,e,t){var r,a=this._writableState,s=!1,o=!a.objectMode&&(r=n,f.isBuffer(r)||r instanceof h);return o&&!f.isBuffer(n)&&(n=function(n){return f.from(n)}(n)),"function"==typeof e&&(t=e,e=null),o?e="buffer":e||(e=a.defaultEncoding),"function"!=typeof t&&(t=b),a.ended?function(n,e){var t=new Error("write after end");n.emit("error",t),i.nextTick(e,t)}(this,t):(o||function(n,e,t,r){var a=!0,s=!1;return null===t?s=new TypeError("May not write null values to stream"):"string"==typeof t||void 0===t||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(n.emit("error",s),i.nextTick(r,s),a=!1),a}(this,a,n,t))&&(a.pendingcb++,s=function(n,e,t,r,a,i){if(!t){var s=function(n,e,t){n.objectMode||!1===n.decodeStrings||"string"!=typeof e||(e=f.from(e,t));return e}(e,r,a);r!==s&&(t=!0,a="buffer",r=s)}var o=e.objectMode?1:r.length;e.length+=o;var l=e.length-1))throw new TypeError("Unknown encoding: "+n);return this._writableState.defaultEncoding=n,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(n,e,t){t(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(n,e,t){var r=this._writableState;"function"==typeof n?(t=n,n=null,e=null):"function"==typeof e&&(t=e,e=null),null!=n&&this.write(n,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(n,e,t){e.ending=!0,S(n,e),t&&(e.finished?i.nextTick(t):n.once("finish",t));e.ended=!0,n.writable=!1}(this,r,t)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(n){this._writableState&&(this._writableState.destroyed=n)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(n,e){this.end(),e(n)}}).call(this,t(8),t(235).setImmediate,t(4))},function(n,e,t){"use strict";var r=t(1).Buffer,a=r.isEncoding||function(n){switch((n=""+n)&&n.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 i(n){var e;switch(this.encoding=function(n){var e=function(n){if(!n)return"utf8";for(var e;;)switch(n){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 n;default:if(e)return;n=(""+n).toLowerCase(),e=!0}}(n);if("string"!=typeof e&&(r.isEncoding===a||!a(n)))throw new Error("Unknown encoding: "+n);return e||n}(n),this.encoding){case"utf16le":this.text=l,this.end=c,e=4;break;case"utf8":this.fillLast=o,e=4;break;case"base64":this.text=u,this.end=d,e=3;break;default:return this.write=f,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function s(n){return n<=127?0:n>>5==6?2:n>>4==14?3:n>>3==30?4:n>>6==2?-1:-2}function o(n){var e=this.lastTotal-this.lastNeed,t=function(n,e,t){if(128!=(192&e[0]))return n.lastNeed=0,"�";if(n.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return n.lastNeed=1,"�";if(n.lastNeed>2&&e.length>2&&128!=(192&e[2]))return n.lastNeed=2,"�"}}(this,n);return void 0!==t?t:this.lastNeed<=n.length?(n.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(n.copy(this.lastChar,e,0,n.length),void(this.lastNeed-=n.length))}function l(n,e){if((n.length-e)%2==0){var t=n.toString("utf16le",e);if(t){var r=t.charCodeAt(t.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=n[n.length-1],n.toString("utf16le",e,n.length-1)}function c(n){var e=n&&n.length?this.write(n):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,t)}return e}function u(n,e){var t=(n.length-e)%3;return 0===t?n.toString("base64",e):(this.lastNeed=3-t,this.lastTotal=3,1===t?this.lastChar[0]=n[n.length-1]:(this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1]),n.toString("base64",e,n.length-t))}function d(n){var e=n&&n.length?this.write(n):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f(n){return n.toString(this.encoding)}function h(n){return n&&n.length?this.write(n):""}e.StringDecoder=i,i.prototype.write=function(n){if(0===n.length)return"";var e,t;if(this.lastNeed){if(void 0===(e=this.fillLast(n)))return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t=0)return a>0&&(n.lastNeed=a-1),a;if(--r=0)return a>0&&(n.lastNeed=a-2),a;if(--r=0)return a>0&&(2===a?a=0:n.lastNeed=a-3),a;return 0}(this,n,e);if(!this.lastNeed)return n.toString("utf8",e);this.lastTotal=t;var r=n.length-(t-this.lastNeed);return n.copy(this.lastChar,0,r),n.toString("utf8",e,r)},i.prototype.fillLast=function(n){if(this.lastNeed<=n.length)return n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,n.length),this.lastNeed-=n.length}},function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function n(){this.listeners={}}return n.prototype.addEventListener=function(n,e){n=n.toLowerCase(),this.listeners[n]=this.listeners[n]||[],this.listeners[n].push(e.handleEvent||e)},n.prototype.removeEventListener=function(n,e){if(n=n.toLowerCase(),this.listeners[n]){var t=this.listeners[n].indexOf(e.handleEvent||e);t<0||this.listeners[n].splice(t,1)}},n.prototype.dispatchEvent=function(n){var e=n.type.toLowerCase();if(n.target=this,this.listeners[e])for(var t=0,r=this.listeners[e];t>6|192);else{if(a>55295&&a<56320){if(++r==n.length)return null;var i=n.charCodeAt(r);if(i<56320||i>57343)return null;t+=e((a=65536+((1023&a)<<10)+(1023&i))>>18|240),t+=e(a>>12&63|128)}else t+=e(a>>12|224);t+=e(a>>6&63|128)}t+=e(63&a|128)}}return t},toString:function(n){for(var e="",t=0,i=a(n);t127){if(s>191&&s<224){if(t>=i)return null;s=(31&s)<<6|63&r(n,t)}else if(s>223&&s<240){if(t+1>=i)return null;s=(15&s)<<12|(63&r(n,t))<<6|63&r(n,++t)}else{if(!(s>239&&s<248))return null;if(t+2>=i)return null;s=(7&s)<<18|(63&r(n,t))<<12|(63&r(n,++t))<<6|63&r(n,++t)}++t}if(s<=65535)e+=String.fromCharCode(s);else{if(!(s<=1114111))return null;s-=65536,e+=String.fromCharCode(s>>10|55296),e+=String.fromCharCode(1023&s|56320)}}return e},fromNumber:function(n){var e=n.toString(16);return e.length%2==0?"0x"+e:"0x0"+e},toNumber:function(n){return parseInt(n.slice(2),16)},fromNat:function(n){return"0x0"===n?"0x":n.length%2==0?n:"0x0"+n.slice(2)},toNat:function(n){return"0"===n[2]?"0x"+n.slice(3):n},fromArray:s,toArray:i,fromUint8Array:function(n){return s([].slice.call(n,0))},toUint8Array:function(n){return new Uint8Array(i(n))}}},function(n,e,t){"use strict";var r=t(0),a=t(118),i=t(1).Buffer,s=new Array(16);function o(){a.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function l(n,e){return n<>>32-e}function c(n,e,t,r,a,i,s){return l(n+(e&t|~e&r)+a+i|0,s)+e|0}function u(n,e,t,r,a,i,s){return l(n+(e&r|t&~r)+a+i|0,s)+e|0}function d(n,e,t,r,a,i,s){return l(n+(e^t^r)+a+i|0,s)+e|0}function f(n,e,t,r,a,i,s){return l(n+(t^(e|~r))+a+i|0,s)+e|0}r(o,a),o.prototype._update=function(){for(var n=s,e=0;e<16;++e)n[e]=this._block.readInt32LE(4*e);var t=this._a,r=this._b,a=this._c,i=this._d;t=c(t,r,a,i,n[0],3614090360,7),i=c(i,t,r,a,n[1],3905402710,12),a=c(a,i,t,r,n[2],606105819,17),r=c(r,a,i,t,n[3],3250441966,22),t=c(t,r,a,i,n[4],4118548399,7),i=c(i,t,r,a,n[5],1200080426,12),a=c(a,i,t,r,n[6],2821735955,17),r=c(r,a,i,t,n[7],4249261313,22),t=c(t,r,a,i,n[8],1770035416,7),i=c(i,t,r,a,n[9],2336552879,12),a=c(a,i,t,r,n[10],4294925233,17),r=c(r,a,i,t,n[11],2304563134,22),t=c(t,r,a,i,n[12],1804603682,7),i=c(i,t,r,a,n[13],4254626195,12),a=c(a,i,t,r,n[14],2792965006,17),t=u(t,r=c(r,a,i,t,n[15],1236535329,22),a,i,n[1],4129170786,5),i=u(i,t,r,a,n[6],3225465664,9),a=u(a,i,t,r,n[11],643717713,14),r=u(r,a,i,t,n[0],3921069994,20),t=u(t,r,a,i,n[5],3593408605,5),i=u(i,t,r,a,n[10],38016083,9),a=u(a,i,t,r,n[15],3634488961,14),r=u(r,a,i,t,n[4],3889429448,20),t=u(t,r,a,i,n[9],568446438,5),i=u(i,t,r,a,n[14],3275163606,9),a=u(a,i,t,r,n[3],4107603335,14),r=u(r,a,i,t,n[8],1163531501,20),t=u(t,r,a,i,n[13],2850285829,5),i=u(i,t,r,a,n[2],4243563512,9),a=u(a,i,t,r,n[7],1735328473,14),t=d(t,r=u(r,a,i,t,n[12],2368359562,20),a,i,n[5],4294588738,4),i=d(i,t,r,a,n[8],2272392833,11),a=d(a,i,t,r,n[11],1839030562,16),r=d(r,a,i,t,n[14],4259657740,23),t=d(t,r,a,i,n[1],2763975236,4),i=d(i,t,r,a,n[4],1272893353,11),a=d(a,i,t,r,n[7],4139469664,16),r=d(r,a,i,t,n[10],3200236656,23),t=d(t,r,a,i,n[13],681279174,4),i=d(i,t,r,a,n[0],3936430074,11),a=d(a,i,t,r,n[3],3572445317,16),r=d(r,a,i,t,n[6],76029189,23),t=d(t,r,a,i,n[9],3654602809,4),i=d(i,t,r,a,n[12],3873151461,11),a=d(a,i,t,r,n[15],530742520,16),t=f(t,r=d(r,a,i,t,n[2],3299628645,23),a,i,n[0],4096336452,6),i=f(i,t,r,a,n[7],1126891415,10),a=f(a,i,t,r,n[14],2878612391,15),r=f(r,a,i,t,n[5],4237533241,21),t=f(t,r,a,i,n[12],1700485571,6),i=f(i,t,r,a,n[3],2399980690,10),a=f(a,i,t,r,n[10],4293915773,15),r=f(r,a,i,t,n[1],2240044497,21),t=f(t,r,a,i,n[8],1873313359,6),i=f(i,t,r,a,n[15],4264355552,10),a=f(a,i,t,r,n[6],2734768916,15),r=f(r,a,i,t,n[13],1309151649,21),t=f(t,r,a,i,n[4],4149444226,6),i=f(i,t,r,a,n[11],3174756917,10),a=f(a,i,t,r,n[2],718787259,15),r=f(r,a,i,t,n[9],3951481745,21),this._a=this._a+t|0,this._b=this._b+r|0,this._c=this._c+a|0,this._d=this._d+i|0},o.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 n=i.allocUnsafe(16);return n.writeInt32LE(this._a,0),n.writeInt32LE(this._b,4),n.writeInt32LE(this._c,8),n.writeInt32LE(this._d,12),n},n.exports=o},function(n,e,t){n.exports=a;var r=t(65).EventEmitter;function a(){r.call(this)}t(0)(a,r),a.Readable=t(32),a.Writable=t(273),a.Duplex=t(274),a.Transform=t(275),a.PassThrough=t(276),a.Stream=a,a.prototype.pipe=function(n,e){var t=this;function a(e){n.writable&&!1===n.write(e)&&t.pause&&t.pause()}function i(){t.readable&&t.resume&&t.resume()}t.on("data",a),n.on("drain",i),n._isStdio||e&&!1===e.end||(t.on("end",o),t.on("close",l));var s=!1;function o(){s||(s=!0,n.end())}function l(){s||(s=!0,"function"==typeof n.destroy&&n.destroy())}function c(n){if(u(),0===r.listenerCount(this,"error"))throw n}function u(){t.removeListener("data",a),n.removeListener("drain",i),t.removeListener("end",o),t.removeListener("close",l),t.removeListener("error",c),n.removeListener("error",c),t.removeListener("end",u),t.removeListener("close",u),n.removeListener("close",u)}return t.on("error",c),n.on("error",c),t.on("end",u),t.on("close",u),n.on("close",u),n.emit("pipe",t),n}},function(n,e,t){"use strict";var r=t(2).Buffer,a=t(0),i=t(118),s=new Array(16),o=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],l=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],c=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],u=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],d=[0,1518500249,1859775393,2400959708,2840853838],f=[1352829926,1548603684,1836072691,2053994217,0];function h(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(n,e){return n<>>32-e}function m(n,e,t,r,a,i,s,o){return p(n+(e^t^r)+i+s|0,o)+a|0}function b(n,e,t,r,a,i,s,o){return p(n+(e&t|~e&r)+i+s|0,o)+a|0}function g(n,e,t,r,a,i,s,o){return p(n+((e|~t)^r)+i+s|0,o)+a|0}function y(n,e,t,r,a,i,s,o){return p(n+(e&r|t&~r)+i+s|0,o)+a|0}function v(n,e,t,r,a,i,s,o){return p(n+(e^(t|~r))+i+s|0,o)+a|0}a(h,i),h.prototype._update=function(){for(var n=s,e=0;e<16;++e)n[e]=this._block.readInt32LE(4*e);for(var t=0|this._a,r=0|this._b,a=0|this._c,i=0|this._d,h=0|this._e,_=0|this._a,w=0|this._b,k=0|this._c,x=0|this._d,S=0|this._e,A=0;A<80;A+=1){var E,T;A<16?(E=m(t,r,a,i,h,n[o[A]],d[0],c[A]),T=v(_,w,k,x,S,n[l[A]],f[0],u[A])):A<32?(E=b(t,r,a,i,h,n[o[A]],d[1],c[A]),T=y(_,w,k,x,S,n[l[A]],f[1],u[A])):A<48?(E=g(t,r,a,i,h,n[o[A]],d[2],c[A]),T=g(_,w,k,x,S,n[l[A]],f[2],u[A])):A<64?(E=y(t,r,a,i,h,n[o[A]],d[3],c[A]),T=b(_,w,k,x,S,n[l[A]],f[3],u[A])):(E=v(t,r,a,i,h,n[o[A]],d[4],c[A]),T=m(_,w,k,x,S,n[l[A]],f[4],u[A])),t=h,h=i,i=p(a,10),a=r,r=E,_=S,S=x,x=p(k,10),k=w,w=T}var C=this._b+a+x|0;this._b=this._c+i+S|0,this._c=this._d+h+_|0,this._d=this._e+t+w|0,this._e=this._a+r+k|0,this._a=C},h.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var n=r.alloc?r.alloc(20):new r(20);return n.writeInt32LE(this._a,0),n.writeInt32LE(this._b,4),n.writeInt32LE(this._c,8),n.writeInt32LE(this._d,12),n.writeInt32LE(this._e,16),n},n.exports=h},function(n,e,t){(e=n.exports=function(n){n=n.toLowerCase();var t=e[n];if(!t)throw new Error(n+" is not supported (we accept pull requests)");return new t}).sha=t(277),e.sha1=t(278),e.sha224=t(279),e.sha256=t(119),e.sha384=t(280),e.sha512=t(120)},function(n,e,t){e.pbkdf2=t(283),e.pbkdf2Sync=t(126)},function(n,e,t){"use strict";e.utils=t(286),e.Cipher=t(287),e.DES=t(288),e.CBC=t(289),e.EDE=t(290)},function(n,e,t){var r=t(291),a=t(299),i=t(129);e.createCipher=e.Cipher=r.createCipher,e.createCipheriv=e.Cipheriv=r.createCipheriv,e.createDecipher=e.Decipher=a.createDecipher,e.createDecipheriv=e.Decipheriv=a.createDecipheriv,e.listCiphers=e.getCiphers=function(){return Object.keys(i)}},function(n,e,t){var r={ECB:t(292),CBC:t(293),CFB:t(294),CFB8:t(295),CFB1:t(296),OFB:t(297),CTR:t(127),GCM:t(127)},a=t(129);for(var i in a)a[i].module=r[a[i].mode];n.exports=a},function(n,e,t){(function(e){var r=t(3),a=t(24);function i(n,t){var a=function(n){var e=s(n);return{blinder:e.toRed(r.mont(n.modulus)).redPow(new r(n.publicExponent)).fromRed(),unblinder:e.invm(n.modulus)}}(t),i=t.modulus.byteLength(),o=(r.mont(t.modulus),new r(n).mul(a.blinder).umod(t.modulus)),l=o.toRed(r.mont(t.prime1)),c=o.toRed(r.mont(t.prime2)),u=t.coefficient,d=t.prime1,f=t.prime2,h=l.redPow(t.exponent1),p=c.redPow(t.exponent2);h=h.fromRed(),p=p.fromRed();var m=h.isub(p).imul(u).umod(d);return m.imul(f),p.iadd(m),new e(p.imul(a.unblinder).umod(t.modulus).toArray(!1,i))}function s(n){for(var e=n.modulus.byteLength(),t=new r(a(e));t.cmp(n.modulus)>=0||!t.umod(n.prime1)||!t.umod(n.prime2);)t=new r(a(e));return t}n.exports=i,i.getr=s}).call(this,t(2).Buffer)},function(n,e,t){var r=e;r.utils=t(11),r.common=t(36),r.sha=t(314),r.ripemd=t(318),r.hmac=t(319),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},function(n,e,t){"use strict";var r=t(369);n.exports=Function.prototype.bind||r},function(n,e,t){"use strict";var r=Function.prototype.toString,a=/^\s*class\b/,i=function(n){try{var e=r.call(n);return a.test(e)}catch(n){return!1}},s=Object.prototype.toString,o="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;n.exports=function(n){if(!n)return!1;if("function"!=typeof n&&"object"!=typeof n)return!1;if("function"==typeof n&&!n.prototype)return!0;if(o)return function(n){try{return!i(n)&&(r.call(n),!0)}catch(n){return!1}}(n);if(i(n))return!1;var e=s.call(n);return"[object Function]"===e||"[object GeneratorFunction]"===e}},function(n,e){n.exports=function(n){if(null==n)throw TypeError("Can't call method on "+n);return n}},function(n,e){n.exports=!0},function(n,e){n.exports=function(n){if("function"!=typeof n)throw TypeError(n+" is not a function!");return n}},function(n,e,t){var r=t(12),a=t(13).document,i=r(a)&&r(a.createElement);n.exports=function(n){return i?a.createElement(n):{}}},function(n,e){n.exports=function(n,e){return{enumerable:!(1&n),configurable:!(2&n),writable:!(4&n),value:e}}},function(n,e,t){n.exports=t(16)},function(n,e,t){var r=t(176),a=t(91);n.exports=Object.keys||function(n){return r(n,a)}},function(n,e){var t=Math.ceil,r=Math.floor;n.exports=function(n){return isNaN(n=+n)?0:(n>0?r:t)(n)}},function(n,e,t){var r=t(27),a=t(13),i=a["__core-js_shared__"]||(a["__core-js_shared__"]={});(n.exports=function(n,e){return i[n]||(i[n]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:t(83)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(n,e){n.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(n,e,t){var r=t(16);n.exports=function(n,e,t){for(var a in e)t&&n[a]?n[a]=e[a]:r(n,a,e[a]);return n}},function(n,e){n.exports=function(n,e,t,r){if(!(n instanceof e)||void 0!==r&&r in n)throw TypeError(t+": incorrect invocation!");return n}},function(n,e){var t={}.toString;n.exports=Array.isArray||function(n){return"[object Array]"==t.call(n)}},function(n,e,t){var r=t(209),a=t(210);n.exports=function(n){if("string"==typeof n||"number"==typeof n){var e=new r(1),t=String(n).toLowerCase().trim(),i="0x"===t.substr(0,2)||"-0x"===t.substr(0,3),s=a(t);if("-"===s.substr(0,1)&&(s=a(s.slice(1)),e=new r(-1,10)),!(s=""===s?"0":s).match(/^-?[0-9]+$/)&&s.match(/^[0-9A-Fa-f]+$/)||s.match(/^[a-fA-F]+$/)||!0===i&&s.match(/^[0-9A-Fa-f]+$/))return new r(s,16).mul(e);if((s.match(/^-?[0-9]+$/)||""===s)&&!1===i)return new r(s,10).mul(e)}else if("object"==typeof n&&n.toString&&!n.pop&&!n.push&&n.toString(10).match(/^-?[0-9]+$/)&&(n.mul||n.dividedToIntegerBy))return new r(n.toString(10),10);throw new Error("[number-to-bn] while converting number "+JSON.stringify(n)+" 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(n,e,t){var r=t(5),a=t(97),i=t(95),s=t(212),o=t(98),l=function(n){return n instanceof a||n&&n.constructor&&"BN"===n.constructor.name},c=function(n){return n&&n.constructor&&"BigNumber"===n.constructor.name},u=function(n){try{return i.apply(null,arguments)}catch(e){throw new Error(e+' Given value: "'+n+'"')}},d=function(n){return!!/^(0x)?[0-9a-f]{40}$/i.test(n)&&(!(!/^(0x|0X)?[0-9a-f]{40}$/.test(n)&&!/^(0x|0X)?[0-9A-F]{40}$/.test(n))||f(n))},f=function(n){n=n.replace(/^0x/i,"");for(var e=g(n.toLowerCase()).replace(/^0x/i,""),t=0;t<40;t++)if(parseInt(e[t],16)>7&&n[t].toUpperCase()!==n[t]||parseInt(e[t],16)<=7&&n[t].toLowerCase()!==n[t])return!1;return!0},h=function(n){var e="";n=(n=(n=(n=(n=s.encode(n)).replace(/^(?:\u0000)*/,"")).split("").reverse().join("")).replace(/^(?:\u0000)*/,"")).split("").reverse().join("");for(var t=0;t>>4).toString(16)),e.push((15&n[t]).toString(16));return"0x"+e.join("")},isHex:function(n){return(r.isString(n)||r.isNumber(n))&&/^(-0x|0x)?[0-9a-f]*$/i.test(n)},isHexStrict:b,leftPad:function(n,e,t){var r=/^0x/i.test(n)||"number"==typeof n,a=e-(n=n.toString(16).replace(/^0x/i,"")).length+1>=0?e-n.length+1:0;return(r?"0x":"")+new Array(a).join(t||"0")+n},rightPad:function(n,e,t){var r=/^0x/i.test(n)||"number"==typeof n,a=e-(n=n.toString(16).replace(/^0x/i,"")).length+1>=0?e-n.length+1:0;return(r?"0x":"")+n+new Array(a).join(t||"0")},toTwosComplement:function(n){return"0x"+u(n).toTwos(256).toString(16,64)},sha3:g}},function(n,e,t){(function(n){!function(n,e){"use strict";function r(n,e){if(!n)throw new Error(e||"Assertion failed")}function a(n,e){n.super_=e;var t=function(){};t.prototype=e.prototype,n.prototype=new t,n.prototype.constructor=n}function i(n,e,t){if(i.isBN(n))return n;this.negative=0,this.words=null,this.length=0,this.red=null,null!==n&&("le"!==e&&"be"!==e||(t=e,e=10),this._init(n||0,e||10,t||"be"))}var s;"object"==typeof n?n.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{s=t(2).Buffer}catch(n){}function o(n,e,t){for(var r=0,a=Math.min(n.length,t),i=e;i=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return r}function l(n,e,t,r){for(var a=0,i=Math.min(n.length,t),s=e;s=49?o-49+10:o>=17?o-17+10:o}return a}i.isBN=function(n){return n instanceof i||null!==n&&"object"==typeof n&&n.constructor.wordSize===i.wordSize&&Array.isArray(n.words)},i.max=function(n,e){return n.cmp(e)>0?n:e},i.min=function(n,e){return n.cmp(e)<0?n:e},i.prototype._init=function(n,e,t){if("number"==typeof n)return this._initNumber(n,e,t);if("object"==typeof n)return this._initArray(n,e,t);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var a=0;"-"===(n=n.toString().replace(/\s+/g,""))[0]&&a++,16===e?this._parseHex(n,a):this._parseBase(n,e,a),"-"===n[0]&&(this.negative=1),this.strip(),"le"===t&&this._initArray(this.toArray(),e,t)},i.prototype._initNumber=function(n,e,t){n<0&&(this.negative=1,n=-n),n<67108864?(this.words=[67108863&n],this.length=1):n<4503599627370496?(this.words=[67108863&n,n/67108864&67108863],this.length=2):(r(n<9007199254740992),this.words=[67108863&n,n/67108864&67108863,1],this.length=3),"le"===t&&this._initArray(this.toArray(),e,t)},i.prototype._initArray=function(n,e,t){if(r("number"==typeof n.length),n.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(n.length/3),this.words=new Array(this.length);for(var a=0;a=0;a-=3)s=n[a]|n[a-1]<<8|n[a-2]<<16,this.words[i]|=s<>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);else if("le"===t)for(a=0,i=0;a>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);return this.strip()},i.prototype._parseHex=function(n,e){this.length=Math.ceil((n.length-e)/6),this.words=new Array(this.length);for(var t=0;t=e;t-=6)a=o(n,t,t+6),this.words[r]|=a<>>26-i&4194303,(i+=24)>=26&&(i-=26,r++);t+6!==e&&(a=o(n,e,t+6),this.words[r]|=a<>>26-i&4194303),this.strip()},i.prototype._parseBase=function(n,e,t){this.words=[0],this.length=1;for(var r=0,a=1;a<=67108863;a*=e)r++;r--,a=a/e|0;for(var i=n.length-t,s=i%r,o=Math.min(i,i-s)+t,c=0,u=t;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var c=["","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"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(n,e,t){t.negative=e.negative^n.negative;var r=n.length+e.length|0;t.length=r,r=r-1|0;var a=0|n.words[0],i=0|e.words[0],s=a*i,o=67108863&s,l=s/67108864|0;t.words[0]=o;for(var c=1;c>>26,d=67108863&l,f=Math.min(c,e.length-1),h=Math.max(0,c-n.length+1);h<=f;h++){var p=c-h|0;u+=(s=(a=0|n.words[p])*(i=0|e.words[h])+d)/67108864|0,d=67108863&s}t.words[c]=0|d,l=0|u}return 0!==l?t.words[c]=0|l:t.length--,t.strip()}i.prototype.toString=function(n,e){var t;if(e=0|e||1,16===(n=n||10)||"hex"===n){t="";for(var a=0,i=0,s=0;s>>24-a&16777215)||s!==this.length-1?c[6-l.length]+l+t:l+t,(a+=2)>=26&&(a-=26,s--)}for(0!==i&&(t=i.toString(16)+t);t.length%e!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(n===(0|n)&&n>=2&&n<=36){var f=u[n],h=d[n];t="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(h).toString(n);t=(p=p.idivn(h)).isZero()?m+t:c[f-m.length]+m+t}for(this.isZero()&&(t="0"+t);t.length%e!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var n=this.words[0];return 2===this.length?n+=67108864*this.words[1]:3===this.length&&1===this.words[2]?n+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-n:n},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(n,e){return r(void 0!==s),this.toArrayLike(s,n,e)},i.prototype.toArray=function(n,e){return this.toArrayLike(Array,n,e)},i.prototype.toArrayLike=function(n,e,t){var a=this.byteLength(),i=t||Math.max(1,a);r(a<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var s,o,l="le"===e,c=new n(i),u=this.clone();if(l){for(o=0;!u.isZero();o++)s=u.andln(255),u.iushrn(8),c[o]=s;for(;o=4096&&(t+=13,e>>>=13),e>=64&&(t+=7,e>>>=7),e>=8&&(t+=4,e>>>=4),e>=2&&(t+=2,e>>>=2),t+e},i.prototype._zeroBits=function(n){if(0===n)return 26;var e=n,t=0;return 0==(8191&e)&&(t+=13,e>>>=13),0==(127&e)&&(t+=7,e>>>=7),0==(15&e)&&(t+=4,e>>>=4),0==(3&e)&&(t+=2,e>>>=2),0==(1&e)&&t++,t},i.prototype.bitLength=function(){var n=this.words[this.length-1],e=this._countBits(n);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var n=0,e=0;en.length?this.clone().ior(n):n.clone().ior(this)},i.prototype.uor=function(n){return this.length>n.length?this.clone().iuor(n):n.clone().iuor(this)},i.prototype.iuand=function(n){var e;e=this.length>n.length?n:this;for(var t=0;tn.length?this.clone().iand(n):n.clone().iand(this)},i.prototype.uand=function(n){return this.length>n.length?this.clone().iuand(n):n.clone().iuand(this)},i.prototype.iuxor=function(n){var e,t;this.length>n.length?(e=this,t=n):(e=n,t=this);for(var r=0;rn.length?this.clone().ixor(n):n.clone().ixor(this)},i.prototype.uxor=function(n){return this.length>n.length?this.clone().iuxor(n):n.clone().iuxor(this)},i.prototype.inotn=function(n){r("number"==typeof n&&n>=0);var e=0|Math.ceil(n/26),t=n%26;this._expand(e),t>0&&e--;for(var a=0;a0&&(this.words[a]=~this.words[a]&67108863>>26-t),this.strip()},i.prototype.notn=function(n){return this.clone().inotn(n)},i.prototype.setn=function(n,e){r("number"==typeof n&&n>=0);var t=n/26|0,a=n%26;return this._expand(t+1),this.words[t]=e?this.words[t]|1<n.length?(t=this,r=n):(t=n,r=this);for(var a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=t.length,0!==a)this.words[this.length]=a,this.length++;else if(t!==this)for(;in.length?this.clone().iadd(n):n.clone().iadd(this)},i.prototype.isub=function(n){if(0!==n.negative){n.negative=0;var e=this.iadd(n);return n.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(n),this.negative=1,this._normSign();var t,r,a=this.cmp(n);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(t=this,r=n):(t=n,r=this);for(var i=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==i&&s>26,this.words[s]=67108863&e;if(0===i&&s>>13,h=0|s[1],p=8191&h,m=h>>>13,b=0|s[2],g=8191&b,y=b>>>13,v=0|s[3],_=8191&v,w=v>>>13,k=0|s[4],x=8191&k,S=k>>>13,A=0|s[5],E=8191&A,T=A>>>13,C=0|s[6],I=8191&C,j=C>>>13,R=0|s[7],B=8191&R,M=R>>>13,N=0|s[8],P=8191&N,O=N>>>13,L=0|s[9],D=8191&L,q=L>>>13,F=0|o[0],U=8191&F,z=F>>>13,K=0|o[1],H=8191&K,G=K>>>13,V=0|o[2],W=8191&V,Y=V>>>13,X=0|o[3],J=8191&X,Z=X>>>13,$=0|o[4],Q=8191&$,nn=$>>>13,en=0|o[5],tn=8191&en,rn=en>>>13,an=0|o[6],sn=8191&an,on=an>>>13,ln=0|o[7],cn=8191&ln,un=ln>>>13,dn=0|o[8],fn=8191&dn,hn=dn>>>13,pn=0|o[9],mn=8191&pn,bn=pn>>>13;t.negative=n.negative^e.negative,t.length=19;var gn=(c+(r=Math.imul(d,U))|0)+((8191&(a=(a=Math.imul(d,z))+Math.imul(f,U)|0))<<13)|0;c=((i=Math.imul(f,z))+(a>>>13)|0)+(gn>>>26)|0,gn&=67108863,r=Math.imul(p,U),a=(a=Math.imul(p,z))+Math.imul(m,U)|0,i=Math.imul(m,z);var yn=(c+(r=r+Math.imul(d,H)|0)|0)+((8191&(a=(a=a+Math.imul(d,G)|0)+Math.imul(f,H)|0))<<13)|0;c=((i=i+Math.imul(f,G)|0)+(a>>>13)|0)+(yn>>>26)|0,yn&=67108863,r=Math.imul(g,U),a=(a=Math.imul(g,z))+Math.imul(y,U)|0,i=Math.imul(y,z),r=r+Math.imul(p,H)|0,a=(a=a+Math.imul(p,G)|0)+Math.imul(m,H)|0,i=i+Math.imul(m,G)|0;var vn=(c+(r=r+Math.imul(d,W)|0)|0)+((8191&(a=(a=a+Math.imul(d,Y)|0)+Math.imul(f,W)|0))<<13)|0;c=((i=i+Math.imul(f,Y)|0)+(a>>>13)|0)+(vn>>>26)|0,vn&=67108863,r=Math.imul(_,U),a=(a=Math.imul(_,z))+Math.imul(w,U)|0,i=Math.imul(w,z),r=r+Math.imul(g,H)|0,a=(a=a+Math.imul(g,G)|0)+Math.imul(y,H)|0,i=i+Math.imul(y,G)|0,r=r+Math.imul(p,W)|0,a=(a=a+Math.imul(p,Y)|0)+Math.imul(m,W)|0,i=i+Math.imul(m,Y)|0;var _n=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(a=(a=a+Math.imul(d,Z)|0)+Math.imul(f,J)|0))<<13)|0;c=((i=i+Math.imul(f,Z)|0)+(a>>>13)|0)+(_n>>>26)|0,_n&=67108863,r=Math.imul(x,U),a=(a=Math.imul(x,z))+Math.imul(S,U)|0,i=Math.imul(S,z),r=r+Math.imul(_,H)|0,a=(a=a+Math.imul(_,G)|0)+Math.imul(w,H)|0,i=i+Math.imul(w,G)|0,r=r+Math.imul(g,W)|0,a=(a=a+Math.imul(g,Y)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,Y)|0,r=r+Math.imul(p,J)|0,a=(a=a+Math.imul(p,Z)|0)+Math.imul(m,J)|0,i=i+Math.imul(m,Z)|0;var wn=(c+(r=r+Math.imul(d,Q)|0)|0)+((8191&(a=(a=a+Math.imul(d,nn)|0)+Math.imul(f,Q)|0))<<13)|0;c=((i=i+Math.imul(f,nn)|0)+(a>>>13)|0)+(wn>>>26)|0,wn&=67108863,r=Math.imul(E,U),a=(a=Math.imul(E,z))+Math.imul(T,U)|0,i=Math.imul(T,z),r=r+Math.imul(x,H)|0,a=(a=a+Math.imul(x,G)|0)+Math.imul(S,H)|0,i=i+Math.imul(S,G)|0,r=r+Math.imul(_,W)|0,a=(a=a+Math.imul(_,Y)|0)+Math.imul(w,W)|0,i=i+Math.imul(w,Y)|0,r=r+Math.imul(g,J)|0,a=(a=a+Math.imul(g,Z)|0)+Math.imul(y,J)|0,i=i+Math.imul(y,Z)|0,r=r+Math.imul(p,Q)|0,a=(a=a+Math.imul(p,nn)|0)+Math.imul(m,Q)|0,i=i+Math.imul(m,nn)|0;var kn=(c+(r=r+Math.imul(d,tn)|0)|0)+((8191&(a=(a=a+Math.imul(d,rn)|0)+Math.imul(f,tn)|0))<<13)|0;c=((i=i+Math.imul(f,rn)|0)+(a>>>13)|0)+(kn>>>26)|0,kn&=67108863,r=Math.imul(I,U),a=(a=Math.imul(I,z))+Math.imul(j,U)|0,i=Math.imul(j,z),r=r+Math.imul(E,H)|0,a=(a=a+Math.imul(E,G)|0)+Math.imul(T,H)|0,i=i+Math.imul(T,G)|0,r=r+Math.imul(x,W)|0,a=(a=a+Math.imul(x,Y)|0)+Math.imul(S,W)|0,i=i+Math.imul(S,Y)|0,r=r+Math.imul(_,J)|0,a=(a=a+Math.imul(_,Z)|0)+Math.imul(w,J)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(g,Q)|0,a=(a=a+Math.imul(g,nn)|0)+Math.imul(y,Q)|0,i=i+Math.imul(y,nn)|0,r=r+Math.imul(p,tn)|0,a=(a=a+Math.imul(p,rn)|0)+Math.imul(m,tn)|0,i=i+Math.imul(m,rn)|0;var xn=(c+(r=r+Math.imul(d,sn)|0)|0)+((8191&(a=(a=a+Math.imul(d,on)|0)+Math.imul(f,sn)|0))<<13)|0;c=((i=i+Math.imul(f,on)|0)+(a>>>13)|0)+(xn>>>26)|0,xn&=67108863,r=Math.imul(B,U),a=(a=Math.imul(B,z))+Math.imul(M,U)|0,i=Math.imul(M,z),r=r+Math.imul(I,H)|0,a=(a=a+Math.imul(I,G)|0)+Math.imul(j,H)|0,i=i+Math.imul(j,G)|0,r=r+Math.imul(E,W)|0,a=(a=a+Math.imul(E,Y)|0)+Math.imul(T,W)|0,i=i+Math.imul(T,Y)|0,r=r+Math.imul(x,J)|0,a=(a=a+Math.imul(x,Z)|0)+Math.imul(S,J)|0,i=i+Math.imul(S,Z)|0,r=r+Math.imul(_,Q)|0,a=(a=a+Math.imul(_,nn)|0)+Math.imul(w,Q)|0,i=i+Math.imul(w,nn)|0,r=r+Math.imul(g,tn)|0,a=(a=a+Math.imul(g,rn)|0)+Math.imul(y,tn)|0,i=i+Math.imul(y,rn)|0,r=r+Math.imul(p,sn)|0,a=(a=a+Math.imul(p,on)|0)+Math.imul(m,sn)|0,i=i+Math.imul(m,on)|0;var Sn=(c+(r=r+Math.imul(d,cn)|0)|0)+((8191&(a=(a=a+Math.imul(d,un)|0)+Math.imul(f,cn)|0))<<13)|0;c=((i=i+Math.imul(f,un)|0)+(a>>>13)|0)+(Sn>>>26)|0,Sn&=67108863,r=Math.imul(P,U),a=(a=Math.imul(P,z))+Math.imul(O,U)|0,i=Math.imul(O,z),r=r+Math.imul(B,H)|0,a=(a=a+Math.imul(B,G)|0)+Math.imul(M,H)|0,i=i+Math.imul(M,G)|0,r=r+Math.imul(I,W)|0,a=(a=a+Math.imul(I,Y)|0)+Math.imul(j,W)|0,i=i+Math.imul(j,Y)|0,r=r+Math.imul(E,J)|0,a=(a=a+Math.imul(E,Z)|0)+Math.imul(T,J)|0,i=i+Math.imul(T,Z)|0,r=r+Math.imul(x,Q)|0,a=(a=a+Math.imul(x,nn)|0)+Math.imul(S,Q)|0,i=i+Math.imul(S,nn)|0,r=r+Math.imul(_,tn)|0,a=(a=a+Math.imul(_,rn)|0)+Math.imul(w,tn)|0,i=i+Math.imul(w,rn)|0,r=r+Math.imul(g,sn)|0,a=(a=a+Math.imul(g,on)|0)+Math.imul(y,sn)|0,i=i+Math.imul(y,on)|0,r=r+Math.imul(p,cn)|0,a=(a=a+Math.imul(p,un)|0)+Math.imul(m,cn)|0,i=i+Math.imul(m,un)|0;var An=(c+(r=r+Math.imul(d,fn)|0)|0)+((8191&(a=(a=a+Math.imul(d,hn)|0)+Math.imul(f,fn)|0))<<13)|0;c=((i=i+Math.imul(f,hn)|0)+(a>>>13)|0)+(An>>>26)|0,An&=67108863,r=Math.imul(D,U),a=(a=Math.imul(D,z))+Math.imul(q,U)|0,i=Math.imul(q,z),r=r+Math.imul(P,H)|0,a=(a=a+Math.imul(P,G)|0)+Math.imul(O,H)|0,i=i+Math.imul(O,G)|0,r=r+Math.imul(B,W)|0,a=(a=a+Math.imul(B,Y)|0)+Math.imul(M,W)|0,i=i+Math.imul(M,Y)|0,r=r+Math.imul(I,J)|0,a=(a=a+Math.imul(I,Z)|0)+Math.imul(j,J)|0,i=i+Math.imul(j,Z)|0,r=r+Math.imul(E,Q)|0,a=(a=a+Math.imul(E,nn)|0)+Math.imul(T,Q)|0,i=i+Math.imul(T,nn)|0,r=r+Math.imul(x,tn)|0,a=(a=a+Math.imul(x,rn)|0)+Math.imul(S,tn)|0,i=i+Math.imul(S,rn)|0,r=r+Math.imul(_,sn)|0,a=(a=a+Math.imul(_,on)|0)+Math.imul(w,sn)|0,i=i+Math.imul(w,on)|0,r=r+Math.imul(g,cn)|0,a=(a=a+Math.imul(g,un)|0)+Math.imul(y,cn)|0,i=i+Math.imul(y,un)|0,r=r+Math.imul(p,fn)|0,a=(a=a+Math.imul(p,hn)|0)+Math.imul(m,fn)|0,i=i+Math.imul(m,hn)|0;var En=(c+(r=r+Math.imul(d,mn)|0)|0)+((8191&(a=(a=a+Math.imul(d,bn)|0)+Math.imul(f,mn)|0))<<13)|0;c=((i=i+Math.imul(f,bn)|0)+(a>>>13)|0)+(En>>>26)|0,En&=67108863,r=Math.imul(D,H),a=(a=Math.imul(D,G))+Math.imul(q,H)|0,i=Math.imul(q,G),r=r+Math.imul(P,W)|0,a=(a=a+Math.imul(P,Y)|0)+Math.imul(O,W)|0,i=i+Math.imul(O,Y)|0,r=r+Math.imul(B,J)|0,a=(a=a+Math.imul(B,Z)|0)+Math.imul(M,J)|0,i=i+Math.imul(M,Z)|0,r=r+Math.imul(I,Q)|0,a=(a=a+Math.imul(I,nn)|0)+Math.imul(j,Q)|0,i=i+Math.imul(j,nn)|0,r=r+Math.imul(E,tn)|0,a=(a=a+Math.imul(E,rn)|0)+Math.imul(T,tn)|0,i=i+Math.imul(T,rn)|0,r=r+Math.imul(x,sn)|0,a=(a=a+Math.imul(x,on)|0)+Math.imul(S,sn)|0,i=i+Math.imul(S,on)|0,r=r+Math.imul(_,cn)|0,a=(a=a+Math.imul(_,un)|0)+Math.imul(w,cn)|0,i=i+Math.imul(w,un)|0,r=r+Math.imul(g,fn)|0,a=(a=a+Math.imul(g,hn)|0)+Math.imul(y,fn)|0,i=i+Math.imul(y,hn)|0;var Tn=(c+(r=r+Math.imul(p,mn)|0)|0)+((8191&(a=(a=a+Math.imul(p,bn)|0)+Math.imul(m,mn)|0))<<13)|0;c=((i=i+Math.imul(m,bn)|0)+(a>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,r=Math.imul(D,W),a=(a=Math.imul(D,Y))+Math.imul(q,W)|0,i=Math.imul(q,Y),r=r+Math.imul(P,J)|0,a=(a=a+Math.imul(P,Z)|0)+Math.imul(O,J)|0,i=i+Math.imul(O,Z)|0,r=r+Math.imul(B,Q)|0,a=(a=a+Math.imul(B,nn)|0)+Math.imul(M,Q)|0,i=i+Math.imul(M,nn)|0,r=r+Math.imul(I,tn)|0,a=(a=a+Math.imul(I,rn)|0)+Math.imul(j,tn)|0,i=i+Math.imul(j,rn)|0,r=r+Math.imul(E,sn)|0,a=(a=a+Math.imul(E,on)|0)+Math.imul(T,sn)|0,i=i+Math.imul(T,on)|0,r=r+Math.imul(x,cn)|0,a=(a=a+Math.imul(x,un)|0)+Math.imul(S,cn)|0,i=i+Math.imul(S,un)|0,r=r+Math.imul(_,fn)|0,a=(a=a+Math.imul(_,hn)|0)+Math.imul(w,fn)|0,i=i+Math.imul(w,hn)|0;var Cn=(c+(r=r+Math.imul(g,mn)|0)|0)+((8191&(a=(a=a+Math.imul(g,bn)|0)+Math.imul(y,mn)|0))<<13)|0;c=((i=i+Math.imul(y,bn)|0)+(a>>>13)|0)+(Cn>>>26)|0,Cn&=67108863,r=Math.imul(D,J),a=(a=Math.imul(D,Z))+Math.imul(q,J)|0,i=Math.imul(q,Z),r=r+Math.imul(P,Q)|0,a=(a=a+Math.imul(P,nn)|0)+Math.imul(O,Q)|0,i=i+Math.imul(O,nn)|0,r=r+Math.imul(B,tn)|0,a=(a=a+Math.imul(B,rn)|0)+Math.imul(M,tn)|0,i=i+Math.imul(M,rn)|0,r=r+Math.imul(I,sn)|0,a=(a=a+Math.imul(I,on)|0)+Math.imul(j,sn)|0,i=i+Math.imul(j,on)|0,r=r+Math.imul(E,cn)|0,a=(a=a+Math.imul(E,un)|0)+Math.imul(T,cn)|0,i=i+Math.imul(T,un)|0,r=r+Math.imul(x,fn)|0,a=(a=a+Math.imul(x,hn)|0)+Math.imul(S,fn)|0,i=i+Math.imul(S,hn)|0;var In=(c+(r=r+Math.imul(_,mn)|0)|0)+((8191&(a=(a=a+Math.imul(_,bn)|0)+Math.imul(w,mn)|0))<<13)|0;c=((i=i+Math.imul(w,bn)|0)+(a>>>13)|0)+(In>>>26)|0,In&=67108863,r=Math.imul(D,Q),a=(a=Math.imul(D,nn))+Math.imul(q,Q)|0,i=Math.imul(q,nn),r=r+Math.imul(P,tn)|0,a=(a=a+Math.imul(P,rn)|0)+Math.imul(O,tn)|0,i=i+Math.imul(O,rn)|0,r=r+Math.imul(B,sn)|0,a=(a=a+Math.imul(B,on)|0)+Math.imul(M,sn)|0,i=i+Math.imul(M,on)|0,r=r+Math.imul(I,cn)|0,a=(a=a+Math.imul(I,un)|0)+Math.imul(j,cn)|0,i=i+Math.imul(j,un)|0,r=r+Math.imul(E,fn)|0,a=(a=a+Math.imul(E,hn)|0)+Math.imul(T,fn)|0,i=i+Math.imul(T,hn)|0;var jn=(c+(r=r+Math.imul(x,mn)|0)|0)+((8191&(a=(a=a+Math.imul(x,bn)|0)+Math.imul(S,mn)|0))<<13)|0;c=((i=i+Math.imul(S,bn)|0)+(a>>>13)|0)+(jn>>>26)|0,jn&=67108863,r=Math.imul(D,tn),a=(a=Math.imul(D,rn))+Math.imul(q,tn)|0,i=Math.imul(q,rn),r=r+Math.imul(P,sn)|0,a=(a=a+Math.imul(P,on)|0)+Math.imul(O,sn)|0,i=i+Math.imul(O,on)|0,r=r+Math.imul(B,cn)|0,a=(a=a+Math.imul(B,un)|0)+Math.imul(M,cn)|0,i=i+Math.imul(M,un)|0,r=r+Math.imul(I,fn)|0,a=(a=a+Math.imul(I,hn)|0)+Math.imul(j,fn)|0,i=i+Math.imul(j,hn)|0;var Rn=(c+(r=r+Math.imul(E,mn)|0)|0)+((8191&(a=(a=a+Math.imul(E,bn)|0)+Math.imul(T,mn)|0))<<13)|0;c=((i=i+Math.imul(T,bn)|0)+(a>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,r=Math.imul(D,sn),a=(a=Math.imul(D,on))+Math.imul(q,sn)|0,i=Math.imul(q,on),r=r+Math.imul(P,cn)|0,a=(a=a+Math.imul(P,un)|0)+Math.imul(O,cn)|0,i=i+Math.imul(O,un)|0,r=r+Math.imul(B,fn)|0,a=(a=a+Math.imul(B,hn)|0)+Math.imul(M,fn)|0,i=i+Math.imul(M,hn)|0;var Bn=(c+(r=r+Math.imul(I,mn)|0)|0)+((8191&(a=(a=a+Math.imul(I,bn)|0)+Math.imul(j,mn)|0))<<13)|0;c=((i=i+Math.imul(j,bn)|0)+(a>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,r=Math.imul(D,cn),a=(a=Math.imul(D,un))+Math.imul(q,cn)|0,i=Math.imul(q,un),r=r+Math.imul(P,fn)|0,a=(a=a+Math.imul(P,hn)|0)+Math.imul(O,fn)|0,i=i+Math.imul(O,hn)|0;var Mn=(c+(r=r+Math.imul(B,mn)|0)|0)+((8191&(a=(a=a+Math.imul(B,bn)|0)+Math.imul(M,mn)|0))<<13)|0;c=((i=i+Math.imul(M,bn)|0)+(a>>>13)|0)+(Mn>>>26)|0,Mn&=67108863,r=Math.imul(D,fn),a=(a=Math.imul(D,hn))+Math.imul(q,fn)|0,i=Math.imul(q,hn);var Nn=(c+(r=r+Math.imul(P,mn)|0)|0)+((8191&(a=(a=a+Math.imul(P,bn)|0)+Math.imul(O,mn)|0))<<13)|0;c=((i=i+Math.imul(O,bn)|0)+(a>>>13)|0)+(Nn>>>26)|0,Nn&=67108863;var Pn=(c+(r=Math.imul(D,mn))|0)+((8191&(a=(a=Math.imul(D,bn))+Math.imul(q,mn)|0))<<13)|0;return c=((i=Math.imul(q,bn))+(a>>>13)|0)+(Pn>>>26)|0,Pn&=67108863,l[0]=gn,l[1]=yn,l[2]=vn,l[3]=_n,l[4]=wn,l[5]=kn,l[6]=xn,l[7]=Sn,l[8]=An,l[9]=En,l[10]=Tn,l[11]=Cn,l[12]=In,l[13]=jn,l[14]=Rn,l[15]=Bn,l[16]=Mn,l[17]=Nn,l[18]=Pn,0!==c&&(l[19]=c,t.length++),t};function p(n,e,t){return(new m).mulp(n,e,t)}function m(n,e){this.x=n,this.y=e}Math.imul||(h=f),i.prototype.mulTo=function(n,e){var t=this.length+n.length;return 10===this.length&&10===n.length?h(this,n,e):t<63?f(this,n,e):t<1024?function(n,e,t){t.negative=e.negative^n.negative,t.length=n.length+e.length;for(var r=0,a=0,i=0;i>>26)|0)>>>26,s&=67108863}t.words[i]=o,r=s,s=a}return 0!==r?t.words[i]=r:t.length--,t.strip()}(this,n,e):p(this,n,e)},m.prototype.makeRBT=function(n){for(var e=new Array(n),t=i.prototype._countBits(n)-1,r=0;r>=1;return r},m.prototype.permute=function(n,e,t,r,a,i){for(var s=0;s>>=1)a++;return 1<>>=13,t[2*s+1]=8191&i,i>>>=13;for(s=2*e;s>=26,e+=a/67108864|0,e+=i>>>26,this.words[t]=67108863&i}return 0!==e&&(this.words[t]=e,this.length++),this},i.prototype.muln=function(n){return this.clone().imuln(n)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(n){var e=function(n){for(var e=new Array(n.bitLength()),t=0;t>>a}return e}(n);if(0===e.length)return new i(1);for(var t=this,r=0;r=0);var e,t=n%26,a=(n-t)/26,i=67108863>>>26-t<<26-t;if(0!==t){var s=0;for(e=0;e>>26-t}s&&(this.words[e]=s,this.length++)}if(0!==a){for(e=this.length-1;e>=0;e--)this.words[e+a]=this.words[e];for(e=0;e=0),a=e?(e-e%26)/26:0;var i=n%26,s=Math.min((n-i)/26,this.length),o=67108863^67108863>>>i<s)for(this.length-=s,c=0;c=0&&(0!==u||c>=a);c--){var d=0|this.words[c];this.words[c]=u<<26-i|d>>>i,u=d&o}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(n,e,t){return r(0===this.negative),this.iushrn(n,e,t)},i.prototype.shln=function(n){return this.clone().ishln(n)},i.prototype.ushln=function(n){return this.clone().iushln(n)},i.prototype.shrn=function(n){return this.clone().ishrn(n)},i.prototype.ushrn=function(n){return this.clone().iushrn(n)},i.prototype.testn=function(n){r("number"==typeof n&&n>=0);var e=n%26,t=(n-e)/26,a=1<=0);var e=n%26,t=(n-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==e&&t++,this.length=Math.min(t,this.length),0!==e){var a=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},i.prototype.isubn=function(n){if(r("number"==typeof n),r(n<67108864),n<0)return this.iaddn(-n);if(0!==this.negative)return this.negative=0,this.iaddn(n),this.negative=1,this;if(this.words[0]-=n,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[a+t]=67108863&i}for(;a>26,this.words[a+t]=67108863&i;if(0===o)return this.strip();for(r(-1===o),o=0,a=0;a>26,this.words[a]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(n,e){var t=(this.length,n.length),r=this.clone(),a=n,s=0|a.words[a.length-1];0!==(t=26-this._countBits(s))&&(a=a.ushln(t),r.iushln(t),s=0|a.words[a.length-1]);var o,l=r.length-a.length;if("mod"!==e){(o=new i(null)).length=l+1,o.words=new Array(o.length);for(var c=0;c=0;d--){var f=67108864*(0|r.words[a.length+d])+(0|r.words[a.length+d-1]);for(f=Math.min(f/s|0,67108863),r._ishlnsubmul(a,f,d);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(a,1,d),r.isZero()||(r.negative^=1);o&&(o.words[d]=f)}return o&&o.strip(),r.strip(),"div"!==e&&0!==t&&r.iushrn(t),{div:o||null,mod:r}},i.prototype.divmod=function(n,e,t){return r(!n.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===n.negative?(o=this.neg().divmod(n,e),"mod"!==e&&(a=o.div.neg()),"div"!==e&&(s=o.mod.neg(),t&&0!==s.negative&&s.iadd(n)),{div:a,mod:s}):0===this.negative&&0!==n.negative?(o=this.divmod(n.neg(),e),"mod"!==e&&(a=o.div.neg()),{div:a,mod:o.mod}):0!=(this.negative&n.negative)?(o=this.neg().divmod(n.neg(),e),"div"!==e&&(s=o.mod.neg(),t&&0!==s.negative&&s.isub(n)),{div:o.div,mod:s}):n.length>this.length||this.cmp(n)<0?{div:new i(0),mod:this}:1===n.length?"div"===e?{div:this.divn(n.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(n.words[0]))}:{div:this.divn(n.words[0]),mod:new i(this.modn(n.words[0]))}:this._wordDiv(n,e);var a,s,o},i.prototype.div=function(n){return this.divmod(n,"div",!1).div},i.prototype.mod=function(n){return this.divmod(n,"mod",!1).mod},i.prototype.umod=function(n){return this.divmod(n,"mod",!0).mod},i.prototype.divRound=function(n){var e=this.divmod(n);if(e.mod.isZero())return e.div;var t=0!==e.div.negative?e.mod.isub(n):e.mod,r=n.ushrn(1),a=n.andln(1),i=t.cmp(r);return i<0||1===a&&0===i?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(n){r(n<=67108863);for(var e=(1<<26)%n,t=0,a=this.length-1;a>=0;a--)t=(e*t+(0|this.words[a]))%n;return t},i.prototype.idivn=function(n){r(n<=67108863);for(var e=0,t=this.length-1;t>=0;t--){var a=(0|this.words[t])+67108864*e;this.words[t]=a/n|0,e=a%n}return this.strip()},i.prototype.divn=function(n){return this.clone().idivn(n)},i.prototype.egcd=function(n){r(0===n.negative),r(!n.isZero());var e=this,t=n.clone();e=0!==e.negative?e.umod(n):e.clone();for(var a=new i(1),s=new i(0),o=new i(0),l=new i(1),c=0;e.isEven()&&t.isEven();)e.iushrn(1),t.iushrn(1),++c;for(var u=t.clone(),d=e.clone();!e.isZero();){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()||s.isOdd())&&(a.iadd(u),s.isub(d)),a.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(t.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(t.iushrn(p);p-- >0;)(o.isOdd()||l.isOdd())&&(o.iadd(u),l.isub(d)),o.iushrn(1),l.iushrn(1);e.cmp(t)>=0?(e.isub(t),a.isub(o),s.isub(l)):(t.isub(e),o.isub(a),l.isub(s))}return{a:o,b:l,gcd:t.iushln(c)}},i.prototype._invmp=function(n){r(0===n.negative),r(!n.isZero());var e=this,t=n.clone();e=0!==e.negative?e.umod(n):e.clone();for(var a,s=new i(1),o=new i(0),l=t.clone();e.cmpn(1)>0&&t.cmpn(1)>0;){for(var c=0,u=1;0==(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);for(var d=0,f=1;0==(t.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(t.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);e.cmp(t)>=0?(e.isub(t),s.isub(o)):(t.isub(e),o.isub(s))}return(a=0===e.cmpn(1)?s:o).cmpn(0)<0&&a.iadd(n),a},i.prototype.gcd=function(n){if(this.isZero())return n.abs();if(n.isZero())return this.abs();var e=this.clone(),t=n.clone();e.negative=0,t.negative=0;for(var r=0;e.isEven()&&t.isEven();r++)e.iushrn(1),t.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;t.isEven();)t.iushrn(1);var a=e.cmp(t);if(a<0){var i=e;e=t,t=i}else if(0===a||0===t.cmpn(1))break;e.isub(t)}return t.iushln(r)},i.prototype.invm=function(n){return this.egcd(n).a.umod(n)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(n){return this.words[0]&n},i.prototype.bincn=function(n){r("number"==typeof n);var e=n%26,t=(n-e)/26,a=1<>>26,o&=67108863,this.words[s]=o}return 0!==i&&(this.words[s]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(n){var e,t=n<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)e=1;else{t&&(n=-n),r(n<=67108863,"Number is too big");var a=0|this.words[0];e=a===n?0:an.length)return 1;if(this.length=0;t--){var r=0|this.words[t],a=0|n.words[t];if(r!==a){ra&&(e=1);break}}return e},i.prototype.gtn=function(n){return 1===this.cmpn(n)},i.prototype.gt=function(n){return 1===this.cmp(n)},i.prototype.gten=function(n){return this.cmpn(n)>=0},i.prototype.gte=function(n){return this.cmp(n)>=0},i.prototype.ltn=function(n){return-1===this.cmpn(n)},i.prototype.lt=function(n){return-1===this.cmp(n)},i.prototype.lten=function(n){return this.cmpn(n)<=0},i.prototype.lte=function(n){return this.cmp(n)<=0},i.prototype.eqn=function(n){return 0===this.cmpn(n)},i.prototype.eq=function(n){return 0===this.cmp(n)},i.red=function(n){return new k(n)},i.prototype.toRed=function(n){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),n.convertTo(this)._forceRed(n)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(n){return this.red=n,this},i.prototype.forceRed=function(n){return r(!this.red,"Already a number in reduction context"),this._forceRed(n)},i.prototype.redAdd=function(n){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,n)},i.prototype.redIAdd=function(n){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,n)},i.prototype.redSub=function(n){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,n)},i.prototype.redISub=function(n){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,n)},i.prototype.redShl=function(n){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,n)},i.prototype.redMul=function(n){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,n),this.red.mul(this,n)},i.prototype.redIMul=function(n){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,n),this.red.imul(this,n)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(n){return r(this.red&&!n.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,n)};var b={k256:null,p224:null,p192:null,p25519:null};function g(n,e){this.name=n,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(n){if("string"==typeof n){var e=i._prime(n);this.m=e.p,this.prime=e}else r(n.gtn(1),"modulus must be greater than 1"),this.m=n,this.prime=null}function x(n){k.call(this,n),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}g.prototype._tmp=function(){var n=new i(null);return n.words=new Array(Math.ceil(this.n/13)),n},g.prototype.ireduce=function(n){var e,t=n;do{this.split(t,this.tmp),e=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?t.isub(this.p):t.strip(),t},g.prototype.split=function(n,e){n.iushrn(this.n,0,e)},g.prototype.imulK=function(n){return n.imul(this.k)},a(y,g),y.prototype.split=function(n,e){for(var t=Math.min(n.length,9),r=0;r>>22,a=i}a>>>=22,n.words[r-10]=a,0===a&&n.length>10?n.length-=10:n.length-=9},y.prototype.imulK=function(n){n.words[n.length]=0,n.words[n.length+1]=0,n.length+=2;for(var e=0,t=0;t>>=26,n.words[t]=a,e=r}return 0!==e&&(n.words[n.length++]=e),n},i._prime=function(n){if(b[n])return b[n];var e;if("k256"===n)e=new y;else if("p224"===n)e=new v;else if("p192"===n)e=new _;else{if("p25519"!==n)throw new Error("Unknown prime "+n);e=new w}return b[n]=e,e},k.prototype._verify1=function(n){r(0===n.negative,"red works only with positives"),r(n.red,"red works only with red numbers")},k.prototype._verify2=function(n,e){r(0==(n.negative|e.negative),"red works only with positives"),r(n.red&&n.red===e.red,"red works only with red numbers")},k.prototype.imod=function(n){return this.prime?this.prime.ireduce(n)._forceRed(this):n.umod(this.m)._forceRed(this)},k.prototype.neg=function(n){return n.isZero()?n.clone():this.m.sub(n)._forceRed(this)},k.prototype.add=function(n,e){this._verify2(n,e);var t=n.add(e);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},k.prototype.iadd=function(n,e){this._verify2(n,e);var t=n.iadd(e);return t.cmp(this.m)>=0&&t.isub(this.m),t},k.prototype.sub=function(n,e){this._verify2(n,e);var t=n.sub(e);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},k.prototype.isub=function(n,e){this._verify2(n,e);var t=n.isub(e);return t.cmpn(0)<0&&t.iadd(this.m),t},k.prototype.shl=function(n,e){return this._verify1(n),this.imod(n.ushln(e))},k.prototype.imul=function(n,e){return this._verify2(n,e),this.imod(n.imul(e))},k.prototype.mul=function(n,e){return this._verify2(n,e),this.imod(n.mul(e))},k.prototype.isqr=function(n){return this.imul(n,n.clone())},k.prototype.sqr=function(n){return this.mul(n,n)},k.prototype.sqrt=function(n){if(n.isZero())return n.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var t=this.m.add(new i(1)).iushrn(2);return this.pow(n,t)}for(var a=this.m.subn(1),s=0;!a.isZero()&&0===a.andln(1);)s++,a.iushrn(1);r(!a.isZero());var o=new i(1).toRed(this),l=o.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var d=this.pow(u,a),f=this.pow(n,a.addn(1).iushrn(1)),h=this.pow(n,a),p=s;0!==h.cmp(o);){for(var m=h,b=0;0!==m.cmp(o);b++)m=m.redSqr();r(b=0;r--){for(var c=e.words[r],u=l-1;u>=0;u--){var d=c>>u&1;a!==t[0]&&(a=this.sqr(a)),0!==d||0!==s?(s<<=1,s|=d,(4===++o||0===r&&0===u)&&(a=this.mul(a,t[s]),o=0,s=0)):o=0}l=26}return a},k.prototype.convertTo=function(n){var e=n.umod(this.m);return e===n?e.clone():e},k.prototype.convertFrom=function(n){var e=n.clone();return e.red=null,e},i.mont=function(n){return new x(n)},a(x,k),x.prototype.convertTo=function(n){return this.imod(n.ushln(this.shift))},x.prototype.convertFrom=function(n){var e=this.imod(n.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(n,e){if(n.isZero()||e.isZero())return n.words[0]=0,n.length=1,n;var t=n.imul(e),r=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=t.isub(r).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},x.prototype.mul=function(n,e){if(n.isZero()||e.isZero())return new i(0)._forceRed(this);var t=n.mul(e),r=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=t.isub(r).iushrn(this.shift),s=a;return a.cmp(this.m)>=0?s=a.isub(this.m):a.cmpn(0)<0&&(s=a.iadd(this.m)),s._forceRed(this)},x.prototype.invm=function(n){return this.imod(n._invmp(this.m).mul(this.r2))._forceRed(this)}}(n,this)}).call(this,t(18)(n))},function(n,e){var t="0123456789abcdef".split(""),r=[1,256,65536,16777216],a=[0,8,16,24],i=[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],s=function(n){var e,t,r,a,s,o,l,c,u,d,f,h,p,m,b,g,y,v,_,w,k,x,S,A,E,T,C,I,j,R,B,M,N,P,O,L,D,q,F,U,z,K,H,G,V,W,Y,X,J,Z,$,Q,nn,en,tn,rn,an,sn,on,ln,cn,un,dn;for(r=0;r<48;r+=2)a=n[0]^n[10]^n[20]^n[30]^n[40],s=n[1]^n[11]^n[21]^n[31]^n[41],o=n[2]^n[12]^n[22]^n[32]^n[42],l=n[3]^n[13]^n[23]^n[33]^n[43],c=n[4]^n[14]^n[24]^n[34]^n[44],u=n[5]^n[15]^n[25]^n[35]^n[45],d=n[6]^n[16]^n[26]^n[36]^n[46],f=n[7]^n[17]^n[27]^n[37]^n[47],e=(h=n[8]^n[18]^n[28]^n[38]^n[48])^(o<<1|l>>>31),t=(p=n[9]^n[19]^n[29]^n[39]^n[49])^(l<<1|o>>>31),n[0]^=e,n[1]^=t,n[10]^=e,n[11]^=t,n[20]^=e,n[21]^=t,n[30]^=e,n[31]^=t,n[40]^=e,n[41]^=t,e=a^(c<<1|u>>>31),t=s^(u<<1|c>>>31),n[2]^=e,n[3]^=t,n[12]^=e,n[13]^=t,n[22]^=e,n[23]^=t,n[32]^=e,n[33]^=t,n[42]^=e,n[43]^=t,e=o^(d<<1|f>>>31),t=l^(f<<1|d>>>31),n[4]^=e,n[5]^=t,n[14]^=e,n[15]^=t,n[24]^=e,n[25]^=t,n[34]^=e,n[35]^=t,n[44]^=e,n[45]^=t,e=c^(h<<1|p>>>31),t=u^(p<<1|h>>>31),n[6]^=e,n[7]^=t,n[16]^=e,n[17]^=t,n[26]^=e,n[27]^=t,n[36]^=e,n[37]^=t,n[46]^=e,n[47]^=t,e=d^(a<<1|s>>>31),t=f^(s<<1|a>>>31),n[8]^=e,n[9]^=t,n[18]^=e,n[19]^=t,n[28]^=e,n[29]^=t,n[38]^=e,n[39]^=t,n[48]^=e,n[49]^=t,m=n[0],b=n[1],W=n[11]<<4|n[10]>>>28,Y=n[10]<<4|n[11]>>>28,I=n[20]<<3|n[21]>>>29,j=n[21]<<3|n[20]>>>29,ln=n[31]<<9|n[30]>>>23,cn=n[30]<<9|n[31]>>>23,K=n[40]<<18|n[41]>>>14,H=n[41]<<18|n[40]>>>14,P=n[2]<<1|n[3]>>>31,O=n[3]<<1|n[2]>>>31,g=n[13]<<12|n[12]>>>20,y=n[12]<<12|n[13]>>>20,X=n[22]<<10|n[23]>>>22,J=n[23]<<10|n[22]>>>22,R=n[33]<<13|n[32]>>>19,B=n[32]<<13|n[33]>>>19,un=n[42]<<2|n[43]>>>30,dn=n[43]<<2|n[42]>>>30,en=n[5]<<30|n[4]>>>2,tn=n[4]<<30|n[5]>>>2,L=n[14]<<6|n[15]>>>26,D=n[15]<<6|n[14]>>>26,v=n[25]<<11|n[24]>>>21,_=n[24]<<11|n[25]>>>21,Z=n[34]<<15|n[35]>>>17,$=n[35]<<15|n[34]>>>17,M=n[45]<<29|n[44]>>>3,N=n[44]<<29|n[45]>>>3,A=n[6]<<28|n[7]>>>4,E=n[7]<<28|n[6]>>>4,rn=n[17]<<23|n[16]>>>9,an=n[16]<<23|n[17]>>>9,q=n[26]<<25|n[27]>>>7,F=n[27]<<25|n[26]>>>7,w=n[36]<<21|n[37]>>>11,k=n[37]<<21|n[36]>>>11,Q=n[47]<<24|n[46]>>>8,nn=n[46]<<24|n[47]>>>8,G=n[8]<<27|n[9]>>>5,V=n[9]<<27|n[8]>>>5,T=n[18]<<20|n[19]>>>12,C=n[19]<<20|n[18]>>>12,sn=n[29]<<7|n[28]>>>25,on=n[28]<<7|n[29]>>>25,U=n[38]<<8|n[39]>>>24,z=n[39]<<8|n[38]>>>24,x=n[48]<<14|n[49]>>>18,S=n[49]<<14|n[48]>>>18,n[0]=m^~g&v,n[1]=b^~y&_,n[10]=A^~T&I,n[11]=E^~C&j,n[20]=P^~L&q,n[21]=O^~D&F,n[30]=G^~W&X,n[31]=V^~Y&J,n[40]=en^~rn&sn,n[41]=tn^~an&on,n[2]=g^~v&w,n[3]=y^~_&k,n[12]=T^~I&R,n[13]=C^~j&B,n[22]=L^~q&U,n[23]=D^~F&z,n[32]=W^~X&Z,n[33]=Y^~J&$,n[42]=rn^~sn&ln,n[43]=an^~on&cn,n[4]=v^~w&x,n[5]=_^~k&S,n[14]=I^~R&M,n[15]=j^~B&N,n[24]=q^~U&K,n[25]=F^~z&H,n[34]=X^~Z&Q,n[35]=J^~$&nn,n[44]=sn^~ln&un,n[45]=on^~cn&dn,n[6]=w^~x&m,n[7]=k^~S&b,n[16]=R^~M&A,n[17]=B^~N&E,n[26]=U^~K&P,n[27]=z^~H&O,n[36]=Z^~Q&G,n[37]=$^~nn&V,n[46]=ln^~un&en,n[47]=cn^~dn&tn,n[8]=x^~m&g,n[9]=S^~b&y,n[18]=M^~A&T,n[19]=N^~E&C,n[28]=K^~P&L,n[29]=H^~O&D,n[38]=Q^~G&W,n[39]=nn^~V&Y,n[48]=un^~en&rn,n[49]=dn^~tn&an,n[0]^=i[r],n[1]^=i[r+1]},o=function(n){return function(e){var i;if("0x"===e.slice(0,2)){i=[];for(var o=2,l=e.length;o>2]|=e[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(l[b>>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)<=c){for(n.start=b-c,n.block=l[u],b=0;b>2]|=r[3&b],n.lastByteIndex===c)for(l[0]=l[u],b=1;b>4&15]+t[15&p]+t[p>>12&15]+t[p>>8&15]+t[p>>20&15]+t[p>>16&15]+t[p>>28&15]+t[p>>24&15];g%u==0&&(s(f),b=0)}return"0x"+m}(function(n){return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(n<<1)>>5,outputBlocks:n>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e}(n),i)}};n.exports={keccak256:o(256),keccak512:o(512),keccak256s:o(256),keccak512s:o(512)}},function(n,e,t){"use strict";var r=t(10),a=t(217),i=function(n){var e="A".charCodeAt(0),t="Z".charCodeAt(0);return(n=(n=n.toUpperCase()).substr(4)+n.substr(0,4)).split("").map(function(n){var r=n.charCodeAt(0);return r>=e&&r<=t?r-e+10:n}).join("")},s=function(n){for(var e,t=n;t.length>2;)e=t.slice(0,9),t=parseInt(e,10)%97+t.slice(e.length);return parseInt(t,10)%97},o=function(n){this._iban=n};o.toAddress=function(n){if(!(n=new o(n)).isDirect())throw new Error("IBAN is indirect and can't be converted");return n.toAddress()},o.toIban=function(n){return o.fromAddress(n).toString()},o.fromAddress=function(n){if(!r.isAddress(n))throw new Error("Provided address is not a valid address: "+n);n=n.replace("0x","").replace("0X","");var e=function(n,e){for(var t=n;t.length<2*e;)t="0"+t;return t}(new a(n,16).toString(36),15);return o.fromBban(e.toUpperCase())},o.fromBban=function(n){var e=("0"+(98-s(i("XE00"+n)))).slice(-2);return new o("XE"+e+n)},o.createIndirect=function(n){return o.fromBban("ETH"+n.institution+n.identifier)},o.isValid=function(n){return new o(n).isValid()},o.prototype.isValid=function(){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(this._iban)&&1===s(i(this._iban))},o.prototype.isDirect=function(){return 34===this._iban.length||35===this._iban.length},o.prototype.isIndirect=function(){return 20===this._iban.length},o.prototype.checksum=function(){return this._iban.substr(2,2)},o.prototype.institution=function(){return this.isIndirect()?this._iban.substr(7,4):""},o.prototype.client=function(){return this.isIndirect()?this._iban.substr(11):""},o.prototype.toAddress=function(){if(this.isDirect()){var n=this._iban.substr(4),e=new a(n,36);return r.toChecksumAddress(e.toString(16,20))}return""},o.prototype.toString=function(){return this._iban},n.exports=o},function(n,e,t){"use strict";var r={messageId:0,toPayload:function(n,e){if(!n)throw new Error('JSONRPC method should be specified for params: "'+JSON.stringify(e)+'"!');return r.messageId++,{jsonrpc:"2.0",id:r.messageId,method:n,params:e||[]}},isValidResponse:function(n){return Array.isArray(n)?n.every(e):e(n);function e(n){return!(!n||n.error||"2.0"!==n.jsonrpc||"number"!=typeof n.id&&"string"!=typeof n.id||void 0===n.result)}},toBatchPayload:function(n){return n.map(function(n){return r.toPayload(n.method,n.params)})}};n.exports=r},function(n,e,t){(function(n,r){var a;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(i){e&&e.nodeType,n&&n.nodeType;var s="object"==typeof r&&r;s.global!==s&&s.window!==s&&s.self;var o,l=2147483647,c=36,u=1,d=26,f=38,h=700,p=72,m=128,b="-",g=/^xn--/,y=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=c-u,k=Math.floor,x=String.fromCharCode;function S(n){throw new RangeError(_[n])}function A(n,e){for(var t=n.length,r=[];t--;)r[t]=e(n[t]);return r}function E(n,e){var t=n.split("@"),r="";return t.length>1&&(r=t[0]+"@",n=t[1]),r+A((n=n.replace(v,".")).split("."),e).join(".")}function T(n){for(var e,t,r=[],a=0,i=n.length;a=55296&&e<=56319&&a65535&&(e+=x((n-=65536)>>>10&1023|55296),n=56320|1023&n),e+=x(n)}).join("")}function I(n,e){return n+22+75*(n<26)-((0!=e)<<5)}function j(n,e,t){var r=0;for(n=t?k(n/h):n>>1,n+=k(n/e);n>w*d>>1;r+=c)n=k(n/w);return k(r+(w+1)*n/(n+f))}function R(n){var e,t,r,a,i,s,o,f,h,g,y,v=[],_=n.length,w=0,x=m,A=p;for((t=n.lastIndexOf(b))<0&&(t=0),r=0;r=128&&S("not-basic"),v.push(n.charCodeAt(r));for(a=t>0?t+1:0;a<_;){for(i=w,s=1,o=c;a>=_&&S("invalid-input"),((f=(y=n.charCodeAt(a++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:c)>=c||f>k((l-w)/s))&&S("overflow"),w+=f*s,!(f<(h=o<=A?u:o>=A+d?d:o-A));o+=c)s>k(l/(g=c-h))&&S("overflow"),s*=g;A=j(w-i,e=v.length+1,0==i),k(w/e)>l-x&&S("overflow"),x+=k(w/e),w%=e,v.splice(w++,0,x)}return C(v)}function B(n){var e,t,r,a,i,s,o,f,h,g,y,v,_,w,A,E=[];for(v=(n=T(n)).length,e=m,t=0,i=p,s=0;s=e&&yk((l-t)/(_=r+1))&&S("overflow"),t+=(o-e)*_,e=o,s=0;sl&&S("overflow"),y==e){for(f=t,h=c;!(f<(g=h<=i?u:h>=i+d?d:h-i));h+=c)A=f-g,w=c-g,E.push(x(I(g+A%w,0))),f=k(A/w);E.push(x(I(f,0))),i=j(t,_,r==a),t=0,++r}++t,++e}return E.join("")}o={version:"1.4.1",ucs2:{decode:T,encode:C},decode:R,encode:B,toASCII:function(n){return E(n,function(n){return y.test(n)?"xn--"+B(n):n})},toUnicode:function(n){return E(n,function(n){return g.test(n)?R(n.slice(4).toLowerCase()):n})}},void 0===(a=function(){return o}.call(e,t,e,n))||(n.exports=a)}()}).call(this,t(18)(n),t(4))},function(n,e,t){(function(n){e.fetch=o(n.fetch)&&o(n.ReadableStream),e.writableStream=o(n.WritableStream),e.abortController=o(n.AbortController),e.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),e.blobConstructor=!0}catch(n){}var t;function r(){if(void 0!==t)return t;if(n.XMLHttpRequest){t=new n.XMLHttpRequest;try{t.open("GET",n.XDomainRequest?"/":"https://example.com")}catch(n){t=null}}else t=null;return t}function a(n){var e=r();if(!e)return!1;try{return e.responseType=n,e.responseType===n}catch(n){}return!1}var i=void 0!==n.ArrayBuffer,s=i&&o(n.ArrayBuffer.prototype.slice);function o(n){return"function"==typeof n}e.arraybuffer=e.fetch||i&&a("arraybuffer"),e.msstream=!e.fetch&&s&&a("ms-stream"),e.mozchunkedarraybuffer=!e.fetch&&i&&a("moz-chunked-arraybuffer"),e.overrideMimeType=e.fetch||!!r()&&o(r().overrideMimeType),e.vbArray=o(n.VBArray),t=null}).call(this,t(4))},function(n,e,t){(function(n,r,a){var i=t(102),s=t(0),o=t(32),l=e.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=e.IncomingMessage=function(e,t,s,l){var c=this;if(o.Readable.call(c),c._mode=s,c.headers={},c.rawHeaders=[],c.trailers={},c.rawTrailers=[],c.on("end",function(){n.nextTick(function(){c.emit("close")})}),"fetch"===s){if(c._fetchResponse=t,c.url=t.url,c.statusCode=t.status,c.statusMessage=t.statusText,t.headers.forEach(function(n,e){c.headers[e.toLowerCase()]=n,c.rawHeaders.push(e,n)}),i.writableStream){var u=new WritableStream({write:function(n){return new Promise(function(e,t){c._destroyed?t():c.push(new r(n))?e():c._resumeFetch=e})},close:function(){a.clearTimeout(l),c._destroyed||c.push(null)},abort:function(n){c._destroyed||c.emit("error",n)}});try{return void t.body.pipeTo(u).catch(function(n){a.clearTimeout(l),c._destroyed||c.emit("error",n)})}catch(n){}}var d=t.body.getReader();!function n(){d.read().then(function(e){if(!c._destroyed){if(e.done)return a.clearTimeout(l),void c.push(null);c.push(new r(e.value)),n()}}).catch(function(n){a.clearTimeout(l),c._destroyed||c.emit("error",n)})}()}else{if(c._xhr=e,c._pos=0,c.url=e.responseURL,c.statusCode=e.status,c.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach(function(n){var e=n.match(/^([^:]+):\s*(.*)/);if(e){var t=e[1].toLowerCase();"set-cookie"===t?(void 0===c.headers[t]&&(c.headers[t]=[]),c.headers[t].push(e[2])):void 0!==c.headers[t]?c.headers[t]+=", "+e[2]:c.headers[t]=e[2],c.rawHeaders.push(e[1],e[2])}}),c._charset="x-user-defined",!i.overrideMimeType){var f=c.rawHeaders["mime-type"];if(f){var h=f.match(/;\s*charset=([^;])(;|$)/);h&&(c._charset=h[1].toLowerCase())}c._charset||(c._charset="utf-8")}}};s(c,o.Readable),c.prototype._read=function(){var n=this._resumeFetch;n&&(this._resumeFetch=null,n())},c.prototype._onXHRProgress=function(){var n=this,e=n._xhr,t=null;switch(n._mode){case"text:vbarray":if(e.readyState!==l.DONE)break;try{t=new a.VBArray(e.responseBody).toArray()}catch(n){}if(null!==t){n.push(new r(t));break}case"text":try{t=e.responseText}catch(e){n._mode="text:vbarray";break}if(t.length>n._pos){var i=t.substr(n._pos);if("x-user-defined"===n._charset){for(var s=new r(i.length),o=0;on._pos&&(n.push(new r(new Uint8Array(c.result.slice(n._pos)))),n._pos=c.result.byteLength)},c.onload=function(){n.push(null)},c.readAsArrayBuffer(t)}n._xhr.readyState===l.DONE&&"ms-stream"!==n._mode&&n.push(null)}}).call(this,t(8),t(2).Buffer,t(4))},function(n,e,t){"use strict";(function(e,r){var a=t(41);n.exports=v;var i,s=t(94);v.ReadableState=y;t(65).EventEmitter;var o=function(n,e){return n.listeners(e).length},l=t(105),c=t(1).Buffer,u=e.Uint8Array||function(){};var d=t(33);d.inherits=t(0);var f=t(232),h=void 0;h=f&&f.debuglog?f.debuglog("stream"):function(){};var p,m=t(233),b=t(106);d.inherits(v,l);var g=["error","close","destroy","pause","resume"];function y(n,e){n=n||{};var r=e instanceof(i=i||t(19));this.objectMode=!!n.objectMode,r&&(this.objectMode=this.objectMode||!!n.readableObjectMode);var a=n.highWaterMark,s=n.readableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:r&&(s||0===s)?s:o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,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=n.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,n.encoding&&(p||(p=t(67).StringDecoder),this.decoder=new p(n.encoding),this.encoding=n.encoding)}function v(n){if(i=i||t(19),!(this instanceof v))return new v(n);this._readableState=new y(n,this),this.readable=!0,n&&("function"==typeof n.read&&(this._read=n.read),"function"==typeof n.destroy&&(this._destroy=n.destroy)),l.call(this)}function _(n,e,t,r,a){var i,s=n._readableState;null===e?(s.reading=!1,function(n,e){if(e.ended)return;if(e.decoder){var t=e.decoder.end();t&&t.length&&(e.buffer.push(t),e.length+=e.objectMode?1:t.length)}e.ended=!0,S(n)}(n,s)):(a||(i=function(n,e){var t;r=e,c.isBuffer(r)||r instanceof u||"string"==typeof e||void 0===e||n.objectMode||(t=new TypeError("Invalid non-string/buffer chunk"));var r;return t}(s,e)),i?n.emit("error",i):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===c.prototype||(e=function(n){return c.from(n)}(e)),r?s.endEmitted?n.emit("error",new Error("stream.unshift() after end event")):w(n,s,e,!0):s.ended?n.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!t?(e=s.decoder.write(e),s.objectMode||0!==e.length?w(n,s,e,!1):E(n,s)):w(n,s,e,!1))):r||(s.reading=!1));return function(n){return!n.ended&&(n.needReadable||n.lengthe.highWaterMark&&(e.highWaterMark=function(n){return n>=k?n=k:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}(n)),n<=e.length?n:e.ended?e.length:(e.needReadable=!0,0))}function S(n){var e=n._readableState;e.needReadable=!1,e.emittedReadable||(h("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?a.nextTick(A,n):A(n))}function A(n){h("emit readable"),n.emit("readable"),j(n)}function E(n,e){e.readingMore||(e.readingMore=!0,a.nextTick(T,n,e))}function T(n,e){for(var t=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(t=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):t=function(n,e,t){var r;ni.length?i.length:n;if(s===i.length?a+=i:a+=i.slice(0,n),0===(n-=s)){s===i.length?(++r,t.next?e.head=t.next:e.head=e.tail=null):(e.head=t,t.data=i.slice(s));break}++r}return e.length-=r,a}(n,e):function(n,e){var t=c.allocUnsafe(n),r=e.head,a=1;r.data.copy(t),n-=r.data.length;for(;r=r.next;){var i=r.data,s=n>i.length?i.length:n;if(i.copy(t,t.length-n,0,s),0===(n-=s)){s===i.length?(++a,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=i.slice(s));break}++a}return e.length-=a,t}(n,e);return r}(n,e.buffer,e.decoder),t);var t}function B(n){var e=n._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,a.nextTick(M,e,n))}function M(n,e){n.endEmitted||0!==n.length||(n.endEmitted=!0,e.readable=!1,e.emit("end"))}function N(n,e){for(var t=0,r=n.length;t=e.highWaterMark||e.ended))return h("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?B(this):S(this),null;if(0===(n=x(n,e))&&e.ended)return 0===e.length&&B(this),null;var r,a=e.needReadable;return h("need readable",a),(0===e.length||e.length-n0?R(n,e):null)?(e.needReadable=!0,n=0):e.length-=n,0===e.length&&(e.ended||(e.needReadable=!0),t!==n&&e.ended&&B(this)),null!==r&&this.emit("data",r),r},v.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(n,e){var t=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=n;break;case 1:i.pipes=[i.pipes,n];break;default:i.pipes.push(n)}i.pipesCount+=1,h("pipe count=%d opts=%j",i.pipesCount,e);var l=(!e||!1!==e.end)&&n!==r.stdout&&n!==r.stderr?u:v;function c(e,r){h("onunpipe"),e===t&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),n.removeListener("close",g),n.removeListener("finish",y),n.removeListener("drain",d),n.removeListener("error",b),n.removeListener("unpipe",c),t.removeListener("end",u),t.removeListener("end",v),t.removeListener("data",m),f=!0,!i.awaitDrain||n._writableState&&!n._writableState.needDrain||d())}function u(){h("onend"),n.end()}i.endEmitted?a.nextTick(l):t.once("end",l),n.on("unpipe",c);var d=function(n){return function(){var e=n._readableState;h("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(n,"data")&&(e.flowing=!0,j(n))}}(t);n.on("drain",d);var f=!1;var p=!1;function m(e){h("ondata"),p=!1,!1!==n.write(e)||p||((1===i.pipesCount&&i.pipes===n||i.pipesCount>1&&-1!==N(i.pipes,n))&&!f&&(h("false write response, pause",t._readableState.awaitDrain),t._readableState.awaitDrain++,p=!0),t.pause())}function b(e){h("onerror",e),v(),n.removeListener("error",b),0===o(n,"error")&&n.emit("error",e)}function g(){n.removeListener("finish",y),v()}function y(){h("onfinish"),n.removeListener("close",g),v()}function v(){h("unpipe"),t.unpipe(n)}return t.on("data",m),function(n,e,t){if("function"==typeof n.prependListener)return n.prependListener(e,t);n._events&&n._events[e]?s(n._events[e])?n._events[e].unshift(t):n._events[e]=[t,n._events[e]]:n.on(e,t)}(n,"error",b),n.once("close",g),n.once("finish",y),n.emit("pipe",t),i.flowing||(h("pipe resume"),t.resume()),n},v.prototype.unpipe=function(n){var e=this._readableState,t={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return n&&n!==e.pipes?this:(n||(n=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,n&&n.emit("unpipe",this,t),this);if(!n){var r=e.pipes,a=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i=2?e.slice(2):e;var t=d.decodeParameters(n,e);return 1===t.__length__?t[0]:(delete t.__length__,t)},f.prototype.deploy=function(n,e){if((n=n||{}).arguments=n.arguments||[],!(n=this._getOrSetDefaultOptions(n)).data)return s._fireError(new Error('No "data" specified in neither the given options, nor the default options.'),null,null,e);var t=r.find(this.options.jsonInterface,function(n){return"constructor"===n.type})||{};return t.signature="constructor",this._createTxObject.apply({method:t,parent:this,deployData:n.data,_ethAccounts:this.constructor._ethAccounts},n.arguments)},f.prototype._generateEventOptions=function(){var n=Array.prototype.slice.call(arguments),e=this._getCallback(n),t=r.isObject(n[n.length-1])?n.pop():{},a=r.isString(n[0])?n[0]:"allevents";if(!(a="allevents"===a.toLowerCase()?{name:"ALLEVENTS",jsonInterface:this.options.jsonInterface}:this.options.jsonInterface.find(function(n){return"event"===n.type&&(n.name===a||n.signature==="0x"+a.replace("0x",""))})))throw new Error('Event "'+a.name+"\" doesn't exist in this contract.");if(!s.isAddress(this.options.address))throw new Error("This contract object doesn't have address set yet, please set an address first.");return{params:this._encodeEventABI(a,t),event:a,callback:e}},f.prototype.clone=function(){return new this.constructor(this.options.jsonInterface,this.options.address,this.options)},f.prototype.once=function(n,e,t){var a=Array.prototype.slice.call(arguments);if(!(t=this._getCallback(a)))throw new Error("Once requires a callback as the second parameter.");e&&delete e.fromBlock,this._on(n,e,function(n,e,a){a.unsubscribe(),r.isFunction(t)&&t(n,e,a)})},f.prototype._on=function(){var n=this._generateEventOptions.apply(this,arguments);this._checkListener("newListener",n.event.name,n.callback),this._checkListener("removeListener",n.event.name,n.callback);var e=new o({subscription:{params:1,inputFormatter:[l.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(n.event),subscriptionHandler:function(n){n.removed?this.emit("changed",n):this.emit("data",n),r.isFunction(this.callback)&&this.callback(null,n,this)}},type:"eth",requestManager:this._requestManager});return e.subscribe("logs",n.params,n.callback||function(){}),e},f.prototype.getPastEvents=function(){var n=this._generateEventOptions.apply(this,arguments),e=new i({name:"getPastLogs",call:"eth_getLogs",params:1,inputFormatter:[l.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(n.event)});e.setRequestManager(this._requestManager);var t=e.buildCall();return e=null,t(n.params,n.callback)},f.prototype._createTxObject=function(){var n=Array.prototype.slice.call(arguments),e={};if("function"===this.method.type&&(e.call=this.parent._executeMethod.bind(e,"call"),e.call.request=this.parent._executeMethod.bind(e,"call",!0)),e.send=this.parent._executeMethod.bind(e,"send"),e.send.request=this.parent._executeMethod.bind(e,"send",!0),e.encodeABI=this.parent._encodeMethodABI.bind(e),e.estimateGas=this.parent._executeMethod.bind(e,"estimate"),n&&this.method.inputs&&n.length!==this.method.inputs.length){if(this.nextMethod)return this.nextMethod.apply(null,n);throw c.InvalidNumberOfParams(n.length,this.method.inputs.length,this.method.name)}return e.arguments=n||[],e._method=this.method,e._parent=this.parent,e._ethAccounts=this.parent.constructor._ethAccounts||this._ethAccounts,this.deployData&&(e._deployData=this.deployData),e},f.prototype._processExecuteArguments=function(n,e){var t={};if(t.type=n.shift(),t.callback=this._parent._getCallback(n),"call"===t.type&&!0!==n[n.length-1]&&(r.isString(n[n.length-1])||isFinite(n[n.length-1]))&&(t.defaultBlock=n.pop()),t.options=r.isObject(n[n.length-1])?n.pop():{},t.generateRequest=!0===n[n.length-1]&&n.pop(),t.options=this._parent._getOrSetDefaultOptions(t.options),t.options.data=this.encodeABI(),!this._deployData&&!s.isAddress(this._parent.options.address))throw new Error("This contract object doesn't have address set yet, please set an address first.");return this._deployData||(t.options.to=this._parent.options.address),t.options.data?t:s._fireError(new Error("Couldn't find a matching contract method, or the number of parameters is wrong."),e.eventEmitter,e.reject,t.callback)},f.prototype._executeMethod=function(){var n=this,e=this._parent._processExecuteArguments.call(this,Array.prototype.slice.call(arguments),t),t=u("send"!==e.type),a=n.constructor._ethAccounts||n._ethAccounts;if(e.generateRequest){var o={params:[l.inputCallFormatter.call(this._parent,e.options)],callback:e.callback};return"call"===e.type?(o.params.push(l.inputDefaultBlockNumberFormatter.call(this._parent,e.defaultBlock)),o.method="eth_call",o.format=this._parent._decodeMethodReturn.bind(null,this._method.outputs)):o.method="eth_sendTransaction",o}switch(e.type){case"estimate":return new i({name:"estimateGas",call:"eth_estimateGas",params:1,inputFormatter:[l.inputCallFormatter],outputFormatter:s.hexToNumber,requestManager:n._parent._requestManager,accounts:a,defaultAccount:n._parent.defaultAccount,defaultBlock:n._parent.defaultBlock}).createFunction()(e.options,e.callback);case"call":return new i({name:"call",call:"eth_call",params:2,inputFormatter:[l.inputCallFormatter,l.inputDefaultBlockNumberFormatter],outputFormatter:function(e){return n._parent._decodeMethodReturn(n._method.outputs,e)},requestManager:n._parent._requestManager,accounts:a,defaultAccount:n._parent.defaultAccount,defaultBlock:n._parent.defaultBlock}).createFunction()(e.options,e.defaultBlock,e.callback);case"send":if(!s.isAddress(e.options.from))return s._fireError(new Error('No "from" address specified in neither the given options, nor the default options.'),t.eventEmitter,t.reject,e.callback);if(r.isBoolean(this._method.payable)&&!this._method.payable&&e.options.value&&e.options.value>0)return s._fireError(new Error("Can not send value to non-payable contract method or constructor"),t.eventEmitter,t.reject,e.callback);var c={receiptFormatter:function(e){if(r.isArray(e.logs)){var t=r.map(e.logs,function(e){return n._parent._decodeEventABI.call({name:"ALLEVENTS",jsonInterface:n._parent.options.jsonInterface},e)});e.events={};var a=0;t.forEach(function(n){n.event?e.events[n.event]?Array.isArray(e.events[n.event])?e.events[n.event].push(n):e.events[n.event]=[e.events[n.event],n]:e.events[n.event]=n:(e.events[a]=n,a++)}),delete e.logs}return e},contractDeployFormatter:function(e){var t=n._parent.clone();return t.options.address=e.contractAddress,t}};return new i({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[l.inputTransactionFormatter],requestManager:n._parent._requestManager,accounts:n.constructor._ethAccounts||n._ethAccounts,defaultAccount:n._parent.defaultAccount,defaultBlock:n._parent.defaultBlock,extraFormatters:c}).createFunction()(e.options,e.callback)}},n.exports=f},function(n,e,t){var r=t(5),a=t(10),i=new(0,t(257).AbiCoder)(function(n,e){return!n.match(/^u?int/)||r.isArray(e)||r.isObject(e)&&"BN"===e.constructor.name?e:e.toString()});function s(){}var o=function(){};o.prototype.encodeFunctionSignature=function(n){return r.isObject(n)&&(n=a._jsonInterfaceMethodToString(n)),a.sha3(n).slice(0,10)},o.prototype.encodeEventSignature=function(n){return r.isObject(n)&&(n=a._jsonInterfaceMethodToString(n)),a.sha3(n)},o.prototype.encodeParameter=function(n,e){return this.encodeParameters([n],[e])},o.prototype.encodeParameters=function(n,e){return i.encode(this.mapTypes(n),e)},o.prototype.mapTypes=function(n){var e=this,t=[];return n.forEach(function(n){if(e.isSimplifiedStructFormat(n)){var r=Object.keys(n)[0];t.push(Object.assign(e.mapStructNameAndType(r),{components:e.mapStructToCoderFormat(n[r])}))}else t.push(n)}),t},o.prototype.isSimplifiedStructFormat=function(n){return"object"==typeof n&&void 0===n.components&&void 0===n.name},o.prototype.mapStructNameAndType=function(n){var e="tuple";return n.indexOf("[]")>-1&&(e="tuple[]",n=n.slice(0,-2)),{type:e,name:n}},o.prototype.mapStructToCoderFormat=function(n){var e=this,t=[];return Object.keys(n).forEach(function(r){"object"!=typeof n[r]?t.push({name:r,type:n[r]}):t.push(Object.assign(e.mapStructNameAndType(r),{components:e.mapStructToCoderFormat(n[r])}))}),t},o.prototype.encodeFunctionCall=function(n,e){return this.encodeFunctionSignature(n)+this.encodeParameters(n.inputs,e).replace("0x","")},o.prototype.decodeParameter=function(n,e){return this.decodeParameters([n],e)[0]},o.prototype.decodeParameters=function(n,e){if(!e||"0x"===e||"0X"===e)throw new Error("Returned values aren't valid, did it run Out of Gas?");var t=i.decode(this.mapTypes(n),"0x"+e.replace(/0x/i,"")),a=new s;return a.__length__=0,n.forEach(function(n,e){var i=t[a.__length__];i="0x"===i?null:i,a[e]=i,r.isObject(n)&&n.name&&(a[n.name]=i),a.__length__++}),a},o.prototype.decodeLog=function(n,e,t){var a=this;t=r.isArray(t)?t:[t],e=e||"";var i=[],o=[],l=0;n.forEach(function(n,e){n.indexed?(o[e]=["bool","int","uint","address","fixed","ufixed"].find(function(e){return-1!==n.type.indexOf(e)})?a.decodeParameter(n.type,t[l]):t[l],l++):i[e]=n});var c=e,u=c?this.decodeParameters(i,c):[],d=new s;return d.__length__=0,n.forEach(function(n,e){d[e]="string"===n.type?"":null,void 0!==u[e]&&(d[e]=u[e]),void 0!==o[e]&&(d[e]=o[e]),n.name&&(d[n.name]=d[e]),d.__length__++}),d};var l=new o;n.exports=l},function(n,e,t){(function(e,t){ +var r=t(208),a=t(209),i=t(95);function s(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(n,e){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|n}function p(n,e){if(l.isBuffer(n))return n.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(n)||n instanceof ArrayBuffer))return n.byteLength;"string"!=typeof n&&(n=""+n);var t=n.length;if(0===t)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return F(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t;case"hex":return t>>>1;case"base64":return U(n).length;default:if(r)return F(n).length;e=(""+e).toLowerCase(),r=!0}}function m(n,e,t){var r=n[e];n[e]=n[t],n[t]=r}function b(n,e,t,r,a){if(0===n.length)return-1;if("string"==typeof t?(r=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=a?0:n.length-1),t<0&&(t=n.length+t),t>=n.length){if(a)return-1;t=n.length-1}else if(t<0){if(!a)return-1;t=0}if("string"==typeof e&&(e=l.from(e,r)),l.isBuffer(e))return 0===e.length?-1:g(n,e,t,r,a);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(n,e,t):Uint8Array.prototype.lastIndexOf.call(n,e,t):g(n,[e],t,r,a);throw new TypeError("val must be string, number or Buffer")}function g(n,e,t,r,a){var i,s=1,o=n.length,l=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(n.length<2||e.length<2)return-1;s=2,o/=2,l/=2,t/=2}function c(n,e){return 1===s?n[e]:n.readUInt16BE(e*s)}if(a){var u=-1;for(i=t;io&&(t=o-l),i=t;i>=0;i--){for(var d=!0,f=0;fa&&(r=a):r=a;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var s=0;s>8,a=t%256,i.push(a),i.push(r);return i}(e,n.length-t),n,t,r)}function S(n,e,t){return 0===e&&t===n.length?r.fromByteArray(n):r.fromByteArray(n.slice(e,t))}function A(n,e,t){t=Math.min(n.length,t);for(var r=[],a=e;a239?4:c>223?3:c>191?2:1;if(a+d<=t)switch(d){case 1:c<128&&(u=c);break;case 2:128==(192&(i=n[a+1]))&&(l=(31&c)<<6|63&i)>127&&(u=l);break;case 3:i=n[a+1],s=n[a+2],128==(192&i)&&128==(192&s)&&(l=(15&c)<<12|(63&i)<<6|63&s)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:i=n[a+1],s=n[a+2],o=n[a+3],128==(192&i)&&128==(192&s)&&128==(192&o)&&(l=(15&c)<<18|(63&i)<<12|(63&s)<<6|63&o)>65535&&l<1114112&&(u=l)}null===u?(u=65533,d=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),a+=d}return function(n){var e=n.length;if(e<=E)return String.fromCharCode.apply(String,n);var t="",r=0;for(;rthis.length)return"";if((void 0===t||t>this.length)&&(t=this.length),t<=0)return"";if((t>>>=0)<=(e>>>=0))return"";for(n||(n="utf8");;)switch(n){case"hex":return I(this,e,t);case"utf8":case"utf-8":return A(this,e,t);case"ascii":return T(this,e,t);case"latin1":case"binary":return C(this,e,t);case"base64":return S(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),r=!0}}.apply(this,arguments)},l.prototype.equals=function(n){if(!l.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n||0===l.compare(this,n)},l.prototype.inspect=function(){var n="",t=e.INSPECT_MAX_BYTES;return this.length>0&&(n=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(n+=" ... ")),""},l.prototype.compare=function(n,e,t,r,a){if(!l.isBuffer(n))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===t&&(t=n?n.length:0),void 0===r&&(r=0),void 0===a&&(a=this.length),e<0||t>n.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&e>=t)return 0;if(r>=a)return-1;if(e>=t)return 1;if(this===n)return 0;for(var i=(a>>>=0)-(r>>>=0),s=(t>>>=0)-(e>>>=0),o=Math.min(i,s),c=this.slice(r,a),u=n.slice(e,t),d=0;da)&&(t=a),n.length>0&&(t<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return y(this,n,e,t);case"utf8":case"utf-8":return v(this,n,e,t);case"ascii":return _(this,n,e,t);case"latin1":case"binary":return w(this,n,e,t);case"base64":return k(this,n,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,n,e,t);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function T(n,e,t){var r="";t=Math.min(n.length,t);for(var a=e;ar)&&(t=r);for(var a="",i=e;it)throw new RangeError("Trying to access beyond buffer length")}function B(n,e,t,r,a,i){if(!l.isBuffer(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||en.length)throw new RangeError("Index out of range")}function M(n,e,t,r){e<0&&(e=65535+e+1);for(var a=0,i=Math.min(n.length-t,2);a>>8*(r?a:1-a)}function N(n,e,t,r){e<0&&(e=4294967295+e+1);for(var a=0,i=Math.min(n.length-t,4);a>>8*(r?a:3-a)&255}function P(n,e,t,r,a,i){if(t+r>n.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function O(n,e,t,r,i){return i||P(n,0,t,4),a.write(n,e,t,r,23,4),t+4}function L(n,e,t,r,i){return i||P(n,0,t,8),a.write(n,e,t,r,52,8),t+8}l.prototype.slice=function(n,e){var t,r=this.length;if((n=~~n)<0?(n+=r)<0&&(n=0):n>r&&(n=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e0&&(a*=256);)r+=this[n+--e]*a;return r},l.prototype.readUInt8=function(n,e){return e||R(n,1,this.length),this[n]},l.prototype.readUInt16LE=function(n,e){return e||R(n,2,this.length),this[n]|this[n+1]<<8},l.prototype.readUInt16BE=function(n,e){return e||R(n,2,this.length),this[n]<<8|this[n+1]},l.prototype.readUInt32LE=function(n,e){return e||R(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+16777216*this[n+3]},l.prototype.readUInt32BE=function(n,e){return e||R(n,4,this.length),16777216*this[n]+(this[n+1]<<16|this[n+2]<<8|this[n+3])},l.prototype.readIntLE=function(n,e,t){n|=0,e|=0,t||R(n,e,this.length);for(var r=this[n],a=1,i=0;++i=(a*=128)&&(r-=Math.pow(2,8*e)),r},l.prototype.readIntBE=function(n,e,t){n|=0,e|=0,t||R(n,e,this.length);for(var r=e,a=1,i=this[n+--r];r>0&&(a*=256);)i+=this[n+--r]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*e)),i},l.prototype.readInt8=function(n,e){return e||R(n,1,this.length),128&this[n]?-1*(255-this[n]+1):this[n]},l.prototype.readInt16LE=function(n,e){e||R(n,2,this.length);var t=this[n]|this[n+1]<<8;return 32768&t?4294901760|t:t},l.prototype.readInt16BE=function(n,e){e||R(n,2,this.length);var t=this[n+1]|this[n]<<8;return 32768&t?4294901760|t:t},l.prototype.readInt32LE=function(n,e){return e||R(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},l.prototype.readInt32BE=function(n,e){return e||R(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},l.prototype.readFloatLE=function(n,e){return e||R(n,4,this.length),a.read(this,n,!0,23,4)},l.prototype.readFloatBE=function(n,e){return e||R(n,4,this.length),a.read(this,n,!1,23,4)},l.prototype.readDoubleLE=function(n,e){return e||R(n,8,this.length),a.read(this,n,!0,52,8)},l.prototype.readDoubleBE=function(n,e){return e||R(n,8,this.length),a.read(this,n,!1,52,8)},l.prototype.writeUIntLE=function(n,e,t,r){(n=+n,e|=0,t|=0,r)||B(this,n,e,t,Math.pow(2,8*t)-1,0);var a=1,i=0;for(this[e]=255&n;++i=0&&(i*=256);)this[e+a]=n/i&255;return e+t},l.prototype.writeUInt8=function(n,e,t){return n=+n,e|=0,t||B(this,n,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),this[e]=255&n,e+1},l.prototype.writeUInt16LE=function(n,e,t){return n=+n,e|=0,t||B(this,n,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&n,this[e+1]=n>>>8):M(this,n,e,!0),e+2},l.prototype.writeUInt16BE=function(n,e,t){return n=+n,e|=0,t||B(this,n,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=n>>>8,this[e+1]=255&n):M(this,n,e,!1),e+2},l.prototype.writeUInt32LE=function(n,e,t){return n=+n,e|=0,t||B(this,n,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=n>>>24,this[e+2]=n>>>16,this[e+1]=n>>>8,this[e]=255&n):N(this,n,e,!0),e+4},l.prototype.writeUInt32BE=function(n,e,t){return n=+n,e|=0,t||B(this,n,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=n>>>24,this[e+1]=n>>>16,this[e+2]=n>>>8,this[e+3]=255&n):N(this,n,e,!1),e+4},l.prototype.writeIntLE=function(n,e,t,r){if(n=+n,e|=0,!r){var a=Math.pow(2,8*t-1);B(this,n,e,t,a-1,-a)}var i=0,s=1,o=0;for(this[e]=255&n;++i>0)-o&255;return e+t},l.prototype.writeIntBE=function(n,e,t,r){if(n=+n,e|=0,!r){var a=Math.pow(2,8*t-1);B(this,n,e,t,a-1,-a)}var i=t-1,s=1,o=0;for(this[e+i]=255&n;--i>=0&&(s*=256);)n<0&&0===o&&0!==this[e+i+1]&&(o=1),this[e+i]=(n/s>>0)-o&255;return e+t},l.prototype.writeInt8=function(n,e,t){return n=+n,e|=0,t||B(this,n,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),n<0&&(n=255+n+1),this[e]=255&n,e+1},l.prototype.writeInt16LE=function(n,e,t){return n=+n,e|=0,t||B(this,n,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&n,this[e+1]=n>>>8):M(this,n,e,!0),e+2},l.prototype.writeInt16BE=function(n,e,t){return n=+n,e|=0,t||B(this,n,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=n>>>8,this[e+1]=255&n):M(this,n,e,!1),e+2},l.prototype.writeInt32LE=function(n,e,t){return n=+n,e|=0,t||B(this,n,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&n,this[e+1]=n>>>8,this[e+2]=n>>>16,this[e+3]=n>>>24):N(this,n,e,!0),e+4},l.prototype.writeInt32BE=function(n,e,t){return n=+n,e|=0,t||B(this,n,e,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),l.TYPED_ARRAY_SUPPORT?(this[e]=n>>>24,this[e+1]=n>>>16,this[e+2]=n>>>8,this[e+3]=255&n):N(this,n,e,!1),e+4},l.prototype.writeFloatLE=function(n,e,t){return O(this,n,e,!0,t)},l.prototype.writeFloatBE=function(n,e,t){return O(this,n,e,!1,t)},l.prototype.writeDoubleLE=function(n,e,t){return L(this,n,e,!0,t)},l.prototype.writeDoubleBE=function(n,e,t){return L(this,n,e,!1,t)},l.prototype.copy=function(n,e,t,r){if(t||(t=0),r||0===r||(r=this.length),e>=n.length&&(e=n.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),n.length-e=0;--a)n[a+e]=this[a+t];else if(i<1e3||!l.TYPED_ARRAY_SUPPORT)for(a=0;a>>=0,t=void 0===t?this.length:t>>>0,n||(n=0),"number"==typeof n)for(i=e;i55295&&t<57344){if(!a){if(t>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&i.push(239,191,189);continue}a=t;continue}if(t<56320){(e-=3)>-1&&i.push(239,191,189),a=t;continue}t=65536+(a-55296<<10|t-56320)}else a&&(e-=3)>-1&&i.push(239,191,189);if(a=null,t<128){if((e-=1)<0)break;i.push(t)}else if(t<2048){if((e-=2)<0)break;i.push(t>>6|192,63&t|128)}else if(t<65536){if((e-=3)<0)break;i.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return i}function U(n){return r.toByteArray(function(n){if((n=function(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}(n).replace(D,"")).length<2)return"";for(;n.length%4!=0;)n+="=";return n}(n))}function z(n,e,t,r){for(var a=0;a=e.length||a>=n.length);++a)e[a+t]=n[a];return a}}).call(this,t(4))},function(n,e,t){(function(n){!function(n,e){"use strict";function r(n,e){if(!n)throw new Error(e||"Assertion failed")}function a(n,e){n.super_=e;var t=function(){};t.prototype=e.prototype,n.prototype=new t,n.prototype.constructor=n}function i(n,e,t){if(i.isBN(n))return n;this.negative=0,this.words=null,this.length=0,this.red=null,null!==n&&("le"!==e&&"be"!==e||(t=e,e=10),this._init(n||0,e||10,t||"be"))}var s;"object"==typeof n?n.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{s=t(260).Buffer}catch(n){}function o(n,e,t){for(var r=0,a=Math.min(n.length,t),i=e;i=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return r}function l(n,e,t,r){for(var a=0,i=Math.min(n.length,t),s=e;s=49?o-49+10:o>=17?o-17+10:o}return a}i.isBN=function(n){return n instanceof i||null!==n&&"object"==typeof n&&n.constructor.wordSize===i.wordSize&&Array.isArray(n.words)},i.max=function(n,e){return n.cmp(e)>0?n:e},i.min=function(n,e){return n.cmp(e)<0?n:e},i.prototype._init=function(n,e,t){if("number"==typeof n)return this._initNumber(n,e,t);if("object"==typeof n)return this._initArray(n,e,t);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var a=0;"-"===(n=n.toString().replace(/\s+/g,""))[0]&&a++,16===e?this._parseHex(n,a):this._parseBase(n,e,a),"-"===n[0]&&(this.negative=1),this.strip(),"le"===t&&this._initArray(this.toArray(),e,t)},i.prototype._initNumber=function(n,e,t){n<0&&(this.negative=1,n=-n),n<67108864?(this.words=[67108863&n],this.length=1):n<4503599627370496?(this.words=[67108863&n,n/67108864&67108863],this.length=2):(r(n<9007199254740992),this.words=[67108863&n,n/67108864&67108863,1],this.length=3),"le"===t&&this._initArray(this.toArray(),e,t)},i.prototype._initArray=function(n,e,t){if(r("number"==typeof n.length),n.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(n.length/3),this.words=new Array(this.length);for(var a=0;a=0;a-=3)s=n[a]|n[a-1]<<8|n[a-2]<<16,this.words[i]|=s<>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);else if("le"===t)for(a=0,i=0;a>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);return this.strip()},i.prototype._parseHex=function(n,e){this.length=Math.ceil((n.length-e)/6),this.words=new Array(this.length);for(var t=0;t=e;t-=6)a=o(n,t,t+6),this.words[r]|=a<>>26-i&4194303,(i+=24)>=26&&(i-=26,r++);t+6!==e&&(a=o(n,e,t+6),this.words[r]|=a<>>26-i&4194303),this.strip()},i.prototype._parseBase=function(n,e,t){this.words=[0],this.length=1;for(var r=0,a=1;a<=67108863;a*=e)r++;r--,a=a/e|0;for(var i=n.length-t,s=i%r,o=Math.min(i,i-s)+t,c=0,u=t;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var c=["","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"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(n,e,t){t.negative=e.negative^n.negative;var r=n.length+e.length|0;t.length=r,r=r-1|0;var a=0|n.words[0],i=0|e.words[0],s=a*i,o=67108863&s,l=s/67108864|0;t.words[0]=o;for(var c=1;c>>26,d=67108863&l,f=Math.min(c,e.length-1),h=Math.max(0,c-n.length+1);h<=f;h++){var p=c-h|0;u+=(s=(a=0|n.words[p])*(i=0|e.words[h])+d)/67108864|0,d=67108863&s}t.words[c]=0|d,l=0|u}return 0!==l?t.words[c]=0|l:t.length--,t.strip()}i.prototype.toString=function(n,e){var t;if(e=0|e||1,16===(n=n||10)||"hex"===n){t="";for(var a=0,i=0,s=0;s>>24-a&16777215)||s!==this.length-1?c[6-l.length]+l+t:l+t,(a+=2)>=26&&(a-=26,s--)}for(0!==i&&(t=i.toString(16)+t);t.length%e!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(n===(0|n)&&n>=2&&n<=36){var f=u[n],h=d[n];t="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(h).toString(n);t=(p=p.idivn(h)).isZero()?m+t:c[f-m.length]+m+t}for(this.isZero()&&(t="0"+t);t.length%e!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var n=this.words[0];return 2===this.length?n+=67108864*this.words[1]:3===this.length&&1===this.words[2]?n+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-n:n},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(n,e){return r(void 0!==s),this.toArrayLike(s,n,e)},i.prototype.toArray=function(n,e){return this.toArrayLike(Array,n,e)},i.prototype.toArrayLike=function(n,e,t){var a=this.byteLength(),i=t||Math.max(1,a);r(a<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var s,o,l="le"===e,c=new n(i),u=this.clone();if(l){for(o=0;!u.isZero();o++)s=u.andln(255),u.iushrn(8),c[o]=s;for(;o=4096&&(t+=13,e>>>=13),e>=64&&(t+=7,e>>>=7),e>=8&&(t+=4,e>>>=4),e>=2&&(t+=2,e>>>=2),t+e},i.prototype._zeroBits=function(n){if(0===n)return 26;var e=n,t=0;return 0==(8191&e)&&(t+=13,e>>>=13),0==(127&e)&&(t+=7,e>>>=7),0==(15&e)&&(t+=4,e>>>=4),0==(3&e)&&(t+=2,e>>>=2),0==(1&e)&&t++,t},i.prototype.bitLength=function(){var n=this.words[this.length-1],e=this._countBits(n);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var n=0,e=0;en.length?this.clone().ior(n):n.clone().ior(this)},i.prototype.uor=function(n){return this.length>n.length?this.clone().iuor(n):n.clone().iuor(this)},i.prototype.iuand=function(n){var e;e=this.length>n.length?n:this;for(var t=0;tn.length?this.clone().iand(n):n.clone().iand(this)},i.prototype.uand=function(n){return this.length>n.length?this.clone().iuand(n):n.clone().iuand(this)},i.prototype.iuxor=function(n){var e,t;this.length>n.length?(e=this,t=n):(e=n,t=this);for(var r=0;rn.length?this.clone().ixor(n):n.clone().ixor(this)},i.prototype.uxor=function(n){return this.length>n.length?this.clone().iuxor(n):n.clone().iuxor(this)},i.prototype.inotn=function(n){r("number"==typeof n&&n>=0);var e=0|Math.ceil(n/26),t=n%26;this._expand(e),t>0&&e--;for(var a=0;a0&&(this.words[a]=~this.words[a]&67108863>>26-t),this.strip()},i.prototype.notn=function(n){return this.clone().inotn(n)},i.prototype.setn=function(n,e){r("number"==typeof n&&n>=0);var t=n/26|0,a=n%26;return this._expand(t+1),this.words[t]=e?this.words[t]|1<n.length?(t=this,r=n):(t=n,r=this);for(var a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=t.length,0!==a)this.words[this.length]=a,this.length++;else if(t!==this)for(;in.length?this.clone().iadd(n):n.clone().iadd(this)},i.prototype.isub=function(n){if(0!==n.negative){n.negative=0;var e=this.iadd(n);return n.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(n),this.negative=1,this._normSign();var t,r,a=this.cmp(n);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(t=this,r=n):(t=n,r=this);for(var i=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==i&&s>26,this.words[s]=67108863&e;if(0===i&&s>>13,h=0|s[1],p=8191&h,m=h>>>13,b=0|s[2],g=8191&b,y=b>>>13,v=0|s[3],_=8191&v,w=v>>>13,k=0|s[4],x=8191&k,S=k>>>13,A=0|s[5],E=8191&A,T=A>>>13,C=0|s[6],I=8191&C,j=C>>>13,R=0|s[7],B=8191&R,M=R>>>13,N=0|s[8],P=8191&N,O=N>>>13,L=0|s[9],D=8191&L,q=L>>>13,F=0|o[0],U=8191&F,z=F>>>13,K=0|o[1],H=8191&K,G=K>>>13,V=0|o[2],W=8191&V,Y=V>>>13,X=0|o[3],J=8191&X,Z=X>>>13,$=0|o[4],Q=8191&$,nn=$>>>13,en=0|o[5],tn=8191&en,rn=en>>>13,an=0|o[6],sn=8191&an,on=an>>>13,ln=0|o[7],cn=8191&ln,un=ln>>>13,dn=0|o[8],fn=8191&dn,hn=dn>>>13,pn=0|o[9],mn=8191&pn,bn=pn>>>13;t.negative=n.negative^e.negative,t.length=19;var gn=(c+(r=Math.imul(d,U))|0)+((8191&(a=(a=Math.imul(d,z))+Math.imul(f,U)|0))<<13)|0;c=((i=Math.imul(f,z))+(a>>>13)|0)+(gn>>>26)|0,gn&=67108863,r=Math.imul(p,U),a=(a=Math.imul(p,z))+Math.imul(m,U)|0,i=Math.imul(m,z);var yn=(c+(r=r+Math.imul(d,H)|0)|0)+((8191&(a=(a=a+Math.imul(d,G)|0)+Math.imul(f,H)|0))<<13)|0;c=((i=i+Math.imul(f,G)|0)+(a>>>13)|0)+(yn>>>26)|0,yn&=67108863,r=Math.imul(g,U),a=(a=Math.imul(g,z))+Math.imul(y,U)|0,i=Math.imul(y,z),r=r+Math.imul(p,H)|0,a=(a=a+Math.imul(p,G)|0)+Math.imul(m,H)|0,i=i+Math.imul(m,G)|0;var vn=(c+(r=r+Math.imul(d,W)|0)|0)+((8191&(a=(a=a+Math.imul(d,Y)|0)+Math.imul(f,W)|0))<<13)|0;c=((i=i+Math.imul(f,Y)|0)+(a>>>13)|0)+(vn>>>26)|0,vn&=67108863,r=Math.imul(_,U),a=(a=Math.imul(_,z))+Math.imul(w,U)|0,i=Math.imul(w,z),r=r+Math.imul(g,H)|0,a=(a=a+Math.imul(g,G)|0)+Math.imul(y,H)|0,i=i+Math.imul(y,G)|0,r=r+Math.imul(p,W)|0,a=(a=a+Math.imul(p,Y)|0)+Math.imul(m,W)|0,i=i+Math.imul(m,Y)|0;var _n=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(a=(a=a+Math.imul(d,Z)|0)+Math.imul(f,J)|0))<<13)|0;c=((i=i+Math.imul(f,Z)|0)+(a>>>13)|0)+(_n>>>26)|0,_n&=67108863,r=Math.imul(x,U),a=(a=Math.imul(x,z))+Math.imul(S,U)|0,i=Math.imul(S,z),r=r+Math.imul(_,H)|0,a=(a=a+Math.imul(_,G)|0)+Math.imul(w,H)|0,i=i+Math.imul(w,G)|0,r=r+Math.imul(g,W)|0,a=(a=a+Math.imul(g,Y)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,Y)|0,r=r+Math.imul(p,J)|0,a=(a=a+Math.imul(p,Z)|0)+Math.imul(m,J)|0,i=i+Math.imul(m,Z)|0;var wn=(c+(r=r+Math.imul(d,Q)|0)|0)+((8191&(a=(a=a+Math.imul(d,nn)|0)+Math.imul(f,Q)|0))<<13)|0;c=((i=i+Math.imul(f,nn)|0)+(a>>>13)|0)+(wn>>>26)|0,wn&=67108863,r=Math.imul(E,U),a=(a=Math.imul(E,z))+Math.imul(T,U)|0,i=Math.imul(T,z),r=r+Math.imul(x,H)|0,a=(a=a+Math.imul(x,G)|0)+Math.imul(S,H)|0,i=i+Math.imul(S,G)|0,r=r+Math.imul(_,W)|0,a=(a=a+Math.imul(_,Y)|0)+Math.imul(w,W)|0,i=i+Math.imul(w,Y)|0,r=r+Math.imul(g,J)|0,a=(a=a+Math.imul(g,Z)|0)+Math.imul(y,J)|0,i=i+Math.imul(y,Z)|0,r=r+Math.imul(p,Q)|0,a=(a=a+Math.imul(p,nn)|0)+Math.imul(m,Q)|0,i=i+Math.imul(m,nn)|0;var kn=(c+(r=r+Math.imul(d,tn)|0)|0)+((8191&(a=(a=a+Math.imul(d,rn)|0)+Math.imul(f,tn)|0))<<13)|0;c=((i=i+Math.imul(f,rn)|0)+(a>>>13)|0)+(kn>>>26)|0,kn&=67108863,r=Math.imul(I,U),a=(a=Math.imul(I,z))+Math.imul(j,U)|0,i=Math.imul(j,z),r=r+Math.imul(E,H)|0,a=(a=a+Math.imul(E,G)|0)+Math.imul(T,H)|0,i=i+Math.imul(T,G)|0,r=r+Math.imul(x,W)|0,a=(a=a+Math.imul(x,Y)|0)+Math.imul(S,W)|0,i=i+Math.imul(S,Y)|0,r=r+Math.imul(_,J)|0,a=(a=a+Math.imul(_,Z)|0)+Math.imul(w,J)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(g,Q)|0,a=(a=a+Math.imul(g,nn)|0)+Math.imul(y,Q)|0,i=i+Math.imul(y,nn)|0,r=r+Math.imul(p,tn)|0,a=(a=a+Math.imul(p,rn)|0)+Math.imul(m,tn)|0,i=i+Math.imul(m,rn)|0;var xn=(c+(r=r+Math.imul(d,sn)|0)|0)+((8191&(a=(a=a+Math.imul(d,on)|0)+Math.imul(f,sn)|0))<<13)|0;c=((i=i+Math.imul(f,on)|0)+(a>>>13)|0)+(xn>>>26)|0,xn&=67108863,r=Math.imul(B,U),a=(a=Math.imul(B,z))+Math.imul(M,U)|0,i=Math.imul(M,z),r=r+Math.imul(I,H)|0,a=(a=a+Math.imul(I,G)|0)+Math.imul(j,H)|0,i=i+Math.imul(j,G)|0,r=r+Math.imul(E,W)|0,a=(a=a+Math.imul(E,Y)|0)+Math.imul(T,W)|0,i=i+Math.imul(T,Y)|0,r=r+Math.imul(x,J)|0,a=(a=a+Math.imul(x,Z)|0)+Math.imul(S,J)|0,i=i+Math.imul(S,Z)|0,r=r+Math.imul(_,Q)|0,a=(a=a+Math.imul(_,nn)|0)+Math.imul(w,Q)|0,i=i+Math.imul(w,nn)|0,r=r+Math.imul(g,tn)|0,a=(a=a+Math.imul(g,rn)|0)+Math.imul(y,tn)|0,i=i+Math.imul(y,rn)|0,r=r+Math.imul(p,sn)|0,a=(a=a+Math.imul(p,on)|0)+Math.imul(m,sn)|0,i=i+Math.imul(m,on)|0;var Sn=(c+(r=r+Math.imul(d,cn)|0)|0)+((8191&(a=(a=a+Math.imul(d,un)|0)+Math.imul(f,cn)|0))<<13)|0;c=((i=i+Math.imul(f,un)|0)+(a>>>13)|0)+(Sn>>>26)|0,Sn&=67108863,r=Math.imul(P,U),a=(a=Math.imul(P,z))+Math.imul(O,U)|0,i=Math.imul(O,z),r=r+Math.imul(B,H)|0,a=(a=a+Math.imul(B,G)|0)+Math.imul(M,H)|0,i=i+Math.imul(M,G)|0,r=r+Math.imul(I,W)|0,a=(a=a+Math.imul(I,Y)|0)+Math.imul(j,W)|0,i=i+Math.imul(j,Y)|0,r=r+Math.imul(E,J)|0,a=(a=a+Math.imul(E,Z)|0)+Math.imul(T,J)|0,i=i+Math.imul(T,Z)|0,r=r+Math.imul(x,Q)|0,a=(a=a+Math.imul(x,nn)|0)+Math.imul(S,Q)|0,i=i+Math.imul(S,nn)|0,r=r+Math.imul(_,tn)|0,a=(a=a+Math.imul(_,rn)|0)+Math.imul(w,tn)|0,i=i+Math.imul(w,rn)|0,r=r+Math.imul(g,sn)|0,a=(a=a+Math.imul(g,on)|0)+Math.imul(y,sn)|0,i=i+Math.imul(y,on)|0,r=r+Math.imul(p,cn)|0,a=(a=a+Math.imul(p,un)|0)+Math.imul(m,cn)|0,i=i+Math.imul(m,un)|0;var An=(c+(r=r+Math.imul(d,fn)|0)|0)+((8191&(a=(a=a+Math.imul(d,hn)|0)+Math.imul(f,fn)|0))<<13)|0;c=((i=i+Math.imul(f,hn)|0)+(a>>>13)|0)+(An>>>26)|0,An&=67108863,r=Math.imul(D,U),a=(a=Math.imul(D,z))+Math.imul(q,U)|0,i=Math.imul(q,z),r=r+Math.imul(P,H)|0,a=(a=a+Math.imul(P,G)|0)+Math.imul(O,H)|0,i=i+Math.imul(O,G)|0,r=r+Math.imul(B,W)|0,a=(a=a+Math.imul(B,Y)|0)+Math.imul(M,W)|0,i=i+Math.imul(M,Y)|0,r=r+Math.imul(I,J)|0,a=(a=a+Math.imul(I,Z)|0)+Math.imul(j,J)|0,i=i+Math.imul(j,Z)|0,r=r+Math.imul(E,Q)|0,a=(a=a+Math.imul(E,nn)|0)+Math.imul(T,Q)|0,i=i+Math.imul(T,nn)|0,r=r+Math.imul(x,tn)|0,a=(a=a+Math.imul(x,rn)|0)+Math.imul(S,tn)|0,i=i+Math.imul(S,rn)|0,r=r+Math.imul(_,sn)|0,a=(a=a+Math.imul(_,on)|0)+Math.imul(w,sn)|0,i=i+Math.imul(w,on)|0,r=r+Math.imul(g,cn)|0,a=(a=a+Math.imul(g,un)|0)+Math.imul(y,cn)|0,i=i+Math.imul(y,un)|0,r=r+Math.imul(p,fn)|0,a=(a=a+Math.imul(p,hn)|0)+Math.imul(m,fn)|0,i=i+Math.imul(m,hn)|0;var En=(c+(r=r+Math.imul(d,mn)|0)|0)+((8191&(a=(a=a+Math.imul(d,bn)|0)+Math.imul(f,mn)|0))<<13)|0;c=((i=i+Math.imul(f,bn)|0)+(a>>>13)|0)+(En>>>26)|0,En&=67108863,r=Math.imul(D,H),a=(a=Math.imul(D,G))+Math.imul(q,H)|0,i=Math.imul(q,G),r=r+Math.imul(P,W)|0,a=(a=a+Math.imul(P,Y)|0)+Math.imul(O,W)|0,i=i+Math.imul(O,Y)|0,r=r+Math.imul(B,J)|0,a=(a=a+Math.imul(B,Z)|0)+Math.imul(M,J)|0,i=i+Math.imul(M,Z)|0,r=r+Math.imul(I,Q)|0,a=(a=a+Math.imul(I,nn)|0)+Math.imul(j,Q)|0,i=i+Math.imul(j,nn)|0,r=r+Math.imul(E,tn)|0,a=(a=a+Math.imul(E,rn)|0)+Math.imul(T,tn)|0,i=i+Math.imul(T,rn)|0,r=r+Math.imul(x,sn)|0,a=(a=a+Math.imul(x,on)|0)+Math.imul(S,sn)|0,i=i+Math.imul(S,on)|0,r=r+Math.imul(_,cn)|0,a=(a=a+Math.imul(_,un)|0)+Math.imul(w,cn)|0,i=i+Math.imul(w,un)|0,r=r+Math.imul(g,fn)|0,a=(a=a+Math.imul(g,hn)|0)+Math.imul(y,fn)|0,i=i+Math.imul(y,hn)|0;var Tn=(c+(r=r+Math.imul(p,mn)|0)|0)+((8191&(a=(a=a+Math.imul(p,bn)|0)+Math.imul(m,mn)|0))<<13)|0;c=((i=i+Math.imul(m,bn)|0)+(a>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,r=Math.imul(D,W),a=(a=Math.imul(D,Y))+Math.imul(q,W)|0,i=Math.imul(q,Y),r=r+Math.imul(P,J)|0,a=(a=a+Math.imul(P,Z)|0)+Math.imul(O,J)|0,i=i+Math.imul(O,Z)|0,r=r+Math.imul(B,Q)|0,a=(a=a+Math.imul(B,nn)|0)+Math.imul(M,Q)|0,i=i+Math.imul(M,nn)|0,r=r+Math.imul(I,tn)|0,a=(a=a+Math.imul(I,rn)|0)+Math.imul(j,tn)|0,i=i+Math.imul(j,rn)|0,r=r+Math.imul(E,sn)|0,a=(a=a+Math.imul(E,on)|0)+Math.imul(T,sn)|0,i=i+Math.imul(T,on)|0,r=r+Math.imul(x,cn)|0,a=(a=a+Math.imul(x,un)|0)+Math.imul(S,cn)|0,i=i+Math.imul(S,un)|0,r=r+Math.imul(_,fn)|0,a=(a=a+Math.imul(_,hn)|0)+Math.imul(w,fn)|0,i=i+Math.imul(w,hn)|0;var Cn=(c+(r=r+Math.imul(g,mn)|0)|0)+((8191&(a=(a=a+Math.imul(g,bn)|0)+Math.imul(y,mn)|0))<<13)|0;c=((i=i+Math.imul(y,bn)|0)+(a>>>13)|0)+(Cn>>>26)|0,Cn&=67108863,r=Math.imul(D,J),a=(a=Math.imul(D,Z))+Math.imul(q,J)|0,i=Math.imul(q,Z),r=r+Math.imul(P,Q)|0,a=(a=a+Math.imul(P,nn)|0)+Math.imul(O,Q)|0,i=i+Math.imul(O,nn)|0,r=r+Math.imul(B,tn)|0,a=(a=a+Math.imul(B,rn)|0)+Math.imul(M,tn)|0,i=i+Math.imul(M,rn)|0,r=r+Math.imul(I,sn)|0,a=(a=a+Math.imul(I,on)|0)+Math.imul(j,sn)|0,i=i+Math.imul(j,on)|0,r=r+Math.imul(E,cn)|0,a=(a=a+Math.imul(E,un)|0)+Math.imul(T,cn)|0,i=i+Math.imul(T,un)|0,r=r+Math.imul(x,fn)|0,a=(a=a+Math.imul(x,hn)|0)+Math.imul(S,fn)|0,i=i+Math.imul(S,hn)|0;var In=(c+(r=r+Math.imul(_,mn)|0)|0)+((8191&(a=(a=a+Math.imul(_,bn)|0)+Math.imul(w,mn)|0))<<13)|0;c=((i=i+Math.imul(w,bn)|0)+(a>>>13)|0)+(In>>>26)|0,In&=67108863,r=Math.imul(D,Q),a=(a=Math.imul(D,nn))+Math.imul(q,Q)|0,i=Math.imul(q,nn),r=r+Math.imul(P,tn)|0,a=(a=a+Math.imul(P,rn)|0)+Math.imul(O,tn)|0,i=i+Math.imul(O,rn)|0,r=r+Math.imul(B,sn)|0,a=(a=a+Math.imul(B,on)|0)+Math.imul(M,sn)|0,i=i+Math.imul(M,on)|0,r=r+Math.imul(I,cn)|0,a=(a=a+Math.imul(I,un)|0)+Math.imul(j,cn)|0,i=i+Math.imul(j,un)|0,r=r+Math.imul(E,fn)|0,a=(a=a+Math.imul(E,hn)|0)+Math.imul(T,fn)|0,i=i+Math.imul(T,hn)|0;var jn=(c+(r=r+Math.imul(x,mn)|0)|0)+((8191&(a=(a=a+Math.imul(x,bn)|0)+Math.imul(S,mn)|0))<<13)|0;c=((i=i+Math.imul(S,bn)|0)+(a>>>13)|0)+(jn>>>26)|0,jn&=67108863,r=Math.imul(D,tn),a=(a=Math.imul(D,rn))+Math.imul(q,tn)|0,i=Math.imul(q,rn),r=r+Math.imul(P,sn)|0,a=(a=a+Math.imul(P,on)|0)+Math.imul(O,sn)|0,i=i+Math.imul(O,on)|0,r=r+Math.imul(B,cn)|0,a=(a=a+Math.imul(B,un)|0)+Math.imul(M,cn)|0,i=i+Math.imul(M,un)|0,r=r+Math.imul(I,fn)|0,a=(a=a+Math.imul(I,hn)|0)+Math.imul(j,fn)|0,i=i+Math.imul(j,hn)|0;var Rn=(c+(r=r+Math.imul(E,mn)|0)|0)+((8191&(a=(a=a+Math.imul(E,bn)|0)+Math.imul(T,mn)|0))<<13)|0;c=((i=i+Math.imul(T,bn)|0)+(a>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,r=Math.imul(D,sn),a=(a=Math.imul(D,on))+Math.imul(q,sn)|0,i=Math.imul(q,on),r=r+Math.imul(P,cn)|0,a=(a=a+Math.imul(P,un)|0)+Math.imul(O,cn)|0,i=i+Math.imul(O,un)|0,r=r+Math.imul(B,fn)|0,a=(a=a+Math.imul(B,hn)|0)+Math.imul(M,fn)|0,i=i+Math.imul(M,hn)|0;var Bn=(c+(r=r+Math.imul(I,mn)|0)|0)+((8191&(a=(a=a+Math.imul(I,bn)|0)+Math.imul(j,mn)|0))<<13)|0;c=((i=i+Math.imul(j,bn)|0)+(a>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,r=Math.imul(D,cn),a=(a=Math.imul(D,un))+Math.imul(q,cn)|0,i=Math.imul(q,un),r=r+Math.imul(P,fn)|0,a=(a=a+Math.imul(P,hn)|0)+Math.imul(O,fn)|0,i=i+Math.imul(O,hn)|0;var Mn=(c+(r=r+Math.imul(B,mn)|0)|0)+((8191&(a=(a=a+Math.imul(B,bn)|0)+Math.imul(M,mn)|0))<<13)|0;c=((i=i+Math.imul(M,bn)|0)+(a>>>13)|0)+(Mn>>>26)|0,Mn&=67108863,r=Math.imul(D,fn),a=(a=Math.imul(D,hn))+Math.imul(q,fn)|0,i=Math.imul(q,hn);var Nn=(c+(r=r+Math.imul(P,mn)|0)|0)+((8191&(a=(a=a+Math.imul(P,bn)|0)+Math.imul(O,mn)|0))<<13)|0;c=((i=i+Math.imul(O,bn)|0)+(a>>>13)|0)+(Nn>>>26)|0,Nn&=67108863;var Pn=(c+(r=Math.imul(D,mn))|0)+((8191&(a=(a=Math.imul(D,bn))+Math.imul(q,mn)|0))<<13)|0;return c=((i=Math.imul(q,bn))+(a>>>13)|0)+(Pn>>>26)|0,Pn&=67108863,l[0]=gn,l[1]=yn,l[2]=vn,l[3]=_n,l[4]=wn,l[5]=kn,l[6]=xn,l[7]=Sn,l[8]=An,l[9]=En,l[10]=Tn,l[11]=Cn,l[12]=In,l[13]=jn,l[14]=Rn,l[15]=Bn,l[16]=Mn,l[17]=Nn,l[18]=Pn,0!==c&&(l[19]=c,t.length++),t};function p(n,e,t){return(new m).mulp(n,e,t)}function m(n,e){this.x=n,this.y=e}Math.imul||(h=f),i.prototype.mulTo=function(n,e){var t=this.length+n.length;return 10===this.length&&10===n.length?h(this,n,e):t<63?f(this,n,e):t<1024?function(n,e,t){t.negative=e.negative^n.negative,t.length=n.length+e.length;for(var r=0,a=0,i=0;i>>26)|0)>>>26,s&=67108863}t.words[i]=o,r=s,s=a}return 0!==r?t.words[i]=r:t.length--,t.strip()}(this,n,e):p(this,n,e)},m.prototype.makeRBT=function(n){for(var e=new Array(n),t=i.prototype._countBits(n)-1,r=0;r>=1;return r},m.prototype.permute=function(n,e,t,r,a,i){for(var s=0;s>>=1)a++;return 1<>>=13,t[2*s+1]=8191&i,i>>>=13;for(s=2*e;s>=26,e+=a/67108864|0,e+=i>>>26,this.words[t]=67108863&i}return 0!==e&&(this.words[t]=e,this.length++),this},i.prototype.muln=function(n){return this.clone().imuln(n)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(n){var e=function(n){for(var e=new Array(n.bitLength()),t=0;t>>a}return e}(n);if(0===e.length)return new i(1);for(var t=this,r=0;r=0);var e,t=n%26,a=(n-t)/26,i=67108863>>>26-t<<26-t;if(0!==t){var s=0;for(e=0;e>>26-t}s&&(this.words[e]=s,this.length++)}if(0!==a){for(e=this.length-1;e>=0;e--)this.words[e+a]=this.words[e];for(e=0;e=0),a=e?(e-e%26)/26:0;var i=n%26,s=Math.min((n-i)/26,this.length),o=67108863^67108863>>>i<s)for(this.length-=s,c=0;c=0&&(0!==u||c>=a);c--){var d=0|this.words[c];this.words[c]=u<<26-i|d>>>i,u=d&o}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(n,e,t){return r(0===this.negative),this.iushrn(n,e,t)},i.prototype.shln=function(n){return this.clone().ishln(n)},i.prototype.ushln=function(n){return this.clone().iushln(n)},i.prototype.shrn=function(n){return this.clone().ishrn(n)},i.prototype.ushrn=function(n){return this.clone().iushrn(n)},i.prototype.testn=function(n){r("number"==typeof n&&n>=0);var e=n%26,t=(n-e)/26,a=1<=0);var e=n%26,t=(n-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==e&&t++,this.length=Math.min(t,this.length),0!==e){var a=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},i.prototype.isubn=function(n){if(r("number"==typeof n),r(n<67108864),n<0)return this.iaddn(-n);if(0!==this.negative)return this.negative=0,this.iaddn(n),this.negative=1,this;if(this.words[0]-=n,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[a+t]=67108863&i}for(;a>26,this.words[a+t]=67108863&i;if(0===o)return this.strip();for(r(-1===o),o=0,a=0;a>26,this.words[a]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(n,e){var t=(this.length,n.length),r=this.clone(),a=n,s=0|a.words[a.length-1];0!==(t=26-this._countBits(s))&&(a=a.ushln(t),r.iushln(t),s=0|a.words[a.length-1]);var o,l=r.length-a.length;if("mod"!==e){(o=new i(null)).length=l+1,o.words=new Array(o.length);for(var c=0;c=0;d--){var f=67108864*(0|r.words[a.length+d])+(0|r.words[a.length+d-1]);for(f=Math.min(f/s|0,67108863),r._ishlnsubmul(a,f,d);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(a,1,d),r.isZero()||(r.negative^=1);o&&(o.words[d]=f)}return o&&o.strip(),r.strip(),"div"!==e&&0!==t&&r.iushrn(t),{div:o||null,mod:r}},i.prototype.divmod=function(n,e,t){return r(!n.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===n.negative?(o=this.neg().divmod(n,e),"mod"!==e&&(a=o.div.neg()),"div"!==e&&(s=o.mod.neg(),t&&0!==s.negative&&s.iadd(n)),{div:a,mod:s}):0===this.negative&&0!==n.negative?(o=this.divmod(n.neg(),e),"mod"!==e&&(a=o.div.neg()),{div:a,mod:o.mod}):0!=(this.negative&n.negative)?(o=this.neg().divmod(n.neg(),e),"div"!==e&&(s=o.mod.neg(),t&&0!==s.negative&&s.isub(n)),{div:o.div,mod:s}):n.length>this.length||this.cmp(n)<0?{div:new i(0),mod:this}:1===n.length?"div"===e?{div:this.divn(n.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(n.words[0]))}:{div:this.divn(n.words[0]),mod:new i(this.modn(n.words[0]))}:this._wordDiv(n,e);var a,s,o},i.prototype.div=function(n){return this.divmod(n,"div",!1).div},i.prototype.mod=function(n){return this.divmod(n,"mod",!1).mod},i.prototype.umod=function(n){return this.divmod(n,"mod",!0).mod},i.prototype.divRound=function(n){var e=this.divmod(n);if(e.mod.isZero())return e.div;var t=0!==e.div.negative?e.mod.isub(n):e.mod,r=n.ushrn(1),a=n.andln(1),i=t.cmp(r);return i<0||1===a&&0===i?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(n){r(n<=67108863);for(var e=(1<<26)%n,t=0,a=this.length-1;a>=0;a--)t=(e*t+(0|this.words[a]))%n;return t},i.prototype.idivn=function(n){r(n<=67108863);for(var e=0,t=this.length-1;t>=0;t--){var a=(0|this.words[t])+67108864*e;this.words[t]=a/n|0,e=a%n}return this.strip()},i.prototype.divn=function(n){return this.clone().idivn(n)},i.prototype.egcd=function(n){r(0===n.negative),r(!n.isZero());var e=this,t=n.clone();e=0!==e.negative?e.umod(n):e.clone();for(var a=new i(1),s=new i(0),o=new i(0),l=new i(1),c=0;e.isEven()&&t.isEven();)e.iushrn(1),t.iushrn(1),++c;for(var u=t.clone(),d=e.clone();!e.isZero();){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()||s.isOdd())&&(a.iadd(u),s.isub(d)),a.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(t.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(t.iushrn(p);p-- >0;)(o.isOdd()||l.isOdd())&&(o.iadd(u),l.isub(d)),o.iushrn(1),l.iushrn(1);e.cmp(t)>=0?(e.isub(t),a.isub(o),s.isub(l)):(t.isub(e),o.isub(a),l.isub(s))}return{a:o,b:l,gcd:t.iushln(c)}},i.prototype._invmp=function(n){r(0===n.negative),r(!n.isZero());var e=this,t=n.clone();e=0!==e.negative?e.umod(n):e.clone();for(var a,s=new i(1),o=new i(0),l=t.clone();e.cmpn(1)>0&&t.cmpn(1)>0;){for(var c=0,u=1;0==(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);for(var d=0,f=1;0==(t.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(t.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);e.cmp(t)>=0?(e.isub(t),s.isub(o)):(t.isub(e),o.isub(s))}return(a=0===e.cmpn(1)?s:o).cmpn(0)<0&&a.iadd(n),a},i.prototype.gcd=function(n){if(this.isZero())return n.abs();if(n.isZero())return this.abs();var e=this.clone(),t=n.clone();e.negative=0,t.negative=0;for(var r=0;e.isEven()&&t.isEven();r++)e.iushrn(1),t.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;t.isEven();)t.iushrn(1);var a=e.cmp(t);if(a<0){var i=e;e=t,t=i}else if(0===a||0===t.cmpn(1))break;e.isub(t)}return t.iushln(r)},i.prototype.invm=function(n){return this.egcd(n).a.umod(n)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(n){return this.words[0]&n},i.prototype.bincn=function(n){r("number"==typeof n);var e=n%26,t=(n-e)/26,a=1<>>26,o&=67108863,this.words[s]=o}return 0!==i&&(this.words[s]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(n){var e,t=n<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)e=1;else{t&&(n=-n),r(n<=67108863,"Number is too big");var a=0|this.words[0];e=a===n?0:an.length)return 1;if(this.length=0;t--){var r=0|this.words[t],a=0|n.words[t];if(r!==a){ra&&(e=1);break}}return e},i.prototype.gtn=function(n){return 1===this.cmpn(n)},i.prototype.gt=function(n){return 1===this.cmp(n)},i.prototype.gten=function(n){return this.cmpn(n)>=0},i.prototype.gte=function(n){return this.cmp(n)>=0},i.prototype.ltn=function(n){return-1===this.cmpn(n)},i.prototype.lt=function(n){return-1===this.cmp(n)},i.prototype.lten=function(n){return this.cmpn(n)<=0},i.prototype.lte=function(n){return this.cmp(n)<=0},i.prototype.eqn=function(n){return 0===this.cmpn(n)},i.prototype.eq=function(n){return 0===this.cmp(n)},i.red=function(n){return new k(n)},i.prototype.toRed=function(n){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),n.convertTo(this)._forceRed(n)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(n){return this.red=n,this},i.prototype.forceRed=function(n){return r(!this.red,"Already a number in reduction context"),this._forceRed(n)},i.prototype.redAdd=function(n){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,n)},i.prototype.redIAdd=function(n){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,n)},i.prototype.redSub=function(n){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,n)},i.prototype.redISub=function(n){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,n)},i.prototype.redShl=function(n){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,n)},i.prototype.redMul=function(n){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,n),this.red.mul(this,n)},i.prototype.redIMul=function(n){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,n),this.red.imul(this,n)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(n){return r(this.red&&!n.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,n)};var b={k256:null,p224:null,p192:null,p25519:null};function g(n,e){this.name=n,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(n){if("string"==typeof n){var e=i._prime(n);this.m=e.p,this.prime=e}else r(n.gtn(1),"modulus must be greater than 1"),this.m=n,this.prime=null}function x(n){k.call(this,n),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}g.prototype._tmp=function(){var n=new i(null);return n.words=new Array(Math.ceil(this.n/13)),n},g.prototype.ireduce=function(n){var e,t=n;do{this.split(t,this.tmp),e=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?t.isub(this.p):t.strip(),t},g.prototype.split=function(n,e){n.iushrn(this.n,0,e)},g.prototype.imulK=function(n){return n.imul(this.k)},a(y,g),y.prototype.split=function(n,e){for(var t=Math.min(n.length,9),r=0;r>>22,a=i}a>>>=22,n.words[r-10]=a,0===a&&n.length>10?n.length-=10:n.length-=9},y.prototype.imulK=function(n){n.words[n.length]=0,n.words[n.length+1]=0,n.length+=2;for(var e=0,t=0;t>>=26,n.words[t]=a,e=r}return 0!==e&&(n.words[n.length++]=e),n},i._prime=function(n){if(b[n])return b[n];var e;if("k256"===n)e=new y;else if("p224"===n)e=new v;else if("p192"===n)e=new _;else{if("p25519"!==n)throw new Error("Unknown prime "+n);e=new w}return b[n]=e,e},k.prototype._verify1=function(n){r(0===n.negative,"red works only with positives"),r(n.red,"red works only with red numbers")},k.prototype._verify2=function(n,e){r(0==(n.negative|e.negative),"red works only with positives"),r(n.red&&n.red===e.red,"red works only with red numbers")},k.prototype.imod=function(n){return this.prime?this.prime.ireduce(n)._forceRed(this):n.umod(this.m)._forceRed(this)},k.prototype.neg=function(n){return n.isZero()?n.clone():this.m.sub(n)._forceRed(this)},k.prototype.add=function(n,e){this._verify2(n,e);var t=n.add(e);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},k.prototype.iadd=function(n,e){this._verify2(n,e);var t=n.iadd(e);return t.cmp(this.m)>=0&&t.isub(this.m),t},k.prototype.sub=function(n,e){this._verify2(n,e);var t=n.sub(e);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},k.prototype.isub=function(n,e){this._verify2(n,e);var t=n.isub(e);return t.cmpn(0)<0&&t.iadd(this.m),t},k.prototype.shl=function(n,e){return this._verify1(n),this.imod(n.ushln(e))},k.prototype.imul=function(n,e){return this._verify2(n,e),this.imod(n.imul(e))},k.prototype.mul=function(n,e){return this._verify2(n,e),this.imod(n.mul(e))},k.prototype.isqr=function(n){return this.imul(n,n.clone())},k.prototype.sqr=function(n){return this.mul(n,n)},k.prototype.sqrt=function(n){if(n.isZero())return n.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var t=this.m.add(new i(1)).iushrn(2);return this.pow(n,t)}for(var a=this.m.subn(1),s=0;!a.isZero()&&0===a.andln(1);)s++,a.iushrn(1);r(!a.isZero());var o=new i(1).toRed(this),l=o.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var d=this.pow(u,a),f=this.pow(n,a.addn(1).iushrn(1)),h=this.pow(n,a),p=s;0!==h.cmp(o);){for(var m=h,b=0;0!==m.cmp(o);b++)m=m.redSqr();r(b=0;r--){for(var c=e.words[r],u=l-1;u>=0;u--){var d=c>>u&1;a!==t[0]&&(a=this.sqr(a)),0!==d||0!==s?(s<<=1,s|=d,(4===++o||0===r&&0===u)&&(a=this.mul(a,t[s]),o=0,s=0)):o=0}l=26}return a},k.prototype.convertTo=function(n){var e=n.umod(this.m);return e===n?e.clone():e},k.prototype.convertFrom=function(n){var e=n.clone();return e.red=null,e},i.mont=function(n){return new x(n)},a(x,k),x.prototype.convertTo=function(n){return this.imod(n.ushln(this.shift))},x.prototype.convertFrom=function(n){var e=this.imod(n.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(n,e){if(n.isZero()||e.isZero())return n.words[0]=0,n.length=1,n;var t=n.imul(e),r=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=t.isub(r).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},x.prototype.mul=function(n,e){if(n.isZero()||e.isZero())return new i(0)._forceRed(this);var t=n.mul(e),r=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=t.isub(r).iushrn(this.shift),s=a;return a.cmp(this.m)>=0?s=a.isub(this.m):a.cmpn(0)<0&&(s=a.iadd(this.m)),s._forceRed(this)},x.prototype.invm=function(n){return this.imod(n._invmp(this.m).mul(this.r2))._forceRed(this)}}(n,this)}).call(this,t(18)(n))},function(n,e){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch(n){"object"==typeof window&&(t=window)}n.exports=t},function(n,e,t){var r;(function(){var t=this,a=t._,i=Array.prototype,s=Object.prototype,o=Function.prototype,l=i.push,c=i.slice,u=s.toString,d=s.hasOwnProperty,f=Array.isArray,h=Object.keys,p=o.bind,m=Object.create,b=function(){},g=function(n){return n instanceof g?n:this instanceof g?void(this._wrapped=n):new g(n)};n.exports&&(e=n.exports=g),e._=g,g.VERSION="1.8.3";var y=function(n,e,t){if(void 0===e)return n;switch(null==t?3:t){case 1:return function(t){return n.call(e,t)};case 2:return function(t,r){return n.call(e,t,r)};case 3:return function(t,r,a){return n.call(e,t,r,a)};case 4:return function(t,r,a,i){return n.call(e,t,r,a,i)}}return function(){return n.apply(e,arguments)}},v=function(n,e,t){return null==n?g.identity:g.isFunction(n)?y(n,e,t):g.isObject(n)?g.matcher(n):g.property(n)};g.iteratee=function(n,e){return v(n,e,1/0)};var _=function(n,e){return function(t){var r=arguments.length;if(r<2||null==t)return t;for(var a=1;a=0&&e<=x};function E(n){return function(e,t,r,a){t=y(t,a,4);var i=!A(e)&&g.keys(e),s=(i||e).length,o=n>0?0:s-1;return arguments.length<3&&(r=e[i?i[o]:o],o+=n),function(e,t,r,a,i,s){for(;i>=0&&i=0},g.invoke=function(n,e){var t=c.call(arguments,2),r=g.isFunction(e);return g.map(n,function(n){var a=r?e:n[e];return null==a?a:a.apply(n,t)})},g.pluck=function(n,e){return g.map(n,g.property(e))},g.where=function(n,e){return g.filter(n,g.matcher(e))},g.findWhere=function(n,e){return g.find(n,g.matcher(e))},g.max=function(n,e,t){var r,a,i=-1/0,s=-1/0;if(null==e&&null!=n)for(var o=0,l=(n=A(n)?n:g.values(n)).length;oi&&(i=r);else e=v(e,t),g.each(n,function(n,t,r){((a=e(n,t,r))>s||a===-1/0&&i===-1/0)&&(i=n,s=a)});return i},g.min=function(n,e,t){var r,a,i=1/0,s=1/0;if(null==e&&null!=n)for(var o=0,l=(n=A(n)?n:g.values(n)).length;or||void 0===t)return 1;if(t0?0:a-1;i>=0&&i0?s=i>=0?i:Math.max(i+o,s):o=i>=0?Math.min(i+1,o):i+o+1;else if(t&&i&&o)return r[i=t(r,a)]===a?i:-1;if(a!=a)return(i=e(c.call(r,s,o),g.isNaN))>=0?i+s:-1;for(i=n>0?s:o-1;i>=0&&ie?(s&&(clearTimeout(s),s=null),o=c,i=n.apply(r,a),s||(r=a=null)):s||!1===t.trailing||(s=setTimeout(l,u)),i}},g.debounce=function(n,e,t){var r,a,i,s,o,l=function(){var c=g.now()-s;c=0?r=setTimeout(l,e-c):(r=null,t||(o=n.apply(i,a),r||(i=a=null)))};return function(){i=this,a=arguments,s=g.now();var c=t&&!r;return r||(r=setTimeout(l,e)),c&&(o=n.apply(i,a),i=a=null),o}},g.wrap=function(n,e){return g.partial(e,n)},g.negate=function(n){return function(){return!n.apply(this,arguments)}},g.compose=function(){var n=arguments,e=n.length-1;return function(){for(var t=e,r=n[e].apply(this,arguments);t--;)r=n[t].call(this,r);return r}},g.after=function(n,e){return function(){if(--n<1)return e.apply(this,arguments)}},g.before=function(n,e){var t;return function(){return--n>0&&(t=e.apply(this,arguments)),n<=1&&(e=null),t}},g.once=g.partial(g.before,2);var B=!{toString:null}.propertyIsEnumerable("toString"),M=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];function N(n,e){var t=M.length,r=n.constructor,a=g.isFunction(r)&&r.prototype||s,i="constructor";for(g.has(n,i)&&!g.contains(e,i)&&e.push(i);t--;)(i=M[t])in n&&n[i]!==a[i]&&!g.contains(e,i)&&e.push(i)}g.keys=function(n){if(!g.isObject(n))return[];if(h)return h(n);var e=[];for(var t in n)g.has(n,t)&&e.push(t);return B&&N(n,e),e},g.allKeys=function(n){if(!g.isObject(n))return[];var e=[];for(var t in n)e.push(t);return B&&N(n,e),e},g.values=function(n){for(var e=g.keys(n),t=e.length,r=Array(t),a=0;a":">",'"':""","'":"'","`":"`"},L=g.invert(O),D=function(n){var e=function(e){return n[e]},t="(?:"+g.keys(n).join("|")+")",r=RegExp(t),a=RegExp(t,"g");return function(n){return n=null==n?"":""+n,r.test(n)?n.replace(a,e):n}};g.escape=D(O),g.unescape=D(L),g.result=function(n,e,t){var r=null==n?void 0:n[e];return void 0===r&&(r=t),g.isFunction(r)?r.call(n):r};var q=0;g.uniqueId=function(n){var e=++q+"";return n?n+e:e},g.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var F=/(.)^/,U={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},z=/\\|'|\r|\n|\u2028|\u2029/g,K=function(n){return"\\"+U[n]};g.template=function(n,e,t){!e&&t&&(e=t),e=g.defaults({},e,g.templateSettings);var r=RegExp([(e.escape||F).source,(e.interpolate||F).source,(e.evaluate||F).source].join("|")+"|$","g"),a=0,i="__p+='";n.replace(r,function(e,t,r,s,o){return i+=n.slice(a,o).replace(z,K),a=o+e.length,t?i+="'+\n((__t=("+t+"))==null?'':_.escape(__t))+\n'":r?i+="'+\n((__t=("+r+"))==null?'':__t)+\n'":s&&(i+="';\n"+s+"\n__p+='"),e}),i+="';\n",e.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var s=new Function(e.variable||"obj","_",i)}catch(n){throw n.source=i,n}var o=function(n){return s.call(this,n,g)},l=e.variable||"obj";return o.source="function("+l+"){\n"+i+"}",o},g.chain=function(n){var e=g(n);return e._chain=!0,e};var H=function(n,e){return n._chain?g(e).chain():e};g.mixin=function(n){g.each(g.functions(n),function(e){var t=g[e]=n[e];g.prototype[e]=function(){var n=[this._wrapped];return l.apply(n,arguments),H(this,t.apply(g,n))}})},g.mixin(g),g.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var e=i[n];g.prototype[n]=function(){var t=this._wrapped;return e.apply(t,arguments),"shift"!==n&&"splice"!==n||0!==t.length||delete t[0],H(this,t)}}),g.each(["concat","join","slice"],function(n){var e=i[n];g.prototype[n]=function(){return H(this,e.apply(this._wrapped,arguments))}}),g.prototype.value=function(){return this._wrapped},g.prototype.valueOf=g.prototype.toJSON=g.prototype.value,g.prototype.toString=function(){return""+this._wrapped},void 0===(r=function(){return g}.apply(e,[]))||(n.exports=r)}).call(this)},function(n,e,t){"use strict";var r=e;r.version=t(308).version,r.utils=t(309),r.rand=t(135),r.curve=t(49),r.curves=t(314),r.ec=t(322),r.eddsa=t(326)},function(n,e,t){"use strict";var r=t(204),a=t(205);n.exports={errors:r,formatters:a}},function(n,e){var t,r,a=n.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(n){if(t===setTimeout)return setTimeout(n,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(n,0);try{return t(n,0)}catch(e){try{return t.call(null,n,0)}catch(e){return t.call(this,n,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(n){t=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(n){r=s}}();var l,c=[],u=!1,d=-1;function f(){u&&l&&(u=!1,l.length?c=l.concat(c):d=-1,c.length&&h())}function h(){if(!u){var n=o(f);u=!0;for(var e=c.length;e;){for(l=c,c=[];++d1)for(var t=1;t=0&&(a=e.type.substring(i));var s=l(n,e.components);r.isArray(s)&&n?t.push("tuple("+s.join(",")+")"+a):n?t.push("("+s+")"):t.push("("+s.join(",")+")"+a)}else t.push(e.type)}),t},c=function(n){if(!i.isHexStrict(n))throw new Error("The parameter must be a valid HEX string.");var e="",t=0,r=n.length;for("0x"===n.substring(0,2)&&(t=2);t7?t+=n[r].toUpperCase():t+=n[r];return t},toHex:i.toHex,toBN:i.toBN,bytesToHex:i.bytesToHex,hexToBytes:i.hexToBytes,hexToNumberString:i.hexToNumberString,hexToNumber:i.hexToNumber,toDecimal:i.hexToNumber,numberToHex:i.numberToHex,fromDecimal:i.numberToHex,hexToUtf8:i.hexToUtf8,hexToString:i.hexToUtf8,toUtf8:i.hexToUtf8,utf8ToHex:i.utf8ToHex,stringToHex:i.utf8ToHex,fromUtf8:i.utf8ToHex,hexToAscii:c,toAscii:c,asciiToHex:u,fromAscii:u,unitMap:a.unitMap,toWei:function(n,e){if(e=d(e),!i.isBN(n)&&!r.isString(n))throw new Error("Please pass numbers as strings or BigNumber objects to avoid precision errors.");return i.isBN(n)?a.toWei(n,e):a.toWei(n,e).toString(10)},fromWei:function(n,e){if(e=d(e),!i.isBN(n)&&!r.isString(n))throw new Error("Please pass numbers as strings or BigNumber objects to avoid precision errors.");return i.isBN(n)?a.fromWei(n,e):a.fromWei(n,e).toString(10)},padLeft:i.leftPad,leftPad:i.leftPad,padRight:i.rightPad,rightPad:i.rightPad,toTwosComplement:i.toTwosComplement}},function(n,e,t){"use strict";var r=t(9),a=t(0);function i(n,e){return 55296==(64512&n.charCodeAt(e))&&(!(e<0||e+1>=n.length)&&56320==(64512&n.charCodeAt(e+1)))}function s(n){return(n>>>24|n>>>8&65280|n<<8&16711680|(255&n)<<24)>>>0}function o(n){return 1===n.length?"0"+n:n}function l(n){return 7===n.length?"0"+n:6===n.length?"00"+n:5===n.length?"000"+n:4===n.length?"0000"+n:3===n.length?"00000"+n:2===n.length?"000000"+n:1===n.length?"0000000"+n:n}e.inherits=a,e.toArray=function(n,e){if(Array.isArray(n))return n.slice();if(!n)return[];var t=[];if("string"==typeof n)if(e){if("hex"===e)for((n=n.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(n="0"+n),a=0;a>6|192,t[r++]=63&s|128):i(n,a)?(s=65536+((1023&s)<<10)+(1023&n.charCodeAt(++a)),t[r++]=s>>18|240,t[r++]=s>>12&63|128,t[r++]=s>>6&63|128,t[r++]=63&s|128):(t[r++]=s>>12|224,t[r++]=s>>6&63|128,t[r++]=63&s|128)}else for(a=0;a>>0}return s},e.split32=function(n,e){for(var t=new Array(4*n.length),r=0,a=0;r>>24,t[a+1]=i>>>16&255,t[a+2]=i>>>8&255,t[a+3]=255&i):(t[a+3]=i>>>24,t[a+2]=i>>>16&255,t[a+1]=i>>>8&255,t[a]=255&i)}return t},e.rotr32=function(n,e){return n>>>e|n<<32-e},e.rotl32=function(n,e){return n<>>32-e},e.sum32=function(n,e){return n+e>>>0},e.sum32_3=function(n,e,t){return n+e+t>>>0},e.sum32_4=function(n,e,t,r){return n+e+t+r>>>0},e.sum32_5=function(n,e,t,r,a){return n+e+t+r+a>>>0},e.sum64=function(n,e,t,r){var a=n[e],i=r+n[e+1]>>>0,s=(i>>0,n[e+1]=i},e.sum64_hi=function(n,e,t,r){return(e+r>>>0>>0},e.sum64_lo=function(n,e,t,r){return e+r>>>0},e.sum64_4_hi=function(n,e,t,r,a,i,s,o){var l=0,c=e;return l+=(c=c+r>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(n,e,t,r,a,i,s,o){return e+r+i+o>>>0},e.sum64_5_hi=function(n,e,t,r,a,i,s,o,l,c){var u=0,d=e;return u+=(d=d+r>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(n,e,t,r,a,i,s,o,l,c){return e+r+i+o+c>>>0},e.rotr64_hi=function(n,e,t){return(e<<32-t|n>>>t)>>>0},e.rotr64_lo=function(n,e,t){return(n<<32-t|e>>>t)>>>0},e.shr64_hi=function(n,e,t){return n>>>t},e.shr64_lo=function(n,e,t){return(n<<32-t|e>>>t)>>>0}},function(n,e){n.exports=function(n){return"object"==typeof n?null!==n:"function"==typeof n}},function(n,e){var t=n.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},function(n,e,t){var r=t(90)("wks"),a=t(57),i=t(13).Symbol,s="function"==typeof i;(n.exports=function(n){return r[n]||(r[n]=s&&i[n]||(s?i:a)("Symbol."+n))}).store=r},function(n,e,t){var r=t(1).Buffer,a=t(71).Transform,i=t(67).StringDecoder;function s(n){a.call(this),this.hashMode="string"==typeof n,this.hashMode?this[n]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}t(0)(s,a),s.prototype.update=function(n,e,t){"string"==typeof n&&(n=r.from(n,e));var a=this._update(n);return this.hashMode?this:(t&&(a=this._toString(a,t)),a)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(n,e,t){var r;try{this.hashMode?this._update(n):this.push(this._update(n))}catch(n){r=n}finally{t(r)}},s.prototype._flush=function(n){var e;try{this.push(this.__final())}catch(n){e=n}n(e)},s.prototype._finalOrDigest=function(n){var e=this.__final()||r.alloc(0);return n&&(e=this._toString(e,n,!0)),e},s.prototype._toString=function(n,e,t){if(this._decoder||(this._decoder=new i(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var r=this._decoder.write(n);return t&&(r+=this._decoder.end()),r},n.exports=s},function(n,e,t){var r=t(29),a=t(86);n.exports=t(30)?function(n,e,t){return r.f(n,e,a(1,t))}:function(n,e,t){return n[e]=t,n}},function(n,e,t){"use strict";var r=t(203),a=t(249);n.exports={packageInit:function(n,e){if(e=Array.prototype.slice.call(e),!n)throw new Error('You need to instantiate using the "new" keyword.');Object.defineProperty(n,"currentProvider",{get:function(){return n._provider},set:function(e){return n.setProvider(e)},enumerable:!0,configurable:!0}),e[0]&&e[0]._requestManager?n._requestManager=new r.Manager(e[0].currentProvider):(n._requestManager=new r.Manager,n._requestManager.setProvider(e[0],e[1])),n.givenProvider=r.Manager.givenProvider,n.providers=r.Manager.providers,n._provider=n._requestManager.provider,n.setProvider||(n.setProvider=function(e,t){return n._requestManager.setProvider(e,t),n._provider=n._requestManager.provider,!0}),n.BatchRequest=r.BatchManager.bind(null,n._requestManager),n.extend=a(n)},addProviders:function(n){n.givenProvider=r.Manager.givenProvider,n.providers=r.Manager.providers}}},function(n,e){n.exports=function(n){return n.webpackPolyfill||(n.deprecate=function(){},n.paths=[],n.children||(n.children=[]),Object.defineProperty(n,"loaded",{enumerable:!0,get:function(){return n.l}}),Object.defineProperty(n,"id",{enumerable:!0,get:function(){return n.i}}),n.webpackPolyfill=1),n}},function(n,e,t){"use strict";var r=t(41),a=Object.keys||function(n){var e=[];for(var t in n)e.push(t);return e};n.exports=d;var i=t(34);i.inherits=t(0);var s=t(105),o=t(66);i.inherits(d,s);for(var l=a(o.prototype),c=0;c1?(n[t[0]]=n[t[0]]||{},n[t[0]][t[1]]=e):n[t[0]]=e},c.prototype.getCall=function(n){return r.isFunction(this.call)?this.call(n):this.call},c.prototype.extractCallback=function(n){if(r.isFunction(n[n.length-1]))return n.pop()},c.prototype.validateArgs=function(n){if(n.length!==this.params)throw a.InvalidNumberOfParams(n.length,this.params,this.name)},c.prototype.formatInput=function(n){var e=this;return this.inputFormatter?this.inputFormatter.map(function(t,r){return t?t.call(e,n[r]):n[r]}):n},c.prototype.formatOutput=function(n){var e=this;return r.isArray(n)?n.map(function(n){return e.outputFormatter&&n?e.outputFormatter(n):n}):this.outputFormatter&&n?this.outputFormatter(n):n},c.prototype.toPayload=function(n){var e=this.getCall(n),t=this.extractCallback(n),r=this.formatInput(n);this.validateArgs(r);var a={method:e,params:r,callback:t};return this.transformPayload&&(a=this.transformPayload(a)),a},c.prototype._confirmTransaction=function(n,e,t){var a=this,u=!1,d=!0,f=0,h=0,p=null,m="",b=r.isObject(t.params[0])&&t.params[0].gas?t.params[0].gas:null,g=r.isObject(t.params[0])&&t.params[0].data&&t.params[0].from&&!t.params[0].to,y=[new c({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:i.outputTransactionReceiptFormatter}),new c({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[i.inputAddressFormatter,i.inputDefaultBlockNumberFormatter]}),new l({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:i.outputBlockFormatter}}})],v={};r.each(y,function(n){n.attachToObject(v),n.requestManager=a.requestManager});var _=function(t,r,i,l,c){if(!i)return c||(c={unsubscribe:function(){clearInterval(p)}}),(t?o.resolve(t):v.getTransactionReceipt(e)).catch(function(e){c.unsubscribe(),u=!0,s._fireError({message:"Failed to check for transaction receipt:",data:e},n.eventEmitter,n.reject)}).then(function(e){if(!e||!e.blockHash)throw new Error("Receipt missing or blockHash null");return a.extraFormatters&&a.extraFormatters.receiptFormatter&&(e=a.extraFormatters.receiptFormatter(e)),n.eventEmitter.listeners("confirmation").length>0&&(void 0!==t&&0===h||n.eventEmitter.emit("confirmation",h,e),d=!1,25===++h&&(c.unsubscribe(),n.eventEmitter.removeAllListeners())),e}).then(function(e){if(g&&!u){if(!e.contractAddress)return d&&(c.unsubscribe(),u=!0),void s._fireError(new Error("The transaction receipt didn't contain a contract address."),n.eventEmitter,n.reject);v.getCode(e.contractAddress,function(t,r){r&&(r.length>2?(n.eventEmitter.emit("receipt",e),a.extraFormatters&&a.extraFormatters.contractDeployFormatter?n.resolve(a.extraFormatters.contractDeployFormatter(e)):n.resolve(e),d&&n.eventEmitter.removeAllListeners()):s._fireError(new Error("The contract code couldn't be stored, please check your gas limit."),n.eventEmitter,n.reject),d&&c.unsubscribe(),u=!0)})}return e}).then(function(e){g||u||(e.outOfGas||b&&b===e.gasUsed||!0!==e.status&&"0x1"!==e.status&&void 0!==e.status?(m=JSON.stringify(e,null,2),!1===e.status||"0x0"===e.status?s._fireError(new Error("Transaction has been reverted by the EVM:\n"+m),n.eventEmitter,n.reject):s._fireError(new Error("Transaction ran out of gas. Please provide more gas:\n"+m),n.eventEmitter,n.reject)):(n.eventEmitter.emit("receipt",e),n.resolve(e),d&&n.eventEmitter.removeAllListeners()),d&&c.unsubscribe(),u=!0)}).catch(function(){f++,r?f-1>=750&&(c.unsubscribe(),u=!0,s._fireError(new Error("Transaction was not mined within750 seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!"),n.eventEmitter,n.reject)):f-1>=50&&(c.unsubscribe(),u=!0,s._fireError(new Error("Transaction was not mined within 50 blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!"),n.eventEmitter,n.reject))});c.unsubscribe(),u=!0,s._fireError({message:"Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.",data:i},n.eventEmitter,n.reject)},w=function(n){r.isFunction(this.requestManager.provider.on)?v.subscribe("newBlockHeaders",_.bind(null,n,!1)):p=setInterval(_.bind(null,n,!0),1e3)}.bind(this);v.getTransactionReceipt(e).then(function(e){e&&e.blockHash?(n.eventEmitter.listeners("confirmation").length>0&&w(e),_(e,!1)):u||w()}).catch(function(){u||w()})};var u=function(n,e){return r.isNumber(n)?e.wallet[n]:r.isObject(n)&&n.address&&n.privateKey?n:e.wallet[n.toLowerCase()]};c.prototype.buildCall=function(){var n=this,e="eth_sendTransaction"===n.call||"eth_sendRawTransaction"===n.call,t=function(){var t=o(!e),a=n.toPayload(Array.prototype.slice.call(arguments)),i=function(r,i){try{i=n.formatOutput(i)}catch(n){r=n}if(i instanceof Error&&(r=i),r)return r.error&&(r=r.error),s._fireError(r,t.eventEmitter,t.reject,a.callback);a.callback&&a.callback(null,i),e?(t.eventEmitter.emit("transactionHash",i),n._confirmTransaction(t,i,a)):r||t.resolve(i)},l=function(e){var t=r.extend({},a,{method:"eth_sendRawTransaction",params:[e.rawTransaction]});n.requestManager.send(t,i)},d=function(n,e){var a;if(e&&e.accounts&&e.accounts.wallet&&e.accounts.wallet.length)if("eth_sendTransaction"===n.method){var s=n.params[0];if((a=u(r.isObject(s)?s.from:null,e.accounts))&&a.privateKey)return e.accounts.signTransaction(r.omit(s,"from"),a.privateKey).then(l)}else if("eth_sign"===n.method){var o=n.params[1];if((a=u(n.params[0],e.accounts))&&a.privateKey){var c=e.accounts.sign(o,a.privateKey);return n.callback&&n.callback(null,c.signature),void t.resolve(c.signature)}}return e.requestManager.send(n,i)};e&&r.isObject(a.params[0])&&void 0===a.params[0].gasPrice?new c({name:"getGasPrice",call:"eth_gasPrice",params:0}).createFunction(n.requestManager)(function(e,t){t&&(a.params[0].gasPrice=t),d(a,n)}):d(a,n);return t.eventEmitter};return t.method=n,t.request=this.request.bind(this),t},c.prototype.request=function(){var n=this.toPayload(Array.prototype.slice.call(arguments));return n.format=this.formatOutput.bind(this),n},n.exports=c},function(n,e){var t=n.exports={version:"2.6.5"};"number"==typeof __e&&(__e=t)},function(n,e,t){var r=t(12);n.exports=function(n){if(!r(n))throw TypeError(n+" is not an object!");return n}},function(n,e){var t={}.hasOwnProperty;n.exports=function(n,e){return t.call(n,e)}},function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=t(45);function a(n){return!!n._bn}function i(n){return n.slice?n:(n.slice=function(){var e=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(n,e))},n)}function s(n){if(!n||parseInt(String(n.length))!=n.length||"string"==typeof n)return!1;for(var e=0;e=256||parseInt(String(t))!=t)return!1}return!0}function o(n){if(null==n&&r.throwError("cannot convert null value to array",r.INVALID_ARGUMENT,{arg:"value",value:n}),a(n)&&(n=n.toHexString()),"string"==typeof n){var e=n.match(/^(0x)?[0-9a-fA-F]*$/);e||r.throwError("invalid hexidecimal string",r.INVALID_ARGUMENT,{arg:"value",value:n}),"0x"!==e[1]&&r.throwError("hex string must have 0x prefix",r.INVALID_ARGUMENT,{arg:"value",value:n}),(n=n.substring(2)).length%2&&(n="0"+n);for(var t=[],o=0;o>4]+u[15&l])}return"0x"+i.join("")}return r.throwError("invalid hexlify value",null,{arg:"value",value:n}),"never"}function f(n,e){for(c(n)||r.throwError("invalid hex string",r.INVALID_ARGUMENT,{arg:"value",value:n});n.length<2*e+2;)n="0x0"+n.substring(2);return n}function h(n){var e,t=0,a="0x",i="0x";if((e=n)&&null!=e.r&&null!=e.s){null==n.v&&null==n.recoveryParam&&r.throwError("at least on of recoveryParam or v must be specified",r.INVALID_ARGUMENT,{argument:"signature",value:n}),a=f(n.r,32),i=f(n.s,32),"string"==typeof(t=n.v)&&(t=parseInt(t,16));var s=n.recoveryParam;null==s&&null!=n.v&&(s=1-t%2),t=27+s}else{var l=o(n);if(65!==l.length)throw new Error("invalid signature");a=d(l.slice(0,32)),i=d(l.slice(32,64)),27!==(t=l[64])&&28!==t&&(t=27+t%2)}return{r:a,s:i,recoveryParam:t-27,v:t}}e.hexlify=d,e.hexDataLength=function(n){return c(n)&&n.length%2==0?(n.length-2)/2:null},e.hexDataSlice=function(n,e,t){return c(n)||r.throwError("invalid hex data",r.INVALID_ARGUMENT,{arg:"value",value:n}),n.length%2!=0&&r.throwError("hex data length must be even",r.INVALID_ARGUMENT,{arg:"value",value:n}),e=2+2*e,null!=t?"0x"+n.substring(e,e+2*t):"0x"+n.substring(e)},e.hexStripZeros=function(n){for(c(n)||r.throwError("invalid hex string",r.INVALID_ARGUMENT,{arg:"value",value:n});n.length>3&&"0x0"===n.substring(0,3);)n="0x"+n.substring(3);return n},e.hexZeroPad=f,e.splitSignature=h,e.joinSignature=function(n){return d(l([(n=h(n)).r,n.s,n.recoveryParam?"0x1c":"0x1b"]))}},function(n,e,t){"use strict";(function(e,r){var a=65536,i=4294967295;var s=t(1).Buffer,o=e.crypto||e.msCrypto;o&&o.getRandomValues?n.exports=function(n,e){if(n>i)throw new RangeError("requested too many random bytes");var t=s.allocUnsafe(n);if(n>0)if(n>a)for(var l=0;l=this._finalSize&&(this._update(this._block),this._block.fill(0));var t=8*this._len;if(t<=4294967295)this._block.writeUInt32BE(t,this._blockSize-4);else{var r=(4294967295&t)>>>0,a=(t-r)/4294967296;this._block.writeUInt32BE(a,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var i=this._hash();return n?i.toString(n):i},a.prototype._update=function(){throw new Error("_update must be implemented by subclass")},n.exports=a},function(n,e){n.exports={}},function(n,e,t){var r=t(13),a=t(21),i=t(40),s=t(16),o=t(23),l=function(n,e,t){var c,u,d,f=n&l.F,h=n&l.G,p=n&l.S,m=n&l.P,b=n&l.B,g=n&l.W,y=h?a:a[e]||(a[e]={}),v=y.prototype,_=h?r:p?r[e]:(r[e]||{}).prototype;for(c in h&&(t=e),t)(u=!f&&_&&void 0!==_[c])&&o(y,c)||(d=u?_[c]:t[c],y[c]=h&&"function"!=typeof _[c]?t[c]:b&&u?i(d,r):g&&_[c]==d?function(n){var e=function(e,t,r){if(this instanceof n){switch(arguments.length){case 0:return new n;case 1:return new n(e);case 2:return new n(e,t)}return new n(e,t,r)}return n.apply(this,arguments)};return e.prototype=n.prototype,e}(d):m&&"function"==typeof d?i(Function.call,d):d,m&&((y.virtual||(y.virtual={}))[c]=d,n&l.R&&v&&!v[c]&&s(v,c,d)))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,n.exports=l},function(n,e,t){var r=t(22),a=t(173),i=t(174),s=Object.defineProperty;e.f=t(30)?Object.defineProperty:function(n,e,t){if(r(n),e=i(e,!0),r(t),a)try{return s(n,e,t)}catch(n){}if("get"in t||"set"in t)throw TypeError("Accessors not supported!");return"value"in t&&(n[e]=t.value),n}},function(n,e,t){n.exports=!t(31)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(n,e){n.exports=function(n){try{return!!n()}catch(n){return!0}}},function(n,e,t){"use strict";var r=t(102),a=t(225);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}e.parse=v,e.resolve=function(n,e){return v(n,!1,!0).resolve(e)},e.resolveObject=function(n,e){return n?v(n,!1,!0).resolveObject(e):e},e.format=function(n){a.isString(n)&&(n=v(n));return n instanceof i?n.format():i.prototype.format.call(n)},e.Url=i;var s=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,l=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(c),d=["%","/","?",";","#"].concat(u),f=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=t(226);function v(n,e,t){if(n&&a.isObject(n)&&n instanceof i)return n;var r=new i;return r.parse(n,e,t),r}i.prototype.parse=function(n,e,t){if(!a.isString(n))throw new TypeError("Parameter 'url' must be a string, not "+typeof n);var i=n.indexOf("?"),o=-1!==i&&i127?M+="x":M+=B[N];if(!M.match(h)){var O=j.slice(0,T),L=j.slice(T+1),D=B.match(p);D&&(O.push(D[1]),L.unshift(D[2])),L.length&&(v="/"+L.join(".")+v),this.hostname=O.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),I||(this.hostname=r.toASCII(this.hostname));var q=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+q,this.href+=this.host,I&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!m[k])for(T=0,R=u.length;T0)&&t.host.split("@"))&&(t.auth=I.shift(),t.host=t.hostname=I.shift());return t.search=n.search,t.query=n.query,a.isNull(t.pathname)&&a.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t}if(!x.length)return t.pathname=null,t.search?t.path="/"+t.search:t.path=null,t.href=t.format(),t;for(var A=x.slice(-1)[0],E=(t.host||n.host||x.length>1)&&("."===A||".."===A)||""===A,T=0,C=x.length;C>=0;C--)"."===(A=x[C])?x.splice(C,1):".."===A?(x.splice(C,1),T++):T&&(x.splice(C,1),T--);if(!w&&!k)for(;T--;T)x.unshift("..");!w||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),E&&"/"!==x.join("/").substr(-1)&&x.push("");var I,j=""===x[0]||x[0]&&"/"===x[0].charAt(0);S&&(t.hostname=t.host=j?"":x.length?x.shift():"",(I=!!(t.host&&t.host.indexOf("@")>0)&&t.host.split("@"))&&(t.auth=I.shift(),t.host=t.hostname=I.shift()));return(w=w||t.host&&x.length)&&!j&&x.unshift(""),x.length?t.pathname=x.join("/"):(t.pathname=null,t.path=null),a.isNull(t.pathname)&&a.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.auth=n.auth||t.auth,t.slashes=t.slashes||n.slashes,t.href=t.format(),t},i.prototype.parseHost=function(){var n=this.host,e=o.exec(n);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),n=n.substr(0,n.length-e.length)),n&&(this.hostname=n)}},function(n,e,t){(e=n.exports=t(105)).Stream=e,e.Readable=e,e.Writable=t(66),e.Duplex=t(19),e.Transform=t(108),e.PassThrough=t(239)},function(n,e,t){(function(n){function t(n){return Object.prototype.toString.call(n)}e.isArray=function(n){return Array.isArray?Array.isArray(n):"[object Array]"===t(n)},e.isBoolean=function(n){return"boolean"==typeof n},e.isNull=function(n){return null===n},e.isNullOrUndefined=function(n){return null==n},e.isNumber=function(n){return"number"==typeof n},e.isString=function(n){return"string"==typeof n},e.isSymbol=function(n){return"symbol"==typeof n},e.isUndefined=function(n){return void 0===n},e.isRegExp=function(n){return"[object RegExp]"===t(n)},e.isObject=function(n){return"object"==typeof n&&null!==n},e.isDate=function(n){return"[object Date]"===t(n)},e.isError=function(n){return"[object Error]"===t(n)||n instanceof Error},e.isFunction=function(n){return"function"==typeof n},e.isPrimitive=function(n){return null===n||"boolean"==typeof n||"number"==typeof n||"string"==typeof n||"symbol"==typeof n||void 0===n},e.isBuffer=n.isBuffer}).call(this,t(2).Buffer)},function(n,e,t){"use strict";var r=t(0),a=t(70),i=t(72),s=t(73),o=t(15);function l(n){o.call(this,"digest"),this._hash=n}r(l,o),l.prototype._update=function(n){this._hash.update(n)},l.prototype._final=function(){return this._hash.digest()},n.exports=function(n){return"md5"===(n=n.toLowerCase())?new a:"rmd160"===n||"ripemd160"===n?new i:new l(s(n))}},function(n,e,t){(function(e){n.exports=function(n,t){for(var r=Math.min(n.length,t.length),a=new e(r),i=0;i=this._delta8){var t=(n=this.pending).length%this._delta8;this.pending=n.slice(n.length-t,n.length),0===this.pending.length&&(this.pending=null),n=r.join32(n,0,n.length-t,this.endian);for(var a=0;a>>24&255,r[a++]=n>>>16&255,r[a++]=n>>>8&255,r[a++]=255&n}else for(r[a++]=255&n,r[a++]=n>>>8&255,r[a++]=n>>>16&255,r[a++]=n>>>24&255,r[a++]=0,r[a++]=0,r[a++]=0,r[a++]=0,i=8;i1?(n[t[0]]=n[t[0]]||{},n[t[0]][t[1]]=e):n[t[0]]=e},a.prototype.buildCall=function(){var n=this;return function(){n.subscriptions[arguments[0]]||console.warn("Subscription "+JSON.stringify(arguments[0])+" doesn't exist. Subscribing anyway.");var e=new r({subscription:n.subscriptions[arguments[0]],requestManager:n.requestManager,type:n.type});return e.subscribe.apply(e,arguments)}},n.exports={subscriptions:a,subscription:r}},function(n,e,t){"use strict";var r=t(17),a=t(20),i=t(10),s=function(){var n=this;r.packageInit(this,arguments),[new a({name:"getId",call:"net_version",params:0,outputFormatter:i.hexToNumber}),new a({name:"isListening",call:"net_listening",params:0}),new a({name:"getPeerCount",call:"net_peerCount",params:0,outputFormatter:i.hexToNumber})].forEach(function(e){e.attachToObject(n),e.setRequestManager(n._requestManager)})};r.addProviders(s),n.exports=s},function(n,e,t){"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 r=!1,a=!1;function i(n,t,r){if(a)throw new Error("unknown error");t||(t=e.UNKNOWN_ERROR),r||(r={});var i=[];Object.keys(r).forEach(function(n){try{i.push(n+"="+JSON.stringify(r[n]))}catch(e){i.push(n+"="+JSON.stringify(r[n].toString()))}});var s=n;i.length&&(n+=" ("+i.join(", ")+")");var o=new Error(n);throw o.reason=s,o.code=t,Object.keys(r).forEach(function(n){o[n]=r[n]}),o}e.throwError=i,e.checkNew=function(n,t){n instanceof t||i("missing new",e.MISSING_NEW,{name:t.name})},e.checkArgumentCount=function(n,t,r){r||(r=""),nt&&i("too many arguments"+r,e.UNEXPECTED_ARGUMENT,{count:n,expectedCount:t})},e.setCensorship=function(n,t){r&&i("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),a=!!n,r=!!t}},function(n,e,t){"use strict";e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=t(25),e.createHash=e.Hash=t(35),e.createHmac=e.Hmac=t(122);var r=t(283),a=Object.keys(r),i=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(a);e.getHashes=function(){return i};var s=t(74);e.pbkdf2=s.pbkdf2,e.pbkdf2Sync=s.pbkdf2Sync;var o=t(285);e.Cipher=o.Cipher,e.createCipher=o.createCipher,e.Cipheriv=o.Cipheriv,e.createCipheriv=o.createCipheriv,e.Decipher=o.Decipher,e.createDecipher=o.createDecipher,e.Decipheriv=o.Decipheriv,e.createDecipheriv=o.createDecipheriv,e.getCiphers=o.getCiphers,e.listCiphers=o.listCiphers;var l=t(302);e.DiffieHellmanGroup=l.DiffieHellmanGroup,e.createDiffieHellmanGroup=l.createDiffieHellmanGroup,e.getDiffieHellman=l.getDiffieHellman,e.createDiffieHellman=l.createDiffieHellman,e.DiffieHellman=l.DiffieHellman;var c=t(306);e.createSign=c.createSign,e.Sign=c.Sign,e.createVerify=c.createVerify,e.Verify=c.Verify,e.createECDH=t(344);var u=t(345);e.publicEncrypt=u.publicEncrypt,e.privateEncrypt=u.privateEncrypt,e.publicDecrypt=u.publicDecrypt,e.privateDecrypt=u.privateDecrypt;var d=t(348);e.randomFill=d.randomFill,e.randomFillSync=d.randomFillSync,e.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},function(n,e,t){var r=t(1).Buffer;function a(n){r.isBuffer(n)||(n=r.from(n));for(var e=n.length/4|0,t=new Array(e),a=0;a>>24]^u[p>>>16&255]^d[m>>>8&255]^f[255&b]^e[g++],s=c[p>>>24]^u[m>>>16&255]^d[b>>>8&255]^f[255&h]^e[g++],o=c[m>>>24]^u[b>>>16&255]^d[h>>>8&255]^f[255&p]^e[g++],l=c[b>>>24]^u[h>>>16&255]^d[p>>>8&255]^f[255&m]^e[g++],h=i,p=s,m=o,b=l;return i=(r[h>>>24]<<24|r[p>>>16&255]<<16|r[m>>>8&255]<<8|r[255&b])^e[g++],s=(r[p>>>24]<<24|r[m>>>16&255]<<16|r[b>>>8&255]<<8|r[255&h])^e[g++],o=(r[m>>>24]<<24|r[b>>>16&255]<<16|r[h>>>8&255]<<8|r[255&p])^e[g++],l=(r[b>>>24]<<24|r[h>>>16&255]<<16|r[p>>>8&255]<<8|r[255&m])^e[g++],[i>>>=0,s>>>=0,o>>>=0,l>>>=0]}var o=[0,1,2,4,8,16,32,64,128,27,54],l=function(){for(var n=new Array(256),e=0;e<256;e++)n[e]=e<128?e<<1:e<<1^283;for(var t=[],r=[],a=[[],[],[],[]],i=[[],[],[],[]],s=0,o=0,l=0;l<256;++l){var c=o^o<<1^o<<2^o<<3^o<<4;c=c>>>8^255&c^99,t[s]=c,r[c]=s;var u=n[s],d=n[u],f=n[d],h=257*n[c]^16843008*c;a[0][s]=h<<24|h>>>8,a[1][s]=h<<16|h>>>16,a[2][s]=h<<8|h>>>24,a[3][s]=h,h=16843009*f^65537*d^257*u^16843008*s,i[0][c]=h<<24|h>>>8,i[1][c]=h<<16|h>>>16,i[2][c]=h<<8|h>>>24,i[3][c]=h,0===s?s=o=1:(s=u^n[n[n[f^u]]],o^=n[n[o]])}return{SBOX:t,INV_SBOX:r,SUB_MIX:a,INV_SUB_MIX:i}}();function c(n){this._key=a(n),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var n=this._key,e=n.length,t=e+6,r=4*(t+1),a=[],i=0;i>>24,s=l.SBOX[s>>>24]<<24|l.SBOX[s>>>16&255]<<16|l.SBOX[s>>>8&255]<<8|l.SBOX[255&s],s^=o[i/e|0]<<24):e>6&&i%e==4&&(s=l.SBOX[s>>>24]<<24|l.SBOX[s>>>16&255]<<16|l.SBOX[s>>>8&255]<<8|l.SBOX[255&s]),a[i]=a[i-e]^s}for(var c=[],u=0;u>>24]]^l.INV_SUB_MIX[1][l.SBOX[f>>>16&255]]^l.INV_SUB_MIX[2][l.SBOX[f>>>8&255]]^l.INV_SUB_MIX[3][l.SBOX[255&f]]}this._nRounds=t,this._keySchedule=a,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(n){return s(n=a(n),this._keySchedule,l.SUB_MIX,l.SBOX,this._nRounds)},c.prototype.encryptBlock=function(n){var e=this.encryptBlockRaw(n),t=r.allocUnsafe(16);return t.writeUInt32BE(e[0],0),t.writeUInt32BE(e[1],4),t.writeUInt32BE(e[2],8),t.writeUInt32BE(e[3],12),t},c.prototype.decryptBlock=function(n){var e=(n=a(n))[1];n[1]=n[3],n[3]=e;var t=s(n,this._invKeySchedule,l.INV_SUB_MIX,l.INV_SBOX,this._nRounds),i=r.allocUnsafe(16);return i.writeUInt32BE(t[0],0),i.writeUInt32BE(t[3],4),i.writeUInt32BE(t[2],8),i.writeUInt32BE(t[1],12),i},c.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},n.exports.AES=c},function(n,e,t){var r=t(1).Buffer,a=t(70);n.exports=function(n,e,t,i){if(r.isBuffer(n)||(n=r.from(n,"binary")),e&&(r.isBuffer(e)||(e=r.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=t/8,o=r.alloc(s),l=r.alloc(i||0),c=r.alloc(0);s>0||i>0;){var u=new a;u.update(c),u.update(n),e&&u.update(e),c=u.digest();var d=0;if(s>0){var f=o.length-s;d=Math.min(s,c.length),c.copy(o,f,0,d),s-=d}if(d0){var h=l.length-i,p=Math.min(i,c.length-d);c.copy(l,h,d,d+p),i-=p}}return c.fill(0),{key:o,iv:l}}},function(n,e,t){"use strict";var r=e;r.base=t(310),r.short=t(311),r.mont=t(312),r.edwards=t(313)},function(n,e,t){var r=t(329),a=t(341),i=t(342),s=t(76),o=t(74),l=t(1).Buffer;function c(n){var e;"object"!=typeof n||l.isBuffer(n)||(e=n.passphrase,n=n.key),"string"==typeof n&&(n=l.from(n));var t,c,u=i(n,e),d=u.tag,f=u.data;switch(d){case"CERTIFICATE":c=r.certificate.decode(f,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(c||(c=r.PublicKey.decode(f,"der")),t=c.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return r.RSAPublicKey.decode(c.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return c.subjectPrivateKey=c.subjectPublicKey,{type:"ec",data:c};case"1.2.840.10040.4.1":return c.algorithm.params.pub_key=r.DSAparam.decode(c.subjectPublicKey.data,"der"),{type:"dsa",data:c.algorithm.params};default:throw new Error("unknown key id "+t)}throw new Error("unknown key type "+d);case"ENCRYPTED PRIVATE KEY":f=function(n,e){var t=n.algorithm.decrypt.kde.kdeparams.salt,r=parseInt(n.algorithm.decrypt.kde.kdeparams.iters.toString(),10),i=a[n.algorithm.decrypt.cipher.algo.join(".")],c=n.algorithm.decrypt.cipher.iv,u=n.subjectPrivateKey,d=parseInt(i.split("-")[1],10)/8,f=o.pbkdf2Sync(e,t,r,d,"sha1"),h=s.createDecipheriv(i,f,c),p=[];return p.push(h.update(u)),p.push(h.final()),l.concat(p)}(f=r.EncryptedPrivateKey.decode(f,"der"),e);case"PRIVATE KEY":switch(t=(c=r.PrivateKey.decode(f,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return r.RSAPrivateKey.decode(c.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:c.algorithm.curve,privateKey:r.ECPrivateKey.decode(c.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return c.algorithm.params.priv_key=r.DSAparam.decode(c.subjectPrivateKey,"der"),{type:"dsa",params:c.algorithm.params};default:throw new Error("unknown key id "+t)}throw new Error("unknown key type "+d);case"RSA PUBLIC KEY":return r.RSAPublicKey.decode(f,"der");case"RSA PRIVATE KEY":return r.RSAPrivateKey.decode(f,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:r.DSAPrivateKey.decode(f,"der")};case"EC PRIVATE KEY":return{curve:(f=r.ECPrivateKey.decode(f,"der")).parameters.value,privateKey:f.privateKey};default:throw new Error("unknown key type "+d)}}n.exports=c,c.signature=r.signature},function(n,e){n.exports=function(n){return n&&n.__esModule?n:{default:n}}},function(n,e,t){var r=t(53),a=t(82);n.exports=function(n){return r(a(n))}},function(n,e,t){var r=t(54);n.exports=Object("z").propertyIsEnumerable(0)?Object:function(n){return"String"==r(n)?n.split(""):Object(n)}},function(n,e){var t={}.toString;n.exports=function(n){return t.call(n).slice(8,-1)}},function(n,e,t){var r=t(89),a=Math.min;n.exports=function(n){return n>0?a(r(n),9007199254740991):0}},function(n,e,t){var r=t(90)("keys"),a=t(57);n.exports=function(n){return r[n]||(r[n]=a(n))}},function(n,e){var t=0,r=Math.random();n.exports=function(n){return"Symbol(".concat(void 0===n?"":n,")_",(++t+r).toString(36))}},function(n,e,t){var r=t(29).f,a=t(23),i=t(14)("toStringTag");n.exports=function(n,e,t){n&&!a(n=t?n:n.prototype,i)&&r(n,i,{configurable:!0,value:e})}},function(n,e,t){var r=t(82);n.exports=function(n){return Object(r(n))}},function(n,e,t){var r=t(40),a=t(53),i=t(59),s=t(55),o=t(184);n.exports=function(n,e){var t=1==n,l=2==n,c=3==n,u=4==n,d=6==n,f=5==n||d,h=e||o;return function(e,o,p){for(var m,b,g=i(e),y=a(g),v=r(o,p,3),_=s(y.length),w=0,k=t?h(e,_):l?h(e,0):void 0;_>w;w++)if((f||w in y)&&(b=v(m=y[w],w,g),n))if(t)k[w]=b;else if(b)switch(n){case 3:return!0;case 5:return m;case 6:return w;case 2:k.push(m)}else if(u)return!1;return d?-1:c||u?u:k}}},function(n,e,t){var r=t(57)("meta"),a=t(12),i=t(23),s=t(29).f,o=0,l=Object.isExtensible||function(){return!0},c=!t(31)(function(){return l(Object.preventExtensions({}))}),u=function(n){s(n,r,{value:{i:"O"+ ++o,w:{}}})},d=n.exports={KEY:r,NEED:!1,fastKey:function(n,e){if(!a(n))return"symbol"==typeof n?n:("string"==typeof n?"S":"P")+n;if(!i(n,r)){if(!l(n))return"F";if(!e)return"E";u(n)}return n[r].i},getWeak:function(n,e){if(!i(n,r)){if(!l(n))return!0;if(!e)return!1;u(n)}return n[r].w},onFreeze:function(n){return c&&d.NEED&&l(n)&&!i(n,r)&&u(n),n}}},function(n,e,t){var r=t(40),a=t(190),i=t(191),s=t(22),o=t(55),l=t(192),c={},u={};(e=n.exports=function(n,e,t,d,f){var h,p,m,b,g=f?function(){return n}:l(n),y=r(t,d,e?2:1),v=0;if("function"!=typeof g)throw TypeError(n+" is not iterable!");if(i(g)){for(h=o(n.length);h>v;v++)if((b=e?y(s(p=n[v])[0],p[1]):y(n[v]))===c||b===u)return b}else for(m=g.call(n);!(p=m.next()).done;)if((b=a(m,y,p.value,e))===c||b===u)return b}).BREAK=c,e.RETURN=u},function(n,e,t){var r=t(12);n.exports=function(n,e){if(!r(n)||n._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return n}},function(n,e,t){(function(n){var r=t(232),a=t(104),i=t(109),s=t(241),o=t(32),l=e;l.request=function(e,t){e="string"==typeof e?o.parse(e):i(e);var a=-1===n.location.protocol.search(/^https?:$/)?"http:":"",s=e.protocol||a,l=e.hostname||e.host,c=e.port,u=e.path||"/";l&&-1!==l.indexOf(":")&&(l="["+l+"]"),e.url=(l?s+"//"+l:"")+(c?":"+c:"")+u,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var d=new r(e);return t&&d.on("response",t),d},l.get=function(n,e){var t=l.request(n,e);return t.end(),t},l.ClientRequest=r,l.IncomingMessage=a.IncomingMessage,l.Agent=function(){},l.Agent.defaultMaxSockets=4,l.globalAgent=new l.Agent,l.STATUS_CODES=s,l.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,t(4))},function(n,e,t){"use strict";var r,a="object"==typeof Reflect?Reflect:null,i=a&&"function"==typeof a.apply?a.apply:function(n,e,t){return Function.prototype.apply.call(n,e,t)};r=a&&"function"==typeof a.ownKeys?a.ownKeys:Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:function(n){return Object.getOwnPropertyNames(n)};var s=Number.isNaN||function(n){return n!=n};function o(){o.init.call(this)}n.exports=o,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var l=10;function c(n){return void 0===n._maxListeners?o.defaultMaxListeners:n._maxListeners}function u(n,e,t,r){var a,i,s,o;if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);if(void 0===(i=n._events)?(i=n._events=Object.create(null),n._eventsCount=0):(void 0!==i.newListener&&(n.emit("newListener",e,t.listener?t.listener:t),i=n._events),s=i[e]),void 0===s)s=i[e]=t,++n._eventsCount;else if("function"==typeof s?s=i[e]=r?[t,s]:[s,t]:r?s.unshift(t):s.push(t),(a=c(n))>0&&s.length>a&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=n,l.type=e,l.count=s.length,o=l,console&&console.warn&&console.warn(o)}return n}function d(n,e,t){var r={fired:!1,wrapFn:void 0,target:n,type:e,listener:t},a=function(){for(var n=[],e=0;e0&&(s=e[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var l=a[n];if(void 0===l)return!1;if("function"==typeof l)i(l,this,e);else{var c=l.length,u=p(l,c);for(t=0;t=0;i--)if(t[i]===e||t[i].listener===e){s=t[i].listener,a=i;break}if(a<0)return this;0===a?t.shift():function(n,e){for(;e+1=0;r--)this.removeListener(n,e[r]);return this},o.prototype.listeners=function(n){return f(this,n,!0)},o.prototype.rawListeners=function(n){return f(this,n,!1)},o.listenerCount=function(n,e){return"function"==typeof n.listenerCount?n.listenerCount(e):h.call(n,e)},o.prototype.listenerCount=h,o.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(n,e,t){"use strict";(function(e,r,a){var i=t(41);function s(n){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(n,e,t){var r=n.entry;n.entry=null;for(;r;){var a=r.callback;e.pendingcb--,a(t),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=n:e.corkedRequestsFree=n}(e,n)}}n.exports=y;var o,l=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?r:i.nextTick;y.WritableState=g;var c=t(34);c.inherits=t(0);var u={deprecate:t(238)},d=t(106),f=t(1).Buffer,h=a.Uint8Array||function(){};var p,m=t(107);function b(){}function g(n,e){o=o||t(19),n=n||{};var r=e instanceof o;this.objectMode=!!n.objectMode,r&&(this.objectMode=this.objectMode||!!n.writableObjectMode);var a=n.highWaterMark,c=n.writableHighWaterMark,u=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:r&&(c||0===c)?c:u,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 d=!1===n.decodeStrings;this.decodeStrings=!d,this.defaultEncoding=n.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){!function(n,e){var t=n._writableState,r=t.sync,a=t.writecb;if(function(n){n.writing=!1,n.writecb=null,n.length-=n.writelen,n.writelen=0}(t),e)!function(n,e,t,r,a){--e.pendingcb,t?(i.nextTick(a,r),i.nextTick(S,n,e),n._writableState.errorEmitted=!0,n.emit("error",r)):(a(r),n._writableState.errorEmitted=!0,n.emit("error",r),S(n,e))}(n,t,r,e,a);else{var s=k(t);s||t.corked||t.bufferProcessing||!t.bufferedRequest||w(n,t),r?l(_,n,t,s,a):_(n,t,s,a)}}(e,n)},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 s(this)}function y(n){if(o=o||t(19),!(p.call(y,this)||this instanceof o))return new y(n);this._writableState=new g(n,this),this.writable=!0,n&&("function"==typeof n.write&&(this._write=n.write),"function"==typeof n.writev&&(this._writev=n.writev),"function"==typeof n.destroy&&(this._destroy=n.destroy),"function"==typeof n.final&&(this._final=n.final)),d.call(this)}function v(n,e,t,r,a,i,s){e.writelen=r,e.writecb=s,e.writing=!0,e.sync=!0,t?n._writev(a,e.onwrite):n._write(a,i,e.onwrite),e.sync=!1}function _(n,e,t,r){t||function(n,e){0===e.length&&e.needDrain&&(e.needDrain=!1,n.emit("drain"))}(n,e),e.pendingcb--,r(),S(n,e)}function w(n,e){e.bufferProcessing=!0;var t=e.bufferedRequest;if(n._writev&&t&&t.next){var r=e.bufferedRequestCount,a=new Array(r),i=e.corkedRequestsFree;i.entry=t;for(var o=0,l=!0;t;)a[o]=t,t.isBuf||(l=!1),t=t.next,o+=1;a.allBuffers=l,v(n,e,!0,e.length,a,"",i.finish),e.pendingcb++,e.lastBufferedRequest=null,i.next?(e.corkedRequestsFree=i.next,i.next=null):e.corkedRequestsFree=new s(e),e.bufferedRequestCount=0}else{for(;t;){var c=t.chunk,u=t.encoding,d=t.callback;if(v(n,e,!1,e.objectMode?1:c.length,c,u,d),t=t.next,e.bufferedRequestCount--,e.writing)break}null===t&&(e.lastBufferedRequest=null)}e.bufferedRequest=t,e.bufferProcessing=!1}function k(n){return n.ending&&0===n.length&&null===n.bufferedRequest&&!n.finished&&!n.writing}function x(n,e){n._final(function(t){e.pendingcb--,t&&n.emit("error",t),e.prefinished=!0,n.emit("prefinish"),S(n,e)})}function S(n,e){var t=k(e);return t&&(!function(n,e){e.prefinished||e.finalCalled||("function"==typeof n._final?(e.pendingcb++,e.finalCalled=!0,i.nextTick(x,n,e)):(e.prefinished=!0,n.emit("prefinish")))}(n,e),0===e.pendingcb&&(e.finished=!0,n.emit("finish"))),t}c.inherits(y,d),g.prototype.getBuffer=function(){for(var n=this.bufferedRequest,e=[];n;)e.push(n),n=n.next;return e},function(){try{Object.defineProperty(g.prototype,"buffer",{get:u.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(n){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(n){return!!p.call(this,n)||this===y&&(n&&n._writableState instanceof g)}})):p=function(n){return n instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(n,e,t){var r,a=this._writableState,s=!1,o=!a.objectMode&&(r=n,f.isBuffer(r)||r instanceof h);return o&&!f.isBuffer(n)&&(n=function(n){return f.from(n)}(n)),"function"==typeof e&&(t=e,e=null),o?e="buffer":e||(e=a.defaultEncoding),"function"!=typeof t&&(t=b),a.ended?function(n,e){var t=new Error("write after end");n.emit("error",t),i.nextTick(e,t)}(this,t):(o||function(n,e,t,r){var a=!0,s=!1;return null===t?s=new TypeError("May not write null values to stream"):"string"==typeof t||void 0===t||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(n.emit("error",s),i.nextTick(r,s),a=!1),a}(this,a,n,t))&&(a.pendingcb++,s=function(n,e,t,r,a,i){if(!t){var s=function(n,e,t){n.objectMode||!1===n.decodeStrings||"string"!=typeof e||(e=f.from(e,t));return e}(e,r,a);r!==s&&(t=!0,a="buffer",r=s)}var o=e.objectMode?1:r.length;e.length+=o;var l=e.length-1))throw new TypeError("Unknown encoding: "+n);return this._writableState.defaultEncoding=n,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(n,e,t){t(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(n,e,t){var r=this._writableState;"function"==typeof n?(t=n,n=null,e=null):"function"==typeof e&&(t=e,e=null),null!=n&&this.write(n,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(n,e,t){e.ending=!0,S(n,e),t&&(e.finished?i.nextTick(t):n.once("finish",t));e.ended=!0,n.writable=!1}(this,r,t)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(n){this._writableState&&(this._writableState.destroyed=n)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(n,e){this.end(),e(n)}}).call(this,t(8),t(236).setImmediate,t(4))},function(n,e,t){"use strict";var r=t(1).Buffer,a=r.isEncoding||function(n){switch((n=""+n)&&n.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 i(n){var e;switch(this.encoding=function(n){var e=function(n){if(!n)return"utf8";for(var e;;)switch(n){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 n;default:if(e)return;n=(""+n).toLowerCase(),e=!0}}(n);if("string"!=typeof e&&(r.isEncoding===a||!a(n)))throw new Error("Unknown encoding: "+n);return e||n}(n),this.encoding){case"utf16le":this.text=l,this.end=c,e=4;break;case"utf8":this.fillLast=o,e=4;break;case"base64":this.text=u,this.end=d,e=3;break;default:return this.write=f,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function s(n){return n<=127?0:n>>5==6?2:n>>4==14?3:n>>3==30?4:n>>6==2?-1:-2}function o(n){var e=this.lastTotal-this.lastNeed,t=function(n,e,t){if(128!=(192&e[0]))return n.lastNeed=0,"�";if(n.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return n.lastNeed=1,"�";if(n.lastNeed>2&&e.length>2&&128!=(192&e[2]))return n.lastNeed=2,"�"}}(this,n);return void 0!==t?t:this.lastNeed<=n.length?(n.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(n.copy(this.lastChar,e,0,n.length),void(this.lastNeed-=n.length))}function l(n,e){if((n.length-e)%2==0){var t=n.toString("utf16le",e);if(t){var r=t.charCodeAt(t.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=n[n.length-1],n.toString("utf16le",e,n.length-1)}function c(n){var e=n&&n.length?this.write(n):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,t)}return e}function u(n,e){var t=(n.length-e)%3;return 0===t?n.toString("base64",e):(this.lastNeed=3-t,this.lastTotal=3,1===t?this.lastChar[0]=n[n.length-1]:(this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1]),n.toString("base64",e,n.length-t))}function d(n){var e=n&&n.length?this.write(n):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f(n){return n.toString(this.encoding)}function h(n){return n&&n.length?this.write(n):""}e.StringDecoder=i,i.prototype.write=function(n){if(0===n.length)return"";var e,t;if(this.lastNeed){if(void 0===(e=this.fillLast(n)))return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t=0)return a>0&&(n.lastNeed=a-1),a;if(--r=0)return a>0&&(n.lastNeed=a-2),a;if(--r=0)return a>0&&(2===a?a=0:n.lastNeed=a-3),a;return 0}(this,n,e);if(!this.lastNeed)return n.toString("utf8",e);this.lastTotal=t;var r=n.length-(t-this.lastNeed);return n.copy(this.lastChar,0,r),n.toString("utf8",e,r)},i.prototype.fillLast=function(n){if(this.lastNeed<=n.length)return n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,n.length),this.lastNeed-=n.length}},function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function n(){this.listeners={}}return n.prototype.addEventListener=function(n,e){n=n.toLowerCase(),this.listeners[n]=this.listeners[n]||[],this.listeners[n].push(e.handleEvent||e)},n.prototype.removeEventListener=function(n,e){if(n=n.toLowerCase(),this.listeners[n]){var t=this.listeners[n].indexOf(e.handleEvent||e);t<0||this.listeners[n].splice(t,1)}},n.prototype.dispatchEvent=function(n){var e=n.type.toLowerCase();if(n.target=this,this.listeners[e])for(var t=0,r=this.listeners[e];t>6|192);else{if(a>55295&&a<56320){if(++r==n.length)return null;var i=n.charCodeAt(r);if(i<56320||i>57343)return null;t+=e((a=65536+((1023&a)<<10)+(1023&i))>>18|240),t+=e(a>>12&63|128)}else t+=e(a>>12|224);t+=e(a>>6&63|128)}t+=e(63&a|128)}}return t},toString:function(n){for(var e="",t=0,i=a(n);t127){if(s>191&&s<224){if(t>=i)return null;s=(31&s)<<6|63&r(n,t)}else if(s>223&&s<240){if(t+1>=i)return null;s=(15&s)<<12|(63&r(n,t))<<6|63&r(n,++t)}else{if(!(s>239&&s<248))return null;if(t+2>=i)return null;s=(7&s)<<18|(63&r(n,t))<<12|(63&r(n,++t))<<6|63&r(n,++t)}++t}if(s<=65535)e+=String.fromCharCode(s);else{if(!(s<=1114111))return null;s-=65536,e+=String.fromCharCode(s>>10|55296),e+=String.fromCharCode(1023&s|56320)}}return e},fromNumber:function(n){var e=n.toString(16);return e.length%2==0?"0x"+e:"0x0"+e},toNumber:function(n){return parseInt(n.slice(2),16)},fromNat:function(n){return"0x0"===n?"0x":n.length%2==0?n:"0x0"+n.slice(2)},toNat:function(n){return"0"===n[2]?"0x"+n.slice(3):n},fromArray:s,toArray:i,fromUint8Array:function(n){return s([].slice.call(n,0))},toUint8Array:function(n){return new Uint8Array(i(n))}}},function(n,e,t){"use strict";var r=t(0),a=t(119),i=t(1).Buffer,s=new Array(16);function o(){a.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function l(n,e){return n<>>32-e}function c(n,e,t,r,a,i,s){return l(n+(e&t|~e&r)+a+i|0,s)+e|0}function u(n,e,t,r,a,i,s){return l(n+(e&r|t&~r)+a+i|0,s)+e|0}function d(n,e,t,r,a,i,s){return l(n+(e^t^r)+a+i|0,s)+e|0}function f(n,e,t,r,a,i,s){return l(n+(t^(e|~r))+a+i|0,s)+e|0}r(o,a),o.prototype._update=function(){for(var n=s,e=0;e<16;++e)n[e]=this._block.readInt32LE(4*e);var t=this._a,r=this._b,a=this._c,i=this._d;t=c(t,r,a,i,n[0],3614090360,7),i=c(i,t,r,a,n[1],3905402710,12),a=c(a,i,t,r,n[2],606105819,17),r=c(r,a,i,t,n[3],3250441966,22),t=c(t,r,a,i,n[4],4118548399,7),i=c(i,t,r,a,n[5],1200080426,12),a=c(a,i,t,r,n[6],2821735955,17),r=c(r,a,i,t,n[7],4249261313,22),t=c(t,r,a,i,n[8],1770035416,7),i=c(i,t,r,a,n[9],2336552879,12),a=c(a,i,t,r,n[10],4294925233,17),r=c(r,a,i,t,n[11],2304563134,22),t=c(t,r,a,i,n[12],1804603682,7),i=c(i,t,r,a,n[13],4254626195,12),a=c(a,i,t,r,n[14],2792965006,17),t=u(t,r=c(r,a,i,t,n[15],1236535329,22),a,i,n[1],4129170786,5),i=u(i,t,r,a,n[6],3225465664,9),a=u(a,i,t,r,n[11],643717713,14),r=u(r,a,i,t,n[0],3921069994,20),t=u(t,r,a,i,n[5],3593408605,5),i=u(i,t,r,a,n[10],38016083,9),a=u(a,i,t,r,n[15],3634488961,14),r=u(r,a,i,t,n[4],3889429448,20),t=u(t,r,a,i,n[9],568446438,5),i=u(i,t,r,a,n[14],3275163606,9),a=u(a,i,t,r,n[3],4107603335,14),r=u(r,a,i,t,n[8],1163531501,20),t=u(t,r,a,i,n[13],2850285829,5),i=u(i,t,r,a,n[2],4243563512,9),a=u(a,i,t,r,n[7],1735328473,14),t=d(t,r=u(r,a,i,t,n[12],2368359562,20),a,i,n[5],4294588738,4),i=d(i,t,r,a,n[8],2272392833,11),a=d(a,i,t,r,n[11],1839030562,16),r=d(r,a,i,t,n[14],4259657740,23),t=d(t,r,a,i,n[1],2763975236,4),i=d(i,t,r,a,n[4],1272893353,11),a=d(a,i,t,r,n[7],4139469664,16),r=d(r,a,i,t,n[10],3200236656,23),t=d(t,r,a,i,n[13],681279174,4),i=d(i,t,r,a,n[0],3936430074,11),a=d(a,i,t,r,n[3],3572445317,16),r=d(r,a,i,t,n[6],76029189,23),t=d(t,r,a,i,n[9],3654602809,4),i=d(i,t,r,a,n[12],3873151461,11),a=d(a,i,t,r,n[15],530742520,16),t=f(t,r=d(r,a,i,t,n[2],3299628645,23),a,i,n[0],4096336452,6),i=f(i,t,r,a,n[7],1126891415,10),a=f(a,i,t,r,n[14],2878612391,15),r=f(r,a,i,t,n[5],4237533241,21),t=f(t,r,a,i,n[12],1700485571,6),i=f(i,t,r,a,n[3],2399980690,10),a=f(a,i,t,r,n[10],4293915773,15),r=f(r,a,i,t,n[1],2240044497,21),t=f(t,r,a,i,n[8],1873313359,6),i=f(i,t,r,a,n[15],4264355552,10),a=f(a,i,t,r,n[6],2734768916,15),r=f(r,a,i,t,n[13],1309151649,21),t=f(t,r,a,i,n[4],4149444226,6),i=f(i,t,r,a,n[11],3174756917,10),a=f(a,i,t,r,n[2],718787259,15),r=f(r,a,i,t,n[9],3951481745,21),this._a=this._a+t|0,this._b=this._b+r|0,this._c=this._c+a|0,this._d=this._d+i|0},o.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 n=i.allocUnsafe(16);return n.writeInt32LE(this._a,0),n.writeInt32LE(this._b,4),n.writeInt32LE(this._c,8),n.writeInt32LE(this._d,12),n},n.exports=o},function(n,e,t){n.exports=a;var r=t(65).EventEmitter;function a(){r.call(this)}t(0)(a,r),a.Readable=t(33),a.Writable=t(274),a.Duplex=t(275),a.Transform=t(276),a.PassThrough=t(277),a.Stream=a,a.prototype.pipe=function(n,e){var t=this;function a(e){n.writable&&!1===n.write(e)&&t.pause&&t.pause()}function i(){t.readable&&t.resume&&t.resume()}t.on("data",a),n.on("drain",i),n._isStdio||e&&!1===e.end||(t.on("end",o),t.on("close",l));var s=!1;function o(){s||(s=!0,n.end())}function l(){s||(s=!0,"function"==typeof n.destroy&&n.destroy())}function c(n){if(u(),0===r.listenerCount(this,"error"))throw n}function u(){t.removeListener("data",a),n.removeListener("drain",i),t.removeListener("end",o),t.removeListener("close",l),t.removeListener("error",c),n.removeListener("error",c),t.removeListener("end",u),t.removeListener("close",u),n.removeListener("close",u)}return t.on("error",c),n.on("error",c),t.on("end",u),t.on("close",u),n.on("close",u),n.emit("pipe",t),n}},function(n,e,t){"use strict";var r=t(2).Buffer,a=t(0),i=t(119),s=new Array(16),o=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],l=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],c=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],u=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],d=[0,1518500249,1859775393,2400959708,2840853838],f=[1352829926,1548603684,1836072691,2053994217,0];function h(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(n,e){return n<>>32-e}function m(n,e,t,r,a,i,s,o){return p(n+(e^t^r)+i+s|0,o)+a|0}function b(n,e,t,r,a,i,s,o){return p(n+(e&t|~e&r)+i+s|0,o)+a|0}function g(n,e,t,r,a,i,s,o){return p(n+((e|~t)^r)+i+s|0,o)+a|0}function y(n,e,t,r,a,i,s,o){return p(n+(e&r|t&~r)+i+s|0,o)+a|0}function v(n,e,t,r,a,i,s,o){return p(n+(e^(t|~r))+i+s|0,o)+a|0}a(h,i),h.prototype._update=function(){for(var n=s,e=0;e<16;++e)n[e]=this._block.readInt32LE(4*e);for(var t=0|this._a,r=0|this._b,a=0|this._c,i=0|this._d,h=0|this._e,_=0|this._a,w=0|this._b,k=0|this._c,x=0|this._d,S=0|this._e,A=0;A<80;A+=1){var E,T;A<16?(E=m(t,r,a,i,h,n[o[A]],d[0],c[A]),T=v(_,w,k,x,S,n[l[A]],f[0],u[A])):A<32?(E=b(t,r,a,i,h,n[o[A]],d[1],c[A]),T=y(_,w,k,x,S,n[l[A]],f[1],u[A])):A<48?(E=g(t,r,a,i,h,n[o[A]],d[2],c[A]),T=g(_,w,k,x,S,n[l[A]],f[2],u[A])):A<64?(E=y(t,r,a,i,h,n[o[A]],d[3],c[A]),T=b(_,w,k,x,S,n[l[A]],f[3],u[A])):(E=v(t,r,a,i,h,n[o[A]],d[4],c[A]),T=m(_,w,k,x,S,n[l[A]],f[4],u[A])),t=h,h=i,i=p(a,10),a=r,r=E,_=S,S=x,x=p(k,10),k=w,w=T}var C=this._b+a+x|0;this._b=this._c+i+S|0,this._c=this._d+h+_|0,this._d=this._e+t+w|0,this._e=this._a+r+k|0,this._a=C},h.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var n=r.alloc?r.alloc(20):new r(20);return n.writeInt32LE(this._a,0),n.writeInt32LE(this._b,4),n.writeInt32LE(this._c,8),n.writeInt32LE(this._d,12),n.writeInt32LE(this._e,16),n},n.exports=h},function(n,e,t){(e=n.exports=function(n){n=n.toLowerCase();var t=e[n];if(!t)throw new Error(n+" is not supported (we accept pull requests)");return new t}).sha=t(278),e.sha1=t(279),e.sha224=t(280),e.sha256=t(120),e.sha384=t(281),e.sha512=t(121)},function(n,e,t){e.pbkdf2=t(284),e.pbkdf2Sync=t(127)},function(n,e,t){"use strict";e.utils=t(287),e.Cipher=t(288),e.DES=t(289),e.CBC=t(290),e.EDE=t(291)},function(n,e,t){var r=t(292),a=t(300),i=t(130);e.createCipher=e.Cipher=r.createCipher,e.createCipheriv=e.Cipheriv=r.createCipheriv,e.createDecipher=e.Decipher=a.createDecipher,e.createDecipheriv=e.Decipheriv=a.createDecipheriv,e.listCiphers=e.getCiphers=function(){return Object.keys(i)}},function(n,e,t){var r={ECB:t(293),CBC:t(294),CFB:t(295),CFB8:t(296),CFB1:t(297),OFB:t(298),CTR:t(128),GCM:t(128)},a=t(130);for(var i in a)a[i].module=r[a[i].mode];n.exports=a},function(n,e,t){(function(e){var r=t(3),a=t(25);function i(n,t){var a=function(n){var e=s(n);return{blinder:e.toRed(r.mont(n.modulus)).redPow(new r(n.publicExponent)).fromRed(),unblinder:e.invm(n.modulus)}}(t),i=t.modulus.byteLength(),o=(r.mont(t.modulus),new r(n).mul(a.blinder).umod(t.modulus)),l=o.toRed(r.mont(t.prime1)),c=o.toRed(r.mont(t.prime2)),u=t.coefficient,d=t.prime1,f=t.prime2,h=l.redPow(t.exponent1),p=c.redPow(t.exponent2);h=h.fromRed(),p=p.fromRed();var m=h.isub(p).imul(u).umod(d);return m.imul(f),p.iadd(m),new e(p.imul(a.unblinder).umod(t.modulus).toArray(!1,i))}function s(n){for(var e=n.modulus.byteLength(),t=new r(a(e));t.cmp(n.modulus)>=0||!t.umod(n.prime1)||!t.umod(n.prime2);)t=new r(a(e));return t}n.exports=i,i.getr=s}).call(this,t(2).Buffer)},function(n,e,t){var r=e;r.utils=t(11),r.common=t(37),r.sha=t(315),r.ripemd=t(319),r.hmac=t(320),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},function(n,e,t){"use strict";var r=t(370);n.exports=Function.prototype.bind||r},function(n,e,t){"use strict";var r=Function.prototype.toString,a=/^\s*class\b/,i=function(n){try{var e=r.call(n);return a.test(e)}catch(n){return!1}},s=Object.prototype.toString,o="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;n.exports=function(n){if(!n)return!1;if("function"!=typeof n&&"object"!=typeof n)return!1;if("function"==typeof n&&!n.prototype)return!0;if(o)return function(n){try{return!i(n)&&(r.call(n),!0)}catch(n){return!1}}(n);if(i(n))return!1;var e=s.call(n);return"[object Function]"===e||"[object GeneratorFunction]"===e}},function(n,e){n.exports=function(n){if(null==n)throw TypeError("Can't call method on "+n);return n}},function(n,e){n.exports=!0},function(n,e){n.exports=function(n){if("function"!=typeof n)throw TypeError(n+" is not a function!");return n}},function(n,e,t){var r=t(12),a=t(13).document,i=r(a)&&r(a.createElement);n.exports=function(n){return i?a.createElement(n):{}}},function(n,e){n.exports=function(n,e){return{enumerable:!(1&n),configurable:!(2&n),writable:!(4&n),value:e}}},function(n,e,t){n.exports=t(16)},function(n,e,t){var r=t(178),a=t(91);n.exports=Object.keys||function(n){return r(n,a)}},function(n,e){var t=Math.ceil,r=Math.floor;n.exports=function(n){return isNaN(n=+n)?0:(n>0?r:t)(n)}},function(n,e,t){var r=t(21),a=t(13),i=a["__core-js_shared__"]||(a["__core-js_shared__"]={});(n.exports=function(n,e){return i[n]||(i[n]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:t(83)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(n,e){n.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(n,e,t){"use strict";var r=t(88),a=t(187),i=t(188),s=t(59),o=t(53),l=Object.assign;n.exports=!l||t(31)(function(){var n={},e={},t=Symbol(),r="abcdefghijklmnopqrst";return n[t]=7,r.split("").forEach(function(n){e[n]=n}),7!=l({},n)[t]||Object.keys(l({},e)).join("")!=r})?function(n,e){for(var t=s(n),l=arguments.length,c=1,u=a.f,d=i.f;l>c;)for(var f,h=o(arguments[c++]),p=u?r(h).concat(u(h)):r(h),m=p.length,b=0;m>b;)d.call(h,f=p[b++])&&(t[f]=h[f]);return t}:l},function(n,e,t){var r=t(16);n.exports=function(n,e,t){for(var a in e)t&&n[a]?n[a]=e[a]:r(n,a,e[a]);return n}},function(n,e){n.exports=function(n,e,t,r){if(!(n instanceof e)||void 0!==r&&r in n)throw TypeError(t+": incorrect invocation!");return n}},function(n,e){var t={}.toString;n.exports=Array.isArray||function(n){return"[object Array]"==t.call(n)}},function(n,e,t){var r=t(210),a=t(211);n.exports=function(n){if("string"==typeof n||"number"==typeof n){var e=new r(1),t=String(n).toLowerCase().trim(),i="0x"===t.substr(0,2)||"-0x"===t.substr(0,3),s=a(t);if("-"===s.substr(0,1)&&(s=a(s.slice(1)),e=new r(-1,10)),!(s=""===s?"0":s).match(/^-?[0-9]+$/)&&s.match(/^[0-9A-Fa-f]+$/)||s.match(/^[a-fA-F]+$/)||!0===i&&s.match(/^[0-9A-Fa-f]+$/))return new r(s,16).mul(e);if((s.match(/^-?[0-9]+$/)||""===s)&&!1===i)return new r(s,10).mul(e)}else if("object"==typeof n&&n.toString&&!n.pop&&!n.push&&n.toString(10).match(/^-?[0-9]+$/)&&(n.mul||n.dividedToIntegerBy))return new r(n.toString(10),10);throw new Error("[number-to-bn] while converting number "+JSON.stringify(n)+" 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(n,e,t){var r=t(5),a=t(98),i=t(96),s=t(213),o=t(99),l=function(n){return n instanceof a||n&&n.constructor&&"BN"===n.constructor.name},c=function(n){return n&&n.constructor&&"BigNumber"===n.constructor.name},u=function(n){try{return i.apply(null,arguments)}catch(e){throw new Error(e+' Given value: "'+n+'"')}},d=function(n){return!!/^(0x)?[0-9a-f]{40}$/i.test(n)&&(!(!/^(0x|0X)?[0-9a-f]{40}$/.test(n)&&!/^(0x|0X)?[0-9A-F]{40}$/.test(n))||f(n))},f=function(n){n=n.replace(/^0x/i,"");for(var e=g(n.toLowerCase()).replace(/^0x/i,""),t=0;t<40;t++)if(parseInt(e[t],16)>7&&n[t].toUpperCase()!==n[t]||parseInt(e[t],16)<=7&&n[t].toLowerCase()!==n[t])return!1;return!0},h=function(n){var e="";n=(n=(n=(n=(n=s.encode(n)).replace(/^(?:\u0000)*/,"")).split("").reverse().join("")).replace(/^(?:\u0000)*/,"")).split("").reverse().join("");for(var t=0;t>>4).toString(16)),e.push((15&n[t]).toString(16));return"0x"+e.join("")},isHex:function(n){return(r.isString(n)||r.isNumber(n))&&/^(-0x|0x)?[0-9a-f]*$/i.test(n)},isHexStrict:b,leftPad:function(n,e,t){var r=/^0x/i.test(n)||"number"==typeof n,a=e-(n=n.toString(16).replace(/^0x/i,"")).length+1>=0?e-n.length+1:0;return(r?"0x":"")+new Array(a).join(t||"0")+n},rightPad:function(n,e,t){var r=/^0x/i.test(n)||"number"==typeof n,a=e-(n=n.toString(16).replace(/^0x/i,"")).length+1>=0?e-n.length+1:0;return(r?"0x":"")+n+new Array(a).join(t||"0")},toTwosComplement:function(n){return"0x"+u(n).toTwos(256).toString(16,64)},sha3:g}},function(n,e,t){(function(n){!function(n,e){"use strict";function r(n,e){if(!n)throw new Error(e||"Assertion failed")}function a(n,e){n.super_=e;var t=function(){};t.prototype=e.prototype,n.prototype=new t,n.prototype.constructor=n}function i(n,e,t){if(i.isBN(n))return n;this.negative=0,this.words=null,this.length=0,this.red=null,null!==n&&("le"!==e&&"be"!==e||(t=e,e=10),this._init(n||0,e||10,t||"be"))}var s;"object"==typeof n?n.exports=i:e.BN=i,i.BN=i,i.wordSize=26;try{s=t(2).Buffer}catch(n){}function o(n,e,t){for(var r=0,a=Math.min(n.length,t),i=e;i=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return r}function l(n,e,t,r){for(var a=0,i=Math.min(n.length,t),s=e;s=49?o-49+10:o>=17?o-17+10:o}return a}i.isBN=function(n){return n instanceof i||null!==n&&"object"==typeof n&&n.constructor.wordSize===i.wordSize&&Array.isArray(n.words)},i.max=function(n,e){return n.cmp(e)>0?n:e},i.min=function(n,e){return n.cmp(e)<0?n:e},i.prototype._init=function(n,e,t){if("number"==typeof n)return this._initNumber(n,e,t);if("object"==typeof n)return this._initArray(n,e,t);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var a=0;"-"===(n=n.toString().replace(/\s+/g,""))[0]&&a++,16===e?this._parseHex(n,a):this._parseBase(n,e,a),"-"===n[0]&&(this.negative=1),this.strip(),"le"===t&&this._initArray(this.toArray(),e,t)},i.prototype._initNumber=function(n,e,t){n<0&&(this.negative=1,n=-n),n<67108864?(this.words=[67108863&n],this.length=1):n<4503599627370496?(this.words=[67108863&n,n/67108864&67108863],this.length=2):(r(n<9007199254740992),this.words=[67108863&n,n/67108864&67108863,1],this.length=3),"le"===t&&this._initArray(this.toArray(),e,t)},i.prototype._initArray=function(n,e,t){if(r("number"==typeof n.length),n.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(n.length/3),this.words=new Array(this.length);for(var a=0;a=0;a-=3)s=n[a]|n[a-1]<<8|n[a-2]<<16,this.words[i]|=s<>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);else if("le"===t)for(a=0,i=0;a>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);return this.strip()},i.prototype._parseHex=function(n,e){this.length=Math.ceil((n.length-e)/6),this.words=new Array(this.length);for(var t=0;t=e;t-=6)a=o(n,t,t+6),this.words[r]|=a<>>26-i&4194303,(i+=24)>=26&&(i-=26,r++);t+6!==e&&(a=o(n,e,t+6),this.words[r]|=a<>>26-i&4194303),this.strip()},i.prototype._parseBase=function(n,e,t){this.words=[0],this.length=1;for(var r=0,a=1;a<=67108863;a*=e)r++;r--,a=a/e|0;for(var i=n.length-t,s=i%r,o=Math.min(i,i-s)+t,c=0,u=t;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var c=["","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"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(n,e,t){t.negative=e.negative^n.negative;var r=n.length+e.length|0;t.length=r,r=r-1|0;var a=0|n.words[0],i=0|e.words[0],s=a*i,o=67108863&s,l=s/67108864|0;t.words[0]=o;for(var c=1;c>>26,d=67108863&l,f=Math.min(c,e.length-1),h=Math.max(0,c-n.length+1);h<=f;h++){var p=c-h|0;u+=(s=(a=0|n.words[p])*(i=0|e.words[h])+d)/67108864|0,d=67108863&s}t.words[c]=0|d,l=0|u}return 0!==l?t.words[c]=0|l:t.length--,t.strip()}i.prototype.toString=function(n,e){var t;if(e=0|e||1,16===(n=n||10)||"hex"===n){t="";for(var a=0,i=0,s=0;s>>24-a&16777215)||s!==this.length-1?c[6-l.length]+l+t:l+t,(a+=2)>=26&&(a-=26,s--)}for(0!==i&&(t=i.toString(16)+t);t.length%e!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}if(n===(0|n)&&n>=2&&n<=36){var f=u[n],h=d[n];t="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(h).toString(n);t=(p=p.idivn(h)).isZero()?m+t:c[f-m.length]+m+t}for(this.isZero()&&(t="0"+t);t.length%e!=0;)t="0"+t;return 0!==this.negative&&(t="-"+t),t}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var n=this.words[0];return 2===this.length?n+=67108864*this.words[1]:3===this.length&&1===this.words[2]?n+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-n:n},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(n,e){return r(void 0!==s),this.toArrayLike(s,n,e)},i.prototype.toArray=function(n,e){return this.toArrayLike(Array,n,e)},i.prototype.toArrayLike=function(n,e,t){var a=this.byteLength(),i=t||Math.max(1,a);r(a<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var s,o,l="le"===e,c=new n(i),u=this.clone();if(l){for(o=0;!u.isZero();o++)s=u.andln(255),u.iushrn(8),c[o]=s;for(;o=4096&&(t+=13,e>>>=13),e>=64&&(t+=7,e>>>=7),e>=8&&(t+=4,e>>>=4),e>=2&&(t+=2,e>>>=2),t+e},i.prototype._zeroBits=function(n){if(0===n)return 26;var e=n,t=0;return 0==(8191&e)&&(t+=13,e>>>=13),0==(127&e)&&(t+=7,e>>>=7),0==(15&e)&&(t+=4,e>>>=4),0==(3&e)&&(t+=2,e>>>=2),0==(1&e)&&t++,t},i.prototype.bitLength=function(){var n=this.words[this.length-1],e=this._countBits(n);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var n=0,e=0;en.length?this.clone().ior(n):n.clone().ior(this)},i.prototype.uor=function(n){return this.length>n.length?this.clone().iuor(n):n.clone().iuor(this)},i.prototype.iuand=function(n){var e;e=this.length>n.length?n:this;for(var t=0;tn.length?this.clone().iand(n):n.clone().iand(this)},i.prototype.uand=function(n){return this.length>n.length?this.clone().iuand(n):n.clone().iuand(this)},i.prototype.iuxor=function(n){var e,t;this.length>n.length?(e=this,t=n):(e=n,t=this);for(var r=0;rn.length?this.clone().ixor(n):n.clone().ixor(this)},i.prototype.uxor=function(n){return this.length>n.length?this.clone().iuxor(n):n.clone().iuxor(this)},i.prototype.inotn=function(n){r("number"==typeof n&&n>=0);var e=0|Math.ceil(n/26),t=n%26;this._expand(e),t>0&&e--;for(var a=0;a0&&(this.words[a]=~this.words[a]&67108863>>26-t),this.strip()},i.prototype.notn=function(n){return this.clone().inotn(n)},i.prototype.setn=function(n,e){r("number"==typeof n&&n>=0);var t=n/26|0,a=n%26;return this._expand(t+1),this.words[t]=e?this.words[t]|1<n.length?(t=this,r=n):(t=n,r=this);for(var a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=t.length,0!==a)this.words[this.length]=a,this.length++;else if(t!==this)for(;in.length?this.clone().iadd(n):n.clone().iadd(this)},i.prototype.isub=function(n){if(0!==n.negative){n.negative=0;var e=this.iadd(n);return n.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(n),this.negative=1,this._normSign();var t,r,a=this.cmp(n);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(t=this,r=n):(t=n,r=this);for(var i=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==i&&s>26,this.words[s]=67108863&e;if(0===i&&s>>13,h=0|s[1],p=8191&h,m=h>>>13,b=0|s[2],g=8191&b,y=b>>>13,v=0|s[3],_=8191&v,w=v>>>13,k=0|s[4],x=8191&k,S=k>>>13,A=0|s[5],E=8191&A,T=A>>>13,C=0|s[6],I=8191&C,j=C>>>13,R=0|s[7],B=8191&R,M=R>>>13,N=0|s[8],P=8191&N,O=N>>>13,L=0|s[9],D=8191&L,q=L>>>13,F=0|o[0],U=8191&F,z=F>>>13,K=0|o[1],H=8191&K,G=K>>>13,V=0|o[2],W=8191&V,Y=V>>>13,X=0|o[3],J=8191&X,Z=X>>>13,$=0|o[4],Q=8191&$,nn=$>>>13,en=0|o[5],tn=8191&en,rn=en>>>13,an=0|o[6],sn=8191&an,on=an>>>13,ln=0|o[7],cn=8191&ln,un=ln>>>13,dn=0|o[8],fn=8191&dn,hn=dn>>>13,pn=0|o[9],mn=8191&pn,bn=pn>>>13;t.negative=n.negative^e.negative,t.length=19;var gn=(c+(r=Math.imul(d,U))|0)+((8191&(a=(a=Math.imul(d,z))+Math.imul(f,U)|0))<<13)|0;c=((i=Math.imul(f,z))+(a>>>13)|0)+(gn>>>26)|0,gn&=67108863,r=Math.imul(p,U),a=(a=Math.imul(p,z))+Math.imul(m,U)|0,i=Math.imul(m,z);var yn=(c+(r=r+Math.imul(d,H)|0)|0)+((8191&(a=(a=a+Math.imul(d,G)|0)+Math.imul(f,H)|0))<<13)|0;c=((i=i+Math.imul(f,G)|0)+(a>>>13)|0)+(yn>>>26)|0,yn&=67108863,r=Math.imul(g,U),a=(a=Math.imul(g,z))+Math.imul(y,U)|0,i=Math.imul(y,z),r=r+Math.imul(p,H)|0,a=(a=a+Math.imul(p,G)|0)+Math.imul(m,H)|0,i=i+Math.imul(m,G)|0;var vn=(c+(r=r+Math.imul(d,W)|0)|0)+((8191&(a=(a=a+Math.imul(d,Y)|0)+Math.imul(f,W)|0))<<13)|0;c=((i=i+Math.imul(f,Y)|0)+(a>>>13)|0)+(vn>>>26)|0,vn&=67108863,r=Math.imul(_,U),a=(a=Math.imul(_,z))+Math.imul(w,U)|0,i=Math.imul(w,z),r=r+Math.imul(g,H)|0,a=(a=a+Math.imul(g,G)|0)+Math.imul(y,H)|0,i=i+Math.imul(y,G)|0,r=r+Math.imul(p,W)|0,a=(a=a+Math.imul(p,Y)|0)+Math.imul(m,W)|0,i=i+Math.imul(m,Y)|0;var _n=(c+(r=r+Math.imul(d,J)|0)|0)+((8191&(a=(a=a+Math.imul(d,Z)|0)+Math.imul(f,J)|0))<<13)|0;c=((i=i+Math.imul(f,Z)|0)+(a>>>13)|0)+(_n>>>26)|0,_n&=67108863,r=Math.imul(x,U),a=(a=Math.imul(x,z))+Math.imul(S,U)|0,i=Math.imul(S,z),r=r+Math.imul(_,H)|0,a=(a=a+Math.imul(_,G)|0)+Math.imul(w,H)|0,i=i+Math.imul(w,G)|0,r=r+Math.imul(g,W)|0,a=(a=a+Math.imul(g,Y)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,Y)|0,r=r+Math.imul(p,J)|0,a=(a=a+Math.imul(p,Z)|0)+Math.imul(m,J)|0,i=i+Math.imul(m,Z)|0;var wn=(c+(r=r+Math.imul(d,Q)|0)|0)+((8191&(a=(a=a+Math.imul(d,nn)|0)+Math.imul(f,Q)|0))<<13)|0;c=((i=i+Math.imul(f,nn)|0)+(a>>>13)|0)+(wn>>>26)|0,wn&=67108863,r=Math.imul(E,U),a=(a=Math.imul(E,z))+Math.imul(T,U)|0,i=Math.imul(T,z),r=r+Math.imul(x,H)|0,a=(a=a+Math.imul(x,G)|0)+Math.imul(S,H)|0,i=i+Math.imul(S,G)|0,r=r+Math.imul(_,W)|0,a=(a=a+Math.imul(_,Y)|0)+Math.imul(w,W)|0,i=i+Math.imul(w,Y)|0,r=r+Math.imul(g,J)|0,a=(a=a+Math.imul(g,Z)|0)+Math.imul(y,J)|0,i=i+Math.imul(y,Z)|0,r=r+Math.imul(p,Q)|0,a=(a=a+Math.imul(p,nn)|0)+Math.imul(m,Q)|0,i=i+Math.imul(m,nn)|0;var kn=(c+(r=r+Math.imul(d,tn)|0)|0)+((8191&(a=(a=a+Math.imul(d,rn)|0)+Math.imul(f,tn)|0))<<13)|0;c=((i=i+Math.imul(f,rn)|0)+(a>>>13)|0)+(kn>>>26)|0,kn&=67108863,r=Math.imul(I,U),a=(a=Math.imul(I,z))+Math.imul(j,U)|0,i=Math.imul(j,z),r=r+Math.imul(E,H)|0,a=(a=a+Math.imul(E,G)|0)+Math.imul(T,H)|0,i=i+Math.imul(T,G)|0,r=r+Math.imul(x,W)|0,a=(a=a+Math.imul(x,Y)|0)+Math.imul(S,W)|0,i=i+Math.imul(S,Y)|0,r=r+Math.imul(_,J)|0,a=(a=a+Math.imul(_,Z)|0)+Math.imul(w,J)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(g,Q)|0,a=(a=a+Math.imul(g,nn)|0)+Math.imul(y,Q)|0,i=i+Math.imul(y,nn)|0,r=r+Math.imul(p,tn)|0,a=(a=a+Math.imul(p,rn)|0)+Math.imul(m,tn)|0,i=i+Math.imul(m,rn)|0;var xn=(c+(r=r+Math.imul(d,sn)|0)|0)+((8191&(a=(a=a+Math.imul(d,on)|0)+Math.imul(f,sn)|0))<<13)|0;c=((i=i+Math.imul(f,on)|0)+(a>>>13)|0)+(xn>>>26)|0,xn&=67108863,r=Math.imul(B,U),a=(a=Math.imul(B,z))+Math.imul(M,U)|0,i=Math.imul(M,z),r=r+Math.imul(I,H)|0,a=(a=a+Math.imul(I,G)|0)+Math.imul(j,H)|0,i=i+Math.imul(j,G)|0,r=r+Math.imul(E,W)|0,a=(a=a+Math.imul(E,Y)|0)+Math.imul(T,W)|0,i=i+Math.imul(T,Y)|0,r=r+Math.imul(x,J)|0,a=(a=a+Math.imul(x,Z)|0)+Math.imul(S,J)|0,i=i+Math.imul(S,Z)|0,r=r+Math.imul(_,Q)|0,a=(a=a+Math.imul(_,nn)|0)+Math.imul(w,Q)|0,i=i+Math.imul(w,nn)|0,r=r+Math.imul(g,tn)|0,a=(a=a+Math.imul(g,rn)|0)+Math.imul(y,tn)|0,i=i+Math.imul(y,rn)|0,r=r+Math.imul(p,sn)|0,a=(a=a+Math.imul(p,on)|0)+Math.imul(m,sn)|0,i=i+Math.imul(m,on)|0;var Sn=(c+(r=r+Math.imul(d,cn)|0)|0)+((8191&(a=(a=a+Math.imul(d,un)|0)+Math.imul(f,cn)|0))<<13)|0;c=((i=i+Math.imul(f,un)|0)+(a>>>13)|0)+(Sn>>>26)|0,Sn&=67108863,r=Math.imul(P,U),a=(a=Math.imul(P,z))+Math.imul(O,U)|0,i=Math.imul(O,z),r=r+Math.imul(B,H)|0,a=(a=a+Math.imul(B,G)|0)+Math.imul(M,H)|0,i=i+Math.imul(M,G)|0,r=r+Math.imul(I,W)|0,a=(a=a+Math.imul(I,Y)|0)+Math.imul(j,W)|0,i=i+Math.imul(j,Y)|0,r=r+Math.imul(E,J)|0,a=(a=a+Math.imul(E,Z)|0)+Math.imul(T,J)|0,i=i+Math.imul(T,Z)|0,r=r+Math.imul(x,Q)|0,a=(a=a+Math.imul(x,nn)|0)+Math.imul(S,Q)|0,i=i+Math.imul(S,nn)|0,r=r+Math.imul(_,tn)|0,a=(a=a+Math.imul(_,rn)|0)+Math.imul(w,tn)|0,i=i+Math.imul(w,rn)|0,r=r+Math.imul(g,sn)|0,a=(a=a+Math.imul(g,on)|0)+Math.imul(y,sn)|0,i=i+Math.imul(y,on)|0,r=r+Math.imul(p,cn)|0,a=(a=a+Math.imul(p,un)|0)+Math.imul(m,cn)|0,i=i+Math.imul(m,un)|0;var An=(c+(r=r+Math.imul(d,fn)|0)|0)+((8191&(a=(a=a+Math.imul(d,hn)|0)+Math.imul(f,fn)|0))<<13)|0;c=((i=i+Math.imul(f,hn)|0)+(a>>>13)|0)+(An>>>26)|0,An&=67108863,r=Math.imul(D,U),a=(a=Math.imul(D,z))+Math.imul(q,U)|0,i=Math.imul(q,z),r=r+Math.imul(P,H)|0,a=(a=a+Math.imul(P,G)|0)+Math.imul(O,H)|0,i=i+Math.imul(O,G)|0,r=r+Math.imul(B,W)|0,a=(a=a+Math.imul(B,Y)|0)+Math.imul(M,W)|0,i=i+Math.imul(M,Y)|0,r=r+Math.imul(I,J)|0,a=(a=a+Math.imul(I,Z)|0)+Math.imul(j,J)|0,i=i+Math.imul(j,Z)|0,r=r+Math.imul(E,Q)|0,a=(a=a+Math.imul(E,nn)|0)+Math.imul(T,Q)|0,i=i+Math.imul(T,nn)|0,r=r+Math.imul(x,tn)|0,a=(a=a+Math.imul(x,rn)|0)+Math.imul(S,tn)|0,i=i+Math.imul(S,rn)|0,r=r+Math.imul(_,sn)|0,a=(a=a+Math.imul(_,on)|0)+Math.imul(w,sn)|0,i=i+Math.imul(w,on)|0,r=r+Math.imul(g,cn)|0,a=(a=a+Math.imul(g,un)|0)+Math.imul(y,cn)|0,i=i+Math.imul(y,un)|0,r=r+Math.imul(p,fn)|0,a=(a=a+Math.imul(p,hn)|0)+Math.imul(m,fn)|0,i=i+Math.imul(m,hn)|0;var En=(c+(r=r+Math.imul(d,mn)|0)|0)+((8191&(a=(a=a+Math.imul(d,bn)|0)+Math.imul(f,mn)|0))<<13)|0;c=((i=i+Math.imul(f,bn)|0)+(a>>>13)|0)+(En>>>26)|0,En&=67108863,r=Math.imul(D,H),a=(a=Math.imul(D,G))+Math.imul(q,H)|0,i=Math.imul(q,G),r=r+Math.imul(P,W)|0,a=(a=a+Math.imul(P,Y)|0)+Math.imul(O,W)|0,i=i+Math.imul(O,Y)|0,r=r+Math.imul(B,J)|0,a=(a=a+Math.imul(B,Z)|0)+Math.imul(M,J)|0,i=i+Math.imul(M,Z)|0,r=r+Math.imul(I,Q)|0,a=(a=a+Math.imul(I,nn)|0)+Math.imul(j,Q)|0,i=i+Math.imul(j,nn)|0,r=r+Math.imul(E,tn)|0,a=(a=a+Math.imul(E,rn)|0)+Math.imul(T,tn)|0,i=i+Math.imul(T,rn)|0,r=r+Math.imul(x,sn)|0,a=(a=a+Math.imul(x,on)|0)+Math.imul(S,sn)|0,i=i+Math.imul(S,on)|0,r=r+Math.imul(_,cn)|0,a=(a=a+Math.imul(_,un)|0)+Math.imul(w,cn)|0,i=i+Math.imul(w,un)|0,r=r+Math.imul(g,fn)|0,a=(a=a+Math.imul(g,hn)|0)+Math.imul(y,fn)|0,i=i+Math.imul(y,hn)|0;var Tn=(c+(r=r+Math.imul(p,mn)|0)|0)+((8191&(a=(a=a+Math.imul(p,bn)|0)+Math.imul(m,mn)|0))<<13)|0;c=((i=i+Math.imul(m,bn)|0)+(a>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,r=Math.imul(D,W),a=(a=Math.imul(D,Y))+Math.imul(q,W)|0,i=Math.imul(q,Y),r=r+Math.imul(P,J)|0,a=(a=a+Math.imul(P,Z)|0)+Math.imul(O,J)|0,i=i+Math.imul(O,Z)|0,r=r+Math.imul(B,Q)|0,a=(a=a+Math.imul(B,nn)|0)+Math.imul(M,Q)|0,i=i+Math.imul(M,nn)|0,r=r+Math.imul(I,tn)|0,a=(a=a+Math.imul(I,rn)|0)+Math.imul(j,tn)|0,i=i+Math.imul(j,rn)|0,r=r+Math.imul(E,sn)|0,a=(a=a+Math.imul(E,on)|0)+Math.imul(T,sn)|0,i=i+Math.imul(T,on)|0,r=r+Math.imul(x,cn)|0,a=(a=a+Math.imul(x,un)|0)+Math.imul(S,cn)|0,i=i+Math.imul(S,un)|0,r=r+Math.imul(_,fn)|0,a=(a=a+Math.imul(_,hn)|0)+Math.imul(w,fn)|0,i=i+Math.imul(w,hn)|0;var Cn=(c+(r=r+Math.imul(g,mn)|0)|0)+((8191&(a=(a=a+Math.imul(g,bn)|0)+Math.imul(y,mn)|0))<<13)|0;c=((i=i+Math.imul(y,bn)|0)+(a>>>13)|0)+(Cn>>>26)|0,Cn&=67108863,r=Math.imul(D,J),a=(a=Math.imul(D,Z))+Math.imul(q,J)|0,i=Math.imul(q,Z),r=r+Math.imul(P,Q)|0,a=(a=a+Math.imul(P,nn)|0)+Math.imul(O,Q)|0,i=i+Math.imul(O,nn)|0,r=r+Math.imul(B,tn)|0,a=(a=a+Math.imul(B,rn)|0)+Math.imul(M,tn)|0,i=i+Math.imul(M,rn)|0,r=r+Math.imul(I,sn)|0,a=(a=a+Math.imul(I,on)|0)+Math.imul(j,sn)|0,i=i+Math.imul(j,on)|0,r=r+Math.imul(E,cn)|0,a=(a=a+Math.imul(E,un)|0)+Math.imul(T,cn)|0,i=i+Math.imul(T,un)|0,r=r+Math.imul(x,fn)|0,a=(a=a+Math.imul(x,hn)|0)+Math.imul(S,fn)|0,i=i+Math.imul(S,hn)|0;var In=(c+(r=r+Math.imul(_,mn)|0)|0)+((8191&(a=(a=a+Math.imul(_,bn)|0)+Math.imul(w,mn)|0))<<13)|0;c=((i=i+Math.imul(w,bn)|0)+(a>>>13)|0)+(In>>>26)|0,In&=67108863,r=Math.imul(D,Q),a=(a=Math.imul(D,nn))+Math.imul(q,Q)|0,i=Math.imul(q,nn),r=r+Math.imul(P,tn)|0,a=(a=a+Math.imul(P,rn)|0)+Math.imul(O,tn)|0,i=i+Math.imul(O,rn)|0,r=r+Math.imul(B,sn)|0,a=(a=a+Math.imul(B,on)|0)+Math.imul(M,sn)|0,i=i+Math.imul(M,on)|0,r=r+Math.imul(I,cn)|0,a=(a=a+Math.imul(I,un)|0)+Math.imul(j,cn)|0,i=i+Math.imul(j,un)|0,r=r+Math.imul(E,fn)|0,a=(a=a+Math.imul(E,hn)|0)+Math.imul(T,fn)|0,i=i+Math.imul(T,hn)|0;var jn=(c+(r=r+Math.imul(x,mn)|0)|0)+((8191&(a=(a=a+Math.imul(x,bn)|0)+Math.imul(S,mn)|0))<<13)|0;c=((i=i+Math.imul(S,bn)|0)+(a>>>13)|0)+(jn>>>26)|0,jn&=67108863,r=Math.imul(D,tn),a=(a=Math.imul(D,rn))+Math.imul(q,tn)|0,i=Math.imul(q,rn),r=r+Math.imul(P,sn)|0,a=(a=a+Math.imul(P,on)|0)+Math.imul(O,sn)|0,i=i+Math.imul(O,on)|0,r=r+Math.imul(B,cn)|0,a=(a=a+Math.imul(B,un)|0)+Math.imul(M,cn)|0,i=i+Math.imul(M,un)|0,r=r+Math.imul(I,fn)|0,a=(a=a+Math.imul(I,hn)|0)+Math.imul(j,fn)|0,i=i+Math.imul(j,hn)|0;var Rn=(c+(r=r+Math.imul(E,mn)|0)|0)+((8191&(a=(a=a+Math.imul(E,bn)|0)+Math.imul(T,mn)|0))<<13)|0;c=((i=i+Math.imul(T,bn)|0)+(a>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,r=Math.imul(D,sn),a=(a=Math.imul(D,on))+Math.imul(q,sn)|0,i=Math.imul(q,on),r=r+Math.imul(P,cn)|0,a=(a=a+Math.imul(P,un)|0)+Math.imul(O,cn)|0,i=i+Math.imul(O,un)|0,r=r+Math.imul(B,fn)|0,a=(a=a+Math.imul(B,hn)|0)+Math.imul(M,fn)|0,i=i+Math.imul(M,hn)|0;var Bn=(c+(r=r+Math.imul(I,mn)|0)|0)+((8191&(a=(a=a+Math.imul(I,bn)|0)+Math.imul(j,mn)|0))<<13)|0;c=((i=i+Math.imul(j,bn)|0)+(a>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,r=Math.imul(D,cn),a=(a=Math.imul(D,un))+Math.imul(q,cn)|0,i=Math.imul(q,un),r=r+Math.imul(P,fn)|0,a=(a=a+Math.imul(P,hn)|0)+Math.imul(O,fn)|0,i=i+Math.imul(O,hn)|0;var Mn=(c+(r=r+Math.imul(B,mn)|0)|0)+((8191&(a=(a=a+Math.imul(B,bn)|0)+Math.imul(M,mn)|0))<<13)|0;c=((i=i+Math.imul(M,bn)|0)+(a>>>13)|0)+(Mn>>>26)|0,Mn&=67108863,r=Math.imul(D,fn),a=(a=Math.imul(D,hn))+Math.imul(q,fn)|0,i=Math.imul(q,hn);var Nn=(c+(r=r+Math.imul(P,mn)|0)|0)+((8191&(a=(a=a+Math.imul(P,bn)|0)+Math.imul(O,mn)|0))<<13)|0;c=((i=i+Math.imul(O,bn)|0)+(a>>>13)|0)+(Nn>>>26)|0,Nn&=67108863;var Pn=(c+(r=Math.imul(D,mn))|0)+((8191&(a=(a=Math.imul(D,bn))+Math.imul(q,mn)|0))<<13)|0;return c=((i=Math.imul(q,bn))+(a>>>13)|0)+(Pn>>>26)|0,Pn&=67108863,l[0]=gn,l[1]=yn,l[2]=vn,l[3]=_n,l[4]=wn,l[5]=kn,l[6]=xn,l[7]=Sn,l[8]=An,l[9]=En,l[10]=Tn,l[11]=Cn,l[12]=In,l[13]=jn,l[14]=Rn,l[15]=Bn,l[16]=Mn,l[17]=Nn,l[18]=Pn,0!==c&&(l[19]=c,t.length++),t};function p(n,e,t){return(new m).mulp(n,e,t)}function m(n,e){this.x=n,this.y=e}Math.imul||(h=f),i.prototype.mulTo=function(n,e){var t=this.length+n.length;return 10===this.length&&10===n.length?h(this,n,e):t<63?f(this,n,e):t<1024?function(n,e,t){t.negative=e.negative^n.negative,t.length=n.length+e.length;for(var r=0,a=0,i=0;i>>26)|0)>>>26,s&=67108863}t.words[i]=o,r=s,s=a}return 0!==r?t.words[i]=r:t.length--,t.strip()}(this,n,e):p(this,n,e)},m.prototype.makeRBT=function(n){for(var e=new Array(n),t=i.prototype._countBits(n)-1,r=0;r>=1;return r},m.prototype.permute=function(n,e,t,r,a,i){for(var s=0;s>>=1)a++;return 1<>>=13,t[2*s+1]=8191&i,i>>>=13;for(s=2*e;s>=26,e+=a/67108864|0,e+=i>>>26,this.words[t]=67108863&i}return 0!==e&&(this.words[t]=e,this.length++),this},i.prototype.muln=function(n){return this.clone().imuln(n)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(n){var e=function(n){for(var e=new Array(n.bitLength()),t=0;t>>a}return e}(n);if(0===e.length)return new i(1);for(var t=this,r=0;r=0);var e,t=n%26,a=(n-t)/26,i=67108863>>>26-t<<26-t;if(0!==t){var s=0;for(e=0;e>>26-t}s&&(this.words[e]=s,this.length++)}if(0!==a){for(e=this.length-1;e>=0;e--)this.words[e+a]=this.words[e];for(e=0;e=0),a=e?(e-e%26)/26:0;var i=n%26,s=Math.min((n-i)/26,this.length),o=67108863^67108863>>>i<s)for(this.length-=s,c=0;c=0&&(0!==u||c>=a);c--){var d=0|this.words[c];this.words[c]=u<<26-i|d>>>i,u=d&o}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(n,e,t){return r(0===this.negative),this.iushrn(n,e,t)},i.prototype.shln=function(n){return this.clone().ishln(n)},i.prototype.ushln=function(n){return this.clone().iushln(n)},i.prototype.shrn=function(n){return this.clone().ishrn(n)},i.prototype.ushrn=function(n){return this.clone().iushrn(n)},i.prototype.testn=function(n){r("number"==typeof n&&n>=0);var e=n%26,t=(n-e)/26,a=1<=0);var e=n%26,t=(n-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=t)return this;if(0!==e&&t++,this.length=Math.min(t,this.length),0!==e){var a=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},i.prototype.isubn=function(n){if(r("number"==typeof n),r(n<67108864),n<0)return this.iaddn(-n);if(0!==this.negative)return this.negative=0,this.iaddn(n),this.negative=1,this;if(this.words[0]-=n,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[a+t]=67108863&i}for(;a>26,this.words[a+t]=67108863&i;if(0===o)return this.strip();for(r(-1===o),o=0,a=0;a>26,this.words[a]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(n,e){var t=(this.length,n.length),r=this.clone(),a=n,s=0|a.words[a.length-1];0!==(t=26-this._countBits(s))&&(a=a.ushln(t),r.iushln(t),s=0|a.words[a.length-1]);var o,l=r.length-a.length;if("mod"!==e){(o=new i(null)).length=l+1,o.words=new Array(o.length);for(var c=0;c=0;d--){var f=67108864*(0|r.words[a.length+d])+(0|r.words[a.length+d-1]);for(f=Math.min(f/s|0,67108863),r._ishlnsubmul(a,f,d);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(a,1,d),r.isZero()||(r.negative^=1);o&&(o.words[d]=f)}return o&&o.strip(),r.strip(),"div"!==e&&0!==t&&r.iushrn(t),{div:o||null,mod:r}},i.prototype.divmod=function(n,e,t){return r(!n.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===n.negative?(o=this.neg().divmod(n,e),"mod"!==e&&(a=o.div.neg()),"div"!==e&&(s=o.mod.neg(),t&&0!==s.negative&&s.iadd(n)),{div:a,mod:s}):0===this.negative&&0!==n.negative?(o=this.divmod(n.neg(),e),"mod"!==e&&(a=o.div.neg()),{div:a,mod:o.mod}):0!=(this.negative&n.negative)?(o=this.neg().divmod(n.neg(),e),"div"!==e&&(s=o.mod.neg(),t&&0!==s.negative&&s.isub(n)),{div:o.div,mod:s}):n.length>this.length||this.cmp(n)<0?{div:new i(0),mod:this}:1===n.length?"div"===e?{div:this.divn(n.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(n.words[0]))}:{div:this.divn(n.words[0]),mod:new i(this.modn(n.words[0]))}:this._wordDiv(n,e);var a,s,o},i.prototype.div=function(n){return this.divmod(n,"div",!1).div},i.prototype.mod=function(n){return this.divmod(n,"mod",!1).mod},i.prototype.umod=function(n){return this.divmod(n,"mod",!0).mod},i.prototype.divRound=function(n){var e=this.divmod(n);if(e.mod.isZero())return e.div;var t=0!==e.div.negative?e.mod.isub(n):e.mod,r=n.ushrn(1),a=n.andln(1),i=t.cmp(r);return i<0||1===a&&0===i?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(n){r(n<=67108863);for(var e=(1<<26)%n,t=0,a=this.length-1;a>=0;a--)t=(e*t+(0|this.words[a]))%n;return t},i.prototype.idivn=function(n){r(n<=67108863);for(var e=0,t=this.length-1;t>=0;t--){var a=(0|this.words[t])+67108864*e;this.words[t]=a/n|0,e=a%n}return this.strip()},i.prototype.divn=function(n){return this.clone().idivn(n)},i.prototype.egcd=function(n){r(0===n.negative),r(!n.isZero());var e=this,t=n.clone();e=0!==e.negative?e.umod(n):e.clone();for(var a=new i(1),s=new i(0),o=new i(0),l=new i(1),c=0;e.isEven()&&t.isEven();)e.iushrn(1),t.iushrn(1),++c;for(var u=t.clone(),d=e.clone();!e.isZero();){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()||s.isOdd())&&(a.iadd(u),s.isub(d)),a.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(t.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(t.iushrn(p);p-- >0;)(o.isOdd()||l.isOdd())&&(o.iadd(u),l.isub(d)),o.iushrn(1),l.iushrn(1);e.cmp(t)>=0?(e.isub(t),a.isub(o),s.isub(l)):(t.isub(e),o.isub(a),l.isub(s))}return{a:o,b:l,gcd:t.iushln(c)}},i.prototype._invmp=function(n){r(0===n.negative),r(!n.isZero());var e=this,t=n.clone();e=0!==e.negative?e.umod(n):e.clone();for(var a,s=new i(1),o=new i(0),l=t.clone();e.cmpn(1)>0&&t.cmpn(1)>0;){for(var c=0,u=1;0==(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);for(var d=0,f=1;0==(t.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(t.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);e.cmp(t)>=0?(e.isub(t),s.isub(o)):(t.isub(e),o.isub(s))}return(a=0===e.cmpn(1)?s:o).cmpn(0)<0&&a.iadd(n),a},i.prototype.gcd=function(n){if(this.isZero())return n.abs();if(n.isZero())return this.abs();var e=this.clone(),t=n.clone();e.negative=0,t.negative=0;for(var r=0;e.isEven()&&t.isEven();r++)e.iushrn(1),t.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;t.isEven();)t.iushrn(1);var a=e.cmp(t);if(a<0){var i=e;e=t,t=i}else if(0===a||0===t.cmpn(1))break;e.isub(t)}return t.iushln(r)},i.prototype.invm=function(n){return this.egcd(n).a.umod(n)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(n){return this.words[0]&n},i.prototype.bincn=function(n){r("number"==typeof n);var e=n%26,t=(n-e)/26,a=1<>>26,o&=67108863,this.words[s]=o}return 0!==i&&(this.words[s]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(n){var e,t=n<0;if(0!==this.negative&&!t)return-1;if(0===this.negative&&t)return 1;if(this.strip(),this.length>1)e=1;else{t&&(n=-n),r(n<=67108863,"Number is too big");var a=0|this.words[0];e=a===n?0:an.length)return 1;if(this.length=0;t--){var r=0|this.words[t],a=0|n.words[t];if(r!==a){ra&&(e=1);break}}return e},i.prototype.gtn=function(n){return 1===this.cmpn(n)},i.prototype.gt=function(n){return 1===this.cmp(n)},i.prototype.gten=function(n){return this.cmpn(n)>=0},i.prototype.gte=function(n){return this.cmp(n)>=0},i.prototype.ltn=function(n){return-1===this.cmpn(n)},i.prototype.lt=function(n){return-1===this.cmp(n)},i.prototype.lten=function(n){return this.cmpn(n)<=0},i.prototype.lte=function(n){return this.cmp(n)<=0},i.prototype.eqn=function(n){return 0===this.cmpn(n)},i.prototype.eq=function(n){return 0===this.cmp(n)},i.red=function(n){return new k(n)},i.prototype.toRed=function(n){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),n.convertTo(this)._forceRed(n)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(n){return this.red=n,this},i.prototype.forceRed=function(n){return r(!this.red,"Already a number in reduction context"),this._forceRed(n)},i.prototype.redAdd=function(n){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,n)},i.prototype.redIAdd=function(n){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,n)},i.prototype.redSub=function(n){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,n)},i.prototype.redISub=function(n){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,n)},i.prototype.redShl=function(n){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,n)},i.prototype.redMul=function(n){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,n),this.red.mul(this,n)},i.prototype.redIMul=function(n){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,n),this.red.imul(this,n)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(n){return r(this.red&&!n.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,n)};var b={k256:null,p224:null,p192:null,p25519:null};function g(n,e){this.name=n,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(n){if("string"==typeof n){var e=i._prime(n);this.m=e.p,this.prime=e}else r(n.gtn(1),"modulus must be greater than 1"),this.m=n,this.prime=null}function x(n){k.call(this,n),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}g.prototype._tmp=function(){var n=new i(null);return n.words=new Array(Math.ceil(this.n/13)),n},g.prototype.ireduce=function(n){var e,t=n;do{this.split(t,this.tmp),e=(t=(t=this.imulK(t)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?t.isub(this.p):t.strip(),t},g.prototype.split=function(n,e){n.iushrn(this.n,0,e)},g.prototype.imulK=function(n){return n.imul(this.k)},a(y,g),y.prototype.split=function(n,e){for(var t=Math.min(n.length,9),r=0;r>>22,a=i}a>>>=22,n.words[r-10]=a,0===a&&n.length>10?n.length-=10:n.length-=9},y.prototype.imulK=function(n){n.words[n.length]=0,n.words[n.length+1]=0,n.length+=2;for(var e=0,t=0;t>>=26,n.words[t]=a,e=r}return 0!==e&&(n.words[n.length++]=e),n},i._prime=function(n){if(b[n])return b[n];var e;if("k256"===n)e=new y;else if("p224"===n)e=new v;else if("p192"===n)e=new _;else{if("p25519"!==n)throw new Error("Unknown prime "+n);e=new w}return b[n]=e,e},k.prototype._verify1=function(n){r(0===n.negative,"red works only with positives"),r(n.red,"red works only with red numbers")},k.prototype._verify2=function(n,e){r(0==(n.negative|e.negative),"red works only with positives"),r(n.red&&n.red===e.red,"red works only with red numbers")},k.prototype.imod=function(n){return this.prime?this.prime.ireduce(n)._forceRed(this):n.umod(this.m)._forceRed(this)},k.prototype.neg=function(n){return n.isZero()?n.clone():this.m.sub(n)._forceRed(this)},k.prototype.add=function(n,e){this._verify2(n,e);var t=n.add(e);return t.cmp(this.m)>=0&&t.isub(this.m),t._forceRed(this)},k.prototype.iadd=function(n,e){this._verify2(n,e);var t=n.iadd(e);return t.cmp(this.m)>=0&&t.isub(this.m),t},k.prototype.sub=function(n,e){this._verify2(n,e);var t=n.sub(e);return t.cmpn(0)<0&&t.iadd(this.m),t._forceRed(this)},k.prototype.isub=function(n,e){this._verify2(n,e);var t=n.isub(e);return t.cmpn(0)<0&&t.iadd(this.m),t},k.prototype.shl=function(n,e){return this._verify1(n),this.imod(n.ushln(e))},k.prototype.imul=function(n,e){return this._verify2(n,e),this.imod(n.imul(e))},k.prototype.mul=function(n,e){return this._verify2(n,e),this.imod(n.mul(e))},k.prototype.isqr=function(n){return this.imul(n,n.clone())},k.prototype.sqr=function(n){return this.mul(n,n)},k.prototype.sqrt=function(n){if(n.isZero())return n.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var t=this.m.add(new i(1)).iushrn(2);return this.pow(n,t)}for(var a=this.m.subn(1),s=0;!a.isZero()&&0===a.andln(1);)s++,a.iushrn(1);r(!a.isZero());var o=new i(1).toRed(this),l=o.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new i(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var d=this.pow(u,a),f=this.pow(n,a.addn(1).iushrn(1)),h=this.pow(n,a),p=s;0!==h.cmp(o);){for(var m=h,b=0;0!==m.cmp(o);b++)m=m.redSqr();r(b=0;r--){for(var c=e.words[r],u=l-1;u>=0;u--){var d=c>>u&1;a!==t[0]&&(a=this.sqr(a)),0!==d||0!==s?(s<<=1,s|=d,(4===++o||0===r&&0===u)&&(a=this.mul(a,t[s]),o=0,s=0)):o=0}l=26}return a},k.prototype.convertTo=function(n){var e=n.umod(this.m);return e===n?e.clone():e},k.prototype.convertFrom=function(n){var e=n.clone();return e.red=null,e},i.mont=function(n){return new x(n)},a(x,k),x.prototype.convertTo=function(n){return this.imod(n.ushln(this.shift))},x.prototype.convertFrom=function(n){var e=this.imod(n.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(n,e){if(n.isZero()||e.isZero())return n.words[0]=0,n.length=1,n;var t=n.imul(e),r=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=t.isub(r).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},x.prototype.mul=function(n,e){if(n.isZero()||e.isZero())return new i(0)._forceRed(this);var t=n.mul(e),r=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=t.isub(r).iushrn(this.shift),s=a;return a.cmp(this.m)>=0?s=a.isub(this.m):a.cmpn(0)<0&&(s=a.iadd(this.m)),s._forceRed(this)},x.prototype.invm=function(n){return this.imod(n._invmp(this.m).mul(this.r2))._forceRed(this)}}(n,this)}).call(this,t(18)(n))},function(n,e){var t="0123456789abcdef".split(""),r=[1,256,65536,16777216],a=[0,8,16,24],i=[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],s=function(n){var e,t,r,a,s,o,l,c,u,d,f,h,p,m,b,g,y,v,_,w,k,x,S,A,E,T,C,I,j,R,B,M,N,P,O,L,D,q,F,U,z,K,H,G,V,W,Y,X,J,Z,$,Q,nn,en,tn,rn,an,sn,on,ln,cn,un,dn;for(r=0;r<48;r+=2)a=n[0]^n[10]^n[20]^n[30]^n[40],s=n[1]^n[11]^n[21]^n[31]^n[41],o=n[2]^n[12]^n[22]^n[32]^n[42],l=n[3]^n[13]^n[23]^n[33]^n[43],c=n[4]^n[14]^n[24]^n[34]^n[44],u=n[5]^n[15]^n[25]^n[35]^n[45],d=n[6]^n[16]^n[26]^n[36]^n[46],f=n[7]^n[17]^n[27]^n[37]^n[47],e=(h=n[8]^n[18]^n[28]^n[38]^n[48])^(o<<1|l>>>31),t=(p=n[9]^n[19]^n[29]^n[39]^n[49])^(l<<1|o>>>31),n[0]^=e,n[1]^=t,n[10]^=e,n[11]^=t,n[20]^=e,n[21]^=t,n[30]^=e,n[31]^=t,n[40]^=e,n[41]^=t,e=a^(c<<1|u>>>31),t=s^(u<<1|c>>>31),n[2]^=e,n[3]^=t,n[12]^=e,n[13]^=t,n[22]^=e,n[23]^=t,n[32]^=e,n[33]^=t,n[42]^=e,n[43]^=t,e=o^(d<<1|f>>>31),t=l^(f<<1|d>>>31),n[4]^=e,n[5]^=t,n[14]^=e,n[15]^=t,n[24]^=e,n[25]^=t,n[34]^=e,n[35]^=t,n[44]^=e,n[45]^=t,e=c^(h<<1|p>>>31),t=u^(p<<1|h>>>31),n[6]^=e,n[7]^=t,n[16]^=e,n[17]^=t,n[26]^=e,n[27]^=t,n[36]^=e,n[37]^=t,n[46]^=e,n[47]^=t,e=d^(a<<1|s>>>31),t=f^(s<<1|a>>>31),n[8]^=e,n[9]^=t,n[18]^=e,n[19]^=t,n[28]^=e,n[29]^=t,n[38]^=e,n[39]^=t,n[48]^=e,n[49]^=t,m=n[0],b=n[1],W=n[11]<<4|n[10]>>>28,Y=n[10]<<4|n[11]>>>28,I=n[20]<<3|n[21]>>>29,j=n[21]<<3|n[20]>>>29,ln=n[31]<<9|n[30]>>>23,cn=n[30]<<9|n[31]>>>23,K=n[40]<<18|n[41]>>>14,H=n[41]<<18|n[40]>>>14,P=n[2]<<1|n[3]>>>31,O=n[3]<<1|n[2]>>>31,g=n[13]<<12|n[12]>>>20,y=n[12]<<12|n[13]>>>20,X=n[22]<<10|n[23]>>>22,J=n[23]<<10|n[22]>>>22,R=n[33]<<13|n[32]>>>19,B=n[32]<<13|n[33]>>>19,un=n[42]<<2|n[43]>>>30,dn=n[43]<<2|n[42]>>>30,en=n[5]<<30|n[4]>>>2,tn=n[4]<<30|n[5]>>>2,L=n[14]<<6|n[15]>>>26,D=n[15]<<6|n[14]>>>26,v=n[25]<<11|n[24]>>>21,_=n[24]<<11|n[25]>>>21,Z=n[34]<<15|n[35]>>>17,$=n[35]<<15|n[34]>>>17,M=n[45]<<29|n[44]>>>3,N=n[44]<<29|n[45]>>>3,A=n[6]<<28|n[7]>>>4,E=n[7]<<28|n[6]>>>4,rn=n[17]<<23|n[16]>>>9,an=n[16]<<23|n[17]>>>9,q=n[26]<<25|n[27]>>>7,F=n[27]<<25|n[26]>>>7,w=n[36]<<21|n[37]>>>11,k=n[37]<<21|n[36]>>>11,Q=n[47]<<24|n[46]>>>8,nn=n[46]<<24|n[47]>>>8,G=n[8]<<27|n[9]>>>5,V=n[9]<<27|n[8]>>>5,T=n[18]<<20|n[19]>>>12,C=n[19]<<20|n[18]>>>12,sn=n[29]<<7|n[28]>>>25,on=n[28]<<7|n[29]>>>25,U=n[38]<<8|n[39]>>>24,z=n[39]<<8|n[38]>>>24,x=n[48]<<14|n[49]>>>18,S=n[49]<<14|n[48]>>>18,n[0]=m^~g&v,n[1]=b^~y&_,n[10]=A^~T&I,n[11]=E^~C&j,n[20]=P^~L&q,n[21]=O^~D&F,n[30]=G^~W&X,n[31]=V^~Y&J,n[40]=en^~rn&sn,n[41]=tn^~an&on,n[2]=g^~v&w,n[3]=y^~_&k,n[12]=T^~I&R,n[13]=C^~j&B,n[22]=L^~q&U,n[23]=D^~F&z,n[32]=W^~X&Z,n[33]=Y^~J&$,n[42]=rn^~sn&ln,n[43]=an^~on&cn,n[4]=v^~w&x,n[5]=_^~k&S,n[14]=I^~R&M,n[15]=j^~B&N,n[24]=q^~U&K,n[25]=F^~z&H,n[34]=X^~Z&Q,n[35]=J^~$&nn,n[44]=sn^~ln&un,n[45]=on^~cn&dn,n[6]=w^~x&m,n[7]=k^~S&b,n[16]=R^~M&A,n[17]=B^~N&E,n[26]=U^~K&P,n[27]=z^~H&O,n[36]=Z^~Q&G,n[37]=$^~nn&V,n[46]=ln^~un&en,n[47]=cn^~dn&tn,n[8]=x^~m&g,n[9]=S^~b&y,n[18]=M^~A&T,n[19]=N^~E&C,n[28]=K^~P&L,n[29]=H^~O&D,n[38]=Q^~G&W,n[39]=nn^~V&Y,n[48]=un^~en&rn,n[49]=dn^~tn&an,n[0]^=i[r],n[1]^=i[r+1]},o=function(n){return function(e){var i;if("0x"===e.slice(0,2)){i=[];for(var o=2,l=e.length;o>2]|=e[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(l[b>>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)<=c){for(n.start=b-c,n.block=l[u],b=0;b>2]|=r[3&b],n.lastByteIndex===c)for(l[0]=l[u],b=1;b>4&15]+t[15&p]+t[p>>12&15]+t[p>>8&15]+t[p>>20&15]+t[p>>16&15]+t[p>>28&15]+t[p>>24&15];g%u==0&&(s(f),b=0)}return"0x"+m}(function(n){return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(n<<1)>>5,outputBlocks:n>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e}(n),i)}};n.exports={keccak256:o(256),keccak512:o(512),keccak256s:o(256),keccak512s:o(512)}},function(n,e,t){"use strict";var r=t(10),a=t(218),i=function(n){var e="A".charCodeAt(0),t="Z".charCodeAt(0);return(n=(n=n.toUpperCase()).substr(4)+n.substr(0,4)).split("").map(function(n){var r=n.charCodeAt(0);return r>=e&&r<=t?r-e+10:n}).join("")},s=function(n){for(var e,t=n;t.length>2;)e=t.slice(0,9),t=parseInt(e,10)%97+t.slice(e.length);return parseInt(t,10)%97},o=function(n){this._iban=n};o.toAddress=function(n){if(!(n=new o(n)).isDirect())throw new Error("IBAN is indirect and can't be converted");return n.toAddress()},o.toIban=function(n){return o.fromAddress(n).toString()},o.fromAddress=function(n){if(!r.isAddress(n))throw new Error("Provided address is not a valid address: "+n);n=n.replace("0x","").replace("0X","");var e=function(n,e){for(var t=n;t.length<2*e;)t="0"+t;return t}(new a(n,16).toString(36),15);return o.fromBban(e.toUpperCase())},o.fromBban=function(n){var e=("0"+(98-s(i("XE00"+n)))).slice(-2);return new o("XE"+e+n)},o.createIndirect=function(n){return o.fromBban("ETH"+n.institution+n.identifier)},o.isValid=function(n){return new o(n).isValid()},o.prototype.isValid=function(){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(this._iban)&&1===s(i(this._iban))},o.prototype.isDirect=function(){return 34===this._iban.length||35===this._iban.length},o.prototype.isIndirect=function(){return 20===this._iban.length},o.prototype.checksum=function(){return this._iban.substr(2,2)},o.prototype.institution=function(){return this.isIndirect()?this._iban.substr(7,4):""},o.prototype.client=function(){return this.isIndirect()?this._iban.substr(11):""},o.prototype.toAddress=function(){if(this.isDirect()){var n=this._iban.substr(4),e=new a(n,36);return r.toChecksumAddress(e.toString(16,20))}return""},o.prototype.toString=function(){return this._iban},n.exports=o},function(n,e,t){"use strict";var r={messageId:0,toPayload:function(n,e){if(!n)throw new Error('JSONRPC method should be specified for params: "'+JSON.stringify(e)+'"!');return r.messageId++,{jsonrpc:"2.0",id:r.messageId,method:n,params:e||[]}},isValidResponse:function(n){return Array.isArray(n)?n.every(e):e(n);function e(n){return!(!n||n.error||"2.0"!==n.jsonrpc||"number"!=typeof n.id&&"string"!=typeof n.id||void 0===n.result)}},toBatchPayload:function(n){return n.map(function(n){return r.toPayload(n.method,n.params)})}};n.exports=r},function(n,e,t){(function(n,r){var a;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(i){e&&e.nodeType,n&&n.nodeType;var s="object"==typeof r&&r;s.global!==s&&s.window!==s&&s.self;var o,l=2147483647,c=36,u=1,d=26,f=38,h=700,p=72,m=128,b="-",g=/^xn--/,y=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=c-u,k=Math.floor,x=String.fromCharCode;function S(n){throw new RangeError(_[n])}function A(n,e){for(var t=n.length,r=[];t--;)r[t]=e(n[t]);return r}function E(n,e){var t=n.split("@"),r="";return t.length>1&&(r=t[0]+"@",n=t[1]),r+A((n=n.replace(v,".")).split("."),e).join(".")}function T(n){for(var e,t,r=[],a=0,i=n.length;a=55296&&e<=56319&&a65535&&(e+=x((n-=65536)>>>10&1023|55296),n=56320|1023&n),e+=x(n)}).join("")}function I(n,e){return n+22+75*(n<26)-((0!=e)<<5)}function j(n,e,t){var r=0;for(n=t?k(n/h):n>>1,n+=k(n/e);n>w*d>>1;r+=c)n=k(n/w);return k(r+(w+1)*n/(n+f))}function R(n){var e,t,r,a,i,s,o,f,h,g,y,v=[],_=n.length,w=0,x=m,A=p;for((t=n.lastIndexOf(b))<0&&(t=0),r=0;r=128&&S("not-basic"),v.push(n.charCodeAt(r));for(a=t>0?t+1:0;a<_;){for(i=w,s=1,o=c;a>=_&&S("invalid-input"),((f=(y=n.charCodeAt(a++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:c)>=c||f>k((l-w)/s))&&S("overflow"),w+=f*s,!(f<(h=o<=A?u:o>=A+d?d:o-A));o+=c)s>k(l/(g=c-h))&&S("overflow"),s*=g;A=j(w-i,e=v.length+1,0==i),k(w/e)>l-x&&S("overflow"),x+=k(w/e),w%=e,v.splice(w++,0,x)}return C(v)}function B(n){var e,t,r,a,i,s,o,f,h,g,y,v,_,w,A,E=[];for(v=(n=T(n)).length,e=m,t=0,i=p,s=0;s=e&&yk((l-t)/(_=r+1))&&S("overflow"),t+=(o-e)*_,e=o,s=0;sl&&S("overflow"),y==e){for(f=t,h=c;!(f<(g=h<=i?u:h>=i+d?d:h-i));h+=c)A=f-g,w=c-g,E.push(x(I(g+A%w,0))),f=k(A/w);E.push(x(I(f,0))),i=j(t,_,r==a),t=0,++r}++t,++e}return E.join("")}o={version:"1.4.1",ucs2:{decode:T,encode:C},decode:R,encode:B,toASCII:function(n){return E(n,function(n){return y.test(n)?"xn--"+B(n):n})},toUnicode:function(n){return E(n,function(n){return g.test(n)?R(n.slice(4).toLowerCase()):n})}},void 0===(a=function(){return o}.call(e,t,e,n))||(n.exports=a)}()}).call(this,t(18)(n),t(4))},function(n,e,t){(function(n){e.fetch=o(n.fetch)&&o(n.ReadableStream),e.writableStream=o(n.WritableStream),e.abortController=o(n.AbortController),e.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),e.blobConstructor=!0}catch(n){}var t;function r(){if(void 0!==t)return t;if(n.XMLHttpRequest){t=new n.XMLHttpRequest;try{t.open("GET",n.XDomainRequest?"/":"https://example.com")}catch(n){t=null}}else t=null;return t}function a(n){var e=r();if(!e)return!1;try{return e.responseType=n,e.responseType===n}catch(n){}return!1}var i=void 0!==n.ArrayBuffer,s=i&&o(n.ArrayBuffer.prototype.slice);function o(n){return"function"==typeof n}e.arraybuffer=e.fetch||i&&a("arraybuffer"),e.msstream=!e.fetch&&s&&a("ms-stream"),e.mozchunkedarraybuffer=!e.fetch&&i&&a("moz-chunked-arraybuffer"),e.overrideMimeType=e.fetch||!!r()&&o(r().overrideMimeType),e.vbArray=o(n.VBArray),t=null}).call(this,t(4))},function(n,e,t){(function(n,r,a){var i=t(103),s=t(0),o=t(33),l=e.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=e.IncomingMessage=function(e,t,s,l){var c=this;if(o.Readable.call(c),c._mode=s,c.headers={},c.rawHeaders=[],c.trailers={},c.rawTrailers=[],c.on("end",function(){n.nextTick(function(){c.emit("close")})}),"fetch"===s){if(c._fetchResponse=t,c.url=t.url,c.statusCode=t.status,c.statusMessage=t.statusText,t.headers.forEach(function(n,e){c.headers[e.toLowerCase()]=n,c.rawHeaders.push(e,n)}),i.writableStream){var u=new WritableStream({write:function(n){return new Promise(function(e,t){c._destroyed?t():c.push(new r(n))?e():c._resumeFetch=e})},close:function(){a.clearTimeout(l),c._destroyed||c.push(null)},abort:function(n){c._destroyed||c.emit("error",n)}});try{return void t.body.pipeTo(u).catch(function(n){a.clearTimeout(l),c._destroyed||c.emit("error",n)})}catch(n){}}var d=t.body.getReader();!function n(){d.read().then(function(e){if(!c._destroyed){if(e.done)return a.clearTimeout(l),void c.push(null);c.push(new r(e.value)),n()}}).catch(function(n){a.clearTimeout(l),c._destroyed||c.emit("error",n)})}()}else{if(c._xhr=e,c._pos=0,c.url=e.responseURL,c.statusCode=e.status,c.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach(function(n){var e=n.match(/^([^:]+):\s*(.*)/);if(e){var t=e[1].toLowerCase();"set-cookie"===t?(void 0===c.headers[t]&&(c.headers[t]=[]),c.headers[t].push(e[2])):void 0!==c.headers[t]?c.headers[t]+=", "+e[2]:c.headers[t]=e[2],c.rawHeaders.push(e[1],e[2])}}),c._charset="x-user-defined",!i.overrideMimeType){var f=c.rawHeaders["mime-type"];if(f){var h=f.match(/;\s*charset=([^;])(;|$)/);h&&(c._charset=h[1].toLowerCase())}c._charset||(c._charset="utf-8")}}};s(c,o.Readable),c.prototype._read=function(){var n=this._resumeFetch;n&&(this._resumeFetch=null,n())},c.prototype._onXHRProgress=function(){var n=this,e=n._xhr,t=null;switch(n._mode){case"text:vbarray":if(e.readyState!==l.DONE)break;try{t=new a.VBArray(e.responseBody).toArray()}catch(n){}if(null!==t){n.push(new r(t));break}case"text":try{t=e.responseText}catch(e){n._mode="text:vbarray";break}if(t.length>n._pos){var i=t.substr(n._pos);if("x-user-defined"===n._charset){for(var s=new r(i.length),o=0;on._pos&&(n.push(new r(new Uint8Array(c.result.slice(n._pos)))),n._pos=c.result.byteLength)},c.onload=function(){n.push(null)},c.readAsArrayBuffer(t)}n._xhr.readyState===l.DONE&&"ms-stream"!==n._mode&&n.push(null)}}).call(this,t(8),t(2).Buffer,t(4))},function(n,e,t){"use strict";(function(e,r){var a=t(41);n.exports=v;var i,s=t(95);v.ReadableState=y;t(65).EventEmitter;var o=function(n,e){return n.listeners(e).length},l=t(106),c=t(1).Buffer,u=e.Uint8Array||function(){};var d=t(34);d.inherits=t(0);var f=t(233),h=void 0;h=f&&f.debuglog?f.debuglog("stream"):function(){};var p,m=t(234),b=t(107);d.inherits(v,l);var g=["error","close","destroy","pause","resume"];function y(n,e){n=n||{};var r=e instanceof(i=i||t(19));this.objectMode=!!n.objectMode,r&&(this.objectMode=this.objectMode||!!n.readableObjectMode);var a=n.highWaterMark,s=n.readableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:r&&(s||0===s)?s:o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,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=n.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,n.encoding&&(p||(p=t(67).StringDecoder),this.decoder=new p(n.encoding),this.encoding=n.encoding)}function v(n){if(i=i||t(19),!(this instanceof v))return new v(n);this._readableState=new y(n,this),this.readable=!0,n&&("function"==typeof n.read&&(this._read=n.read),"function"==typeof n.destroy&&(this._destroy=n.destroy)),l.call(this)}function _(n,e,t,r,a){var i,s=n._readableState;null===e?(s.reading=!1,function(n,e){if(e.ended)return;if(e.decoder){var t=e.decoder.end();t&&t.length&&(e.buffer.push(t),e.length+=e.objectMode?1:t.length)}e.ended=!0,S(n)}(n,s)):(a||(i=function(n,e){var t;r=e,c.isBuffer(r)||r instanceof u||"string"==typeof e||void 0===e||n.objectMode||(t=new TypeError("Invalid non-string/buffer chunk"));var r;return t}(s,e)),i?n.emit("error",i):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===c.prototype||(e=function(n){return c.from(n)}(e)),r?s.endEmitted?n.emit("error",new Error("stream.unshift() after end event")):w(n,s,e,!0):s.ended?n.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!t?(e=s.decoder.write(e),s.objectMode||0!==e.length?w(n,s,e,!1):E(n,s)):w(n,s,e,!1))):r||(s.reading=!1));return function(n){return!n.ended&&(n.needReadable||n.lengthe.highWaterMark&&(e.highWaterMark=function(n){return n>=k?n=k:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}(n)),n<=e.length?n:e.ended?e.length:(e.needReadable=!0,0))}function S(n){var e=n._readableState;e.needReadable=!1,e.emittedReadable||(h("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?a.nextTick(A,n):A(n))}function A(n){h("emit readable"),n.emit("readable"),j(n)}function E(n,e){e.readingMore||(e.readingMore=!0,a.nextTick(T,n,e))}function T(n,e){for(var t=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(t=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):t=function(n,e,t){var r;ni.length?i.length:n;if(s===i.length?a+=i:a+=i.slice(0,n),0===(n-=s)){s===i.length?(++r,t.next?e.head=t.next:e.head=e.tail=null):(e.head=t,t.data=i.slice(s));break}++r}return e.length-=r,a}(n,e):function(n,e){var t=c.allocUnsafe(n),r=e.head,a=1;r.data.copy(t),n-=r.data.length;for(;r=r.next;){var i=r.data,s=n>i.length?i.length:n;if(i.copy(t,t.length-n,0,s),0===(n-=s)){s===i.length?(++a,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=i.slice(s));break}++a}return e.length-=a,t}(n,e);return r}(n,e.buffer,e.decoder),t);var t}function B(n){var e=n._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,a.nextTick(M,e,n))}function M(n,e){n.endEmitted||0!==n.length||(n.endEmitted=!0,e.readable=!1,e.emit("end"))}function N(n,e){for(var t=0,r=n.length;t=e.highWaterMark||e.ended))return h("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?B(this):S(this),null;if(0===(n=x(n,e))&&e.ended)return 0===e.length&&B(this),null;var r,a=e.needReadable;return h("need readable",a),(0===e.length||e.length-n0?R(n,e):null)?(e.needReadable=!0,n=0):e.length-=n,0===e.length&&(e.ended||(e.needReadable=!0),t!==n&&e.ended&&B(this)),null!==r&&this.emit("data",r),r},v.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(n,e){var t=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=n;break;case 1:i.pipes=[i.pipes,n];break;default:i.pipes.push(n)}i.pipesCount+=1,h("pipe count=%d opts=%j",i.pipesCount,e);var l=(!e||!1!==e.end)&&n!==r.stdout&&n!==r.stderr?u:v;function c(e,r){h("onunpipe"),e===t&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),n.removeListener("close",g),n.removeListener("finish",y),n.removeListener("drain",d),n.removeListener("error",b),n.removeListener("unpipe",c),t.removeListener("end",u),t.removeListener("end",v),t.removeListener("data",m),f=!0,!i.awaitDrain||n._writableState&&!n._writableState.needDrain||d())}function u(){h("onend"),n.end()}i.endEmitted?a.nextTick(l):t.once("end",l),n.on("unpipe",c);var d=function(n){return function(){var e=n._readableState;h("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(n,"data")&&(e.flowing=!0,j(n))}}(t);n.on("drain",d);var f=!1;var p=!1;function m(e){h("ondata"),p=!1,!1!==n.write(e)||p||((1===i.pipesCount&&i.pipes===n||i.pipesCount>1&&-1!==N(i.pipes,n))&&!f&&(h("false write response, pause",t._readableState.awaitDrain),t._readableState.awaitDrain++,p=!0),t.pause())}function b(e){h("onerror",e),v(),n.removeListener("error",b),0===o(n,"error")&&n.emit("error",e)}function g(){n.removeListener("finish",y),v()}function y(){h("onfinish"),n.removeListener("close",g),v()}function v(){h("unpipe"),t.unpipe(n)}return t.on("data",m),function(n,e,t){if("function"==typeof n.prependListener)return n.prependListener(e,t);n._events&&n._events[e]?s(n._events[e])?n._events[e].unshift(t):n._events[e]=[t,n._events[e]]:n.on(e,t)}(n,"error",b),n.once("close",g),n.once("finish",y),n.emit("pipe",t),i.flowing||(h("pipe resume"),t.resume()),n},v.prototype.unpipe=function(n){var e=this._readableState,t={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return n&&n!==e.pipes?this:(n||(n=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,n&&n.emit("unpipe",this,t),this);if(!n){var r=e.pipes,a=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i=2?e.slice(2):e;var t=d.decodeParameters(n,e);return 1===t.__length__?t[0]:(delete t.__length__,t)},f.prototype.deploy=function(n,e){if((n=n||{}).arguments=n.arguments||[],!(n=this._getOrSetDefaultOptions(n)).data)return s._fireError(new Error('No "data" specified in neither the given options, nor the default options.'),null,null,e);var t=r.find(this.options.jsonInterface,function(n){return"constructor"===n.type})||{};return t.signature="constructor",this._createTxObject.apply({method:t,parent:this,deployData:n.data,_ethAccounts:this.constructor._ethAccounts},n.arguments)},f.prototype._generateEventOptions=function(){var n=Array.prototype.slice.call(arguments),e=this._getCallback(n),t=r.isObject(n[n.length-1])?n.pop():{},a=r.isString(n[0])?n[0]:"allevents";if(!(a="allevents"===a.toLowerCase()?{name:"ALLEVENTS",jsonInterface:this.options.jsonInterface}:this.options.jsonInterface.find(function(n){return"event"===n.type&&(n.name===a||n.signature==="0x"+a.replace("0x",""))})))throw new Error('Event "'+a.name+"\" doesn't exist in this contract.");if(!s.isAddress(this.options.address))throw new Error("This contract object doesn't have address set yet, please set an address first.");return{params:this._encodeEventABI(a,t),event:a,callback:e}},f.prototype.clone=function(){return new this.constructor(this.options.jsonInterface,this.options.address,this.options)},f.prototype.once=function(n,e,t){var a=Array.prototype.slice.call(arguments);if(!(t=this._getCallback(a)))throw new Error("Once requires a callback as the second parameter.");e&&delete e.fromBlock,this._on(n,e,function(n,e,a){a.unsubscribe(),r.isFunction(t)&&t(n,e,a)})},f.prototype._on=function(){var n=this._generateEventOptions.apply(this,arguments);this._checkListener("newListener",n.event.name,n.callback),this._checkListener("removeListener",n.event.name,n.callback);var e=new o({subscription:{params:1,inputFormatter:[l.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(n.event),subscriptionHandler:function(n){n.removed?this.emit("changed",n):this.emit("data",n),r.isFunction(this.callback)&&this.callback(null,n,this)}},type:"eth",requestManager:this._requestManager});return e.subscribe("logs",n.params,n.callback||function(){}),e},f.prototype.getPastEvents=function(){var n=this._generateEventOptions.apply(this,arguments),e=new i({name:"getPastLogs",call:"eth_getLogs",params:1,inputFormatter:[l.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(n.event)});e.setRequestManager(this._requestManager);var t=e.buildCall();return e=null,t(n.params,n.callback)},f.prototype._createTxObject=function(){var n=Array.prototype.slice.call(arguments),e={};if("function"===this.method.type&&(e.call=this.parent._executeMethod.bind(e,"call"),e.call.request=this.parent._executeMethod.bind(e,"call",!0)),e.send=this.parent._executeMethod.bind(e,"send"),e.send.request=this.parent._executeMethod.bind(e,"send",!0),e.encodeABI=this.parent._encodeMethodABI.bind(e),e.estimateGas=this.parent._executeMethod.bind(e,"estimate"),n&&this.method.inputs&&n.length!==this.method.inputs.length){if(this.nextMethod)return this.nextMethod.apply(null,n);throw c.InvalidNumberOfParams(n.length,this.method.inputs.length,this.method.name)}return e.arguments=n||[],e._method=this.method,e._parent=this.parent,e._ethAccounts=this.parent.constructor._ethAccounts||this._ethAccounts,this.deployData&&(e._deployData=this.deployData),e},f.prototype._processExecuteArguments=function(n,e){var t={};if(t.type=n.shift(),t.callback=this._parent._getCallback(n),"call"===t.type&&!0!==n[n.length-1]&&(r.isString(n[n.length-1])||isFinite(n[n.length-1]))&&(t.defaultBlock=n.pop()),t.options=r.isObject(n[n.length-1])?n.pop():{},t.generateRequest=!0===n[n.length-1]&&n.pop(),t.options=this._parent._getOrSetDefaultOptions(t.options),t.options.data=this.encodeABI(),!this._deployData&&!s.isAddress(this._parent.options.address))throw new Error("This contract object doesn't have address set yet, please set an address first.");return this._deployData||(t.options.to=this._parent.options.address),t.options.data?t:s._fireError(new Error("Couldn't find a matching contract method, or the number of parameters is wrong."),e.eventEmitter,e.reject,t.callback)},f.prototype._executeMethod=function(){var n=this,e=this._parent._processExecuteArguments.call(this,Array.prototype.slice.call(arguments),t),t=u("send"!==e.type),a=n.constructor._ethAccounts||n._ethAccounts;if(e.generateRequest){var o={params:[l.inputCallFormatter.call(this._parent,e.options)],callback:e.callback};return"call"===e.type?(o.params.push(l.inputDefaultBlockNumberFormatter.call(this._parent,e.defaultBlock)),o.method="eth_call",o.format=this._parent._decodeMethodReturn.bind(null,this._method.outputs)):o.method="eth_sendTransaction",o}switch(e.type){case"estimate":return new i({name:"estimateGas",call:"eth_estimateGas",params:1,inputFormatter:[l.inputCallFormatter],outputFormatter:s.hexToNumber,requestManager:n._parent._requestManager,accounts:a,defaultAccount:n._parent.defaultAccount,defaultBlock:n._parent.defaultBlock}).createFunction()(e.options,e.callback);case"call":return new i({name:"call",call:"eth_call",params:2,inputFormatter:[l.inputCallFormatter,l.inputDefaultBlockNumberFormatter],outputFormatter:function(e){return n._parent._decodeMethodReturn(n._method.outputs,e)},requestManager:n._parent._requestManager,accounts:a,defaultAccount:n._parent.defaultAccount,defaultBlock:n._parent.defaultBlock}).createFunction()(e.options,e.defaultBlock,e.callback);case"send":if(!s.isAddress(e.options.from))return s._fireError(new Error('No "from" address specified in neither the given options, nor the default options.'),t.eventEmitter,t.reject,e.callback);if(r.isBoolean(this._method.payable)&&!this._method.payable&&e.options.value&&e.options.value>0)return s._fireError(new Error("Can not send value to non-payable contract method or constructor"),t.eventEmitter,t.reject,e.callback);var c={receiptFormatter:function(e){if(r.isArray(e.logs)){var t=r.map(e.logs,function(e){return n._parent._decodeEventABI.call({name:"ALLEVENTS",jsonInterface:n._parent.options.jsonInterface},e)});e.events={};var a=0;t.forEach(function(n){n.event?e.events[n.event]?Array.isArray(e.events[n.event])?e.events[n.event].push(n):e.events[n.event]=[e.events[n.event],n]:e.events[n.event]=n:(e.events[a]=n,a++)}),delete e.logs}return e},contractDeployFormatter:function(e){var t=n._parent.clone();return t.options.address=e.contractAddress,t}};return new i({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[l.inputTransactionFormatter],requestManager:n._parent._requestManager,accounts:n.constructor._ethAccounts||n._ethAccounts,defaultAccount:n._parent.defaultAccount,defaultBlock:n._parent.defaultBlock,extraFormatters:c}).createFunction()(e.options,e.callback)}},n.exports=f},function(n,e,t){var r=t(5),a=t(10),i=new(0,t(258).AbiCoder)(function(n,e){return!n.match(/^u?int/)||r.isArray(e)||r.isObject(e)&&"BN"===e.constructor.name?e:e.toString()});function s(){}var o=function(){};o.prototype.encodeFunctionSignature=function(n){return r.isObject(n)&&(n=a._jsonInterfaceMethodToString(n)),a.sha3(n).slice(0,10)},o.prototype.encodeEventSignature=function(n){return r.isObject(n)&&(n=a._jsonInterfaceMethodToString(n)),a.sha3(n)},o.prototype.encodeParameter=function(n,e){return this.encodeParameters([n],[e])},o.prototype.encodeParameters=function(n,e){return i.encode(this.mapTypes(n),e)},o.prototype.mapTypes=function(n){var e=this,t=[];return n.forEach(function(n){if(e.isSimplifiedStructFormat(n)){var r=Object.keys(n)[0];t.push(Object.assign(e.mapStructNameAndType(r),{components:e.mapStructToCoderFormat(n[r])}))}else t.push(n)}),t},o.prototype.isSimplifiedStructFormat=function(n){return"object"==typeof n&&void 0===n.components&&void 0===n.name},o.prototype.mapStructNameAndType=function(n){var e="tuple";return n.indexOf("[]")>-1&&(e="tuple[]",n=n.slice(0,-2)),{type:e,name:n}},o.prototype.mapStructToCoderFormat=function(n){var e=this,t=[];return Object.keys(n).forEach(function(r){"object"!=typeof n[r]?t.push({name:r,type:n[r]}):t.push(Object.assign(e.mapStructNameAndType(r),{components:e.mapStructToCoderFormat(n[r])}))}),t},o.prototype.encodeFunctionCall=function(n,e){return this.encodeFunctionSignature(n)+this.encodeParameters(n.inputs,e).replace("0x","")},o.prototype.decodeParameter=function(n,e){return this.decodeParameters([n],e)[0]},o.prototype.decodeParameters=function(n,e){if(!e||"0x"===e||"0X"===e)throw new Error("Returned values aren't valid, did it run Out of Gas?");var t=i.decode(this.mapTypes(n),"0x"+e.replace(/0x/i,"")),a=new s;return a.__length__=0,n.forEach(function(n,e){var i=t[a.__length__];i="0x"===i?null:i,a[e]=i,r.isObject(n)&&n.name&&(a[n.name]=i),a.__length__++}),a},o.prototype.decodeLog=function(n,e,t){var a=this;t=r.isArray(t)?t:[t],e=e||"";var i=[],o=[],l=0;n.forEach(function(n,e){n.indexed?(o[e]=["bool","int","uint","address","fixed","ufixed"].find(function(e){return-1!==n.type.indexOf(e)})?a.decodeParameter(n.type,t[l]):t[l],l++):i[e]=n});var c=e,u=c?this.decodeParameters(i,c):[],d=new s;return d.__length__=0,n.forEach(function(n,e){d[e]="string"===n.type?"":null,void 0!==u[e]&&(d[e]=u[e]),void 0!==o[e]&&(d[e]=o[e]),n.name&&(d[n.name]=d[e]),d.__length__++}),d};var l=new o;n.exports=l},function(n,e,t){(function(e,t){ /** * [js-sha3]{@link https://github.com/emn178/js-sha3} * @@ -14,12 +14,12 @@ var r=t(207),a=t(208),i=t(94);function s(){return l.TYPED_ARRAY_SUPPORT?21474836 * @copyright Chen, Yi-Cyuan 2015-2016 * @license MIT */ -!function(){"use strict";var r="object"==typeof window?window:{};!r.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(r=t);for(var a=!r.JS_SHA3_NO_COMMON_JS&&"object"==typeof n&&n.exports,i="0123456789abcdef".split(""),s=[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],l=[224,256,384,512],c=["hex","buffer","arrayBuffer","array"],u=function(n,e,t){return function(r){return new w(n,e,n).update(r)[t]()}},d=function(n,e,t){return function(r,a){return new w(n,e,a).update(r)[t]()}},f=function(n,e){var t=u(n,e,"hex");t.create=function(){return new w(n,e,n)},t.update=function(n){return t.create().update(n)};for(var r=0;r>5,this.byteCount=this.blockCount<<2,this.outputBlocks=t>>5,this.extraBytes=(31&t)>>3;for(var r=0;r<50;++r)this.s[r]=0}w.prototype.update=function(n){var e="string"!=typeof n;e&&n.constructor===ArrayBuffer&&(n=new Uint8Array(n));for(var t,r,a=n.length,i=this.blocks,o=this.byteCount,l=this.blockCount,c=0,u=this.s;c>2]|=n[c]<>2]|=r<>2]|=(192|r>>6)<>2]|=(128|63&r)<=57344?(i[t>>2]|=(224|r>>12)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<=o){for(this.start=t-o,this.block=i[l],t=0;t>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(n[0]=n[t],e=1;e>4&15]+i[15&n]+i[n>>12&15]+i[n>>8&15]+i[n>>20&15]+i[n>>16&15]+i[n>>28&15]+i[n>>24&15];o%e==0&&(k(t),s=0)}return a&&(n=t[s],a>0&&(l+=i[n>>4&15]+i[15&n]),a>1&&(l+=i[n>>12&15]+i[n>>8&15]),a>2&&(l+=i[n>>20&15]+i[n>>16&15])),l},w.prototype.arrayBuffer=function(){this.finalize();var n,e=this.blockCount,t=this.s,r=this.outputBlocks,a=this.extraBytes,i=0,s=0,o=this.outputBits>>3;n=a?new ArrayBuffer(r+1<<2):new ArrayBuffer(o);for(var l=new Uint32Array(n);s>8&255,l[n+2]=e>>16&255,l[n+3]=e>>24&255;o%t==0&&k(r)}return i&&(n=o<<2,e=r[s],i>0&&(l[n]=255&e),i>1&&(l[n+1]=e>>8&255),i>2&&(l[n+2]=e>>16&255)),l};var k=function(n){var e,t,r,a,i,s,l,c,u,d,f,h,p,m,b,g,y,v,_,w,k,x,S,A,E,T,C,I,j,R,B,M,N,P,O,L,D,q,F,U,z,K,H,G,V,W,Y,X,J,Z,$,Q,nn,en,tn,rn,an,sn,on,ln,cn,un,dn;for(r=0;r<48;r+=2)a=n[0]^n[10]^n[20]^n[30]^n[40],i=n[1]^n[11]^n[21]^n[31]^n[41],s=n[2]^n[12]^n[22]^n[32]^n[42],l=n[3]^n[13]^n[23]^n[33]^n[43],c=n[4]^n[14]^n[24]^n[34]^n[44],u=n[5]^n[15]^n[25]^n[35]^n[45],d=n[6]^n[16]^n[26]^n[36]^n[46],f=n[7]^n[17]^n[27]^n[37]^n[47],e=(h=n[8]^n[18]^n[28]^n[38]^n[48])^(s<<1|l>>>31),t=(p=n[9]^n[19]^n[29]^n[39]^n[49])^(l<<1|s>>>31),n[0]^=e,n[1]^=t,n[10]^=e,n[11]^=t,n[20]^=e,n[21]^=t,n[30]^=e,n[31]^=t,n[40]^=e,n[41]^=t,e=a^(c<<1|u>>>31),t=i^(u<<1|c>>>31),n[2]^=e,n[3]^=t,n[12]^=e,n[13]^=t,n[22]^=e,n[23]^=t,n[32]^=e,n[33]^=t,n[42]^=e,n[43]^=t,e=s^(d<<1|f>>>31),t=l^(f<<1|d>>>31),n[4]^=e,n[5]^=t,n[14]^=e,n[15]^=t,n[24]^=e,n[25]^=t,n[34]^=e,n[35]^=t,n[44]^=e,n[45]^=t,e=c^(h<<1|p>>>31),t=u^(p<<1|h>>>31),n[6]^=e,n[7]^=t,n[16]^=e,n[17]^=t,n[26]^=e,n[27]^=t,n[36]^=e,n[37]^=t,n[46]^=e,n[47]^=t,e=d^(a<<1|i>>>31),t=f^(i<<1|a>>>31),n[8]^=e,n[9]^=t,n[18]^=e,n[19]^=t,n[28]^=e,n[29]^=t,n[38]^=e,n[39]^=t,n[48]^=e,n[49]^=t,m=n[0],b=n[1],W=n[11]<<4|n[10]>>>28,Y=n[10]<<4|n[11]>>>28,I=n[20]<<3|n[21]>>>29,j=n[21]<<3|n[20]>>>29,ln=n[31]<<9|n[30]>>>23,cn=n[30]<<9|n[31]>>>23,K=n[40]<<18|n[41]>>>14,H=n[41]<<18|n[40]>>>14,P=n[2]<<1|n[3]>>>31,O=n[3]<<1|n[2]>>>31,g=n[13]<<12|n[12]>>>20,y=n[12]<<12|n[13]>>>20,X=n[22]<<10|n[23]>>>22,J=n[23]<<10|n[22]>>>22,R=n[33]<<13|n[32]>>>19,B=n[32]<<13|n[33]>>>19,un=n[42]<<2|n[43]>>>30,dn=n[43]<<2|n[42]>>>30,en=n[5]<<30|n[4]>>>2,tn=n[4]<<30|n[5]>>>2,L=n[14]<<6|n[15]>>>26,D=n[15]<<6|n[14]>>>26,v=n[25]<<11|n[24]>>>21,_=n[24]<<11|n[25]>>>21,Z=n[34]<<15|n[35]>>>17,$=n[35]<<15|n[34]>>>17,M=n[45]<<29|n[44]>>>3,N=n[44]<<29|n[45]>>>3,A=n[6]<<28|n[7]>>>4,E=n[7]<<28|n[6]>>>4,rn=n[17]<<23|n[16]>>>9,an=n[16]<<23|n[17]>>>9,q=n[26]<<25|n[27]>>>7,F=n[27]<<25|n[26]>>>7,w=n[36]<<21|n[37]>>>11,k=n[37]<<21|n[36]>>>11,Q=n[47]<<24|n[46]>>>8,nn=n[46]<<24|n[47]>>>8,G=n[8]<<27|n[9]>>>5,V=n[9]<<27|n[8]>>>5,T=n[18]<<20|n[19]>>>12,C=n[19]<<20|n[18]>>>12,sn=n[29]<<7|n[28]>>>25,on=n[28]<<7|n[29]>>>25,U=n[38]<<8|n[39]>>>24,z=n[39]<<8|n[38]>>>24,x=n[48]<<14|n[49]>>>18,S=n[49]<<14|n[48]>>>18,n[0]=m^~g&v,n[1]=b^~y&_,n[10]=A^~T&I,n[11]=E^~C&j,n[20]=P^~L&q,n[21]=O^~D&F,n[30]=G^~W&X,n[31]=V^~Y&J,n[40]=en^~rn&sn,n[41]=tn^~an&on,n[2]=g^~v&w,n[3]=y^~_&k,n[12]=T^~I&R,n[13]=C^~j&B,n[22]=L^~q&U,n[23]=D^~F&z,n[32]=W^~X&Z,n[33]=Y^~J&$,n[42]=rn^~sn&ln,n[43]=an^~on&cn,n[4]=v^~w&x,n[5]=_^~k&S,n[14]=I^~R&M,n[15]=j^~B&N,n[24]=q^~U&K,n[25]=F^~z&H,n[34]=X^~Z&Q,n[35]=J^~$&nn,n[44]=sn^~ln&un,n[45]=on^~cn&dn,n[6]=w^~x&m,n[7]=k^~S&b,n[16]=R^~M&A,n[17]=B^~N&E,n[26]=U^~K&P,n[27]=z^~H&O,n[36]=Z^~Q&G,n[37]=$^~nn&V,n[46]=ln^~un&en,n[47]=cn^~dn&tn,n[8]=x^~m&g,n[9]=S^~b&y,n[18]=M^~A&T,n[19]=N^~E&C,n[28]=K^~P&L,n[29]=H^~O&D,n[38]=Q^~G&W,n[39]=nn^~V&Y,n[48]=un^~en&rn,n[49]=dn^~tn&an,n[0]^=o[r],n[1]^=o[r+1]};if(a)n.exports=p;else for(b=0;b=0;a--){var o=r(s[a]);t=r(new n(t+o,"hex"))}}return"0x"+t},e.normalize=i}).call(this,t(2).Buffer)},function(n,e,t){"use strict";var r=t(17),a=t(20),i=t(10),s=t(44),o=t(7).formatters,l=function(){var n=this;r.packageInit(this,arguments),this.net=new s(this.currentProvider);var e=null,t="latest";Object.defineProperty(this,"defaultAccount",{get:function(){return e},set:function(n){return n&&(e=i.toChecksumAddress(o.inputAddressFormatter(n))),l.forEach(function(n){n.defaultAccount=e}),n},enumerable:!0}),Object.defineProperty(this,"defaultBlock",{get:function(){return t},set:function(n){return t=n,l.forEach(function(n){n.defaultBlock=t}),n},enumerable:!0});var l=[new a({name:"getAccounts",call:"personal_listAccounts",params:0,outputFormatter:i.toChecksumAddress}),new a({name:"newAccount",call:"personal_newAccount",params:1,inputFormatter:[null],outputFormatter:i.toChecksumAddress}),new a({name:"unlockAccount",call:"personal_unlockAccount",params:3,inputFormatter:[o.inputAddressFormatter,null,null]}),new a({name:"lockAccount",call:"personal_lockAccount",params:1,inputFormatter:[o.inputAddressFormatter]}),new a({name:"importRawKey",call:"personal_importRawKey",params:2}),new a({name:"sendTransaction",call:"personal_sendTransaction",params:2,inputFormatter:[o.inputTransactionFormatter,null]}),new a({name:"signTransaction",call:"personal_signTransaction",params:2,inputFormatter:[o.inputTransactionFormatter,null]}),new a({name:"sign",call:"personal_sign",params:3,inputFormatter:[o.inputSignFormatter,o.inputAddressFormatter,null]}),new a({name:"ecRecover",call:"personal_ecRecover",params:2,inputFormatter:[o.inputSignFormatter,null]})];l.forEach(function(e){e.attachToObject(n),e.setRequestManager(n._requestManager),e.defaultBlock=n.defaultBlock,e.defaultAccount=n.defaultAccount})};r.addProviders(l),n.exports=l},function(n,e,t){"use strict";var r=t(1).Buffer,a=t(71).Transform;function i(n){a.call(this),this._block=r.allocUnsafe(n),this._blockSize=n,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}t(0)(i,a),i.prototype._transform=function(n,e,t){var r=null;try{this.update(n,e)}catch(n){r=n}t(r)},i.prototype._flush=function(n){var e=null;try{this.push(this.digest())}catch(n){e=n}n(e)},i.prototype.update=function(n,e){if(function(n,e){if(!r.isBuffer(n)&&"string"!=typeof n)throw new TypeError(e+" must be a string or a buffer")}(n,"Data"),this._finalized)throw new Error("Digest already called");r.isBuffer(n)||(n=r.from(n,e));for(var t=this._block,a=0;this._blockOffset+n.length-a>=this._blockSize;){for(var i=this._blockOffset;i0;++s)this._length[s]+=o,(o=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*o);return this},i.prototype._update=function(){throw new Error("_update is not implemented")},i.prototype.digest=function(n){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==n&&(e=e.toString(n)),this._block.fill(0),this._blockOffset=0;for(var t=0;t<4;++t)this._length[t]=0;return e},i.prototype._digest=function(){throw new Error("_digest is not implemented")},n.exports=i},function(n,e,t){var r=t(0),a=t(25),i=t(1).Buffer,s=[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],o=new Array(64);function l(){this.init(),this._w=o,a.call(this,64,56)}function c(n,e,t){return t^n&(e^t)}function u(n,e,t){return n&e|t&(n|e)}function d(n){return(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10)}function f(n){return(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7)}function h(n){return(n>>>7|n<<25)^(n>>>18|n<<14)^n>>>3}r(l,a),l.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},l.prototype._update=function(n){for(var e,t=this._w,r=0|this._a,a=0|this._b,i=0|this._c,o=0|this._d,l=0|this._e,p=0|this._f,m=0|this._g,b=0|this._h,g=0;g<16;++g)t[g]=n.readInt32BE(4*g);for(;g<64;++g)t[g]=0|(((e=t[g-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+t[g-7]+h(t[g-15])+t[g-16];for(var y=0;y<64;++y){var v=b+f(l)+c(l,p,m)+s[y]+t[y]|0,_=d(r)+u(r,a,i)|0;b=m,m=p,p=l,l=o+v|0,o=i,i=a,a=r,r=v+_|0}this._a=r+this._a|0,this._b=a+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=l+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=b+this._h|0},l.prototype._hash=function(){var n=i.allocUnsafe(32);return n.writeInt32BE(this._a,0),n.writeInt32BE(this._b,4),n.writeInt32BE(this._c,8),n.writeInt32BE(this._d,12),n.writeInt32BE(this._e,16),n.writeInt32BE(this._f,20),n.writeInt32BE(this._g,24),n.writeInt32BE(this._h,28),n},n.exports=l},function(n,e,t){var r=t(0),a=t(25),i=t(1).Buffer,s=[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],o=new Array(160);function l(){this.init(),this._w=o,a.call(this,128,112)}function c(n,e,t){return t^n&(e^t)}function u(n,e,t){return n&e|t&(n|e)}function d(n,e){return(n>>>28|e<<4)^(e>>>2|n<<30)^(e>>>7|n<<25)}function f(n,e){return(n>>>14|e<<18)^(n>>>18|e<<14)^(e>>>9|n<<23)}function h(n,e){return(n>>>1|e<<31)^(n>>>8|e<<24)^n>>>7}function p(n,e){return(n>>>1|e<<31)^(n>>>8|e<<24)^(n>>>7|e<<25)}function m(n,e){return(n>>>19|e<<13)^(e>>>29|n<<3)^n>>>6}function b(n,e){return(n>>>19|e<<13)^(e>>>29|n<<3)^(n>>>6|e<<26)}function g(n,e){return n>>>0>>0?1:0}r(l,a),l.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},l.prototype._update=function(n){for(var e=this._w,t=0|this._ah,r=0|this._bh,a=0|this._ch,i=0|this._dh,o=0|this._eh,l=0|this._fh,y=0|this._gh,v=0|this._hh,_=0|this._al,w=0|this._bl,k=0|this._cl,x=0|this._dl,S=0|this._el,A=0|this._fl,E=0|this._gl,T=0|this._hl,C=0;C<32;C+=2)e[C]=n.readInt32BE(4*C),e[C+1]=n.readInt32BE(4*C+4);for(;C<160;C+=2){var I=e[C-30],j=e[C-30+1],R=h(I,j),B=p(j,I),M=m(I=e[C-4],j=e[C-4+1]),N=b(j,I),P=e[C-14],O=e[C-14+1],L=e[C-32],D=e[C-32+1],q=B+O|0,F=R+P+g(q,B)|0;F=(F=F+M+g(q=q+N|0,N)|0)+L+g(q=q+D|0,D)|0,e[C]=F,e[C+1]=q}for(var U=0;U<160;U+=2){F=e[U],q=e[U+1];var z=u(t,r,a),K=u(_,w,k),H=d(t,_),G=d(_,t),V=f(o,S),W=f(S,o),Y=s[U],X=s[U+1],J=c(o,l,y),Z=c(S,A,E),$=T+W|0,Q=v+V+g($,T)|0;Q=(Q=(Q=Q+J+g($=$+Z|0,Z)|0)+Y+g($=$+X|0,X)|0)+F+g($=$+q|0,q)|0;var nn=G+K|0,en=H+z+g(nn,G)|0;v=y,T=E,y=l,E=A,l=o,A=S,o=i+Q+g(S=x+$|0,x)|0,i=a,x=k,a=r,k=w,r=t,w=_,t=Q+en+g(_=$+nn|0,$)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+k|0,this._dl=this._dl+x|0,this._el=this._el+S|0,this._fl=this._fl+A|0,this._gl=this._gl+E|0,this._hl=this._hl+T|0,this._ah=this._ah+t+g(this._al,_)|0,this._bh=this._bh+r+g(this._bl,w)|0,this._ch=this._ch+a+g(this._cl,k)|0,this._dh=this._dh+i+g(this._dl,x)|0,this._eh=this._eh+o+g(this._el,S)|0,this._fh=this._fh+l+g(this._fl,A)|0,this._gh=this._gh+y+g(this._gl,E)|0,this._hh=this._hh+v+g(this._hl,T)|0},l.prototype._hash=function(){var n=i.allocUnsafe(64);function e(e,t,r){n.writeInt32BE(e,r),n.writeInt32BE(t,r+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),n},n.exports=l},function(n,e,t){"use strict";var r=t(0),a=t(281),i=t(15),s=t(1).Buffer,o=t(122),l=t(72),c=t(73),u=s.alloc(128);function d(n,e){i.call(this,"digest"),"string"==typeof e&&(e=s.from(e));var t="sha512"===n||"sha384"===n?128:64;(this._alg=n,this._key=e,e.length>t)?e=("rmd160"===n?new l:c(n)).update(e).digest():e.lengtht||i!=i)throw new TypeError("Bad key length")}}).call(this,t(2).Buffer)},function(n,e,t){(function(e){var t;e.browser?t="utf-8":t=parseInt(e.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary";n.exports=t}).call(this,t(8))},function(n,e,t){var r=t(122),a=t(72),i=t(73),s=t(124),o=t(125),l=t(1).Buffer,c=l.alloc(128),u={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function d(n,e,t){var s=function(n){return"rmd160"===n||"ripemd160"===n?function(n){return(new a).update(n).digest()}:"md5"===n?r:function(e){return i(n).update(e).digest()}}(n),o="sha512"===n||"sha384"===n?128:64;e.length>o?e=s(e):e.lengthn;)t.ishrn(1);if(t.isEven()&&t.iadd(o),t.testn(1)||t.iadd(l),e.cmp(l)){if(!e.cmp(c))for(;t.mod(u).cmp(d);)t.iadd(h)}else for(;t.mod(i).cmp(f);)t.iadd(h);if(b(p=t.shrn(1))&&b(t)&&g(p)&&g(t)&&s.test(p)&&s.test(t))return t}}},function(n,e,t){var r=t(3),a=t(134);function i(n){this.rand=n||new a.Rand}n.exports=i,i.create=function(n){return new i(n)},i.prototype._randbelow=function(n){var e=n.bitLength(),t=Math.ceil(e/8);do{var a=new r(this.rand.generate(t))}while(a.cmp(n)>=0);return a},i.prototype._randrange=function(n,e){var t=e.sub(n);return n.add(this._randbelow(t))},i.prototype.test=function(n,e,t){var a=n.bitLength(),i=r.mont(n),s=new r(1).toRed(i);e||(e=Math.max(1,a/48|0));for(var o=n.subn(1),l=0;!o.testn(l);l++);for(var c=n.shrn(l),u=o.toRed(i);e>0;e--){var d=this._randrange(new r(2),o);t&&t(d);var f=d.toRed(i).redPow(c);if(0!==f.cmp(s)&&0!==f.cmp(u)){for(var h=1;h0;e--){var u=this._randrange(new r(2),s),d=n.gcd(u);if(0!==d.cmpn(1))return d;var f=u.toRed(a).redPow(l);if(0!==f.cmp(i)&&0!==f.cmp(c)){for(var h=1;h>8,s=255&a;i?t.push(i,s):t.push(s)}return t},r.zero2=a,r.toHex=i,r.encode=function(n,e){return"hex"===e?i(n):n}},function(n,e,t){"use strict";var r=t(11).rotr32;function a(n,e,t){return n&e^~n&t}function i(n,e,t){return n&e^n&t^e&t}function s(n,e,t){return n^e^t}e.ft_1=function(n,e,t,r){return 0===n?a(e,t,r):1===n||3===n?s(e,t,r):2===n?i(e,t,r):void 0},e.ch32=a,e.maj32=i,e.p32=s,e.s0_256=function(n){return r(n,2)^r(n,13)^r(n,22)},e.s1_256=function(n){return r(n,6)^r(n,11)^r(n,25)},e.g0_256=function(n){return r(n,7)^r(n,18)^n>>>3},e.g1_256=function(n){return r(n,17)^r(n,19)^n>>>10}},function(n,e,t){"use strict";var r=t(11),a=t(36),i=t(136),s=t(9),o=r.sum32,l=r.sum32_4,c=r.sum32_5,u=i.ch32,d=i.maj32,f=i.s0_256,h=i.s1_256,p=i.g0_256,m=i.g1_256,b=a.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;b.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}r.inherits(y,b),n.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(n,e){for(var t=this.W,r=0;r<16;r++)t[r]=n[e+r];for(;r>6],a=0==(32&t);if(31==(31&t)){var i=t;for(t=0;128==(128&i);){if(i=n.readUInt8(e),n.isError(i))return i;t<<=7,t|=127&i}}else t&=31;return{cls:r,primitive:a,tag:t,tagStr:o.tag[t]}}function d(n,e,t){var r=n.readUInt8(t);if(n.isError(r))return r;if(!e&&128===r)return null;if(0==(128&r))return r;var a=127&r;if(a>4)return n.error("length octect is too long");r=0;for(var i=0;i=31)return r.error("Multi-octet tag encoding unsupported");e||(a|=32);return a|=o.tagClassByName[t||"universal"]<<6}(n,e,t,this.reporter);if(r.length<128)return(i=new a(2))[0]=s,i[1]=r.length,this._createEncoderBuffer([i,r]);for(var l=1,c=r.length;c>=256;c>>=8)l++;(i=new a(2+l))[0]=s,i[1]=128|l;c=1+l;for(var u=r.length;u>0;c--,u>>=8)i[c]=255&u;return this._createEncoderBuffer([i,r])},c.prototype._encodeStr=function(n,e){if("bitstr"===e)return this._createEncoderBuffer([0|n.unused,n.data]);if("bmpstr"===e){for(var t=new a(2*n.length),r=0;r=40)return this.reporter.error("Second objid identifier OOB");n.splice(0,2,40*n[0]+n[1])}var i=0;for(r=0;r=128;s>>=7)i++}var o=new a(i),l=o.length-1;for(r=n.length-1;r>=0;r--){s=n[r];for(o[l--]=127&s;(s>>=7)>0;)o[l--]=128|127&s}return this._createEncoderBuffer(o)},c.prototype._encodeTime=function(n,e){var t,r=new Date(n);return"gentime"===e?t=[u(r.getFullYear()),u(r.getUTCMonth()+1),u(r.getUTCDate()),u(r.getUTCHours()),u(r.getUTCMinutes()),u(r.getUTCSeconds()),"Z"].join(""):"utctime"===e?t=[u(r.getFullYear()%100),u(r.getUTCMonth()+1),u(r.getUTCDate()),u(r.getUTCHours()),u(r.getUTCMinutes()),u(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(t,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.prototype._encodeInt=function(n,e){if("string"==typeof n){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(n))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(n));n=e[n]}if("number"!=typeof n&&!a.isBuffer(n)){var t=n.toArray();!n.sign&&128&t[0]&&t.unshift(0),n=new a(t)}if(a.isBuffer(n)){var r=n.length;0===n.length&&r++;var i=new a(r);return n.copy(i),0===n.length&&(i[0]=0),this._createEncoderBuffer(i)}if(n<128)return this._createEncoderBuffer(n);if(n<256)return this._createEncoderBuffer([0,n]);r=1;for(var s=n;s>=256;s>>=8)r++;for(s=(i=new Array(r)).length-1;s>=0;s--)i[s]=255&n,n>>=8;return 128&i[0]&&i.unshift(0),this._createEncoderBuffer(new a(i))},c.prototype._encodeBool=function(n){return this._createEncoderBuffer(n?255:0)},c.prototype._use=function(n,e){return"function"==typeof n&&(n=n(e)),n._getEncoder("der").tree},c.prototype._skipDefault=function(n,e,t){var r,a=this._baseState;if(null===a.default)return!1;var i=n.join();if(void 0===a.defaultBuffer&&(a.defaultBuffer=this._encodeValue(a.default,e,t).join()),i.length!==a.defaultBuffer.length)return!1;for(r=0;r="80"?t(r.length/2,128):"")+r}var a=e.map(n).join("");return t(a.length/2,192)+a}(n)},decode:function(n){var e=2,t=function(){if(e>=n.length)throw"";var t=n.slice(e,e+2);return t<"80"?(e+=2,"0x"+t):t<"c0"?a():i()},r=function(){var t=parseInt(n.slice(e,e+=2),16)%64;return t<56?t:parseInt(n.slice(e,e+=2*(t-55)),16)},a=function(){var t=r();return"0x"+n.slice(e,e+=2*t)},i=function(){for(var n=2*r()+e,a=[];e>>31),t=(p=n[9]^n[19]^n[29]^n[39]^n[49])^(l<<1|o>>>31),n[0]^=e,n[1]^=t,n[10]^=e,n[11]^=t,n[20]^=e,n[21]^=t,n[30]^=e,n[31]^=t,n[40]^=e,n[41]^=t,e=a^(c<<1|u>>>31),t=s^(u<<1|c>>>31),n[2]^=e,n[3]^=t,n[12]^=e,n[13]^=t,n[22]^=e,n[23]^=t,n[32]^=e,n[33]^=t,n[42]^=e,n[43]^=t,e=o^(d<<1|f>>>31),t=l^(f<<1|d>>>31),n[4]^=e,n[5]^=t,n[14]^=e,n[15]^=t,n[24]^=e,n[25]^=t,n[34]^=e,n[35]^=t,n[44]^=e,n[45]^=t,e=c^(h<<1|p>>>31),t=u^(p<<1|h>>>31),n[6]^=e,n[7]^=t,n[16]^=e,n[17]^=t,n[26]^=e,n[27]^=t,n[36]^=e,n[37]^=t,n[46]^=e,n[47]^=t,e=d^(a<<1|s>>>31),t=f^(s<<1|a>>>31),n[8]^=e,n[9]^=t,n[18]^=e,n[19]^=t,n[28]^=e,n[29]^=t,n[38]^=e,n[39]^=t,n[48]^=e,n[49]^=t,m=n[0],b=n[1],W=n[11]<<4|n[10]>>>28,Y=n[10]<<4|n[11]>>>28,I=n[20]<<3|n[21]>>>29,j=n[21]<<3|n[20]>>>29,ln=n[31]<<9|n[30]>>>23,cn=n[30]<<9|n[31]>>>23,K=n[40]<<18|n[41]>>>14,H=n[41]<<18|n[40]>>>14,P=n[2]<<1|n[3]>>>31,O=n[3]<<1|n[2]>>>31,g=n[13]<<12|n[12]>>>20,y=n[12]<<12|n[13]>>>20,X=n[22]<<10|n[23]>>>22,J=n[23]<<10|n[22]>>>22,R=n[33]<<13|n[32]>>>19,B=n[32]<<13|n[33]>>>19,un=n[42]<<2|n[43]>>>30,dn=n[43]<<2|n[42]>>>30,en=n[5]<<30|n[4]>>>2,tn=n[4]<<30|n[5]>>>2,L=n[14]<<6|n[15]>>>26,D=n[15]<<6|n[14]>>>26,v=n[25]<<11|n[24]>>>21,_=n[24]<<11|n[25]>>>21,Z=n[34]<<15|n[35]>>>17,$=n[35]<<15|n[34]>>>17,M=n[45]<<29|n[44]>>>3,N=n[44]<<29|n[45]>>>3,A=n[6]<<28|n[7]>>>4,E=n[7]<<28|n[6]>>>4,rn=n[17]<<23|n[16]>>>9,an=n[16]<<23|n[17]>>>9,q=n[26]<<25|n[27]>>>7,F=n[27]<<25|n[26]>>>7,w=n[36]<<21|n[37]>>>11,k=n[37]<<21|n[36]>>>11,Q=n[47]<<24|n[46]>>>8,nn=n[46]<<24|n[47]>>>8,G=n[8]<<27|n[9]>>>5,V=n[9]<<27|n[8]>>>5,T=n[18]<<20|n[19]>>>12,C=n[19]<<20|n[18]>>>12,sn=n[29]<<7|n[28]>>>25,on=n[28]<<7|n[29]>>>25,U=n[38]<<8|n[39]>>>24,z=n[39]<<8|n[38]>>>24,x=n[48]<<14|n[49]>>>18,S=n[49]<<14|n[48]>>>18,n[0]=m^~g&v,n[1]=b^~y&_,n[10]=A^~T&I,n[11]=E^~C&j,n[20]=P^~L&q,n[21]=O^~D&F,n[30]=G^~W&X,n[31]=V^~Y&J,n[40]=en^~rn&sn,n[41]=tn^~an&on,n[2]=g^~v&w,n[3]=y^~_&k,n[12]=T^~I&R,n[13]=C^~j&B,n[22]=L^~q&U,n[23]=D^~F&z,n[32]=W^~X&Z,n[33]=Y^~J&$,n[42]=rn^~sn&ln,n[43]=an^~on&cn,n[4]=v^~w&x,n[5]=_^~k&S,n[14]=I^~R&M,n[15]=j^~B&N,n[24]=q^~U&K,n[25]=F^~z&H,n[34]=X^~Z&Q,n[35]=J^~$&nn,n[44]=sn^~ln&un,n[45]=on^~cn&dn,n[6]=w^~x&m,n[7]=k^~S&b,n[16]=R^~M&A,n[17]=B^~N&E,n[26]=U^~K&P,n[27]=z^~H&O,n[36]=Z^~Q&G,n[37]=$^~nn&V,n[46]=ln^~un&en,n[47]=cn^~dn&tn,n[8]=x^~m&g,n[9]=S^~b&y,n[18]=M^~A&T,n[19]=N^~E&C,n[28]=K^~P&L,n[29]=H^~O&D,n[38]=Q^~G&W,n[39]=nn^~V&Y,n[48]=un^~en&rn,n[49]=dn^~tn&an,n[0]^=i[r],n[1]^=i[r+1]},o=function(n){return function(e){var i;if("0x"===e.slice(0,2)){i=[];for(var o=2,l=e.length;o>2]|=e[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(l[b>>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)<=c){for(n.start=b-c,n.block=l[u],b=0;b>2]|=r[3&b],n.lastByteIndex===c)for(l[0]=l[u],b=1;b>4&15]+t[15&p]+t[p>>12&15]+t[p>>8&15]+t[p>>20&15]+t[p>>16&15]+t[p>>28&15]+t[p>>24&15];g%u==0&&(s(f),b=0)}return"0x"+m}(function(n){return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(n<<1)>>5,outputBlocks:n>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e}(n),i)}};n.exports={keccak256:o(256),keccak512:o(512),keccak256s:o(256),keccak512s:o(512)}},function(n,e,t){"use strict"; +!function(){"use strict";var r="object"==typeof window?window:{};!r.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(r=t);for(var a=!r.JS_SHA3_NO_COMMON_JS&&"object"==typeof n&&n.exports,i="0123456789abcdef".split(""),s=[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],l=[224,256,384,512],c=["hex","buffer","arrayBuffer","array"],u=function(n,e,t){return function(r){return new w(n,e,n).update(r)[t]()}},d=function(n,e,t){return function(r,a){return new w(n,e,a).update(r)[t]()}},f=function(n,e){var t=u(n,e,"hex");t.create=function(){return new w(n,e,n)},t.update=function(n){return t.create().update(n)};for(var r=0;r>5,this.byteCount=this.blockCount<<2,this.outputBlocks=t>>5,this.extraBytes=(31&t)>>3;for(var r=0;r<50;++r)this.s[r]=0}w.prototype.update=function(n){var e="string"!=typeof n;e&&n.constructor===ArrayBuffer&&(n=new Uint8Array(n));for(var t,r,a=n.length,i=this.blocks,o=this.byteCount,l=this.blockCount,c=0,u=this.s;c>2]|=n[c]<>2]|=r<>2]|=(192|r>>6)<>2]|=(128|63&r)<=57344?(i[t>>2]|=(224|r>>12)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<=o){for(this.start=t-o,this.block=i[l],t=0;t>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(n[0]=n[t],e=1;e>4&15]+i[15&n]+i[n>>12&15]+i[n>>8&15]+i[n>>20&15]+i[n>>16&15]+i[n>>28&15]+i[n>>24&15];o%e==0&&(k(t),s=0)}return a&&(n=t[s],a>0&&(l+=i[n>>4&15]+i[15&n]),a>1&&(l+=i[n>>12&15]+i[n>>8&15]),a>2&&(l+=i[n>>20&15]+i[n>>16&15])),l},w.prototype.arrayBuffer=function(){this.finalize();var n,e=this.blockCount,t=this.s,r=this.outputBlocks,a=this.extraBytes,i=0,s=0,o=this.outputBits>>3;n=a?new ArrayBuffer(r+1<<2):new ArrayBuffer(o);for(var l=new Uint32Array(n);s>8&255,l[n+2]=e>>16&255,l[n+3]=e>>24&255;o%t==0&&k(r)}return i&&(n=o<<2,e=r[s],i>0&&(l[n]=255&e),i>1&&(l[n+1]=e>>8&255),i>2&&(l[n+2]=e>>16&255)),l};var k=function(n){var e,t,r,a,i,s,l,c,u,d,f,h,p,m,b,g,y,v,_,w,k,x,S,A,E,T,C,I,j,R,B,M,N,P,O,L,D,q,F,U,z,K,H,G,V,W,Y,X,J,Z,$,Q,nn,en,tn,rn,an,sn,on,ln,cn,un,dn;for(r=0;r<48;r+=2)a=n[0]^n[10]^n[20]^n[30]^n[40],i=n[1]^n[11]^n[21]^n[31]^n[41],s=n[2]^n[12]^n[22]^n[32]^n[42],l=n[3]^n[13]^n[23]^n[33]^n[43],c=n[4]^n[14]^n[24]^n[34]^n[44],u=n[5]^n[15]^n[25]^n[35]^n[45],d=n[6]^n[16]^n[26]^n[36]^n[46],f=n[7]^n[17]^n[27]^n[37]^n[47],e=(h=n[8]^n[18]^n[28]^n[38]^n[48])^(s<<1|l>>>31),t=(p=n[9]^n[19]^n[29]^n[39]^n[49])^(l<<1|s>>>31),n[0]^=e,n[1]^=t,n[10]^=e,n[11]^=t,n[20]^=e,n[21]^=t,n[30]^=e,n[31]^=t,n[40]^=e,n[41]^=t,e=a^(c<<1|u>>>31),t=i^(u<<1|c>>>31),n[2]^=e,n[3]^=t,n[12]^=e,n[13]^=t,n[22]^=e,n[23]^=t,n[32]^=e,n[33]^=t,n[42]^=e,n[43]^=t,e=s^(d<<1|f>>>31),t=l^(f<<1|d>>>31),n[4]^=e,n[5]^=t,n[14]^=e,n[15]^=t,n[24]^=e,n[25]^=t,n[34]^=e,n[35]^=t,n[44]^=e,n[45]^=t,e=c^(h<<1|p>>>31),t=u^(p<<1|h>>>31),n[6]^=e,n[7]^=t,n[16]^=e,n[17]^=t,n[26]^=e,n[27]^=t,n[36]^=e,n[37]^=t,n[46]^=e,n[47]^=t,e=d^(a<<1|i>>>31),t=f^(i<<1|a>>>31),n[8]^=e,n[9]^=t,n[18]^=e,n[19]^=t,n[28]^=e,n[29]^=t,n[38]^=e,n[39]^=t,n[48]^=e,n[49]^=t,m=n[0],b=n[1],W=n[11]<<4|n[10]>>>28,Y=n[10]<<4|n[11]>>>28,I=n[20]<<3|n[21]>>>29,j=n[21]<<3|n[20]>>>29,ln=n[31]<<9|n[30]>>>23,cn=n[30]<<9|n[31]>>>23,K=n[40]<<18|n[41]>>>14,H=n[41]<<18|n[40]>>>14,P=n[2]<<1|n[3]>>>31,O=n[3]<<1|n[2]>>>31,g=n[13]<<12|n[12]>>>20,y=n[12]<<12|n[13]>>>20,X=n[22]<<10|n[23]>>>22,J=n[23]<<10|n[22]>>>22,R=n[33]<<13|n[32]>>>19,B=n[32]<<13|n[33]>>>19,un=n[42]<<2|n[43]>>>30,dn=n[43]<<2|n[42]>>>30,en=n[5]<<30|n[4]>>>2,tn=n[4]<<30|n[5]>>>2,L=n[14]<<6|n[15]>>>26,D=n[15]<<6|n[14]>>>26,v=n[25]<<11|n[24]>>>21,_=n[24]<<11|n[25]>>>21,Z=n[34]<<15|n[35]>>>17,$=n[35]<<15|n[34]>>>17,M=n[45]<<29|n[44]>>>3,N=n[44]<<29|n[45]>>>3,A=n[6]<<28|n[7]>>>4,E=n[7]<<28|n[6]>>>4,rn=n[17]<<23|n[16]>>>9,an=n[16]<<23|n[17]>>>9,q=n[26]<<25|n[27]>>>7,F=n[27]<<25|n[26]>>>7,w=n[36]<<21|n[37]>>>11,k=n[37]<<21|n[36]>>>11,Q=n[47]<<24|n[46]>>>8,nn=n[46]<<24|n[47]>>>8,G=n[8]<<27|n[9]>>>5,V=n[9]<<27|n[8]>>>5,T=n[18]<<20|n[19]>>>12,C=n[19]<<20|n[18]>>>12,sn=n[29]<<7|n[28]>>>25,on=n[28]<<7|n[29]>>>25,U=n[38]<<8|n[39]>>>24,z=n[39]<<8|n[38]>>>24,x=n[48]<<14|n[49]>>>18,S=n[49]<<14|n[48]>>>18,n[0]=m^~g&v,n[1]=b^~y&_,n[10]=A^~T&I,n[11]=E^~C&j,n[20]=P^~L&q,n[21]=O^~D&F,n[30]=G^~W&X,n[31]=V^~Y&J,n[40]=en^~rn&sn,n[41]=tn^~an&on,n[2]=g^~v&w,n[3]=y^~_&k,n[12]=T^~I&R,n[13]=C^~j&B,n[22]=L^~q&U,n[23]=D^~F&z,n[32]=W^~X&Z,n[33]=Y^~J&$,n[42]=rn^~sn&ln,n[43]=an^~on&cn,n[4]=v^~w&x,n[5]=_^~k&S,n[14]=I^~R&M,n[15]=j^~B&N,n[24]=q^~U&K,n[25]=F^~z&H,n[34]=X^~Z&Q,n[35]=J^~$&nn,n[44]=sn^~ln&un,n[45]=on^~cn&dn,n[6]=w^~x&m,n[7]=k^~S&b,n[16]=R^~M&A,n[17]=B^~N&E,n[26]=U^~K&P,n[27]=z^~H&O,n[36]=Z^~Q&G,n[37]=$^~nn&V,n[46]=ln^~un&en,n[47]=cn^~dn&tn,n[8]=x^~m&g,n[9]=S^~b&y,n[18]=M^~A&T,n[19]=N^~E&C,n[28]=K^~P&L,n[29]=H^~O&D,n[38]=Q^~G&W,n[39]=nn^~V&Y,n[48]=un^~en&rn,n[49]=dn^~tn&an,n[0]^=o[r],n[1]^=o[r+1]};if(a)n.exports=p;else for(b=0;b=0;a--){var o=r(s[a]);t=r(new n(t+o,"hex"))}}return"0x"+t},e.normalize=i}).call(this,t(2).Buffer)},function(n,e,t){"use strict";var r=t(17),a=t(20),i=t(10),s=t(44),o=t(7).formatters,l=function(){var n=this;r.packageInit(this,arguments),this.net=new s(this.currentProvider);var e=null,t="latest";Object.defineProperty(this,"defaultAccount",{get:function(){return e},set:function(n){return n&&(e=i.toChecksumAddress(o.inputAddressFormatter(n))),l.forEach(function(n){n.defaultAccount=e}),n},enumerable:!0}),Object.defineProperty(this,"defaultBlock",{get:function(){return t},set:function(n){return t=n,l.forEach(function(n){n.defaultBlock=t}),n},enumerable:!0});var l=[new a({name:"getAccounts",call:"personal_listAccounts",params:0,outputFormatter:i.toChecksumAddress}),new a({name:"newAccount",call:"personal_newAccount",params:1,inputFormatter:[null],outputFormatter:i.toChecksumAddress}),new a({name:"unlockAccount",call:"personal_unlockAccount",params:3,inputFormatter:[o.inputAddressFormatter,null,null]}),new a({name:"lockAccount",call:"personal_lockAccount",params:1,inputFormatter:[o.inputAddressFormatter]}),new a({name:"importRawKey",call:"personal_importRawKey",params:2}),new a({name:"sendTransaction",call:"personal_sendTransaction",params:2,inputFormatter:[o.inputTransactionFormatter,null]}),new a({name:"signTransaction",call:"personal_signTransaction",params:2,inputFormatter:[o.inputTransactionFormatter,null]}),new a({name:"sign",call:"personal_sign",params:3,inputFormatter:[o.inputSignFormatter,o.inputAddressFormatter,null]}),new a({name:"ecRecover",call:"personal_ecRecover",params:2,inputFormatter:[o.inputSignFormatter,null]})];l.forEach(function(e){e.attachToObject(n),e.setRequestManager(n._requestManager),e.defaultBlock=n.defaultBlock,e.defaultAccount=n.defaultAccount})};r.addProviders(l),n.exports=l},function(n,e,t){"use strict";var r=t(1).Buffer,a=t(71).Transform;function i(n){a.call(this),this._block=r.allocUnsafe(n),this._blockSize=n,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}t(0)(i,a),i.prototype._transform=function(n,e,t){var r=null;try{this.update(n,e)}catch(n){r=n}t(r)},i.prototype._flush=function(n){var e=null;try{this.push(this.digest())}catch(n){e=n}n(e)},i.prototype.update=function(n,e){if(function(n,e){if(!r.isBuffer(n)&&"string"!=typeof n)throw new TypeError(e+" must be a string or a buffer")}(n,"Data"),this._finalized)throw new Error("Digest already called");r.isBuffer(n)||(n=r.from(n,e));for(var t=this._block,a=0;this._blockOffset+n.length-a>=this._blockSize;){for(var i=this._blockOffset;i0;++s)this._length[s]+=o,(o=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*o);return this},i.prototype._update=function(){throw new Error("_update is not implemented")},i.prototype.digest=function(n){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==n&&(e=e.toString(n)),this._block.fill(0),this._blockOffset=0;for(var t=0;t<4;++t)this._length[t]=0;return e},i.prototype._digest=function(){throw new Error("_digest is not implemented")},n.exports=i},function(n,e,t){var r=t(0),a=t(26),i=t(1).Buffer,s=[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],o=new Array(64);function l(){this.init(),this._w=o,a.call(this,64,56)}function c(n,e,t){return t^n&(e^t)}function u(n,e,t){return n&e|t&(n|e)}function d(n){return(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10)}function f(n){return(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7)}function h(n){return(n>>>7|n<<25)^(n>>>18|n<<14)^n>>>3}r(l,a),l.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},l.prototype._update=function(n){for(var e,t=this._w,r=0|this._a,a=0|this._b,i=0|this._c,o=0|this._d,l=0|this._e,p=0|this._f,m=0|this._g,b=0|this._h,g=0;g<16;++g)t[g]=n.readInt32BE(4*g);for(;g<64;++g)t[g]=0|(((e=t[g-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+t[g-7]+h(t[g-15])+t[g-16];for(var y=0;y<64;++y){var v=b+f(l)+c(l,p,m)+s[y]+t[y]|0,_=d(r)+u(r,a,i)|0;b=m,m=p,p=l,l=o+v|0,o=i,i=a,a=r,r=v+_|0}this._a=r+this._a|0,this._b=a+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=l+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=b+this._h|0},l.prototype._hash=function(){var n=i.allocUnsafe(32);return n.writeInt32BE(this._a,0),n.writeInt32BE(this._b,4),n.writeInt32BE(this._c,8),n.writeInt32BE(this._d,12),n.writeInt32BE(this._e,16),n.writeInt32BE(this._f,20),n.writeInt32BE(this._g,24),n.writeInt32BE(this._h,28),n},n.exports=l},function(n,e,t){var r=t(0),a=t(26),i=t(1).Buffer,s=[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],o=new Array(160);function l(){this.init(),this._w=o,a.call(this,128,112)}function c(n,e,t){return t^n&(e^t)}function u(n,e,t){return n&e|t&(n|e)}function d(n,e){return(n>>>28|e<<4)^(e>>>2|n<<30)^(e>>>7|n<<25)}function f(n,e){return(n>>>14|e<<18)^(n>>>18|e<<14)^(e>>>9|n<<23)}function h(n,e){return(n>>>1|e<<31)^(n>>>8|e<<24)^n>>>7}function p(n,e){return(n>>>1|e<<31)^(n>>>8|e<<24)^(n>>>7|e<<25)}function m(n,e){return(n>>>19|e<<13)^(e>>>29|n<<3)^n>>>6}function b(n,e){return(n>>>19|e<<13)^(e>>>29|n<<3)^(n>>>6|e<<26)}function g(n,e){return n>>>0>>0?1:0}r(l,a),l.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},l.prototype._update=function(n){for(var e=this._w,t=0|this._ah,r=0|this._bh,a=0|this._ch,i=0|this._dh,o=0|this._eh,l=0|this._fh,y=0|this._gh,v=0|this._hh,_=0|this._al,w=0|this._bl,k=0|this._cl,x=0|this._dl,S=0|this._el,A=0|this._fl,E=0|this._gl,T=0|this._hl,C=0;C<32;C+=2)e[C]=n.readInt32BE(4*C),e[C+1]=n.readInt32BE(4*C+4);for(;C<160;C+=2){var I=e[C-30],j=e[C-30+1],R=h(I,j),B=p(j,I),M=m(I=e[C-4],j=e[C-4+1]),N=b(j,I),P=e[C-14],O=e[C-14+1],L=e[C-32],D=e[C-32+1],q=B+O|0,F=R+P+g(q,B)|0;F=(F=F+M+g(q=q+N|0,N)|0)+L+g(q=q+D|0,D)|0,e[C]=F,e[C+1]=q}for(var U=0;U<160;U+=2){F=e[U],q=e[U+1];var z=u(t,r,a),K=u(_,w,k),H=d(t,_),G=d(_,t),V=f(o,S),W=f(S,o),Y=s[U],X=s[U+1],J=c(o,l,y),Z=c(S,A,E),$=T+W|0,Q=v+V+g($,T)|0;Q=(Q=(Q=Q+J+g($=$+Z|0,Z)|0)+Y+g($=$+X|0,X)|0)+F+g($=$+q|0,q)|0;var nn=G+K|0,en=H+z+g(nn,G)|0;v=y,T=E,y=l,E=A,l=o,A=S,o=i+Q+g(S=x+$|0,x)|0,i=a,x=k,a=r,k=w,r=t,w=_,t=Q+en+g(_=$+nn|0,$)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+k|0,this._dl=this._dl+x|0,this._el=this._el+S|0,this._fl=this._fl+A|0,this._gl=this._gl+E|0,this._hl=this._hl+T|0,this._ah=this._ah+t+g(this._al,_)|0,this._bh=this._bh+r+g(this._bl,w)|0,this._ch=this._ch+a+g(this._cl,k)|0,this._dh=this._dh+i+g(this._dl,x)|0,this._eh=this._eh+o+g(this._el,S)|0,this._fh=this._fh+l+g(this._fl,A)|0,this._gh=this._gh+y+g(this._gl,E)|0,this._hh=this._hh+v+g(this._hl,T)|0},l.prototype._hash=function(){var n=i.allocUnsafe(64);function e(e,t,r){n.writeInt32BE(e,r),n.writeInt32BE(t,r+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),n},n.exports=l},function(n,e,t){"use strict";var r=t(0),a=t(282),i=t(15),s=t(1).Buffer,o=t(123),l=t(72),c=t(73),u=s.alloc(128);function d(n,e){i.call(this,"digest"),"string"==typeof e&&(e=s.from(e));var t="sha512"===n||"sha384"===n?128:64;(this._alg=n,this._key=e,e.length>t)?e=("rmd160"===n?new l:c(n)).update(e).digest():e.lengtht||i!=i)throw new TypeError("Bad key length")}}).call(this,t(2).Buffer)},function(n,e,t){(function(e){var t;e.browser?t="utf-8":t=parseInt(e.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary";n.exports=t}).call(this,t(8))},function(n,e,t){var r=t(123),a=t(72),i=t(73),s=t(125),o=t(126),l=t(1).Buffer,c=l.alloc(128),u={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function d(n,e,t){var s=function(n){return"rmd160"===n||"ripemd160"===n?function(n){return(new a).update(n).digest()}:"md5"===n?r:function(e){return i(n).update(e).digest()}}(n),o="sha512"===n||"sha384"===n?128:64;e.length>o?e=s(e):e.lengthn;)t.ishrn(1);if(t.isEven()&&t.iadd(o),t.testn(1)||t.iadd(l),e.cmp(l)){if(!e.cmp(c))for(;t.mod(u).cmp(d);)t.iadd(h)}else for(;t.mod(i).cmp(f);)t.iadd(h);if(b(p=t.shrn(1))&&b(t)&&g(p)&&g(t)&&s.test(p)&&s.test(t))return t}}},function(n,e,t){var r=t(3),a=t(135);function i(n){this.rand=n||new a.Rand}n.exports=i,i.create=function(n){return new i(n)},i.prototype._randbelow=function(n){var e=n.bitLength(),t=Math.ceil(e/8);do{var a=new r(this.rand.generate(t))}while(a.cmp(n)>=0);return a},i.prototype._randrange=function(n,e){var t=e.sub(n);return n.add(this._randbelow(t))},i.prototype.test=function(n,e,t){var a=n.bitLength(),i=r.mont(n),s=new r(1).toRed(i);e||(e=Math.max(1,a/48|0));for(var o=n.subn(1),l=0;!o.testn(l);l++);for(var c=n.shrn(l),u=o.toRed(i);e>0;e--){var d=this._randrange(new r(2),o);t&&t(d);var f=d.toRed(i).redPow(c);if(0!==f.cmp(s)&&0!==f.cmp(u)){for(var h=1;h0;e--){var u=this._randrange(new r(2),s),d=n.gcd(u);if(0!==d.cmpn(1))return d;var f=u.toRed(a).redPow(l);if(0!==f.cmp(i)&&0!==f.cmp(c)){for(var h=1;h>8,s=255&a;i?t.push(i,s):t.push(s)}return t},r.zero2=a,r.toHex=i,r.encode=function(n,e){return"hex"===e?i(n):n}},function(n,e,t){"use strict";var r=t(11).rotr32;function a(n,e,t){return n&e^~n&t}function i(n,e,t){return n&e^n&t^e&t}function s(n,e,t){return n^e^t}e.ft_1=function(n,e,t,r){return 0===n?a(e,t,r):1===n||3===n?s(e,t,r):2===n?i(e,t,r):void 0},e.ch32=a,e.maj32=i,e.p32=s,e.s0_256=function(n){return r(n,2)^r(n,13)^r(n,22)},e.s1_256=function(n){return r(n,6)^r(n,11)^r(n,25)},e.g0_256=function(n){return r(n,7)^r(n,18)^n>>>3},e.g1_256=function(n){return r(n,17)^r(n,19)^n>>>10}},function(n,e,t){"use strict";var r=t(11),a=t(37),i=t(137),s=t(9),o=r.sum32,l=r.sum32_4,c=r.sum32_5,u=i.ch32,d=i.maj32,f=i.s0_256,h=i.s1_256,p=i.g0_256,m=i.g1_256,b=a.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;b.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}r.inherits(y,b),n.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(n,e){for(var t=this.W,r=0;r<16;r++)t[r]=n[e+r];for(;r>6],a=0==(32&t);if(31==(31&t)){var i=t;for(t=0;128==(128&i);){if(i=n.readUInt8(e),n.isError(i))return i;t<<=7,t|=127&i}}else t&=31;return{cls:r,primitive:a,tag:t,tagStr:o.tag[t]}}function d(n,e,t){var r=n.readUInt8(t);if(n.isError(r))return r;if(!e&&128===r)return null;if(0==(128&r))return r;var a=127&r;if(a>4)return n.error("length octect is too long");r=0;for(var i=0;i=31)return r.error("Multi-octet tag encoding unsupported");e||(a|=32);return a|=o.tagClassByName[t||"universal"]<<6}(n,e,t,this.reporter);if(r.length<128)return(i=new a(2))[0]=s,i[1]=r.length,this._createEncoderBuffer([i,r]);for(var l=1,c=r.length;c>=256;c>>=8)l++;(i=new a(2+l))[0]=s,i[1]=128|l;c=1+l;for(var u=r.length;u>0;c--,u>>=8)i[c]=255&u;return this._createEncoderBuffer([i,r])},c.prototype._encodeStr=function(n,e){if("bitstr"===e)return this._createEncoderBuffer([0|n.unused,n.data]);if("bmpstr"===e){for(var t=new a(2*n.length),r=0;r=40)return this.reporter.error("Second objid identifier OOB");n.splice(0,2,40*n[0]+n[1])}var i=0;for(r=0;r=128;s>>=7)i++}var o=new a(i),l=o.length-1;for(r=n.length-1;r>=0;r--){s=n[r];for(o[l--]=127&s;(s>>=7)>0;)o[l--]=128|127&s}return this._createEncoderBuffer(o)},c.prototype._encodeTime=function(n,e){var t,r=new Date(n);return"gentime"===e?t=[u(r.getFullYear()),u(r.getUTCMonth()+1),u(r.getUTCDate()),u(r.getUTCHours()),u(r.getUTCMinutes()),u(r.getUTCSeconds()),"Z"].join(""):"utctime"===e?t=[u(r.getFullYear()%100),u(r.getUTCMonth()+1),u(r.getUTCDate()),u(r.getUTCHours()),u(r.getUTCMinutes()),u(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(t,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.prototype._encodeInt=function(n,e){if("string"==typeof n){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(n))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(n));n=e[n]}if("number"!=typeof n&&!a.isBuffer(n)){var t=n.toArray();!n.sign&&128&t[0]&&t.unshift(0),n=new a(t)}if(a.isBuffer(n)){var r=n.length;0===n.length&&r++;var i=new a(r);return n.copy(i),0===n.length&&(i[0]=0),this._createEncoderBuffer(i)}if(n<128)return this._createEncoderBuffer(n);if(n<256)return this._createEncoderBuffer([0,n]);r=1;for(var s=n;s>=256;s>>=8)r++;for(s=(i=new Array(r)).length-1;s>=0;s--)i[s]=255&n,n>>=8;return 128&i[0]&&i.unshift(0),this._createEncoderBuffer(new a(i))},c.prototype._encodeBool=function(n){return this._createEncoderBuffer(n?255:0)},c.prototype._use=function(n,e){return"function"==typeof n&&(n=n(e)),n._getEncoder("der").tree},c.prototype._skipDefault=function(n,e,t){var r,a=this._baseState;if(null===a.default)return!1;var i=n.join();if(void 0===a.defaultBuffer&&(a.defaultBuffer=this._encodeValue(a.default,e,t).join()),i.length!==a.defaultBuffer.length)return!1;for(r=0;r="80"?t(r.length/2,128):"")+r}var a=e.map(n).join("");return t(a.length/2,192)+a}(n)},decode:function(n){var e=2,t=function(){if(e>=n.length)throw"";var t=n.slice(e,e+2);return t<"80"?(e+=2,"0x"+t):t<"c0"?a():i()},r=function(){var t=parseInt(n.slice(e,e+=2),16)%64;return t<56?t:parseInt(n.slice(e,e+=2*(t-55)),16)},a=function(){var t=r();return"0x"+n.slice(e,e+=2*t)},i=function(){for(var n=2*r()+e,a=[];e>>31),t=(p=n[9]^n[19]^n[29]^n[39]^n[49])^(l<<1|o>>>31),n[0]^=e,n[1]^=t,n[10]^=e,n[11]^=t,n[20]^=e,n[21]^=t,n[30]^=e,n[31]^=t,n[40]^=e,n[41]^=t,e=a^(c<<1|u>>>31),t=s^(u<<1|c>>>31),n[2]^=e,n[3]^=t,n[12]^=e,n[13]^=t,n[22]^=e,n[23]^=t,n[32]^=e,n[33]^=t,n[42]^=e,n[43]^=t,e=o^(d<<1|f>>>31),t=l^(f<<1|d>>>31),n[4]^=e,n[5]^=t,n[14]^=e,n[15]^=t,n[24]^=e,n[25]^=t,n[34]^=e,n[35]^=t,n[44]^=e,n[45]^=t,e=c^(h<<1|p>>>31),t=u^(p<<1|h>>>31),n[6]^=e,n[7]^=t,n[16]^=e,n[17]^=t,n[26]^=e,n[27]^=t,n[36]^=e,n[37]^=t,n[46]^=e,n[47]^=t,e=d^(a<<1|s>>>31),t=f^(s<<1|a>>>31),n[8]^=e,n[9]^=t,n[18]^=e,n[19]^=t,n[28]^=e,n[29]^=t,n[38]^=e,n[39]^=t,n[48]^=e,n[49]^=t,m=n[0],b=n[1],W=n[11]<<4|n[10]>>>28,Y=n[10]<<4|n[11]>>>28,I=n[20]<<3|n[21]>>>29,j=n[21]<<3|n[20]>>>29,ln=n[31]<<9|n[30]>>>23,cn=n[30]<<9|n[31]>>>23,K=n[40]<<18|n[41]>>>14,H=n[41]<<18|n[40]>>>14,P=n[2]<<1|n[3]>>>31,O=n[3]<<1|n[2]>>>31,g=n[13]<<12|n[12]>>>20,y=n[12]<<12|n[13]>>>20,X=n[22]<<10|n[23]>>>22,J=n[23]<<10|n[22]>>>22,R=n[33]<<13|n[32]>>>19,B=n[32]<<13|n[33]>>>19,un=n[42]<<2|n[43]>>>30,dn=n[43]<<2|n[42]>>>30,en=n[5]<<30|n[4]>>>2,tn=n[4]<<30|n[5]>>>2,L=n[14]<<6|n[15]>>>26,D=n[15]<<6|n[14]>>>26,v=n[25]<<11|n[24]>>>21,_=n[24]<<11|n[25]>>>21,Z=n[34]<<15|n[35]>>>17,$=n[35]<<15|n[34]>>>17,M=n[45]<<29|n[44]>>>3,N=n[44]<<29|n[45]>>>3,A=n[6]<<28|n[7]>>>4,E=n[7]<<28|n[6]>>>4,rn=n[17]<<23|n[16]>>>9,an=n[16]<<23|n[17]>>>9,q=n[26]<<25|n[27]>>>7,F=n[27]<<25|n[26]>>>7,w=n[36]<<21|n[37]>>>11,k=n[37]<<21|n[36]>>>11,Q=n[47]<<24|n[46]>>>8,nn=n[46]<<24|n[47]>>>8,G=n[8]<<27|n[9]>>>5,V=n[9]<<27|n[8]>>>5,T=n[18]<<20|n[19]>>>12,C=n[19]<<20|n[18]>>>12,sn=n[29]<<7|n[28]>>>25,on=n[28]<<7|n[29]>>>25,U=n[38]<<8|n[39]>>>24,z=n[39]<<8|n[38]>>>24,x=n[48]<<14|n[49]>>>18,S=n[49]<<14|n[48]>>>18,n[0]=m^~g&v,n[1]=b^~y&_,n[10]=A^~T&I,n[11]=E^~C&j,n[20]=P^~L&q,n[21]=O^~D&F,n[30]=G^~W&X,n[31]=V^~Y&J,n[40]=en^~rn&sn,n[41]=tn^~an&on,n[2]=g^~v&w,n[3]=y^~_&k,n[12]=T^~I&R,n[13]=C^~j&B,n[22]=L^~q&U,n[23]=D^~F&z,n[32]=W^~X&Z,n[33]=Y^~J&$,n[42]=rn^~sn&ln,n[43]=an^~on&cn,n[4]=v^~w&x,n[5]=_^~k&S,n[14]=I^~R&M,n[15]=j^~B&N,n[24]=q^~U&K,n[25]=F^~z&H,n[34]=X^~Z&Q,n[35]=J^~$&nn,n[44]=sn^~ln&un,n[45]=on^~cn&dn,n[6]=w^~x&m,n[7]=k^~S&b,n[16]=R^~M&A,n[17]=B^~N&E,n[26]=U^~K&P,n[27]=z^~H&O,n[36]=Z^~Q&G,n[37]=$^~nn&V,n[46]=ln^~un&en,n[47]=cn^~dn&tn,n[8]=x^~m&g,n[9]=S^~b&y,n[18]=M^~A&T,n[19]=N^~E&C,n[28]=K^~P&L,n[29]=H^~O&D,n[38]=Q^~G&W,n[39]=nn^~V&Y,n[48]=un^~en&rn,n[49]=dn^~tn&an,n[0]^=i[r],n[1]^=i[r+1]},o=function(n){return function(e){var i;if("0x"===e.slice(0,2)){i=[];for(var o=2,l=e.length;o>2]|=e[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(l[b>>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)<=c){for(n.start=b-c,n.block=l[u],b=0;b>2]|=r[3&b],n.lastByteIndex===c)for(l[0]=l[u],b=1;b>4&15]+t[15&p]+t[p>>12&15]+t[p>>8&15]+t[p>>20&15]+t[p>>16&15]+t[p>>28&15]+t[p>>24&15];g%u==0&&(s(f),b=0)}return"0x"+m}(function(n){return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(n<<1)>>5,outputBlocks:n>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e}(n),i)}};n.exports={keccak256:o(256),keccak512:o(512),keccak256s:o(256),keccak512s:o(512)}},function(n,e,t){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT -*/var r=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;n.exports=function(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de","5"===Object.getOwnPropertyNames(n)[0])return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(n){return e[n]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(n){r[n]=n}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(n){return!1}}()?Object.assign:function(n,e){for(var t,s,o=function(n){if(null==n)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}(n),l=1;l2?arguments[2]:{},i=r(e);a&&(i=s.call(i,Object.getOwnPropertySymbols(e)));for(var o=0;o=0&&"[object Function]"===r.call(n.callee)),t}},function(n,e,t){"use strict";var r=t(80),a=t(372),i=r.call(Function.call,String.prototype.replace),s=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,o=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;n.exports=function(){var n=a.ToString(a.CheckObjectCoercible(this));return i(i(n,s,""),o,"")}},function(n,e,t){"use strict";var r=Object.getOwnPropertyDescriptor?function(){return Object.getOwnPropertyDescriptor(arguments,"callee").get}():function(){throw new TypeError},a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=Object.getPrototypeOf||function(n){return n.__proto__},s=void 0,o="undefined"==typeof Uint8Array?void 0:i(Uint8Array),l={"$ %Array%":Array,"$ %ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"$ %ArrayBufferPrototype%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer.prototype,"$ %ArrayIteratorPrototype%":a?i([][Symbol.iterator]()):void 0,"$ %ArrayPrototype%":Array.prototype,"$ %ArrayProto_entries%":Array.prototype.entries,"$ %ArrayProto_forEach%":Array.prototype.forEach,"$ %ArrayProto_keys%":Array.prototype.keys,"$ %ArrayProto_values%":Array.prototype.values,"$ %AsyncFromSyncIteratorPrototype%":void 0,"$ %AsyncFunction%":void 0,"$ %AsyncFunctionPrototype%":void 0,"$ %AsyncGenerator%":void 0,"$ %AsyncGeneratorFunction%":void 0,"$ %AsyncGeneratorPrototype%":void 0,"$ %AsyncIteratorPrototype%":s&&a&&Symbol.asyncIterator?s[Symbol.asyncIterator]():void 0,"$ %Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"$ %Boolean%":Boolean,"$ %BooleanPrototype%":Boolean.prototype,"$ %DataView%":"undefined"==typeof DataView?void 0:DataView,"$ %DataViewPrototype%":"undefined"==typeof DataView?void 0:DataView.prototype,"$ %Date%":Date,"$ %DatePrototype%":Date.prototype,"$ %decodeURI%":decodeURI,"$ %decodeURIComponent%":decodeURIComponent,"$ %encodeURI%":encodeURI,"$ %encodeURIComponent%":encodeURIComponent,"$ %Error%":Error,"$ %ErrorPrototype%":Error.prototype,"$ %eval%":eval,"$ %EvalError%":EvalError,"$ %EvalErrorPrototype%":EvalError.prototype,"$ %Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"$ %Float32ArrayPrototype%":"undefined"==typeof Float32Array?void 0:Float32Array.prototype,"$ %Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"$ %Float64ArrayPrototype%":"undefined"==typeof Float64Array?void 0:Float64Array.prototype,"$ %Function%":Function,"$ %FunctionPrototype%":Function.prototype,"$ %Generator%":void 0,"$ %GeneratorFunction%":void 0,"$ %GeneratorPrototype%":void 0,"$ %Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"$ %Int8ArrayPrototype%":"undefined"==typeof Int8Array?void 0:Int8Array.prototype,"$ %Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"$ %Int16ArrayPrototype%":"undefined"==typeof Int16Array?void 0:Int8Array.prototype,"$ %Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"$ %Int32ArrayPrototype%":"undefined"==typeof Int32Array?void 0:Int32Array.prototype,"$ %isFinite%":isFinite,"$ %isNaN%":isNaN,"$ %IteratorPrototype%":a?i(i([][Symbol.iterator]())):void 0,"$ %JSON%":JSON,"$ %JSONParse%":JSON.parse,"$ %Map%":"undefined"==typeof Map?void 0:Map,"$ %MapIteratorPrototype%":"undefined"!=typeof Map&&a?i((new Map)[Symbol.iterator]()):void 0,"$ %MapPrototype%":"undefined"==typeof Map?void 0:Map.prototype,"$ %Math%":Math,"$ %Number%":Number,"$ %NumberPrototype%":Number.prototype,"$ %Object%":Object,"$ %ObjectPrototype%":Object.prototype,"$ %ObjProto_toString%":Object.prototype.toString,"$ %ObjProto_valueOf%":Object.prototype.valueOf,"$ %parseFloat%":parseFloat,"$ %parseInt%":parseInt,"$ %Promise%":"undefined"==typeof Promise?void 0:Promise,"$ %PromisePrototype%":"undefined"==typeof Promise?void 0:Promise.prototype,"$ %PromiseProto_then%":"undefined"==typeof Promise?void 0:Promise.prototype.then,"$ %Promise_all%":"undefined"==typeof Promise?void 0:Promise.all,"$ %Promise_reject%":"undefined"==typeof Promise?void 0:Promise.reject,"$ %Promise_resolve%":"undefined"==typeof Promise?void 0:Promise.resolve,"$ %Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"$ %RangeError%":RangeError,"$ %RangeErrorPrototype%":RangeError.prototype,"$ %ReferenceError%":ReferenceError,"$ %ReferenceErrorPrototype%":ReferenceError.prototype,"$ %Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"$ %RegExp%":RegExp,"$ %RegExpPrototype%":RegExp.prototype,"$ %Set%":"undefined"==typeof Set?void 0:Set,"$ %SetIteratorPrototype%":"undefined"!=typeof Set&&a?i((new Set)[Symbol.iterator]()):void 0,"$ %SetPrototype%":"undefined"==typeof Set?void 0:Set.prototype,"$ %SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"$ %SharedArrayBufferPrototype%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer.prototype,"$ %String%":String,"$ %StringIteratorPrototype%":a?i(""[Symbol.iterator]()):void 0,"$ %StringPrototype%":String.prototype,"$ %Symbol%":a?Symbol:void 0,"$ %SymbolPrototype%":a?Symbol.prototype:void 0,"$ %SyntaxError%":SyntaxError,"$ %SyntaxErrorPrototype%":SyntaxError.prototype,"$ %ThrowTypeError%":r,"$ %TypedArray%":o,"$ %TypedArrayPrototype%":o?o.prototype:void 0,"$ %TypeError%":TypeError,"$ %TypeErrorPrototype%":TypeError.prototype,"$ %Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"$ %Uint8ArrayPrototype%":"undefined"==typeof Uint8Array?void 0:Uint8Array.prototype,"$ %Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"$ %Uint8ClampedArrayPrototype%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray.prototype,"$ %Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"$ %Uint16ArrayPrototype%":"undefined"==typeof Uint16Array?void 0:Uint16Array.prototype,"$ %Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"$ %Uint32ArrayPrototype%":"undefined"==typeof Uint32Array?void 0:Uint32Array.prototype,"$ %URIError%":URIError,"$ %URIErrorPrototype%":URIError.prototype,"$ %WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"$ %WeakMapPrototype%":"undefined"==typeof WeakMap?void 0:WeakMap.prototype,"$ %WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet,"$ %WeakSetPrototype%":"undefined"==typeof WeakSet?void 0:WeakSet.prototype};n.exports=function(n,e){if(arguments.length>1&&"boolean"!=typeof e)throw new TypeError('"allowMissing" argument must be a boolean');var t="$ "+n;if(!(t in l))throw new SyntaxError("intrinsic "+n+" does not exist!");if(void 0===l[t]&&!e)throw new TypeError("intrinsic "+n+" exists, but is not available. Please file an issue!");return l[t]}},function(n,e,t){"use strict";var r=t(80);n.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},function(n,e,t){"use strict";var r=t(153);n.exports=function(){return String.prototype.trim&&"​"==="​".trim()?String.prototype.trim:r}},function(n,e,t){t(383);var r=function(n,e){return parseInt(n.slice(2*e+2,2*e+4),16)},a=function(n){return(n.length-2)/2},i=function(n){for(var e=[],t=2,r=n.length;t>6|192);else{if(a>55295&&a<56320){if(++r==n.length)return null;var i=n.charCodeAt(r);if(i<56320||i>57343)return null;t+=e((a=65536+((1023&a)<<10)+(1023&i))>>18|240),t+=e(a>>12&63|128)}else t+=e(a>>12|224);t+=e(a>>6&63|128)}t+=e(63&a|128)}}return t},toString:function(n){for(var e="",t=0,i=a(n);t127){if(s>191&&s<224){if(t>=i)return null;s=(31&s)<<6|63&r(n,t)}else if(s>223&&s<240){if(t+1>=i)return null;s=(15&s)<<12|(63&r(n,t))<<6|63&r(n,++t)}else{if(!(s>239&&s<248))return null;if(t+2>=i)return null;s=(7&s)<<18|(63&r(n,t))<<12|(63&r(n,++t))<<6|63&r(n,++t)}++t}if(s<=65535)e+=String.fromCharCode(s);else{if(!(s<=1114111))return null;s-=65536,e+=String.fromCharCode(s>>10|55296),e+=String.fromCharCode(1023&s|56320)}}return e},fromNumber:function(n){var e=n.toString(16);return e.length%2==0?"0x"+e:"0x0"+e},toNumber:function(n){return parseInt(n.slice(2),16)},fromNat:function(n){return"0x0"===n?"0x":n.length%2==0?n:"0x0"+n.slice(2)},toNat:function(n){return"0"===n[2]?"0x"+n.slice(3):n},fromArray:s,toArray:i,fromUint8Array:function(n){return s([].slice.call(n,0))},toUint8Array:function(n){return new Uint8Array(i(n))}}},function(n,e,t){"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,function(n){n.CONTACT_DISCOVERY_TOPIC="0xf8946aac"}(r||(r={}));var a={messageTags:{chatRequest:"~#c2",message:"~#c4"},messageTypes:{GROUP_MESSAGE:"~:public-group-user-message",USER_MESSAGE:"~:user-message"},post:{POW_TARGET:.002,POW_TIME:1,TTL:10},regExp:{CONTACT_CODE_REGEXP:/^(0x)?[0-9a-f]{130}$/i},topics:r};e.default=a},function(n,e,t){const r=t(162);n.exports=r},function(module,exports){module.exports=function(n){var e={};function t(r){if(e[r])return e[r].exports;var a=e[r]={i:r,l:!1,exports:{}};return n[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}return t.m=n,t.c=e,t.d=function(n,e,r){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:r})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var a in n)t.d(r,a,function(e){return n[e]}.bind(null,a));return r},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="",t(t.s="./src/index.js")}({"./data/config.json": +*/var r=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;n.exports=function(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de","5"===Object.getOwnPropertyNames(n)[0])return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(n){return e[n]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(n){r[n]=n}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(n){return!1}}()?Object.assign:function(n,e){for(var t,s,o=function(n){if(null==n)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}(n),l=1;l2?arguments[2]:{},i=r(e);a&&(i=s.call(i,Object.getOwnPropertySymbols(e)));for(var o=0;o=0&&"[object Function]"===r.call(n.callee)),t}},function(n,e,t){"use strict";var r=t(80),a=t(373),i=r.call(Function.call,String.prototype.replace),s=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,o=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;n.exports=function(){var n=a.ToString(a.CheckObjectCoercible(this));return i(i(n,s,""),o,"")}},function(n,e,t){"use strict";var r=Object.getOwnPropertyDescriptor?function(){return Object.getOwnPropertyDescriptor(arguments,"callee").get}():function(){throw new TypeError},a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=Object.getPrototypeOf||function(n){return n.__proto__},s=void 0,o="undefined"==typeof Uint8Array?void 0:i(Uint8Array),l={"$ %Array%":Array,"$ %ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"$ %ArrayBufferPrototype%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer.prototype,"$ %ArrayIteratorPrototype%":a?i([][Symbol.iterator]()):void 0,"$ %ArrayPrototype%":Array.prototype,"$ %ArrayProto_entries%":Array.prototype.entries,"$ %ArrayProto_forEach%":Array.prototype.forEach,"$ %ArrayProto_keys%":Array.prototype.keys,"$ %ArrayProto_values%":Array.prototype.values,"$ %AsyncFromSyncIteratorPrototype%":void 0,"$ %AsyncFunction%":void 0,"$ %AsyncFunctionPrototype%":void 0,"$ %AsyncGenerator%":void 0,"$ %AsyncGeneratorFunction%":void 0,"$ %AsyncGeneratorPrototype%":void 0,"$ %AsyncIteratorPrototype%":s&&a&&Symbol.asyncIterator?s[Symbol.asyncIterator]():void 0,"$ %Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"$ %Boolean%":Boolean,"$ %BooleanPrototype%":Boolean.prototype,"$ %DataView%":"undefined"==typeof DataView?void 0:DataView,"$ %DataViewPrototype%":"undefined"==typeof DataView?void 0:DataView.prototype,"$ %Date%":Date,"$ %DatePrototype%":Date.prototype,"$ %decodeURI%":decodeURI,"$ %decodeURIComponent%":decodeURIComponent,"$ %encodeURI%":encodeURI,"$ %encodeURIComponent%":encodeURIComponent,"$ %Error%":Error,"$ %ErrorPrototype%":Error.prototype,"$ %eval%":eval,"$ %EvalError%":EvalError,"$ %EvalErrorPrototype%":EvalError.prototype,"$ %Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"$ %Float32ArrayPrototype%":"undefined"==typeof Float32Array?void 0:Float32Array.prototype,"$ %Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"$ %Float64ArrayPrototype%":"undefined"==typeof Float64Array?void 0:Float64Array.prototype,"$ %Function%":Function,"$ %FunctionPrototype%":Function.prototype,"$ %Generator%":void 0,"$ %GeneratorFunction%":void 0,"$ %GeneratorPrototype%":void 0,"$ %Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"$ %Int8ArrayPrototype%":"undefined"==typeof Int8Array?void 0:Int8Array.prototype,"$ %Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"$ %Int16ArrayPrototype%":"undefined"==typeof Int16Array?void 0:Int8Array.prototype,"$ %Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"$ %Int32ArrayPrototype%":"undefined"==typeof Int32Array?void 0:Int32Array.prototype,"$ %isFinite%":isFinite,"$ %isNaN%":isNaN,"$ %IteratorPrototype%":a?i(i([][Symbol.iterator]())):void 0,"$ %JSON%":JSON,"$ %JSONParse%":JSON.parse,"$ %Map%":"undefined"==typeof Map?void 0:Map,"$ %MapIteratorPrototype%":"undefined"!=typeof Map&&a?i((new Map)[Symbol.iterator]()):void 0,"$ %MapPrototype%":"undefined"==typeof Map?void 0:Map.prototype,"$ %Math%":Math,"$ %Number%":Number,"$ %NumberPrototype%":Number.prototype,"$ %Object%":Object,"$ %ObjectPrototype%":Object.prototype,"$ %ObjProto_toString%":Object.prototype.toString,"$ %ObjProto_valueOf%":Object.prototype.valueOf,"$ %parseFloat%":parseFloat,"$ %parseInt%":parseInt,"$ %Promise%":"undefined"==typeof Promise?void 0:Promise,"$ %PromisePrototype%":"undefined"==typeof Promise?void 0:Promise.prototype,"$ %PromiseProto_then%":"undefined"==typeof Promise?void 0:Promise.prototype.then,"$ %Promise_all%":"undefined"==typeof Promise?void 0:Promise.all,"$ %Promise_reject%":"undefined"==typeof Promise?void 0:Promise.reject,"$ %Promise_resolve%":"undefined"==typeof Promise?void 0:Promise.resolve,"$ %Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"$ %RangeError%":RangeError,"$ %RangeErrorPrototype%":RangeError.prototype,"$ %ReferenceError%":ReferenceError,"$ %ReferenceErrorPrototype%":ReferenceError.prototype,"$ %Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"$ %RegExp%":RegExp,"$ %RegExpPrototype%":RegExp.prototype,"$ %Set%":"undefined"==typeof Set?void 0:Set,"$ %SetIteratorPrototype%":"undefined"!=typeof Set&&a?i((new Set)[Symbol.iterator]()):void 0,"$ %SetPrototype%":"undefined"==typeof Set?void 0:Set.prototype,"$ %SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"$ %SharedArrayBufferPrototype%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer.prototype,"$ %String%":String,"$ %StringIteratorPrototype%":a?i(""[Symbol.iterator]()):void 0,"$ %StringPrototype%":String.prototype,"$ %Symbol%":a?Symbol:void 0,"$ %SymbolPrototype%":a?Symbol.prototype:void 0,"$ %SyntaxError%":SyntaxError,"$ %SyntaxErrorPrototype%":SyntaxError.prototype,"$ %ThrowTypeError%":r,"$ %TypedArray%":o,"$ %TypedArrayPrototype%":o?o.prototype:void 0,"$ %TypeError%":TypeError,"$ %TypeErrorPrototype%":TypeError.prototype,"$ %Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"$ %Uint8ArrayPrototype%":"undefined"==typeof Uint8Array?void 0:Uint8Array.prototype,"$ %Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"$ %Uint8ClampedArrayPrototype%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray.prototype,"$ %Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"$ %Uint16ArrayPrototype%":"undefined"==typeof Uint16Array?void 0:Uint16Array.prototype,"$ %Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"$ %Uint32ArrayPrototype%":"undefined"==typeof Uint32Array?void 0:Uint32Array.prototype,"$ %URIError%":URIError,"$ %URIErrorPrototype%":URIError.prototype,"$ %WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"$ %WeakMapPrototype%":"undefined"==typeof WeakMap?void 0:WeakMap.prototype,"$ %WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet,"$ %WeakSetPrototype%":"undefined"==typeof WeakSet?void 0:WeakSet.prototype};n.exports=function(n,e){if(arguments.length>1&&"boolean"!=typeof e)throw new TypeError('"allowMissing" argument must be a boolean');var t="$ "+n;if(!(t in l))throw new SyntaxError("intrinsic "+n+" does not exist!");if(void 0===l[t]&&!e)throw new TypeError("intrinsic "+n+" exists, but is not available. Please file an issue!");return l[t]}},function(n,e,t){"use strict";var r=t(80);n.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},function(n,e,t){"use strict";var r=t(154);n.exports=function(){return String.prototype.trim&&"​"==="​".trim()?String.prototype.trim:r}},function(n,e,t){t(384);var r=function(n,e){return parseInt(n.slice(2*e+2,2*e+4),16)},a=function(n){return(n.length-2)/2},i=function(n){for(var e=[],t=2,r=n.length;t>6|192);else{if(a>55295&&a<56320){if(++r==n.length)return null;var i=n.charCodeAt(r);if(i<56320||i>57343)return null;t+=e((a=65536+((1023&a)<<10)+(1023&i))>>18|240),t+=e(a>>12&63|128)}else t+=e(a>>12|224);t+=e(a>>6&63|128)}t+=e(63&a|128)}}return t},toString:function(n){for(var e="",t=0,i=a(n);t127){if(s>191&&s<224){if(t>=i)return null;s=(31&s)<<6|63&r(n,t)}else if(s>223&&s<240){if(t+1>=i)return null;s=(15&s)<<12|(63&r(n,t))<<6|63&r(n,++t)}else{if(!(s>239&&s<248))return null;if(t+2>=i)return null;s=(7&s)<<18|(63&r(n,t))<<12|(63&r(n,++t))<<6|63&r(n,++t)}++t}if(s<=65535)e+=String.fromCharCode(s);else{if(!(s<=1114111))return null;s-=65536,e+=String.fromCharCode(s>>10|55296),e+=String.fromCharCode(1023&s|56320)}}return e},fromNumber:function(n){var e=n.toString(16);return e.length%2==0?"0x"+e:"0x0"+e},toNumber:function(n){return parseInt(n.slice(2),16)},fromNat:function(n){return"0x0"===n?"0x":n.length%2==0?n:"0x0"+n.slice(2)},toNat:function(n){return"0"===n[2]?"0x"+n.slice(3):n},fromArray:s,toArray:i,fromUint8Array:function(n){return s([].slice.call(n,0))},toUint8Array:function(n){return new Uint8Array(i(n))}}},function(n,e,t){"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,function(n){n.CONTACT_DISCOVERY_TOPIC="0xf8946aac"}(r||(r={}));var a={messageTags:{chatRequest:"~#c2",message:"~#c4"},messageTypes:{GROUP_MESSAGE:"~:public-group-user-message",USER_MESSAGE:"~:user-message"},post:{POW_TARGET:.002,POW_TIME:1,TTL:10},regExp:{CONTACT_CODE_REGEXP:/^(0x)?[0-9a-f]{130}$/i},topics:r};e.default=a},function(n,e,t){const r=t(164);n.exports=r},function(module,exports){module.exports=function(n){var e={};function t(r){if(e[r])return e[r].exports;var a=e[r]={i:r,l:!1,exports:{}};return n[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}return t.m=n,t.c=e,t.d=function(n,e,r){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:r})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var a in n)t.d(r,a,function(e){return n[e]}.bind(null,a));return r},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="",t(t.s="./src/index.js")}({"./data/config.json": /*!**************************!*\ !*** ./data/config.json ***! \**************************/ @@ -3495,4 +3495,15 @@ object-assign /*!**********************!*\ !*** util (ignored) ***! \**********************/ -/*! no static exports found */function(module,exports){eval("/* (ignored) */\n\n//# sourceURL=webpack://murmur/util_(ignored)?")}})},function(n,e,t){"use strict";t.r(e);var r=t(159),a=t.n(r),i=t(160),s=t.n(i);window.StatusWidget=function(n,e){if(!n)throw new Error("no channelName provider");if(!e)throw new Error("no DOM element for chat");var t=document.createElement("h3");t.innerHTML="#"+n;var r=document.createElement("div");r.className="chat";var i=document.createElement("input");i.type="input",i.className="post",i.placeholder="Type a message..",e.className+=" _status-chat-widget",e.append(t),e.append(r),e.append(i);let o=new s.a({protocols:["libp2p"],signalServers:["/dns4/web-bridge.status.im/tcp/443/wss/p2p-webrtc-star"],bootnodes:[]});o.start();const l=new a.a;l.connectToProvider(o.provider,null);var c="";l.joinChat(n,()=>{l.onMessage(n,(n,e)=>{if(n||!e)return console.dir("error receiving message"),void console.dir(n);const t=JSON.parse(e.payload)[1][0],a={username:e.username,message:t,pubkey:e.data.sig,data:e};let i=document.createElement("div");i.innerHTML=c===a.username?""+a.message+"":""+a.username+""+a.message+"",r.append(i),c=a.username,r.scrollTop=r.scrollHeight}),i.addEventListener("keyup",function(e){if(13===e.keyCode){e.preventDefault();var t=i.value;l.sendMessage(n,t),i.value=""}})})}},function(n,e,t){"use strict";var r=t(51),a=r(t(163)),i=r(t(198)),s=r(t(200)),o=r(t(387)),l=r(t(391)),c=r(t(158)),u=r(t(392));"undefined"!=typeof window&&(window.web3=window.web3||{});const d="undefined"!=typeof window&&window.web3?new s.default(window.web3.currentProvider):s.default,{utils:{asciiToHex:f,hexToAscii:h}}=d;function p(n,e,t,r=!1){const a=c.default.messageTags.message;t<(new Date).getTime()&&(t=100*((new Date).getTime()+26784e5));const s=r?"content/json":"text/plain",o=(new Date).getTime();return f((0,i.default)([a,[n,s,e,t,o,["^ ","~:text",n]]]))}const m=new a.default;n.exports=class{constructor(){this.channels=void 0,this.contacts=void 0,this.userMessagesSubscription=void 0,this.mailservers=void 0,this.isHttpProvider=void 0,this.shh=void 0,this.chatRequestCb=void 0,this.channels={},this.contacts={},this.userMessagesSubscription=null,this.mailservers=null,this.isHttpProvider=!1}async connect(n,e){const r=new s.default;if(n.startsWith("ws://"))r.setProvider(new d.providers.WebsocketProvider(n,{headers:{Origin:"statusjs"}}));else if(n.startsWith("http://")||n.startsWith("https://"))r.setProvider(new d.providers.HttpProvider(n)),this.isHttpProvider=!0;else{const e=t(393);r.setProvider(new d.providers.IpcProvider(n,e))}this.shh=r.shh,this.mailservers=new l.default(r),await r.shh.setMinPoW(c.default.post.POW_TARGET),m.set(this,e?await this.generateWhisperKeyFromWallet(e):await r.shh.newKeyPair())}async connectToProvider(n,e){const t=new s.default(n);this.shh=t.shh,this.mailservers=new l.default(t),await t.shh.setMinPoW(c.default.post.POW_TARGET),m.set(this,e?await this.generateWhisperKeyFromWallet(e):await t.shh.newKeyPair())}isConnected(){return this.shh.isListening()}async generateWhisperKeyFromWallet(n){return await this.shh.addPrivateKey(n)}async getPublicKey(){return await this.shh.getPublicKey(m.get(this))}async getUserName(n){return n||(n=await this.getPublicKey()),o.default.generateUsernameFromSeed(n)}cleanChannelName(n){return n.startsWith("#")?n.substr(1):n}async joinChat(n,e){n=this.cleanChannelName(n);const t=await this.shh.generateSymKeyFromPassword(n);this.channels[n]={channelCode:d.utils.sha3(n).slice(0,10),channelKey:t,channelName:n,lastClockValue:0},e&&e()}async addContact(n,e){this.contacts[n]={lastClockValue:0,username:o.default.generateUsernameFromSeed(n)},e&&e()}leaveChat(n){n=this.cleanChannelName(n),this.isHttpProvider?this.shh.deleteMessageFilter(this.channels[n].filterId).then(()=>{clearInterval(this.channels[n].interval)}):this.channels[n].subscription.unsubscribe(),delete this.channels[n]}async removeContact(n){delete this.contacts[n]}isSubscribedTo(n){return n=this.cleanChannelName(n),!!this.channels[n]}onMessage(n,e){"function"==typeof n?this.onUserMessage(n):this.onChannelMessage(n,e)}onChatRequest(n){this.chatRequestCb=n}onChannelMessage(n,e){if(n=this.cleanChannelName(n),!this.channels[n])return e("unknown channel: "+n);const t={allowP2P:!0,symKeyID:this.channels[n].channelKey,topics:[this.channels[n].channelCode]},r=t=>{try{const r=o.default.generateUsernameFromSeed(t.sig),a=u.default.parse(h(t.payload));this.channels[n].lastClockValue{this.channels[n].filterId=t,this.channels[n].interval=setInterval(()=>{this.shh.getFilterMessages(t).then(n=>{n.map(n=>{r(n)})}).catch(n=>{e(n)})},250)}):this.channels[n].subscription=this.shh.subscribe("messages",t).on("data",r).on("error",n=>{e(n)})}onUserMessage(n){const e={allowP2P:!0,minPow:0,privateKeyID:m.get(this),topics:[c.default.topics.CONTACT_DISCOVERY_TOPIC]},t=e=>{this.contacts[e.sig]||this.addContact(e.sig);try{const t=u.default.parse(h(e.payload));this.contacts[e.sig].lastClockValue{this.userMessagesSubscription={},this.userMessagesSubscription.filterId=e,this.userMessagesSubscription.interval=setInterval(()=>{this.shh.getFilterMessages(e).then(n=>{n.map(n=>{t(n)})}).catch(e=>{n(e)})},250)}):this.userMessagesSubscription=this.shh.subscribe("messages",e).on("data",n=>{t(n)}).on("error",e=>{n(e)})}sendUserMessage(n,e,t){this.contacts[n]||this.addContact(n),this.contacts[n].lastClockValue++,this.shh.post({payload:p(e,c.default.messageTypes.USER_MESSAGE,this.contacts[n].lastClockValue),powTarget:c.default.post.POW_TARGET,powTime:c.default.post.POW_TIME,pubKey:n,sig:m.get(this),topic:c.default.topics.CONTACT_DISCOVERY_TOPIC,ttl:c.default.post.TTL}).then(()=>{t&&t(null,!0)}).catch(n=>{t&&t(n,!1)})}sendGroupMessage(n,e,t){if(n=this.cleanChannelName(n),!this.channels[n]){if(!t)return;return t("unknown channel: "+n)}this.channels[n].lastClockValue++,this.shh.post({payload:p(e,c.default.messageTypes.GROUP_MESSAGE,this.channels[n].lastClockValue),powTarget:c.default.post.POW_TARGET,powTime:c.default.post.POW_TIME,sig:m.get(this),symKeyID:this.channels[n].channelKey,topic:this.channels[n].channelCode,ttl:c.default.post.TTL}).then(()=>{t&&t(null,!0)}).catch(n=>{t&&t(n,!1)})}sendJsonMessage(n,e,t){c.default.regExp.CONTACT_CODE_REGEXP.test(n)?(this.contacts[n]||this.addContact(n),this.contacts[n].lastClockValue++,this.shh.post({payload:p(e,c.default.messageTypes.USER_MESSAGE,this.contacts[n].lastClockValue,!0),powTarget:c.default.post.POW_TARGET,powTime:c.default.post.POW_TIME,pubKey:n,sig:m.get(this),topic:c.default.topics.CONTACT_DISCOVERY_TOPIC,ttl:c.default.post.TTL}).then(()=>{t&&t(null,!0)}).catch(n=>{t&&t(n,!1)})):(this.channels[n].lastClockValue++,this.shh.post({payload:p((0,i.default)(e),c.default.messageTypes.GROUP_MESSAGE,this.channels[n].lastClockValue,!0),powTarget:c.default.post.POW_TARGET,powTime:c.default.post.POW_TIME,sig:m.get(this),symKeyID:this.channels[n].channelKey,topic:this.channels[n].channelCode,ttl:c.default.post.TTL}).then(()=>{t&&t(null,!0)}).catch(n=>{t&&t(n,!1)}))}sendMessage(n,e,t){c.default.regExp.CONTACT_CODE_REGEXP.test(n)?this.sendUserMessage(n,e,t):this.sendGroupMessage(n,e,t)}}},function(n,e,t){n.exports=t(164)},function(n,e,t){t(165),t(166),t(181),t(194),t(196),n.exports=t(27).WeakMap},function(n,e){},function(n,e,t){t(167);for(var r=t(13),a=t(16),i=t(26),s=t(14)("toStringTag"),o="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l=n.length?(this._t=void 0,a(1)):a(0,"keys"==e?t:"values"==e?n[t]:[t,n[t]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},function(n,e){n.exports=function(){}},function(n,e){n.exports=function(n,e){return{value:e,done:!!n}}},function(n,e,t){"use strict";var r=t(83),a=t(39),i=t(87),s=t(16),o=t(26),l=t(173),c=t(58),u=t(180),d=t(14)("iterator"),f=!([].keys&&"next"in[].keys()),h=function(){return this};n.exports=function(n,e,t,p,m,b,g){l(t,e,p);var y,v,_,w=function(n){if(!f&&n in A)return A[n];switch(n){case"keys":case"values":return function(){return new t(this,n)}}return function(){return new t(this,n)}},k=e+" Iterator",x="values"==m,S=!1,A=n.prototype,E=A[d]||A["@@iterator"]||m&&A[m],T=E||w(m),C=m?x?w("entries"):T:void 0,I="Array"==e&&A.entries||E;if(I&&(_=u(I.call(new n)))!==Object.prototype&&_.next&&(c(_,k,!0),r||"function"==typeof _[d]||s(_,d,h)),x&&E&&"values"!==E.name&&(S=!0,T=function(){return E.call(this)}),r&&!g||!f&&!S&&A[d]||s(A,d,T),o[e]=T,o[k]=h,m)if(y={values:x?T:w("values"),keys:b?T:w("keys"),entries:C},g)for(v in y)v in A||i(A,v,y[v]);else a(a.P+a.F*(f||S),e,y);return y}},function(n,e,t){n.exports=!t(29)&&!t(30)(function(){return 7!=Object.defineProperty(t(85)("div"),"a",{get:function(){return 7}}).a})},function(n,e,t){var r=t(12);n.exports=function(n,e){if(!r(n))return n;var t,a;if(e&&"function"==typeof(t=n.toString)&&!r(a=t.call(n)))return a;if("function"==typeof(t=n.valueOf)&&!r(a=t.call(n)))return a;if(!e&&"function"==typeof(t=n.toString)&&!r(a=t.call(n)))return a;throw TypeError("Can't convert object to primitive value")}},function(n,e,t){"use strict";var r=t(174),a=t(86),i=t(58),s={};t(16)(s,t(14)("iterator"),function(){return this}),n.exports=function(n,e,t){n.prototype=r(s,{next:a(1,t)}),i(n,e+" Iterator")}},function(n,e,t){var r=t(21),a=t(175),i=t(91),s=t(56)("IE_PROTO"),o=function(){},l=function(){var n,e=t(85)("iframe"),r=i.length;for(e.style.display="none",t(179).appendChild(e),e.src="javascript:",(n=e.contentWindow.document).open(),n.write("