text: !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("@pascalcoin-sbx/walletkeys.dat",[],e):"object"==typeof exports?exports["@pascalcoin-sbx/walletkeys.dat"]=e():t["@pascalcoin-sbx/walletkeys.dat"]=e()}("undefined"!=typeof self?self:this,function(){return function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},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 i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},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=35)}([function(t,e,r){const i=r(1),n=Symbol("buffer");class o{constructor(t){this[n]=Buffer.from(t)}static from(t,e="hex"){if(t instanceof o)return t;if(t instanceof Buffer)return new o(t);if(t instanceof Uint8Array)return new o(t);if("hex"===e)try{return o.fromHex(t)}catch(e){return o.fromString(t)}return o.fromString(t)}static empty(){return o.from([])}static fromHex(t,e=!0){if(t instanceof o)return t;if(t.length%2==1){if(e)throw new Error("Invalid hex - number of nibbles need to be divideable by 2");t=`0${t}`}if(t.length>0&&!1===/^[0-9a-fA-F]+$/.test(t))throw new Error("Invalid hex");return new o(Buffer.from(t,"hex"))}static fromString(t){return t instanceof o?t:new o(Buffer.from(t,"utf8"))}static fromInt(t,e=null){let r=parseInt(t,10).toString(16);const i=o.fromHex(r,!1);return null!==e&&i.length<e?i.prepend(o.fromHex("00".repeat(e-i.length))):i}toBinary(){return this[n].toString("binary")}toString(){return this[n].toString("utf8")}toHex(t=!1){return t?this[n].toString("hex").toLowerCase():this[n].toString("hex").toUpperCase()}toInt(){return parseInt(this.toHex(),16)}get length(){return this[n].length}get hexLength(){return 2*this.length}get buffer(){return Buffer.from(this[n].toString("hex"),"hex")}slice(t,e=null){return new o(null===e?this[n].slice(t):this[n].slice(t,e))}static concat(...t){return o.fromHex(t.reduce((t,e)=>t instanceof Object?`${t.toHex()}${e.toHex()}`:`${t}${e.toHex()}`))}append(t){return o.concat(this,o.from(t))}prepend(t){return o.concat(o.from(t),this)}equals(t){return 0===Buffer.compare(o.from(t).buffer,this.buffer)}readInt8(t,e=!0){return this[n][e?"readUInt8":"readInt8"](t)}readInt16(t,e=!0,r=i.detect()){const o=`read${e?"U":""}Int16${r}`;return this[n][o](t)}readInt32(t,e=!0,r=i.detect()){const o=`read${e?"U":""}Int32${r}`;return this[n][o](t)}static fromInt8(t,e=!0){const r=`write${e?"U":""}Int8`,i=Buffer.allocUnsafe(1);return i[r](t),new o(i)}static fromInt16(t,e=!0,r=i.detect()){const n=`write${e?"U":""}Int16${r}`,s=Buffer.allocUnsafe(2);return s[n](t),new o(s)}static fromInt32(t,e=!0,r=i.detect()){const n=`write${e?"U":""}Int32${r}`,s=Buffer.allocUnsafe(4);return s[n](t),new o(s)}split(t){let e=0,r=[];for(;e<this.length;e+=t)r.push(this.slice(e,e+t));return r}}t.exports=o},function(t,e){let r=null;class i{static get BIG_ENDIAN(){return"BE"}static get LITTLE_ENDIAN(){return"LE"}static detect(){if(null===r){const t=new ArrayBuffer(4),e=new Uint32Array(t),n=new Uint8Array(t);e[0]=3735928559,239===n[0]&&(r=i.LITTLE_ENDIAN),222===n[0]&&(r=i.BIG_ENDIAN)}return r}static isLittleEndian(){return i.detect()===i.LITTLE_ENDIAN}static isBigEndian(){return i.detect()===i.BIG_ENDIAN}}t.exports=i},function(t,e){const r=Symbol("id"),i=Symbol("fixed_value"),n=Symbol("has_fixed_value"),o=Symbol("description");t.exports=class{constructor(t=null){this[r]=t,this[n]=!1}get id(){return this[r]}get hasFixedValue(){return this[n]}get fixedValue(){return this[i]}get encodedSize(){throw new Error("Encoded size getter not implemented")}decodeFromBytes(t,e={},r=null){throw new Error("Missing implementation for decodeFromBytes.")}encodeToBytes(t){throw new Error("Missing implementation for encodeToBytes.")}withFixedValue(t){return this[i]=t,this[n]=!0,this}description(t=null){return null===t?this[o]:(void 0===this[o]&&(this[o]=[]),this[o].push(t),this)}get canDecode(){return!0}}},function(t,e,r){const i=r(5),n=r(0);t.exports=class extends i{constructor(t,e,r){super(t||"int32",e,r),this.description("4byte 32bit int value")}get encodedSize(){return 4}decodeFromBytes(t,e={},r=null){return n.from(t).readInt32(0,this.unsigned,this.endian)}encodeToBytes(t){return n.fromInt32(t,this.unsigned,this.endian)}}},function(t,e,r){const i=r(0),n=r(2),o=Symbol("subtypes"),s=Symbol("size_encoded");t.exports=class extends n{constructor(t){super(t||"composite_type"),super.description("A type that itself is made up of multiple other types."),this[o]=[]}get subTypes(){return this[o]}get encodedSize(){return this[s]}addSubType(t){return this[o].push(t),this}decodeFromBytes(t,e={toArray:!1},r=null){if(!1===this.canDecode)throw new Error("This type cannot be decoded.");const n={};let o=0;return t=i.from(t),this.subTypes.forEach(r=>{n[r.id]=r.decodeFromBytes(t.slice(o),e,n),o+=r.encodedSize}),this[s]=o,e.toArray?Object.values(n):n}encodeToBytes(t){let e=i.empty();return this.subTypes.forEach((r,i)=>{let n;n=r.hasFixedValue?r.fixedValue:Array.isArray(t)?t[i]:t[r.id],e=e.append(r.encodeToBytes(n,t))}),this[s]=e.length,e}}},function(t,e,r){const i=r(2),n=Symbol("endian"),o=Symbol("unsigned");t.exports=class extends i{constructor(t,e,r){super(t),this[o]=e,this[n]=r}get endian(){return this[n]}get unsigned(){return this[o]}}},function(t,e,r){const i=r(5),n=r(0);t.exports=class extends i{constructor(t,e,r){super(t||"int16",e,r),this.description("2byte 16bit int value")}get encodedSize(){return 2}decodeFromBytes(t,e={},r=null){return n.from(t).readInt16(0,this.unsigned,this.endian)}encodeToBytes(t){return n.fromInt16(t,this.unsigned,this.endian)}}},function(t,e,r){const i=r(5),n=r(1),o=r(0);t.exports=class extends i{constructor(t,e){super(t||"int8",e,n.LITTLE_ENDIAN),this.description("1byte 8bit int value")}get encodedSize(){return 1}decodeFromBytes(t,e={},r=null){return o.from(t).readInt8(0,this.unsigned)}encodeToBytes(t){return o.fromInt8(t,this.unsigned)}}},function(t,e,r){t.exports={Base58:r(18),BC:r(0),Endian:r(1),PascalCoinInfo:r(20),Sha:r(22),Util:r(24),Types:r(43),Coding:r(46)}},function(t,e,r){const i=r(21),n=Symbol("value");function o(t){let e=new i(10).pow(new i(4)),r=t.divmod(e),n=r.mod.toString(10,4),o=r.div.toString(),s=!1;return"-"===t.toString().substr(0,1)&&("-"===o.substr(0,1)&&(o=o.substr(1)),"-"===n.substr(0,1)&&(n=n.substr(1)),s=!0),`${s?"-":""}${o}.${n}`}class s{constructor(t){let e=t;if(e instanceof s)return void(this[n]=e.value);if(i.isBN(e))return void(this[n]=e);e=(e=e.toString()).split(",").join("");const r=new i(10).pow(new i(4));let o="-"===e.substring(0,1);if(o&&(e=e.substring(1)),"."===e)throw new Error(`Invalid value ${e} cannot be converted to`+" base unit with 4 decimals.");let h=e.split(".");if(h.length>2)throw new Error("Too many decimal points");let u=h[0],a=h[1];if(u||(u="0"),a||(a="0"),a.length>4)throw new Error("Too many decimal places");for(;a.length<4;)a+="0";u=new i(u),a=new i(a);let l=u.mul(r).add(a);o&&(l=l.neg()),this[n]=new i(l.toString(10),10)}static fromMolina(t){return new s(new i(t.toString()))}get value(){return this[n]}toString(){return o(this[n])}isVague(){return this.toStringOpt(5)!==this.toStringOpt(4)}toStringOpt(t=4){return o(this[n]).replace(new RegExp("[0]+$"),"").replace(new RegExp("[.]+$"),"")}toMolina(){return this[n].toString()}add(t){return new s(this.value.add(new s(t).value))}mul(t){return s.fromMolina(this.value.mul(new i(t)))}sub(t){return new s(this.value.sub(new s(t).value))}toPositive(){return!0===this[n].isNeg()?new s(this[n].neg()):this}eq(t){return this[n].eq(new s(t).value)}gt(t){return this[n].gt(new s(t).value)}lt(t){return this[n].lt(new s(t).value)}lteq(t){return this[n].lte(new s(t).value)}gteq(t){return this[n].gte(new s(t).value)}get bn(){return this[n]}serialize(){return{pascal:this.toStringOpt(),molina:this.toMolina()}}}t.exports=s},function(t,e,r){const i=r(20),n=Symbol("account"),o=Symbol("checksum"),s=Symbol("created_in_block"),h=Symbol("is_foundation_reward");class u{constructor(t){if(t instanceof u)this[n]=t[n],this[o]=t[o];else if("string"==typeof t){const e=t.split("-");if(e.map(t=>{if(isNaN(t)||parseInt(t,10).toString()!==t)throw new Error(`Invalid account number part: ${t}`)}),2===e.length){if(this[n]=parseInt(e[0],10),this[o]=parseInt(e[1],10),this[o]!==u.calculateChecksum(this[n]))throw new Error(`Invalid checksum for account ${this[n]}`)}else this[n]=parseInt(t,10),this[o]=u.calculateChecksum(this[n])}else{if("number"!=typeof t)throw new Error(`Unable to parse Account: ${t.toString()}`);this[n]=t,this[o]=u.calculateChecksum(this[n])}this[s]=Math.floor(this[n]/5),this[h]=i.isDeveloperReward(this[s])&&this[n]%5==4}get account(){return this[n]}get checksum(){return this[o]}get createdInBlock(){return this[s]}get isFoundationReward(){return this[h]}toString(){return`${this.account}-${this.checksum}`}equals(t){return null!==t&&this.toString()===t.toString()}static calculateChecksum(t){return 101*t%89+10}}t.exports=u},function(t,e){const r={0:"empty",714:"secp256k1",715:"p384",729:"sect283k1",716:"p521"},i={714:{x:32,y:32},715:{x:48,y:48},716:{x:66,y:66},729:{x:36,y:36},0:{x:0,y:0}},n={714:32,715:48,716:66,729:36},o=Symbol("id"),s=Symbol("name");class h{static get CN_SECP256K1(){return"secp256k1"}static get CN_P384(){return"p384"}static get CN_SECT283K1(){return"sect283k1"}static get CN_P521(){return"p521"}static get CI_SECP256K1(){return 714}static get CI_P384(){return 715}static get CI_SECT283K1(){return 729}static get CI_P521(){return 716}constructor(t){if("number"==typeof t){if(void 0===r[t])throw new Error(`Unknown curve: ${t}`);this[o]=t,this[s]=r[t]}else{if(-1===Object.values(r).indexOf(t.toString()))throw new Error(`Unknown curve: ${t}`);this[s]=t.toString(),this[o]=parseInt(Object.keys(r)[Object.values(r).indexOf(this[s])],10)}}get id(){return this[o]}get name(){return this[s]}toString(){return this.name}static getDefaultCurve(){return new h(h.CI_SECP256K1)}xylPublicKey(t){return i[this.id][t]}lPrivateKey(){return n[this.id]}get supported(){return this.id!==h.CI_SECT283K1&&0!==this.id}}t.exports=h},function(t,e,r){const i=r(2),n=r(7),o=r(6),s=r(3),h=r(13),u=r(1),a=r(0),l=Symbol("size_encoded"),c=Symbol("length_field"),d=Symbol("bytes_field"),f=Symbol("has_leading_zerobyte");t.exports=class extends i{constructor(t,e=1,r="length",i=null,a=u.LITTLE_ENDIAN,l=!1){switch(super(t||`bytes_with_length_${8*e}`),this.description("Bytes with variable size prepended"),this[d]=new h("value"),this[f]=l,e){case 1:this[c]=new n(r,!0);break;case 2:this[c]=new o(r,!0,a);break;case 4:this[c]=new s(r,!0,a);break;default:throw new Error("ByteSize must be either 1, 2 or 4")}null!==i&&this[c].description(i)}get encodedSize(){return this[l]}decodeFromBytes(t,e={},r=null){return this[l]=this[c].encodedSize+this[c].decodeFromBytes(a.from(t))+ +this[f],this[d].decodeFromBytes(t.slice(this[c].encodedSize+ +this[f],this[l]))}encodeToBytes(t){return t=a.from(t),this[l]=t.length+this[c].encodedSize,this[c].encodeToBytes(this[l]-this[c].encodedSize).append(this[d].encodeToBytes(t))}get lengthField(){return this[c]}}},function(t,e,r){const i=r(2),n=r(0),o=Symbol("size_encoded");t.exports=class extends i{constructor(t=null){super(t||"bytes_without_length"),this.description("Bytes without length prepended.")}get encodedSize(){return this[o]}decodeFromBytes(t,e={},r=null){return this[o]=t.length,t}encodeToBytes(t){let e=n.from(t);return this[o]=e.length,e}}},function(t,e,r){const i=r(11),n=r(1),o=r(6);t.exports=class extends o{constructor(t=null){super(t||"curve",!0,n.LITTLE_ENDIAN),this.description("Key curve id")}decodeFromBytes(t,e={},r=null){return new i(super.decodeFromBytes(t))}encodeToBytes(t){return super.encodeToBytes(t.id)}}},function(t,e){const r=Symbol("magic"),i=Symbol("version"),n=Symbol("keys");t.exports=class{constructor(t,e){this[r]=t,this[i]=e,this[n]=[]}get magic(){return this[r]}get version(){return this[i]}get countKeys(){return this[n].length}get keys(){return this[n]}addKey(t){this[n].push(t)}}},function(t,e){const r=Symbol("name"),i=Symbol("public_key"),n=Symbol("encrypted_private_key");t.exports=class{constructor(t,e,o){this[r]=t,this[i]=e,this[n]=o}get name(){return this[r]}get publicKey(){return this[i]}get encryptedPrivateKey(){return this[n]}}},function(t,e,r){const i=r(8).Coding,n=r(16),o=i.CompositeType;t.exports=class extends o{constructor(t=null){super(t||"walletkeys.dat_key"),this.description("The coder for a key entry in the walletkeys.dat file from the classic wallet."),this.addSubType(new i.Core.StringWithLength("name",2,"name_length","Length of the key name").description("The name of the key.")),this.addSubType(new i.Pascal.Keys.PublicKey("publicKey").description("The public key")),this.addSubType(new i.Core.BytesWithLength("encryptedPrivateKey",2,"encryptedPrivateKeyLength","Length of crypted").description("The crypted key"))}decodeFromBytes(t,e={},r=null){const i=super.decodeFromBytes(t,e,r);return new n(i.name,i.publicKey,i.encryptedPrivateKey)}}},function(t,e,r){"use strict";const i=r(37),n=r(0);t.exports=class{static encode(t){return i.encode(n.from(t).buffer)}static decode(t){return new n(i.decode(t))}}},function(t,e){t.exports=require("buffer")},function(t,e,r){const i=r(9);class n{static MIN_FEE(t=null){return i.fromMolina(1)}static get PIP_0010(){return 210240}static get INFLATION_REDUCTION(){return n.PIP_0010}static isInflationReduction(t){return t>=n.INFLATION_REDUCTION}static get PIP_0009(){return 26e4}static get RANDOM_HASH(){return n.PIP_0009}static isRandomHash(t){return t>=n.RANDOM_HASH}static get PIP_0011(){return 21e4}static get DEVELOPER_REWARD(){return n.PIP_0011}static isDeveloperReward(t){return t>=n.DEVELOPER_REWARD}static get MAX_PAYLOAD_LENGTH(){return 255}}t.exports=n},function(t,e,r){(function(t){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(19).Buffer}catch(t){}function h(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o<n;o++){var s=t.charCodeAt(o)-48;i<<=4,i|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function u(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s<o;s++){var h=t.charCodeAt(s)-48;n*=i,n+=h>=49?h-49+10:h>=17?h-17+10:h}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("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 n=0;n<this.length;n++)this.words[n]=0;var o,s,h=0;if("be"===r)for(n=t.length-1,o=0;n>=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<<h&67108863,this.words[o+1]=s>>>26-h&67108863,(h+=24)>=26&&(h-=26,o++);else if("le"===r)for(n=0,o=0;n<t.length;n+=3)s=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[o]|=s<<h&67108863,this.words[o+1]=s>>>26-h&67108863,(h+=24)>=26&&(h-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,n,o=0;for(r=t.length-6,i=0;r>=e;r-=6)n=h(t,r,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=h(t,e,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,h=Math.min(o,o-s)+r,a=0,l=r;l<h;l+=i)a=u(t,l,l+i,e),this.imuln(n),this.words[0]+a<67108864?this.words[0]+=a:this._iaddn(a);if(0!==s){var c=1;for(a=u(t,l,t.length,e),l=0;l<s;l++)c*=e;this.imuln(c),this.words[0]+a<67108864?this.words[0]+=a:this._iaddn(a)}},o.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},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var a=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,h=67108863&s,u=s/67108864|0;r.words[0]=h;for(var a=1;a<i;a++){for(var l=u>>>26,c=67108863&u,d=Math.min(a,e.length-1),f=Math.max(0,a-t.length+1);f<=d;f++){var m=a-f|0;l+=(s=(n=0|t.words[m])*(o=0|e.words[f])+c)/67108864|0,c=67108863&s}r.words[a]=0|c,u=0|l}return 0!==u?r.words[a]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s<this.length;s++){var h=this.words[s],u=(16777215&(h<<n|o)).toString(16);r=0!==(o=h>>>24-n&16777215)||s!==this.length-1?a[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var d=l[t],f=c[t];r="";var m=this.clone();for(m.negative=0;!m.isZero();){var p=m.modn(f).toString(t);r=(m=m.idivn(f)).isZero()?p+r:a[d-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,h,u="le"===e,a=new t(o),l=this.clone();if(u){for(h=0;!l.isZero();h++)s=l.andln(255),l.iushrn(8),a[h]=s;for(;h<o;h++)a[h]=0}else{for(h=0;h<o-n;h++)a[h]=0;for(h=0;!l.isZero();h++)s=l.andln(255),l.iushrn(8),a[o-h-1]=s}return a},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.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},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(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()},o.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},o.prototype.iadd=function(t){var e,r,i;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,i=t):(r=t,i=this);for(var n=0,o=0;o<i.length;o++)e=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<r.length;o++)e=(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.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)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s<i.length;s++)o=(e=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var f=function(t,e,r){var i,n,o,s=t.words,h=e.words,u=r.words,a=0,l=0|s[0],c=8191&l,d=l>>>13,f=0|s[1],m=8191&f,p=f>>>13,g=0|s[2],y=8191&g,v=g>>>13,w=0|s[3],M=8191&w,b=w>>>13,x=0|s[4],S=8191&x,_=x>>>13,A=0|s[5],T=8191&A,B=A>>>13,I=0|s[6],E=8191&I,k=I>>>13,C=0|s[7],N=8191&C,L=C>>>13,z=0|s[8],P=8191&z,F=z>>>13,O=0|s[9],U=8191&O,K=O>>>13,R=0|h[0],$=8191&R,D=R>>>13,H=0|h[1],q=8191&H,j=H>>>13,Z=0|h[2],V=8191&Z,W=Z>>>13,X=0|h[3],G=8191&X,Y=X>>>13,J=0|h[4],Q=8191&J,tt=J>>>13,et=0|h[5],rt=8191&et,it=et>>>13,nt=0|h[6],ot=8191&nt,st=nt>>>13,ht=0|h[7],ut=8191&ht,at=ht>>>13,lt=0|h[8],ct=8191&lt,dt=lt>>>13,ft=0|h[9],mt=8191&ft,pt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(a+(i=Math.imul(c,$))|0)+((8191&(n=(n=Math.imul(c,D))+Math.imul(d,$)|0))<<13)|0;a=((o=Math.imul(d,D))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(m,$),n=(n=Math.imul(m,D))+Math.imul(p,$)|0,o=Math.imul(p,D);var yt=(a+(i=i+Math.imul(c,q)|0)|0)+((8191&(n=(n=n+Math.imul(c,j)|0)+Math.imul(d,q)|0))<<13)|0;a=((o=o+Math.imul(d,j)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(y,$),n=(n=Math.imul(y,D))+Math.imul(v,$)|0,o=Math.imul(v,D),i=i+Math.imul(m,q)|0,n=(n=n+Math.imul(m,j)|0)+Math.imul(p,q)|0,o=o+Math.imul(p,j)|0;var vt=(a+(i=i+Math.imul(c,V)|0)|0)+((8191&(n=(n=n+Math.imul(c,W)|0)+Math.imul(d,V)|0))<<13)|0;a=((o=o+Math.imul(d,W)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(M,$),n=(n=Math.imul(M,D))+Math.imul(b,$)|0,o=Math.imul(b,D),i=i+Math.imul(y,q)|0,n=(n=n+Math.imul(y,j)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,j)|0,i=i+Math.imul(m,V)|0,n=(n=n+Math.imul(m,W)|0)+Math.imul(p,V)|0,o=o+Math.imul(p,W)|0;var wt=(a+(i=i+Math.imul(c,G)|0)|0)+((8191&(n=(n=n+Math.imul(c,Y)|0)+Math.imul(d,G)|0))<<13)|0;a=((o=o+Math.imul(d,Y)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(S,$),n=(n=Math.imul(S,D))+Math.imul(_,$)|0,o=Math.imul(_,D),i=i+Math.imul(M,q)|0,n=(n=n+Math.imul(M,j)|0)+Math.imul(b,q)|0,o=o+Math.imul(b,j)|0,i=i+Math.imul(y,V)|0,n=(n=n+Math.imul(y,W)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,W)|0,i=i+Math.imul(m,G)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(p,G)|0,o=o+Math.imul(p,Y)|0;var Mt=(a+(i=i+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;a=((o=o+Math.imul(d,tt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(T,$),n=(n=Math.imul(T,D))+Math.imul(B,$)|0,o=Math.imul(B,D),i=i+Math.imul(S,q)|0,n=(n=n+Math.imul(S,j)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,j)|0,i=i+Math.imul(M,V)|0,n=(n=n+Math.imul(M,W)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,W)|0,i=i+Math.imul(y,G)|0,n=(n=n+Math.imul(y,Y)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,Y)|0,i=i+Math.imul(m,Q)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(p,Q)|0,o=o+Math.imul(p,tt)|0;var bt=(a+(i=i+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,it)|0)+Math.imul(d,rt)|0))<<13)|0;a=((o=o+Math.imul(d,it)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(E,$),n=(n=Math.imul(E,D))+Math.imul(k,$)|0,o=Math.imul(k,D),i=i+Math.imul(T,q)|0,n=(n=n+Math.imul(T,j)|0)+Math.imul(B,q)|0,o=o+Math.imul(B,j)|0,i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,W)|0,i=i+Math.imul(M,G)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,Y)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,i=i+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(p,rt)|0,o=o+Math.imul(p,it)|0;var xt=(a+(i=i+Math.imul(c,ot)|0)|0)+((8191&(n=(n=n+Math.imul(c,st)|0)+Math.imul(d,ot)|0))<<13)|0;a=((o=o+Math.imul(d,st)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(N,$),n=(n=Math.imul(N,D))+Math.imul(L,$)|0,o=Math.imul(L,D),i=i+Math.imul(E,q)|0,n=(n=n+Math.imul(E,j)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,j)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,W)|0,i=i+Math.imul(S,G)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,Y)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0,i=i+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,it)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,it)|0,i=i+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,st)|0)+Math.imul(p,ot)|0,o=o+Math.imul(p,st)|0;var St=(a+(i=i+Math.imul(c,ut)|0)|0)+((8191&(n=(n=n+Math.imul(c,at)|0)+Math.imul(d,ut)|0))<<13)|0;a=((o=o+Math.imul(d,at)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(P,$),n=(n=Math.imul(P,D))+Math.imul(F,$)|0,o=Math.imul(F,D),i=i+Math.imul(N,q)|0,n=(n=n+Math.imul(N,j)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,j)|0,i=i+Math.imul(E,V)|0,n=(n=n+Math.imul(E,W)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,W)|0,i=i+Math.imul(T,G)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,Y)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,i=i+Math.imul(M,rt)|0,n=(n=n+Math.imul(M,it)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,it)|0,i=i+Math.imul(y,ot)|0,n=(n=n+Math.imul(y,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,i=i+Math.imul(m,ut)|0,n=(n=n+Math.imul(m,at)|0)+Math.imul(p,ut)|0,o=o+Math.imul(p,at)|0;var _t=(a+(i=i+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;a=((o=o+Math.imul(d,dt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(U,$),n=(n=Math.imul(U,D))+Math.imul(K,$)|0,o=Math.imul(K,D),i=i+Math.imul(P,q)|0,n=(n=n+Math.imul(P,j)|0)+Math.imul(F,q)|0,o=o+Math.imul(F,j)|0,i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,W)|0,i=i+Math.imul(E,G)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,Y)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,i=i+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,i=i+Math.imul(y,ut)|0,n=(n=n+Math.imul(y,at)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,at)|0,i=i+Math.imul(m,ct)|0,n=(n=n+Math.imul(m,dt)|0)+Math.imul(p,ct)|0,o=o+Math.imul(p,dt)|0;var At=(a+(i=i+Math.imul(c,mt)|0)|0)+((8191&(n=(n=n+Math.imul(c,pt)|0)+Math.imul(d,mt)|0))<<13)|0;a=((o=o+Math.imul(d,pt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(U,q),n=(n=Math.imul(U,j))+Math.imul(K,q)|0,o=Math.imul(K,j),i=i+Math.imul(P,V)|0,n=(n=n+Math.imul(P,W)|0)+Math.imul(F,V)|0,o=o+Math.imul(F,W)|0,i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,Y)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,i=i+Math.imul(M,ut)|0,n=(n=n+Math.imul(M,at)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,at)|0,i=i+Math.imul(y,ct)|0,n=(n=n+Math.imul(y,dt)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,dt)|0;var Tt=(a+(i=i+Math.imul(m,mt)|0)|0)+((8191&(n=(n=n+Math.imul(m,pt)|0)+Math.imul(p,mt)|0))<<13)|0;a=((o=o+Math.imul(p,pt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(U,V),n=(n=Math.imul(U,W))+Math.imul(K,V)|0,o=Math.imul(K,W),i=i+Math.imul(P,G)|0,n=(n=n+Math.imul(P,Y)|0)+Math.imul(F,G)|0,o=o+Math.imul(F,Y)|0,i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,st)|0,i=i+Math.imul(S,ut)|0,n=(n=n+Math.imul(S,at)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,at)|0,i=i+Math.imul(M,ct)|0,n=(n=n+Math.imul(M,dt)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,dt)|0;var Bt=(a+(i=i+Math.imul(y,mt)|0)|0)+((8191&(n=(n=n+Math.imul(y,pt)|0)+Math.imul(v,mt)|0))<<13)|0;a=((o=o+Math.imul(v,pt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(U,G),n=(n=Math.imul(U,Y))+Math.imul(K,G)|0,o=Math.imul(K,Y),i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(F,Q)|0,o=o+Math.imul(F,tt)|0,i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,i=i+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,at)|0)+Math.imul(B,ut)|0,o=o+Math.imul(B,at)|0,i=i+Math.imul(S,ct)|0,n=(n=n+Math.imul(S,dt)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,dt)|0;var It=(a+(i=i+Math.imul(M,mt)|0)|0)+((8191&(n=(n=n+Math.imul(M,pt)|0)+Math.imul(b,mt)|0))<<13)|0;a=((o=o+Math.imul(b,pt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(U,Q),n=(n=Math.imul(U,tt))+Math.imul(K,Q)|0,o=Math.imul(K,tt),i=i+Math.imul(P,rt)|0,n=(n=n+Math.imul(P,it)|0)+Math.imul(F,rt)|0,o=o+Math.imul(F,it)|0,i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,i=i+Math.imul(E,ut)|0,n=(n=n+Math.imul(E,at)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,at)|0,i=i+Math.imul(T,ct)|0,n=(n=n+Math.imul(T,dt)|0)+Math.imul(B,ct)|0,o=o+Math.imul(B,dt)|0;var Et=(a+(i=i+Math.imul(S,mt)|0)|0)+((8191&(n=(n=n+Math.imul(S,pt)|0)+Math.imul(_,mt)|0))<<13)|0;a=((o=o+Math.imul(_,pt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(U,rt),n=(n=Math.imul(U,it))+Math.imul(K,rt)|0,o=Math.imul(K,it),i=i+Math.imul(P,ot)|0,n=(n=n+Math.imul(P,st)|0)+Math.imul(F,ot)|0,o=o+Math.imul(F,st)|0,i=i+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,at)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,at)|0,i=i+Math.imul(E,ct)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(k,ct)|0,o=o+Math.imul(k,dt)|0;var kt=(a+(i=i+Math.imul(T,mt)|0)|0)+((8191&(n=(n=n+Math.imul(T,pt)|0)+Math.imul(B,mt)|0))<<13)|0;a=((o=o+Math.imul(B,pt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(U,ot),n=(n=Math.imul(U,st))+Math.imul(K,ot)|0,o=Math.imul(K,st),i=i+Math.imul(P,ut)|0,n=(n=n+Math.imul(P,at)|0)+Math.imul(F,ut)|0,o=o+Math.imul(F,at)|0,i=i+Math.imul(N,ct)|0,n=(n=n+Math.imul(N,dt)|0)+Math.imul(L,ct)|0,o=o+Math.imul(L,dt)|0;var Ct=(a+(i=i+Math.imul(E,mt)|0)|0)+((8191&(n=(n=n+Math.imul(E,pt)|0)+Math.imul(k,mt)|0))<<13)|0;a=((o=o+Math.imul(k,pt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,i=Math.imul(U,ut),n=(n=Math.imul(U,at))+Math.imul(K,ut)|0,o=Math.imul(K,at),i=i+Math.imul(P,ct)|0,n=(n=n+Math.imul(P,dt)|0)+Math.imul(F,ct)|0,o=o+Math.imul(F,dt)|0;var Nt=(a+(i=i+Math.imul(N,mt)|0)|0)+((8191&(n=(n=n+Math.imul(N,pt)|0)+Math.imul(L,mt)|0))<<13)|0;a=((o=o+Math.imul(L,pt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(U,ct),n=(n=Math.imul(U,dt))+Math.imul(K,ct)|0,o=Math.imul(K,dt);var Lt=(a+(i=i+Math.imul(P,mt)|0)|0)+((8191&(n=(n=n+Math.imul(P,pt)|0)+Math.imul(F,mt)|0))<<13)|0;a=((o=o+Math.imul(F,pt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var zt=(a+(i=Math.imul(U,mt))|0)+((8191&(n=(n=Math.imul(U,pt))+Math.imul(K,mt)|0))<<13)|0;return a=((o=Math.imul(K,pt))+(n>>>13)|0)+(zt>>>26)|0,zt&=67108863,u[0]=gt,u[1]=yt,u[2]=vt,u[3]=wt,u[4]=Mt,u[5]=bt,u[6]=xt,u[7]=St,u[8]=_t,u[9]=At,u[10]=Tt,u[11]=Bt,u[12]=It,u[13]=Et,u[14]=kt,u[15]=Ct,u[16]=Nt,u[17]=Lt,u[18]=zt,0!==a&&(u[19]=a,r.length++),r};function m(t,e,r){return(new p).mulp(t,e,r)}function p(t,e){this.x=t,this.y=e}Math.imul||(f=d),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?f(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 i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var h=67108863&i,u=Math.min(o,e.length-1),a=Math.max(0,o-t.length+1);a<=u;a++){var l=o-a,c=(0|t.words[l])*(0|e.words[a]),d=67108863&c;h=67108863&(d=d+h|0),n+=(s=(s=s+(c/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=h,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):m(this,t,e)},p.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},p.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},p.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s<o;s++)i[s]=e[t[s]],n[s]=r[t[s]]},p.prototype.transform=function(t,e,r,i,n,o){this.permute(o,t,e,r,i,n);for(var s=1;s<n;s<<=1)for(var h=s<<1,u=Math.cos(2*Math.PI/h),a=Math.sin(2*Math.PI/h),l=0;l<n;l+=h)for(var c=u,d=a,f=0;f<s;f++){var m=r[l+f],p=i[l+f],g=r[l+f+s],y=i[l+f+s],v=c*g-d*y;y=c*y+d*g,g=v,r[l+f]=m+g,i[l+f]=p+y,r[l+f+s]=m-g,i[l+f+s]=p-y,f!==h&&(v=u*c-a*d,d=u*d+a*c,c=v)}},p.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},p.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},p.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=67108863&n,r=n<67108864?0:n/67108864|0}return t},p.prototype.convert13b=function(t,e,r,n){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<n;++s)r[s]=0;i(0===o),i(0==(-8192&o))},p.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},p.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),h=new Array(i),u=new Array(i),a=new Array(i),l=new Array(i),c=new Array(i),d=r.words;d.length=i,this.convert13b(t.words,t.length,s,i),this.convert13b(e.words,e.length,a,i),this.transform(s,o,h,u,i,n),this.transform(a,o,l,c,i,n);for(var f=0;f<i;f++){var m=h[f]*l[f]-u[f]*c[f];u[f]=h[f]*c[f]+u[f]*l[f],h[f]=m}return this.conjugate(h,u,i),this.transform(h,u,d,o,i,n),this.conjugate(d,o,i),this.normalize13b(d,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),m(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,o=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var n=r.sqr();i<e.length;i++,n=n.sqr())0!==e[i]&&(r=r.mul(n));return r},o.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var h=this.words[e]&o,u=(0|this.words[e])-h<<r;this.words[e]=u|s,s=h>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},o.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var n;i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),h=67108863^67108863>>>o<<o,u=r;if(n-=s,n=Math.max(0,n),u){for(var a=0;a<s;a++)u.words[a]=this.words[a];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,a=0;a<this.length;a++)this.words[a]=this.words[a+s];else this.words[0]=0,this.length=1;var l=0;for(a=this.length-1;a>=0&&(0!==l||a>=n);a--){var c=0|this.words[a];this.words[a]=l<<26-o|c>>>o,l=c&h}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r)&&!!(this.words[r]&n)},o.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return i("number"==typeof t),i(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var n,o,s=t.length+r;this._expand(s);var h=0;for(n=0;n<t.length;n++){o=(0|this.words[n+r])+h;var u=(0|t.words[n])*e;h=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)h=(o=(0|this.words[n+r])+h)>>26,this.words[n+r]=67108863&o;if(0===h)return this.strip();for(i(-1===h),h=0,n=0;n<this.length;n++)h=(o=-(0|this.words[n])+h)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!==(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var h,u=i.length-n.length;if("mod"!==e){(h=new o(null)).length=u+1,h.words=new Array(h.length);for(var a=0;a<h.length;a++)h.words[a]=0}var l=i.clone()._ishlnsubmul(n,1,u);0===l.negative&&(i=l,h&&(h.words[u]=1));for(var c=u-1;c>=0;c--){var d=67108864*(0|i.words[n.length+c])+(0|i.words[n.length+c-1]);for(d=Math.min(d/s|0,67108863),i._ishlnsubmul(n,d,c);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(n,1,c),i.isZero()||(i.negative^=1);h&&(h.words[c]=d)}return h&&h.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:h||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(h=this.neg().divmod(t,e),"mod"!==e&&(n=h.div.neg()),"div"!==e&&(s=h.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(h=this.divmod(t.neg(),e),"mod"!==e&&(n=h.div.neg()),{div:n,mod:h.mod}):0!=(this.negative&t.negative)?(h=this.neg().divmod(t.neg(),e),"div"!==e&&(s=h.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:h.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,h},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),h=new o(0),u=new o(1),a=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++a;for(var l=r.clone(),c=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(l),s.isub(c)),n.iushrn(1),s.iushrn(1);for(var m=0,p=1;0==(r.words[0]&p)&&m<26;++m,p<<=1);if(m>0)for(r.iushrn(m);m-- >0;)(h.isOdd()||u.isOdd())&&(h.iadd(l),u.isub(c)),h.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(h),s.isub(u)):(r.isub(e),h.isub(n),u.isub(s))}return{a:h,b:u,gcd:r.iushln(a)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),h=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var a=0,l=1;0==(e.words[0]&l)&&a<26;++a,l<<=1);if(a>0)for(e.iushrn(a);a-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,d=1;0==(r.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(r.iushrn(c);c-- >0;)h.isOdd()&&h.iadd(u),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(h)):(r.isub(e),h.isub(s))}return(n=0===e.cmpn(1)?s:h).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,s=r;0!==o&&s<this.length;s++){var h=0|this.words[s];o=(h+=o)>>>26,h&=67108863,this.words[s]=h}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function b(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},n(v,y),v.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i<r;i++)e.words[i]=t.words[i];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(e.words[e.length++]=4194303&n,i=10;i<t.length;i++){var o=0|t.words[i];t.words[i-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(w,y),n(M,y),n(b,y),b.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new b}return g[t]=e,e},x.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var h=new o(1).toRed(this),u=h.redNeg(),a=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,a).cmp(u);)l.redIAdd(u);for(var c=this.pow(l,n),d=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),m=s;0!==f.cmp(h);){for(var p=f,g=0;0!==p.cmp(h);g++)p=p.redSqr();i(g<m);var y=this.pow(c,new o(1).iushln(m-g-1));d=d.redMul(y),c=y.redSqr(),f=f.redMul(c),m=g}return d},x.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},x.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var n=r[0],s=0,h=0,u=e.bitLength()%26;for(0===u&&(u=26),i=e.length-1;i>=0;i--){for(var a=e.words[i],l=u-1;l>=0;l--){var c=a>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==c||0!==s?(s<<=1,s|=c,(4===++h||0===i&&0===l)&&(n=this.mul(n,r[s]),h=0,s=0)):h=0}u=26}return n},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},n(S,x),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(40)(t))},function(t,e,r){"use strict";const i=r(41),n=r(42),o=r(0);t.exports=class{static sha256(...t){const e=new i.SHA256;return t.forEach(t=>e.update(t.buffer)),new o(Buffer.from(e.digest()))}static sha512(...t){const e=new n.SHA512;return t.forEach(t=>e.update(t.buffer)),new o(Buffer.from(e.digest()))}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version="1.1.4",function(t){t.str2bin=function(t){t=t.replace(/\r\n/g,"\n");for(var e=new Uint8Array(3*t.length),r=0,i=0,n=t.length;i<n;i++){var o=t.charCodeAt(i);o<128?e[r++]=o:o<2048?(e[r++]=o>>>6|192,e[r++]=63&o|128):(e[r++]=o>>>12|224,e[r++]=o>>>6&63|128,e[r++]=63&o|128)}return e.subarray(0,r)},t.hex2bin=function(t){0!==t.indexOf("0x")&&0!==t.indexOf("0X")||(t=t.substr(2)),t.length%2&&(t+="0");for(var e=new Uint8Array(t.length>>>1),r=0,i=t.length>>>1;r<i;r++)e[r]=parseInt(t.substr(r<<1,2),16);return e},t.int2bin=function(t){var e=new Uint8Array(4);return e[0]=255&t,e[1]=t>>>8&255,e[2]=t>>>16&255,e[3]=t>>>24&255,e},t.number2bin=function(t){var e=new Uint8Array(8);if(Math.floor(t)===t){var r=t%4294967296|0,i=t/4294967296|0;t<0&&(i=0|~(-t/4294967296),(r=1+(r=0|~(-t%4294967296))&4294967295)||i++);var n=0;e[n++]=255&r,e[n++]=r>>>8&255,e[n++]=r>>>16&255,e[n++]=r>>>24&255,e[n++]=255&i,e[n++]=i>>>8&255,e[n++]=i>>>16&255,e[7]=i>>>24&255}else{var o=new Float64Array([t]),s=new Uint8Array(o.buffer);e.set(s)}return e},t.base642bin=function(t){if((t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/%3d/g,"=")).length%4==0){var e=t.length/4*3;if("="===t.charAt(t.length-1)&&e--,"="===t.charAt(t.length-2)&&e--,"undefined"!=typeof atob)return new Uint8Array(atob(t).split("").map(function(t){return t.charCodeAt(0)}));for(var r=new Int8Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,62,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-2,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,63,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1]),i=0,n=new Uint8Array(e),o=0,s=t.length;o<s;){var h="="===t.charAt(o)||t.charCodeAt(o)>"z".charCodeAt(0)?0:r[t.charCodeAt(o)];o++;var u="="===t.charAt(o)||t.charCodeAt(o)>"z".charCodeAt(0)?0:r[t.charCodeAt(o)];o++;var a="="===t.charAt(o)||t.charCodeAt(o)>"z".charCodeAt(0)?0:r[t.charCodeAt(o)];o++;var l="="===t.charAt(o)||t.charCodeAt(o)>"z".charCodeAt(0)?0:r[t.charCodeAt(o)];o++;var c=(h<<18)+(u<<12)+(a<<6)+l;"="!==t.charAt(o-3)&&(n[i++]=c>>>16&255),"="!==t.charAt(o-2)&&(n[i++]=c>>>8&255),"="!==t.charAt(o-1)&&(n[i++]=255&c)}return n}},t.bin2hex=function(t,e){void 0===e&&(e=!1);for(var r=e?"0123456789ABCDEF":"0123456789abcdef",i="",n=0,o=t.length;n<o;n++)i+=r.charAt(t[n]>>>4&15)+r.charAt(15&t[n]);return i},t.bin2str=function(t){for(var e,r,i,n="",o=t.length,s=0;s<o;)(e=t[s])<128?(n+=String.fromCharCode(e),s++):e>191&&e<224?(r=t[s+1],n+=String.fromCharCode((31&e)<<6|63&r),s+=2):(r=t[s+1],i=t[s+2],n+=String.fromCharCode((15&e)<<12|(63&r)<<6|63&i),s+=3);return n},t.bin2longbin=function(t){for(var e=new Uint32Array(t.length>>>2),r=0,i=t.length;r<i;r++)e[r>>>2]|=t[r]<<(r%4<<3);return e},t.bin2number=function(t){var e=0,r=t[e++]|t[e++]<<8|t[e++]<<16|t[e++]<<24;return 4294967296*(t[e++]|t[e++]<<8|t[e++]<<16|t[7]<<24)+(r>=0?r:4294967296+r)},t.bin2base64=function(t,e){if(void 0===e&&(e=!1),"undefined"!=typeof btoa)return e?btoa(String.fromCharCode.apply(null,t)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"%3d"):btoa(String.fromCharCode.apply(null,t));for(var r="",i=e?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=t.length;n<o;){var s=n<t.length?t[n]:0,h=++n<t.length?t[n]:0,u=++n<t.length?t[n]:0;n++;var a=(s<<16)+(h<<8)+u;r+=i.charAt(a>>>18&63),r+=i.charAt(a>>>12&63),r+=n<t.length+2?i.charAt(a>>>6&63):e?"%3d":"=",r+=n<t.length+1?i.charAt(a>>>0&63):e?"%3d":"="}return r}}(e.Convert||(e.Convert={})),function(t){t.compare=function(t,e){if(t.length!==e.length)return!1;var r,i=0,n=t.length;for(r=0;r<n;r++)i|=t[r]^e[r];return 0===i},t.clear=function(t){t.fill(0)},t.xor=function(t,e){return t.map(function(t,r){return t^e[r]})},t.concat=function(t,e){var r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},t.litteendian=function(){return 67305985===new Uint32Array(new Uint8Array([1,2,3,4]).buffer)[0]}}(e.Util||(e.Util={}))},function(t,e){t.exports=class{static escapeRegex(t){return(""+t).replace(/([?!${}*:()|=^[\]\/\\.+])/g,"\\$1")}}},function(t,e,r){const i=r(24),n=Symbol("value"),o='(){}[]:"<>'.split(""),s=`(${o.map(t=>i.escapeRegex(t)).join("|")})`,h='0123456789abcdefghijklmnopqrstuvwxyz!@#$%^&*()-+{}[]_:"|<>,.?/~'.split(""),u=h.slice(10);class a{constructor(t){this[n]=t instanceof a?t.toString():a.validate(t)}static validate(t){if(0===t.length)return t;if(t.length<3)throw new Error("Invalid account name, must be at least 3 characters long.");for(let e=0;e<t.length;e++){if(0===e&&-1===u.indexOf(t[e]))throw new Error(`Invalid AccountName encoding - character ${t[e]} not allowed at position 0`);if(e>0&&-1===h.indexOf(t[e]))throw new Error(`Invalid AccountName encoding - character ${t[e]} not allowed at position ${e}`)}return t}toString(){return this[n]}toStringEscaped(){return this[n].replace(new RegExp(s,"gm"),"\\$1")}static isEscape(t,e){return"\\"===t&&o.indexOf(e)>-1}}t.exports=a},function(t,e,r){const i=r(0),n=r(10),o=Symbol("block"),s=Symbol("account"),h=Symbol("nOperation"),u=Symbol("md160");t.exports=class{constructor(t,e,r,a){if(this[o]=t,this[s]=new n(e),this[h]=r,this[u]=i.from(a),20!==this[u].length)throw new Error("Invalid operation hash - md160 size !== 20 bytes.")}get account(){return this[s]}get block(){return this[o]}get nOperation(){return this[h]}get md160(){return this[u]}equals(t,e=!1){let r=!0;return e||(r=this.block===t.block),r&&this.nOperation===t.nOperation&&this.account.account===t.account.account&&this.md160.equals(t.md160)}}},function(t,e,r){const i=r(0),n=Symbol("key"),o=Symbol("curve");t.exports=class{constructor(t,e){this[n]=i.from(t),this[o]=e;const r=e.lPrivateKey();if(this[n].length>r)throw new Error(`Invalid length for curve ${e.name} - `+`expected <= ${r}, got ${this[n].length}`)}get key(){return this[n]}get ec(){return this.key}get curve(){return this[o]}}},function(t,e,r){const i=r(0),n=r(11),o=Symbol("x"),s=Symbol("xl"),h=Symbol("y"),u=Symbol("yl"),a=Symbol("curve");class l{constructor(t,e,r){if(t=i.from(t),e=i.from(e),this[o]=t,this[h]=e,this[s]=t.length,this[u]=e.length,this[a]=r,this[s]>r.xylPublicKey("x")||this[u]>r.xylPublicKey("y"))throw new Error(`Invalid x and/or y length for curve ${r.name} - `+`expected <= X${r.xylPublicKey("x")}:Y${r.xylPublicKey("y")}, `+`got X${this[s]}:Y${this[u]}`)}get x(){return this[o]}get y(){return this[h]}get yl(){return this[u]}get xl(){return this[s]}get curve(){return this[a]}get ec(){return i.concat(this.x,this.y)}get ecdh(){return this.curve.id===n.CI_P521?i.concat(i.fromHex("0400"),this.x,i.fromHex("00"),this.y):i.concat(i.fromHex("04"),this.x,this.y)}static empty(){return new l(i.fromString(""),i.fromString(""),new n(0))}}t.exports=l},function(t,e,r){const i=r(5),n=r(0),o=r(1),s=r(21);function h(t,e){if(t){if(e.isNeg())throw new Error("64bit value is negative. Only signed allowed.");if(e.gt(new s("18446744073709551615")))throw new Error("Invalid unsigned 64 bit value.")}else if(!t&&(e.gt(new s("9223372036854775807"))||e.lt(new s("-9223372036854775808"))))throw new Error("Invalid signed 64 bit value.");return e}t.exports=class extends i{constructor(t,e=!0,r=o.LITTLE_ENDIAN){super(t||"int64",e,r),this.description("8byte 64bit int value")}get encodedSize(){return 8}decodeFromBytes(t,e={},r=null){let i=new s(n.from(t).slice(0,this.encodedSize).buffer,10,this.endian.toLowerCase());return this.unsigned||(i=i.fromTwos(64)),h(this.unsigned,i)}encodeToBytes(t){return t=h(this.unsigned,t),this.unsigned||(t=t.toTwos(64)),n.from(t.toBuffer(this.endian.toLowerCase(),this.encodedSize))}}},function(t,e,r){const i=r(0),n=r(2),o=r(7),s=r(6),h=r(3),u=r(31),a=r(1),l=Symbol("size_encoded"),c=Symbol("has_leading_zerobyte"),d=Symbol("length_field"),f=Symbol("bytes_field");t.exports=class extends n{constructor(t,e=1,r="length",i=null,n=a.LITTLE_ENDIAN,l=!1){switch(super(t||`bytes_size${8*e}`),this.description("String with size prepended"),this[f]=new u("value"),this[c]=l,e){case 1:this[d]=new o(r,!0);break;case 2:this[d]=new s(r,!0,n);break;case 4:this[d]=new h(r,!0,n);break;default:throw new Error("ByteSize must be either 1, 2 or 4")}null!==i&&this[d].description(i)}get encodedSize(){return this[l]}decodeFromBytes(t,e={},r=null){return this[l]=this[d].encodedSize+this[d].decodeFromBytes(i.from(t))+ +this[c],this[f].decodeFromBytes(t.slice(this[d].encodedSize+ +this[c],this[l]))}encodeToBytes(t){this[l]=t.length;let e=this[d].encodeToBytes(this[l]);return this[c]&&(e=e.append("00")),e.append(this[f].encodeToBytes(t))}}},function(t,e,r){const i=r(2),n=r(0),o=Symbol("size_encoded");t.exports=class extends i{constructor(t=null){super(t||"string_without_length"),this.description("Single string value without length prepended.")}get encodedSize(){return this[o]}decodeFromBytes(t,e={},r=null){return n.from(t).toString()}encodeToBytes(t){let e=n.from(t,"string");return this[o]=e.length,e}}},function(t,e,r){const i=r(2),n=r(0),o=Symbol("size");t.exports=class extends i{constructor(t,e){super(t||"bytes_fixed_length_"+e),this.description("Bytes with a fixed length of "+e),this[o]=e}get encodedSize(){return this[o]}decodeFromBytes(t,e={},r=null){return n.from(t).slice(0,this[o])}encodeToBytes(t){return(t=n.from(t)).slice(0,this[o])}}},function(t,e,r){const i=r(10),n=r(1),o=r(3);t.exports=class extends o{constructor(t=null){super(t||"account",!0,n.LITTLE_ENDIAN),this.description("An account number")}decodeFromBytes(t,e={},r=null){return new i(super.decodeFromBytes(t))}encodeToBytes(t){return super.encodeToBytes(t.account)}}},function(t,e,r){const i=r(1),n=r(3);t.exports=class extends n{constructor(t=null){super(t||"nOperation",!0,i.LITTLE_ENDIAN),this.description("Accounts n_operation value.")}}},function(t,e,r){t.exports=r(36)},function(t,e,r){t.exports={File:r(15),Key:r(16),KeyCoder:r(17),FileCoder:r(55)}},function(t,e,r){var i=r(38);t.exports=i("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(t,e,r){const i=r(39).Buffer;t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");const e=new Uint8Array(256);e.fill(255);for(let r=0;r<t.length;r++){const i=t.charAt(r),n=i.charCodeAt(0);if(255!==e[n])throw new TypeError(i+" is ambiguous");e[n]=r}const r=t.length,n=t.charAt(0),o=Math.log(r)/Math.log(256),s=Math.log(256)/Math.log(r);function h(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return i.alloc(0);let s=0;if(" "===t[s])return;let h=0,u=0;for(;t[s]===n;)h++,s++;const a=(t.length-s)*o+1>>>0,l=new Uint8Array(a);for(;t[s];){let i=e[t.charCodeAt(s)];if(255===i)return;let n=0;for(let t=a-1;(0!==i||n<u)&&-1!==t;t--,n++)i+=r*l[t]>>>0,l[t]=i%256>>>0,i=i/256>>>0;if(0!==i)throw new Error("Non-zero carry");u=n,s++}if(" "===t[s])return;let c=a-u;for(;c!==a&&0===l[c];)c++;const d=i.allocUnsafe(h+(a-c));d.fill(0,0,h);let f=h;for(;c!==a;)d[f++]=l[c++];return d}return{encode:function(e){if(!i.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";let o=0,h=0,u=0;const a=e.length;for(;u!==a&&0===e[u];)u++,o++;const l=(a-u)*s+1>>>0,c=new Uint8Array(l);for(;u!==a;){let t=e[u],i=0;for(let e=l-1;(0!==t||i<h)&&-1!==e;e--,i++)t+=256*c[e]>>>0,c[e]=t%r>>>0,t=t/r>>>0;if(0!==t)throw new Error("Non-zero carry");h=i,u++}let d=l-h;for(;d!==l&&0===c[d];)d++;let f=n.repeat(o);for(;d<l;++d)f+=t.charAt(c[d]);return f},decodeUnsafe:h,decode:function(t){const e=h(t);if(e)return e;throw new Error("Non-base"+r+" character")}}}},function(t,e,r){var i=r(19),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=s),o(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(23),n=function(){function t(){this.hashSize=32,this.buffer=new Uint8Array(64),this.K=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),this.init()}return t.prototype.init=function(){return this.H=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),this.bufferIndex=0,this.count=new Uint32Array(2),i.Util.clear(this.buffer),this},t.prototype.transform=function(){var t,e=this.H,r=e[0],i=e[1],n=e[2],o=e[3],s=e[4],h=e[5],u=e[6],a=e[7],l=new Uint32Array(16);for(t=0;t<16;t++)l[t]=this.buffer[3+(t<<2)]|this.buffer[2+(t<<2)]<<8|this.buffer[1+(t<<2)]<<16|this.buffer[t<<2]<<24;for(t=0;t<64;t++){var c=void 0;if(t<16)c=l[t];else{var d=l[t+1&15],f=l[t+14&15];c=l[15&t]=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(f>>>17^f>>>19^f>>>10^f<<15^f<<13)+l[15&t]+l[t+9&15]|0}c=c+a+(s>>>6^s>>>11^s>>>25^s<<26^s<<21^s<<7)+(u^s&(h^u))+this.K[t]|0,a=u,u=h,h=s,s=o+c,o=n,n=i,r=c+((i=r)&n^o&(i^n))+(i>>>2^i>>>13^i>>>22^i<<30^i<<19^i<<10)|0}e[0]=e[0]+r|0,e[1]=e[1]+i|0,e[2]=e[2]+n|0,e[3]=e[3]+o|0,e[4]=e[4]+s|0,e[5]=e[5]+h|0,e[6]=e[6]+u|0,e[7]=e[7]+a|0},t.prototype.update=function(t){for(var e=0,r=(t=t||new Uint8Array(0)).length;e<r;e++)this.buffer[this.bufferIndex++]=t[e],64===this.bufferIndex&&(this.transform(),this.bufferIndex=0);var i=this.count;return(i[0]+=t.length<<3)<t.length<<3&&i[1]++,i[1]+=t.length>>>29,this},t.prototype.digest=function(t){this.update(t);var e=this.buffer,r=this.bufferIndex;for(e[r++]=128;56!==r;)64===r&&(this.transform(),r=0),e[r++]=0;var i=this.count;e[56]=i[1]>>>24&255,e[57]=i[1]>>>16&255,e[58]=i[1]>>>8&255,e[59]=i[1]>>>0&255,e[60]=i[0]>>>24&255,e[61]=i[0]>>>16&255,e[62]=i[0]>>>8&255,e[63]=i[0]>>>0&255,this.transform();var n,o=new Uint8Array(32);for(n=0;n<8;n++)o[0+(n<<2)]=this.H[n]>>>24&255,o[1+(n<<2)]=this.H[n]>>>16&255,o[2+(n<<2)]=this.H[n]>>>8&255,o[3+(n<<2)]=this.H[n]>>>0&255;return this.init(),o},t.prototype.hash=function(t){return this.init().digest(t)},t.prototype.selftest=function(){var e,r,n,o=new t,s=new t,h="";for(r=0;r<10;r++)for(n=100*r;n<100*(r+1);n++)e=i.Convert.bin2hex(s.hash(i.Convert.str2bin(h))),o.update(i.Convert.str2bin(e)),h=(e.substring(0,2)+h).substring(0,n+1);return"f305c76d5d457ddf04f1927166f5e13429407049a5c5f29021916321fcdcd8b4"===(e=i.Convert.bin2hex(o.digest()))},t}();e.SHA256=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(23),n=function(){function t(){this.hashSize=64,this.buffer=new Uint8Array(128),this.K=new Uint32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]),this.init()}return t.prototype.init=function(){return this.H=new Uint32Array([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),this.bufferIndex=0,this.count=new Uint32Array(2),i.Util.clear(this.buffer),this},t.prototype.transform=function(){var t,e,r,i,n,o,s,h,u,a,l,c,d,f,m,p,g,y,v,w,M,b=this.H,x=b[0],S=b[1],_=b[2],A=b[3],T=b[4],B=b[5],I=b[6],E=b[7],k=b[8],C=b[9],N=b[10],L=b[11],z=b[12],P=b[13],F=b[14],O=b[15],U=x,K=S,R=_,$=A,D=T,H=B,q=I,j=E,Z=k,V=C,W=N,X=L,G=z,Y=P,J=F,Q=O,tt=new Uint32Array(160);for(t=0;t<32;t++)tt[t]=this.buffer[3+(t<<2)]|this.buffer[2+(t<<2)]<<8|this.buffer[1+(t<<2)]<<16|this.buffer[t<<2]<<24;for(t=16;t<80;t++)r=tt[2*(t-15)],n=((e=tt[2*(t-15)+1])<<31|r>>>1)^(e<<24|r>>>8)^r>>>7,i=(r<<31|e>>>1)^(r<<24|e>>>8)^(r<<25|e>>>7),s=tt[2*(t-2)],u=((o=tt[2*(t-2)+1])<<13|s>>>19)^(s<<3|o>>>29)^s>>>6,h=(s<<13|o>>>19)^(o<<3|s>>>29)^(s<<26|o>>>6),l=n+tt[2*(t-7)]+((a=i+tt[2*(t-7)+1])>>>0<i>>>0?1:0),l+=u+((a+=h)>>>0<h>>>0?1:0),l+=tt[2*(t-16)]+((a+=c=tt[2*(t-16)+1])>>>0<c>>>0?1:0),tt[2*t]=l,tt[2*t+1]=a;for(t=0;t<80;t++)m=U&R^U&D^R&D,f=K&$^K&H^$&H,g=(K<<4|U>>>28)^(U<<30|K>>>2)^(U<<25|K>>>7),p=(U<<4|K>>>28)^(K<<30|U>>>2)^(K<<25|U>>>7),w=J+((V<<18|Z>>>14)^(V<<14|Z>>>18)^(Z<<23|V>>>9))+((v=Q+((Z<<18|V>>>14)^(Z<<14|V>>>18)^(V<<23|Z>>>9)))>>>0<Q>>>0?1:0),w+=(Z&W^~Z&G)+((v+=d=V&X^~V&Y)>>>0<d>>>0?1:0),w+=this.K[2*t]+((v+=y=this.K[2*t+1])>>>0<y>>>0?1:0),v+=tt[2*t+1],J=G,Q=Y,G=W,Y=X,W=Z,X=V,Z=q+(w+=tt[2*t]+(v>>>0<tt[2*t+1]>>>0?1:0))+((V=j+v|0)>>>0<j>>>0?1:0)|0,q=D,j=H,D=R,H=$,R=U,$=K,U=w+(g+m+((M=p+f)>>>0<p>>>0?1:0))+((K=v+M|0)>>>0<v>>>0?1:0)|0;S=b[1]=S+K|0,b[0]=x+U+(S>>>0<K>>>0?1:0)|0,A=b[3]=A+$|0,b[2]=_+R+(A>>>0<$>>>0?1:0)|0,B=b[5]=B+H|0,b[4]=T+D+(B>>>0<H>>>0?1:0)|0,E=b[7]=E+j|0,b[6]=I+q+(E>>>0<j>>>0?1:0)|0,C=b[9]=C+V|0,b[8]=k+Z+(C>>>0<V>>>0?1:0)|0,L=b[11]=L+X|0,b[10]=N+W+(L>>>0<X>>>0?1:0)|0,P=b[13]=P+Y|0,b[12]=z+G+(P>>>0<Y>>>0?1:0)|0,O=b[15]=O+Q|0,b[14]=F+J+(O>>>0<Q>>>0?1:0)|0},t.prototype.update=function(t){t=t||new Uint8Array(0);for(var e=0;e<t.length;e++)this.buffer[this.bufferIndex++]=t[e],128===this.bufferIndex&&(this.transform(),this.bufferIndex=0);var r=this.count;return(r[0]+=t.length<<3)<t.length<<3&&r[1]++,r[1]+=t.length>>>29,this},t.prototype.digest=function(t){this.update(t);var e=this.buffer,r=this.bufferIndex;for(e[r++]=128;112!==r;)128===r&&(this.transform(),r=0),e[r++]=0;var i=this.count;e[112]=e[113]=e[114]=e[115]=e[116]=e[117]=e[118]=e[119]=0,e[120]=i[1]>>>24&255,e[121]=i[1]>>>16&255,e[122]=i[1]>>>8&255,e[123]=i[1]>>>0&255,e[124]=i[0]>>>24&255,e[125]=i[0]>>>16&255,e[126]=i[0]>>>8&255,e[127]=i[0]>>>0&255,this.transform();var n,o=new Uint8Array(64);for(n=0;n<16;n++)o[0+(n<<2)]=this.H[n]>>>24&255,o[1+(n<<2)]=this.H[n]>>>16&255,o[2+(n<<2)]=this.H[n]>>>8&255,o[3+(n<<2)]=255&this.H[n];return this.init(),o},t.prototype.hash=function(t){return this.init().digest(t)},t.prototype.selftest=function(){for(var e,r=new t,n=new t,o="",s=0;s<10;s++)for(var h=100*s;h<100*(s+1);h++)e=i.Convert.bin2hex(n.hash(i.Convert.str2bin(o))),r.update(i.Convert.str2bin(e)),o=(e.substring(0,2)+o).substring(0,h+1);return"602923787640dd6d77a99b101c379577a4054df2d61f39c74172cafa2d9f5b26a11b40b7ba4cdc87e84a4ab91b85391cb3e1c0200f3e3d5e317486aae7bebbf3"===(e=i.Convert.bin2hex(r.digest()))},t}();e.SHA512=n},function(t,e,r){t.exports={AccountName:r(25),AccountNumber:r(10),Currency:r(9),OperationHash:r(26),Keys:r(44)}},function(t,e,r){t.exports={Curve:r(11),PrivateKey:r(27),PublicKey:r(28),KeyPair:r(45)}},function(t,e){const r=Symbol("private_key"),i=Symbol("public_key"),n=Symbol("curve");t.exports=class{constructor(t,e){if(this[n]=t.curve,this[r]=t,this[i]=e,t.curve.id!==e.curve.id)throw new Error("Mixed up curves between private an public key")}get privateKey(){return this[r]}get publicKey(){return this[i]}get curve(){return this[n]}}},function(t,e,r){t.exports={AbstractType:r(2),CompositeType:r(4),Repeating:r(47),Decissive:r(48),Core:{AbstractInt:r(5),Int8:r(7),Int16:r(6),Int32:r(3),Int64:r(29),StringWithLength:r(30),StringWithoutLength:r(31),BytesWithLength:r(12),BytesWithoutLength:r(13),BytesFixedLength:r(32)},Pascal:{Keys:{Curve:r(14),PublicKey:r(49),PrivateKey:r(50)},AccountNumber:r(33),AccountName:r(51),Currency:r(52),NOperation:r(34),OpType:r(53),OperationHash:r(54)}}},function(t,e,r){const i=r(0),n=r(2),o=Symbol("size_encoded"),s=Symbol("repeat_limit"),h=Symbol("repeat_marker"),u=Symbol("type");t.exports=class extends n{constructor(t,e,r=-1,i=null){super(t||"repeating"),super.description("A type that itself has one repeating type that will be written / read until the limit is reached or data is empty."),this[u]=e,this[s]=r,this[h]=i}get encodedSize(){return this[o]}decodeFromBytes(t,e={},r=null){let n=[],a=0;t=i.from(t);let l=null!==this[h]?r[this[h]]:this[s],c=l;for(;l>-1&&c>0||-1===l&&t.length>a;){const e=this[u].decodeFromBytes(t.slice(a));n.push(e),a+=this[u].encodedSize,c--}return this[o]=a,n}encodeToBytes(t){let e=i.empty();return t.forEach((t,r)=>{r>=this[s]&&this[s]>-1||(e=e.append(this[u].encodeToBytes(t)))}),this[o]=e.length,e}get repeatingType(){return this[u]}}},function(t,e,r){const i=r(4),n=Symbol("size_encoded"),o=Symbol("subtype_resolver"),s=Symbol("marker_field");t.exports=class extends i{constructor(t,e,r){super(t||"decissive"),super.description("A type that itself has many sub types but only some are triggere based on a marker."),this[o]=r,this[s]=e}get encodedSize(){return this[n]}decodeFromBytes(t,e={},r=null){let i=this[o](r[this[s]]);return this[n]=i.encodedSize,i.decodeFromBytes(t,e,r)}encodeToBytes(t,e){let r=this[o](e[this[s]]).encodeToBytes(t);return this[n]=r.length,r}}},function(t,e,r){const i=r(14),n=r(12),o=r(13),s=r(4),h=r(0),u=r(22),a=r(18),l=r(28);t.exports=class extends s{constructor(t=null,e=!1){super(t||"public_key"),this.addSubType(new i("curve")),e?(this.addSubType(new o("x").description("The X value of the public key.")),this.addSubType(new o("y"))):(this.addSubType(new n("x",2,"x_length","Length of X value").description("The X value of the public key.")),this.addSubType(new n("y",2,"y_length","Length of Y value").description("The X value of the public key.")))}decodeFromBytes(t,e={},r=null){const i=super.decodeFromBytes(t);return new l(i.x,i.y,i.curve)}encodeToBase58(t){const e=h.fromHex("01"),r=this.encodeToBytes(t),i=u.sha256(r).slice(0,4),n=h.concat(e,r,i);return a.encode(n)}decodeFromBase58(t){const e=a.decode(t);return this.decodeFromBytes(e.slice(1,-4))}}},function(t,e,r){const i=r(14),n=r(12),o=r(4),s=r(27);t.exports=class extends o{constructor(t=null){super(t||"private_key"),this.addSubType(new i("curve")),this.addSubType(new n("key",2).description("The private key value."))}decodeFromBytes(t,e={},r=null){const i=super.decodeFromBytes(t);return new s(i.key,i.curve)}encodeToBytes(t){return super.encodeToBytes(t)}}},function(t,e,r){const i=r(25),n=r(30);t.exports=class extends n{constructor(t=null,e=2){super(t||"account_name",e),this.description("An account name")}decodeFromBytes(t,e={},r=null){return new i(super.decodeFromBytes(t))}encodeToBytes(t){return super.encodeToBytes(t.toString())}}},function(t,e,r){const i=r(29),n=r(9),o=r(1);t.exports=class extends i{constructor(t=null,e=!0,r=o.LITTLE_ENDIAN){super(t||"currency",e,r),this.description("A type for currency values.")}decodeFromBytes(t,e={},r=null){return n.fromMolina(super.decodeFromBytes(t))}encodeToBytes(t){return super.encodeToBytes(t.bn)}}},function(t,e,r){const i=r(1),n=r(2),o=r(7),s=r(6),h=r(3),u=Symbol("int_type");t.exports=class extends n{constructor(t,e){switch(super(t||`optype_int${8*e}`),e){case 1:this[u]=new o("OpType[Int8]",!0);break;case 2:this[u]=new s("OpType[Int16]",!0,i.LITTLE_ENDIAN);break;case 4:this[u]=new h("OpType[Int32]",!0,i.LITTLE_ENDIAN);break;default:throw Error("Invalid byte size.")}this.description(`Operation type in ${8*e} bits`)}get encodedSize(){return this[u].encodedSize}decodeFromBytes(t,e={},r=null){return this[u].decodeFromBytes(t)}encodeToBytes(t){return this[u].encodeToBytes(t)}get intType(){return this[u]}}},function(t,e,r){const i=r(1),n=r(4),o=r(3),s=r(33),h=r(32),u=r(34),a=r(26);t.exports=class extends n{constructor(t=null){super(t||"ophash"),this.description("A pascalCoin operation hash"),this.addSubType(new o("block",!0,i.LITTLE_ENDIAN).description("The block the operation is in.")),this.addSubType(new s("account").description("The account number that signed the operation.")),this.addSubType(new u("nOperation",4).description("The n_operation value of the account with the current operation.")),this.addSubType(new h("md160",20).description("The RIPEMD160 hash of the operation data."))}decodeFromBytes(t,e={},r=null){const i=super.decodeFromBytes(t);return new a(i.block,i.account,i.nOperation,i.md160)}encodeToBytes(t){return super.encodeToBytes(t)}}},function(t,e,r){const i=r(8).Coding,n=r(8).Endian,o=r(15),s=r(17),h=i.CompositeType;t.exports=class extends h{constructor(t=null){super(t||"walletkeys.dat"),this.description("The coder for the walletkeys.dat file from the classic wallet."),this.addSubType(new i.Core.StringWithLength("magic",1,"magic_length","Length of the magic",n.LITTLE_ENDIAN,!0).description("The name of the magic.")),this.addSubType(new i.Core.Int32("version",!0,n.LITTLE_ENDIAN).description("Version of file"));const e=new i.Decissive("versioned","version",t=>{{const t=new i.CompositeType("v100");return t.addSubType(new i.Core.Int32("countKeys",!0,n.LITTLE_ENDIAN).description("The number of keys in the file")),t.addSubType(new i.Repeating("keys",new s("keys"),-1,"countKeys").description("List of keys")),t}});this.addSubType(e)}decodeFromBytes(t,e={},r=null){const i=super.decodeFromBytes(t,e,r),n=new o(i.magic,i.version);return i.versioned.keys.forEach(t=>{n.addKey(t)}),n}encodeToBytes(t){let e={magic:t.magic,version:t.version,versioned:{countKeys:t.countKeys,keys:t.keys}};return super.encodeToBytes(e)}}}])});
  //# sourceMappingURL=walletkeys.dat.node.min.js.map