text: !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).WAValidator=t()}}(function(){return function o(s,a,u){function f(r,t){if(!a[r]){if(!s[r]){var e="function"==typeof require&&require;if(!t&&e)return e(r,!0);if(h)return h(r,!0);var n=new Error("Cannot find module '"+r+"'");throw n.code="MODULE_NOT_FOUND",n}var i=a[r]={exports:{}};s[r][0].call(i.exports,function(t){return f(s[r][1][t]||t)},i,i.exports,o,s,a,u)}return a[r].exports}for(var h="function"==typeof require&&require,t=0;t<u.length;t++)f(u[t]);return f}({1:[function(t,r,e){var c=t("safe-buffer").Buffer;r.exports=function(u){for(var a={},f=u.length,h=u.charAt(0),t=0;t<u.length;t++){var r=u.charAt(t);if(void 0!==a[r])throw new TypeError(r+" is ambiguous");a[r]=t}function e(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return c.allocUnsafe(0);for(var r=[0],e=0;e<t.length;e++){var n=a[t[e]];if(void 0===n)return;for(var i=0,o=n;i<r.length;++i)o+=r[i]*f,r[i]=255&o,o>>=8;for(;0<o;)r.push(255&o),o>>=8}for(var s=0;t[s]===h&&s<t.length-1;++s)r.push(0);return c.from(r.reverse())}return{encode:function(t){if(0===t.length)return"";for(var r=[0],e=0;e<t.length;++e){for(var n=0,i=t[e];n<r.length;++n)i+=r[n]<<8,r[n]=i%f,i=i/f|0;for(;0<i;)r.push(i%f),i=i/f|0}for(var o="",s=0;0===t[s]&&s<t.length-1;++s)o+=h;for(var a=r.length-1;0<=a;--a)o+=u[r[a]];return o},decodeUnsafe:e,decode:function(t){var r=e(t);if(r)return r;throw new Error("Non-base"+f+" character")}}}},{"safe-buffer":7}],2:[function(t,r,e){"use strict";e.byteLength=function(t){var r=p(t),e=r[0],n=r[1];return 3*(e+n)/4-n},e.toByteArray=function(t){for(var r,e=p(t),n=e[0],i=e[1],o=new l((f=n,h=i,3*(f+h)/4-h)),s=0,a=0<i?n-4:n,u=0;u<a;u+=4)r=c[t.charCodeAt(u)]<<18|c[t.charCodeAt(u+1)]<<12|c[t.charCodeAt(u+2)]<<6|c[t.charCodeAt(u+3)],o[s++]=r>>16&255,o[s++]=r>>8&255,o[s++]=255&r;var f,h;2===i&&(r=c[t.charCodeAt(u)]<<2|c[t.charCodeAt(u+1)]>>4,o[s++]=255&r);1===i&&(r=c[t.charCodeAt(u)]<<10|c[t.charCodeAt(u+1)]<<4|c[t.charCodeAt(u+2)]>>2,o[s++]=r>>8&255,o[s++]=255&r);return o},e.fromByteArray=function(t){for(var r,e=t.length,n=e%3,i=[],o=0,s=e-n;o<s;o+=16383)i.push(u(t,o,s<o+16383?s:o+16383));1===n?(r=t[e-1],i.push(a[r>>2]+a[r<<4&63]+"==")):2===n&&(r=(t[e-2]<<8)+t[e-1],i.push(a[r>>10]+a[r>>4&63]+a[r<<2&63]+"="));return i.join("")};for(var a=[],c=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=n.length;i<o;++i)a[i]=n[i],c[n.charCodeAt(i)]=i;function p(t){var r=t.length;if(0<r%4)throw new Error("Invalid string. Length must be a multiple of 4");var e=t.indexOf("=");return-1===e&&(e=r),[e,e===r?0:4-e%4]}function u(t,r,e){for(var n,i,o=[],s=r;s<e;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(a[(i=n)>>18&63]+a[i>>12&63]+a[i>>6&63]+a[63&i]);return o.join("")}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},{}],3:[function(t,r,e){"use strict";var n=t("base64-js"),o=t("ieee754");e.Buffer=c,e.SlowBuffer=function(t){+t!=t&&(t=0);return c.alloc(+t)},e.INSPECT_MAX_BYTES=50;var i=2147483647;function s(t){if(i<t)throw new RangeError("Invalid typed array length");var r=new Uint8Array(t);return r.__proto__=c.prototype,r}function c(t,r,e){if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return f(t)}return a(t,r,e)}function a(t,r,e){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return H(t)||t&&H(t.buffer)?function(t,r,e){if(r<0||t.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<r+(e||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===r&&void 0===e?new Uint8Array(t):void 0===e?new Uint8Array(t,r):new Uint8Array(t,r,e);return n.__proto__=c.prototype,n}(t,r,e):"string"==typeof t?function(t,r){"string"==typeof r&&""!==r||(r="utf8");if(!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var e=0|p(t,r),n=s(e),i=n.write(t,r);i!==e&&(n=n.slice(0,i));return n}(t,r):function(t){if(c.isBuffer(t)){var r=0|l(t.length),e=s(r);return 0===e.length||t.copy(e,0,0,r),e}if(t){if(ArrayBuffer.isView(t)||"length"in t)return"number"!=typeof t.length||F(t.length)?s(0):h(t);if("Buffer"===t.type&&Array.isArray(t.data))return h(t.data)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object.")}(t)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t){return u(t),s(t<0?0:0|l(t))}function h(t){for(var r=t.length<0?0:0|l(t.length),e=s(r),n=0;n<r;n+=1)e[n]=255&t[n];return e}function l(t){if(i<=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function p(t,r){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||H(t))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return O(t).length;default:if(n)return L(t).length;r=(""+r).toLowerCase(),n=!0}}function d(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function g(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):2147483647<e?e=2147483647:e<-2147483648&&(e=-2147483648),F(e=+e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=c.from(r,n)),c.isBuffer(r))return 0===r.length?-1:y(t,r,e,n,i);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):y(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function y(t,r,e,n,i){var o,s=1,a=t.length,u=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;a/=s=2,u/=2,e/=2}function f(t,r){return 1===s?t[r]:t.readUInt16BE(r*s)}if(i){var h=-1;for(o=e;o<a;o++)if(f(t,o)===f(r,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===u)return h*s}else-1!==h&&(o-=o-h),h=-1}else for(a<e+u&&(e=a-u),o=e;0<=o;o--){for(var c=!0,l=0;l<u;l++)if(f(t,o+l)!==f(r,l)){c=!1;break}if(c)return o}return-1}function v(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?i<(n=Number(n))&&(n=i):n=i;var o=r.length;o/2<n&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(r.substr(2*s,2),16);if(F(a))return s;t[e+s]=a}return s}function w(t,r,e,n){return M(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function b(t,r,e){return 0===r&&e===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(r,e))}function m(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,s,a,u,f=t[i],h=null,c=239<f?4:223<f?3:191<f?2:1;if(i+c<=e)switch(c){case 1:f<128&&(h=f);break;case 2:128==(192&(o=t[i+1]))&&127<(u=(31&f)<<6|63&o)&&(h=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&2047<(u=(15&f)<<12|(63&o)<<6|63&s)&&(u<55296||57343<u)&&(h=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&65535<(u=(15&f)<<18|(63&o)<<12|(63&s)<<6|63&a)&&u<1114112&&(h=u)}null===h?(h=65533,c=1):65535<h&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=c}return function(t){var r=t.length;if(r<=A)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=A));return e}(n)}e.kMaxLength=i,(c.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{get:function(){if(this instanceof c)return this.buffer}}),Object.defineProperty(c.prototype,"offset",{get:function(){if(this instanceof c)return this.byteOffset}}),"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),c.poolSize=8192,c.from=function(t,r,e){return a(t,r,e)},c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,c.alloc=function(t,r,e){return i=r,o=e,u(n=t),n<=0?s(n):void 0!==i?"string"==typeof o?s(n).fill(i,o):s(n).fill(i):s(n);var n,i,o},c.allocUnsafe=function(t){return f(t)},c.allocUnsafeSlow=function(t){return f(t)},c.isBuffer=function(t){return null!=t&&!0===t._isBuffer},c.compare=function(t,r){if(!c.isBuffer(t)||!c.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var e;if(void 0===r)for(e=r=0;e<t.length;++e)r+=t[e].length;var n=c.allocUnsafe(r),i=0;for(e=0;e<t.length;++e){var o=t[e];if(ArrayBuffer.isView(o)&&(o=c.from(o)),!c.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},c.byteLength=p,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)d(this,r,r+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)d(this,r,r+3),d(this,r+1,r+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)d(this,r,r+7),d(this,r+1,r+6),d(this,r+2,r+5),d(this,r+3,r+4);return this},c.prototype.toLocaleString=c.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?m(this,0,t):function(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,r,e);case"utf8":case"utf-8":return m(this,r,e);case"ascii":return _(this,r,e);case"latin1":case"binary":return E(this,r,e);case"base64":return b(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return 0<this.length&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,r,e,n,i){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(i<=n&&e<=r)return 0;if(i<=n)return-1;if(e<=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(e>>>=0)-(r>>>=0),a=Math.min(o,s),u=this.slice(n,i),f=t.slice(r,e),h=0;h<a;++h)if(u[h]!==f[h]){o=u[h],s=f[h];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},c.prototype.indexOf=function(t,r,e){return g(this,t,r,e,!0)},c.prototype.lastIndexOf=function(t,r,e){return g(this,t,r,e,!1)},c.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r>>>=0,isFinite(e)?(e>>>=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||i<e)&&(e=i),0<t.length&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o,s,a,u,f,h,c,l,p,d=!1;;)switch(n){case"hex":return v(this,t,r,e);case"utf8":case"utf-8":return l=r,p=e,M(L(t,(c=this).length-l),c,l,p);case"ascii":return w(this,t,r,e);case"latin1":case"binary":return w(this,t,r,e);case"base64":return u=this,f=r,h=e,M(O(t),u,f,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s=r,a=e,M(function(t,r){for(var e,n,i,o=[],s=0;s<t.length&&!((r-=2)<0);++s)e=t.charCodeAt(s),n=e>>8,i=e%256,o.push(i),o.push(n);return o}(t,(o=this).length-s),o,s,a);default:if(d)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),d=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function _(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function E(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function x(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||n<e)&&(e=n);for(var i="",o=r;o<e;++o)i+=R(t[o]);return i}function B(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function k(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(e<t+r)throw new RangeError("Trying to access beyond buffer length")}function U(t,r,e,n,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(i<r||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function S(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function T(t,r,e,n,i){return r=+r,e>>>=0,i||S(t,0,e,4),o.write(t,r,e,n,23,4),e+4}function C(t,r,e,n,i){return r=+r,e>>>=0,i||S(t,0,e,8),o.write(t,r,e,n,52,8),e+8}c.prototype.slice=function(t,r){var e=this.length;(t=~~t)<0?(t+=e)<0&&(t=0):e<t&&(t=e),(r=void 0===r?e:~~r)<0?(r+=e)<0&&(r=0):e<r&&(r=e),r<t&&(r=t);var n=this.subarray(t,r);return n.__proto__=c.prototype,n},c.prototype.readUIntLE=function(t,r,e){t>>>=0,r>>>=0,e||k(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},c.prototype.readUIntBE=function(t,r,e){t>>>=0,r>>>=0,e||k(t,r,this.length);for(var n=this[t+--r],i=1;0<r&&(i*=256);)n+=this[t+--r]*i;return n},c.prototype.readUInt8=function(t,r){return t>>>=0,r||k(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,r){return t>>>=0,r||k(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,r){return t>>>=0,r||k(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,r){return t>>>=0,r||k(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,r){return t>>>=0,r||k(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,r,e){t>>>=0,r>>>=0,e||k(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return(i*=128)<=n&&(n-=Math.pow(2,8*r)),n},c.prototype.readIntBE=function(t,r,e){t>>>=0,r>>>=0,e||k(t,r,this.length);for(var n=r,i=1,o=this[t+--n];0<n&&(i*=256);)o+=this[t+--n]*i;return(i*=128)<=o&&(o-=Math.pow(2,8*r)),o},c.prototype.readInt8=function(t,r){return t>>>=0,r||k(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,r){t>>>=0,r||k(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},c.prototype.readInt16BE=function(t,r){t>>>=0,r||k(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},c.prototype.readInt32LE=function(t,r){return t>>>=0,r||k(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,r){return t>>>=0,r||k(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,r){return t>>>=0,r||k(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,r){return t>>>=0,r||k(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,r){return t>>>=0,r||k(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,r){return t>>>=0,r||k(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r>>>=0,e>>>=0,n)||U(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},c.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r>>>=0,e>>>=0,n)||U(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;0<=--i&&(o*=256);)this[r+i]=t/o&255;return r+e},c.prototype.writeUInt8=function(t,r,e){return t=+t,r>>>=0,e||U(this,t,r,1,255,0),this[r]=255&t,r+1},c.prototype.writeUInt16LE=function(t,r,e){return t=+t,r>>>=0,e||U(this,t,r,2,65535,0),this[r]=255&t,this[r+1]=t>>>8,r+2},c.prototype.writeUInt16BE=function(t,r,e){return t=+t,r>>>=0,e||U(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=255&t,r+2},c.prototype.writeUInt32LE=function(t,r,e){return t=+t,r>>>=0,e||U(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t,r+4},c.prototype.writeUInt32BE=function(t,r,e){return t=+t,r>>>=0,e||U(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t,r+4},c.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r>>>=0,!n){var i=Math.pow(2,8*e-1);U(this,t,r,e,i-1,-i)}var o=0,s=1,a=0;for(this[r]=255&t;++o<e&&(s*=256);)t<0&&0===a&&0!==this[r+o-1]&&(a=1),this[r+o]=(t/s>>0)-a&255;return r+e},c.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r>>>=0,!n){var i=Math.pow(2,8*e-1);U(this,t,r,e,i-1,-i)}var o=e-1,s=1,a=0;for(this[r+o]=255&t;0<=--o&&(s*=256);)t<0&&0===a&&0!==this[r+o+1]&&(a=1),this[r+o]=(t/s>>0)-a&255;return r+e},c.prototype.writeInt8=function(t,r,e){return t=+t,r>>>=0,e||U(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=255&t,r+1},c.prototype.writeInt16LE=function(t,r,e){return t=+t,r>>>=0,e||U(this,t,r,2,32767,-32768),this[r]=255&t,this[r+1]=t>>>8,r+2},c.prototype.writeInt16BE=function(t,r,e){return t=+t,r>>>=0,e||U(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=255&t,r+2},c.prototype.writeInt32LE=function(t,r,e){return t=+t,r>>>=0,e||U(this,t,r,4,2147483647,-2147483648),this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4},c.prototype.writeInt32BE=function(t,r,e){return t=+t,r>>>=0,e||U(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t,r+4},c.prototype.writeFloatLE=function(t,r,e){return T(this,t,r,!0,e)},c.prototype.writeFloatBE=function(t,r,e){return T(this,t,r,!1,e)},c.prototype.writeDoubleLE=function(t,r,e){return C(this,t,r,!0,e)},c.prototype.writeDoubleBE=function(t,r,e){return C(this,t,r,!1,e)},c.prototype.copy=function(t,r,e,n){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),0<n&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i=n-e;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(r,e,n);else if(this===t&&e<r&&r<n)for(var o=i-1;0<=o;--o)t[o+r]=this[o+e];else Uint8Array.prototype.set.call(t,this.subarray(e,n),r);return i},c.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var s=c.isBuffer(t)?t:new c(t,n),a=s.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<e-r;++o)this[o+r]=s[o%a]}return this};var I=/[^+/0-9A-Za-z-_]/g;function R(t){return t<16?"0"+t.toString(16):t.toString(16)}function L(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if(55295<(e=t.charCodeAt(s))&&e<57344){if(!i){if(56319<e){-1<(r-=3)&&o.push(239,191,189);continue}if(s+1===n){-1<(r-=3)&&o.push(239,191,189);continue}i=e;continue}if(e<56320){-1<(r-=3)&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&-1<(r-=3)&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function O(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(I,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function M(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function H(t){return t instanceof ArrayBuffer||null!=t&&null!=t.constructor&&"ArrayBuffer"===t.constructor.name&&"number"==typeof t.byteLength}function F(t){return t!=t}},{"base64-js":2,ieee754:4}],4:[function(t,r,e){e.read=function(t,r,e,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,f=u>>1,h=-7,c=e?i-1:0,l=e?-1:1,p=t[r+c];for(c+=l,o=p&(1<<-h)-1,p>>=-h,h+=a;0<h;o=256*o+t[r+c],c+=l,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;0<h;s=256*s+t[r+c],c+=l,h-=8);if(0===o)o=1-f;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=f}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,r,e,n,i,o){var s,a,u,f=8*o-i-1,h=(1<<f)-1,c=h>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,g=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,s=h):(s=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-s))<1&&(s--,u*=2),2<=(r+=1<=s+c?l/u:l*Math.pow(2,1-c))*u&&(s++,u/=2),h<=s+c?(a=0,s=h):1<=s+c?(a=(r*u-1)*Math.pow(2,i),s+=c):(a=r*Math.pow(2,c-1)*Math.pow(2,i),s=0));8<=i;t[e+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,f+=i;0<f;t[e+p]=255&s,p+=d,s/=256,f-=8);t[e+p-d]|=128*g}},{}],5:[function(t,i,o){"use strict";!function(t){function r(s,t,r){var i,a,u,f,h,c,l,p,d,g=0,y=[],v=0,w=!1,o=[],b=[],m=!1;if(i=(r=r||{}).encoding||"UTF8",(d=r.numRounds||1)!==parseInt(d,10)||d<1)throw Error("numRounds must a integer >= 1");if(0!==s.lastIndexOf("SHA-",0))throw Error("Chosen SHA variant is not supported");if(c=function(t,r){return F(t,r,s)},l=function(t,r,e,n){var i,o;if("SHA-224"!==s&&"SHA-256"!==s)throw Error("Unexpected error in SHA-2 implementation");for(i=15+(r+65>>>9<<4),o=16;t.length<=i;)t.push(0);for(t[r>>>5]|=128<<24-r%32,r+=e,t[i]=4294967295&r,t[i-1]=r/4294967296|0,e=t.length,r=0;r<e;r+=o)n=F(t.slice(r,r+o),n,s);if("SHA-224"===s)t=[n[0],n[1],n[2],n[3],n[4],n[5],n[6]];else{if("SHA-256"!==s)throw Error("Unexpected error in SHA-2 implementation");t=n}return t},p=function(t){return t.slice()},"SHA-224"===s)h=512,f=224;else{if("SHA-256"!==s)throw Error("Chosen SHA variant is not supported");h=512,f=256}u=k(t,i),a=H(s),this.setHMACKey=function(t,r,e){var n;if(!0===w)throw Error("HMAC key already set");if(!0===m)throw Error("Cannot set HMAC key after calling update");if(t=(r=k(r,i=(e||{}).encoding||"UTF8")(t)).binLen,r=r.value,e=(n=h>>>3)/4-1,n<t/8){for(r=l(r,t,0,H(s));r.length<=e;)r.push(0);r[e]&=4294967040}else if(t/8<n){for(;r.length<=e;)r.push(0);r[e]&=4294967040}for(t=0;t<=e;t+=1)o[t]=909522486^r[t],b[t]=1549556828^r[t];a=c(o,a),g=h,w=!0},this.update=function(t){var r,e,n,i=0,o=h>>>5;for(t=(r=u(t,y,v)).binLen,e=r.value,r=t>>>5,n=0;n<r;n+=o)i+h<=t&&(a=c(e.slice(n,n+o),a),i+=h);g+=i,y=e.slice(i>>>5),v=t%h,m=!0},this.getHash=function(t,r){var e,n,i,o;if(!0===w)throw Error("Cannot call getHash after setting HMAC key");switch(i=B(r),t){case"HEX":e=function(t){return A(t,f,i)};break;case"B64":e=function(t){return _(t,f,i)};break;case"BYTES":e=function(t){return E(t,f)};break;case"ARRAYBUFFER":try{n=new ArrayBuffer(0)}catch(t){throw Error("ARRAYBUFFER not supported by this environment")}e=function(t){return x(t,f)};break;default:throw Error("format must be HEX, B64, BYTES, or ARRAYBUFFER")}for(o=l(y.slice(),v,g,p(a)),n=1;n<d;n+=1)o=l(o,f,0,H(s));return e(o)},this.getHMAC=function(t,r){var e,n,i,o;if(!1===w)throw Error("Cannot call getHMAC without first setting HMAC key");switch(i=B(r),t){case"HEX":e=function(t){return A(t,f,i)};break;case"B64":e=function(t){return _(t,f,i)};break;case"BYTES":e=function(t){return E(t,f)};break;case"ARRAYBUFFER":try{e=new ArrayBuffer(0)}catch(t){throw Error("ARRAYBUFFER not supported by this environment")}e=function(t){return x(t,f)};break;default:throw Error("outputFormat must be HEX, B64, BYTES, or ARRAYBUFFER")}return n=l(y.slice(),v,g,p(a)),o=c(b,H(s)),e(o=l(n,f,h,o))}}function n(){}function A(t,r,e){var n,i,o="";for(r/=8,n=0;n<r;n+=1)i=t[n>>>2]>>>8*(3+n%4*-1),o+="0123456789abcdef".charAt(i>>>4&15)+"0123456789abcdef".charAt(15&i);return e.outputUpper?o.toUpperCase():o}function _(t,r,e){var n,i,o,s="",a=r/8;for(n=0;n<a;n+=3)for(i=n+1<a?t[n+1>>>2]:0,o=n+2<a?t[n+2>>>2]:0,o=(t[n>>>2]>>>8*(3+n%4*-1)&255)<<16|(i>>>8*(3+(n+1)%4*-1)&255)<<8|o>>>8*(3+(n+2)%4*-1)&255,i=0;i<4;i+=1)s+=8*n+6*i<=r?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(o>>>6*(3-i)&63):e.b64Pad;return s}function E(t,r){var e,n,i="",o=r/8;for(e=0;e<o;e+=1)n=t[e>>>2]>>>8*(3+e%4*-1)&255,i+=String.fromCharCode(n);return i}function x(t,r){var e,n,i=r/8,o=new ArrayBuffer(i);for(n=new Uint8Array(o),e=0;e<i;e+=1)n[e]=t[e>>>2]>>>8*(3+e%4*-1)&255;return o}function B(t){var r={outputUpper:!1,b64Pad:"=",shakeLen:-1};if(t=t||{},r.outputUpper=t.outputUpper||!1,!0===t.hasOwnProperty("b64Pad")&&(r.b64Pad=t.b64Pad),"boolean"!=typeof r.outputUpper)throw Error("Invalid outputUpper formatting option");if("string"!=typeof r.b64Pad)throw Error("Invalid b64Pad formatting option");return r}function k(t,l){var r;switch(l){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(t){case"HEX":r=function(t,r,e){var n,i,o,s,a,u=t.length;if(0!=u%2)throw Error("String of HEX type must be in byte increments");for(r=r||[0],a=(e=e||0)>>>3,n=0;n<u;n+=2){if(i=parseInt(t.substr(n,2),16),isNaN(i))throw Error("String of HEX type contains invalid characters");for(o=(s=(n>>>1)+a)>>>2;r.length<=o;)r.push(0);r[o]|=i<<8*(3+s%4*-1)}return{value:r,binLen:4*u+e}};break;case"TEXT":r=function(t,r,e){var n,i,o,s,a,u,f,h,c=0;if(r=r||[0],a=(e=e||0)>>>3,"UTF8"===l)for(h=3,o=0;o<t.length;o+=1)for(i=[],(n=t.charCodeAt(o))<128?i.push(n):n<2048?(i.push(192|n>>>6),i.push(128|63&n)):n<55296||57344<=n?i.push(224|n>>>12,128|n>>>6&63,128|63&n):(o+=1,n=65536+((1023&n)<<10|1023&t.charCodeAt(o)),i.push(240|n>>>18,128|n>>>12&63,128|n>>>6&63,128|63&n)),s=0;s<i.length;s+=1){for(u=(f=c+a)>>>2;r.length<=u;)r.push(0);r[u]|=i[s]<<8*(h+f%4*-1),c+=1}else if("UTF16BE"===l||"UTF16LE"===l)for(h=2,i="UTF16LE"===l||"UTF16LE"!==l&&!1,o=0;o<t.length;o+=1){for(n=t.charCodeAt(o),!0===i&&(n=(s=255&n)<<8|n>>>8),u=(f=c+a)>>>2;r.length<=u;)r.push(0);r[u]|=n<<8*(h+f%4*-1),c+=2}return{value:r,binLen:8*c+e}};break;case"B64":r=function(t,r,e){var n,i,o,s,a,u,f,h=0;if(-1===t.search(/^[a-zA-Z0-9=+\/]+$/))throw Error("Invalid character in base-64 string");if(i=t.indexOf("="),t=t.replace(/\=/g,""),-1!==i&&i<t.length)throw Error("Invalid '=' found in base-64 string");for(r=r||[0],u=(e=e||0)>>>3,i=0;i<t.length;i+=4){for(a=t.substr(i,4),o=s=0;o<a.length;o+=1)s|=(n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[o]))<<18-6*o;for(o=0;o<a.length-1;o+=1){for(n=(f=h+u)>>>2;r.length<=n;)r.push(0);r[n]|=(s>>>16-8*o&255)<<8*(3+f%4*-1),h+=1}}return{value:r,binLen:8*h+e}};break;case"BYTES":r=function(t,r,e){var n,i,o,s,a;for(r=r||[0],o=(e=e||0)>>>3,i=0;i<t.length;i+=1)n=t.charCodeAt(i),s=(a=i+o)>>>2,r.length<=s&&r.push(0),r[s]|=n<<8*(3+a%4*-1);return{value:r,binLen:8*t.length+e}};break;case"ARRAYBUFFER":try{r=new ArrayBuffer(0)}catch(t){throw Error("ARRAYBUFFER not supported by this environment")}r=function(t,r,e){var n,i,o,s,a;for(r=r||[0],i=(e=e||0)>>>3,a=new Uint8Array(t),n=0;n<t.byteLength;n+=1)o=(s=n+i)>>>2,r.length<=o&&r.push(0),r[o]|=a[n]<<8*(3+s%4*-1);return{value:r,binLen:8*t.byteLength+e}};break;default:throw Error("format must be HEX, TEXT, B64, BYTES, or ARRAYBUFFER")}return r}function e(t,r){return t>>>r|t<<32-r}function U(t,r,e){return t&r^~t&e}function S(t,r,e){return t&r^t&e^r&e}function T(t){return e(t,2)^e(t,13)^e(t,22)}function C(t){return e(t,6)^e(t,11)^e(t,25)}function I(t){return e(t,7)^e(t,18)^t>>>3}function R(t){return e(t,17)^e(t,19)^t>>>10}function L(t,r){var e=(65535&t)+(65535&r);return((t>>>16)+(r>>>16)+(e>>>16)&65535)<<16|65535&e}function O(t,r,e,n){var i=(65535&t)+(65535&r)+(65535&e)+(65535&n);return((t>>>16)+(r>>>16)+(e>>>16)+(n>>>16)+(i>>>16)&65535)<<16|65535&i}function M(t,r,e,n,i){var o=(65535&t)+(65535&r)+(65535&e)+(65535&n)+(65535&i);return((t>>>16)+(r>>>16)+(e>>>16)+(n>>>16)+(i>>>16)+(o>>>16)&65535)<<16|65535&o}function H(t){var r,e=[];if(0!==t.lastIndexOf("SHA-",0))throw Error("No SHA variants supported");switch(e=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],r=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],t){case"SHA-224":break;case"SHA-256":e=r;break;case"SHA-384":case"SHA-512":e=[new n,new n,new n,new n,new n,new n,new n,new n];break;default:throw Error("Unknown SHA variant")}return e}function F(t,r,e){var n,i,o,s,a,u,f,h,c,l,p,d,g,y,v,w,b,m,A,_,E,x,B,k=[];if("SHA-224"!==e&&"SHA-256"!==e)throw Error("Unexpected error in SHA-2 implementation");for(l=64,d=1,x=Number,g=L,y=O,v=M,w=I,b=R,m=T,A=C,E=S,_=U,B=N,e=r[0],n=r[1],i=r[2],o=r[3],s=r[4],a=r[5],u=r[6],f=r[7],p=0;p<l;p+=1)p<16?(c=p*d,h=t.length<=c?0:t[c],c=t.length<=c+1?0:t[c+1],k[p]=new x(h,c)):k[p]=y(b(k[p-2]),k[p-7],w(k[p-15]),k[p-16]),h=v(f,A(s),_(s,a,u),B[p],k[p]),c=g(m(e),E(e,n,i)),f=u,u=a,a=s,s=g(o,h),o=i,i=n,n=e,e=g(h,c);return r[0]=g(e,r[0]),r[1]=g(n,r[1]),r[2]=g(i,r[2]),r[3]=g(o,r[3]),r[4]=g(s,r[4]),r[5]=g(a,r[5]),r[6]=g(u,r[6]),r[7]=g(f,r[7]),r}var N;N=[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],void 0!==o?(void 0!==i&&i.exports&&(i.exports=r),o=r):t.jsSHA=r}(this)},{}],6:[function(t,r,e){var n,i,o=r.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(r){if(n===setTimeout)return setTimeout(r,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(r,0);try{return n(r,0)}catch(t){try{return n.call(null,r,0)}catch(t){return n.call(this,r,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(t){n=s}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(t){i=a}}();var f,h=[],c=!1,l=-1;function p(){c&&f&&(c=!1,f.length?h=f.concat(h):l=-1,h.length&&d())}function d(){if(!c){var t=u(p);c=!0;for(var r=h.length;r;){for(f=h,h=[];++l<r;)f&&f[l].run();l=-1,r=h.length}f=null,c=!1,function(r){if(i===clearTimeout)return clearTimeout(r);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(r);try{i(r)}catch(t){try{return i.call(null,r)}catch(t){return i.call(this,r)}}}(t)}}function g(t,r){this.fun=t,this.array=r}function y(){}o.nextTick=function(t){var r=new Array(arguments.length-1);if(1<arguments.length)for(var e=1;e<arguments.length;e++)r[e-1]=arguments[e];h.push(new g(t,r)),1!==h.length||c||u(d)},g.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],7:[function(t,r,e){var n=t("buffer"),i=n.Buffer;function o(t,r){for(var e in t)r[e]=t[e]}function s(t,r,e){return i(t,r,e)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?r.exports=n:(o(n,e),e.Buffer=s),o(i,s),s.from=function(t,r,e){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,r,e)},s.alloc=function(t,r,e){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==r?"string"==typeof e?n.fill(r,e):n.fill(r):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},{buffer:3}],8:[function(t,r,e){var s=t("./crypto/base58"),n=t("./crypto/segwit_addr"),a=t("./crypto/utils");function i(t,r){var e=(r=r||{}).expectedLength||25,n=r.hashFunction||"sha256",i=function(t){try{return s.decode(t)}catch(t){return null}}(t);if(i){var o=i.length;return o!==e?null:a.toHex(i.slice(o-4,o))===function(t,r){switch(t){case"blake256":return a.blake256Checksum(r);case"sha256":default:return a.sha256Checksum(r)}}(n,a.toHex(i.slice(0,o-4)))?a.toHex(i.slice(0,e-24)):null}return null}r.exports={isValidAddress:function(t,r,e){return function(t,r,e){e=e||"prod";var n=i(t,r);return!!n&&0<=("prod"===e||"testnet"===e?r.addressTypes[e]:r.addressTypes.prod.concat(r.addressTypes.testnet)).indexOf(n)}(t,r,e)||n.isValidAddress(t,r.segwitHrp)}}},{"./crypto/base58":9,"./crypto/segwit_addr":15,"./crypto/utils":17}],9:[function(t,r,e){for(var n="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",s={},i=0;i<n.length;++i)s[n.charAt(i)]=i;var a=n.length;r.exports={decode:function(t){if(0===t.length)return[];var r,e,n=[0];for(r=0;r<t.length;++r){var i=t[r];if(!(i in s))throw new Error("Non-base58 character");for(e=0;e<n.length;++e)n[e]*=a;n[0]+=s[i];var o=0;for(e=0;e<n.length;++e)n[e]+=o,o=n[e]>>8,n[e]&=255;for(;o;)n.push(255&o),o>>=8}for(r=0;"1"===t[r]&&r<t.length-1;++r)n.push(0);return n.reverse()}}},{}],10:[function(t,r,e){var h="qpzry9x8gf2tvdw0s3jn54khce6mua7l",o=[996825010,642813549,513874426,1027748829,705979059];function c(t){for(var r=1,e=0;e<t.length;++e){var n=r>>25;r=(33554431&r)<<5^t[e];for(var i=0;i<5;++i)n>>i&1&&(r^=o[i])}return r}function l(t){var r,e=[];for(r=0;r<t.length;++r)e.push(t.charCodeAt(r)>>5);for(e.push(0),r=0;r<t.length;++r)e.push(31&t.charCodeAt(r));return e}r.exports={decode:function(t){var r,e=!1,n=!1;for(r=0;r<t.length;++r){if(t.charCodeAt(r)<33||126<t.charCodeAt(r))return null;97<=t.charCodeAt(r)&&t.charCodeAt(r)<=122&&(e=!0),65<=t.charCodeAt(r)&&t.charCodeAt(r)<=90&&(n=!0)}if(e&&n)return null;var i=(t=t.toLowerCase()).lastIndexOf("1");if(i<1||i+7>t.length||90<t.length)return null;var o=t.substring(0,i),s=[];for(r=i+1;r<t.length;++r){var a=h.indexOf(t.charAt(r));if(-1===a)return null;s.push(a)}if(u=o,f=s,1!==c(l(u).concat(f)))return null;var u,f;return{hrp:o,data:s.slice(0,s.length-6)}},encode:function(t,r){for(var e=r.concat(function(t,r){for(var e=1^c(l(t).concat(r).concat([0,0,0,0,0,0])),n=[],i=0;i<6;++i)n.push(e>>5*(5-i)&31);return n}(t,r)),n=t+"1",i=0;i<e.length;++i)n+=h.charAt(e[i]);return n}}},{}],11:[function(t,r,e){!function(t){"use strict";var d={};function g(t,r,e){if(e!==d)return t instanceof g?t:void 0===t?v:g.parse(t);for(t=t||[];t.length&&!t[t.length-1];)--t.length;this._d=t,this._s=t.length?r||1:0}g._construct=function(t,r){return new g(t,r,d)};var y=1e7;g.base=y,g.base_log10=7;var v=new g([],0,d);g.ZERO=v;var w=new g([1],1,d);g.ONE=w;var b=new g(w._d,-1,d);g.M_ONE=b,g._0=v,g._1=w,g.small=[v,w,new g([2],1,d),new g([3],1,d),new g([4],1,d),new g([5],1,d),new g([6],1,d),new g([7],1,d),new g([8],1,d),new g([9],1,d),new g([10],1,d),new g([11],1,d),new g([12],1,d),new g([13],1,d),new g([14],1,d),new g([15],1,d),new g([16],1,d),new g([17],1,d),new g([18],1,d),new g([19],1,d),new g([20],1,d),new g([21],1,d),new g([22],1,d),new g([23],1,d),new g([24],1,d),new g([25],1,d),new g([26],1,d),new g([27],1,d),new g([28],1,d),new g([29],1,d),new g([30],1,d),new g([31],1,d),new g([32],1,d),new g([33],1,d),new g([34],1,d),new g([35],1,d),new g([36],1,d)],g.digits="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),g.prototype.toString=function(t){if((t=+t||10)<2||36<t)throw new Error("illegal radix "+t+".");if(0===this._s)return"0";if(10===t){var r=this._s<0?"-":"";r+=this._d[this._d.length-1].toString();for(var e=this._d.length-2;0<=e;e--){for(var n=this._d[e].toString();n.length<7;)n="0"+n;r+=n}return r}var i=g.digits;t=g.small[t];for(var o,s=this._s,a=this.abs(),u=[];0!==a._s;){var f=a.divRem(t);a=f[0],o=f[1],u.push(i[o.valueOf()])}return(s<0?"-":"")+u.reverse().join("")},g.radixRegex=[/^$/,/^$/,/^[01]*$/,/^[012]*$/,/^[0-3]*$/,/^[0-4]*$/,/^[0-5]*$/,/^[0-6]*$/,/^[0-7]*$/,/^[0-8]*$/,/^[0-9]*$/,/^[0-9aA]*$/,/^[0-9abAB]*$/,/^[0-9abcABC]*$/,/^[0-9a-dA-D]*$/,/^[0-9a-eA-E]*$/,/^[0-9a-fA-F]*$/,/^[0-9a-gA-G]*$/,/^[0-9a-hA-H]*$/,/^[0-9a-iA-I]*$/,/^[0-9a-jA-J]*$/,/^[0-9a-kA-K]*$/,/^[0-9a-lA-L]*$/,/^[0-9a-mA-M]*$/,/^[0-9a-nA-N]*$/,/^[0-9a-oA-O]*$/,/^[0-9a-pA-P]*$/,/^[0-9a-qA-Q]*$/,/^[0-9a-rA-R]*$/,/^[0-9a-sA-S]*$/,/^[0-9a-tA-T]*$/,/^[0-9a-uA-U]*$/,/^[0-9a-vA-V]*$/,/^[0-9a-wA-W]*$/,/^[0-9a-xA-X]*$/,/^[0-9a-yA-Y]*$/,/^[0-9a-zA-Z]*$/],g.parse=function(t,r){var e;t=t.toString(),void 0!==r&&10!=+r||(t=t.replace(/\s*[*xX]\s*10\s*(\^|\*\*)\s*/,"e").replace(/^([+\-])?(\d+)\.?(\d*)[eE]([+\-]?\d+)$/,function(t,r,e,n,i){var o=(i=+i)<0,s=e.length+i;t=(o?e:n).length,i=(i=Math.abs(i))>=t?i-t+o:0;var a=new Array(i+1).join("0"),u=e+n;return(r||"")+(o?u=a+u:u+=a).substr(0,s+=o?a.length:0)+(s<u.length?"."+u.substr(s):"")})),e=void 0===r?"0[xcb]":16==r?"0x":8==r?"0c":2==r?"0b":"";var n=new RegExp("^([+\\-]?)("+e+")?([0-9a-z]*)(?:\\.\\d*)?$","i").exec(t);if(n){var i=n[1]||"+",o=n[2]||"",s=n[3]||"";if(void 0===r)r="0x"===o||"0X"===o?16:"0c"===o||"0C"===o?8:"0b"===o||"0B"===o?2:10;else if(r<2||36<r)throw new Error("Illegal radix "+r+".");if(!g.radixRegex[r=+r].test(s))throw new Error("Bad digit for radix "+r);if(0===(s=s.replace(/^0+/,"").split("")).length)return v;if(i="-"===i?-1:1,10==r){for(var a=[];7<=s.length;)a.push(parseInt(s.splice(s.length-g.base_log10,g.base_log10).join(""),10));return a.push(parseInt(s.join(""),10)),new g(a,i,d)}a=v;r=g.small[r];for(var u=g.small,f=0;f<s.length;f++)a=a.multiply(r).add(u[parseInt(s[f],36)]);return new g(a._d,i,d)}throw new Error("Invalid BigInteger format: "+t)},g.prototype.add=function(t){if(0===this._s)return g(t);if(0===(t=g(t))._s)return this;if(this._s!==t._s)return t=t.negate(),this.subtract(t);for(var r,e=this._d,n=t._d,i=e.length,o=n.length,s=new Array(Math.max(i,o)+1),a=Math.min(i,o),u=0,f=0;f<a;f++)r=e[f]+n[f]+u,s[f]=r%y,u=r/y|0;for(i<o&&(e=n,i=o),f=a;u&&f<i;f++)r=e[f]+u,s[f]=r%y,u=r/y|0;for(u&&(s[f]=u);f<i;f++)s[f]=e[f];return new g(s,this._s,d)},g.prototype.negate=function(){return new g(this._d,0|-this._s,d)},g.prototype.abs=function(){return this._s<0?this.negate():this},g.prototype.subtract=function(t){if(0===this._s)return g(t).negate();if(0===(t=g(t))._s)return this;if(this._s!==t._s)return t=t.negate(),this.add(t);var r=this;this._s<0&&(r=new g(t._d,1,d),t=new g(this._d,1,d));var e=r.compareAbs(t);if(0===e)return v;if(e<0){var n=t;t=r,r=n}var i,o,s=r._d,a=t._d,u=s.length,f=a.length,h=new Array(u),c=0;for(i=0;i<f;i++)(o=s[i]-c-a[i])<0?(o+=y,c=1):c=0,h[i]=o;for(i=f;i<u;i++){if(!((o=s[i]-c)<0)){h[i++]=o;break}o+=y,h[i]=o}for(;i<u;i++)h[i]=s[i];return new g(h,e,d)},function(){function t(t,r){for(var e=t._d,n=e.slice(),i=0;;){var o=(e[i]||0)+1;if(n[i]=o%y,o<=y-1)break;++i}return new g(n,r,d)}function r(t,r){for(var e=t._d,n=e.slice(),i=0;;){var o=(e[i]||0)-1;if(!(o<0)){n[i]=o;break}n[i]=o+y,++i}return new g(n,r,d)}g.prototype.next=function(){switch(this._s){case 0:return w;case-1:return r(this,-1);default:return t(this,1)}},g.prototype.prev=function(){switch(this._s){case 0:return b;case-1:return t(this,-1);default:return r(this,1)}}}(),g.prototype.compareAbs=function(t){if(this===t)return 0;if(!(t instanceof g)){if(!isFinite(t))return isNaN(t)?t:-1;t=g(t)}if(0===this._s)return 0!==t._s?-1:0;if(0===t._s)return 1;var r=this._d.length,e=t._d.length;if(r<e)return-1;if(e<r)return 1;for(var n=this._d,i=t._d,o=r-1;0<=o;o--)if(n[o]!==i[o])return n[o]<i[o]?-1:1;return 0},g.prototype.compare=function(t){return this===t?0:(t=g(t),0===this._s?-t._s:this._s===t._s?this.compareAbs(t)*this._s:this._s)},g.prototype.isUnit=function(){return this===w||this===b||1===this._d.length&&1===this._d[0]},g.prototype.multiply=function(t){if(0===this._s)return v;if(0===(t=g(t))._s)return v;if(this.isUnit())return this._s<0?t.negate():t;if(t.isUnit())return t._s<0?this.negate():this;if(this===t)return this.square();var r,e=this._d.length>=t._d.length,n=(e?this:t)._d,i=(e?t:this)._d,o=n.length,s=i.length,a=o+s,u=new Array(a);for(r=0;r<a;r++)u[r]=0;for(r=0;r<s;r++){for(var f,h=0,c=i[r],l=o+r,p=r;p<l;p++)h=(f=u[p]+c*n[p-r]+h)/y|0,u[p]=f%y|0;h&&(h=(f=u[p]+h)/y|0,u[p]=f%y)}return new g(u,this._s*t._s,d)},g.prototype.multiplySingleDigit=function(t){if(0===t||0===this._s)return v;if(1===t)return this;var r;if(1===this._d.length)return r=this._d[0]*t,new g(y<=r?[r%y|0,r/y|0]:[r],1,d);if(2===t)return this.add(this);if(this.isUnit())return new g([t],1,d);for(var e=this._d,n=e.length,i=n+1,o=new Array(i),s=0;s<i;s++)o[s]=0;for(var a=0,u=0;u<n;u++)a=(r=t*e[u]+a)/y|0,o[u]=r%y|0;return a&&(o[u]=a),new g(o,1,d)},g.prototype.square=function(){if(0===this._s)return v;if(this.isUnit())return w;var t,r,e,n,i=this._d,o=i.length,s=new Array(o+o+1);for(n=0;n<o;n++)e=2*n,r=(t=i[n]*i[n])/y|0,s[e]=t%y,s[e+1]=r;for(n=0;n<o;n++){r=0,e=2*n+1;for(var a=n+1;a<o;a++,e++)r=(t=i[a]*i[n]*2+s[e]+r)/y|0,s[e]=t%y;var u=r+s[e=o+n];r=u/y|0,s[e]=u%y,s[e+1]+=r}return new g(s,1,d)},g.prototype.divide=g.prototype.quotient=function(t){return this.divRem(t)[0]},g.prototype.remainder=function(t){return this.divRem(t)[1]},g.prototype.divRem=function(t){if(0===(t=g(t))._s)throw new Error("Divide by zero");if(0===this._s)return[v,v];if(1===t._d.length)return this.divRemSmall(t._s*t._d[0]);switch(this.compareAbs(t)){case 0:return[this._s===t._s?w:b,v];case-1:return[v,this]}for(var r,e=this._s*t._s,n=t.abs(),i=this._d,o=i.length,s=(t._d.length,[]),a=new g([],0,d);o;)if(a._d.unshift(i[--o]),(a=new g(a._d,1,d)).compareAbs(t)<0)s.push(0);else{if(0===a._s)r=0;else{var u=a._d.length,f=n._d.length,h=a._d[u-1]*y+a._d[u-2],c=n._d[f-1]*y+n._d[f-2];a._d.length>n._d.length&&(h=(h+1)*y),r=Math.ceil(h/c)}do{var l=n.multiplySingleDigit(r);if(l.compareAbs(a)<=0)break;r--}while(r);if(s.push(r),r){var p=a.subtract(l);a._d=p._d.slice()}}return[new g(s.reverse(),e,d),new g(a._d,this._s,d)]},g.prototype.divRemSmall=function(t){var r;if(0===(t=+t))throw new Error("Divide by zero");var e=t<0?-1:1,n=this._s*e;if((t=Math.abs(t))<1||y<=t)throw new Error("Argument out of range");if(0===this._s)return[v,v];if(1===t||-1===t)return[1===n?this.abs():new g(this._d,n,d),v];if(1===this._d.length){var i=new g([this._d[0]/t|0],1,d);return r=new g([this._d[0]%t|0],1,d),n<0&&(i=i.negate()),this._s<0&&(r=r.negate()),[i,r]}for(var o,s=this._d.slice(),a=new Array(s.length),u=0,f=0,h=0;s.length;){if((u=u*y+s[s.length-1])<t)a[h++]=0,s.pop(),f=y*f+u;else f=u-t*(o=0===u?0:u/t|0),(a[h++]=o)?(s.pop(),u=f):s.pop()}return r=new g([f],1,d),this._s<0&&(r=r.negate()),[new g(a.reverse(),n,d),r]},g.prototype.isEven=function(){var t=this._d;return 0===this._s||0===t.length||t[0]%2==0},g.prototype.isOdd=function(){return!this.isEven()},g.prototype.sign=function(){return this._s},g.prototype.isPositive=function(){return 0<this._s},g.prototype.isNegative=function(){return this._s<0},g.prototype.isZero=function(){return 0===this._s},g.prototype.exp10=function(t){if(0===(t=+t))return this;if(Math.abs(t)>Number(i))throw new Error("exponent too large in BigInteger.exp10");if(0===this._s)return v;if(0<t){for(var r=new g(this._d.slice(),this._s,d);7<=t;t-=7)r._d.unshift(0);return 0==t?r:(r._s=1,r=r.multiplySingleDigit(Math.pow(10,t)),this._s<0?r.negate():r)}if(-t>=7*this._d.length)return v;r=new g(this._d.slice(),this._s,d);for(t=-t;7<=t;t-=7)r._d.shift();return 0==t?r:r.divRemSmall(Math.pow(10,t))[0]},g.prototype.pow=function(t){if(this.isUnit())return 0<this._s?this:g(t).isOdd()?this:this.negate();if(0===(t=g(t))._s)return w;if(t._s<0){if(0===this._s)throw new Error("Divide by zero");return v}if(0===this._s)return v;if(t.isUnit())return this;if(0<t.compareAbs(i))throw new Error("exponent too large in BigInteger.pow");for(var r=this,e=w,n=g.small[2];t.isPositive();){if(t.isOdd()&&(e=e.multiply(r),t.isUnit()))return e;r=r.square(),t=t.quotient(n)}return e},g.prototype.modPow=function(t,r){for(var e=w,n=this;t.isPositive();)t.isOdd()&&(e=e.multiply(n).remainder(r)),(t=t.quotient(g.small[2])).isPositive()&&(n=n.square().remainder(r));return e},g.prototype.log=function(){switch(this._s){case 0:return-1/0;case-1:return NaN}var t=this._d.length;if(7*t<30)return Math.log(this.valueOf());var r=Math.ceil(30/7),e=this._d.slice(t-r);return Math.log(new g(e,1,d).valueOf())+(t-r)*Math.log(y)},g.prototype.valueOf=function(){return parseInt(this.toString(),10)},g.prototype.toJSValue=function(){return parseInt(this.toString(),10)},g.prototype.lowVal=function(){return this._d[0]||0};var i=g(2147483647);g.MAX_EXP=i,function(){function o(r){return function(t){return r.call(g(t))}}function s(e){return function(t,r){return e.call(g(t),g(r))}}function a(n){return function(t,r,e){return n.call(g(t),g(r),g(e))}}!function(){var t,r,e="toJSValue,isEven,isOdd,sign,isZero,isNegative,abs,isUnit,square,negate,isPositive,toString,next,prev,log".split(","),n="compare,remainder,divRem,subtract,add,quotient,divide,multiply,pow,compareAbs".split(","),i=["modPow"];for(t=0;t<e.length;t++)g[r=e[t]]=o(g.prototype[r]);for(t=0;t<n.length;t++)g[r=n[t]]=s(g.prototype[r]);for(t=0;t<i.length;t++)g[r=i[t]]=a(g.prototype[r]);g.exp10=function(t,r){return g(t).exp10(r)}}()}(),t.JSBigInt=g}(void 0!==e?e:this)},{}],12:[function(t,e,r){(function(o){"use strict";c.sigma=[[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],[14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],[11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4],[7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8],[9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13],[2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9],[12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11],[13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10],[6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5],[10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0],[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],[14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],[11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4],[7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8],[9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13],[2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]],c.u256=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479],c.padding=new o([128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),c.prototype._length_carry=function(t){for(var r=0;r<t.length&&!(t[r]<4294967296);++r)t[r]-=4294967296,t[r+1]+=1},c.prototype.update=function(t,r){t=new o(t,r);for(var e=this._block,n=0;this._blockOffset+t.length-n>=e.length;){for(var i=this._blockOffset;i<e.length;)e[i++]=t[n++];this._length[0]+=8*e.length,this._length_carry(this._length),this._compress(),this._blockOffset=0}for(;n<t.length;)e[this._blockOffset++]=t[n++];return this};var t=new o([1]),r=new o([129]);function h(t,r){return(t<<32-r|t>>>r)>>>0}function i(t,r,e,n,i,o,s,a){var u=c.sigma,f=c.u256;t[n]=t[n]+((r[u[e][a]]^f[u[e][a+1]])>>>0)+t[i]>>>0,t[s]=h(t[s]^t[n],16),t[o]=t[o]+t[s]>>>0,t[i]=h(t[i]^t[o],12),t[n]=t[n]+((r[u[e][a+1]]^f[u[e][a]])>>>0)+t[i]>>>0,t[s]=h(t[s]^t[n],8),t[o]=t[o]+t[s]>>>0,t[i]=h(t[i]^t[o],7)}function c(){this._h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this._s=[0,0,0,0],this._block=new o(64),this._blockOffset=0,this._length=[0,0],this._nullt=!1,this._zo=t,this._oo=r}c.prototype._compress=function(){var t,r=c.u256,e=new Array(16),n=new Array(16);for(t=0;t<16;++t)n[t]=this._block.readUInt32BE(4*t);for(t=0;t<8;++t)e[t]=this._h[t]>>>0;for(t=8;t<12;++t)e[t]=(this._s[t-8]^r[t-8])>>>0;for(t=12;t<16;++t)e[t]=r[t-8];for(this._nullt||(e[12]=(e[12]^this._length[0])>>>0,e[13]=(e[13]^this._length[0])>>>0,e[14]=(e[14]^this._length[1])>>>0,e[15]=(e[15]^this._length[1])>>>0),t=0;t<14;++t)i(e,n,t,0,4,8,12,0),i(e,n,t,1,5,9,13,2),i(e,n,t,2,6,10,14,4),i(e,n,t,3,7,11,15,6),i(e,n,t,0,5,10,15,8),i(e,n,t,1,6,11,12,10),i(e,n,t,2,7,8,13,12),i(e,n,t,3,4,9,14,14);for(t=0;t<16;++t)this._h[t%8]=(this._h[t%8]^e[t])>>>0;for(t=0;t<8;++t)this._h[t]=(this._h[t]^this._s[t%4])>>>0},c.prototype._padding=function(){var t=this._length[0]+8*this._blockOffset,r=this._length[1];4294967296<=t&&(t-=4294967296,r+=1);var e=new o(8);e.writeUInt32BE(r,0),e.writeUInt32BE(t,4),55===this._blockOffset?(this._length[0]-=8,this.update(this._oo)):(this._blockOffset<55?(0===this._blockOffset&&(this._nullt=!0),this._length[0]-=8*(55-this._blockOffset),this.update(c.padding.slice(0,55-this._blockOffset))):(this._length[0]-=8*(64-this._blockOffset),this.update(c.padding.slice(0,64-this._blockOffset)),this._length[0]-=440,this.update(c.padding.slice(1,56)),this._nullt=!0),this.update(this._zo),this._length[0]-=8),this._length[0]-=64,this.update(e)},c.prototype.digest=function(t){this._padding();for(var r=new o(32),e=0;e<8;++e)r.writeUInt32BE(this._h[e],4*e);return r.toString(t)},e.exports=c}).call(this,t("buffer").Buffer)},{buffer:3}],13:[function(t,r,e){"use strict";function l(t,r,e){var n=t[r]+t[e],i=t[r+1]+t[e+1];4294967296<=n&&i++,t[r]=n,t[r+1]=i}function p(t,r,e,n){var i=t[r]+e;e<0&&(i+=4294967296);var o=t[r+1]+n;4294967296<=i&&o++,t[r]=i,t[r+1]=o}function o(t,r){return t[r]^t[r+1]<<8^t[r+2]<<16^t[r+3]<<24}function n(t,r,e,n,i,o){var s=g[i],a=g[i+1],u=g[o],f=g[o+1];l(d,t,r),p(d,t,s,a);var h=d[n]^d[t],c=d[n+1]^d[t+1];d[n]=c,d[n+1]=h,l(d,e,n),h=d[r]^d[e],c=d[r+1]^d[e+1],d[r]=h>>>24^c<<8,d[r+1]=c>>>24^h<<8,l(d,t,r),p(d,t,u,f),h=d[n]^d[t],c=d[n+1]^d[t+1],d[n]=h>>>16^c<<16,d[n+1]=c>>>16^h<<16,l(d,e,n),h=d[r]^d[e],c=d[r+1]^d[e+1],d[r]=c>>>31^h<<1,d[r+1]=h>>>31^c<<1}var s=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),i=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map(function(t){return 2*t})),d=new Uint32Array(32),g=new Uint32Array(32);function a(t,r){var e=0;for(e=0;e<16;e++)d[e]=t.h[e],d[e+16]=s[e];for(d[24]=d[24]^t.t,d[25]=d[25]^t.t/4294967296,r&&(d[28]=~d[28],d[29]=~d[29]),e=0;e<32;e++)g[e]=o(t.b,4*e);for(e=0;e<12;e++)n(0,8,16,24,i[16*e+0],i[16*e+1]),n(2,10,18,26,i[16*e+2],i[16*e+3]),n(4,12,20,28,i[16*e+4],i[16*e+5]),n(6,14,22,30,i[16*e+6],i[16*e+7]),n(0,10,20,30,i[16*e+8],i[16*e+9]),n(2,12,22,24,i[16*e+10],i[16*e+11]),n(4,14,16,26,i[16*e+12],i[16*e+13]),n(6,8,18,28,i[16*e+14],i[16*e+15]);for(e=0;e<16;e++)t.h[e]=t.h[e]^d[e]^d[e+16]}var u=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function f(t,r,e,n){u.fill(0),this.b=new Uint8Array(128),this.h=new Uint32Array(16),this.t=0,this.c=0,this.outlen=t,u[0]=t,r&&(u[1]=r.length),u[2]=1,u[3]=1,e&&u.set(e,32),n&&u.set(n,48);for(var i=0;i<16;i++)this.h[i]=s[i]^o(u,4*i);r&&(h(this,r),this.c=128)}function h(t,r){for(var e=0;e<r.length;e++)128===t.c&&(t.t+=t.c,a(t,!1),t.c=0),t.b[t.c++]=r[e]}function c(t){return t<16?"0"+t.toString(16):t.toString(16)}f.prototype.update=function(t){return h(this,t),this},f.prototype.final=f.prototype.digest=function(t){var r=t&&"binary"!==t&&"hex"!==t?t:new Uint8Array(this.outlen);return function(t,r){t.t+=t.c;for(;t.c<128;)t.b[t.c++]=0;a(t,!0);for(var e=0;e<t.outlen;e++)r[e]=t.h[e>>2]>>8*(3&e)}(this,r),"hex"===t?function(t){for(var r="",e=0;e<t.length;e++)r+=c(t[e]);return r}(r):r},r.exports=f},{}],14:[function(t,r,e){var p=t("./biginteger").JSBigInt,n=function(){for(var a={},t="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",f=[],r=0;r<t.length;r++)f.push(t.charCodeAt(r));var h=[0,2,3,5,6,7,9,10,11],c=f.length,l=new p(2).pow(64);return a.encode_block=function(t,r,e){if(t.length<1||11<t.length)throw"Invalid block length: "+t.length;for(var n=function(t){if(t.length<1||8<t.length)throw"Invalid input length";var r=p.ZERO,e=new p(2).pow(8),n=0;switch(9-t.length){case 1:r=r.add(t[n++]);case 2:r=r.multiply(e).add(t[n++]);case 3:r=r.multiply(e).add(t[n++]);case 4:r=r.multiply(e).add(t[n++]);case 5:r=r.multiply(e).add(t[n++]);case 6:r=r.multiply(e).add(t[n++]);case 7:r=r.multiply(e).add(t[n++]);case 8:r=r.multiply(e).add(t[n++]);break;default:throw"Impossible condition"}return r}(t),i=h[t.length]-1;1===n.compare(0);){var o=n.divRem(c),s=o[1];n=o[0],r[e+i]=f[s.toJSValue()],i--}return r},a.encode=function(t){var r=function(t){if(t.length%2!=0)throw"Hex string has invalid length!";for(var r=new Uint8Array(t.length/2),e=0;e<t.length/2;++e)r[e]=parseInt(t.slice(2*e,2*e+2),16);return r}(t);if(0===r.length)return"";var e,n=Math.floor(r.length/8),i=r.length%8,o=11*n+h[i],s=new Uint8Array(o);for(e=0;e<o;++e)s[e]=f[0];for(e=0;e<n;e++)s=a.encode_block(r.subarray(8*e,8*e+8),s,11*e);return 0<i&&(s=a.encode_block(r.subarray(8*n,8*n+i),s,11*n)),function(t){for(var r=[],e=0;e<t.length;e++)r.push(String.fromCharCode(t[e]));return r.join("")}(s)},a.decode_block=function(t,r,e){if(t.length<1||11<t.length)throw"Invalid block length: "+t.length;var n=h.indexOf(t.length);if(n<=0)throw"Invalid block size";for(var i=new p(0),o=new p(1),s=t.length-1;0<=s;s--){var a=f.indexOf(t[s]);if(a<0)throw"Invalid symbol";var u=o.multiply(a).add(i);if(1===u.compare(l))throw"Overflow";i=u,o=o.multiply(c)}if(n<8&&new p(2).pow(8*n).compare(i)<=0)throw"Overflow 2";return r.set(function(t,r){var e=new Uint8Array(r);if(r<1||8<r)throw"Invalid input length";for(var n=new p(2).pow(8),i=r-1;0<=i;i--)e[i]=t.remainder(n).toJSValue(),t=t.divide(n);return e}(i,n),e),r},a.decode=function(t){if(0===(t=function(t){for(var r=new Uint8Array(t.length),e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}(t)).length)return"";var r=Math.floor(t.length/11),e=t.length%11,n=h.indexOf(e);if(n<0)throw"Invalid encoded length";for(var i=new Uint8Array(8*r+n),o=0;o<r;o++)i=a.decode_block(t.subarray(11*o,11*o+11),i,8*o);return 0<e&&(i=a.decode_block(t.subarray(11*r,11*r+e),i,8*r)),function(t){for(var r=[],e=0;e<t.length;++e)r.push(("0"+t[e].toString(16)).slice(-2));return r.join("")}(i)},a}();r.exports=n},{"./biginteger":11}],15:[function(t,r,e){var i=t("./bech32");function o(t,r,e,n){for(var i=0,o=0,s=[],a=(1<<e)-1,u=0;u<t.length;++u){var f=t[u];if(f<0||f>>r!=0)return null;for(i=i<<r|f,o+=r;e<=o;)o-=e,s.push(i>>o&a)}if(n)0<o&&s.push(i<<e-o&a);else if(r<=o||i<<e-o&a)return null;return s}function s(t,r){var e=i.decode(r);if(null===e||e.hrp!==t||e.data.length<1||16<e.data[0])return null;var n=o(e.data.slice(1),5,8,!1);return null===n||n.length<2||40<n.length?null:0===e.data[0]&&20!==n.length&&32!==n.length?null:{version:e.data[0],program:n}}function n(t,r,e){var n=i.encode(t,[r].concat(o(e,8,5,!0)));return null===s(t,n)?null:n}r.exports={encode:n,decode:s,isValidAddress:function(t,r){var e=s(r=r||"bc",t);return null===e&&(e=s(r="tb",t)),null!==e&&n(r,e.version,e.program)===t.toLowerCase()}}},{"./bech32":10}],16:[function(t,R,r){(function(t,r){"use strict";var c="input is invalid type",e="object"==typeof window,n=e?window:{};n.JS_SHA3_NO_WINDOW&&(e=!1);var i=!e&&"object"==typeof self;!n.JS_SHA3_NO_NODE_JS&&"object"==typeof t&&t.versions&&t.versions.node?n=r:i&&(n=self);var l=!n.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,u="0123456789abcdef".split(""),o=[4,1024,262144,67108864],p=[0,8,16,24],ht=[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=[224,256,384,512],a=[128,256],f=["hex","buffer","arrayBuffer","array","digest"],h={128:168,256:136};!n.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!l||!n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var d=function(r,e,n){return function(t){return new T(r,e,r).update(t)[n]()}},g=function(e,n,i){return function(t,r){return new T(e,n,r).update(t)[i]()}},y=function(i,t,o){return function(t,r,e,n){return A["cshake"+i].update(t,r,e,n)[o]()}},v=function(i,t,o){return function(t,r,e,n){return A["kmac"+i].update(t,r,e,n)[o]()}},w=function(t,r,e,n){for(var i=0;i<f.length;++i){var o=f[i];t[o]=r(e,n,o)}return t},b=function(t,r){var e=d(t,r,"hex");return e.create=function(){return new T(t,r,t)},e.update=function(t){return e.create().update(t)},w(e,d,t,r)},m=[{name:"keccak",padding:[1,256,65536,16777216],bits:s,createMethod:b},{name:"sha3",padding:[6,1536,393216,100663296],bits:s,createMethod:b},{name:"shake",padding:[31,7936,2031616,520093696],bits:a,createMethod:function(r,e){var n=g(r,e,"hex");return n.create=function(t){return new T(r,e,t)},n.update=function(t,r){return n.create(r).update(t)},w(n,g,r,e)}},{name:"cshake",padding:o,bits:a,createMethod:function(n,i){var o=h[n],s=y(n,0,"hex");return s.create=function(t,r,e){return r||e?new T(n,i,t).bytepad([r,e],o):A["shake"+n].create(t)},s.update=function(t,r,e,n){return s.create(r,e,n).update(t)},w(s,y,n,i)}},{name:"kmac",padding:o,bits:a,createMethod:function(n,i){var o=h[n],s=v(n,0,"hex");return s.create=function(t,r,e){return new C(n,i,r).bytepad(["KMAC",e],o).bytepad([t],o)},s.update=function(t,r,e,n){return s.create(t,e,n).update(r)},w(s,v,n,i)}}],A={},_=[],E=0;E<m.length;++E)for(var x=m[E],B=x.bits,k=0;k<B.length;++k){var U=x.name+"_"+B[k];if(_.push(U),A[U]=x.createMethod(B[k],x.padding),"sha3"!==x.name){var S=x.name+B[k];_.push(S),A[S]=A[U]}}function T(t,r,e){this.blocks=[],this.s=[],this.padding=r,this.outputBits=e,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=e>>5,this.extraBytes=(31&e)>>3;for(var n=0;n<50;++n)this.s[n]=0}function C(t,r,e){T.call(this,t,r,e)}T.prototype.update=function(t){if(!this.finalized){var r,e=typeof t;if("string"!==e){if("object"!==e)throw c;if(null===t)throw c;if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||l&&ArrayBuffer.isView(t)))throw c;r=!0}for(var n,i,o=this.blocks,s=this.byteCount,a=t.length,u=this.blockCount,f=0,h=this.s;f<a;){if(this.reset)for(this.reset=!1,o[0]=this.block,n=1;n<u+1;++n)o[n]=0;if(r)for(n=this.start;f<a&&n<s;++f)o[n>>2]|=t[f]<<p[3&n++];else for(n=this.start;f<a&&n<s;++f)(i=t.charCodeAt(f))<128?o[n>>2]|=i<<p[3&n++]:(i<2048?o[n>>2]|=(192|i>>6)<<p[3&n++]:(i<55296||57344<=i?o[n>>2]|=(224|i>>12)<<p[3&n++]:(i=65536+((1023&i)<<10|1023&t.charCodeAt(++f)),o[n>>2]|=(240|i>>18)<<p[3&n++],o[n>>2]|=(128|i>>12&63)<<p[3&n++]),o[n>>2]|=(128|i>>6&63)<<p[3&n++]),o[n>>2]|=(128|63&i)<<p[3&n++]);if(s<=(this.lastByteIndex=n)){for(this.start=n-s,this.block=o[u],n=0;n<u;++n)h[n]^=o[n];I(h),this.reset=!0}else this.start=n}return this}},T.prototype.encode=function(t,r){var e=255&t,n=1,i=[e];for(e=255&(t>>=8);0<e;)i.unshift(e),e=255&(t>>=8),++n;return r?i.push(n):i.unshift(n),this.update(i),i.length},T.prototype.encodeString=function(t){var r,e=typeof t;if("string"!==e){if("object"!==e)throw c;if(null===t)throw c;if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||l&&ArrayBuffer.isView(t)))throw c;r=!0}var n=0,i=t.length;if(r)n=i;else for(var o=0;o<t.length;++o){var s=t.charCodeAt(o);s<128?n+=1:s<2048?n+=2:s<55296||57344<=s?n+=3:(s=65536+((1023&s)<<10|1023&t.charCodeAt(++o)),n+=4)}return n+=this.encode(8*n),this.update(t),n},T.prototype.bytepad=function(t,r){for(var e=this.encode(r),n=0;n<t.length;++n)e+=this.encodeString(t[n]);var i=r-e%r,o=[];return o.length=i,this.update(o),this},T.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,r=this.lastByteIndex,e=this.blockCount,n=this.s;if(t[r>>2]|=this.padding[3&r],this.lastByteIndex===this.byteCount)for(t[0]=t[e],r=1;r<e+1;++r)t[r]=0;for(t[e-1]|=2147483648,r=0;r<e;++r)n[r]^=t[r];I(n)}},T.prototype.toString=T.prototype.hex=function(){this.finalize();for(var t,r=this.blockCount,e=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a="";s<n;){for(o=0;o<r&&s<n;++o,++s)t=e[o],a+=u[t>>4&15]+u[15&t]+u[t>>12&15]+u[t>>8&15]+u[t>>20&15]+u[t>>16&15]+u[t>>28&15]+u[t>>24&15];s%r==0&&(I(e),o=0)}return i&&(t=e[o],a+=u[t>>4&15]+u[15&t],1<i&&(a+=u[t>>12&15]+u[t>>8&15]),2<i&&(a+=u[t>>20&15]+u[t>>16&15])),a},T.prototype.buffer=T.prototype.arrayBuffer=function(){this.finalize();var t,r=this.blockCount,e=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s<n;){for(o=0;o<r&&s<n;++o,++s)u[s]=e[o];s%r==0&&I(e)}return i&&(u[o]=e[o],t=t.slice(0,a)),t},T.prototype.digest=T.prototype.array=function(){this.finalize();for(var t,r,e=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,s=0,a=0,u=[];a<i;){for(s=0;s<e&&a<i;++s,++a)t=a<<2,r=n[s],u[t]=255&r,u[t+1]=r>>8&255,u[t+2]=r>>16&255,u[t+3]=r>>24&255;a%e==0&&I(n)}return o&&(t=a<<2,r=n[s],u[t]=255&r,1<o&&(u[t+1]=r>>8&255),2<o&&(u[t+2]=r>>16&255)),u},(C.prototype=new T).finalize=function(){return this.encode(this.outputBits,!0),T.prototype.finalize.call(this)};var I=function(t){var r,e,n,i,o,s,a,u,f,h,c,l,p,d,g,y,v,w,b,m,A,_,E,x,B,k,U,S,T,C,I,R,L,O,M,H,F,N,z,$,j,P,V,Y,q,X,D,J,W,Z,K,G,Q,tt,rt,et,nt,it,ot,st,at,ut,ft;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],f=t[5]^t[15]^t[25]^t[35]^t[45],h=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],r=(l=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),e=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>31),t[0]^=r,t[1]^=e,t[10]^=r,t[11]^=e,t[20]^=r,t[21]^=e,t[30]^=r,t[31]^=e,t[40]^=r,t[41]^=e,r=i^(u<<1|f>>>31),e=o^(f<<1|u>>>31),t[2]^=r,t[3]^=e,t[12]^=r,t[13]^=e,t[22]^=r,t[23]^=e,t[32]^=r,t[33]^=e,t[42]^=r,t[43]^=e,r=s^(h<<1|c>>>31),e=a^(c<<1|h>>>31),t[4]^=r,t[5]^=e,t[14]^=r,t[15]^=e,t[24]^=r,t[25]^=e,t[34]^=r,t[35]^=e,t[44]^=r,t[45]^=e,r=u^(l<<1|p>>>31),e=f^(p<<1|l>>>31),t[6]^=r,t[7]^=e,t[16]^=r,t[17]^=e,t[26]^=r,t[27]^=e,t[36]^=r,t[37]^=e,t[46]^=r,t[47]^=e,r=h^(i<<1|o>>>31),e=c^(o<<1|i>>>31),t[8]^=r,t[9]^=e,t[18]^=r,t[19]^=e,t[28]^=r,t[29]^=e,t[38]^=r,t[39]^=e,t[48]^=r,t[49]^=e,d=t[0],g=t[1],X=t[11]<<4|t[10]>>>28,D=t[10]<<4|t[11]>>>28,S=t[20]<<3|t[21]>>>29,T=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,P=t[40]<<18|t[41]>>>14,V=t[41]<<18|t[40]>>>14,O=t[2]<<1|t[3]>>>31,M=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,v=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,C=t[33]<<13|t[32]>>>19,I=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,tt=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,H=t[14]<<6|t[15]>>>26,F=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,b=t[24]<<11|t[25]>>>21,Z=t[34]<<15|t[35]>>>17,K=t[35]<<15|t[34]>>>17,R=t[45]<<29|t[44]>>>3,L=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,B=t[7]<<28|t[6]>>>4,et=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,N=t[26]<<25|t[27]>>>7,z=t[27]<<25|t[26]>>>7,m=t[36]<<21|t[37]>>>11,A=t[37]<<21|t[36]>>>11,G=t[47]<<24|t[46]>>>8,Q=t[46]<<24|t[47]>>>8,Y=t[8]<<27|t[9]>>>5,q=t[9]<<27|t[8]>>>5,k=t[18]<<20|t[19]>>>12,U=t[19]<<20|t[18]>>>12,it=t[29]<<7|t[28]>>>25,ot=t[28]<<7|t[29]>>>25,$=t[38]<<8|t[39]>>>24,j=t[39]<<8|t[38]>>>24,_=t[48]<<14|t[49]>>>18,E=t[49]<<14|t[48]>>>18,t[0]=d^~y&w,t[1]=g^~v&b,t[10]=x^~k&S,t[11]=B^~U&T,t[20]=O^~H&N,t[21]=M^~F&z,t[30]=Y^~X&J,t[31]=q^~D&W,t[40]=tt^~et&it,t[41]=rt^~nt&ot,t[2]=y^~w&m,t[3]=v^~b&A,t[12]=k^~S&C,t[13]=U^~T&I,t[22]=H^~N&$,t[23]=F^~z&j,t[32]=X^~J&Z,t[33]=D^~W&K,t[42]=et^~it&st,t[43]=nt^~ot&at,t[4]=w^~m&_,t[5]=b^~A&E,t[14]=S^~C&R,t[15]=T^~I&L,t[24]=N^~$&P,t[25]=z^~j&V,t[34]=J^~Z&G,t[35]=W^~K&Q,t[44]=it^~st&ut,t[45]=ot^~at&ft,t[6]=m^~_&d,t[7]=A^~E&g,t[16]=C^~R&x,t[17]=I^~L&B,t[26]=$^~P&O,t[27]=j^~V&M,t[36]=Z^~G&Y,t[37]=K^~Q&q,t[46]=st^~ut&tt,t[47]=at^~ft&rt,t[8]=_^~d&y,t[9]=E^~g&v,t[18]=R^~x&k,t[19]=L^~B&U,t[28]=P^~O&H,t[29]=V^~M&F,t[38]=G^~Y&X,t[39]=Q^~q&D,t[48]=ut^~tt&et,t[49]=ft^~rt&nt,t[0]^=ht[n],t[1]^=ht[n+1]};R.exports=A}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:6}],17:[function(t,r,e){var n=t("jssha/src/sha256"),i=t("./blake256"),o=t("./sha3").keccak256,s=t("./blake2b"),a=t("./base58");function u(t){var r="0123456789ABCDEF",e="";return e+=r.charAt(t>>4),e+=r.charAt(15&t)}r.exports={toHex:function(t){for(var r,e,n="",i=0;i<t.length;i++)n+=(r=t[i],e=void 0,1===(e=Math.round(r).toString(16)).length&&(e="0"+e),e);return n},sha256:function(t){var r=new n("SHA-256","HEX");return r.update(t),r.getHash("HEX")},sha256Checksum:function(t){return this.sha256(this.sha256(t)).substr(0,8)},blake256:function(t){return(new i).update(t,"hex").digest("hex")},blake256Checksum:function(t){return this.blake256(this.blake256(t)).substr(0,8)},blake2b:function(t,r){return new s(r).update(function(t){for(var r=[],e=0;e<t.length;e+=2)r.push(parseInt(t.substr(e,2),16));return new Uint8Array(r)}(t)).digest("hex")},keccak256:function(t){return o(t)},keccak256Checksum:function(t){return o(t).toString().substr(0,8)},base58:a.decode,byteArray2hexStr:function(t){for(var r="",e=0;e<t.length-1;e++)r+=u(t[e]);return r+=u(t[e])},hexStr2byteArray:function(t){var r,e,n,i=Array(),o=0,s=0,a=0,u=0;for(s=0;s<t.length;s++){var f=t.charAt(s);("A"<=(n=f)&&n<="F"||"a"<=n&&n<="f"||"0"<=n&&n<="9")&&(o<<=4,o+=(e=void 0,e=0,"A"<=(r=f)&&r<="F"?e=r.charCodeAt(0)-"A".charCodeAt(0)+10:"a"<=r&&r<="f"?e=r.charCodeAt(0)-"a".charCodeAt(0)+10:"0"<=r&&r<="9"&&(e=r.charCodeAt(0)-"0".charCodeAt(0)),e),0==++a%2&&(i[u++]=o,o=0))}return i}}},{"./base58":9,"./blake256":12,"./blake2b":13,"./sha3":16,"jssha/src/sha256":5}],18:[function(t,r,e){var n=t("./ripple_validator"),i=t("./ethereum_validator"),o=t("./bitcoin_validator"),s=t("./monero_validator"),a=t("./nano_validator"),u=[{name:"bitcoin",symbol:"btc",addressTypes:{prod:["00","05"],testnet:["6f","c4"]},validator:o},{name:"bitcoincash",symbol:"bch",addressTypes:{prod:["00","05"],testnet:["6f","c4"]},validator:o},{name:"litecoin",symbol:"ltc",addressTypes:{prod:["30","05","32"],testnet:["6f","c4","3a"]},validator:o},{name:"peercoin",symbol:"ppc",addressTypes:{prod:["37","75"],testnet:["6f","c4"]},validator:o},{name:"dogecoin",symbol:"doge",addressTypes:{prod:["1e","16"],testnet:["71","c4"]},validator:o},{name:"beavercoin",symbol:"bvc",addressTypes:{prod:["19","05"],testnet:["6f","c4"]},validator:o},{name:"freicoin",symbol:"frc",addressTypes:{prod:["00","05"],testnet:["6f","c4"]},validator:o},{name:"protoshares",symbol:"pts",addressTypes:{prod:["38","05"],testnet:["6f","c4"]},validator:o},{name:"megacoin",symbol:"mec",addressTypes:{prod:["32","05"],testnet:["6f","c4"]},validator:o},{name:"primecoin",symbol:"xpm",addressTypes:{prod:["17","53"],testnet:["6f","c4"]},validator:o},{name:"auroracoin",symbol:"aur",addressTypes:{prod:["17","05"],testnet:["6f","c4"]},validator:o},{name:"namecoin",symbol:"nmc",addressTypes:{prod:["34"],testnet:[]},validator:o},{name:"biocoin",symbol:"bio",addressTypes:{prod:["19","14"],testnet:["6f","c4"]},validator:o},{name:"garlicoin",symbol:"grlc",addressTypes:{prod:["26","05"],testnet:["6f","c4"]},validator:o},{name:"vertcoin",symbol:"vtc",addressTypes:{prod:["0x","47"],testnet:["6f","c4"]},segwitHrp:"vtc",validator:o},{name:"bitcoingold",symbol:"btg",addressTypes:{prod:["26","17"],testnet:["6f","c4"]},validator:o},{name:"komodo",symbol:"kmd",addressTypes:{prod:["3c","55"],testnet:["0","5"]},validator:o},{name:"bitcoinz",symbol:"btcz",expectedLength:26,addressTypes:{prod:["1cb8","1cbd"],testnet:["1d25","1cba"]},validator:o},{name:"bitcoinprivate",symbol:"btcp",expectedLength:26,addressTypes:{prod:["1325","13af"],testnet:["1957","19e0"]},validator:o},{name:"hush",symbol:"hush",expectedLength:26,addressTypes:{prod:["1cb8","1cbd"],testnet:["1d25","1cba"]},validator:o},{name:"snowgem",symbol:"sng",expectedLength:26,addressTypes:{prod:["1c28","1c2d"],testnet:["1d25","1cba"]},validator:o},{name:"zcash",symbol:"zec",expectedLength:26,addressTypes:{prod:["1cb8","1cbd"],testnet:["1d25","1cba"]},validator:o},{name:"zclassic",symbol:"zcl",expectedLength:26,addressTypes:{prod:["1cb8","1cbd"],testnet:["1d25","1cba"]},validator:o},{name:"zencash",symbol:"zen",expectedLength:26,addressTypes:{prod:["2089","2096"],testnet:["2092","2098"]},validator:o},{name:"votecoin",symbol:"vot",expectedLength:26,addressTypes:{prod:["1cb8","1cbd"],testnet:["1d25","1cba"]},validator:o},{name:"decred",symbol:"dcr",addressTypes:{prod:["073f","071a"],testnet:["0f21","0efc"]},hashFunction:"blake256",expectedLength:26,validator:o},{name:"digibyte",symbol:"dgb",addressTypes:{prod:["1e"],testnet:[]},validator:o},{name:"ethereum",symbol:"eth",validator:i},{name:"etherzero",symbol:"etz",validator:i},{name:"ethereumclassic",symbol:"etc",validator:i},{name:"callisto",symbol:"clo",validator:i},{name:"ripple",symbol:"xrp",validator:n},{name:"dash",symbol:"dash",addressTypes:{prod:["4c","10"],testnet:["8c","13"]},validator:o},{name:"neo",symbol:"neo",addressTypes:{prod:["17"],testnet:[]},validator:o},{name:"neogas",symbol:"gas",addressTypes:{prod:["17"],testnet:[]},validator:o},{name:"qtum",symbol:"qtum",addressTypes:{prod:["3a","32"],testnet:["78","6e"]},validator:o},{name:"bankex",symbol:"bkx",validator:i},{name:"monero",symbol:"xmr",addressTypes:{prod:["18"],testnet:["53"]},iAddressTypes:{prod:["19"],testnet:["54"]},validator:s},{name:"nano",symbol:"nano",validator:a},{name:"raiblocks",symbol:"xrb",validator:a},{name:"tron",symbol:"trx",addressTypes:{prod:[65],testnet:[160]},validator:t("./tron_validator")}];r.exports={getByNameOrSymbol:function(t){for(var r=t.toLowerCase(),e=0;e<u.length;e++){var n=u[e];if(n.name===r||n.symbol===r)return n}return null}}},{"./bitcoin_validator":8,"./ethereum_validator":19,"./monero_validator":20,"./nano_validator":21,"./ripple_validator":22,"./tron_validator":23}],19:[function(t,r,e){var n=t("./crypto/utils");r.exports={isValidAddress:function(t){return!!/^0x[0-9a-fA-F]{40}$/.test(t)&&(!(!/^0x[0-9a-f]{40}$/.test(t)&&!/^0x?[0-9A-F]{40}$/.test(t))||this.verifyChecksum(t))},verifyChecksum:function(t){t=t.replace("0x","");for(var r=n.keccak256(t.toLowerCase()),e=0;e<40;e++)if(7<parseInt(r[e],16)&&t[e].toUpperCase()!==t[e]||parseInt(r[e],16)<=7&&t[e].toLowerCase()!==t[e])return!1;return!0}}},{"./crypto/utils":17}],20:[function(t,r,e){var o=t("./crypto/utils"),s=t("./crypto/cnBase58"),a=new RegExp("^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{95}$"),u=new RegExp("^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{106}$");r.exports={isValidAddress:function(t,r,e){e=e||"prod";var n="standard";if(!a.test(t)){if(!u.test(t))return!1;n="integrated"}var i=s.decode(t);return!!i&&(!!function(t,r,e,n){var i=r.addressTypes;switch("integrated"==n&&(i=r.iAddressTypes),e){case"prod":return parseInt(t.substr(0,2),16)==i.prod[0];case"testnet":return parseInt(t.substr(0,2),16)==i.testnet[0];case"both":return parseInt(t.substr(0,2),16)==i.prod[0]||parseInt(t.substr(0,2),16)==i.testnet[0];default:return!1}}(i,r,e,n)&&i.slice(-8)===o.keccak256Checksum(function(t){if(t.length%2!=0)return null;for(var r=new Uint8Array(t.length/2),e=0;e<t.length/2;++e)r[e]=parseInt(t.slice(2*e,2*e+2),16);return r}(i.slice(0,-8))))}}},{"./crypto/cnBase58":14,"./crypto/utils":17}],21:[function(t,r,e){var n=t("./crypto/utils"),i="13456789abcdefghijkmnopqrstuwxyz",o=t("base-x")(i),s=new RegExp("^(xrb|nano)_(["+i+"]{60})$");r.exports={isValidAddress:function(t){return!!s.test(t)&&this.verifyChecksum(t)},verifyChecksum:function(t){var r=o.decode(s.exec(t)[2]).slice(-37);return n.blake2b(n.toHex(r.slice(0,-5)),5)===n.toHex(r.slice(-5).reverse())}}},{"./crypto/utils":17,"base-x":1}],22:[function(t,r,e){var n=t("./crypto/utils"),i="rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz",o=t("base-x")(i),s=new RegExp("^r["+i+"]{27,35}$");r.exports={isValidAddress:function(t){return!!s.test(t)&&this.verifyChecksum(t)},verifyChecksum:function(t){var r=o.decode(t);return n.sha256Checksum(n.toHex(r.slice(0,-4)))===n.toHex(r.slice(-4))}}},{"./crypto/utils":17,"base-x":1}],23:[function(t,r,e){var s=t("./crypto/utils");r.exports={isValidAddress:function(t,r,e){var n,i=function(t){if("string"!=typeof t)return!1;if(t.length<=4)return!1;try{var r=s.base58(t)}catch(t){return!1}if(t.length<=4)return!1;var e=r.length-4,n=r.slice(e);r=r.slice(0,e);var i=s.sha256(s.byteArray2hexStr(r)),o=s.hexStr2byteArray(s.sha256(i)).slice(0,4);return n[0]===o[0]&&n[1]===o[1]&&n[2]===o[2]&&n[3]===o[3]&&r}(t);return!!i&&(21===i.length&&("prod"!==(n=e||"prod")&&"testnet"!==n&&(n="prod"),r.addressTypes[n][0]===i[0]))}}},{"./crypto/utils":17}],24:[function(t,r,e){var i=t("./currencies");r.exports={validate:function(t,r,e){var n=i.getByNameOrSymbol(r||"bitcoin");if(n.validator)return n.validator.isValidAddress(t,n,e);throw new Error("Missing validator for currency: "+r)}}},{"./currencies":18}]},{},[24])(24)});