UNPKG

run-sdk

Version:

A platform to build apps and tokens on Bitcoin

8 lines 336 kB
var bsv=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=59)}([function(t,e,r){"use strict";(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <http://feross.org> * @license MIT */ var n=r(60),i=r(61),s=r(62);function o(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(t,e){if(o()<e)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=a.prototype:(null===t&&(t=new a(e)),t.length=e),t}function a(t,e,r){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return u(this,t,e,r)}function u(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);a.TYPED_ARRAY_SUPPORT?(t=e).__proto__=a.prototype:t=d(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!a.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|l(e,r),i=(t=f(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(a.isBuffer(e)){var r=0|p(e.length);return 0===(t=f(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?f(t,0):d(t,e);if("Buffer"===e.type&&s(e.data))return d(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(c(e),t=f(t,e<0?0:0|p(e)),!a.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function d(t,e){var r=e.length<0?0:0|p(e.length);t=f(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function p(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function l(t,e){if(a.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(t).length;default:if(n)return F(t).length;e=(""+e).toLowerCase(),n=!0}}function b(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return O(this,e,r);case"latin1":case"binary":return k(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:y(t,e,r,n,i);if("number"==typeof e)return e&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,n,i){var s,o=1,f=t.length,a=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,f/=2,a/=2,r/=2}function u(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var c=-1;for(s=r;s<f;s++)if(u(t,s)===u(e,-1===c?0:s-c)){if(-1===c&&(c=s),s-c+1===a)return c*o}else-1!==c&&(s-=s-c),c=-1}else for(r+a>f&&(r=f-a),s=r;s>=0;s--){for(var h=!0,d=0;d<a;d++)if(u(t,s+d)!==u(e,d)){h=!1;break}if(h)return s}return-1}function v(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var s=e.length;if(s%2!=0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var o=0;o<n;++o){var f=parseInt(e.substr(2*o,2),16);if(isNaN(f))return o;t[r+o]=f}return o}function _(t,e,r,n){return z(F(e,t.length-r),t,r,n)}function S(t,e,r,n){return z(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function w(t,e,r,n){return S(t,e,r,n)}function I(t,e,r,n){return z(K(e),t,r,n)}function A(t,e,r,n){return z(function(t,e){for(var r,n,i,s=[],o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),n=r>>8,i=r%256,s.push(i),s.push(n);return s}(e,t.length-r),t,r,n)}function E(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function P(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var s,o,f,a,u=t[i],c=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(s=t[i+1]))&&(a=(31&u)<<6|63&s)>127&&(c=a);break;case 3:s=t[i+1],o=t[i+2],128==(192&s)&&128==(192&o)&&(a=(15&u)<<12|(63&s)<<6|63&o)>2047&&(a<55296||a>57343)&&(c=a);break;case 4:s=t[i+1],o=t[i+2],f=t[i+3],128==(192&s)&&128==(192&o)&&128==(192&f)&&(a=(15&u)<<18|(63&s)<<12|(63&o)<<6|63&f)>65535&&a<1114112&&(c=a)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}e.Buffer=a,e.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},e.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=o(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,e,r){return u(null,t,e,r)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(t,e,r){return function(t,e,r,n){return c(e),e<=0?f(t,e):void 0!==r?"string"==typeof n?f(t,e).fill(r,n):f(t,e).fill(r):f(t,e)}(null,t,e,r)},a.allocUnsafe=function(t){return h(null,t)},a.allocUnsafeSlow=function(t){return h(null,t)},a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,s=Math.min(r,n);i<s;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},a.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}},a.concat=function(t,e){if(!s(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=a.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(!a.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},a.byteLength=l,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},a.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?P(this,0,t):b.apply(this,arguments)},a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},a.prototype.compare=function(t,e,r,n,i){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var s=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(e>>>=0),f=Math.min(s,o),u=this.slice(n,i),c=t.slice(e,r),h=0;h<f;++h)if(u[h]!==c[h]){s=u[h],o=c[h];break}return s<o?-1:o<s?1:0},a.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},a.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return S(this,t,e,r);case"latin1":case"binary":return w(this,t,e,r);case"base64":return I(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function O(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function k(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function R(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",s=e;s<r;++s)i+=D(t[s]);return i}function M(t,e,r){for(var n=t.slice(e,r),i="",s=0;s<n.length;s+=2)i+=String.fromCharCode(n[s]+256*n[s+1]);return i}function x(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function T(t,e,r,n,i,s){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function B(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,s=Math.min(t.length-r,2);i<s;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function N(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,s=Math.min(t.length-r,4);i<s;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function C(t,e,r,n,i,s){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(t,e,r,n,s){return s||C(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function L(t,e,r,n,s){return s||C(t,0,r,8),i.write(t,e,r,n,52,8),r+8}a.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),a.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=a.prototype;else{var i=e-t;r=new a(i,void 0);for(var s=0;s<i;++s)r[s]=this[s+t]}return r},a.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var n=this[t],i=1,s=0;++s<e&&(i*=256);)n+=this[t+s]*i;return n},a.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUInt8=function(t,e){return e||x(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return e||x(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return e||x(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return e||x(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var n=this[t],i=1,s=0;++s<e&&(i*=256);)n+=this[t+s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var n=e,i=1,s=this[t+--n];n>0&&(i*=256);)s+=this[t+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*e)),s},a.prototype.readInt8=function(t,e){return e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){e||x(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){e||x(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return e||x(t,4,this.length),i.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return e||x(t,4,this.length),i.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return e||x(t,8,this.length),i.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return e||x(t,8,this.length),i.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||T(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,s=0;for(this[e]=255&t;++s<r&&(i*=256);)this[e+s]=t/i&255;return e+r},a.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||T(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,s=1;for(this[e+i]=255&t;--i>=0&&(s*=256);)this[e+i]=t/s&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):N(this,t,e,!0),e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);T(this,t,e,r,i-1,-i)}var s=0,o=1,f=0;for(this[e]=255&t;++s<r&&(o*=256);)t<0&&0===f&&0!==this[e+s-1]&&(f=1),this[e+s]=(t/o>>0)-f&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);T(this,t,e,r,i-1,-i)}var s=r-1,o=1,f=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===f&&0!==this[e+s+1]&&(f=1),this[e+s]=(t/o>>0)-f&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):B(this,t,e,!0),e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):B(this,t,e,!1),e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):N(this,t,e,!0),e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||T(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},a.prototype.writeFloatLE=function(t,e,r){return U(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return U(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return L(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return L(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,s=n-r;if(this===t&&r<e&&e<n)for(i=s-1;i>=0;--i)t[i+e]=this[i+r];else if(s<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i<s;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+s),e);return s},a.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var s;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s<r;++s)this[s]=t;else{var o=a.isBuffer(t)?t:F(new a(t,n).toString()),f=o.length;for(s=0;s<r-e;++s)this[s+e]=o[s%f]}return this};var H=/[^+\/0-9A-Za-z-_]/g;function D(t){return t<16?"0"+t.toString(16):t.toString(16)}function F(t,e){var r;e=e||1/0;for(var n=t.length,i=null,s=[],o=0;o<n;++o){if((r=t.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function K(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(H,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(34))},function(t,e,r){"use strict";var n={isArray:t=>Array.isArray(t),isNumber:t=>"number"==typeof t,isObject:t=>t&&"object"==typeof t,isString:t=>"string"==typeof t,isUndefined:t=>void 0===t,isFunction:t=>"function"==typeof t,isNull:t=>null===t,isDate:t=>t instanceof Date,extend:(t,e)=>Object.assign(t,e),noop:()=>{},every:(t,e)=>t.every(e||(t=>t)),map:(t,e)=>Array.from(t).map(e||(t=>t)),includes:(t,e)=>t.includes(e),each:(t,e)=>t.forEach(e),clone:t=>Object.assign({},t),pick:(t,e)=>{const r={};return e.forEach(e=>{void 0!==t[e]&&(r[e]=t[e])}),r},values:t=>Object.values(t),filter:(t,e)=>t.filter(e),reduce:(t,e,r)=>t.reduce(e,r),without:(t,e)=>t.filter(t=>t!==e),shuffle:t=>{const e=t.slice(0);for(let t=e.length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1));[e[t],e[r]]=[e[r],e[t]]}return e},difference:(t,e)=>t.filter(t=>!e.includes(t)),findIndex:(t,e)=>t.findIndex(e),some:(t,e)=>t.some(e),range:t=>[...Array(t).keys()]};t.exports=n},function(t,e,r){"use strict";var n=r(8),i=r(1);t.exports={checkState:function(t,e){if(!t)throw new n.InvalidState(e)},checkArgument:function(t,e,r,i){if(!t)throw new n.InvalidArgument(e,r,i)},checkArgumentType:function(t,e,s){if(s=s||"(unknown name)",i.isString(e)){if("Buffer"===e){if(!r(0).Buffer.isBuffer(t))throw new n.InvalidArgumentType(t,e,s)}else if(typeof t!==e)throw new n.InvalidArgumentType(t,e,s)}else if(!(t instanceof e))throw new n.InvalidArgumentType(t,e.name,s)}}},function(t,e,r){"use strict";(function(e){var n=r(7),i=r(2),s=r(1),o=function(t){for(var r=e.alloc(t.length),n=0;n<t.length;n++)r[n]=t[t.length-1-n];return r};n.Zero=new n(0),n.One=new n(1),n.Minus1=new n(-1),n.fromNumber=function(t){return i.checkArgument(s.isNumber(t)),new n(t)},n.fromString=function(t,e){return i.checkArgument(s.isString(t)),new n(t,e)},n.fromBuffer=function(t,e){void 0!==e&&"little"===e.endian&&(t=o(t));var r=t.toString("hex");return new n(r,16)},n.fromSM=function(t,r){var i;if(0===t.length)return n.fromBuffer(e.from([0]));var s="big";return r&&(s=r.endian),"little"===s&&(t=o(t)),128&t[0]?(t[0]=127&t[0],(i=n.fromBuffer(t)).neg().copy(i)):i=n.fromBuffer(t),i},n.prototype.toNumber=function(){return parseInt(this.toString(10),10)},n.prototype.toBuffer=function(t){var r,i;if(t&&t.size){var s=(i=this.toString(16,2)).length/2;r=e.from(i,"hex"),s===t.size||(s>t.size?r=n.trim(r,s):s<t.size&&(r=n.pad(r,s,t.size)))}else i=this.toString(16,2),r=e.from(i,"hex");return void 0!==t&&"little"===t.endian&&(r=o(r)),r},n.prototype.toSMBigEndian=function(){var t;return-1===this.cmp(n.Zero)?128&(t=this.neg().toBuffer())[0]?t=e.concat([e.from([128]),t]):t[0]=128|t[0]:128&(t=this.toBuffer())[0]&&(t=e.concat([e.from([0]),t])),1===t.length&0===t[0]&&(t=e.from([])),t},n.prototype.toSM=function(t){var e=t?t.endian:"big",r=this.toSMBigEndian();return"little"===e&&(r=o(r)),r},n.fromScriptNumBuffer=function(t,e,r){var s=r||4;if(i.checkArgument(t.length<=s,new Error("script number overflow")),e&&t.length>0&&0==(127&t[t.length-1])&&(t.length<=1||0==(128&t[t.length-2])))throw new Error("non-minimally encoded script number");return n.fromSM(t,{endian:"little"})},n.prototype.toScriptNumBuffer=function(){return this.toSM({endian:"little"})},n.trim=function(t,e){return t.slice(e-t.length,t.length)},n.pad=function(t,r,n){for(var i=e.alloc(n),s=0;s<t.length;s++)i[i.length-1-s]=t[t.length-1-s];for(s=0;s<n-r;s++)i[s]=0;return i},n.prototype.toHex=function(...t){return this.toBuffer(...t).toString("hex")},n.fromHex=function(t,...r){return n.fromBuffer(e.from(t,"hex"),...r)},t.exports=n}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(e){var n=r(1),i=r(2),s=function(t){return!!n.isString(t)&&/^[0-9a-fA-F]+$/.test(t)};t.exports={isValidJSON:function(t){var e;if(!n.isString(t))return!1;try{e=JSON.parse(t)}catch(t){return!1}return"object"==typeof e},isHexa:s,isHexaString:s,defineImmutable:function(t,e){return Object.keys(e).forEach((function(r){Object.defineProperty(t,r,{configurable:!1,enumerable:!0,value:e[r]})})),t},isNaturalNumber:function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t&&t>=0},integerAsBuffer:function(t){i.checkArgumentType(t,"number","integer");const r=e.allocUnsafe(4);return r.writeUInt32BE(t,0),r}}}).call(this,r(0).Buffer)},function(t,e,r){(function(e){e.browser?t.exports=r(85):t.exports=r(86)}).call(this,r(38))},function(t,e,r){"use strict";var n=e,i=r(7),s=r(17),o=r(44);n.assert=s,n.toArray=o.toArray,n.zero2=o.zero2,n.toHex=o.toHex,n.encode=o.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,s=t.clone(),o=0;o<n.length;o++){var f,a=s.andln(i-1);s.isOdd()?(f=a>(i>>1)-1?(i>>1)-a:a,s.isubn(f)):f=0,n[o]=f,s.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,s=0;t.cmpn(-i)>0||e.cmpn(-s)>0;){var o,f,a=t.andln(3)+i&3,u=e.andln(3)+s&3;3===a&&(a=-1),3===u&&(u=-1),o=0==(1&a)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==u?a:-a,r[0].push(o),f=0==(1&u)?0:3!==(n=e.andln(7)+s&7)&&5!==n||2!==a?u:-u,r[1].push(f),2*i===o+1&&(i=1-i),2*s===f+1&&(s=1-s),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof t?t.exports=s:e.BN=s,s.BN=s,s.wordSize=26;try{o=r(65).Buffer}catch(t){}function f(t,e,r){for(var n=0,i=Math.min(t.length,r),s=e;s<i;s++){var o=t.charCodeAt(s)-48;n<<=4,n|=o>=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function a(t,e,r,n){for(var i=0,s=Math.min(t.length,r),o=e;o<s;o++){var f=t.charCodeAt(o)-48;i*=n,i+=f>=49?f-49+10:f>=17?f-17+10:f}return i}s.isBN=function(t){return t instanceof s||null!==t&&"object"==typeof t&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var s,o,f=0;if("be"===r)for(i=t.length-1,s=0;i>=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[s]|=o<<f&67108863,this.words[s+1]=o>>>26-f&67108863,(f+=24)>=26&&(f-=26,s++);else if("le"===r)for(i=0,s=0;i<t.length;i+=3)o=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[s]|=o<<f&67108863,this.words[s+1]=o>>>26-f&67108863,(f+=24)>=26&&(f-=26,s++);return this.strip()},s.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,s=0;for(r=t.length-6,n=0;r>=e;r-=6)i=f(t,r,r+6),this.words[n]|=i<<s&67108863,this.words[n+1]|=i>>>26-s&4194303,(s+=24)>=26&&(s-=26,n++);r+6!==e&&(i=f(t,e,r+6),this.words[n]|=i<<s&67108863,this.words[n+1]|=i>>>26-s&4194303),this.strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var s=t.length-r,o=s%n,f=Math.min(s,s-o)+r,u=0,c=r;c<f;c+=n)u=a(t,c,c+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==o){var h=1;for(u=a(t,c,t.length,e),c=0;c<o;c++)h*=e;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","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"],c=[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],h=[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 d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],s=0|e.words[0],o=i*s,f=67108863&o,a=o/67108864|0;r.words[0]=f;for(var u=1;u<n;u++){for(var c=a>>>26,h=67108863&a,d=Math.min(u,e.length-1),p=Math.max(0,u-t.length+1);p<=d;p++){var l=u-p|0;c+=(o=(i=0|t.words[l])*(s=0|e.words[p])+h)/67108864|0,h=67108863&o}r.words[u]=0|h,a=0|c}return 0!==a?r.words[u]=0|a:r.length--,r.strip()}s.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,s=0,o=0;o<this.length;o++){var f=this.words[o],a=(16777215&(f<<i|s)).toString(16);r=0!==(s=f>>>24-i&16777215)||o!==this.length-1?u[6-a.length]+a+r:a+r,(i+=2)>=26&&(i-=26,o--)}for(0!==s&&(r=s.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var d=c[t],p=h[t];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var b=l.modn(p).toString(t);r=(l=l.idivn(p)).isZero()?b+r:u[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),s=r||Math.max(1,i);n(i<=s,"byte array longer than desired length"),n(s>0,"Requested array length <= 0"),this.strip();var o,f,a="le"===e,u=new t(s),c=this.clone();if(a){for(f=0;!c.isZero();f++)o=c.andln(255),c.iushrn(8),u[f]=o;for(;f<s;f++)u[f]=0}else{for(f=0;f<s-i;f++)u[f]=0;for(f=0;!c.isZero();f++)o=c.andln(255),c.iushrn(8),u[s-f-1]=o}return u},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},s.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},s.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},s.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},s.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,s=0;s<n.length;s++)e=(0|r.words[s])+(0|n.words[s])+i,this.words[s]=67108863&e,i=e>>>26;for(;0!==i&&s<r.length;s++)e=(0|r.words[s])+i,this.words[s]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var s=0,o=0;o<n.length;o++)s=(e=(0|r.words[o])-(0|n.words[o])+s)>>26,this.words[o]=67108863&e;for(;0!==s&&o<r.length;o++)s=(e=(0|r.words[o])+s)>>26,this.words[o]=67108863&e;if(0===s&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,s,o=t.words,f=e.words,a=r.words,u=0,c=0|o[0],h=8191&c,d=c>>>13,p=0|o[1],l=8191&p,b=p>>>13,m=0|o[2],g=8191&m,y=m>>>13,v=0|o[3],_=8191&v,S=v>>>13,w=0|o[4],I=8191&w,A=w>>>13,E=0|o[5],P=8191&E,O=E>>>13,k=0|o[6],R=8191&k,M=k>>>13,x=0|o[7],T=8191&x,B=x>>>13,N=0|o[8],C=8191&N,U=N>>>13,L=0|o[9],H=8191&L,D=L>>>13,F=0|f[0],K=8191&F,z=F>>>13,j=0|f[1],V=8191&j,q=j>>>13,Y=0|f[2],G=8191&Y,X=Y>>>13,W=0|f[3],Z=8191&W,J=W>>>13,Q=0|f[4],$=8191&Q,tt=Q>>>13,et=0|f[5],rt=8191&et,nt=et>>>13,it=0|f[6],st=8191&it,ot=it>>>13,ft=0|f[7],at=8191&ft,ut=ft>>>13,ct=0|f[8],ht=8191&ct,dt=ct>>>13,pt=0|f[9],lt=8191&pt,bt=pt>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(u+(n=Math.imul(h,K))|0)+((8191&(i=(i=Math.imul(h,z))+Math.imul(d,K)|0))<<13)|0;u=((s=Math.imul(d,z))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(l,K),i=(i=Math.imul(l,z))+Math.imul(b,K)|0,s=Math.imul(b,z);var gt=(u+(n=n+Math.imul(h,V)|0)|0)+((8191&(i=(i=i+Math.imul(h,q)|0)+Math.imul(d,V)|0))<<13)|0;u=((s=s+Math.imul(d,q)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,K),i=(i=Math.imul(g,z))+Math.imul(y,K)|0,s=Math.imul(y,z),n=n+Math.imul(l,V)|0,i=(i=i+Math.imul(l,q)|0)+Math.imul(b,V)|0,s=s+Math.imul(b,q)|0;var yt=(u+(n=n+Math.imul(h,G)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(d,G)|0))<<13)|0;u=((s=s+Math.imul(d,X)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(_,K),i=(i=Math.imul(_,z))+Math.imul(S,K)|0,s=Math.imul(S,z),n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(y,V)|0,s=s+Math.imul(y,q)|0,n=n+Math.imul(l,G)|0,i=(i=i+Math.imul(l,X)|0)+Math.imul(b,G)|0,s=s+Math.imul(b,X)|0;var vt=(u+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(d,Z)|0))<<13)|0;u=((s=s+Math.imul(d,J)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(I,K),i=(i=Math.imul(I,z))+Math.imul(A,K)|0,s=Math.imul(A,z),n=n+Math.imul(_,V)|0,i=(i=i+Math.imul(_,q)|0)+Math.imul(S,V)|0,s=s+Math.imul(S,q)|0,n=n+Math.imul(g,G)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(y,G)|0,s=s+Math.imul(y,X)|0,n=n+Math.imul(l,Z)|0,i=(i=i+Math.imul(l,J)|0)+Math.imul(b,Z)|0,s=s+Math.imul(b,J)|0;var _t=(u+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,$)|0))<<13)|0;u=((s=s+Math.imul(d,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(P,K),i=(i=Math.imul(P,z))+Math.imul(O,K)|0,s=Math.imul(O,z),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(A,V)|0,s=s+Math.imul(A,q)|0,n=n+Math.imul(_,G)|0,i=(i=i+Math.imul(_,X)|0)+Math.imul(S,G)|0,s=s+Math.imul(S,X)|0,n=n+Math.imul(g,Z)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(y,Z)|0,s=s+Math.imul(y,J)|0,n=n+Math.imul(l,$)|0,i=(i=i+Math.imul(l,tt)|0)+Math.imul(b,$)|0,s=s+Math.imul(b,tt)|0;var St=(u+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(d,rt)|0))<<13)|0;u=((s=s+Math.imul(d,nt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(R,K),i=(i=Math.imul(R,z))+Math.imul(M,K)|0,s=Math.imul(M,z),n=n+Math.imul(P,V)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(O,V)|0,s=s+Math.imul(O,q)|0,n=n+Math.imul(I,G)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(A,G)|0,s=s+Math.imul(A,X)|0,n=n+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,J)|0)+Math.imul(S,Z)|0,s=s+Math.imul(S,J)|0,n=n+Math.imul(g,$)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,$)|0,s=s+Math.imul(y,tt)|0,n=n+Math.imul(l,rt)|0,i=(i=i+Math.imul(l,nt)|0)+Math.imul(b,rt)|0,s=s+Math.imul(b,nt)|0;var wt=(u+(n=n+Math.imul(h,st)|0)|0)+((8191&(i=(i=i+Math.imul(h,ot)|0)+Math.imul(d,st)|0))<<13)|0;u=((s=s+Math.imul(d,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(T,K),i=(i=Math.imul(T,z))+Math.imul(B,K)|0,s=Math.imul(B,z),n=n+Math.imul(R,V)|0,i=(i=i+Math.imul(R,q)|0)+Math.imul(M,V)|0,s=s+Math.imul(M,q)|0,n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(O,G)|0,s=s+Math.imul(O,X)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(A,Z)|0,s=s+Math.imul(A,J)|0,n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(S,$)|0,s=s+Math.imul(S,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,s=s+Math.imul(y,nt)|0,n=n+Math.imul(l,st)|0,i=(i=i+Math.imul(l,ot)|0)+Math.imul(b,st)|0,s=s+Math.imul(b,ot)|0;var It=(u+(n=n+Math.imul(h,at)|0)|0)+((8191&(i=(i=i+Math.imul(h,ut)|0)+Math.imul(d,at)|0))<<13)|0;u=((s=s+Math.imul(d,ut)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(C,K),i=(i=Math.imul(C,z))+Math.imul(U,K)|0,s=Math.imul(U,z),n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,q)|0)+Math.imul(B,V)|0,s=s+Math.imul(B,q)|0,n=n+Math.imul(R,G)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(M,G)|0,s=s+Math.imul(M,X)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(O,Z)|0,s=s+Math.imul(O,J)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(A,$)|0,s=s+Math.imul(A,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(S,rt)|0,s=s+Math.imul(S,nt)|0,n=n+Math.imul(g,st)|0,i=(i=i+Math.imul(g,ot)|0)+Math.imul(y,st)|0,s=s+Math.imul(y,ot)|0,n=n+Math.imul(l,at)|0,i=(i=i+Math.imul(l,ut)|0)+Math.imul(b,at)|0,s=s+Math.imul(b,ut)|0;var At=(u+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;u=((s=s+Math.imul(d,dt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(H,K),i=(i=Math.imul(H,z))+Math.imul(D,K)|0,s=Math.imul(D,z),n=n+Math.imul(C,V)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(U,V)|0,s=s+Math.imul(U,q)|0,n=n+Math.imul(T,G)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(B,G)|0,s=s+Math.imul(B,X)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(M,Z)|0,s=s+Math.imul(M,J)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(O,$)|0,s=s+Math.imul(O,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(A,rt)|0,s=s+Math.imul(A,nt)|0,n=n+Math.imul(_,st)|0,i=(i=i+Math.imul(_,ot)|0)+Math.imul(S,st)|0,s=s+Math.imul(S,ot)|0,n=n+Math.imul(g,at)|0,i=(i=i+Math.imul(g,ut)|0)+Math.imul(y,at)|0,s=s+Math.imul(y,ut)|0,n=n+Math.imul(l,ht)|0,i=(i=i+Math.imul(l,dt)|0)+Math.imul(b,ht)|0,s=s+Math.imul(b,dt)|0;var Et=(u+(n=n+Math.imul(h,lt)|0)|0)+((8191&(i=(i=i+Math.imul(h,bt)|0)+Math.imul(d,lt)|0))<<13)|0;u=((s=s+Math.imul(d,bt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(H,V),i=(i=Math.imul(H,q))+Math.imul(D,V)|0,s=Math.imul(D,q),n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(U,G)|0,s=s+Math.imul(U,X)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(B,Z)|0,s=s+Math.imul(B,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(M,$)|0,s=s+Math.imul(M,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(O,rt)|0,s=s+Math.imul(O,nt)|0,n=n+Math.imul(I,st)|0,i=(i=i+Math.imul(I,ot)|0)+Math.imul(A,st)|0,s=s+Math.imul(A,ot)|0,n=n+Math.imul(_,at)|0,i=(i=i+Math.imul(_,ut)|0)+Math.imul(S,at)|0,s=s+Math.imul(S,ut)|0,n=n+Math.imul(g,ht)|0,i=(i=i+Math.imul(g,dt)|0)+Math.imul(y,ht)|0,s=s+Math.imul(y,dt)|0;var Pt=(u+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,bt)|0)+Math.imul(b,lt)|0))<<13)|0;u=((s=s+Math.imul(b,bt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(H,G),i=(i=Math.imul(H,X))+Math.imul(D,G)|0,s=Math.imul(D,X),n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(U,Z)|0,s=s+Math.imul(U,J)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(B,$)|0,s=s+Math.imul(B,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(M,rt)|0,s=s+Math.imul(M,nt)|0,n=n+Math.imul(P,st)|0,i=(i=i+Math.imul(P,ot)|0)+Math.imul(O,st)|0,s=s+Math.imul(O,ot)|0,n=n+Math.imul(I,at)|0,i=(i=i+Math.imul(I,ut)|0)+Math.imul(A,at)|0,s=s+Math.imul(A,ut)|0,n=n+Math.imul(_,ht)|0,i=(i=i+Math.imul(_,dt)|0)+Math.imul(S,ht)|0,s=s+Math.imul(S,dt)|0;var Ot=(u+(n=n+Math.imul(g,lt)|0)|0)+((8191&(i=(i=i+Math.imul(g,bt)|0)+Math.imul(y,lt)|0))<<13)|0;u=((s=s+Math.imul(y,bt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(H,Z),i=(i=Math.imul(H,J))+Math.imul(D,Z)|0,s=Math.imul(D,J),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(U,$)|0,s=s+Math.imul(U,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(B,rt)|0,s=s+Math.imul(B,nt)|0,n=n+Math.imul(R,st)|0,i=(i=i+Math.imul(R,ot)|0)+Math.imul(M,st)|0,s=s+Math.imul(M,ot)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ut)|0)+Math.imul(O,at)|0,s=s+Math.imul(O,ut)|0,n=n+Math.imul(I,ht)|0,i=(i=i+Math.imul(I,dt)|0)+Math.imul(A,ht)|0,s=s+Math.imul(A,dt)|0;var kt=(u+(n=n+Math.imul(_,lt)|0)|0)+((8191&(i=(i=i+Math.imul(_,bt)|0)+Math.imul(S,lt)|0))<<13)|0;u=((s=s+Math.imul(S,bt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(H,$),i=(i=Math.imul(H,tt))+Math.imul(D,$)|0,s=Math.imul(D,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(U,rt)|0,s=s+Math.imul(U,nt)|0,n=n+Math.imul(T,st)|0,i=(i=i+Math.imul(T,ot)|0)+Math.imul(B,st)|0,s=s+Math.imul(B,ot)|0,n=n+Math.imul(R,at)|0,i=(i=i+Math.imul(R,ut)|0)+Math.imul(M,at)|0,s=s+Math.imul(M,ut)|0,n=n+Math.imul(P,ht)|0,i=(i=i+Math.imul(P,dt)|0)+Math.imul(O,ht)|0,s=s+Math.imul(O,dt)|0;var Rt=(u+(n=n+Math.imul(I,lt)|0)|0)+((8191&(i=(i=i+Math.imul(I,bt)|0)+Math.imul(A,lt)|0))<<13)|0;u=((s=s+Math.imul(A,bt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(H,rt),i=(i=Math.imul(H,nt))+Math.imul(D,rt)|0,s=Math.imul(D,nt),n=n+Math.imul(C,st)|0,i=(i=i+Math.imul(C,ot)|0)+Math.imul(U,st)|0,s=s+Math.imul(U,ot)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ut)|0)+Math.imul(B,at)|0,s=s+Math.imul(B,ut)|0,n=n+Math.imul(R,ht)|0,i=(i=i+Math.imul(R,dt)|0)+Math.imul(M,ht)|0,s=s+Math.imul(M,dt)|0;var Mt=(u+(n=n+Math.imul(P,lt)|0)|0)+((8191&(i=(i=i+Math.imul(P,bt)|0)+Math.imul(O,lt)|0))<<13)|0;u=((s=s+Math.imul(O,bt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(H,st),i=(i=Math.imul(H,ot))+Math.imul(D,st)|0,s=Math.imul(D,ot),n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ut)|0)+Math.imul(U,at)|0,s=s+Math.imul(U,ut)|0,n=n+Math.imul(T,ht)|0,i=(i=i+Math.imul(T,dt)|0)+Math.imul(B,ht)|0,s=s+Math.imul(B,dt)|0;var xt=(u+(n=n+Math.imul(R,lt)|0)|0)+((8191&(i=(i=i+Math.imul(R,bt)|0)+Math.imul(M,lt)|0))<<13)|0;u=((s=s+Math.imul(M,bt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(H,at),i=(i=Math.imul(H,ut))+Math.imul(D,at)|0,s=Math.imul(D,ut),n=n+Math.imul(C,ht)|0,i=(i=i+Math.imul(C,dt)|0)+Math.imul(U,ht)|0,s=s+Math.imul(U,dt)|0;var Tt=(u+(n=n+Math.imul(T,lt)|0)|0)+((8191&(i=(i=i+Math.imul(T,bt)|0)+Math.imul(B,lt)|0))<<13)|0;u=((s=s+Math.imul(B,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(H,ht),i=(i=Math.imul(H,dt))+Math.imul(D,ht)|0,s=Math.imul(D,dt);var Bt=(u+(n=n+Math.imul(C,lt)|0)|0)+((8191&(i=(i=i+Math.imul(C,bt)|0)+Math.imul(U,lt)|0))<<13)|0;u=((s=s+Math.imul(U,bt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863;var Nt=(u+(n=Math.imul(H,lt))|0)+((8191&(i=(i=Math.imul(H,bt))+Math.imul(D,lt)|0))<<13)|0;return u=((s=Math.imul(D,bt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,a[0]=mt,a[1]=gt,a[2]=yt,a[3]=vt,a[4]=_t,a[5]=St,a[6]=wt,a[7]=It,a[8]=At,a[9]=Et,a[10]=Pt,a[11]=Ot,a[12]=kt,a[13]=Rt,a[14]=Mt,a[15]=xt,a[16]=Tt,a[17]=Bt,a[18]=Nt,0!==u&&(a[19]=u,r.length++),r};function l(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(p=d),s.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,e):r<63?d(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,s=0;s<r.length-1;s++){var o=i;i=0;for(var f=67108863&n,a=Math.min(s,e.length-1),u=Math.max(0,s-t.length+1);u<=a;u++){var c=s-u,h=(0|t.words[c])*(0|e.words[u]),d=67108863&h;f=67108863&(d=d+f|0),i+=(o=(o=o+(h/67108864|0)|0)+(d>>>26)|0)>>>26,o&=67108863}r.words[s]=f,n=o,o=i}return 0!==n?r.words[s]=n:r.length--,r.strip()}(this,t,e):l(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=s.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},b.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},b.prototype.permute=function(t,e,r,n,i,s){for(var o=0;o<s;o++)n[o]=e[t[o]],i[o]=r[t[o]]},b.prototype.transform=function(t,e,r,n,i,s){this.permute(s,t,e,r,n,i);for(var o=1;o<i;o<<=1)for(var f=o<<1,a=Math.cos(2*Math.PI/f),u=Math.sin(2*Math.PI/f),c=0;c<i;c+=f)for(var h=a,d=u,p=0;p<o;p++){var l=r[c+p],b=n[c+p],m=r[c+p+o],g=n[c+p+o],y=h*m-d*g;g=h*g+d*m,m=y,r[c+p]=l+m,n[c+p]=b+g,r[c+p+o]=l-m,n[c+p+o]=b-g,p!==f&&(y=a*h-u*d,d=a*d+u*h,h=y)}},b.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},b.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},b.prototype.convert13b=function(t,e,r,i){for(var s=0,o=0;o<e;o++)s+=0|t[o],r[2*o]=8191&s,s>>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*e;o<i;++o)r[o]=0;n(0===s),n(0==(-8192&s))},b.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;