From 6e516a62ee93474985b0a8502967256314b5f374 Mon Sep 17 00:00:00 2001 From: Paul Kim Date: Tue, 10 Nov 2020 23:23:07 +0900 Subject: [PATCH] fix: delete dist files from repo --- dist/bundle.js | 29 - dist/bundle.js.map | 1 - dist/bundle.node.js | 15 - dist/bundle.node.js.map | 1 - dist/client/Mirror.d.ts | 41 - dist/client/Mirror.js | 193 -- dist/client/Mirror.js.map | 1 - dist/client/index.d.ts | 1 - dist/client/index.js | 14 - dist/client/index.js.map | 1 - dist/contracts/ContractClient.d.ts | 17 - dist/contracts/ContractClient.js | 86 - dist/contracts/ContractClient.js.map | 1 - dist/contracts/MirrorCollector.d.ts | 38 - dist/contracts/MirrorCollector.js | 98 - dist/contracts/MirrorCollector.js.map | 1 - dist/contracts/MirrorFactory.d.ts | 120 - dist/contracts/MirrorFactory.js | 170 -- dist/contracts/MirrorFactory.js.map | 1 - dist/contracts/MirrorGov.d.ts | 165 -- dist/contracts/MirrorGov.js | 202 -- dist/contracts/MirrorGov.js.map | 1 - dist/contracts/MirrorMint.d.ts | 148 - dist/contracts/MirrorMint.js | 241 -- dist/contracts/MirrorMint.js.map | 1 - dist/contracts/MirrorOracle.d.ts | 79 - dist/contracts/MirrorOracle.js | 137 - dist/contracts/MirrorOracle.js.map | 1 - dist/contracts/MirrorStaking.d.ts | 94 - dist/contracts/MirrorStaking.js | 164 -- dist/contracts/MirrorStaking.js.map | 1 - dist/contracts/TerraswapFactory.d.ts | 61 - dist/contracts/TerraswapFactory.js | 112 - dist/contracts/TerraswapFactory.js.map | 1 - dist/contracts/TerraswapPair.d.ts | 121 - dist/contracts/TerraswapPair.js | 200 -- dist/contracts/TerraswapPair.js.map | 1 - dist/contracts/TerraswapToken.d.ts | 178 -- dist/contracts/TerraswapToken.js | 222 -- dist/contracts/TerraswapToken.js.map | 1 - dist/contracts/index.d.ts | 9 - dist/contracts/index.js | 22 - dist/contracts/index.js.map | 1 - dist/index.d.ts | 3 - dist/index.js | 16 - dist/index.js.map | 1 - dist/utils/Asset.d.ts | 18 - dist/utils/Asset.js | 13 - dist/utils/Asset.js.map | 1 - dist/utils/EmptyKey.d.ts | 6 - dist/utils/EmptyKey.js | 30 - dist/utils/EmptyKey.js.map | 1 - dist/utils/EmptyObject.d.ts | 3 - dist/utils/EmptyObject.js | 3 - dist/utils/EmptyObject.js.map | 1 - dist/utils/index.d.ts | 3 - dist/utils/index.js | 16 - dist/utils/index.js.map | 1 - package-lock.json | 3723 +++++++++--------------- package.json | 32 +- 60 files changed, 1371 insertions(+), 5492 deletions(-) delete mode 100644 dist/bundle.js delete mode 100644 dist/bundle.js.map delete mode 100644 dist/bundle.node.js delete mode 100644 dist/bundle.node.js.map delete mode 100644 dist/client/Mirror.d.ts delete mode 100644 dist/client/Mirror.js delete mode 100644 dist/client/Mirror.js.map delete mode 100644 dist/client/index.d.ts delete mode 100644 dist/client/index.js delete mode 100644 dist/client/index.js.map delete mode 100644 dist/contracts/ContractClient.d.ts delete mode 100644 dist/contracts/ContractClient.js delete mode 100644 dist/contracts/ContractClient.js.map delete mode 100644 dist/contracts/MirrorCollector.d.ts delete mode 100644 dist/contracts/MirrorCollector.js delete mode 100644 dist/contracts/MirrorCollector.js.map delete mode 100644 dist/contracts/MirrorFactory.d.ts delete mode 100644 dist/contracts/MirrorFactory.js delete mode 100644 dist/contracts/MirrorFactory.js.map delete mode 100644 dist/contracts/MirrorGov.d.ts delete mode 100644 dist/contracts/MirrorGov.js delete mode 100644 dist/contracts/MirrorGov.js.map delete mode 100644 dist/contracts/MirrorMint.d.ts delete mode 100644 dist/contracts/MirrorMint.js delete mode 100644 dist/contracts/MirrorMint.js.map delete mode 100644 dist/contracts/MirrorOracle.d.ts delete mode 100644 dist/contracts/MirrorOracle.js delete mode 100644 dist/contracts/MirrorOracle.js.map delete mode 100644 dist/contracts/MirrorStaking.d.ts delete mode 100644 dist/contracts/MirrorStaking.js delete mode 100644 dist/contracts/MirrorStaking.js.map delete mode 100644 dist/contracts/TerraswapFactory.d.ts delete mode 100644 dist/contracts/TerraswapFactory.js delete mode 100644 dist/contracts/TerraswapFactory.js.map delete mode 100644 dist/contracts/TerraswapPair.d.ts delete mode 100644 dist/contracts/TerraswapPair.js delete mode 100644 dist/contracts/TerraswapPair.js.map delete mode 100644 dist/contracts/TerraswapToken.d.ts delete mode 100644 dist/contracts/TerraswapToken.js delete mode 100644 dist/contracts/TerraswapToken.js.map delete mode 100644 dist/contracts/index.d.ts delete mode 100644 dist/contracts/index.js delete mode 100644 dist/contracts/index.js.map delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 dist/utils/Asset.d.ts delete mode 100644 dist/utils/Asset.js delete mode 100644 dist/utils/Asset.js.map delete mode 100644 dist/utils/EmptyKey.d.ts delete mode 100644 dist/utils/EmptyKey.js delete mode 100644 dist/utils/EmptyKey.js.map delete mode 100644 dist/utils/EmptyObject.d.ts delete mode 100644 dist/utils/EmptyObject.js delete mode 100644 dist/utils/EmptyObject.js.map delete mode 100644 dist/utils/index.d.ts delete mode 100644 dist/utils/index.js delete mode 100644 dist/utils/index.js.map diff --git a/dist/bundle.js b/dist/bundle.js deleted file mode 100644 index 80819f1a..00000000 --- a/dist/bundle.js +++ /dev/null @@ -1,29 +0,0 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Mirror=e():t.Mirror=e()}(window,(function(){return 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=6)}([function(t,e,r){window,t.exports=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=115)}([function(t,e,r){"use strict";function n(t){if(Array.isArray(t))return t.map(n);if("object"!=typeof t)return t;var e={};return Object.keys(t).sort().forEach((function(r){void 0!==t[r]&&null!==t[r]&&(e[r]=n(t[r]))})),e}Object.defineProperty(e,"__esModule",{value:!0}),e.JSONSerializable=e.prepareSignBytes=void 0,e.prepareSignBytes=n;var i=function(){function t(){}return t.prototype.toJSON=function(){return JSON.stringify(n(this.toData()))},t}();e.JSONSerializable=i},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},function(t,e,r){"use strict";(function(t){ -/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ -var n=r(157),i=r(158),o=r(66);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(t).length;default:if(n)return L(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 k(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return O(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(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=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){var o,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var f=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var h=!0,d=0;di&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function O(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;i239?4:c>223?3:c>191?2:1;if(i+h<=r)switch(h){case 1:c<128&&(f=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(f=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,h=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function I(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function R(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function C(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function T(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(t,e,r,n,o){return o||T(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function B(t,e,r,n,o){return o||T(t,0,r,8),i.write(t,e,r,n,52,8),r+8}e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.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=a(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,r){return c(null,t,e,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,r){return function(t,e,r,n){return f(e),e<=0?s(t,e):void 0!==r?"string"==typeof n?s(t,e).fill(r,n):s(t,e).fill(r):s(t,e)}(null,t,e,r)},u.allocUnsafe=function(t){return h(null,t)},u.allocUnsafeSlow=function(t){return h(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},u.prototype.compare=function(t,e,r,n,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(o,a),c=this.slice(n,i),f=t.slice(e,r),h=0;hi)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return S(this,t,e,r);case"base64":return x(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return e||D(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||D(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||D(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||D(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||D(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||D(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||D(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||D(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||D(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||D(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||I(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):C(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);I(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);I(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):C(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return B(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return B(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function U(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(z,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(12))},function(t,e,r){ -/*! safe-buffer. MIT License. Feross Aboukhadijeh */ -var n=r(2),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(116),e),i(r(11),e),i(r(6),e),i(r(47),e),i(r(26),e),i(r(5),e),i(r(51),e),i(r(28),e),i(r(34),e),i(r(67),e),i(r(162),e),i(r(35),e),i(r(163),e),i(r(164),e),i(r(165),e),i(r(166),e),i(r(48),e),i(r(49),e),i(r(52),e),i(r(50),e),i(r(53),e),i(r(58),e),i(r(59),e),i(r(32),e),i(r(60),e),i(r(167),e),i(r(168),e),i(r(169),e),i(r(170),e),i(r(55),e),i(r(56),e),i(r(63),e),i(r(64),e),i(r(68),e),i(r(69),e),i(r(171),e),i(r(33),e),i(r(54),e),i(r(57),e),i(r(65),e),i(r(172),e)},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.int=e.dec=e.Int=e.Dec=e.Numeric=e.DEC_PRECISION=void 0;var a=o(r(117));e.DEC_PRECISION=18;var s,u=a.default.clone();u.prototype.toString=function(){return this.toFixed(e.DEC_PRECISION)},function(t){t.parse=function(t){if(t instanceof c)return t;if("string"==typeof t)return t.includes(".")?new c(t):new f(t);var e=new a.default(t);return e.isInteger()?new f(e):new c(e.toString())}}(s=e.Numeric||(e.Numeric={}));var c=function(t){function e(e){return t.call(this,e.toString())||this}return i(e,t),e.withPrec=function(t,r){return new e(new e(t).div(Math.pow(10,r)))},e.prototype.toInt=function(){return new f(this)},e.prototype.add=function(r){var n=new e(s.parse(r));return new e(t.prototype.add.call(this,n))},e.prototype.sub=function(r){var n=new e(s.parse(r));return new e(t.prototype.sub.call(this,n))},e.prototype.mul=function(r){var n=new e(s.parse(r));return new e(t.prototype.mul.call(this,n))},e.prototype.div=function(r){var n=new e(s.parse(r));return new e(t.prototype.div.call(this,n))},e.prototype.mod=function(r){var n=new e(s.parse(r));return new e(t.prototype.mod.call(this,n))},e}(u);e.Dec=c;var f=function(t){function e(e){var r=new a.default(e.toString());return t.call(this,r.divToInt(1))||this}return i(e,t),e.prototype.toString=function(){return this.toFixed()},e.prototype.toDec=function(){return new c(this)},e.prototype.add=function(t){var r=s.parse(t);return r instanceof c?new c(this).add(r):new e(this.plus(r))},e.prototype.sub=function(t){var r=s.parse(t);return r instanceof c?new c(this).sub(r):new e(this.minus(r))},e.prototype.mul=function(t){var r=s.parse(t);return r instanceof c?new c(this).mul(r):new e(this.times(r))},e.prototype.div=function(r){var n=s.parse(r);return n instanceof c?new c(this).div(n):new e(t.prototype.div.call(this,n))},e.prototype.mod=function(r){var n=s.parse(r);return n instanceof c?new c(this).mod(n):new e(t.prototype.mod.call(this,n))},e}(a.default.clone());e.Int=f,e.dec=function(t){return new c(t[0])},e.int=function(t){return new f(t[0])}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r1)for(var r=1;r(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0;t.cmpn(-n)>0||e.cmpn(-i)>0;){var o,a,s,u=t.andln(3)+n&3,c=e.andln(3)+i&3;3===u&&(u=-1),3===c&&(c=-1),o=0==(1&u)?0:3!=(s=t.andln(7)+n&7)&&5!==s||2!==c?u:-u,r[0].push(o),a=0==(1&c)?0:3!=(s=e.andln(7)+i&7)&&5!==s||2!==u?c:-c,r[1].push(a),2*n===o+1&&(n=1-n),2*i===a+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Coin=void 0;var o=r(0),a=r(5),s=function(t){function e(e,r){var n=t.call(this)||this;return n.denom=e,n.amount=a.Numeric.parse(r),n}return i(e,t),e.fromData=function(t){return new e(t.denom,t.amount)},e.prototype.isIntCoin=function(){return this.amount instanceof a.Int},e.prototype.isDecCoin=function(){return this.amount instanceof a.Dec},e.prototype.toIntCoin=function(){return new e(this.denom,new a.Int(this.amount))},e.prototype.toDecCoin=function(){return new e(this.denom,new a.Dec(this.amount))},e.prototype.toData=function(){return{denom:this.denom,amount:this.amount.toString()}},e.prototype.toString=function(){var t=this.amount.toFixed();return this.isDecCoin()&&-1===t.indexOf(".")?t+".0"+this.denom:""+t+this.denom},e.fromString=function(t){var r=t.match(/^(-?[0-9]+(\.[0-9]+)?)([a-zA-Z]+)$/);if(null===r)throw new Error("failed to parse to Coin: "+t);var n=r[1];return new e(r[3],n)},e.prototype.add=function(t){var r;if(t instanceof e){if(t.denom!==this.denom)throw new e.ArithmeticError("cannot add two Coins of different denoms: "+this.denom+" and "+t.denom);r=t.amount}else r=t;return r=a.Numeric.parse(r),new e(this.denom,this.amount.add(r))},e.prototype.sub=function(t){var r;if(t instanceof e){if(t.denom!==this.denom)throw new e.ArithmeticError("cannot subtract two Coins of different denoms: "+this.denom+" and "+t.denom);r=t.amount}else r=t;return r=a.Numeric.parse(r),new e(this.denom,this.amount.sub(r))},e.prototype.mul=function(t){var r=a.Numeric.parse(t);return new e(this.denom,this.amount.mul(r))},e.prototype.div=function(t){var r=a.Numeric.parse(t);return new e(this.denom,this.amount.div(r))},e.prototype.mod=function(t){var r=a.Numeric.parse(t);return new e(this.denom,this.amount.mod(r))},e}(o.JSONSerializable);e.Coin=s,function(t){t.ArithmeticError=function(t){this.message=t}}(s=e.Coin||(e.Coin={})),e.Coin=s},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a=r(208).Buffer}catch(t){}function s(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,c=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[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],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,h=67108863&u,d=Math.min(c,e.length-1),l=Math.max(0,c-t.length+1);l<=d;l++){var p=c-l|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[l])+h)/67108864|0,h=67108863&a}r.words[c]=0|h,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var d=f[t],l=h[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(t);r=(p=p.idivn(l)).isZero()?b+r:c[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")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,c=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,l=0|a[1],p=8191&l,b=l>>>13,y=0|a[2],g=8191&y,v=y>>>13,m=0|a[3],_=8191&m,w=m>>>13,S=0|a[4],x=8191&S,M=S>>>13,O=0|a[5],P=8191&O,A=O>>>13,E=0|a[6],k=8191&E,j=E>>>13,D=0|a[7],I=8191&D,R=D>>>13,C=0|a[8],T=8191&C,N=C>>>13,B=0|a[9],z=8191&B,q=B>>>13,L=0|s[0],U=8191&L,F=L>>>13,K=0|s[1],V=8191&K,J=K>>>13,W=0|s[2],H=8191&W,Y=W>>>13,G=0|s[3],Z=8191&G,X=G>>>13,$=0|s[4],Q=8191&$,tt=$>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ct=st>>>13,ft=0|s[8],ht=8191&ft,dt=ft>>>13,lt=0|s[9],pt=8191<,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(c+(n=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,F))+Math.imul(d,U)|0))<<13)|0;c=((o=Math.imul(d,F))+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,F))+Math.imul(b,U)|0,o=Math.imul(b,F);var gt=(c+(n=n+Math.imul(h,V)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(d,V)|0))<<13)|0;c=((o=o+Math.imul(d,J)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,U),i=(i=Math.imul(g,F))+Math.imul(v,U)|0,o=Math.imul(v,F),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,J)|0;var vt=(c+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(d,H)|0))<<13)|0;c=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(_,U),i=(i=Math.imul(_,F))+Math.imul(w,U)|0,o=Math.imul(w,F),n=n+Math.imul(g,V)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,Y)|0;var mt=(c+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(d,Z)|0))<<13)|0;c=((o=o+Math.imul(d,X)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,F))+Math.imul(M,U)|0,o=Math.imul(M,F),n=n+Math.imul(_,V)|0,i=(i=i+Math.imul(_,J)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,J)|0,n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,Y)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,Y)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,X)|0;var _t=(c+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,Q)|0))<<13)|0;c=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(P,U),i=(i=Math.imul(P,F))+Math.imul(A,U)|0,o=Math.imul(A,F),n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,J)|0,n=n+Math.imul(_,H)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,Y)|0,n=n+Math.imul(g,Z)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var wt=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(d,rt)|0))<<13)|0;c=((o=o+Math.imul(d,nt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,U),i=(i=Math.imul(k,F))+Math.imul(j,U)|0,o=Math.imul(j,F),n=n+Math.imul(P,V)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(A,V)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,X)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,X)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0;var St=(c+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,at)|0)+Math.imul(d,ot)|0))<<13)|0;c=((o=o+Math.imul(d,at)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,F))+Math.imul(R,U)|0,o=Math.imul(R,F),n=n+Math.imul(k,V)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,J)|0,n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,at)|0;var xt=(c+(n=n+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(d,ut)|0))<<13)|0;c=((o=o+Math.imul(d,ct)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,F))+Math.imul(N,U)|0,o=Math.imul(N,F),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,J)|0,n=n+Math.imul(k,H)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(j,H)|0,o=o+Math.imul(j,Y)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ct)|0;var Mt=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;c=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(z,U),i=(i=Math.imul(z,F))+Math.imul(q,U)|0,o=Math.imul(q,F),n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,Y)|0,n=n+Math.imul(k,Z)|0,i=(i=i+Math.imul(k,X)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,X)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,n=n+Math.imul(g,ut)|0,i=(i=i+Math.imul(g,ct)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ct)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,dt)|0;var Ot=(c+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,bt)|0)+Math.imul(d,pt)|0))<<13)|0;c=((o=o+Math.imul(d,bt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(z,V),i=(i=Math.imul(z,J))+Math.imul(q,V)|0,o=Math.imul(q,J),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,at)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,at)|0,n=n+Math.imul(_,ut)|0,i=(i=i+Math.imul(_,ct)|0)+Math.imul(w,ut)|0,o=o+Math.imul(w,ct)|0,n=n+Math.imul(g,ht)|0,i=(i=i+Math.imul(g,dt)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,dt)|0;var Pt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;c=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(z,H),i=(i=Math.imul(z,Y))+Math.imul(q,H)|0,o=Math.imul(q,Y),n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,X)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ct)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ct)|0,n=n+Math.imul(_,ht)|0,i=(i=i+Math.imul(_,dt)|0)+Math.imul(w,ht)|0,o=o+Math.imul(w,dt)|0;var At=(c+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,bt)|0)+Math.imul(v,pt)|0))<<13)|0;c=((o=o+Math.imul(v,bt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(z,Z),i=(i=Math.imul(z,X))+Math.imul(q,Z)|0,o=Math.imul(q,X),n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ct)|0,n=n+Math.imul(x,ht)|0,i=(i=i+Math.imul(x,dt)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,dt)|0;var Et=(c+(n=n+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,bt)|0)+Math.imul(w,pt)|0))<<13)|0;c=((o=o+Math.imul(w,bt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(z,Q),i=(i=Math.imul(z,tt))+Math.imul(q,Q)|0,o=Math.imul(q,tt),n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,at)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,at)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ct)|0,n=n+Math.imul(P,ht)|0,i=(i=i+Math.imul(P,dt)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,dt)|0;var kt=(c+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,bt)|0)+Math.imul(M,pt)|0))<<13)|0;c=((o=o+Math.imul(M,bt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(z,rt),i=(i=Math.imul(z,nt))+Math.imul(q,rt)|0,o=Math.imul(q,nt),n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ct)|0,n=n+Math.imul(k,ht)|0,i=(i=i+Math.imul(k,dt)|0)+Math.imul(j,ht)|0,o=o+Math.imul(j,dt)|0;var jt=(c+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,bt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((o=o+Math.imul(A,bt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(z,ot),i=(i=Math.imul(z,at))+Math.imul(q,ot)|0,o=Math.imul(q,at),n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ct)|0,n=n+Math.imul(I,ht)|0,i=(i=i+Math.imul(I,dt)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,dt)|0;var Dt=(c+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,bt)|0)+Math.imul(j,pt)|0))<<13)|0;c=((o=o+Math.imul(j,bt)|0)+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,n=Math.imul(z,ut),i=(i=Math.imul(z,ct))+Math.imul(q,ut)|0,o=Math.imul(q,ct),n=n+Math.imul(T,ht)|0,i=(i=i+Math.imul(T,dt)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,dt)|0;var It=(c+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,bt)|0)+Math.imul(R,pt)|0))<<13)|0;c=((o=o+Math.imul(R,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(z,ht),i=(i=Math.imul(z,dt))+Math.imul(q,ht)|0,o=Math.imul(q,dt);var Rt=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,bt)|0)+Math.imul(N,pt)|0))<<13)|0;c=((o=o+Math.imul(N,bt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Ct=(c+(n=Math.imul(z,pt))|0)+((8191&(i=(i=Math.imul(z,bt))+Math.imul(q,pt)|0))<<13)|0;return c=((o=Math.imul(q,bt))+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=yt,u[1]=gt,u[2]=vt,u[3]=mt,u[4]=_t,u[5]=wt,u[6]=St,u[7]=xt,u[8]=Mt,u[9]=Ot,u[10]=Pt,u[11]=At,u[12]=Et,u[13]=kt,u[14]=jt,u[15]=Dt,u[16]=It,u[17]=Rt,u[18]=Ct,0!==c&&(u[19]=c,r.length++),r};function p(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(l=d),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?l(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,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==f||c>=i);c--){var h=0|this.words[c];this.words[c]=f<<26-o|h>>>o,f=h&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!=(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=d)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),h=e.clone();!e.isZero();){for(var d=0,l=1;0==(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(h)),i.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(h)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0==(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function g(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(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function m(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){S.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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},i(v,g),v.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},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>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new m;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return y[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.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)},S.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},S.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)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var h=this.pow(f,i),d=this.pow(t,i.addn(1).iushrn(1)),l=this.pow(t,i),p=a;0!==l.cmp(s);){for(var b=l,y=0;0!==b.cmp(s);y++)b=b.redSqr();n(y=0;n--){for(var c=e.words[n],f=u-1;f>=0;f--){var h=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==a?(a<<=1,a|=h,(4==++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new x(t)},i(x,S),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(207)(t))},function(t,e,r){"use strict";var n=r(17),i=r(1);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function a(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function u(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i>6|192,r[n++]=63&a|128):o(t,i)?(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i>>0}return a},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,a=(o>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,o,a,s){var u=0,c=e;return u+=(c=c+n>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,r,n,i,o,a,s){return e+n+o+s>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,a,s,u,c){var f=0,h=e;return f+=(h=h+n>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,r,n,i,o,a,s,u,c){return e+n+o+s+c>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Convert=void 0;var n=r(4),i=r(57),o=r(4);!function(t){t.id=function(t){return t},t.toDec=function(t){return new o.Dec(t)},t.toString=function(t){return t.toString()},t.toFixed=function(t){return t.toFixed()},t.toNumber=Number.parseInt,t.toOracleWhitelist=function(t){return t.map((function(t){return{name:t.name,tobin_tax:new o.Dec(t.tobin_tax)}}))},t.toVotingParams=function(t){return{voting_period:Number.parseInt(t.voting_period)}},t.toDepositParams=function(t){return{min_deposit:n.Coins.fromData(t.min_deposit),max_deposit_period:Number.parseInt(t.max_deposit_period)}},t.toTallyParams=function(t){return{quorum:new o.Dec(t.quorum),threshold:new o.Dec(t.threshold),veto:new o.Dec(t.veto)}},t.toPolicyConstraints=i.PolicyConstraints.fromData,t.toData=function(t){return t.toData()},t.serializeDepositParams=function(t){return{min_deposit:t.min_deposit.toData(),max_deposit_period:t.max_deposit_period.toFixed()}},t.serializeVotingParams=function(t){return{voting_period:t.voting_period.toFixed()}},t.serializeTallyParams=function(t){return{quorum:t.quorum.toString(),threshold:t.threshold.toString(),veto:t.veto.toString()}},t.serializeOracleWhitelist=function(t){return t.map((function(t){return{name:t.name,tobin_tax:t.tobin_tax.toString()}}))}}(e.Convert||(e.Convert={}))},function(t,e,r){"use strict";var n=r(30),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=h;var o=Object.create(r(24));o.inherits=r(1);var a=r(83),s=r(43);o.inherits(h,a);for(var u=i(s.prototype),c=0;c2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,i,a;if("string"==typeof e&&(i="not ",e.substr(0,i.length)===i)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))a="The ".concat(t," ").concat(n," ").concat(o(e,"type"));else{var s=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+".".length>t.length)&&-1!==t.indexOf(".",r)}(t)?"property":"argument";a='The "'.concat(t,'" ').concat(s," ").concat(n," ").concat(o(e,"type"))}return a+". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},function(t,e,r){"use strict";(function(e){var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=c;var i=r(74),o=r(78);r(1)(c,i);for(var a=n(o.prototype),s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise((function(r,n){function i(){void 0!==o&&t.removeListener("error",o),r([].slice.call(arguments))}var o;"error"!==e&&(o=function(r){t.removeListener(e,i),n(r)},t.once("error",o)),t.once(e,i)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function f(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function h(t,e,r,n){var i,o,a,s;if(c(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),a=o[e]),void 0===a)a=o[e]=r,++t._eventsCount;else if("function"==typeof a?a=o[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=f(t))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return t}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=d.bind(n);return i.listener=r,n.wrapFn=i,i}function p(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(a=e[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[t];if(void 0===u)return!1;if("function"==typeof u)o(u,this,e);else{var c=u.length,f=y(u,c);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return p(this,t,!0)},s.prototype.rawListeners=function(t){return p(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):b.call(t,e)},s.prototype.listenerCount=b,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){"use strict";var n=r(3).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=c,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=f,this.end=h,e=3;break;default:return this.write=d,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function d(t){return t.toString(this.encoding)}function l(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,r){(function(t){function r(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===r(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===r(t)},e.isObject=function(t){return"object"==typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===r(t)},e.isError=function(t){return"[object Error]"===r(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=t.isBuffer}).call(this,r(2).Buffer)},function(t,e,r){"use strict";var n=r(14),i=r(17);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=o,o.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o>>2]>>>24-o%4*8&255;e[n+o>>>2]|=a<<24-(n+o)%4*8}else for(o=0;o>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var r,n=[],i=function(e){e=e;var r=987654321,n=4294967295;return function(){var i=((r=36969*(65535&r)+(r>>16)&n)<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n;return i/=4294967296,(i+=.5)*(t.random()>.5?1:-1)}},o=0;o>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new a.init(r,e/2)}},c=s.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new a.init(r,e)}},f=s.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},h=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=f.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r=this._data,n=r.words,i=r.sigBytes,o=this.blockSize,s=i/(4*o),u=(s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0))*o,c=t.min(4*u,i);if(u){for(var f=0;f0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){s(t.precomputed);var r=t._getDoubles(),n=o(e,1,this._bitLength),i=(1<=u;e--)c=(c<<1)+n[e];a.push(c)}for(var f=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=i;d>0;d--){for(u=0;u=0;c--){for(e=0;c>=0&&0===a[c];c--)e++;if(c>=0&&e++,u=u.dblp(e),c<0)break;var f=a[c];s(0!==f),u="affine"===t.type?f>0?u.mixedAdd(i[f-1>>1]):u.mixedAdd(i[-f-1>>1].neg()):f>0?u.add(i[f-1>>1]):u.add(i[-f-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,n,i){for(var s=this._wnafT1,u=this._wnafT2,c=this._wnafT3,f=0,h=0;h=1;h-=2){var l=h-1,p=h;if(1===s[l]&&1===s[p]){var b=[e[l],null,null,e[p]];0===e[l].y.cmp(e[p].y)?(b[1]=e[l].add(e[p]),b[2]=e[l].toJ().mixedAdd(e[p].neg())):0===e[l].y.cmp(e[p].y.redNeg())?(b[1]=e[l].toJ().mixedAdd(e[p]),b[2]=e[l].add(e[p].neg())):(b[1]=e[l].toJ().mixedAdd(e[p]),b[2]=e[l].toJ().mixedAdd(e[p].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],g=a(r[l],r[p]);f=Math.max(g[0].length,f),c[l]=new Array(f),c[p]=new Array(f);for(var v=0;v=0;h--){for(var x=0;h>=0;){var M=!0;for(v=0;v=0&&x++,w=w.dblp(x),h<0)break;for(v=0;v0?O=u[v][P-1>>1]:P<0&&(O=u[v][-P-1>>1].neg()),w="affine"===O.type?w.mixedAdd(O):w.add(O))}}for(h=0;h=Math.ceil((t.bitLength()+1)/e.step)},c.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]>>32-e}function b(t,e,r,n,i,o,a,s){return p(t+(e^r^n)+o+a|0,s)+i|0}function y(t,e,r,n,i,o,a,s){return p(t+(e&r|~e&n)+o+a|0,s)+i|0}function g(t,e,r,n,i,o,a,s){return p(t+((e|~r)^n)+o+a|0,s)+i|0}function v(t,e,r,n,i,o,a,s){return p(t+(e&n|r&~n)+o+a|0,s)+i|0}function m(t,e,r,n,i,o,a,s){return p(t+(e^(r|~n))+o+a|0,s)+i|0}i(l,o),l.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,l=0|this._e,_=0|this._a,w=0|this._b,S=0|this._c,x=0|this._d,M=0|this._e,O=0;O<80;O+=1){var P,A;O<16?(P=b(r,n,i,o,l,t[s[O]],h[0],c[O]),A=m(_,w,S,x,M,t[u[O]],d[0],f[O])):O<32?(P=y(r,n,i,o,l,t[s[O]],h[1],c[O]),A=v(_,w,S,x,M,t[u[O]],d[1],f[O])):O<48?(P=g(r,n,i,o,l,t[s[O]],h[2],c[O]),A=g(_,w,S,x,M,t[u[O]],d[2],f[O])):O<64?(P=v(r,n,i,o,l,t[s[O]],h[3],c[O]),A=y(_,w,S,x,M,t[u[O]],d[3],f[O])):(P=m(r,n,i,o,l,t[s[O]],h[4],c[O]),A=b(_,w,S,x,M,t[u[O]],d[4],f[O])),r=l,l=o,o=p(i,10),i=n,n=P,_=M,M=x,x=p(S,10),S=w,w=A}var E=this._b+i+x|0;this._b=this._c+o+M|0,this._c=this._d+l+_|0,this._d=this._e+r+w|0,this._e=this._a+n+S|0,this._a=E},l.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=n.alloc?n.alloc(20):new n(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=l},function(t,e,r){(e=t.exports=function(t){t=t.toLowerCase();var r=e[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r}).sha=r(187),e.sha1=r(188),e.sha224=r(189),e.sha256=r(81),e.sha384=r(190),e.sha512=r(82)},function(t,e,r){var n=r(3).Buffer,i=r(191).Transform,o=r(23).StringDecoder;function a(t){i.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(1)(a,i),a.prototype.update=function(t,e,r){"string"==typeof t&&(t=n.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},a.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},a.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return t&&(e=this._toString(e,t,!0)),e},a.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},t.exports=a},function(t,e,r){var n=r(2),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},function(t,e,r){"use strict";(function(e,n,i){var o=r(30);function a(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(void 0),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=v;var s,u=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?n:o.nextTick;v.WritableState=g;var c=Object.create(r(24));c.inherits=r(1);var f,h={deprecate:r(79)},d=r(84),l=r(42).Buffer,p=i.Uint8Array||function(){},b=r(85);function y(){}function g(t,e){s=s||r(16),t=t||{};var n=e instanceof s;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,c=t.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=!1===t.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(o.nextTick(i,n),o.nextTick(M,t,e),t._writableState.errorEmitted=!0,t.emit("error",n)):(i(n),t._writableState.errorEmitted=!0,t.emit("error",n),M(t,e))}(t,r,n,e,i);else{var a=S(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||w(t,r),n?u(_,t,r,a,i):_(t,r,a,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function v(t){if(s=s||r(16),!(f.call(v,this)||this instanceof s))return new v(t);this._writableState=new g(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),d.call(this)}function m(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function _(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),M(t,e)}function w(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,m(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new a(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,h=r.callback;if(m(t,e,!1,e.objectMode?1:c.length,c,f,h),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function S(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function x(t,e){t._final((function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),M(t,e)}))}function M(t,e){var r=S(e);return r&&(function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(x,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}c.inherits(v,d),g.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(g.prototype,"buffer",{get:h.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(t){return!!f.call(this,t)||this===v&&t&&t._writableState instanceof g}})):f=function(t){return t instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(t,e,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=t,l.isBuffer(n)||n instanceof p);return s&&!l.isBuffer(t)&&(t=function(t){return l.from(t)}(t)),"function"==typeof e&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=y),i.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),o.nextTick(e,r)}(this,r):(s||function(t,e,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(t.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,t,r))&&(i.pendingcb++,a=function(t,e,r,n,i,o){if(!r){var a=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=l.from(e,r)),e}(e,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=e.objectMode?1:n.length;e.length+=s;var u=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(t,e,r){e.ending=!0,M(t,e),r&&(e.finished?o.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),v.prototype.destroy=b.destroy,v.prototype._undestroy=b.undestroy,v.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,r(7),r(195).setImmediate,r(12))},function(t,e,r){"use strict";var n,i=e,o=r(45),a=r(93),s=r(10).assert;function u(t){"short"===t.type?this.curve=new a.short(t):"edwards"===t.type?this.curve=new a.edwards(t):this.curve=new a.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new u(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(220)}catch(t){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},function(t,e,r){var n=e;n.utils=r(14),n.common=r(25),n.sha=r(214),n.ripemd=r(218),n.hmac=r(219),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(t,e){var r={Array:function(t){return null!=t&&t.constructor===Array},Boolean:function(t){return"boolean"==typeof t},Function:function(t){return"function"==typeof t},Nil:function(t){return null==t},Number:function(t){return"number"==typeof t},Object:function(t){return"object"==typeof t},String:function(t){return"string"==typeof t},"":function(){return!0}};for(var n in r.Null=r.Nil,r)r[n].toJSON=function(t){return t}.bind(null,n);t.exports=r},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Denom=void 0,function(t){t.LUNA="uluna",t.CNY="ucny",t.EUR="ueur",t.GBP="ugbp",t.JPY="ujpy",t.KRW="ukrw",t.MNT="umnt",t.SDR="usdr",t.USD="uusd"}(e.Denom||(e.Denom={}))},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(118),e),i(r(119),e)},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(120),e),i(r(121),e),i(r(122),e),i(r(123),e)},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(124),e),i(r(125),e),i(r(140),e)},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Proposal=void 0;var o=r(6),a=r(52),s=r(53),u=r(54),c=r(0),f=r(5),h=r(55),d=function(t){function e(e,r,n,i,o,a,s,u,c){var f=t.call(this)||this;return f.id=e,f.content=r,f.proposal_status=n,f.final_tally_result=i,f.submit_time=o,f.deposit_end_time=a,f.total_deposit=s,f.voting_start_time=u,f.voting_end_time=c,f}return i(e,t),e.fromData=function(t){var r,n=t.id,i=t.content,a=t.proposal_status,s=t.final_tally_result,u=t.submit_time,c=t.deposit_end_time,h=t.total_deposit,d=t.voting_start_time,l=t.voting_end_time;return s&&(r={yes:new f.Int(s.yes),no:new f.Int(s.no),abstain:new f.Int(s.abstain),no_with_veto:new f.Int(s.no_with_veto)}),new e(Number.parseInt(n),e.Content.fromData(i),a,r,new Date(u),new Date(c),o.Coins.fromData(h),new Date(d),new Date(l))},e.prototype.toData=function(){var t,e=this.proposal_status,r=this.final_tally_result;return r&&(t={yes:r.yes.toString(),no:r.no.toString(),abstain:r.abstain.toString(),no_with_veto:r.no_with_veto.toString()}),{id:this.id.toFixed(),content:this.content.toData(),proposal_status:e,final_tally_result:t,submit_time:this.submit_time.toISOString(),deposit_end_time:this.deposit_end_time.toISOString(),total_deposit:this.total_deposit.toData(),voting_start_time:this.voting_start_time.toISOString(),voting_end_time:this.voting_end_time.toISOString()}},e}(c.JSONSerializable);e.Proposal=d,function(t){!function(t){t.fromData=function(t){switch(t.type){case"gov/TextProposal":return s.TextProposal.fromData(t);case"distribution/CommunityPoolSpendProposal":return a.CommunityPoolSpendProposal.fromData(t);case"treasury/TaxRateUpdateProposal":return u.TaxRateUpdateProposal.fromData(t);case"treasury/RewardWeightUpdateProposal":return u.RewardWeightUpdateProposal.fromData(t);case"params/ParameterChangeProposal":return h.ParameterChangeProposal.fromData(t)}}}(t.Content||(t.Content={})),function(t){t.NIL="",t.DEPOSIT_PERIOD="DepositPeriod",t.VOTING_PERIOD="VotingPeriod",t.PASSED="Passed",t.REJECTED="Rejected",t.FAILED="Failed"}(t.Status||(t.Status={}))}(d=e.Proposal||(e.Proposal={})),e.Proposal=d},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(126),e)},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(127),e)},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(128),e),i(r(129),e)},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(130),e)},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function u(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=s(e)^n>>5}for(e=s(e),r=0;re)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;var o=(t=r).lastIndexOf("1");if(-1===o)return"No separator character for "+t;if(0===o)return"Missing prefix for "+t;var a=t.slice(0,o),c=t.slice(o+1);if(c.length<6)return"Data too short";var f=u(a);if("string"==typeof f)return f;for(var h=[],d=0;d=c.length||h.push(p)}return 1!==f?"Invalid checksum for "+t:{prefix:a,words:h}}function f(t,e,r,n){for(var i=0,o=0,a=(1<=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<=e)return"Excess padding";if(i<r)throw new TypeError("Exceeds length limit");var i=u(t=t.toLowerCase());if("string"==typeof i)throw new Error(i);for(var o=t+"1",a=0;a>5!=0)throw new Error("Non 5-bit word");i=s(i)^c,o+=n.charAt(c)}for(a=0;a<6;++a)i=s(i);for(i^=1,a=0;a<6;++a)o+=n.charAt(i>>5*(5-a)&31);return o},toWordsUnsafe:function(t){var e=f(t,8,5,!0);if(Array.isArray(e))return e},toWords:function(t){var e=f(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)},fromWordsUnsafe:function(t){var e=f(t,5,8,!1);if(Array.isArray(e))return e},fromWords:function(t){var e=f(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}}},function(t,e,r){"use strict";(function(t){var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]>>32-e}function c(t,e,r,n,i,o,a){return u(t+(e&r|~e&n)+i+o|0,a)+e|0}function f(t,e,r,n,i,o,a){return u(t+(e&n|r&~n)+i+o|0,a)+e|0}function h(t,e,r,n,i,o,a){return u(t+(e^r^n)+i+o|0,a)+e|0}function d(t,e,r,n,i,o,a){return u(t+(r^(e|~n))+i+o|0,a)+e|0}n(s,i),s.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,o=this._d;r=c(r,n,i,o,t[0],3614090360,7),o=c(o,r,n,i,t[1],3905402710,12),i=c(i,o,r,n,t[2],606105819,17),n=c(n,i,o,r,t[3],3250441966,22),r=c(r,n,i,o,t[4],4118548399,7),o=c(o,r,n,i,t[5],1200080426,12),i=c(i,o,r,n,t[6],2821735955,17),n=c(n,i,o,r,t[7],4249261313,22),r=c(r,n,i,o,t[8],1770035416,7),o=c(o,r,n,i,t[9],2336552879,12),i=c(i,o,r,n,t[10],4294925233,17),n=c(n,i,o,r,t[11],2304563134,22),r=c(r,n,i,o,t[12],1804603682,7),o=c(o,r,n,i,t[13],4254626195,12),i=c(i,o,r,n,t[14],2792965006,17),r=f(r,n=c(n,i,o,r,t[15],1236535329,22),i,o,t[1],4129170786,5),o=f(o,r,n,i,t[6],3225465664,9),i=f(i,o,r,n,t[11],643717713,14),n=f(n,i,o,r,t[0],3921069994,20),r=f(r,n,i,o,t[5],3593408605,5),o=f(o,r,n,i,t[10],38016083,9),i=f(i,o,r,n,t[15],3634488961,14),n=f(n,i,o,r,t[4],3889429448,20),r=f(r,n,i,o,t[9],568446438,5),o=f(o,r,n,i,t[14],3275163606,9),i=f(i,o,r,n,t[3],4107603335,14),n=f(n,i,o,r,t[8],1163531501,20),r=f(r,n,i,o,t[13],2850285829,5),o=f(o,r,n,i,t[2],4243563512,9),i=f(i,o,r,n,t[7],1735328473,14),r=h(r,n=f(n,i,o,r,t[12],2368359562,20),i,o,t[5],4294588738,4),o=h(o,r,n,i,t[8],2272392833,11),i=h(i,o,r,n,t[11],1839030562,16),n=h(n,i,o,r,t[14],4259657740,23),r=h(r,n,i,o,t[1],2763975236,4),o=h(o,r,n,i,t[4],1272893353,11),i=h(i,o,r,n,t[7],4139469664,16),n=h(n,i,o,r,t[10],3200236656,23),r=h(r,n,i,o,t[13],681279174,4),o=h(o,r,n,i,t[0],3936430074,11),i=h(i,o,r,n,t[3],3572445317,16),n=h(n,i,o,r,t[6],76029189,23),r=h(r,n,i,o,t[9],3654602809,4),o=h(o,r,n,i,t[12],3873151461,11),i=h(i,o,r,n,t[15],530742520,16),r=d(r,n=h(n,i,o,r,t[2],3299628645,23),i,o,t[0],4096336452,6),o=d(o,r,n,i,t[7],1126891415,10),i=d(i,o,r,n,t[14],2878612391,15),n=d(n,i,o,r,t[5],4237533241,21),r=d(r,n,i,o,t[12],1700485571,6),o=d(o,r,n,i,t[3],2399980690,10),i=d(i,o,r,n,t[10],4293915773,15),n=d(n,i,o,r,t[1],2240044497,21),r=d(r,n,i,o,t[8],1873313359,6),o=d(o,r,n,i,t[15],4264355552,10),i=d(i,o,r,n,t[6],2734768916,15),n=d(n,i,o,r,t[13],1309151649,21),r=d(r,n,i,o,t[4],4149444226,6),o=d(o,r,n,i,t[11],3174756917,10),i=d(i,o,r,n,t[2],718787259,15),n=d(n,i,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=s},function(t,e,r){"use strict";var n=r(3).Buffer,i=r(179).Transform;function o(t){i.call(this),this._block=n.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(1)(o,i),o.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!n.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer")}(t),this._finalized)throw new Error("Digest already called");n.isBuffer(t)||(t=n.from(t,e));for(var r=this._block,i=0;this._blockOffset+t.length-i>=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},function(t,e,r){"use strict";(function(e,n){var i;t.exports=O,O.ReadableState=M,r(22).EventEmitter;var o,a=function(t,e){return t.listeners(e).length},s=r(75),u=r(2).Buffer,c=e.Uint8Array||function(){},f=r(180);o=f&&f.debuglog?f.debuglog("stream"):function(){};var h,d,l,p=r(181),b=r(76),y=r(77).getHighWaterMark,g=r(19).codes,v=g.ERR_INVALID_ARG_TYPE,m=g.ERR_STREAM_PUSH_AFTER_EOF,_=g.ERR_METHOD_NOT_IMPLEMENTED,w=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(1)(O,s);var S=b.errorOrDestroy,x=["error","close","destroy","pause","resume"];function M(t,e,n){i=i||r(20),t=t||{},"boolean"!=typeof n&&(n=e instanceof i),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=y(this,t,"readableHighWaterMark",n),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(h||(h=r(23).StringDecoder),this.decoder=new h(t.encoding),this.encoding=t.encoding)}function O(t){if(i=i||r(20),!(this instanceof O))return new O(t);var e=this instanceof i;this._readableState=new M(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function P(t,e,r,n,i){o("readableAddChunk",e);var a,s=t._readableState;if(null===e)s.reading=!1,function(t,e){if(o("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?k(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,j(t)))}}(t,s);else if(i||(a=function(t,e){var r,n;return n=e,u.isBuffer(n)||n instanceof c||"string"==typeof e||void 0===e||t.objectMode||(r=new v("chunk",["string","Buffer","Uint8Array"],e)),r}(s,e)),a)S(t,a);else if(s.objectMode||e&&e.length>0)if("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),n)s.endEmitted?S(t,new w):A(t,s,e,!0);else if(s.ended)S(t,new m);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?A(t,s,e,!1):D(t,s)):A(t,s,e,!1)}else n||(s.reading=!1,D(t,s));return!s.ended&&(s.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function k(t){var e=t._readableState;o("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(o("emitReadable",e.flowing),e.emittedReadable=!0,n.nextTick(j,t))}function j(t){var e=t._readableState;o("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,N(t)}function D(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(I,t,e))}function I(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function C(t){o("readable nexttick read 0"),t.read(0)}function T(t,e){o("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),N(t),e.flowing&&!e.reading&&t.read(0)}function N(t){var e=t._readableState;for(o("flow",e.flowing);e.flowing&&null!==t.read(););}function B(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function z(t){var e=t._readableState;o("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,n.nextTick(q,e,t))}function q(t,e){if(o("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function L(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return o("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?z(this):k(this),null;if(0===(t=E(t,e))&&e.ended)return 0===e.length&&z(this),null;var n,i=e.needReadable;return o("need readable",i),(0===e.length||e.length-t0?B(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&z(this)),null!==n&&this.emit("data",n),n},O.prototype._read=function(t){S(this,new _("_read()"))},O.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,o("pipe count=%d opts=%j",i.pipesCount,e);var s=e&&!1===e.end||t===n.stdout||t===n.stderr?b:u;function u(){o("onend"),t.end()}i.endEmitted?n.nextTick(s):r.once("end",s),t.on("unpipe",(function e(n,a){o("onunpipe"),n===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,o("cleanup"),t.removeListener("close",l),t.removeListener("finish",p),t.removeListener("drain",c),t.removeListener("error",d),t.removeListener("unpipe",e),r.removeListener("end",u),r.removeListener("end",b),r.removeListener("data",h),f=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}));var c=function(t){return function(){var e=t._readableState;o("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,N(t))}}(r);t.on("drain",c);var f=!1;function h(e){o("ondata");var n=t.write(e);o("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==L(i.pipes,t))&&!f&&(o("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function d(e){o("onerror",e),b(),t.removeListener("error",d),0===a(t,"error")&&S(t,e)}function l(){t.removeListener("finish",p),b()}function p(){o("onfinish"),t.removeListener("close",l),b()}function b(){o("unpipe"),r.unpipe(t)}return r.on("data",h),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",l),t.once("finish",p),t.emit("pipe",r),i.flowing||(o("pipe resume"),r.resume()),t},O.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,o("on readable",i.length,i.reading),i.length?k(this):i.reading||n.nextTick(C,this))),r},O.prototype.addListener=O.prototype.on,O.prototype.removeListener=function(t,e){var r=s.prototype.removeListener.call(this,t,e);return"readable"===t&&n.nextTick(R,this),r},O.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||n.nextTick(R,this),e},O.prototype.resume=function(){var t=this._readableState;return t.flowing||(o("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,n.nextTick(T,t,e))}(this,t)),t.paused=!1,this},O.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},O.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var a=0;a-1))throw new w(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(O.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(O.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),O.prototype._write=function(t,e,r){r(new b("_write()"))},O.prototype._writev=null,O.prototype.end=function(t,e,r){var i=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,r){e.ending=!0,D(t,e),r&&(e.finished?n.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,i,r),this},Object.defineProperty(O.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),O.prototype.destroy=h.destroy,O.prototype._undestroy=h.undestroy,O.prototype._destroy=function(t,e){e(t)}}).call(this,r(12),r(7))},function(t,e,r){(function(e){function r(t){try{if(!e.localStorage)return!1}catch(t){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}}).call(this,r(12))},function(t,e,r){"use strict";t.exports=f;var n=r(19).codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(20);function c(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function d(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function l(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,p=0|this._f,b=0|this._g,y=0|this._h,g=0;g<16;++g)r[g]=t.readInt32BE(4*g);for(;g<64;++g)r[g]=0|(((e=r[g-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[g-7]+l(r[g-15])+r[g-16];for(var v=0;v<64;++v){var m=y+d(u)+c(u,p,b)+a[v]+r[v]|0,_=h(n)+f(n,i,o)|0;y=b,b=p,p=u,u=s+m|0,s=o,o=i,i=n,n=m+_|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=y+this._h|0},u.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=u},function(t,e,r){var n=r(1),i=r(21),o=r(3).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}function c(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function h(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function d(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function l(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function b(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function y(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function g(t,e){return t>>>0>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,u=0|this._fh,v=0|this._gh,m=0|this._hh,_=0|this._al,w=0|this._bl,S=0|this._cl,x=0|this._dl,M=0|this._el,O=0|this._fl,P=0|this._gl,A=0|this._hl,E=0;E<32;E+=2)e[E]=t.readInt32BE(4*E),e[E+1]=t.readInt32BE(4*E+4);for(;E<160;E+=2){var k=e[E-30],j=e[E-30+1],D=l(k,j),I=p(j,k),R=b(k=e[E-4],j=e[E-4+1]),C=y(j,k),T=e[E-14],N=e[E-14+1],B=e[E-32],z=e[E-32+1],q=I+N|0,L=D+T+g(q,I)|0;L=(L=L+R+g(q=q+C|0,C)|0)+B+g(q=q+z|0,z)|0,e[E]=L,e[E+1]=q}for(var U=0;U<160;U+=2){L=e[U],q=e[U+1];var F=f(r,n,i),K=f(_,w,S),V=h(r,_),J=h(_,r),W=d(s,M),H=d(M,s),Y=a[U],G=a[U+1],Z=c(s,u,v),X=c(M,O,P),$=A+H|0,Q=m+W+g($,A)|0;Q=(Q=(Q=Q+Z+g($=$+X|0,X)|0)+Y+g($=$+G|0,G)|0)+L+g($=$+q|0,q)|0;var tt=J+K|0,et=V+F+g(tt,J)|0;m=v,A=P,v=u,P=O,u=s,O=M,s=o+Q+g(M=x+$|0,x)|0,o=i,x=S,i=n,S=w,n=r,w=_,r=Q+et+g(_=$+tt|0,$)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+S|0,this._dl=this._dl+x|0,this._el=this._el+M|0,this._fl=this._fl+O|0,this._gl=this._gl+P|0,this._hl=this._hl+A|0,this._ah=this._ah+r+g(this._al,_)|0,this._bh=this._bh+n+g(this._bl,w)|0,this._ch=this._ch+i+g(this._cl,S)|0,this._dh=this._dh+o+g(this._dl,x)|0,this._eh=this._eh+s+g(this._el,M)|0,this._fh=this._fh+u+g(this._fl,O)|0,this._gh=this._gh+v+g(this._gl,P)|0,this._hh=this._hh+m+g(this._hl,A)|0},u.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=u},function(t,e,r){"use strict";(function(e,n){var i=r(30);t.exports=m;var o,a=r(66);m.ReadableState=v,r(22).EventEmitter;var s=function(t,e){return t.listeners(e).length},u=r(84),c=r(42).Buffer,f=e.Uint8Array||function(){},h=Object.create(r(24));h.inherits=r(1);var d=r(192),l=void 0;l=d&&d.debuglog?d.debuglog("stream"):function(){};var p,b=r(193),y=r(85);h.inherits(m,u);var g=["error","close","destroy","pause","resume"];function v(t,e){t=t||{};var n=e instanceof(o=o||r(16));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,a=t.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new b,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=r(23).StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function m(t){if(o=o||r(16),!(this instanceof m))return new m(t);this._readableState=new v(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),u.call(this)}function _(t,e,r,n,i){var o,a=t._readableState;return null===e?(a.reading=!1,function(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,x(t)}}(t,a)):(i||(o=function(t,e){var r,n;return n=e,c.isBuffer(n)||n instanceof f||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(a,e)),o?t.emit("error",o):a.objectMode||e&&e.length>0?("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===c.prototype||(e=function(t){return c.from(t)}(e)),n?a.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):w(t,a,e,!0):a.ended?t.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?w(t,a,e,!1):O(t,a)):w(t,a,e,!1))):n||(a.reading=!1)),function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=8388608?t=8388608:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function x(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(l("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(M,t):M(t))}function M(t){l("emit readable"),t.emit("readable"),k(t)}function O(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(P,t,e))}function P(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;return to.length?o.length:t;if(a===o.length?i+=o:i+=o.slice(0,t),0==(t-=a)){a===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=c.allocUnsafe(t),n=e.head,i=1;for(n.data.copy(r),t-=n.data.length;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,a),0==(t-=a)){a===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(a));break}++i}return e.length-=i,r}(t,e),n}(t,e.buffer,e.decoder),r);var r}function D(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(I,e,t))}function I(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function R(t,e){for(var r=0,n=t.length;r=e.highWaterMark||e.ended))return l("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?D(this):x(this),null;if(0===(t=S(t,e))&&e.ended)return 0===e.length&&D(this),null;var n,i=e.needReadable;return l("need readable",i),(0===e.length||e.length-t0?j(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&D(this)),null!==n&&this.emit("data",n),n},m.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},m.prototype.pipe=function(t,e){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,l("pipe count=%d opts=%j",o.pipesCount,e);var u=e&&!1===e.end||t===n.stdout||t===n.stderr?v:c;function c(){l("onend"),t.end()}o.endEmitted?i.nextTick(u):r.once("end",u),t.on("unpipe",(function e(n,i){l("onunpipe"),n===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,l("cleanup"),t.removeListener("close",y),t.removeListener("finish",g),t.removeListener("drain",f),t.removeListener("error",b),t.removeListener("unpipe",e),r.removeListener("end",c),r.removeListener("end",v),r.removeListener("data",p),h=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}));var f=function(t){return function(){var e=t._readableState;l("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,k(t))}}(r);t.on("drain",f);var h=!1,d=!1;function p(e){l("ondata"),d=!1,!1!==t.write(e)||d||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==R(o.pipes,t))&&!h&&(l("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,d=!0),r.pause())}function b(e){l("onerror",e),v(),t.removeListener("error",b),0===s(t,"error")&&t.emit("error",e)}function y(){t.removeListener("finish",g),v()}function g(){l("onfinish"),t.removeListener("close",y),v()}function v(){l("unpipe"),r.unpipe(t)}return r.on("data",p),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?a(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",b),t.once("close",y),t.once("finish",g),t.emit("pipe",r),o.flowing||(l("pipe resume"),r.resume()),t},m.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;or?e=("rmd160"===t?new u:c(t)).update(e).digest():e.length>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(t,e){return"hex"===e?o(t):t}},function(t,e,r){var n;function i(t){this.rand=t}if(t.exports=function(t){return n||(n=new i(null)),n.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},function(t,e,r){"use strict";var n=r(14),i=r(25),o=r(94),a=r(17),s=n.sum32,u=n.sum32_4,c=n.sum32_5,f=o.ch32,h=o.maj32,d=o.s0_256,l=o.s1_256,p=o.g0_256,b=o.g1_256,y=i.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(v,y),t.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;nr||e!=e)throw new TypeError("Bad key length")}},function(t,e,r){(function(e){var r;r=e.browser?"utf-8":e.version?parseInt(e.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary":"utf-8",t.exports=r}).call(this,r(7))},function(t,e,r){var n=r(88),i=r(39),o=r(40),a=r(3).Buffer,s=r(98),u=r(99),c=r(101),f=a.alloc(128),h={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function d(t,e,r){var s=function(t){return"rmd160"===t||"ripemd160"===t?function(t){return(new i).update(t).digest()}:"md5"===t?n:function(e){return o(t).update(e).digest()}}(t),u="sha512"===t||"sha384"===t?128:64;e.length>u?e=s(e):e.length=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(t){u.headers[t]={}})),n.forEach(["post","put","patch"],(function(t){u.headers[t]=n.merge(o)})),t.exports=u}).call(this,r(7))},function(t,e,r){"use strict";var n=r(9),i=r(249),o=r(251),a=r(106),s=r(252),u=r(255),c=r(256),f=r(110);t.exports=function(t){return new Promise((function(e,r){var h=t.data,d=t.headers;n.isFormData(h)&&delete d["Content-Type"],(n.isBlob(h)||n.isFile(h))&&h.type&&delete d["Content-Type"];var l=new XMLHttpRequest;if(t.auth){var p=t.auth.username||"",b=unescape(encodeURIComponent(t.auth.password))||"";d.Authorization="Basic "+btoa(p+":"+b)}var y=s(t.baseURL,t.url);if(l.open(t.method.toUpperCase(),a(y,t.params,t.paramsSerializer),!0),l.timeout=t.timeout,l.onreadystatechange=function(){if(l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in l?u(l.getAllResponseHeaders()):null,o={data:t.responseType&&"text"!==t.responseType?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:n,config:t,request:l};i(e,r,o),l=null}},l.onabort=function(){l&&(r(f("Request aborted",t,"ECONNABORTED",l)),l=null)},l.onerror=function(){r(f("Network Error",t,null,l)),l=null},l.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(f(e,t,"ECONNABORTED",l)),l=null},n.isStandardBrowserEnv()){var g=(t.withCredentials||c(y))&&t.xsrfCookieName?o.read(t.xsrfCookieName):void 0;g&&(d[t.xsrfHeaderName]=g)}if("setRequestHeader"in l&&n.forEach(d,(function(t,e){void 0===h&&"content-type"===e.toLowerCase()?delete d[e]:l.setRequestHeader(e,t)})),n.isUndefined(t.withCredentials)||(l.withCredentials=!!t.withCredentials),t.responseType)try{l.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&l.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){l&&(l.abort(),r(t),l=null)})),h||(h=null),l.send(h)}))}},function(t,e,r){"use strict";var n=r(250);t.exports=function(t,e,r,i,o){var a=new Error(t);return n(a,e,r,i,o)}},function(t,e,r){"use strict";var n=r(9);t.exports=function(t,e){e=e||{};var r={},i=["url","method","data"],o=["headers","auth","proxy","params"],a=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],s=["validateStatus"];function u(t,e){return n.isPlainObject(t)&&n.isPlainObject(e)?n.merge(t,e):n.isPlainObject(e)?n.merge({},e):n.isArray(e)?e.slice():e}function c(i){n.isUndefined(e[i])?n.isUndefined(t[i])||(r[i]=u(void 0,t[i])):r[i]=u(t[i],e[i])}n.forEach(i,(function(t){n.isUndefined(e[t])||(r[t]=u(void 0,e[t]))})),n.forEach(o,c),n.forEach(a,(function(i){n.isUndefined(e[i])?n.isUndefined(t[i])||(r[i]=u(void 0,t[i])):r[i]=u(void 0,e[i])})),n.forEach(s,(function(n){n in e?r[n]=u(t[n],e[n]):n in t&&(r[n]=u(void 0,t[n]))}));var f=i.concat(o).concat(a).concat(s),h=Object.keys(t).concat(Object.keys(e)).filter((function(t){return-1===f.indexOf(t)}));return n.forEach(h,c),r}},function(t,e,r){"use strict";function n(t){this.message=t}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,t.exports=n},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(259),e),i(r(260),e),i(r(261),e),i(r(262),e),i(r(263),e),i(r(264),e),i(r(265),e),i(r(266),e),i(r(267),e),i(r(268),e),i(r(269),e),i(r(270),e),i(r(271),e),i(r(274),e)},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0){for(o+=a,e=1;er)throw Error(p+t)}function A(t,e,r,n){var i,o,a,s;for(o=t[0];o>=10;o/=10)--e;return--e<0?(e+=7,i=0):(i=Math.ceil((e+1)/7),e%=7),o=y(10,7-e),s=t[i]%o|0,null==n?e<3?(0==e?s=s/100|0:1==e&&(s=s/10|0),a=r<4&&99999==s||r>3&&49999==s||5e4==s||0==s):a=(r<4&&s+1==o||r>3&&s+1==o/2)&&(t[i+1]/o/100|0)==y(10,e-2)-1||(s==o/2||0==s)&&0==(t[i+1]/o/100|0):e<4?(0==e?s=s/1e3|0:1==e?s=s/100|0:2==e&&(s=s/10|0),a=(n||r<4)&&9999==s||!n&&r>3&&4999==s):a=((n||r<4)&&s+1==o||!n&&r>3&&s+1==o/2)&&(t[i+1]/o/1e3|0)==y(10,e-3)-1,a}function E(t,e,r){for(var n,i,o=[0],a=0,s=t.length;ar-1&&(void 0===o[n+1]&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}M.absoluteValue=M.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),j(t)},M.ceil=function(){return j(new this.constructor(this),this.e+1,2)},M.comparedTo=M.cmp=function(t){var e,r,n,i,o=this,a=o.d,s=(t=new o.constructor(t)).d,u=o.s,c=t.s;if(!a||!s)return u&&c?u!==c?u:a===s?0:!a^u<0?1:-1:NaN;if(!a[0]||!s[0])return a[0]?u:s[0]?-c:0;if(u!==c)return u;if(o.e!==t.e)return o.e>t.e^u<0?1:-1;for(e=0,r=(n=a.length)<(i=s.length)?n:i;es[e]^u<0?1:-1;return n===i?0:n>i^u<0?1:-1},M.cosine=M.cos=function(){var t,e,r=this,n=r.constructor;return r.d?r.d[0]?(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(t,e){var r,n,i=e.d.length;i<32?n=(1/W(4,r=Math.ceil(i/3))).toString():(r=16,n="2.3283064365386962890625e-10"),t.precision+=r,e=J(t,1,e.times(n),new t(1));for(var o=r;o--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return t.precision-=r,e}(n,H(n,r)),n.precision=t,n.rounding=e,j(2==s||3==s?r.neg():r,t,e,!0)):new n(1):new n(NaN)},M.cubeRoot=M.cbrt=function(){var t,e,r,n,i,o,a,s,u,c,f=this,h=f.constructor;if(!f.isFinite()||f.isZero())return new h(f);for(l=!1,(o=f.s*y(f.s*f,1/3))&&Math.abs(o)!=1/0?n=new h(o.toString()):(r=O(f.d),(o=((t=f.e)-r.length+1)%3)&&(r+=1==o||-2==o?"0":"00"),o=y(r,1/3),t=b((t+1)/3)-(t%3==(t<0?-1:2)),(n=new h(r=o==1/0?"5e"+t:(r=o.toExponential()).slice(0,r.indexOf("e")+1)+t)).s=f.s),a=(t=h.precision)+3;;)if(c=(u=(s=n).times(s).times(s)).plus(f),n=k(c.plus(f).times(s),c.plus(u),a+2,1),O(s.d).slice(0,a)===(r=O(n.d)).slice(0,a)){if("9999"!=(r=r.slice(a-3,a+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(j(n,t+1,1),e=!n.times(n).times(n).eq(f));break}if(!i&&(j(s,t+1,0),s.times(s).times(s).eq(f))){n=s;break}a+=4,i=1}return l=!0,j(n,t,h.rounding,e)},M.decimalPlaces=M.dp=function(){var t,e=this.d,r=NaN;if(e){if(r=7*((t=e.length-1)-b(this.e/7)),t=e[t])for(;t%10==0;t/=10)r--;r<0&&(r=0)}return r},M.dividedBy=M.div=function(t){return k(this,new this.constructor(t))},M.dividedToIntegerBy=M.divToInt=function(t){var e=this.constructor;return j(k(this,new e(t),0,1,1),e.precision,e.rounding)},M.equals=M.eq=function(t){return 0===this.cmp(t)},M.floor=function(){return j(new this.constructor(this),this.e+1,3)},M.greaterThan=M.gt=function(t){return this.cmp(t)>0},M.greaterThanOrEqualTo=M.gte=function(t){var e=this.cmp(t);return 1==e||0===e},M.hyperbolicCosine=M.cosh=function(){var t,e,r,n,i,o=this,a=o.constructor,s=new a(1);if(!o.isFinite())return new a(o.s?1/0:NaN);if(o.isZero())return s;r=a.precision,n=a.rounding,a.precision=r+Math.max(o.e,o.sd())+4,a.rounding=1,(i=o.d.length)<32?e=(1/W(4,t=Math.ceil(i/3))).toString():(t=16,e="2.3283064365386962890625e-10"),o=J(a,1,o.times(e),new a(1),!0);for(var u,c=t,f=new a(8);c--;)u=o.times(o),o=s.minus(u.times(f.minus(u.times(f))));return j(o,a.precision=r,a.rounding=n,!0)},M.hyperbolicSine=M.sinh=function(){var t,e,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(e=o.precision,r=o.rounding,o.precision=e+Math.max(i.e,i.sd())+4,o.rounding=1,(n=i.d.length)<3)i=J(o,2,i,i,!0);else{t=(t=1.4*Math.sqrt(n))>16?16:0|t,i=J(o,2,i=i.times(1/W(5,t)),i,!0);for(var a,s=new o(5),u=new o(16),c=new o(20);t--;)a=i.times(i),i=i.times(s.plus(a.times(u.times(a).plus(c))))}return o.precision=e,o.rounding=r,j(i,e,r,!0)},M.hyperbolicTangent=M.tanh=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+7,n.rounding=1,k(r.sinh(),r.cosh(),n.precision=t,n.rounding=e)):new n(r.s)},M.inverseCosine=M.acos=function(){var t,e=this,r=e.constructor,n=e.abs().cmp(1),i=r.precision,o=r.rounding;return-1!==n?0===n?e.isNeg()?C(r,i,o):new r(0):new r(NaN):e.isZero()?C(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,e=e.asin(),t=C(r,i+4,o).times(.5),r.precision=i,r.rounding=o,t.minus(e))},M.inverseHyperbolicCosine=M.acosh=function(){var t,e,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(t=n.precision,e=n.rounding,n.precision=t+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,l=!1,r=r.times(r).minus(1).sqrt().plus(r),l=!0,n.precision=t,n.rounding=e,r.ln()):new n(r)},M.inverseHyperbolicSine=M.asinh=function(){var t,e,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,l=!1,r=r.times(r).plus(1).sqrt().plus(r),l=!0,n.precision=t,n.rounding=e,r.ln())},M.inverseHyperbolicTangent=M.atanh=function(){var t,e,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=o.precision,e=o.rounding,n=i.sd(),Math.max(n,t)<2*-i.e-1?j(new o(i),t,e,!0):(o.precision=r=n-i.e,i=k(i.plus(1),new o(1).minus(i),r+t,1),o.precision=t+4,o.rounding=1,i=i.ln(),o.precision=t,o.rounding=e,i.times(.5))):new o(NaN)},M.inverseSine=M.asin=function(){var t,e,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(e=i.abs().cmp(1),r=o.precision,n=o.rounding,-1!==e?0===e?((t=C(o,r+4,n).times(.5)).s=i.s,t):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))},M.inverseTangent=M.atan=function(){var t,e,r,n,i,o,a,s,u,c=this,f=c.constructor,h=f.precision,d=f.rounding;if(c.isFinite()){if(c.isZero())return new f(c);if(c.abs().eq(1)&&h+4<=x)return(a=C(f,h+4,d).times(.25)).s=c.s,a}else{if(!c.s)return new f(NaN);if(h+4<=x)return(a=C(f,h+4,d).times(.5)).s=c.s,a}for(f.precision=s=h+10,f.rounding=1,t=r=Math.min(28,s/7+2|0);t;--t)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(l=!1,e=Math.ceil(s/7),n=1,u=c.times(c),a=new f(c),i=c;-1!==t;)if(i=i.times(u),o=a.minus(i.div(n+=2)),i=i.times(u),void 0!==(a=o.plus(i.div(n+=2))).d[e])for(t=e;a.d[t]===o.d[t]&&t--;);return r&&(a=a.times(2<this.d.length-2},M.isNaN=function(){return!this.s},M.isNegative=M.isNeg=function(){return this.s<0},M.isPositive=M.isPos=function(){return this.s>0},M.isZero=function(){return!!this.d&&0===this.d[0]},M.lessThan=M.lt=function(t){return this.cmp(t)<0},M.lessThanOrEqualTo=M.lte=function(t){return this.cmp(t)<1},M.logarithm=M.log=function(t){var e,r,n,i,o,a,s,u,c=this.constructor,f=c.precision,h=c.rounding;if(null==t)t=new c(10),e=!0;else{if(r=(t=new c(t)).d,t.s<0||!r||!r[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(r=this.d,this.s<0||!r||!r[0]||this.eq(1))return new c(r&&!r[0]?-1/0:1!=this.s?NaN:r?0:1/0);if(e)if(r.length>1)o=!0;else{for(i=r[0];i%10==0;)i/=10;o=1!==i}if(l=!1,a=U(this,s=f+5),n=e?R(c,s+10):U(t,s),A((u=k(a,n,s,1)).d,i=f,h))do{if(a=U(this,s+=10),n=e?R(c,s+10):U(t,s),u=k(a,n,s,1),!o){+O(u.d).slice(i+1,i+15)+1==1e14&&(u=j(u,f+1,0));break}}while(A(u.d,i+=10,h));return l=!0,j(u,f,h)},M.minus=M.sub=function(t){var e,r,n,i,o,a,s,u,c,f,h,d,p=this,y=p.constructor;if(t=new y(t),!p.d||!t.d)return p.s&&t.s?p.d?t.s=-t.s:t=new y(t.d||p.s!==t.s?p:NaN):t=new y(NaN),t;if(p.s!=t.s)return t.s=-t.s,p.plus(t);if(c=p.d,d=t.d,s=y.precision,u=y.rounding,!c[0]||!d[0]){if(d[0])t.s=-t.s;else{if(!c[0])return new y(3===u?-0:0);t=new y(p)}return l?j(t,s,u):t}if(r=b(t.e/7),f=b(p.e/7),c=c.slice(),o=f-r){for((h=o<0)?(e=c,o=-o,a=d.length):(e=d,r=f,a=c.length),o>(n=Math.max(Math.ceil(s/7),a)+2)&&(o=n,e.length=1),e.reverse(),n=o;n--;)e.push(0);e.reverse()}else{for((h=(n=c.length)<(a=d.length))&&(a=n),n=0;n0;--n)c[a++]=0;for(n=d.length;n>o;){if(c[--n](a=(o=Math.ceil(s/7))>a?o+1:a+1)&&(i=a,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for((a=c.length)-(i=f.length)<0&&(i=a,r=f,f=c,c=r),e=0;i;)e=(c[--i]=c[i]+f[i]+e)/w|0,c[i]%=w;for(e&&(c.unshift(e),++n),a=c.length;0==c[--a];)c.pop();return t.d=c,t.e=I(c,n),l?j(t,s,u):t},M.precision=M.sd=function(t){var e,r=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(p+t);return r.d?(e=T(r.d),t&&r.e+1>e&&(e=r.e+1)):e=NaN,e},M.round=function(){var t=this,e=t.constructor;return j(new e(t),t.e+1,e.rounding)},M.sine=M.sin=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(t,e){var r,n=e.d.length;if(n<3)return J(t,2,e,e);r=(r=1.4*Math.sqrt(n))>16?16:0|r,e=J(t,2,e=e.times(1/W(5,r)),e);for(var i,o=new t(5),a=new t(16),s=new t(20);r--;)i=e.times(e),e=e.times(o.plus(i.times(a.times(i).minus(s))));return e}(n,H(n,r)),n.precision=t,n.rounding=e,j(s>2?r.neg():r,t,e,!0)):new n(NaN)},M.squareRoot=M.sqrt=function(){var t,e,r,n,i,o,a=this,s=a.d,u=a.e,c=a.s,f=a.constructor;if(1!==c||!s||!s[0])return new f(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);for(l=!1,0==(c=Math.sqrt(+a))||c==1/0?(((e=O(s)).length+u)%2==0&&(e+="0"),c=Math.sqrt(e),u=b((u+1)/2)-(u<0||u%2),n=new f(e=c==1/0?"1e"+u:(e=c.toExponential()).slice(0,e.indexOf("e")+1)+u)):n=new f(c.toString()),r=(u=f.precision)+3;;)if(n=(o=n).plus(k(a,o,r+2,1)).times(.5),O(o.d).slice(0,r)===(e=O(n.d)).slice(0,r)){if("9999"!=(e=e.slice(r-3,r+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(j(n,u+1,1),t=!n.times(n).eq(a));break}if(!i&&(j(o,u+1,0),o.times(o).eq(a))){n=o;break}r+=4,i=1}return l=!0,j(n,u,f.rounding,t)},M.tangent=M.tan=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+10,n.rounding=1,(r=r.sin()).s=1,r=k(r,new n(1).minus(r.times(r)).sqrt(),t+10,0),n.precision=t,n.rounding=e,j(2==s||4==s?r.neg():r,t,e,!0)):new n(NaN)},M.times=M.mul=function(t){var e,r,n,i,o,a,s,u,c,f=this,h=f.constructor,d=f.d,p=(t=new h(t)).d;if(t.s*=f.s,!(d&&d[0]&&p&&p[0]))return new h(!t.s||d&&!d[0]&&!p||p&&!p[0]&&!d?NaN:d&&p?0*t.s:t.s/0);for(r=b(f.e/7)+b(t.e/7),(u=d.length)<(c=p.length)&&(o=d,d=p,p=o,a=u,u=c,c=a),o=[],n=a=u+c;n--;)o.push(0);for(n=c;--n>=0;){for(e=0,i=u+n;i>n;)s=o[i]+p[n]*d[i-n-1]+e,o[i--]=s%w|0,e=s/w|0;o[i]=(o[i]+e)%w|0}for(;!o[--a];)o.pop();return e?++r:o.shift(),t.d=o,t.e=I(o,r),l?j(t,h.precision,h.rounding):t},M.toBinary=function(t,e){return Y(this,2,t,e)},M.toDecimalPlaces=M.toDP=function(t,e){var r=this,n=r.constructor;return r=new n(r),void 0===t?r:(P(t,0,1e9),void 0===e?e=n.rounding:P(e,0,8),j(r,t+r.e+1,e))},M.toExponential=function(t,e){var r,n=this,i=n.constructor;return void 0===t?r=D(n,!0):(P(t,0,1e9),void 0===e?e=i.rounding:P(e,0,8),r=D(n=j(new i(n),t+1,e),!0,t+1)),n.isNeg()&&!n.isZero()?"-"+r:r},M.toFixed=function(t,e){var r,n,i=this,o=i.constructor;return void 0===t?r=D(i):(P(t,0,1e9),void 0===e?e=o.rounding:P(e,0,8),r=D(n=j(new o(i),t+i.e+1,e),!1,t+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r},M.toFraction=function(t){var e,r,n,i,o,a,s,u,c,f,h,d,b=this,g=b.d,v=b.constructor;if(!g)return new v(b);if(c=r=new v(1),n=u=new v(0),a=(o=(e=new v(n)).e=T(g)-b.e-1)%7,e.d[0]=y(10,a<0?7+a:a),null==t)t=o>0?e:c;else{if(!(s=new v(t)).isInt()||s.lt(c))throw Error(p+s);t=s.gt(e)?o>0?e:c:s}for(l=!1,s=new v(O(g)),f=v.precision,v.precision=o=7*g.length*2;h=k(s,e,0,1,1),1!=(i=r.plus(h.times(n))).cmp(t);)r=n,n=i,i=c,c=u.plus(h.times(i)),u=i,i=e,e=s.minus(h.times(i)),s=i;return i=k(t.minus(r),n,0,1,1),u=u.plus(i.times(c)),r=r.plus(i.times(n)),u.s=c.s=b.s,d=k(c,n,o,1).minus(b).abs().cmp(k(u,r,o,1).minus(b).abs())<1?[c,n]:[u,r],v.precision=f,l=!0,d},M.toHexadecimal=M.toHex=function(t,e){return Y(this,16,t,e)},M.toNearest=function(t,e){var r=this,n=r.constructor;if(r=new n(r),null==t){if(!r.d)return r;t=new n(1),e=n.rounding}else{if(t=new n(t),void 0===e?e=n.rounding:P(e,0,8),!r.d)return t.s?r:t;if(!t.d)return t.s&&(t.s=r.s),t}return t.d[0]?(l=!1,r=k(r,t,0,e,1).times(t),l=!0,j(r)):(t.s=r.s,r=t),r},M.toNumber=function(){return+this},M.toOctal=function(t,e){return Y(this,8,t,e)},M.toPower=M.pow=function(t){var e,r,n,i,o,a,s=this,u=s.constructor,c=+(t=new u(t));if(!(s.d&&t.d&&s.d[0]&&t.d[0]))return new u(y(+s,c));if((s=new u(s)).eq(1))return s;if(n=u.precision,o=u.rounding,t.eq(1))return j(s,n,o);if((e=b(t.e/7))>=t.d.length-1&&(r=c<0?-c:c)<=9007199254740991)return i=B(u,s,r,n),t.s<0?new u(1).div(i):j(i,n,o);if((a=s.s)<0){if(eu.maxE+1||e0?a/0:0):(l=!1,u.rounding=s.s=1,r=Math.min(12,(e+"").length),(i=L(t.times(U(s,n+r)),n)).d&&A((i=j(i,n+5,1)).d,n,o)&&(e=n+10,+O((i=j(L(t.times(U(s,e+r)),e),e+5,1)).d).slice(n+1,n+15)+1==1e14&&(i=j(i,n+1,0))),i.s=a,l=!0,u.rounding=o,j(i,n,o))},M.toPrecision=function(t,e){var r,n=this,i=n.constructor;return void 0===t?r=D(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(P(t,1,1e9),void 0===e?e=i.rounding:P(e,0,8),r=D(n=j(new i(n),t,e),t<=n.e||n.e<=i.toExpNeg,t)),n.isNeg()&&!n.isZero()?"-"+r:r},M.toSignificantDigits=M.toSD=function(t,e){var r=this.constructor;return void 0===t?(t=r.precision,e=r.rounding):(P(t,1,1e9),void 0===e?e=r.rounding:P(e,0,8)),j(new r(this),t,e)},M.toString=function(){var t=this,e=t.constructor,r=D(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+r:r},M.truncated=M.trunc=function(){return j(new this.constructor(this),this.e+1,1)},M.valueOf=M.toJSON=function(){var t=this,e=t.constructor,r=D(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+r:r};var k=function(){function t(t,e,r){var n,i=0,o=t.length;for(t=t.slice();o--;)n=t[o]*e+i,t[o]=n%r|0,i=n/r|0;return i&&t.unshift(i),t}function e(t,e,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;ie[i]?1:-1;break}return o}function r(t,e,r,n){for(var i=0;r--;)t[r]-=i,i=t[r]1;)t.shift()}return function(n,i,o,s,u,c){var f,h,d,l,p,y,g,v,m,_,S,x,M,O,P,A,E,k,D,I,R=n.constructor,C=n.s==i.s?1:-1,T=n.d,N=i.d;if(!(T&&T[0]&&N&&N[0]))return new R(n.s&&i.s&&(T?!N||T[0]!=N[0]:N)?T&&0==T[0]||!N?0*C:C/0:NaN);for(c?(p=1,h=n.e-i.e):(c=w,p=7,h=b(n.e/p)-b(i.e/p)),D=N.length,E=T.length,_=(m=new R(C)).d=[],d=0;N[d]==(T[d]||0);d++);if(N[d]>(T[d]||0)&&h--,null==o?(O=o=R.precision,s=R.rounding):O=u?o+(n.e-i.e)+1:o,O<0)_.push(1),y=!0;else{if(O=O/p+2|0,d=0,1==D){for(l=0,N=N[0],O++;(d1&&(N=t(N,l,c),T=t(T,l,c),D=N.length,E=T.length),A=D,x=(S=T.slice(0,D)).length;x=c/2&&++k;do{l=0,(f=e(N,S,D,x))<0?(M=S[0],D!=x&&(M=M*c+(S[1]||0)),(l=M/k|0)>1?(l>=c&&(l=c-1),1==(f=e(g=t(N,l,c),S,v=g.length,x=S.length))&&(l--,r(g,D=10;l/=10)d++;m.e=d+h*p-1,j(m,u?o+m.e+1:o,s,y)}return m}}();function j(t,e,r,n){var i,o,a,s,u,c,f,h,d,p=t.constructor;t:if(null!=e){if(!(h=t.d))return t;for(i=1,s=h[0];s>=10;s/=10)i++;if((o=e-i)<0)o+=7,a=e,u=(f=h[d=0])/y(10,i-a-1)%10|0;else if((d=Math.ceil((o+1)/7))>=(s=h.length)){if(!n)break t;for(;s++<=d;)h.push(0);f=u=0,i=1,a=(o%=7)-7+1}else{for(f=s=h[d],i=1;s>=10;s/=10)i++;u=(a=(o%=7)-7+i)<0?0:f/y(10,i-a-1)%10|0}if(n=n||e<0||void 0!==h[d+1]||(a<0?f:f%y(10,i-a-1)),c=r<4?(u||n)&&(0==r||r==(t.s<0?3:2)):u>5||5==u&&(4==r||n||6==r&&(o>0?a>0?f/y(10,i-a):0:h[d-1])%10&1||r==(t.s<0?8:7)),e<1||!h[0])return h.length=0,c?(e-=t.e+1,h[0]=y(10,(7-e%7)%7),t.e=-e||0):h[0]=t.e=0,t;if(0==o?(h.length=d,s=1,d--):(h.length=d+1,s=y(10,7-o),h[d]=a>0?(f/y(10,i-a)%y(10,a)|0)*s:0),c)for(;;){if(0==d){for(o=1,a=h[0];a>=10;a/=10)o++;for(a=h[0]+=s,s=1;a>=10;a/=10)s++;o!=s&&(t.e++,h[0]==w&&(h[0]=1));break}if(h[d]+=s,h[d]!=w)break;h[d--]=0,s=1}for(o=h.length;0===h[--o];)h.pop()}return l&&(t.e>p.maxE?(t.d=null,t.e=NaN):t.e0?o=o.charAt(0)+"."+o.slice(1)+N(n):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(t.e<0?"e":"e+")+t.e):i<0?(o="0."+N(-i-1)+o,r&&(n=r-a)>0&&(o+=N(n))):i>=a?(o+=N(i+1-a),r&&(n=r-i-1)>0&&(o=o+"."+N(n))):((n=i+1)0&&(i+1===a&&(o+="."),o+=N(n))),o}function I(t,e){var r=t[0];for(e*=7;r>=10;r/=10)e++;return e}function R(t,e,r){if(e>S)throw l=!0,r&&(t.precision=r),Error("[DecimalError] Precision limit exceeded");return j(new t(f),e,1,!0)}function C(t,e,r){if(e>x)throw Error("[DecimalError] Precision limit exceeded");return j(new t(h),e,r,!0)}function T(t){var e=t.length-1,r=7*e+1;if(e=t[e]){for(;e%10==0;e/=10)r--;for(e=t[0];e>=10;e/=10)r++}return r}function N(t){for(var e="";t--;)e+="0";return e}function B(t,e,r,n){var i,o=new t(1),a=Math.ceil(n/7+4);for(l=!1;;){if(r%2&&G((o=o.times(e)).d,a)&&(i=!0),0===(r=b(r/2))){r=o.d.length-1,i&&0===o.d[r]&&++o.d[r];break}G((e=e.times(e)).d,a)}return l=!0,o}function z(t){return 1&t.d[t.d.length-1]}function q(t,e,r){for(var n,i=new t(e[0]),o=0;++o17)return new d(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==e?(l=!1,u=b):u=e,s=new d(.03125);t.e>-2;)t=t.times(s),h+=5;for(u+=n=Math.log(y(2,h))/Math.LN10*2+5|0,r=o=a=new d(1),d.precision=u;;){if(o=j(o.times(t),u,1),r=r.times(++f),O((s=a.plus(k(o,r,u,1))).d).slice(0,u)===O(a.d).slice(0,u)){for(i=h;i--;)a=j(a.times(a),u,1);if(null!=e)return d.precision=b,a;if(!(c<3&&A(a.d,u-n,p,c)))return j(a,d.precision=b,p,l=!0);d.precision=u+=10,r=o=s=new d(1),f=0,c++}a=s}}function U(t,e){var r,n,i,o,a,s,u,c,f,h,d,p=1,b=t,y=b.d,g=b.constructor,v=g.rounding,m=g.precision;if(b.s<0||!y||!y[0]||!b.e&&1==y[0]&&1==y.length)return new g(y&&!y[0]?-1/0:1!=b.s?NaN:y?0:b);if(null==e?(l=!1,f=m):f=e,g.precision=f+=10,n=(r=O(y)).charAt(0),!(Math.abs(o=b.e)<15e14))return c=R(g,f+2,m).times(o+""),b=U(new g(n+"."+r.slice(1)),f-10).plus(c),g.precision=m,null==e?j(b,m,v,l=!0):b;for(;n<7&&1!=n||1==n&&r.charAt(1)>3;)n=(r=O((b=b.times(t)).d)).charAt(0),p++;for(o=b.e,n>1?(b=new g("0."+r),o++):b=new g(n+"."+r.slice(1)),h=b,u=a=b=k(b.minus(1),b.plus(1),f,1),d=j(b.times(b),f,1),i=3;;){if(a=j(a.times(d),f,1),O((c=u.plus(k(a,new g(i),f,1))).d).slice(0,f)===O(u.d).slice(0,f)){if(u=u.times(2),0!==o&&(u=u.plus(R(g,f+2,m).times(o+""))),u=k(u,new g(p),f,1),null!=e)return g.precision=m,u;if(!A(u.d,f-10,v,s))return j(u,g.precision=m,v,l=!0);g.precision=f+=10,c=a=b=k(h.minus(1),h.plus(1),f,1),d=j(b.times(b),f,1),i=s=1}u=c,i+=2}}function F(t){return String(t.s*t.s/0)}function K(t,e){var r,n,i;for((r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),n=0;48===e.charCodeAt(n);n++);for(i=e.length;48===e.charCodeAt(i-1);--i);if(e=e.slice(n,i)){if(i-=n,t.e=r=r-n-1,t.d=[],n=(r+1)%7,r<0&&(n+=7),nt.constructor.maxE?(t.d=null,t.e=NaN):t.e0?(c=+e.slice(a+1),e=e.substring(2,a)):e=e.slice(2),s=(a=e.indexOf("."))>=0,n=t.constructor,s&&(a=(u=(e=e.replace(".","")).length)-a,i=B(n,new n(r),a,2*a)),a=h=(f=E(e,r,w)).length-1;0===f[a];--a)f.pop();return a<0?new n(0*t.s):(t.e=I(f,h),t.d=f,l=!1,s&&(t=k(t,i,4*u)),c&&(t=t.times(Math.abs(c)<54?y(2,c):o.pow(2,c))),l=!0,t)}function J(t,e,r,n,i){var o,a,s,u,c=t.precision,f=Math.ceil(c/7);for(l=!1,u=r.times(r),s=new t(n);;){if(a=k(s.times(u),new t(e++*e++),c,1),s=i?n.plus(a):n.minus(a),n=k(a.times(u),new t(e++*e++),c,1),void 0!==(a=s.plus(n)).d[f]){for(o=f;a.d[o]===s.d[o]&&o--;);if(-1==o)break}o=s,s=n,n=a,a=o}return l=!0,a.d.length=f+1,a}function W(t,e){for(var r=t;--e;)r*=t;return r}function H(t,e){var r,n=e.s<0,i=C(t,t.precision,1),o=i.times(.5);if((e=e.abs()).lte(o))return s=n?4:1,e;if((r=e.divToInt(i)).isZero())s=n?3:2;else{if((e=e.minus(r.times(i))).lte(o))return s=z(r)?n?2:3:n?4:1,e;s=z(r)?n?1:4:n?3:2}return e.minus(i).abs()}function Y(t,e,r,n){var i,o,s,u,f,h,d,l,p,b=t.constructor,y=void 0!==r;if(y?(P(r,1,1e9),void 0===n?n=b.rounding:P(n,0,8)):(r=b.precision,n=b.rounding),t.isFinite()){for(y?(i=2,16==e?r=4*r-3:8==e&&(r=3*r-2)):i=e,(s=(d=D(t)).indexOf("."))>=0&&(d=d.replace(".",""),(p=new b(1)).e=d.length-s,p.d=E(D(p),10,i),p.e=p.d.length),o=f=(l=E(d,10,i)).length;0==l[--f];)l.pop();if(l[0]){if(s<0?o--:((t=new b(t)).d=l,t.e=o,l=(t=k(t,p,r,n,0,i)).d,o=t.e,h=a),s=l[r],u=i/2,h=h||void 0!==l[r+1],h=n<4?(void 0!==s||h)&&(0===n||n===(t.s<0?3:2)):s>u||s===u&&(4===n||h||6===n&&1&l[r-1]||n===(t.s<0?8:7)),l.length=r,h)for(;++l[--r]>i-1;)l[r]=0,r||(++o,l.unshift(1));for(f=l.length;!l[f-1];--f);for(s=0,d="";s1)if(16==e||8==e){for(s=16==e?4:3,--f;f%s;f++)d+="0";for(f=(l=E(d,i,e)).length;!l[f-1];--f);for(s=1,d="1.";sf)for(o-=f;o--;)d+="0";else oe)return t.length=e,!0}function Z(t){return new this(t).abs()}function X(t){return new this(t).acos()}function $(t){return new this(t).acosh()}function Q(t,e){return new this(t).plus(e)}function tt(t){return new this(t).asin()}function et(t){return new this(t).asinh()}function rt(t){return new this(t).atan()}function nt(t){return new this(t).atanh()}function it(t,e){t=new this(t),e=new this(e);var r,n=this.precision,i=this.rounding,o=n+4;return t.s&&e.s?t.d||e.d?!e.d||t.isZero()?(r=e.s<0?C(this,n,i):new this(0)).s=t.s:!t.d||e.isZero()?(r=C(this,o,1).times(.5)).s=t.s:e.s<0?(this.precision=o,this.rounding=1,r=this.atan(k(t,e,o,1)),e=C(this,o,1),this.precision=n,this.rounding=i,r=t.s<0?r.minus(e):r.plus(e)):r=this.atan(k(t,e,o,1)):(r=C(this,o,1).times(e.s>0?.25:.75)).s=t.s:r=new this(NaN),r}function ot(t){return new this(t).cbrt()}function at(t){return j(t=new this(t),t.e+1,2)}function st(t){if(!t||"object"!=typeof t)throw Error("[DecimalError] Object expected");var e,r,n,i=!0===t.defaults,o=["precision",1,1e9,"rounding",0,8,"toExpNeg",-u,0,"toExpPos",0,u,"maxE",0,u,"minE",-u,0,"modulo",0,9];for(e=0;e=o[e+1]&&n<=o[e+2]))throw Error(p+r+": "+n);this[r]=n}if(r="crypto",i&&(this[r]=d[r]),void 0!==(n=t[r])){if(!0!==n&&!1!==n&&0!==n&&1!==n)throw Error(p+r+": "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");this[r]=!0}else this[r]=!1}return this}function ut(t){return new this(t).cos()}function ct(t){return new this(t).cosh()}function ft(t,e){return new this(t).div(e)}function ht(t){return new this(t).exp()}function dt(t){return j(t=new this(t),t.e+1,3)}function lt(){var t,e,r=new this(0);for(l=!1,t=0;t=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:s[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");for(e=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(e,o):(s.push(i%1e7),o+=4);o=n/4}else for(;o=10;i/=10)n++;n<7&&(r-=7-n)}return a.e=r,a.d=s,a}function Ot(t){return j(t=new this(t),t.e+1,this.rounding)}function Pt(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function At(t){return new this(t).sin()}function Et(t){return new this(t).sinh()}function kt(t){return new this(t).sqrt()}function jt(t,e){return new this(t).sub(e)}function Dt(t){return new this(t).tan()}function It(t){return new this(t).tanh()}function Rt(t){return j(t=new this(t),t.e+1,1)}(o=function t(e){var r,n,i;function o(t){var e,r,n,i=this;if(!(i instanceof o))return new o(t);if(i.constructor=o,t instanceof o)return i.s=t.s,void(l?!t.d||t.e>o.maxE?(i.e=NaN,i.d=null):t.e=10;r/=10)e++;return void(l?e>o.maxE?(i.e=NaN,i.d=null):e0?a-4:a;for(r=0;r>16&255,u[f++]=e>>8&255,u[f++]=255&e;return 2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[f++]=255&e),1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e),u},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));return 1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var i,o,a=[],s=e;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,f=-7,h=r?i-1:0,d=r?-1:1,l=t[e+h];for(h+=d,o=l&(1<<-f)-1,l>>=-f,f+=s;f>0;o=256*o+t[e+h],h+=d,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+t[e+h],h+=d,f-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(l?-1:1);a+=Math.pow(2,n),o-=c}return(l?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,u,c=8*o-i-1,f=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,p=n?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=f?(s=0,a=f):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+l]=255&s,l+=p,s/=256,i-=8);for(a=a<0;t[r+l]=255&a,l+=p,a/=256,c-=8);t[r+l-p]|=128*b}},function(t,e,r){"use strict";(function(t){var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.MsgExecuteContract=void 0;var o=r(0),a=r(6),s=function(e){function r(t,r,n,i){void 0===i&&(i={});var o=e.call(this)||this;return o.sender=t,o.contract=r,o.execute_msg=n,o.coins=new a.Coins(i),o}return i(r,e),r.fromData=function(e){var n=e.value,i=n.sender,o=n.contract,s=n.execute_msg,u=n.coins;return new r(i,o,JSON.parse(t.from(s,"base64").toString()),a.Coins.fromData(u))},r.prototype.toData=function(){var e=this.sender,r=this.contract,n=this.execute_msg,i=this.coins;return{type:"wasm/MsgExecuteContract",value:{sender:e,contract:r,execute_msg:t.from(JSON.stringify(n)).toString("base64"),coins:i.toData()}}},r}(o.JSONSerializable);e.MsgExecuteContract=s}).call(this,r(2).Buffer)},function(t,e,r){"use strict";(function(t){var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.MsgMigrateContract=void 0;var o=function(e){function r(t,r,n,i){var o=e.call(this)||this;return o.owner=t,o.contract=r,o.new_code_id=n,o.migrate_msg=i,o}return i(r,e),r.fromData=function(e){var n=e.value,i=n.owner,o=n.contract,a=n.new_code_id,s=n.migrate_msg;return new r(i,o,Number.parseInt(a),JSON.parse(t.from(s,"base64").toString()))},r.prototype.toData=function(){var e=this.owner,r=this.contract,n=this.new_code_id,i=this.migrate_msg;return{type:"wasm/MsgMigrateContract",value:{owner:e,contract:r,new_code_id:n.toFixed(),migrate_msg:t.from(JSON.stringify(i)).toString("base64")}}},r}(r(0).JSONSerializable);e.MsgMigrateContract=o}).call(this,r(2).Buffer)},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.MsgUpdateContractOwner=void 0;var o=function(t){function e(e,r,n){var i=t.call(this)||this;return i.owner=e,i.new_owner=r,i.contract=n,i}return i(e,t),e.fromData=function(t){var r=t.value;return new e(r.owner,r.new_owner,r.contract)},e.prototype.toData=function(){return{type:"wasm/MsgUpdateContractOwner",value:{owner:this.owner,new_owner:this.new_owner,contract:this.contract}}},e}(r(0).JSONSerializable);e.MsgUpdateContractOwner=o},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.StdSignMsg=void 0;var o=r(34),a=r(26),s=r(0),u=r(35),c=function(t){function e(e,r,n,i,o,a){void 0===a&&(a="");var s=t.call(this)||this;return s.chain_id=e,s.account_number=r,s.sequence=n,s.fee=i,s.msgs=o,s.memo=a,s}return i(e,t),e.prototype.toData=function(){var t=this,e=t.chain_id,r=t.account_number,n=t.sequence,i=t.fee,o=t.msgs,a=t.memo;return{chain_id:e,account_number:r.toString(),sequence:n.toString(),fee:i.toData(),msgs:o.map((function(t){return t.toData()})),memo:a}},e.fromData=function(t){var r=t.chain_id,n=t.account_number,i=t.sequence,s=t.fee,u=t.msgs,c=t.memo;return new e(r,Number.parseInt(n),Number.parseInt(i),o.StdFee.fromData(s),u.map((function(t){return a.Msg.fromData(t)})),c)},e.prototype.toStdTx=function(){var t=this.fee,e=this.msgs,r=this.memo;return new u.StdTx(e,t,[],r)},e}(s.JSONSerializable);e.StdSignMsg=c},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.TxLog=e.EventsByType=e.TxInfo=void 0;var o,a=r(0),s=r(35),u=function(t){function e(e,r,n,i,o,a,s,u,c,f){var h=t.call(this)||this;return h.height=e,h.txhash=r,h.raw_log=n,h.logs=i,h.gas_wanted=o,h.gas_used=a,h.tx=s,h.timestamp=u,h.code=c,h.codespace=f,h}return i(e,t),e.fromData=function(t){return new e(Number.parseInt(t.height),t.txhash,t.raw_log,t.logs&&t.logs.map((function(t){return c.fromData(t)})),Number.parseInt(t.gas_wanted),Number.parseInt(t.gas_used),s.StdTx.fromData(t.tx),t.timestamp,t.code,t.codespace)},e.prototype.toData=function(){var t={height:this.height.toFixed(),txhash:this.txhash,raw_log:this.raw_log,gas_wanted:this.gas_wanted.toFixed(),gas_used:this.gas_used.toFixed(),tx:this.tx.toData(),timestamp:this.timestamp};return this.logs&&(t.logs=this.logs.map((function(t){return t.toData()}))),this.code&&(t.code=this.code),this.codespace&&(t.codespace=this.codespace),t},e}(a.JSONSerializable);e.TxInfo=u,function(t){t.parse=function(t){var e={};return t.forEach((function(t){t.attributes.forEach((function(r){t.type in e||(e[t.type]={}),r.key in e[t.type]||(e[t.type][r.key]=[]),e[t.type][r.key].push(r.value)}))})),e}}(o=e.EventsByType||(e.EventsByType={}));var c=function(t){function e(e,r,n){var i=t.call(this)||this;return i.msg_index=e,i.log=r,i.events=n,i.eventsByType=o.parse(i.events),i}return i(e,t),e.fromData=function(t){return new e(t.msg_index,t.log,t.events)},e.prototype.toData=function(){return{msg_index:this.msg_index,log:this.log,events:this.events}},e}(a.JSONSerializable);e.TxLog=c},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Account=void 0;var o=r(6),a=r(28),s=function(t){function e(e,r,n,i,o){var a=t.call(this)||this;return a.address=e,a.coins=r,a.public_key=n,a.account_number=i,a.sequence=o,a}return i(e,t),e.prototype.toData=function(){var t=this,e=t.address,r=t.coins,n=t.public_key,i=t.account_number,o=t.sequence;return{type:"core/Account",value:{address:e,coins:r.toData(),public_key:n?n.toData():null,account_number:i.toFixed(),sequence:o.toFixed()}}},e.fromData=function(t){var r=t.value,n=r.address,i=r.coins,s=r.public_key,u=r.account_number,c=r.sequence;return new e(n,o.Coins.fromData(i),s?a.PublicKey.fromData(s):null,Number.parseInt(u),Number.parseInt(c))},e}(r(0).JSONSerializable);e.Account=s},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.LazyGradedVestingAccount=void 0;var o=r(6),a=r(0),s=r(5),u=r(28),c=function(t){function e(e,r,n,i,o,a,s,u,c,f){var h=t.call(this)||this;return h.address=e,h.coins=r,h.public_key=n,h.account_number=i,h.sequence=o,h.original_vesting=a,h.delegated_free=s,h.delegated_vesting=u,h.end_time=c,h.vesting_schedules=f,h}return i(e,t),e.prototype.toData=function(){var t=this,e=t.address,r=t.coins,n=t.public_key,i=t.account_number,o=t.sequence,a=t.original_vesting,s=t.delegated_free,u=t.delegated_vesting,c=t.end_time,f=t.vesting_schedules;return{type:"core/LazyGradedVestingAccount",value:{address:e,coins:r.toData(),public_key:n&&n.toData(),account_number:i.toFixed(),sequence:o.toFixed(),original_vesting:a.toData(),delegated_free:s.toData(),delegated_vesting:u.toData(),end_time:c.toFixed(),vesting_schedules:f.map((function(t){return t.toData()}))}}},e.fromData=function(t){var r=t.value,n=r.address,i=r.coins,a=r.public_key,s=r.account_number,c=r.sequence,f=r.original_vesting,h=r.delegated_free,d=r.delegated_vesting,l=r.end_time,p=r.vesting_schedules;return new e(n,o.Coins.fromData(i),a&&u.PublicKey.fromData(a),Number.parseInt(s),Number.parseInt(c),o.Coins.fromData(f),o.Coins.fromData(h),o.Coins.fromData(d),Number.parseInt(l),p.map((function(t){return e.VestingSchedule.fromData(t)})))},e}(a.JSONSerializable);e.LazyGradedVestingAccount=c,function(t){var e=function(t){function e(e,r){var n=t.call(this)||this;return n.denom=e,n.schedules=r,n}return i(e,t),e.prototype.toData=function(){return{denom:this.denom,schedules:this.schedules.map((function(t){return t.toData()}))}},e.fromData=function(t){return new e(t.denom,t.schedules.map((function(t){return e.Entry.fromData(t)})))},e}(a.JSONSerializable);t.VestingSchedule=e,function(t){var e=function(t){function e(e,r,n){var i=t.call(this)||this;return i.start_time=e,i.end_time=r,i.ratio=n,i}return i(e,t),e.fromData=function(t){var r=t.start_time,n=t.end_time,i=t.ratio;return new e(Number.parseInt(r),Number.parseInt(n),new s.Dec(i))},e.prototype.toData=function(){return{start_time:this.start_time.toFixed(),end_time:this.end_time.toFixed(),ratio:this.ratio.toString()}},e}(a.JSONSerializable);t.Entry=e}(e=t.VestingSchedule||(t.VestingSchedule={}))}(c=e.LazyGradedVestingAccount||(e.LazyGradedVestingAccount={})),e.LazyGradedVestingAccount=c},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.ExchangeRatePrevote=void 0;var o=function(t){function e(e,r,n,i){var o=t.call(this)||this;return o.hash=e,o.denom=r,o.voter=n,o.submit_block=i,o}return i(e,t),e.fromData=function(t){var r=t.hash,n=t.denom,i=t.voter,o=t.submit_block;return new e(r,n,i,Number.parseInt(o))},e.prototype.toData=function(){return{hash:this.hash,denom:this.denom,voter:this.voter,submit_block:this.submit_block.toFixed()}},e}(r(0).JSONSerializable);e.ExchangeRatePrevote=o},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.ExchangeRateVote=void 0;var o=r(0),a=r(5),s=function(t){function e(e,r,n){var i=t.call(this)||this;return i.exchange_rate=e,i.denom=r,i.voter=n,i}return i(e,t),e.fromData=function(t){var r=t.exchange_rate,n=t.denom,i=t.voter;return new e(new a.Dec(r),n,i)},e.prototype.toData=function(){var t=this.exchange_rate,e=this.denom,r=this.voter;return{exchange_rate:t.toString(),denom:e,voter:r}},e}(o.JSONSerializable);e.ExchangeRateVote=s},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.AggregateExchangeRatePrevote=void 0;var o=function(t){function e(e,r,n){var i=t.call(this)||this;return i.hash=e,i.voter=r,i.submit_block=n,i}return i(e,t),e.fromData=function(t){var r=t.hash,n=t.voter,i=t.submit_block;return new e(r,n,Number.parseInt(i))},e.prototype.toData=function(){return{hash:this.hash,voter:this.voter,submit_block:this.submit_block.toFixed()}},e}(r(0).JSONSerializable);e.AggregateExchangeRatePrevote=o},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.AggregateExchangeRateVote=void 0;var o=r(0),a=r(11),s=r(6),u=function(t){function e(e,r){var n=t.call(this)||this;return n.exchange_rate_tuples=e,n.voter=r,n}return i(e,t),e.fromData=function(t){var r=t.exchange_rate_tuples,n=t.voter;return new e(new s.Coins(r.map((function(t){return new a.Coin(t.denom,t.exchange_rate)}))).toDecCoins(),n)},e.prototype.toData=function(){var t=this.exchange_rate_tuples,e=this.voter;return{exchange_rate_tuples:t.map((function(t){return{denom:t.denom,exchange_rate:t.amount.toString()}})),voter:e}},e}(o.JSONSerializable);e.AggregateExchangeRateVote=u},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.UnbondingDelegation=void 0;var o=r(0),a=r(5),s=function(t){function e(e,r,n){var i=t.call(this)||this;return i.delegator_address=e,i.validator_address=r,i.entries=n,i}return i(e,t),e.fromData=function(t){return new e(t.delegator_address,t.validator_address,t.entries.map((function(t){return e.Entry.fromData(t)})))},e.prototype.toData=function(){return{delegator_address:this.delegator_address,validator_address:this.validator_address,entries:this.entries.map((function(t){return t.toData()}))}},e}(o.JSONSerializable);e.UnbondingDelegation=s,function(t){var e=function(t){function e(e,r,n,i){var o=t.call(this)||this;return o.initial_balance=e,o.balance=r,o.creation_height=n,o.completion_time=i,o}return i(e,t),e.prototype.toData=function(){return{initial_balance:this.initial_balance.toString(),balance:this.balance.toString(),creation_height:this.creation_height.toFixed(),completion_time:this.completion_time.toISOString()}},e.fromData=function(t){var r=t.initial_balance,n=t.balance,i=t.creation_height,o=t.completion_time;return new e(new a.Int(r),new a.Int(n),Number.parseInt(i),new Date(o))},e}(o.JSONSerializable);t.Entry=e}(s=e.UnbondingDelegation||(e.UnbondingDelegation={})),e.UnbondingDelegation=s},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.ValConsPubKey=e.ValPubKey=e.AccPubKey=e.ValConsAddress=e.ValAddress=e.AccAddress=void 0;var a=o(r(70));function s(t,e,r){try{return a.decode(e).prefix===t&&e.length==r}catch(t){return!1}}!function(t){t.validate=function(t){return s("terra",t,44)},t.fromValAddress=function(t){var e=a.decode(t);return a.encode("terra",e.words)}}(e.AccAddress||(e.AccAddress={})),function(t){t.validate=function(t){return s("terravaloper",t,51)},t.fromAccAddress=function(t){var e=a.decode(t);return a.encode("terravaloper",e.words)}}(e.ValAddress||(e.ValAddress={})),function(t){t.validate=function(t){return s("terravalcons",t,51)}}(e.ValConsAddress||(e.ValConsAddress={})),function(t){t.validate=function(t){return s("terrapub",t,76)},t.fromValPubKey=function(t){var e=a.decode(t);return a.encode("terrapub",e.words)}}(e.AccPubKey||(e.AccPubKey={})),function(t){t.validate=function(t){return s("terravaloperpub",t,83)},t.fromAccPubKey=function(t){var e=a.decode(t);return a.encode("terravaloperpub",e.words)}}(e.ValPubKey||(e.ValPubKey={})),function(t){t.validate=function(t){return s("terravalconspub",t,83)}}(e.ValConsPubKey||(e.ValConsPubKey={}))},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(36),e),i(r(71),e),i(r(239),e)},function(t,e,r){t.exports=r(27).enc.Hex},function(t,e,r){var n;t.exports=(n=r(27), -/** @preserve - (c) 2012 by Cédric Mesnil. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -function(t){var e=n,r=e.lib,i=r.WordArray,o=r.Hasher,a=e.algo,s=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),u=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),c=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=i.create([0,1518500249,1859775393,2400959708,2840853838]),d=i.create([1352829926,1548603684,1836072691,2053994217,0]),l=a.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var n=e+r,i=t[n];t[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,a,l,_,w,S,x,M,O,P,A,E=this._hash.words,k=h.words,j=d.words,D=s.words,I=u.words,R=c.words,C=f.words;for(S=o=E[0],x=a=E[1],M=l=E[2],O=_=E[3],P=w=E[4],r=0;r<80;r+=1)A=o+t[e+D[r]]|0,A+=r<16?p(a,l,_)+k[0]:r<32?b(a,l,_)+k[1]:r<48?y(a,l,_)+k[2]:r<64?g(a,l,_)+k[3]:v(a,l,_)+k[4],A=(A=m(A|=0,R[r]))+w|0,o=w,w=_,_=m(l,10),l=a,a=A,A=S+t[e+I[r]]|0,A+=r<16?v(x,M,O)+j[0]:r<32?g(x,M,O)+j[1]:r<48?y(x,M,O)+j[2]:r<64?b(x,M,O)+j[3]:p(x,M,O)+j[4],A=(A=m(A|=0,C[r]))+P|0,S=P,P=O,O=m(M,10),M=x,x=A;A=E[1]+l+O|0,E[1]=E[2]+_+P|0,E[2]=E[3]+w+S|0,E[3]=E[4]+o+x|0,E[4]=E[0]+a+M|0,E[0]=A},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process();for(var i=this._hash,o=i.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function p(t,e,r){return t^e^r}function b(t,e,r){return t&e|~t&r}function y(t,e,r){return(t|~e)^r}function g(t,e,r){return t&r|e&~r}function v(t,e,r){return t^(e|~r)}function m(t,e){return t<>>32-e}e.RIPEMD160=o._createHelper(l),e.HmacRIPEMD160=o._createHmacHelper(l)}(Math),n.RIPEMD160)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(177);e.fromSeed=n.fromSeed,e.fromBase58=n.fromBase58,e.fromPublicKey=n.fromPublicKey,e.fromPrivateKey=n.fromPrivateKey},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});const n=r(178),i=r(89),o=r(206),a=r(229),s=r(231),u=a.BufferN(32),c=a.compile({wif:a.UInt8,bip32:{public:a.UInt32,private:a.UInt32}}),f={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},h=Math.pow(2,31)-1;function d(t){return a.String(t)&&null!==t.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}function l(t){return a.UInt32(t)&&t<=h}class p{constructor(t,e,r,n,i=0,o=0,s=0){this.__D=t,this.__Q=e,this.chainCode=r,this.network=n,this.__DEPTH=i,this.__INDEX=o,this.__PARENT_FINGERPRINT=s,a(c,n),this.lowR=!1}get depth(){return this.__DEPTH}get index(){return this.__INDEX}get parentFingerprint(){return this.__PARENT_FINGERPRINT}get publicKey(){return void 0===this.__Q&&(this.__Q=o.pointFromScalar(this.__D,!0)),this.__Q}get privateKey(){return this.__D}get identifier(){return n.hash160(this.publicKey)}get fingerprint(){return this.identifier.slice(0,4)}get compressed(){return!0}isNeutered(){return void 0===this.__D}neutered(){return g(this.publicKey,this.chainCode,this.network,this.depth,this.index,this.parentFingerprint)}toBase58(){const e=this.network,r=this.isNeutered()?e.bip32.public:e.bip32.private,n=t.allocUnsafe(78);return n.writeUInt32BE(r,0),n.writeUInt8(this.depth,4),n.writeUInt32BE(this.parentFingerprint,5),n.writeUInt32BE(this.index,9),this.chainCode.copy(n,13),this.isNeutered()?this.publicKey.copy(n,45):(n.writeUInt8(0,45),this.privateKey.copy(n,46)),i.encode(n)}toWIF(){if(!this.privateKey)throw new TypeError("Missing private key");return s.encode(this.network.wif,this.privateKey,!0)}derive(e){a(a.UInt32,e);const r=e>=2147483648,i=t.allocUnsafe(37);if(r){if(this.isNeutered())throw new TypeError("Missing private key for hardened child key");i[0]=0,this.privateKey.copy(i,1),i.writeUInt32BE(e,33)}else this.publicKey.copy(i,0),i.writeUInt32BE(e,33);const s=n.hmacSHA512(this.chainCode,i),u=s.slice(0,32),c=s.slice(32);if(!o.isPrivate(u))return this.derive(e+1);let f;if(this.isNeutered()){const t=o.pointAddScalar(this.publicKey,u,!0);if(null===t)return this.derive(e+1);f=g(t,c,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}else{const t=o.privateAdd(this.privateKey,u);if(null==t)return this.derive(e+1);f=y(t,c,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}return f}deriveHardened(t){return a(l,t),this.derive(t+2147483648)}derivePath(t){a(d,t);let e=t.split("/");if("m"===e[0]){if(this.parentFingerprint)throw new TypeError("Expected master, got child");e=e.slice(1)}return e.reduce((t,e)=>{let r;return"'"===e.slice(-1)?(r=parseInt(e.slice(0,-1),10),t.deriveHardened(r)):(r=parseInt(e,10),t.derive(r))},this)}sign(e,r){if(!this.privateKey)throw new Error("Missing private key");if(void 0===r&&(r=this.lowR),!1===r)return o.sign(e,this.privateKey);{let r=o.sign(e,this.privateKey);const n=t.alloc(32,0);let i=0;for(;r[0]>127;)i++,n.writeUIntLE(i,0,6),r=o.signWithEntropy(e,this.privateKey,n);return r}}verify(t,e){return o.verify(t,this.publicKey,e)}}function b(t,e,r){return y(t,e,r)}function y(t,e,r,n,i,s){if(a({privateKey:u,chainCode:u},{privateKey:t,chainCode:e}),r=r||f,!o.isPrivate(t))throw new TypeError("Private key not in range [1, n)");return new p(t,void 0,e,r,n,i,s)}function g(t,e,r,n,i,s){if(a({publicKey:a.BufferN(33),chainCode:u},{publicKey:t,chainCode:e}),r=r||f,!o.isPoint(t))throw new TypeError("Point is not on the curve");return new p(void 0,t,e,r,n,i,s)}e.fromBase58=function(t,e){const r=i.decode(t);if(78!==r.length)throw new TypeError("Invalid buffer length");e=e||f;const n=r.readUInt32BE(0);if(n!==e.bip32.private&&n!==e.bip32.public)throw new TypeError("Invalid network version");const o=r[4],a=r.readUInt32BE(5);if(0===o&&0!==a)throw new TypeError("Invalid parent fingerprint");const s=r.readUInt32BE(9);if(0===o&&0!==s)throw new TypeError("Invalid index");const u=r.slice(13,45);let c;if(n===e.bip32.private){if(0!==r.readUInt8(45))throw new TypeError("Invalid private key");c=y(r.slice(46,78),u,e,o,s,a)}else c=g(r.slice(45,78),u,e,o,s,a);return c},e.fromPrivateKey=b,e.fromPublicKey=function(t,e,r){return g(t,e,r)},e.fromSeed=function(e,r){if(a(a.Buffer,e),e.length<16)throw new TypeError("Seed should be at least 128 bits");if(e.length>64)throw new TypeError("Seed should be at most 512 bits");r=r||f;const i=n.hmacSHA512(t.from("Bitcoin seed","utf8"),e);return b(i.slice(0,32),i.slice(32),r)}}).call(this,r(2).Buffer)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(37),i=r(87);e.hash160=function(t){const e=n("sha256").update(t).digest();try{return n("rmd160").update(e).digest()}catch(t){return n("ripemd160").update(e).digest()}},e.hmacSHA512=function(t,e){return i("sha512",t).update(e).digest()}},function(t,e,r){(e=t.exports=r(74)).Stream=e,e.Readable=e,e.Writable=r(78),e.Duplex=r(20),e.Transform=r(80),e.PassThrough=r(185),e.finished=r(38),e.pipeline=r(186)},function(t,e){},function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return a.alloc(0);for(var e,r,n,i=a.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=o.data,r=i,n=s,a.prototype.copy.call(e,r,n),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=a.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:u,value:function(t,e){return s(this,function(t){for(var e=1;e0,(function(t){n||(n=t),t&&a.forEach(c),o||(a.forEach(c),i(n))}))}));return e.reduce(f)}},function(t,e,r){var n=r(1),i=r(21),o=r(3).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(t){return t<<30|t>>>2}function f(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,h=0;h<16;++h)r[h]=t.readInt32BE(4*h);for(;h<80;++h)r[h]=r[h-3]^r[h-8]^r[h-14]^r[h-16];for(var d=0;d<80;++d){var l=~~(d/20),p=0|((e=n)<<5|e>>>27)+f(l,i,o,s)+u+r[d]+a[l];u=s,s=o,o=c(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},function(t,e,r){var n=r(1),i=r(21),o=r(3).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(t){return t<<5|t>>>27}function f(t){return t<<30|t>>>2}function h(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,d=0;d<16;++d)r[d]=t.readInt32BE(4*d);for(;d<80;++d)r[d]=(e=r[d-3]^r[d-8]^r[d-14]^r[d-16])<<1|e>>>31;for(var l=0;l<80;++l){var p=~~(l/20),b=c(n)+h(p,i,o,s)+u+r[l]+a[p]|0;u=s,s=o,o=f(i),i=n,n=b}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},function(t,e,r){var n=r(1),i=r(81),o=r(21),a=r(3).Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var t=a.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=u},function(t,e,r){var n=r(1),i=r(82),o=r(21),a=r(3).Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}n(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var t=a.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=u},function(t,e,r){t.exports=i;var n=r(22).EventEmitter;function i(){n.call(this)}r(1)(i,n),i.Readable=r(29),i.Writable=r(198),i.Duplex=r(199),i.Transform=r(200),i.PassThrough=r(201),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,t.end())}function u(){a||(a=!0,"function"==typeof t.destroy&&t.destroy())}function c(t){if(f(),0===n.listenerCount(this,"error"))throw t}function f(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",c),t.removeListener("error",c),r.removeListener("end",f),r.removeListener("close",f),t.removeListener("close",f)}return r.on("error",c),t.on("error",c),r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t}},function(t,e){},function(t,e,r){"use strict";var n=r(42).Buffer,i=r(194);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var e,r,i=n.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=i,r=a,o.data.copy(e,r),a+=o.data.length,o=o.next;return i},t}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,r){(function(t){var n=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(196),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(12))},function(t,e,r){(function(t,e){!function(t,r){"use strict";if(!t.setImmediate){var n,i,o,a,s,u=1,c={},f=!1,h=t.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(t);d=d&&d.setTimeout?d:t,"[object process]"==={}.toString.call(t.process)?n=function(t){e.nextTick((function(){p(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?(a="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&p(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),n=function(e){t.postMessage(a+e,"*")}):t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},n=function(t){o.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,n=function(t){var e=h.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):n=function(t){setTimeout(p,0,t)},d.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r64?e=t(e):e.length<64&&(e=i.concat([e,a],64));for(var r=this._ipad=i.allocUnsafe(64),n=this._opad=i.allocUnsafe(64),s=0;s<64;s++)r[s]=54^e[s],n[s]=92^e[s];this._hash=[r]}n(s,o),s.prototype._update=function(t){this._hash.push(t)},s.prototype._final=function(){var t=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,t]))},t.exports=s},function(t,e,r){"use strict";var n=r(204),i=r(3).Buffer;t.exports=function(t){function e(e){var r=e.slice(0,-4),n=e.slice(-4),i=t(r);if(!(n[0]^i[0]|n[1]^i[1]|n[2]^i[2]|n[3]^i[3]))return r}return{encode:function(e){var r=t(e);return n.encode(i.concat([e,r],e.length+4))},decode:function(t){var r=e(n.decode(t));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(t){var r=n.decodeUnsafe(t);if(r)return e(r)}}}},function(t,e,r){var n=r(205);t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(t,e,r){"use strict";var n=r(3).Buffer;t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r>>0,f=new Uint8Array(a);t[r];){var h=e[t.charCodeAt(r)];if(255===h)return;for(var d=0,l=a-1;(0!==h||d>>0,f[l]=h%256>>>0,h=h/256>>>0;if(0!==h)throw new Error("Non-zero carry");o=d,r++}if(" "!==t[r]){for(var p=a-o;p!==a&&0===f[p];)p++;var b=n.allocUnsafe(i+(a-p));b.fill(0,0,i);for(var y=i;p!==a;)b[y++]=f[p++];return b}}}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,i=0,o=0,a=e.length;o!==a&&0===e[o];)o++,r++;for(var c=(a-o)*f+1>>>0,h=new Uint8Array(c);o!==a;){for(var d=e[o],l=0,p=c-1;(0!==d||l>>0,h[p]=d%s>>>0,d=d/s>>>0;if(0!==d)throw new Error("Non-zero carry");i=l,o++}for(var b=c-i;b!==c&&0===h[b];)b++;for(var y=u.repeat(r);b=0)return!1;if((2===r||3===r)&&33===t.length){try{_(t)}catch(t){return!1}return!0}const i=t.slice(33);return 0!==i.compare(a)&&!(i.compare(u)>=0)&&4===r&&65===t.length}function b(t){return 4!==t[0]}function y(t){return!!d(t)&&t.compare(a)>0&&t.compare(s)<0}function g(t,e){return void 0===t&&void 0!==e?b(e):void 0===t||t}function v(t){return new n(t)}function m(t){return t.toArrayLike(e,"be",32)}function _(t){return i.curve.decodePoint(t)}function w(t,r){return e.from(t._encode(r))}function S(t,r,n){if(!d(t))throw new TypeError("Expected Hash");if(!y(r))throw new TypeError("Expected Private");if(void 0!==n&&!d(n))throw new TypeError("Expected Extra Data (32 bytes)");const i=v(r),a=v(t);let s,u;o(t,r,(function(t){const e=v(t),r=h.mul(e);return!r.isInfinity()&&(s=r.x.umod(c),0!==s.isZero()&&(u=e.invm(c).mul(a.add(i.mul(s))).umod(c),0!==u.isZero()))}),y,n),u.cmp(f)>0&&(u=c.sub(u));const l=e.allocUnsafe(64);return m(s).copy(l,0),m(u).copy(l,32),l}t.exports={isPoint:p,isPointCompressed:function(t){return!!p(t)&&b(t)},isPrivate:y,pointAdd:function(t,e,r){if(!p(t))throw new TypeError("Expected Point");if(!p(e))throw new TypeError("Expected Point");const n=_(t),i=_(e),o=n.add(i);return o.isInfinity()?null:w(o,g(r,t))},pointAddScalar:function(t,e,r){if(!p(t))throw new TypeError("Expected Point");if(!l(e))throw new TypeError("Expected Tweak");const n=g(r,t),i=_(t);if(0===e.compare(a))return w(i,n);const o=v(e),s=h.mul(o),u=i.add(s);return u.isInfinity()?null:w(u,n)},pointCompress:function(t,e){if(!p(t))throw new TypeError("Expected Point");const r=_(t);if(r.isInfinity())throw new TypeError("Expected Point");return w(r,g(e,t))},pointFromScalar:function(t,e){if(!y(t))throw new TypeError("Expected Private");const r=v(t),n=h.mul(r);return n.isInfinity()?null:w(n,g(e))},pointMultiply:function(t,e,r){if(!p(t))throw new TypeError("Expected Point");if(!l(e))throw new TypeError("Expected Tweak");const n=g(r,t),i=_(t),o=v(e),a=i.mul(o);return a.isInfinity()?null:w(a,n)},privateAdd:function(t,e){if(!y(t))throw new TypeError("Expected Private");if(!l(e))throw new TypeError("Expected Tweak");const r=v(t),n=v(e),i=m(r.add(n).umod(c));return y(i)?i:null},privateSub:function(t,e){if(!y(t))throw new TypeError("Expected Private");if(!l(e))throw new TypeError("Expected Tweak");const r=v(t),n=v(e),i=m(r.sub(n).umod(c));return y(i)?i:null},sign:function(t,e){return S(t,e)},signWithEntropy:function(t,e,r){return S(t,e,r)},verify:function(t,r,n,i){if(!d(t))throw new TypeError("Expected Hash");if(!p(r))throw new TypeError("Expected Point");if(!function(t){const r=t.slice(0,32),n=t.slice(32,64);return e.isBuffer(t)&&64===t.length&&r.compare(s)<0&&n.compare(s)<0}(n))throw new TypeError("Expected Signature");const o=_(r),a=v(n.slice(0,32)),u=v(n.slice(32,64));if(i&&u.cmp(f)>0)return!1;if(a.gtn(0)<=0)return!1;if(u.gtn(0)<=0)return!1;const l=v(t),b=u.invm(c),y=l.mul(b).umod(c),g=a.mul(b).umod(c),m=h.mulAdd(y,o,g);return!m.isInfinity()&&m.x.umod(c).eq(a)}}}).call(this,r(2).Buffer)},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){},function(t){t.exports=JSON.parse('{"_args":[["elliptic@6.5.3","/Users/william/terra/terra.js"]],"_from":"elliptic@6.5.3","_id":"elliptic@6.5.3","_inBundle":false,"_integrity":"sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==","_location":"/elliptic","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"elliptic@6.5.3","name":"elliptic","escapedName":"elliptic","rawSpec":"6.5.3","saveSpec":null,"fetchSpec":"6.5.3"},"_requiredBy":["/browserify-sign","/create-ecdh","/secp256k1","/tiny-secp256k1"],"_resolved":"https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz","_spec":"6.5.3","_where":"/Users/william/terra/terra.js","author":{"name":"Fedor Indutny","email":"fedor@indutny.com"},"bugs":{"url":"https://github.com/indutny/elliptic/issues"},"dependencies":{"bn.js":"^4.4.0","brorand":"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0","inherits":"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},"description":"EC cryptography","devDependencies":{"brfs":"^1.4.3","coveralls":"^3.0.8","grunt":"^1.0.4","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.2","jscs":"^3.0.7","jshint":"^2.10.3","mocha":"^6.2.2"},"files":["lib"],"homepage":"https://github.com/indutny/elliptic","keywords":["EC","Elliptic","curve","Cryptography"],"license":"MIT","main":"lib/elliptic.js","name":"elliptic","repository":{"type":"git","url":"git+ssh://git@github.com/indutny/elliptic.git"},"scripts":{"jscs":"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js","jshint":"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js","lint":"npm run jscs && npm run jshint","test":"npm run lint && npm run unit","unit":"istanbul test _mocha --reporter=spec test/index.js","version":"grunt dist && git add dist/"},"version":"6.5.3"}')},function(t,e){},function(t,e,r){"use strict";var n=r(10),i=r(13),o=r(1),a=r(31),s=n.assert;function u(t){a.call(this,"short",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(t,e,r,n){a.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function f(t,e,r,n){a.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,a),t.exports=u,u.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new i(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new i(t.a,16),b:new i(t.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),o=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(t){for(var e,r,n,o,a,s,u,c,f,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=t,l=this.n.clone(),p=new i(1),b=new i(0),y=new i(0),g=new i(1),v=0;0!==d.cmpn(0);){var m=l.div(d);c=l.sub(m.mul(d)),f=y.sub(m.mul(p));var _=g.sub(m.mul(b));if(!n&&c.cmp(h)<0)e=u.neg(),r=p,n=c.neg(),o=f;else if(n&&2==++v)break;u=c,l=d,d=c,y=p,p=f,g=b,b=_}a=c.neg(),s=f;var w=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(w)>=0&&(a=e,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},u.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:t.sub(a).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},u.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},c.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},c.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(f,a.BasePoint),u.prototype.jpoint=function(t,e,r){return new f(this,t,e,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),f=c.redMul(s),h=n.redMul(c),d=u.redSqr().redIAdd(f).redISub(h).redISub(h),l=u.redMul(h.redISub(d)).redISub(o.redMul(f)),p=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(d,l,p)},f.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),f=r.redMul(u),h=s.redSqr().redIAdd(c).redISub(f).redISub(f),d=s.redMul(f.redISub(h)).redISub(i.redMul(c)),l=this.z.redMul(a);return this.curve.jpoint(h,d,l)},f.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(t,e,r){"use strict";var n=r(13),i=r(1),o=r(31),a=r(10);function s(t){o.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),t.exports=s,s.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),s.prototype.decodePoint=function(t,e){return this.point(a.toArray(t,e),1)},s.prototype.point=function(t,e){return new u(this,t,e)},s.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(t,e){return new u(t,e[0],e[1]||t.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),a=i.redMul(n),s=e.z.redMul(o.redAdd(a).redSqr()),u=e.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(t,e,r){"use strict";var n=r(10),i=r(13),o=r(1),a=r(31),s=n.assert;function u(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,a.call(this,"edwards",t),this.a=new i(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function c(t,e,r,n,o){a.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(e,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,a),t.exports=u,u.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},u.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},u.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var u=s.fromRed().isOdd();return(e&&!u||!e&&u)&&(s=s.redNeg()),this.point(t,s)},u.prototype.pointFromY=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==e&&(s=s.redNeg()),this.point(s,t)},u.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},o(c,a.BasePoint),u.prototype.pointFromJSON=function(t){return c.fromJSON(this,t)},u.prototype.point=function(t,e,r,n){return new c(this,t,e,r,n)},c.fromJSON=function(t,e){return new c(t,e[0],e[1],e[2])},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),a=o.redSub(r),s=n.redSub(e),u=i.redMul(a),c=o.redMul(s),f=i.redMul(s),h=a.redMul(o);return this.curve.point(u,c,h,f)},c.prototype._projDbl=function(){var t,e,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(c=this.curve._mulA(i)).redAdd(o);if(this.zOne)t=n.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),e=a.redMul(c.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);t=n.redSub(i).redISub(o).redMul(u),e=a.redMul(c.redSub(o)),r=a.redMul(u)}}else{var c=i.redAdd(o);s=this.curve._mulC(this.z).redSqr(),u=c.redSub(s).redSub(s),t=this.curve._mulC(n.redISub(c)).redMul(u),e=this.curve._mulC(c).redMul(i.redISub(o)),r=c.redMul(u)}return this.curve.point(t,e,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(e),c=o.redMul(a),f=s.redMul(u),h=o.redMul(u),d=a.redMul(s);return this.curve.point(c,f,d,h)},c.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),a=this.y.redMul(t.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),c=i.redAdd(s),f=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(a),h=n.redMul(u).redMul(f);return this.curve.twisted?(e=n.redMul(c).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(c)):(e=n.redMul(c).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(h,e,r)},c.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},c.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},c.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},c.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},c.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},function(t,e,r){"use strict";e.sha1=r(215),e.sha224=r(216),e.sha256=r(95),e.sha384=r(217),e.sha512=r(96)},function(t,e,r){"use strict";var n=r(14),i=r(25),o=r(94),a=n.rotl32,s=n.sum32,u=n.sum32_5,c=o.ft_1,f=i.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,f),t.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;nthis.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e0))return a.iaddn(1),this.keyFromPrivate(a)}},h.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},h.prototype.sign=function(t,e,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var a=this.n.byteLength(),s=e.getPrivate().toArray("be",a),u=t.toArray("be",a),c=new i({hash:this.hash,entropy:s,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),h=this.n.sub(new n(1)),d=0;;d++){var l=o.k?o.k(d):new n(c.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(h)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var b=p.getX(),y=b.umod(this.n);if(0!==y.cmpn(0)){var g=l.invm(this.n).mul(y.mul(e.getPrivate()).iadd(t));if(0!==(g=g.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==b.cmp(y)?2:0);return o.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),v^=1),new f({r:y,s:g,recoveryParam:v})}}}}}},h.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var o=(e=new f(e,"hex")).r,a=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),c=u.mul(t).umod(this.n),h=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),h)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),h)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},h.prototype.recoverPubKey=function(t,e,r,i){u((3&r)===r,"The recovery param is more than two bits"),e=new f(e,i);var o=this.n,a=new n(t),s=e.r,c=e.s,h=1&r,d=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");s=d?this.curve.pointFromX(s.add(this.curve.n),h):this.curve.pointFromX(s,h);var l=e.r.invm(o),p=o.sub(a).mul(l).umod(o),b=c.mul(l).umod(o);return this.g.mulAdd(p,s,b)},h.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new f(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(t,e,r){"use strict";var n=r(45),i=r(91),o=r(17);function a(t){if(!(this instanceof a))return new a(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}t.exports=a,a.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},a.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length"}},function(t,e,r){"use strict";var n=r(13),i=r(10),o=i.assert;function a(t,e){if(t instanceof a)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function s(){this.place=0}function u(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=e.place;o>>=0;return!(i<=127)&&(e.place=a,i)}function c(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=a,a.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new s;if(48!==t[r.place++])return!1;var o=u(t,r);if(!1===o)return!1;if(o+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var a=u(t,r);if(!1===a)return!1;var c=t.slice(r.place,a+r.place);if(r.place+=a,2!==t[r.place++])return!1;var f=u(t,r);if(!1===f)return!1;if(t.length!==f+r.place)return!1;var h=t.slice(r.place,f+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}return this.r=new n(c),this.s=new n(h),this.recoveryParam=null,!0},a.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=c(e),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,e.length),(n=n.concat(e)).push(2),f(n,r.length);var o=n.concat(r),a=[48];return f(a,o.length),a=a.concat(o),i.encode(a,t)}},function(t,e,r){"use strict";var n=r(45),i=r(44),o=r(10),a=o.assert,s=o.parseBytes,u=r(226),c=r(227);function f(t){if(a("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof f))return new f(t);t=i[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}t.exports=f,f.prototype.sign=function(t,e){t=s(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),u=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},f.prototype.verify=function(t,e,r){t=s(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},f.prototype.hashInt=function(){for(var t=this.hash(),e=0;ee.maxLength)&&(void 0===e.length||r.length===e.length)&&r.every((function(e,r){try{return d(t,e,n)}catch(t){throw u(t,r)}}))}return t=h(t),e=e||{},r.toJSON=function(){var r="["+o(t)+"]";return void 0!==e.length?r+="{"+e.length+"}":void 0===e.minLength&&void 0===e.maxLength||(r+="{"+(void 0===e.minLength?0:e.minLength)+","+(void 0===e.maxLength?1/0:e.maxLength)+"}"),r},r},maybe:function t(e){function r(r,n){return i.Nil(r)||e(r,n,t)}return e=h(e),r.toJSON=function(){return"?"+o(e)},r},map:function(t,e){function r(r,n){if(!i.Object(r))return!1;if(i.Nil(r))return!1;for(var o in r){try{e&&d(e,o,n)}catch(t){throw u(t,o,"key")}try{var a=r[o];d(t,a,n)}catch(t){throw u(t,o)}}return!0}return t=h(t),e&&(e=h(e)),r.toJSON=e?function(){return"{"+o(e)+": "+o(t)+"}"}:function(){return"{"+o(t)+"}"},r},object:function(t){var e={};for(var r in t)e[r]=h(t[r]);function n(t,r){if(!i.Object(t))return!1;if(i.Nil(t))return!1;var n;try{for(n in e)d(e[n],t[n],r)}catch(t){throw u(t,n)}if(r)for(n in t)if(!e[n])throw new s(void 0,n);return!0}return n.toJSON=function(){return o(e)},n},anyOf:function(){var t=[].slice.call(arguments).map(h);function e(e,r){return t.some((function(t){try{return d(t,e,r)}catch(t){return!1}}))}return e.toJSON=function(){return t.map(o).join("|")},e},allOf:function(){var t=[].slice.call(arguments).map(h);function e(e,r){return t.every((function(t){try{return d(t,e,r)}catch(t){return!1}}))}return e.toJSON=function(){return t.map(o).join(" & ")},e},quacksLike:function(t){function e(e){return t===c(e)}return e.toJSON=function(){return t},e},tuple:function(){var t=[].slice.call(arguments).map(h);function e(e,r){return!i.Nil(e)&&!i.Nil(e.length)&&(!r||e.length===t.length)&&t.every((function(t,n){try{return d(t,e[n],r)}catch(t){throw u(t,n)}}))}return e.toJSON=function(){return"("+t.map(o).join(", ")+")"},e},value:function(t){function e(e){return e===t}return e.toJSON=function(){return t},e}};function h(t){if(i.String(t))return"?"===t[0]?f.maybe(t.slice(1)):i[t]||f.quacksLike(t);if(t&&i.Object(t)){if(i.Array(t)){if(1!==t.length)throw new TypeError("Expected compile() parameter of type Array of length 1");return f.arrayOf(t[0])}return f.object(t)}return i.Function(t)?t:f.value(t)}function d(t,e,r,n){if(i.Function(t)){if(t(e,r))return!0;throw new a(n||t,e)}return d(h(t),e,r)}for(var l in f.oneOf=f.anyOf,i)d[l]=i[l];for(l in f)d[l]=f[l];var p=r(230);for(l in p)d[l]=p[l];d.compile=h,d.TfTypeError=a,d.TfPropertyTypeError=s,t.exports=d},function(t,e,r){(function(e){var n=r(46),i=r(97);function o(t){return e.isBuffer(t)}function a(t){return"string"==typeof t&&/^([0-9a-f]{2})+$/i.test(t)}function s(t,e){var r=t.toJSON();function n(n){if(!t(n))return!1;if(n.length===e)return!0;throw i.tfCustomError(r+"(Length: "+e+")",r+"(Length: "+n.length+")")}return n.toJSON=function(){return r},n}var u=s.bind(null,n.Array),c=s.bind(null,o),f=s.bind(null,a),h=s.bind(null,n.String),d=Math.pow(2,53)-1,l={ArrayN:u,Buffer:o,BufferN:c,Finite:function(t){return"number"==typeof t&&isFinite(t)},Hex:a,HexN:f,Int8:function(t){return t<<24>>24===t},Int16:function(t){return t<<16>>16===t},Int32:function(t){return(0|t)===t},Int53:function(t){return"number"==typeof t&&t>=-d&&t<=d&&Math.floor(t)===t},Range:function(t,e,r){function i(n,i){return r(n,i)&&n>t&&n>>0===t},UInt53:function(t){return"number"==typeof t&&t>=0&&t<=d&&Math.floor(t)===t}};for(var p in l)l[p].toJSON=function(t){return t}.bind(null,p);t.exports=l}).call(this,r(2).Buffer)},function(t,e,r){(function(e){var n=r(89);function i(t,e){if(void 0!==e&&t[0]!==e)throw new Error("Invalid network version");if(33===t.length)return{version:t[0],privateKey:t.slice(1,33),compressed:!1};if(34!==t.length)throw new Error("Invalid WIF length");if(1!==t[33])throw new Error("Invalid compression flag");return{version:t[0],privateKey:t.slice(1,33),compressed:!0}}function o(t,r,n){var i=new e(n?34:33);return i.writeUInt8(t,0),r.copy(i,1),n&&(i[33]=1),i}t.exports={decode:function(t,e){return i(n.decode(t),e)},decodeRaw:i,encode:function(t,e,r){return"number"==typeof t?n.encode(o(t,e,r)):n.encode(o(t.version,t.privateKey,t.compressed))},encodeRaw:o}}).call(this,r(2).Buffer)},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});const n=r(37),i=r(233),o=r(235),a=r(102);let s=a._default;const u="A wordlist is required but a default could not be found.\nPlease explicitly pass a 2048 word array explicitly.";function c(t,e,r){for(;t.lengthc(t.toString(2),"0",8)).join("")}function d(t){const e=8*t.length/32;return h([...n("sha256").update(t).digest()]).slice(0,e)}function l(t){return"mnemonic"+(t||"")}function p(e,r){if(!(r=r||s))throw new Error(u);const n=(e||"").normalize("NFKD").split(" ");if(n.length%3!=0)throw new Error("Invalid mnemonic");const i=n.map(t=>{const e=r.indexOf(t);if(-1===e)throw new Error("Invalid mnemonic");return c(e.toString(2),"0",11)}).join(""),o=32*Math.floor(i.length/33),a=i.slice(0,o),h=i.slice(o),l=a.match(/(.{1,8})/g).map(f);if(l.length<16)throw new Error("Invalid entropy");if(l.length>32)throw new Error("Invalid entropy");if(l.length%4!=0)throw new Error("Invalid entropy");const p=t.from(l);if(d(p)!==h)throw new Error("Invalid mnemonic checksum");return p.toString("hex")}function b(e,r){if(t.isBuffer(e)||(e=t.from(e,"hex")),!(r=r||s))throw new Error(u);if(e.length<16)throw new TypeError("Invalid entropy");if(e.length>32)throw new TypeError("Invalid entropy");if(e.length%4!=0)throw new TypeError("Invalid entropy");const n=(h([...e])+d(e)).match(/(.{1,11})/g).map(t=>{const e=f(t);return r[e]});return"あいこくしん"===r[0]?n.join(" "):n.join(" ")}e.mnemonicToSeedSync=function(e,r){const n=t.from((e||"").normalize("NFKD"),"utf8"),o=t.from(l((r||"").normalize("NFKD")),"utf8");return i.pbkdf2Sync(n,o,2048,64,"sha512")},e.mnemonicToSeed=function(e,r){return new Promise((n,o)=>{try{const a=t.from((e||"").normalize("NFKD"),"utf8"),s=t.from(l((r||"").normalize("NFKD")),"utf8");i.pbkdf2(a,s,2048,64,"sha512",(t,e)=>t?o(t):n(e))}catch(t){return o(t)}})},e.mnemonicToEntropy=p,e.entropyToMnemonic=b,e.generateMnemonic=function(t,e,r){if((t=t||128)%32!=0)throw new TypeError("Invalid entropy");return b((e=e||o)(t/8),r)},e.validateMnemonic=function(t,e){try{p(t,e)}catch(t){return!1}return!0},e.setDefaultWordlist=function(t){const e=a.wordlists[t];if(!e)throw new Error('Could not find wordlist for language "'+t+'"');s=e},e.getDefaultWordlist=function(){if(!s)throw new Error("No Default Wordlist set");return Object.keys(a.wordlists).filter(t=>"JA"!==t&&"EN"!==t&&a.wordlists[t].every((t,e)=>t===s[e]))[0]};var y=r(102);e.wordlists=y.wordlists}).call(this,r(2).Buffer)},function(t,e,r){e.pbkdf2=r(234),e.pbkdf2Sync=r(100)},function(t,e,r){(function(e,n){var i,o=r(3).Buffer,a=r(98),s=r(99),u=r(100),c=r(101),f=e.crypto&&e.crypto.subtle,h={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},d=[];function l(t,e,r,n,i){return f.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then((function(t){return f.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:i}},t,n<<3)})).then((function(t){return o.from(t)}))}t.exports=function(t,r,p,b,y,g){"function"==typeof y&&(g=y,y=void 0);var v=h[(y=y||"sha1").toLowerCase()];if(!v||"function"!=typeof e.Promise)return n.nextTick((function(){var e;try{e=u(t,r,p,b,y)}catch(t){return g(t)}g(null,e)}));if(a(p,b),t=c(t,s,"Password"),r=c(r,s,"Salt"),"function"!=typeof g)throw new Error("No callback provided to pbkdf2");!function(t,e){t.then((function(t){n.nextTick((function(){e(null,t)}))}),(function(t){n.nextTick((function(){e(t)}))}))}(function(t){if(e.process&&!e.process.browser)return Promise.resolve(!1);if(!f||!f.importKey||!f.deriveBits)return Promise.resolve(!1);if(void 0!==d[t])return d[t];var r=l(i=i||o.alloc(8),i,10,128,t).then((function(){return!0})).catch((function(){return!1}));return d[t]=r,r}(v).then((function(e){return e?l(t,r,p,b,v):u(t,r,p,b,y)})),g)}}).call(this,r(12),r(7))},function(t,e,r){"use strict";(function(e,n){var i=r(3).Buffer,o=e.crypto||e.msCrypto;o&&o.getRandomValues?t.exports=function(t,e){if(t>4294967295)throw new RangeError("requested too many random bytes");var r=i.allocUnsafe(t);if(t>0)if(t>65536)for(var a=0;anew Uint8Array(t)),e){return"function"==typeof t&&(t=t(e)),c("output",t,e),t}function d(t){return Object.prototype.toString.call(t).slice(8,-1)}t.exports=t=>({contextRandomize(e){switch(u(null===e||e instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==e&&c("seed",e,32),t.contextRandomize(e)){case 1:throw new Error("Unknow error on context randomization")}},privateKeyVerify:e=>(c("private key",e,32),0===t.privateKeyVerify(e)),privateKeyNegate(e){switch(c("private key",e,32),t.privateKeyNegate(e)){case 0:return e;case 1:throw new Error(r)}},privateKeyTweakAdd(e,r){switch(c("private key",e,32),c("tweak",r,32),t.privateKeyTweakAdd(e,r)){case 0:return e;case 1:throw new Error(n)}},privateKeyTweakMul(e,r){switch(c("private key",e,32),c("tweak",r,32),t.privateKeyTweakMul(e,r)){case 0:return e;case 1:throw new Error(i)}},publicKeyVerify:e=>(c("public key",e,[33,65]),0===t.publicKeyVerify(e)),publicKeyCreate(e,r=!0,n){switch(c("private key",e,32),f(r),n=h(n,r?33:65),t.publicKeyCreate(n,e)){case 0:return n;case 1:throw new Error("Private Key is invalid");case 2:throw new Error(a)}},publicKeyConvert(e,r=!0,n){switch(c("public key",e,[33,65]),f(r),n=h(n,r?33:65),t.publicKeyConvert(n,e)){case 0:return n;case 1:throw new Error(o);case 2:throw new Error(a)}},publicKeyNegate(e,n=!0,i){switch(c("public key",e,[33,65]),f(n),i=h(i,n?33:65),t.publicKeyNegate(i,e)){case 0:return i;case 1:throw new Error(o);case 2:throw new Error(r);case 3:throw new Error(a)}},publicKeyCombine(e,r=!0,n){u(Array.isArray(e),"Expected public keys to be an Array"),u(e.length>0,"Expected public keys array will have more than zero items");for(const t of e)c("public key",t,[33,65]);switch(f(r),n=h(n,r?33:65),t.publicKeyCombine(n,e)){case 0:return n;case 1:throw new Error(o);case 2:throw new Error("The sum of the public keys is not valid");case 3:throw new Error(a)}},publicKeyTweakAdd(e,r,i=!0,a){switch(c("public key",e,[33,65]),c("tweak",r,32),f(i),a=h(a,i?33:65),t.publicKeyTweakAdd(a,e,r)){case 0:return a;case 1:throw new Error(o);case 2:throw new Error(n)}},publicKeyTweakMul(e,r,n=!0,a){switch(c("public key",e,[33,65]),c("tweak",r,32),f(n),a=h(a,n?33:65),t.publicKeyTweakMul(a,e,r)){case 0:return a;case 1:throw new Error(o);case 2:throw new Error(i)}},signatureNormalize(e){switch(c("signature",e,64),t.signatureNormalize(e)){case 0:return e;case 1:throw new Error(s)}},signatureExport(e,n){c("signature",e,64);const i={output:n=h(n,72),outputlen:72};switch(t.signatureExport(i,e)){case 0:return n.slice(0,i.outputlen);case 1:throw new Error(s);case 2:throw new Error(r)}},signatureImport(e,n){switch(c("signature",e),n=h(n,64),t.signatureImport(n,e)){case 0:return n;case 1:throw new Error(s);case 2:throw new Error(r)}},ecdsaSign(e,n,i={},o){c("message",e,32),c("private key",n,32),u("Object"===d(i),"Expected options to be an Object"),void 0!==i.data&&c("options.data",i.data),void 0!==i.noncefn&&u("Function"===d(i.noncefn),"Expected options.noncefn to be a Function");const a={signature:o=h(o,64),recid:null};switch(t.ecdsaSign(a,e,n,i.data,i.noncefn)){case 0:return a;case 1:throw new Error("The nonce generation function failed, or the private key was invalid");case 2:throw new Error(r)}},ecdsaVerify(e,r,n){switch(c("signature",e,64),c("message",r,32),c("public key",n,[33,65]),t.ecdsaVerify(e,r,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(s);case 2:throw new Error(o)}},ecdsaRecover(e,n,i,o=!0,a){switch(c("signature",e,64),u("Number"===d(n)&&n>=0&&n<=3,"Expected recovery id to be a Number within interval [0, 3]"),c("message",i,32),f(o),a=h(a,o?33:65),t.ecdsaRecover(a,e,n,i)){case 0:return a;case 1:throw new Error(s);case 2:throw new Error("Public key could not be recover");case 3:throw new Error(r)}},ecdh(e,r,n={},i){switch(c("public key",e,[33,65]),c("private key",r,32),u("Object"===d(n),"Expected options to be an Object"),void 0!==n.data&&c("options.data",n.data),void 0!==n.hashfn?(u("Function"===d(n.hashfn),"Expected options.hashfn to be a Function"),void 0!==n.xbuf&&c("options.xbuf",n.xbuf,32),void 0!==n.ybuf&&c("options.ybuf",n.ybuf,32),c("output",i)):i=h(i,32),t.ecdh(i,e,r,n.data,n.hashfn,n.xbuf,n.ybuf)){case 0:return i;case 1:throw new Error(o);case 2:throw new Error("Scalar was invalid (zero or overflow)")}}})},function(t,e,r){const n=new(0,r(90).ec)("secp256k1"),i=n.curve,o=i.n.constructor;function a(t){const e=t[0];switch(e){case 2:case 3:return 33!==t.length?null:function(t,e){let r=new o(e);if(r.cmp(i.p)>=0)return null;r=r.toRed(i.red);let a=r.redSqr().redIMul(r).redIAdd(i.b).redSqrt();return 3===t!==a.isOdd()&&(a=a.redNeg()),n.keyPair({pub:{x:r,y:a}})}(e,t.subarray(1,33));case 4:case 6:case 7:return 65!==t.length?null:function(t,e,r){let a=new o(e),s=new o(r);if(a.cmp(i.p)>=0||s.cmp(i.p)>=0)return null;if(a=a.toRed(i.red),s=s.toRed(i.red),(6===t||7===t)&&s.isOdd()!==(7===t))return null;const u=a.redSqr().redIMul(a);return s.redSqr().redISub(u.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:a,y:s}}):null}(e,t.subarray(1,33),t.subarray(33,65));default:return null}}function s(t,e){const r=e.encode(null,33===t.length);for(let e=0;e0,privateKeyVerify(t){const e=new o(t);return e.cmp(i.n)<0&&!e.isZero()?0:1},privateKeyNegate(t){const e=new o(t),r=i.n.sub(e).umod(i.n).toArrayLike(Uint8Array,"be",32);return t.set(r),0},privateKeyTweakAdd(t,e){const r=new o(e);if(r.cmp(i.n)>=0)return 1;if(r.iadd(new o(t)),r.cmp(i.n)>=0&&r.isub(i.n),r.isZero())return 1;const n=r.toArrayLike(Uint8Array,"be",32);return t.set(n),0},privateKeyTweakMul(t,e){let r=new o(e);if(r.cmp(i.n)>=0||r.isZero())return 1;r.imul(new o(t)),r.cmp(i.n)>=0&&(r=r.umod(i.n));const n=r.toArrayLike(Uint8Array,"be",32);return t.set(n),0},publicKeyVerify:t=>null===a(t)?1:0,publicKeyCreate(t,e){const r=new o(e);return r.cmp(i.n)>=0||r.isZero()?1:(s(t,n.keyFromPrivate(e).getPublic()),0)},publicKeyConvert(t,e){const r=a(e);return null===r?1:(s(t,r.getPublic()),0)},publicKeyNegate(t,e){const r=a(e);if(null===r)return 1;const n=r.getPublic();return n.y=n.y.redNeg(),s(t,n),0},publicKeyCombine(t,e){const r=new Array(e.length);for(let t=0;t=0)return 2;const u=n.getPublic().add(i.g.mul(r));return u.isInfinity()?2:(s(t,u),0)},publicKeyTweakMul(t,e,r){const n=a(e);return null===n?1:(r=new o(r)).cmp(i.n)>=0||r.isZero()?2:(s(t,n.getPublic().mul(r)),0)},signatureNormalize(t){const e=new o(t.subarray(0,32)),r=new o(t.subarray(32,64));return e.cmp(i.n)>=0||r.cmp(i.n)>=0?1:(1===r.cmp(n.nh)&&t.set(i.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(t,e){const r=e.subarray(0,32),n=e.subarray(32,64);if(new o(r).cmp(i.n)>=0)return 1;if(new o(n).cmp(i.n)>=0)return 1;const{output:a}=t;let s=a.subarray(4,37);s[0]=0,s.set(r,1);let u=33,c=0;for(;u>1&&0===s[c]&&!(128&s[c+1]);--u,++c);if(s=s.subarray(c),128&s[0])return 1;if(u>1&&0===s[0]&&!(128&s[1]))return 1;let f=a.subarray(39,72);f[0]=0,f.set(n,1);let h=33,d=0;for(;h>1&&0===f[d]&&!(128&f[d+1]);--h,++d);return f=f.subarray(d),128&f[0]||h>1&&0===f[0]&&!(128&f[1])?1:(t.outputlen=6+u+h,a[0]=48,a[1]=t.outputlen-2,a[2]=2,a[3]=s.length,a.set(s,4),a[4+u]=2,a[5+u]=f.length,a.set(f,6+u),0)},signatureImport(t,e){if(e.length<8)return 1;if(e.length>72)return 1;if(48!==e[0])return 1;if(e[1]!==e.length-2)return 1;if(2!==e[2])return 1;const r=e[3];if(0===r)return 1;if(5+r>=e.length)return 1;if(2!==e[4+r])return 1;const n=e[5+r];if(0===n)return 1;if(6+r+n!==e.length)return 1;if(128&e[4])return 1;if(r>1&&0===e[4]&&!(128&e[5]))return 1;if(128&e[r+6])return 1;if(n>1&&0===e[r+6]&&!(128&e[r+7]))return 1;let a=e.subarray(4,4+r);if(33===a.length&&0===a[0]&&(a=a.subarray(1)),a.length>32)return 1;let s=e.subarray(6+r);if(33===s.length&&0===s[0]&&(s=s.slice(1)),s.length>32)throw new Error("S length is too long");let u=new o(a);u.cmp(i.n)>=0&&(u=new o(0));let c=new o(e.subarray(6+r));return c.cmp(i.n)>=0&&(c=new o(0)),t.set(u.toArrayLike(Uint8Array,"be",32),0),t.set(c.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(t,e,r,a,s){if(s){const t=s;s=n=>{const i=t(e,r,null,a,n);if(!(i instanceof Uint8Array&&32===i.length))throw new Error("This is the way");return new o(i)}}const u=new o(r);if(u.cmp(i.n)>=0||u.isZero())return 1;let c;try{c=n.sign(e,r,{canonical:!0,k:s,pers:a})}catch(t){return 1}return t.signature.set(c.r.toArrayLike(Uint8Array,"be",32),0),t.signature.set(c.s.toArrayLike(Uint8Array,"be",32),32),t.recid=c.recoveryParam,0},ecdsaVerify(t,e,r){const s={r:t.subarray(0,32),s:t.subarray(32,64)},u=new o(s.r),c=new o(s.s);if(u.cmp(i.n)>=0||c.cmp(i.n)>=0)return 1;if(1===c.cmp(n.nh)||u.isZero()||c.isZero())return 3;const f=a(r);if(null===f)return 2;const h=f.getPublic();return n.verify(e,s,h)?0:3},ecdsaRecover(t,e,r,a){const u={r:e.slice(0,32),s:e.slice(32,64)},c=new o(u.r),f=new o(u.s);if(c.cmp(i.n)>=0||f.cmp(i.n)>=0)return 1;if(c.isZero()||f.isZero())return 2;let h;try{h=n.recoverPubKey(a,u,r)}catch(t){return 2}return s(t,h),0},ecdh(t,e,r,s,u,c,f){const h=a(e);if(null===h)return 1;const d=new o(r);if(d.cmp(i.n)>=0||d.isZero())return 2;const l=h.getPublic().mul(d);if(void 0===u){const e=l.encode(null,!0),r=n.hash().update(e).digest();for(let e=0;e<32;++e)t[e]=r[e]}else{c||(c=new Uint8Array(32));const e=l.getX().toArray("be",32);for(let t=0;t<32;++t)c[t]=e[t];f||(f=new Uint8Array(32));const r=l.getY().toArray("be",32);for(let t=0;t<32;++t)f[t]=r[t];const n=u(c,f,s);if(!(n instanceof Uint8Array&&n.length===t.length))return 2;t.set(n)}return 0}}},function(t,e,r){"use strict";(function(t){var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&o(e,t,r);return a(e,t),e},u=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},c=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0)return;a[e]="set-cookie"===e?(a[e]?a[e]:[]).concat([r]):a[e]?a[e]+", "+r:r}})),a):a}},function(t,e,r){"use strict";var n=r(9);t.exports=n.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(t){var n=t;return e&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=i(window.location.href),function(e){var r=n.isString(e)?i(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0}},function(t,e,r){"use strict";var n=r(112);function i(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;t((function(t){r.reason||(r.reason=new n(t),e(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var t;return{token:new i((function(e){t=e})),cancel:t}},t.exports=i},function(t,e,r){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var u=n.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(t){var e=t.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var o=0;o>>6-a%4*2;n[o>>>2]|=(s|u)<<24-o%4*8,o++}return i.create(n,o)}(t,e,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},o.enc.Base64)},function(t,e,r){"use strict";(function(t){var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),u=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&e._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),f(n,t,n.depth)}function u(t,e){var r=s.styles[e];return r?"["+s.colors[r][0]+"m"+t+"["+s.colors[r][1]+"m":t}function c(t,e){return t}function f(t,r,n){if(t.customInspect&&r&&x(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return g(i)||(i=f(t,i,n)),i}var o=function(t,e){if(v(e))return t.stylize("undefined","undefined");if(g(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return y(e)?t.stylize(""+e,"number"):p(e)?t.stylize(""+e,"boolean"):b(e)?t.stylize("null","null"):void 0}(t,r);if(o)return o;var a=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),S(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return h(r);if(0===a.length){if(x(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(m(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return t.stylize(Date.prototype.toString.call(r),"date");if(S(r))return h(r)}var c,_="",M=!1,O=["{","}"];return l(r)&&(M=!0,O=["[","]"]),x(r)&&(_=" [Function"+(r.name?": "+r.name:"")+"]"),m(r)&&(_=" "+RegExp.prototype.toString.call(r)),w(r)&&(_=" "+Date.prototype.toUTCString.call(r)),S(r)&&(_=" "+h(r)),0!==a.length||M&&0!=r.length?n<0?m(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=M?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(c,_,O)):O[0]+_+O[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),E(n,i)||(a="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=b(r)?f(t,u.value,null):f(t,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),v(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function l(t){return Array.isArray(t)}function p(t){return"boolean"==typeof t}function b(t){return null===t}function y(t){return"number"==typeof t}function g(t){return"string"==typeof t}function v(t){return void 0===t}function m(t){return _(t)&&"[object RegExp]"===M(t)}function _(t){return"object"==typeof t&&null!==t}function w(t){return _(t)&&"[object Date]"===M(t)}function S(t){return _(t)&&("[object Error]"===M(t)||t instanceof Error)}function x(t){return"function"==typeof t}function M(t){return Object.prototype.toString.call(t)}function O(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(r){if(v(o)&&(o=t.env.NODE_DEBUG||""),r=r.toUpperCase(),!a[r])if(new RegExp("\\b"+r+"\\b","i").test(o)){var n=t.pid;a[r]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",r,n,t)}}else a[r]=function(){};return a[r]},e.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=l,e.isBoolean=p,e.isNull=b,e.isNullOrUndefined=function(t){return null==t},e.isNumber=y,e.isString=g,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=v,e.isRegExp=m,e.isObject=_,e.isDate=w,e.isError=S,e.isFunction=x,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(279);var P=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(){var t=new Date,e=[O(t.getHours()),O(t.getMinutes()),O(t.getSeconds())].join(":");return[t.getDate(),P[t.getMonth()],e].join(" ")}function E(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",A(),e.format.apply(e,arguments))},e.inherits=r(280),e._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var k="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function j(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(k&&t[k]){var e;if("function"!=typeof(e=t[k]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,k,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1] - * @license MIT - */ -var n=r(10),i=r(11),o=r(12);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(t).length;default:if(n)return L(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 k(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return O(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(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=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){var o,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var f=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var h=!0,d=0;di&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function O(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;i239?4:c>223?3:c>191?2:1;if(i+h<=r)switch(h){case 1:c<128&&(f=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(f=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,h=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},u.prototype.compare=function(t,e,r,n,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(o,a),c=this.slice(n,i),f=t.slice(e,r),h=0;hi)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return S(this,t,e,r);case"base64":return x(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function I(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function R(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function C(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function T(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(t,e,r,n,o){return o||T(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function B(t,e,r,n,o){return o||T(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return e||D(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||D(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||D(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||D(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||D(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||D(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||D(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||D(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||D(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||D(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||I(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):C(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);I(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);I(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):C(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return B(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return B(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function U(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(z,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(9))},function(t,e,r){"use strict";(function(t){var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyKey=void 0;var o=function(e){function r(){return e.call(this,t.from(""))||this}return i(r,e),r.prototype.sign=function(){throw new Error("Key is empty - provide a Key when creating ContractClient to sign transactions.")},r}(r(0).Key);e.EmptyKey=o}).call(this,r(2).Buffer)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UST=e.isNativeToken=void 0,e.isNativeToken=function(t){return"native_token"in t},e.UST={native_token:{denom:"uusd"}}},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(13),e),i(r(14),e),i(r(15),e),i(r(16),e),i(r(17),e),i(r(18),e),i(r(19),e),i(r(20),e),i(r(21),e)},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(7),e),i(r(22),e),i(r(5),e)},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(8),e)},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0?a-4:a;for(r=0;r>16&255,u[f++]=e>>8&255,u[f++]=255&e;2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[f++]=255&e);1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e);return u},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var i,o,a=[],s=e;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,f=-7,h=r?i-1:0,d=r?-1:1,l=t[e+h];for(h+=d,o=l&(1<<-f)-1,l>>=-f,f+=s;f>0;o=256*o+t[e+h],h+=d,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+t[e+h],h+=d,f-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(l?-1:1);a+=Math.pow(2,n),o-=c}return(l?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,u,c=8*o-i-1,f=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,p=n?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?d/u:d*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=f?(s=0,a=f):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+l]=255&s,l+=p,s/=256,i-=8);for(a=a<0;t[r+l]=255&a,l+=p,a/=256,c-=8);t[r+l-p]|=128*b}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]\n * @license MIT\n */\nvar n=r(157),i=r(158),o=r(66);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()=a())throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+a().toString(16)+\" bytes\");return 0|t}function p(t,e){if(u.isBuffer(t))return t.length;if(\"undefined\"!=typeof ArrayBuffer&&\"function\"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;\"string\"!=typeof t&&(t=\"\"+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case\"ascii\":case\"latin1\":case\"binary\":return r;case\"utf8\":case\"utf-8\":case void 0:return q(t).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*r;case\"hex\":return r>>>1;case\"base64\":return U(t).length;default:if(n)return q(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 k(this,e,r);case\"utf8\":case\"utf-8\":return P(this,e,r);case\"ascii\":return A(this,e,r);case\"latin1\":case\"binary\":return E(this,e,r);case\"base64\":return O(this,e,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return j(this,e,r);default:if(n)throw new TypeError(\"Unknown encoding: \"+t);t=(t+\"\").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,i){if(0===t.length)return-1;if(\"string\"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if(\"string\"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if(\"number\"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&\"function\"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError(\"val must be string, number or Buffer\")}function v(t,e,r,n,i){var o,a=1,s=t.length,u=e.length;if(void 0!==n&&(\"ucs2\"===(n=String(n).toLowerCase())||\"ucs-2\"===n||\"utf16le\"===n||\"utf-16le\"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var f=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var d=!0,h=0;hi&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError(\"Invalid hex string\");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function O(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;i239?4:c>223?3:c>191?2:1;if(i+d<=r)switch(d){case 1:c<128&&(f=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(f=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,d=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=d}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r=\"\",n=0;for(;n0&&(t=this.toString(\"hex\",0,r).match(/.{2}/g).join(\" \"),this.length>r&&(t+=\" ... \")),\"\"},u.prototype.compare=function(t,e,r,n,i){if(!u.isBuffer(t))throw new TypeError(\"Argument must be a Buffer\");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError(\"out of range index\");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),s=Math.min(o,a),c=this.slice(n,i),f=t.slice(e,r),d=0;di)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");n||(n=\"utf8\");for(var o=!1;;)switch(n){case\"hex\":return m(this,t,e,r);case\"utf8\":case\"utf-8\":return _(this,t,e,r);case\"ascii\":return w(this,t,e,r);case\"latin1\":case\"binary\":return S(this,t,e,r);case\"base64\":return M(this,t,e,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return x(this,t,e,r);default:if(o)throw new TypeError(\"Unknown encoding: \"+n);n=(\"\"+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};function A(t,e,r){var n=\"\";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i=\"\",o=e;or)throw new RangeError(\"Trying to access beyond buffer length\")}function I(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError(\"Index out of range\")}function R(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function C(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function N(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError(\"Index out of range\");if(r<0)throw new RangeError(\"Index out of range\")}function T(t,e,r,n,o){return o||N(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function B(t,e,r,n,o){return o||N(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return e||D(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||D(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||D(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||D(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||D(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||D(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||D(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||D(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||D(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||D(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||D(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||I(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):C(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);I(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);I(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):C(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||I(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):C(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return T(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return T(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return B(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return B(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError(\"sourceStart out of bounds\");if(n<0)throw new RangeError(\"sourceEnd out of bounds\");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),\"number\"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error(\"Invalid code point\");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function U(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\\s+|\\s+$/g,\"\")}(t).replace(z,\"\")).length<2)return\"\";for(;t.length%4!=0;)t+=\"=\";return t}(t))}function F(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(12))},function(t,e,r){\n/*! safe-buffer. MIT License. Feross Aboukhadijeh */\nvar n=r(2),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(t,e,r){if(\"number\"==typeof t)throw new TypeError(\"Argument must not be a number\");return i(t,e,r)},a.alloc=function(t,e,r){if(\"number\"!=typeof t)throw new TypeError(\"Argument must be a number\");var n=i(t);return void 0!==e?\"string\"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if(\"number\"!=typeof t)throw new TypeError(\"Argument must be a number\");return i(t)},a.allocUnsafeSlow=function(t){if(\"number\"!=typeof t)throw new TypeError(\"Argument must be a number\");return n.SlowBuffer(t)}},function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(r(116),e),i(r(11),e),i(r(6),e),i(r(47),e),i(r(26),e),i(r(5),e),i(r(51),e),i(r(28),e),i(r(34),e),i(r(67),e),i(r(162),e),i(r(35),e),i(r(163),e),i(r(164),e),i(r(165),e),i(r(166),e),i(r(48),e),i(r(49),e),i(r(52),e),i(r(50),e),i(r(53),e),i(r(58),e),i(r(59),e),i(r(32),e),i(r(60),e),i(r(167),e),i(r(168),e),i(r(169),e),i(r(170),e),i(r(55),e),i(r(56),e),i(r(63),e),i(r(64),e),i(r(68),e),i(r(69),e),i(r(171),e),i(r(33),e),i(r(54),e),i(r(57),e),i(r(65),e),i(r(172),e)},function(t,e,r){\"use strict\";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,\"__esModule\",{value:!0}),e.int=e.dec=e.Int=e.Dec=e.Numeric=e.DEC_PRECISION=void 0;var a=o(r(117));e.DEC_PRECISION=18;var s,u=a.default.clone();u.prototype.toString=function(){return this.toFixed(e.DEC_PRECISION)},function(t){t.parse=function(t){if(t instanceof c)return t;if(\"string\"==typeof t)return t.includes(\".\")?new c(t):new f(t);var e=new a.default(t);return e.isInteger()?new f(e):new c(e.toString())}}(s=e.Numeric||(e.Numeric={}));var c=function(t){function e(e){return t.call(this,e.toString())||this}return i(e,t),e.withPrec=function(t,r){return new e(new e(t).div(Math.pow(10,r)))},e.prototype.toInt=function(){return new f(this)},e.prototype.add=function(r){var n=new e(s.parse(r));return new e(t.prototype.add.call(this,n))},e.prototype.sub=function(r){var n=new e(s.parse(r));return new e(t.prototype.sub.call(this,n))},e.prototype.mul=function(r){var n=new e(s.parse(r));return new e(t.prototype.mul.call(this,n))},e.prototype.div=function(r){var n=new e(s.parse(r));return new e(t.prototype.div.call(this,n))},e.prototype.mod=function(r){var n=new e(s.parse(r));return new e(t.prototype.mod.call(this,n))},e}(u);e.Dec=c;var f=function(t){function e(e){var r=new a.default(e.toString());return t.call(this,r.divToInt(1))||this}return i(e,t),e.prototype.toString=function(){return this.toFixed()},e.prototype.toDec=function(){return new c(this)},e.prototype.add=function(t){var r=s.parse(t);return r instanceof c?new c(this).add(r):new e(this.plus(r))},e.prototype.sub=function(t){var r=s.parse(t);return r instanceof c?new c(this).sub(r):new e(this.minus(r))},e.prototype.mul=function(t){var r=s.parse(t);return r instanceof c?new c(this).mul(r):new e(this.times(r))},e.prototype.div=function(r){var n=s.parse(r);return n instanceof c?new c(this).div(n):new e(t.prototype.div.call(this,n))},e.prototype.mod=function(r){var n=s.parse(r);return n instanceof c?new c(this).mod(n):new e(t.prototype.mod.call(this,n))},e}(a.default.clone());e.Int=f,e.dec=function(t){return new c(t[0])},e.int=function(t){return new f(t[0])}},function(t,e,r){\"use strict\";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r1)for(var r=1;r(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0;t.cmpn(-n)>0||e.cmpn(-i)>0;){var o,a,s,u=t.andln(3)+n&3,c=e.andln(3)+i&3;if(3===u&&(u=-1),3===c&&(c=-1),0==(1&u))o=0;else o=3!==(s=t.andln(7)+n&7)&&5!==s||2!==c?u:-u;if(r[0].push(o),0==(1&c))a=0;else a=3!==(s=e.andln(7)+i&7)&&5!==s||2!==u?c:-c;r[1].push(a),2*n===o+1&&(n=1-n),2*i===a+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n=\"_\"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return\"string\"==typeof t?n.toArray(t,\"hex\"):t},n.intFromLE=function(t){return new i(t,\"hex\",\"le\")}},function(t,e,r){\"use strict\";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,\"__esModule\",{value:!0}),e.Coin=void 0;var o=r(0),a=r(5),s=function(t){function e(e,r){var n=t.call(this)||this;return n.denom=e,n.amount=a.Numeric.parse(r),n}return i(e,t),e.fromData=function(t){return new e(t.denom,t.amount)},e.prototype.isIntCoin=function(){return this.amount instanceof a.Int},e.prototype.isDecCoin=function(){return this.amount instanceof a.Dec},e.prototype.toIntCoin=function(){return new e(this.denom,new a.Int(this.amount))},e.prototype.toDecCoin=function(){return new e(this.denom,new a.Dec(this.amount))},e.prototype.toData=function(){return{denom:this.denom,amount:this.amount.toString()}},e.prototype.toString=function(){var t=this.amount.toFixed();return this.isDecCoin()&&-1===t.indexOf(\".\")?t+\".0\"+this.denom:\"\"+t+this.denom},e.fromString=function(t){var r=t.match(/^(-?[0-9]+(\\.[0-9]+)?)([a-zA-Z]+)$/);if(null===r)throw new Error(\"failed to parse to Coin: \"+t);var n=r[1];return new e(r[3],n)},e.prototype.add=function(t){var r;if(t instanceof e){if(t.denom!==this.denom)throw new e.ArithmeticError(\"cannot add two Coins of different denoms: \"+this.denom+\" and \"+t.denom);r=t.amount}else r=t;return r=a.Numeric.parse(r),new e(this.denom,this.amount.add(r))},e.prototype.sub=function(t){var r;if(t instanceof e){if(t.denom!==this.denom)throw new e.ArithmeticError(\"cannot subtract two Coins of different denoms: \"+this.denom+\" and \"+t.denom);r=t.amount}else r=t;return r=a.Numeric.parse(r),new e(this.denom,this.amount.sub(r))},e.prototype.mul=function(t){var r=a.Numeric.parse(t);return new e(this.denom,this.amount.mul(r))},e.prototype.div=function(t){var r=a.Numeric.parse(t);return new e(this.denom,this.amount.div(r))},e.prototype.mod=function(t){var r=a.Numeric.parse(t);return new e(this.denom,this.amount.mod(r))},e}(o.JSONSerializable);e.Coin=s,function(t){var e=function(t){this.message=t};t.ArithmeticError=e}(s=e.Coin||(e.Coin={})),e.Coin=s},function(t,e){var r;r=function(){return this}();try{r=r||new Function(\"return this\")()}catch(t){\"object\"==typeof window&&(r=window)}t.exports=r},function(t,e,r){(function(t){!function(t,e){\"use strict\";function n(t,e){if(!t)throw new Error(e||\"Assertion failed\")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(\"le\"!==e&&\"be\"!==e||(r=e,e=10),this._init(t||0,e||10,r||\"be\"))}var a;\"object\"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a=r(208).Buffer}catch(t){}function s(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&\"object\"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if(\"number\"==typeof t)return this._initNumber(t,e,r);if(\"object\"==typeof t)return this._initArray(t,e,r);\"hex\"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;\"-\"===(t=t.toString().replace(/\\s+/g,\"\"))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),\"-\"===t[0]&&(this.negative=1),this.strip(),\"le\"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),\"le\"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n(\"number\"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if(\"le\"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,c=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?\"\"};var c=[\"\",\"0\",\"00\",\"000\",\"0000\",\"00000\",\"000000\",\"0000000\",\"00000000\",\"000000000\",\"0000000000\",\"00000000000\",\"000000000000\",\"0000000000000\",\"00000000000000\",\"000000000000000\",\"0000000000000000\",\"00000000000000000\",\"000000000000000000\",\"0000000000000000000\",\"00000000000000000000\",\"000000000000000000000\",\"0000000000000000000000\",\"00000000000000000000000\",\"000000000000000000000000\",\"0000000000000000000000000\"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,d=67108863&u,h=Math.min(c,e.length-1),l=Math.max(0,c-t.length+1);l<=h;l++){var p=c-l|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[l])+d)/67108864|0,d=67108863&a}r.words[c]=0|d,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||\"hex\"===t){r=\"\";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r=\"0\"+r;return 0!==this.negative&&(r=\"-\"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=f[t],l=d[t];r=\"\";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(t);r=(p=p.idivn(l)).isZero()?b+r:c[h-b.length]+b+r}for(this.isZero()&&(r=\"0\"+r);r.length%e!=0;)r=\"0\"+r;return 0!==this.negative&&(r=\"-\"+r),r}n(!1,\"Base should be between 2 and 36\")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,\"Number can only safely store up to 53 bits\"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,\"byte array longer than desired length\"),n(o>0,\"Requested array length <= 0\"),this.strip();var a,s,u=\"le\"===e,c=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n(\"number\"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n(\"number\"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,l=0|a[1],p=8191&l,b=l>>>13,g=0|a[2],y=8191&g,v=g>>>13,m=0|a[3],_=8191&m,w=m>>>13,S=0|a[4],M=8191&S,x=S>>>13,O=0|a[5],P=8191&O,A=O>>>13,E=0|a[6],k=8191&E,j=E>>>13,D=0|a[7],I=8191&D,R=D>>>13,C=0|a[8],N=8191&C,T=C>>>13,B=0|a[9],z=8191&B,L=B>>>13,q=0|s[0],U=8191&q,F=q>>>13,K=0|s[1],V=8191&K,J=K>>>13,W=0|s[2],H=8191&W,Y=W>>>13,G=0|s[3],Z=8191&G,X=G>>>13,$=0|s[4],Q=8191&$,tt=$>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ct=st>>>13,ft=0|s[8],dt=8191&ft,ht=ft>>>13,lt=0|s[9],pt=8191<,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(d,U))|0)+((8191&(i=(i=Math.imul(d,F))+Math.imul(h,U)|0))<<13)|0;c=((o=Math.imul(h,F))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,F))+Math.imul(b,U)|0,o=Math.imul(b,F);var yt=(c+(n=n+Math.imul(d,V)|0)|0)+((8191&(i=(i=i+Math.imul(d,J)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,J)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,F))+Math.imul(v,U)|0,o=Math.imul(v,F),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,J)|0;var vt=(c+(n=n+Math.imul(d,H)|0)|0)+((8191&(i=(i=i+Math.imul(d,Y)|0)+Math.imul(h,H)|0))<<13)|0;c=((o=o+Math.imul(h,Y)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(_,U),i=(i=Math.imul(_,F))+Math.imul(w,U)|0,o=Math.imul(w,F),n=n+Math.imul(y,V)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,Y)|0;var mt=(c+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(h,Z)|0))<<13)|0;c=((o=o+Math.imul(h,X)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(M,U),i=(i=Math.imul(M,F))+Math.imul(x,U)|0,o=Math.imul(x,F),n=n+Math.imul(_,V)|0,i=(i=i+Math.imul(_,J)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,J)|0,n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,Y)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,X)|0;var _t=(c+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,tt)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(P,U),i=(i=Math.imul(P,F))+Math.imul(A,U)|0,o=Math.imul(A,F),n=n+Math.imul(M,V)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(_,H)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,Y)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var wt=(c+(n=n+Math.imul(d,rt)|0)|0)+((8191&(i=(i=i+Math.imul(d,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((o=o+Math.imul(h,nt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,U),i=(i=Math.imul(k,F))+Math.imul(j,U)|0,o=Math.imul(j,F),n=n+Math.imul(P,V)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(A,V)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,X)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,X)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0;var St=(c+(n=n+Math.imul(d,ot)|0)|0)+((8191&(i=(i=i+Math.imul(d,at)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,at)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,F))+Math.imul(R,U)|0,o=Math.imul(R,F),n=n+Math.imul(k,V)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,J)|0,n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,X)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,at)|0;var Mt=(c+(n=n+Math.imul(d,ut)|0)|0)+((8191&(i=(i=i+Math.imul(d,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(N,U),i=(i=Math.imul(N,F))+Math.imul(T,U)|0,o=Math.imul(T,F),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,J)|0,n=n+Math.imul(k,H)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(j,H)|0,o=o+Math.imul(j,Y)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ct)|0;var xt=(c+(n=n+Math.imul(d,dt)|0)|0)+((8191&(i=(i=i+Math.imul(d,ht)|0)+Math.imul(h,dt)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(z,U),i=(i=Math.imul(z,F))+Math.imul(L,U)|0,o=Math.imul(L,F),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,J)|0,n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,Y)|0,n=n+Math.imul(k,Z)|0,i=(i=i+Math.imul(k,X)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,X)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,n=n+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ct)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ct)|0,n=n+Math.imul(p,dt)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(b,dt)|0,o=o+Math.imul(b,ht)|0;var Ot=(c+(n=n+Math.imul(d,pt)|0)|0)+((8191&(i=(i=i+Math.imul(d,bt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,bt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(z,V),i=(i=Math.imul(z,J))+Math.imul(L,V)|0,o=Math.imul(L,J),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,Y)|0)+Math.imul(T,H)|0,o=o+Math.imul(T,Y)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,n=n+Math.imul(_,ut)|0,i=(i=i+Math.imul(_,ct)|0)+Math.imul(w,ut)|0,o=o+Math.imul(w,ct)|0,n=n+Math.imul(y,dt)|0,i=(i=i+Math.imul(y,ht)|0)+Math.imul(v,dt)|0,o=o+Math.imul(v,ht)|0;var Pt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;c=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(z,H),i=(i=Math.imul(z,Y))+Math.imul(L,H)|0,o=Math.imul(L,Y),n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ct)|0,n=n+Math.imul(_,dt)|0,i=(i=i+Math.imul(_,ht)|0)+Math.imul(w,dt)|0,o=o+Math.imul(w,ht)|0;var At=(c+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,bt)|0)+Math.imul(v,pt)|0))<<13)|0;c=((o=o+Math.imul(v,bt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(z,Z),i=(i=Math.imul(z,X))+Math.imul(L,Z)|0,o=Math.imul(L,X),n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ct)|0,n=n+Math.imul(M,dt)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(x,dt)|0,o=o+Math.imul(x,ht)|0;var Et=(c+(n=n+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,bt)|0)+Math.imul(w,pt)|0))<<13)|0;c=((o=o+Math.imul(w,bt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(z,Q),i=(i=Math.imul(z,tt))+Math.imul(L,Q)|0,o=Math.imul(L,tt),n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,at)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,at)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ct)|0,n=n+Math.imul(P,dt)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(A,dt)|0,o=o+Math.imul(A,ht)|0;var kt=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,bt)|0)+Math.imul(x,pt)|0))<<13)|0;c=((o=o+Math.imul(x,bt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(z,rt),i=(i=Math.imul(z,nt))+Math.imul(L,rt)|0,o=Math.imul(L,nt),n=n+Math.imul(N,ot)|0,i=(i=i+Math.imul(N,at)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,at)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ct)|0,n=n+Math.imul(k,dt)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(j,dt)|0,o=o+Math.imul(j,ht)|0;var jt=(c+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,bt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((o=o+Math.imul(A,bt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(z,ot),i=(i=Math.imul(z,at))+Math.imul(L,ot)|0,o=Math.imul(L,at),n=n+Math.imul(N,ut)|0,i=(i=i+Math.imul(N,ct)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ct)|0,n=n+Math.imul(I,dt)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(R,dt)|0,o=o+Math.imul(R,ht)|0;var Dt=(c+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,bt)|0)+Math.imul(j,pt)|0))<<13)|0;c=((o=o+Math.imul(j,bt)|0)+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,n=Math.imul(z,ut),i=(i=Math.imul(z,ct))+Math.imul(L,ut)|0,o=Math.imul(L,ct),n=n+Math.imul(N,dt)|0,i=(i=i+Math.imul(N,ht)|0)+Math.imul(T,dt)|0,o=o+Math.imul(T,ht)|0;var It=(c+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,bt)|0)+Math.imul(R,pt)|0))<<13)|0;c=((o=o+Math.imul(R,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(z,dt),i=(i=Math.imul(z,ht))+Math.imul(L,dt)|0,o=Math.imul(L,ht);var Rt=(c+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,bt)|0)+Math.imul(T,pt)|0))<<13)|0;c=((o=o+Math.imul(T,bt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Ct=(c+(n=Math.imul(z,pt))|0)+((8191&(i=(i=Math.imul(z,bt))+Math.imul(L,pt)|0))<<13)|0;return c=((o=Math.imul(L,bt))+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=gt,u[1]=yt,u[2]=vt,u[3]=mt,u[4]=_t,u[5]=wt,u[6]=St,u[7]=Mt,u[8]=xt,u[9]=Ot,u[10]=Pt,u[11]=At,u[12]=Et,u[13]=kt,u[14]=jt,u[15]=Dt,u[16]=It,u[17]=Rt,u[18]=Ct,0!==c&&(u[19]=c,r.length++),r};function p(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(l=h),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?l(this,t,e):r<63?h(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==f||c>=i);c--){var d=0|this.words[c];this.words[c]=f<<26-o|d>>>o,f=d&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n(\"number\"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,\"imaskn works only with positive numbers\"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n(\"number\"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if(\"mod\"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;d--){var h=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(h=Math.min(h/a|0,67108863),n._ishlnsubmul(i,h,d);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=h)}return s&&s.strip(),n.strip(),\"div\"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),\"mod\"!==e&&(i=s.div.neg()),\"div\"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),\"mod\"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),\"div\"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?\"div\"===e?{div:this.divn(t.words[0]),mod:null}:\"mod\"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,\"div\",!1).div},o.prototype.mod=function(t){return this.divmod(t,\"mod\",!1).mod},o.prototype.umod=function(t){return this.divmod(t,\"mod\",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),d=e.clone();!e.isZero();){for(var h=0,l=1;0==(e.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(d)),i.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(d)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0==(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n(\"number\"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,\"Number is too big\");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,\"Already a number in reduction context\"),n(0===this.negative,\"red works only with positives\"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,\"fromRed works only with numbers in reduction context\"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,\"Already a number in reduction context\"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,\"redAdd works only with red numbers\"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,\"redIAdd works only with red numbers\"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,\"redSub works only with red numbers\"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,\"redISub works only with red numbers\"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,\"redShl works only with red numbers\"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,\"redMul works only with red numbers\"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,\"redMul works only with red numbers\"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,\"redSqr works only with red numbers\"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,\"redISqr works only with red numbers\"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,\"redSqrt works only with red numbers\"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,\"redInvm works only with red numbers\"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,\"redNeg works only with red numbers\"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,\"redPow(normalNum)\"),this.red._verify1(this),this.red.pow(this,t)};var 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 m(){y.call(this,\"p224\",\"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\")}function _(){y.call(this,\"p192\",\"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\")}function w(){y.call(this,\"25519\",\"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\")}function S(t){if(\"string\"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),\"modulus must be greater than 1\"),this.m=t,this.prime=null}function M(t){S.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 n=e0?r.isub(this.p):void 0!==r.strip?r.strip():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)},i(v,y),v.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},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>>=26,t.words[r]=i,e=n}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 m;else if(\"p192\"===t)e=new _;else{if(\"p25519\"!==t)throw new Error(\"Unknown prime \"+t);e=new w}return g[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,\"red works only with positives\"),n(t.red,\"red works only with red numbers\")},S.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),\"red works only with positives\"),n(t.red&&t.red===e.red,\"red works only with red numbers\")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.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)},S.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},S.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)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var d=this.pow(f,i),h=this.pow(t,i.addn(1).iushrn(1)),l=this.pow(t,i),p=a;0!==l.cmp(s);){for(var b=l,g=0;0!==b.cmp(s);g++)b=b.redSqr();n(g=0;n--){for(var c=e.words[n],f=u-1;f>=0;f--){var d=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new M(t)},i(M,S),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(207)(t))},function(t,e,r){\"use strict\";var n=r(17),i=r(1);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function a(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?\"0\"+t:t}function u(t){return 7===t.length?\"0\"+t:6===t.length?\"00\"+t:5===t.length?\"000\"+t:4===t.length?\"0000\"+t:3===t.length?\"00000\"+t:2===t.length?\"000000\"+t:1===t.length?\"0000000\"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(\"string\"==typeof t)if(e){if(\"hex\"===e)for((t=t.replace(/[^a-z0-9]+/gi,\"\")).length%2!=0&&(t=\"0\"+t),i=0;i>6|192,r[n++]=63&a|128):o(t,i)?(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i>>0}return a},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,a=(o>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,o,a,s){var u=0,c=e;return u+=(c=c+n>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,r,n,i,o,a,s){return e+n+o+s>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,a,s,u,c){var f=0,d=e;return f+=(d=d+n>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,r,n,i,o,a,s,u,c){return e+n+o+s+c>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Convert=void 0;var n=r(4),i=r(57),o=r(4);!function(t){t.id=function(t){return t},t.toDec=function(t){return new o.Dec(t)},t.toString=function(t){return t.toString()},t.toFixed=function(t){return t.toFixed()},t.toNumber=Number.parseInt,t.toOracleWhitelist=function(t){return t.map((function(t){return{name:t.name,tobin_tax:new o.Dec(t.tobin_tax)}}))},t.toVotingParams=function(t){return{voting_period:Number.parseInt(t.voting_period)}},t.toDepositParams=function(t){return{min_deposit:n.Coins.fromData(t.min_deposit),max_deposit_period:Number.parseInt(t.max_deposit_period)}},t.toTallyParams=function(t){return{quorum:new o.Dec(t.quorum),threshold:new o.Dec(t.threshold),veto:new o.Dec(t.veto)}},t.toPolicyConstraints=i.PolicyConstraints.fromData,t.toData=function(t){return t.toData()},t.serializeDepositParams=function(t){return{min_deposit:t.min_deposit.toData(),max_deposit_period:t.max_deposit_period.toFixed()}},t.serializeVotingParams=function(t){return{voting_period:t.voting_period.toFixed()}},t.serializeTallyParams=function(t){return{quorum:t.quorum.toString(),threshold:t.threshold.toString(),veto:t.veto.toString()}},t.serializeOracleWhitelist=function(t){return t.map((function(t){return{name:t.name,tobin_tax:t.tobin_tax.toString()}}))}}(e.Convert||(e.Convert={}))},function(t,e,r){\"use strict\";var n=r(30),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=d;var o=Object.create(r(24));o.inherits=r(1);var a=r(83),s=r(43);o.inherits(d,a);for(var u=i(s.prototype),c=0;c>>7)^(p<<14|p>>>18)^p>>>3,g=c[l-2],y=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[l]=b+c[l-7]+y+c[l-16]}var v=n&i^n&o^i&o,m=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),_=h+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&f^~s&d)+u[l]+c[l];h=d,d=f,f=s,s=a+_|0,a=o,o=i,i=n,n=_+(m+v)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0,r[5]=r[5]+f|0,r[6]=r[6]+d|0,r[7]=r[7]+h|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=o._createHelper(f),e.HmacSHA256=o._createHmacHelper(f)}(Math),n.SHA256)},function(t,e,r){\"use strict\";var n={};function i(t,e,r){r||(r=Error);var i=function(t){var r,n;function i(r,n,i){return t.call(this,function(t,r,n){return\"string\"==typeof e?e:e(t,r,n)}(r,n,i))||this}return n=t,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=t,n[t]=i}function o(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?\"one of \".concat(e,\" \").concat(t.slice(0,r-1).join(\", \"),\", or \")+t[r-1]:2===r?\"one of \".concat(e,\" \").concat(t[0],\" or \").concat(t[1]):\"of \".concat(e,\" \").concat(t[0])}return\"of \".concat(e,\" \").concat(String(t))}i(\"ERR_INVALID_OPT_VALUE\",(function(t,e){return'The value \"'+e+'\" is invalid for option \"'+t+'\"'}),TypeError),i(\"ERR_INVALID_ARG_TYPE\",(function(t,e,r){var n,i,a,s;if(\"string\"==typeof e&&(i=\"not \",e.substr(!a||a<0?0:+a,i.length)===i)?(n=\"must not be\",e=e.replace(/^not /,\"\")):n=\"must be\",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t,\" argument\"))s=\"The \".concat(t,\" \").concat(n,\" \").concat(o(e,\"type\"));else{var u=function(t,e,r){return\"number\"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,\".\")?\"property\":\"argument\";s='The \"'.concat(t,'\" ').concat(u,\" \").concat(n,\" \").concat(o(e,\"type\"))}return s+=\". Received type \".concat(typeof r)}),TypeError),i(\"ERR_STREAM_PUSH_AFTER_EOF\",\"stream.push() after EOF\"),i(\"ERR_METHOD_NOT_IMPLEMENTED\",(function(t){return\"The \"+t+\" method is not implemented\"})),i(\"ERR_STREAM_PREMATURE_CLOSE\",\"Premature close\"),i(\"ERR_STREAM_DESTROYED\",(function(t){return\"Cannot call \"+t+\" after a stream was destroyed\"})),i(\"ERR_MULTIPLE_CALLBACK\",\"Callback called multiple times\"),i(\"ERR_STREAM_CANNOT_PIPE\",\"Cannot pipe, not readable\"),i(\"ERR_STREAM_WRITE_AFTER_END\",\"write after end\"),i(\"ERR_STREAM_NULL_VALUES\",\"May not write null values to stream\",TypeError),i(\"ERR_UNKNOWN_ENCODING\",(function(t){return\"Unknown encoding: \"+t}),TypeError),i(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\",\"stream.unshift() after end event\"),t.exports.codes=n},function(t,e,r){\"use strict\";(function(e){var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=c;var i=r(74),o=r(78);r(1)(c,i);for(var a=n(o.prototype),s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error(\"_update must be implemented by subclass\")},t.exports=i},function(t,e,r){\"use strict\";var n,i=\"object\"==typeof Reflect?Reflect:null,o=i&&\"function\"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&\"function\"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise((function(r,n){function i(){void 0!==o&&t.removeListener(\"error\",o),r([].slice.call(arguments))}var o;\"error\"!==e&&(o=function(r){t.removeListener(e,i),n(r)},t.once(\"error\",o)),t.once(e,i)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(t){if(\"function\"!=typeof t)throw new TypeError('The \"listener\" argument must be of type Function. Received type '+typeof t)}function f(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function d(t,e,r,n){var i,o,a,s;if(c(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit(\"newListener\",e,r.listener?r.listener:r),o=t._events),a=o[e]),void 0===a)a=o[e]=r,++t._eventsCount;else if(\"function\"==typeof a?a=o[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=f(t))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error(\"Possible EventEmitter memory leak detected. \"+a.length+\" \"+String(e)+\" listeners added. Use emitter.setMaxListeners() to increase limit\");u.name=\"MaxListenersExceededWarning\",u.emitter=t,u.type=e,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function p(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:\"function\"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(a=e[0]),a instanceof Error)throw a;var s=new Error(\"Unhandled error.\"+(a?\" (\"+a.message+\")\":\"\"));throw s.context=a,s}var u=i[t];if(void 0===u)return!1;if(\"function\"==typeof u)o(u,this,e);else{var c=u.length,f=g(u,c);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return p(this,t,!0)},s.prototype.rawListeners=function(t){return p(this,t,!1)},s.listenerCount=function(t,e){return\"function\"==typeof t.listenerCount?t.listenerCount(e):b.call(t,e)},s.prototype.listenerCount=b,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){\"use strict\";var n=r(3).Buffer,i=n.isEncoding||function(t){switch((t=\"\"+t)&&t.toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":case\"raw\":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return\"utf8\";for(var e;;)switch(t){case\"utf8\":case\"utf-8\":return\"utf8\";case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return\"utf16le\";case\"latin1\":case\"binary\":return\"latin1\";case\"base64\":case\"ascii\":case\"hex\":return t;default:if(e)return;t=(\"\"+t).toLowerCase(),e=!0}}(t);if(\"string\"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error(\"Unknown encoding: \"+t);return e||t}(t),this.encoding){case\"utf16le\":this.text=u,this.end=c,e=4;break;case\"utf8\":this.fillLast=s,e=4;break;case\"base64\":this.text=f,this.end=d,e=3;break;default:return this.write=h,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,\"�\";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,\"�\";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,\"�\"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString(\"utf16le\",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString(\"utf16le\",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):\"\";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString(\"utf16le\",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString(\"base64\",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString(\"base64\",e,t.length-r))}function d(t){var e=t&&t.length?this.write(t):\"\";return this.lastNeed?e+this.lastChar.toString(\"base64\",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function l(t){return t&&t.length?this.write(t):\"\"}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return\"\";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return\"\";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString(\"utf8\",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString(\"utf8\",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,r){(function(t){function r(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):\"[object Array]\"===r(t)},e.isBoolean=function(t){return\"boolean\"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return\"number\"==typeof t},e.isString=function(t){return\"string\"==typeof t},e.isSymbol=function(t){return\"symbol\"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return\"[object RegExp]\"===r(t)},e.isObject=function(t){return\"object\"==typeof t&&null!==t},e.isDate=function(t){return\"[object Date]\"===r(t)},e.isError=function(t){return\"[object Error]\"===r(t)||t instanceof Error},e.isFunction=function(t){return\"function\"==typeof t},e.isPrimitive=function(t){return null===t||\"boolean\"==typeof t||\"number\"==typeof t||\"string\"==typeof t||\"symbol\"==typeof t||void 0===t},e.isBuffer=t.isBuffer}).call(this,r(2).Buffer)},function(t,e,r){\"use strict\";var n=r(14),i=r(17);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian=\"big\",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=o,o.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o>>2]>>>24-o%4*8&255;e[n+o>>>2]|=a<<24-(n+o)%4*8}else for(o=0;o>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var r,n=[],i=function(e){e=e;var r=987654321,n=4294967295;return function(){var i=((r=36969*(65535&r)+(r>>16)&n)<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n;return i/=4294967296,(i+=.5)*(t.random()>.5?1:-1)}},o=0;o>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join(\"\")},parse:function(t){for(var e=t.length,r=[],n=0;n>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new a.init(r,e/2)}},c=s.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join(\"\")},parse:function(t){for(var e=t.length,r=[],n=0;n>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new a.init(r,e)}},f=s.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error(\"Malformed UTF-8 data\")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},d=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(t){\"string\"==typeof t&&(t=f.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r=this._data,n=r.words,i=r.sigBytes,o=this.blockSize,s=i/(4*o),u=(s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0))*o,c=t.min(4*u,i);if(u){for(var f=0;f0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=u,u.prototype.point=function(){throw new Error(\"Not implemented\")},u.prototype.validate=function(){throw new Error(\"Not implemented\")},u.prototype._fixedNafMul=function(t,e){s(t.precomputed);var r=t._getDoubles(),n=o(e,1,this._bitLength),i=(1<=u;e--)c=(c<<1)+n[e];a.push(c)}for(var f=this.jpoint(null,null,null),d=this.jpoint(null,null,null),h=i;h>0;h--){for(u=0;u=0;c--){for(e=0;c>=0&&0===a[c];c--)e++;if(c>=0&&e++,u=u.dblp(e),c<0)break;var f=a[c];s(0!==f),u=\"affine\"===t.type?f>0?u.mixedAdd(i[f-1>>1]):u.mixedAdd(i[-f-1>>1].neg()):f>0?u.add(i[f-1>>1]):u.add(i[-f-1>>1].neg())}return\"affine\"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,n,i){for(var s=this._wnafT1,u=this._wnafT2,c=this._wnafT3,f=0,d=0;d=1;d-=2){var l=d-1,p=d;if(1===s[l]&&1===s[p]){var b=[e[l],null,null,e[p]];0===e[l].y.cmp(e[p].y)?(b[1]=e[l].add(e[p]),b[2]=e[l].toJ().mixedAdd(e[p].neg())):0===e[l].y.cmp(e[p].y.redNeg())?(b[1]=e[l].toJ().mixedAdd(e[p]),b[2]=e[l].add(e[p].neg())):(b[1]=e[l].toJ().mixedAdd(e[p]),b[2]=e[l].toJ().mixedAdd(e[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=a(r[l],r[p]);f=Math.max(y[0].length,f),c[l]=new Array(f),c[p]=new Array(f);for(var v=0;v=0;d--){for(var M=0;d>=0;){var x=!0;for(v=0;v=0&&M++,w=w.dblp(M),d<0)break;for(v=0;v0?O=u[v][P-1>>1]:P<0&&(O=u[v][-P-1>>1].neg()),w=\"affine\"===O.type?w.mixedAdd(O):w.add(O))}}for(d=0;d=Math.ceil((t.bitLength()+1)/e.step)},c.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]>>32-e}function b(t,e,r,n,i,o,a,s){return p(t+(e^r^n)+o+a|0,s)+i|0}function g(t,e,r,n,i,o,a,s){return p(t+(e&r|~e&n)+o+a|0,s)+i|0}function y(t,e,r,n,i,o,a,s){return p(t+((e|~r)^n)+o+a|0,s)+i|0}function v(t,e,r,n,i,o,a,s){return p(t+(e&n|r&~n)+o+a|0,s)+i|0}function m(t,e,r,n,i,o,a,s){return p(t+(e^(r|~n))+o+a|0,s)+i|0}i(l,o),l.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,l=0|this._e,_=0|this._a,w=0|this._b,S=0|this._c,M=0|this._d,x=0|this._e,O=0;O<80;O+=1){var P,A;O<16?(P=b(r,n,i,o,l,t[s[O]],d[0],c[O]),A=m(_,w,S,M,x,t[u[O]],h[0],f[O])):O<32?(P=g(r,n,i,o,l,t[s[O]],d[1],c[O]),A=v(_,w,S,M,x,t[u[O]],h[1],f[O])):O<48?(P=y(r,n,i,o,l,t[s[O]],d[2],c[O]),A=y(_,w,S,M,x,t[u[O]],h[2],f[O])):O<64?(P=v(r,n,i,o,l,t[s[O]],d[3],c[O]),A=g(_,w,S,M,x,t[u[O]],h[3],f[O])):(P=m(r,n,i,o,l,t[s[O]],d[4],c[O]),A=b(_,w,S,M,x,t[u[O]],h[4],f[O])),r=l,l=o,o=p(i,10),i=n,n=P,_=x,x=M,M=p(S,10),S=w,w=A}var E=this._b+i+M|0;this._b=this._c+o+x|0,this._c=this._d+l+_|0,this._d=this._e+r+w|0,this._e=this._a+n+S|0,this._a=E},l.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=n.alloc?n.alloc(20):new n(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=l},function(t,e,r){(e=t.exports=function(t){t=t.toLowerCase();var r=e[t];if(!r)throw new Error(t+\" is not supported (we accept pull requests)\");return new r}).sha=r(187),e.sha1=r(188),e.sha224=r(189),e.sha256=r(81),e.sha384=r(190),e.sha512=r(82)},function(t,e,r){var n=r(3).Buffer,i=r(191).Transform,o=r(23).StringDecoder;function a(t){i.call(this),this.hashMode=\"string\"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(1)(a,i),a.prototype.update=function(t,e,r){\"string\"==typeof t&&(t=n.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error(\"trying to get auth tag in unsupported state\")},a.prototype.setAuthTag=function(){throw new Error(\"trying to set auth tag in unsupported state\")},a.prototype.setAAD=function(){throw new Error(\"trying to set aad in unsupported state\")},a.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},a.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},a.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return t&&(e=this._toString(e,t,!0)),e},a.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error(\"can't switch encodings\");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},t.exports=a},function(t,e,r){var n=r(2),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),o(i,a),a.from=function(t,e,r){if(\"number\"==typeof t)throw new TypeError(\"Argument must not be a number\");return i(t,e,r)},a.alloc=function(t,e,r){if(\"number\"!=typeof t)throw new TypeError(\"Argument must be a number\");var n=i(t);return void 0!==e?\"string\"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if(\"number\"!=typeof t)throw new TypeError(\"Argument must be a number\");return i(t)},a.allocUnsafeSlow=function(t){if(\"number\"!=typeof t)throw new TypeError(\"Argument must be a number\");return n.SlowBuffer(t)}},function(t,e,r){\"use strict\";(function(e,n,i){var o=r(30);function a(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=v;var s,u=!e.browser&&[\"v0.10\",\"v0.9.\"].indexOf(e.version.slice(0,5))>-1?n:o.nextTick;v.WritableState=y;var c=Object.create(r(24));c.inherits=r(1);var f={deprecate:r(79)},d=r(84),h=r(42).Buffer,l=i.Uint8Array||function(){};var p,b=r(85);function g(){}function y(t,e){s=s||r(16),t=t||{};var n=e instanceof s;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,c=t.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var d=!1===t.decodeStrings;this.decodeStrings=!d,this.defaultEncoding=t.defaultEncoding||\"utf8\",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(o.nextTick(i,n),o.nextTick(x,t,e),t._writableState.errorEmitted=!0,t.emit(\"error\",n)):(i(n),t._writableState.errorEmitted=!0,t.emit(\"error\",n),x(t,e))}(t,r,n,e,i);else{var a=S(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||w(t,r),n?u(_,t,r,a,i):_(t,r,a,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function v(t){if(s=s||r(16),!(p.call(v,this)||this instanceof s))return new v(t);this._writableState=new y(t,this),this.writable=!0,t&&(\"function\"==typeof t.write&&(this._write=t.write),\"function\"==typeof t.writev&&(this._writev=t.writev),\"function\"==typeof t.destroy&&(this._destroy=t.destroy),\"function\"==typeof t.final&&(this._final=t.final)),d.call(this)}function m(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function _(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit(\"drain\"))}(t,e),e.pendingcb--,n(),x(t,e)}function w(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,m(t,e,!0,e.length,i,\"\",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new a(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,d=r.callback;if(m(t,e,!1,e.objectMode?1:c.length,c,f,d),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function S(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function M(t,e){t._final((function(r){e.pendingcb--,r&&t.emit(\"error\",r),e.prefinished=!0,t.emit(\"prefinish\"),x(t,e)}))}function x(t,e){var r=S(e);return r&&(!function(t,e){e.prefinished||e.finalCalled||(\"function\"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(M,t,e)):(e.prefinished=!0,t.emit(\"prefinish\")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit(\"finish\"))),r}c.inherits(v,d),y.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(y.prototype,\"buffer\",{get:f.deprecate((function(){return this.getBuffer()}),\"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.\",\"DEP0003\")})}catch(t){}}(),\"function\"==typeof Symbol&&Symbol.hasInstance&&\"function\"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(t){return!!p.call(this,t)||this===v&&(t&&t._writableState instanceof y)}})):p=function(t){return t instanceof this},v.prototype.pipe=function(){this.emit(\"error\",new Error(\"Cannot pipe, not readable\"))},v.prototype.write=function(t,e,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=t,h.isBuffer(n)||n instanceof l);return s&&!h.isBuffer(t)&&(t=function(t){return h.from(t)}(t)),\"function\"==typeof e&&(r=e,e=null),s?e=\"buffer\":e||(e=i.defaultEncoding),\"function\"!=typeof r&&(r=g),i.ended?function(t,e){var r=new Error(\"write after end\");t.emit(\"error\",r),o.nextTick(e,r)}(this,r):(s||function(t,e,r,n){var i=!0,a=!1;return null===r?a=new TypeError(\"May not write null values to stream\"):\"string\"==typeof r||void 0===r||e.objectMode||(a=new TypeError(\"Invalid non-string/buffer chunk\")),a&&(t.emit(\"error\",a),o.nextTick(n,a),i=!1),i}(this,i,t,r))&&(i.pendingcb++,a=function(t,e,r,n,i,o){if(!r){var a=function(t,e,r){t.objectMode||!1===t.decodeStrings||\"string\"!=typeof e||(e=h.from(e,r));return e}(e,n,i);n!==a&&(r=!0,i=\"buffer\",n=a)}var s=e.objectMode?1:n.length;e.length+=s;var u=e.length-1))throw new TypeError(\"Unknown encoding: \"+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(v.prototype,\"writableHighWaterMark\",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(t,e,r){r(new Error(\"_write() is not implemented\"))},v.prototype._writev=null,v.prototype.end=function(t,e,r){var n=this._writableState;\"function\"==typeof t?(r=t,t=null,e=null):\"function\"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(t,e,r){e.ending=!0,x(t,e),r&&(e.finished?o.nextTick(r):t.once(\"finish\",r));e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(v.prototype,\"destroyed\",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),v.prototype.destroy=b.destroy,v.prototype._undestroy=b.undestroy,v.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,r(7),r(195).setImmediate,r(12))},function(t,e,r){\"use strict\";var n,i=e,o=r(45),a=r(93),s=r(10).assert;function u(t){\"short\"===t.type?this.curve=new a.short(t):\"edwards\"===t.type?this.curve=new a.edwards(t):this.curve=new a.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,s(this.g.validate(),\"Invalid curve\"),s(this.g.mul(this.n).isInfinity(),\"Invalid curve, G*N != O\")}function c(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new u(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,c(\"p192\",{type:\"short\",prime:\"p192\",p:\"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\",a:\"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc\",b:\"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1\",n:\"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831\",hash:o.sha256,gRed:!1,g:[\"188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012\",\"07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811\"]}),c(\"p224\",{type:\"short\",prime:\"p224\",p:\"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\",a:\"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe\",b:\"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4\",n:\"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d\",hash:o.sha256,gRed:!1,g:[\"b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21\",\"bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34\"]}),c(\"p256\",{type:\"short\",prime:null,p:\"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff\",a:\"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc\",b:\"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b\",n:\"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551\",hash:o.sha256,gRed:!1,g:[\"6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296\",\"4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5\"]}),c(\"p384\",{type:\"short\",prime:null,p:\"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff\",a:\"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc\",b:\"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef\",n:\"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973\",hash:o.sha384,gRed:!1,g:[\"aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7\",\"3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f\"]}),c(\"p521\",{type:\"short\",prime:null,p:\"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff\",a:\"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc\",b:\"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00\",n:\"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409\",hash:o.sha512,gRed:!1,g:[\"000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66\",\"00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650\"]}),c(\"curve25519\",{type:\"mont\",prime:\"p25519\",p:\"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\",a:\"76d06\",b:\"1\",n:\"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed\",hash:o.sha256,gRed:!1,g:[\"9\"]}),c(\"ed25519\",{type:\"edwards\",prime:\"p25519\",p:\"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\",a:\"-1\",c:\"1\",d:\"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3\",n:\"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed\",hash:o.sha256,gRed:!1,g:[\"216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a\",\"6666666666666666666666666666666666666666666666666666666666666658\"]});try{n=r(220)}catch(t){n=void 0}c(\"secp256k1\",{type:\"short\",prime:\"k256\",p:\"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\",a:\"0\",b:\"7\",n:\"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141\",h:\"1\",hash:o.sha256,beta:\"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee\",lambda:\"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72\",basis:[{a:\"3086d221a7d46bcde86c90e49284eb15\",b:\"-e4437ed6010e88286f547fa90abfe4c3\"},{a:\"114ca50f7a8e2f3f657c1108d9d44cfd8\",b:\"3086d221a7d46bcde86c90e49284eb15\"}],gRed:!1,g:[\"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798\",\"483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\",n]})},function(t,e,r){var n=e;n.utils=r(14),n.common=r(25),n.sha=r(214),n.ripemd=r(218),n.hmac=r(219),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(t,e){var r={Array:function(t){return null!=t&&t.constructor===Array},Boolean:function(t){return\"boolean\"==typeof t},Function:function(t){return\"function\"==typeof t},Nil:function(t){return null==t},Number:function(t){return\"number\"==typeof t},Object:function(t){return\"object\"==typeof t},String:function(t){return\"string\"==typeof t},\"\":function(){return!0}};for(var n in r.Null=r.Nil,r)r[n].toJSON=function(t){return t}.bind(null,n);t.exports=r},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0}),e.Denom=void 0,function(t){t.LUNA=\"uluna\",t.CNY=\"ucny\",t.EUR=\"ueur\",t.GBP=\"ugbp\",t.JPY=\"ujpy\",t.KRW=\"ukrw\",t.MNT=\"umnt\",t.SDR=\"usdr\",t.USD=\"uusd\"}(e.Denom||(e.Denom={}))},function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(r(118),e),i(r(119),e)},function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(r(120),e),i(r(121),e),i(r(122),e),i(r(123),e)},function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(r(124),e),i(r(125),e),i(r(140),e)},function(t,e,r){\"use strict\";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,\"__esModule\",{value:!0}),e.Proposal=void 0;var o=r(6),a=r(52),s=r(53),u=r(54),c=r(0),f=r(5),d=r(55),h=function(t){function e(e,r,n,i,o,a,s,u,c){var f=t.call(this)||this;return f.id=e,f.content=r,f.proposal_status=n,f.final_tally_result=i,f.submit_time=o,f.deposit_end_time=a,f.total_deposit=s,f.voting_start_time=u,f.voting_end_time=c,f}return i(e,t),e.fromData=function(t){var r,n=t.id,i=t.content,a=t.proposal_status,s=t.final_tally_result,u=t.submit_time,c=t.deposit_end_time,d=t.total_deposit,h=t.voting_start_time,l=t.voting_end_time;return s&&(r={yes:new f.Int(s.yes),no:new f.Int(s.no),abstain:new f.Int(s.abstain),no_with_veto:new f.Int(s.no_with_veto)}),new e(Number.parseInt(n),e.Content.fromData(i),a,r,new Date(u),new Date(c),o.Coins.fromData(d),new Date(h),new Date(l))},e.prototype.toData=function(){var t,e=this.proposal_status,r=this.final_tally_result;return r&&(t={yes:r.yes.toString(),no:r.no.toString(),abstain:r.abstain.toString(),no_with_veto:r.no_with_veto.toString()}),{id:this.id.toFixed(),content:this.content.toData(),proposal_status:e,final_tally_result:t,submit_time:this.submit_time.toISOString(),deposit_end_time:this.deposit_end_time.toISOString(),total_deposit:this.total_deposit.toData(),voting_start_time:this.voting_start_time.toISOString(),voting_end_time:this.voting_end_time.toISOString()}},e}(c.JSONSerializable);e.Proposal=h,function(t){!function(t){t.fromData=function(t){switch(t.type){case\"gov/TextProposal\":return s.TextProposal.fromData(t);case\"distribution/CommunityPoolSpendProposal\":return a.CommunityPoolSpendProposal.fromData(t);case\"treasury/TaxRateUpdateProposal\":return u.TaxRateUpdateProposal.fromData(t);case\"treasury/RewardWeightUpdateProposal\":return u.RewardWeightUpdateProposal.fromData(t);case\"params/ParameterChangeProposal\":return d.ParameterChangeProposal.fromData(t)}}}(t.Content||(t.Content={})),function(t){t.NIL=\"\",t.DEPOSIT_PERIOD=\"DepositPeriod\",t.VOTING_PERIOD=\"VotingPeriod\",t.PASSED=\"Passed\",t.REJECTED=\"Rejected\",t.FAILED=\"Failed\"}(t.Status||(t.Status={}))}(h=e.Proposal||(e.Proposal={})),e.Proposal=h},function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(r(126),e)},function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(r(127),e)},function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(r(128),e),i(r(129),e)},function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(r(130),e)},function(t,e,r){\"use strict\";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function u(t){for(var e=1,r=0;r126)return\"Invalid prefix (\"+t+\")\";e=s(e)^n>>5}for(e=s(e),r=0;re)return\"Exceeds length limit\";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return\"Mixed-case string \"+t;var o=(t=r).lastIndexOf(\"1\");if(-1===o)return\"No separator character for \"+t;if(0===o)return\"Missing prefix for \"+t;var a=t.slice(0,o),c=t.slice(o+1);if(c.length<6)return\"Data too short\";var f=u(a);if(\"string\"==typeof f)return f;for(var d=[],h=0;h=c.length||d.push(p)}return 1!==f?\"Invalid checksum for \"+t:{prefix:a,words:d}}function f(t,e,r,n){for(var i=0,o=0,a=(1<=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<=e)return\"Excess padding\";if(i<r)throw new TypeError(\"Exceeds length limit\");var i=u(t=t.toLowerCase());if(\"string\"==typeof i)throw new Error(i);for(var o=t+\"1\",a=0;a>5!=0)throw new Error(\"Non 5-bit word\");i=s(i)^c,o+=n.charAt(c)}for(a=0;a<6;++a)i=s(i);for(i^=1,a=0;a<6;++a){o+=n.charAt(i>>5*(5-a)&31)}return o},toWordsUnsafe:function(t){var e=f(t,8,5,!0);if(Array.isArray(e))return e},toWords:function(t){var e=f(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)},fromWordsUnsafe:function(t){var e=f(t,5,8,!1);if(Array.isArray(e))return e},fromWords:function(t){var e=f(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}}},function(t,e,r){\"use strict\";(function(t){var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]>>32-e}function c(t,e,r,n,i,o,a){return u(t+(e&r|~e&n)+i+o|0,a)+e|0}function f(t,e,r,n,i,o,a){return u(t+(e&n|r&~n)+i+o|0,a)+e|0}function d(t,e,r,n,i,o,a){return u(t+(e^r^n)+i+o|0,a)+e|0}function h(t,e,r,n,i,o,a){return u(t+(r^(e|~n))+i+o|0,a)+e|0}n(s,i),s.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,o=this._d;r=c(r,n,i,o,t[0],3614090360,7),o=c(o,r,n,i,t[1],3905402710,12),i=c(i,o,r,n,t[2],606105819,17),n=c(n,i,o,r,t[3],3250441966,22),r=c(r,n,i,o,t[4],4118548399,7),o=c(o,r,n,i,t[5],1200080426,12),i=c(i,o,r,n,t[6],2821735955,17),n=c(n,i,o,r,t[7],4249261313,22),r=c(r,n,i,o,t[8],1770035416,7),o=c(o,r,n,i,t[9],2336552879,12),i=c(i,o,r,n,t[10],4294925233,17),n=c(n,i,o,r,t[11],2304563134,22),r=c(r,n,i,o,t[12],1804603682,7),o=c(o,r,n,i,t[13],4254626195,12),i=c(i,o,r,n,t[14],2792965006,17),r=f(r,n=c(n,i,o,r,t[15],1236535329,22),i,o,t[1],4129170786,5),o=f(o,r,n,i,t[6],3225465664,9),i=f(i,o,r,n,t[11],643717713,14),n=f(n,i,o,r,t[0],3921069994,20),r=f(r,n,i,o,t[5],3593408605,5),o=f(o,r,n,i,t[10],38016083,9),i=f(i,o,r,n,t[15],3634488961,14),n=f(n,i,o,r,t[4],3889429448,20),r=f(r,n,i,o,t[9],568446438,5),o=f(o,r,n,i,t[14],3275163606,9),i=f(i,o,r,n,t[3],4107603335,14),n=f(n,i,o,r,t[8],1163531501,20),r=f(r,n,i,o,t[13],2850285829,5),o=f(o,r,n,i,t[2],4243563512,9),i=f(i,o,r,n,t[7],1735328473,14),r=d(r,n=f(n,i,o,r,t[12],2368359562,20),i,o,t[5],4294588738,4),o=d(o,r,n,i,t[8],2272392833,11),i=d(i,o,r,n,t[11],1839030562,16),n=d(n,i,o,r,t[14],4259657740,23),r=d(r,n,i,o,t[1],2763975236,4),o=d(o,r,n,i,t[4],1272893353,11),i=d(i,o,r,n,t[7],4139469664,16),n=d(n,i,o,r,t[10],3200236656,23),r=d(r,n,i,o,t[13],681279174,4),o=d(o,r,n,i,t[0],3936430074,11),i=d(i,o,r,n,t[3],3572445317,16),n=d(n,i,o,r,t[6],76029189,23),r=d(r,n,i,o,t[9],3654602809,4),o=d(o,r,n,i,t[12],3873151461,11),i=d(i,o,r,n,t[15],530742520,16),r=h(r,n=d(n,i,o,r,t[2],3299628645,23),i,o,t[0],4096336452,6),o=h(o,r,n,i,t[7],1126891415,10),i=h(i,o,r,n,t[14],2878612391,15),n=h(n,i,o,r,t[5],4237533241,21),r=h(r,n,i,o,t[12],1700485571,6),o=h(o,r,n,i,t[3],2399980690,10),i=h(i,o,r,n,t[10],4293915773,15),n=h(n,i,o,r,t[1],2240044497,21),r=h(r,n,i,o,t[8],1873313359,6),o=h(o,r,n,i,t[15],4264355552,10),i=h(i,o,r,n,t[6],2734768916,15),n=h(n,i,o,r,t[13],1309151649,21),r=h(r,n,i,o,t[4],4149444226,6),o=h(o,r,n,i,t[11],3174756917,10),i=h(i,o,r,n,t[2],718787259,15),n=h(n,i,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=s},function(t,e,r){\"use strict\";var n=r(3).Buffer,i=r(179).Transform;function o(t){i.call(this),this._block=n.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(1)(o,i),o.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!n.isBuffer(t)&&\"string\"!=typeof t)throw new TypeError(e+\" must be a string or a buffer\")}(t,\"Data\"),this._finalized)throw new Error(\"Digest already called\");n.isBuffer(t)||(t=n.from(t,e));for(var r=this._block,i=0;this._blockOffset+t.length-i>=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error(\"_update is not implemented\")},o.prototype.digest=function(t){if(this._finalized)throw new Error(\"Digest already called\");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error(\"_digest is not implemented\")},t.exports=o},function(t,e,r){\"use strict\";(function(e,n){var i;t.exports=O,O.ReadableState=x;r(22).EventEmitter;var o=function(t,e){return t.listeners(e).length},a=r(75),s=r(2).Buffer,u=e.Uint8Array||function(){};var c,f=r(180);c=f&&f.debuglog?f.debuglog(\"stream\"):function(){};var d,h,l,p=r(181),b=r(76),g=r(77).getHighWaterMark,y=r(19).codes,v=y.ERR_INVALID_ARG_TYPE,m=y.ERR_STREAM_PUSH_AFTER_EOF,_=y.ERR_METHOD_NOT_IMPLEMENTED,w=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(1)(O,a);var S=b.errorOrDestroy,M=[\"error\",\"close\",\"destroy\",\"pause\",\"resume\"];function x(t,e,n){i=i||r(20),t=t||{},\"boolean\"!=typeof n&&(n=e instanceof i),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,\"readableHighWaterMark\",n),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||\"utf8\",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(d||(d=r(23).StringDecoder),this.decoder=new d(t.encoding),this.encoding=t.encoding)}function O(t){if(i=i||r(20),!(this instanceof O))return new O(t);var e=this instanceof i;this._readableState=new x(t,this,e),this.readable=!0,t&&(\"function\"==typeof t.read&&(this._read=t.read),\"function\"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function P(t,e,r,n,i){c(\"readableAddChunk\",e);var o,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(c(\"onEofChunk\"),e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?k(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,j(t)))}(t,a);else if(i||(o=function(t,e){var r;n=e,s.isBuffer(n)||n instanceof u||\"string\"==typeof e||void 0===e||t.objectMode||(r=new v(\"chunk\",[\"string\",\"Buffer\",\"Uint8Array\"],e));var n;return r}(a,e)),o)S(t,o);else if(a.objectMode||e&&e.length>0)if(\"string\"==typeof e||a.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),n)a.endEmitted?S(t,new w):A(t,a,e,!0);else if(a.ended)S(t,new m);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?A(t,a,e,!1):D(t,a)):A(t,a,e,!1)}else n||(a.reading=!1,D(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function k(t){var e=t._readableState;c(\"emitReadable\",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c(\"emitReadable\",e.flowing),e.emittedReadable=!0,n.nextTick(j,t))}function j(t){var e=t._readableState;c(\"emitReadable_\",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit(\"readable\"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,T(t)}function D(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(I,t,e))}function I(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount(\"data\")>0&&t.resume()}function C(t){c(\"readable nexttick read 0\"),t.read(0)}function N(t,e){c(\"resume\",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit(\"resume\"),T(t),e.flowing&&!e.reading&&t.read(0)}function T(t){var e=t._readableState;for(c(\"flow\",e.flowing);e.flowing&&null!==t.read(););}function B(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(\"\"):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function z(t){var e=t._readableState;c(\"endReadable\",e.endEmitted),e.endEmitted||(e.ended=!0,n.nextTick(L,e,t))}function L(t,e){if(c(\"endReadableNT\",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit(\"end\"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function q(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return c(\"read: emitReadable\",e.length,e.ended),0===e.length&&e.ended?z(this):k(this),null;if(0===(t=E(t,e))&&e.ended)return 0===e.length&&z(this),null;var n,i=e.needReadable;return c(\"need readable\",i),(0===e.length||e.length-t0?B(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&z(this)),null!==n&&this.emit(\"data\",n),n},O.prototype._read=function(t){S(this,new _(\"_read()\"))},O.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,c(\"pipe count=%d opts=%j\",i.pipesCount,e);var a=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?u:g;function s(e,n){c(\"onunpipe\"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,c(\"cleanup\"),t.removeListener(\"close\",p),t.removeListener(\"finish\",b),t.removeListener(\"drain\",f),t.removeListener(\"error\",l),t.removeListener(\"unpipe\",s),r.removeListener(\"end\",u),r.removeListener(\"end\",g),r.removeListener(\"data\",h),d=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}function u(){c(\"onend\"),t.end()}i.endEmitted?n.nextTick(a):r.once(\"end\",a),t.on(\"unpipe\",s);var f=function(t){return function(){var e=t._readableState;c(\"pipeOnDrain\",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,\"data\")&&(e.flowing=!0,T(t))}}(r);t.on(\"drain\",f);var d=!1;function h(e){c(\"ondata\");var n=t.write(e);c(\"dest.write\",n),!1===n&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==q(i.pipes,t))&&!d&&(c(\"false write response, pause\",i.awaitDrain),i.awaitDrain++),r.pause())}function l(e){c(\"onerror\",e),g(),t.removeListener(\"error\",l),0===o(t,\"error\")&&S(t,e)}function p(){t.removeListener(\"finish\",b),g()}function b(){c(\"onfinish\"),t.removeListener(\"close\",p),g()}function g(){c(\"unpipe\"),r.unpipe(t)}return r.on(\"data\",h),function(t,e,r){if(\"function\"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,\"error\",l),t.once(\"close\",p),t.once(\"finish\",b),t.emit(\"pipe\",r),i.flowing||(c(\"pipe resume\"),r.resume()),t},O.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit(\"unpipe\",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):\"readable\"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c(\"on readable\",i.length,i.reading),i.length?k(this):i.reading||n.nextTick(C,this))),r},O.prototype.addListener=O.prototype.on,O.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return\"readable\"===t&&n.nextTick(R,this),r},O.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return\"readable\"!==t&&void 0!==t||n.nextTick(R,this),e},O.prototype.resume=function(){var t=this._readableState;return t.flowing||(c(\"resume\"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,n.nextTick(N,t,e))}(this,t)),t.paused=!1,this},O.prototype.pause=function(){return c(\"call pause flowing=%j\",this._readableState.flowing),!1!==this._readableState.flowing&&(c(\"pause\"),this._readableState.flowing=!1,this.emit(\"pause\")),this._readableState.paused=!0,this},O.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on(\"end\",(function(){if(c(\"wrapped end\"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on(\"data\",(function(i){(c(\"wrapped data\"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&\"function\"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o-1))throw new w(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(O.prototype,\"writableBuffer\",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(O.prototype,\"writableHighWaterMark\",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),O.prototype._write=function(t,e,r){r(new b(\"_write()\"))},O.prototype._writev=null,O.prototype.end=function(t,e,r){var i=this._writableState;return\"function\"==typeof t?(r=t,t=null,e=null):\"function\"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,r){e.ending=!0,D(t,e),r&&(e.finished?n.nextTick(r):t.once(\"finish\",r));e.ended=!0,t.writable=!1}(this,i,r),this},Object.defineProperty(O.prototype,\"writableLength\",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(O.prototype,\"destroyed\",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),O.prototype.destroy=d.destroy,O.prototype._undestroy=d.undestroy,O.prototype._destroy=function(t,e){e(t)}}).call(this,r(12),r(7))},function(t,e,r){(function(e){function r(t){try{if(!e.localStorage)return!1}catch(t){return!1}var r=e.localStorage[t];return null!=r&&\"true\"===String(r).toLowerCase()}t.exports=function(t,e){if(r(\"noDeprecation\"))return t;var n=!1;return function(){if(!n){if(r(\"throwDeprecation\"))throw new Error(e);r(\"traceDeprecation\")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}}).call(this,r(12))},function(t,e,r){\"use strict\";t.exports=f;var n=r(19).codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(20);function c(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit(\"error\",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function h(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function l(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,p=0|this._f,b=0|this._g,g=0|this._h,y=0;y<16;++y)r[y]=t.readInt32BE(4*y);for(;y<64;++y)r[y]=0|(((e=r[y-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[y-7]+l(r[y-15])+r[y-16];for(var v=0;v<64;++v){var m=g+h(u)+c(u,p,b)+a[v]+r[v]|0,_=d(n)+f(n,i,o)|0;g=b,b=p,p=u,u=s+m|0,s=o,o=i,i=n,n=m+_|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=g+this._h|0},u.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=u},function(t,e,r){var n=r(1),i=r(21),o=r(3).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}function c(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function d(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function h(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function l(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function b(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function g(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function y(t,e){return t>>>0>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,u=0|this._fh,v=0|this._gh,m=0|this._hh,_=0|this._al,w=0|this._bl,S=0|this._cl,M=0|this._dl,x=0|this._el,O=0|this._fl,P=0|this._gl,A=0|this._hl,E=0;E<32;E+=2)e[E]=t.readInt32BE(4*E),e[E+1]=t.readInt32BE(4*E+4);for(;E<160;E+=2){var k=e[E-30],j=e[E-30+1],D=l(k,j),I=p(j,k),R=b(k=e[E-4],j=e[E-4+1]),C=g(j,k),N=e[E-14],T=e[E-14+1],B=e[E-32],z=e[E-32+1],L=I+T|0,q=D+N+y(L,I)|0;q=(q=q+R+y(L=L+C|0,C)|0)+B+y(L=L+z|0,z)|0,e[E]=q,e[E+1]=L}for(var U=0;U<160;U+=2){q=e[U],L=e[U+1];var F=f(r,n,i),K=f(_,w,S),V=d(r,_),J=d(_,r),W=h(s,x),H=h(x,s),Y=a[U],G=a[U+1],Z=c(s,u,v),X=c(x,O,P),$=A+H|0,Q=m+W+y($,A)|0;Q=(Q=(Q=Q+Z+y($=$+X|0,X)|0)+Y+y($=$+G|0,G)|0)+q+y($=$+L|0,L)|0;var tt=J+K|0,et=V+F+y(tt,J)|0;m=v,A=P,v=u,P=O,u=s,O=x,s=o+Q+y(x=M+$|0,M)|0,o=i,M=S,i=n,S=w,n=r,w=_,r=Q+et+y(_=$+tt|0,$)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+S|0,this._dl=this._dl+M|0,this._el=this._el+x|0,this._fl=this._fl+O|0,this._gl=this._gl+P|0,this._hl=this._hl+A|0,this._ah=this._ah+r+y(this._al,_)|0,this._bh=this._bh+n+y(this._bl,w)|0,this._ch=this._ch+i+y(this._cl,S)|0,this._dh=this._dh+o+y(this._dl,M)|0,this._eh=this._eh+s+y(this._el,x)|0,this._fh=this._fh+u+y(this._fl,O)|0,this._gh=this._gh+v+y(this._gl,P)|0,this._hh=this._hh+m+y(this._hl,A)|0},u.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=u},function(t,e,r){\"use strict\";(function(e,n){var i=r(30);t.exports=m;var o,a=r(66);m.ReadableState=v;r(22).EventEmitter;var s=function(t,e){return t.listeners(e).length},u=r(84),c=r(42).Buffer,f=e.Uint8Array||function(){};var d=Object.create(r(24));d.inherits=r(1);var h=r(192),l=void 0;l=h&&h.debuglog?h.debuglog(\"stream\"):function(){};var p,b=r(193),g=r(85);d.inherits(m,u);var y=[\"error\",\"close\",\"destroy\",\"pause\",\"resume\"];function v(t,e){t=t||{};var n=e instanceof(o=o||r(16));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,a=t.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new b,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||\"utf8\",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=r(23).StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function m(t){if(o=o||r(16),!(this instanceof m))return new m(t);this._readableState=new v(t,this),this.readable=!0,t&&(\"function\"==typeof t.read&&(this._read=t.read),\"function\"==typeof t.destroy&&(this._destroy=t.destroy)),u.call(this)}function _(t,e,r,n,i){var o,a=t._readableState;null===e?(a.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,M(t)}(t,a)):(i||(o=function(t,e){var r;n=e,c.isBuffer(n)||n instanceof f||\"string\"==typeof e||void 0===e||t.objectMode||(r=new TypeError(\"Invalid non-string/buffer chunk\"));var n;return r}(a,e)),o?t.emit(\"error\",o):a.objectMode||e&&e.length>0?(\"string\"==typeof e||a.objectMode||Object.getPrototypeOf(e)===c.prototype||(e=function(t){return c.from(t)}(e)),n?a.endEmitted?t.emit(\"error\",new Error(\"stream.unshift() after end event\")):w(t,a,e,!0):a.ended?t.emit(\"error\",new Error(\"stream.push() after EOF\")):(a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?w(t,a,e,!1):O(t,a)):w(t,a,e,!1))):n||(a.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=8388608?t=8388608:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function M(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(l(\"emitReadable\",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(x,t):x(t))}function x(t){l(\"emit readable\"),t.emit(\"readable\"),k(t)}function O(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(P,t,e))}function P(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(\"\"):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;to.length?o.length:t;if(a===o.length?i+=o:i+=o.slice(0,t),0===(t-=a)){a===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=c.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,a),0===(t-=a)){a===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(a));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function D(t){var e=t._readableState;if(e.length>0)throw new Error('\"endReadable()\" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(I,e,t))}function I(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit(\"end\"))}function R(t,e){for(var r=0,n=t.length;r=e.highWaterMark||e.ended))return l(\"read: emitReadable\",e.length,e.ended),0===e.length&&e.ended?D(this):M(this),null;if(0===(t=S(t,e))&&e.ended)return 0===e.length&&D(this),null;var n,i=e.needReadable;return l(\"need readable\",i),(0===e.length||e.length-t0?j(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&D(this)),null!==n&&this.emit(\"data\",n),n},m.prototype._read=function(t){this.emit(\"error\",new Error(\"_read() is not implemented\"))},m.prototype.pipe=function(t,e){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,l(\"pipe count=%d opts=%j\",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?f:m;function c(e,n){l(\"onunpipe\"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,l(\"cleanup\"),t.removeListener(\"close\",y),t.removeListener(\"finish\",v),t.removeListener(\"drain\",d),t.removeListener(\"error\",g),t.removeListener(\"unpipe\",c),r.removeListener(\"end\",f),r.removeListener(\"end\",m),r.removeListener(\"data\",b),h=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||d())}function f(){l(\"onend\"),t.end()}o.endEmitted?i.nextTick(u):r.once(\"end\",u),t.on(\"unpipe\",c);var d=function(t){return function(){var e=t._readableState;l(\"pipeOnDrain\",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,\"data\")&&(e.flowing=!0,k(t))}}(r);t.on(\"drain\",d);var h=!1;var p=!1;function b(e){l(\"ondata\"),p=!1,!1!==t.write(e)||p||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==R(o.pipes,t))&&!h&&(l(\"false write response, pause\",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function g(e){l(\"onerror\",e),m(),t.removeListener(\"error\",g),0===s(t,\"error\")&&t.emit(\"error\",e)}function y(){t.removeListener(\"finish\",v),m()}function v(){l(\"onfinish\"),t.removeListener(\"close\",y),m()}function m(){l(\"unpipe\"),r.unpipe(t)}return r.on(\"data\",b),function(t,e,r){if(\"function\"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?a(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,\"error\",g),t.once(\"close\",y),t.once(\"finish\",v),t.emit(\"pipe\",r),o.flowing||(l(\"pipe resume\"),r.resume()),t},m.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit(\"unpipe\",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;or)?e=(\"rmd160\"===t?new u:c(t)).update(e).digest():e.length>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(t,e){return\"hex\"===e?o(t):t}},function(t,e,r){var n;function i(t){this.rand=t}if(t.exports=function(t){return n||(n=new i(null)),n.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},function(t,e,r){\"use strict\";var n=r(14),i=r(25),o=r(94),a=r(17),s=n.sum32,u=n.sum32_4,c=n.sum32_5,f=o.ch32,d=o.maj32,h=o.s0_256,l=o.s1_256,p=o.g0_256,b=o.g1_256,g=i.BlockHash,y=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}n.inherits(v,g),t.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;nr||e!=e)throw new TypeError(\"Bad key length\")}},function(t,e,r){(function(e){var r;if(e.browser)r=\"utf-8\";else if(e.version){r=parseInt(e.version.split(\".\")[0].slice(1),10)>=6?\"utf-8\":\"binary\"}else r=\"utf-8\";t.exports=r}).call(this,r(7))},function(t,e,r){var n=r(88),i=r(39),o=r(40),a=r(3).Buffer,s=r(98),u=r(99),c=r(101),f=a.alloc(128),d={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function h(t,e,r){var s=function(t){function e(e){return o(t).update(e).digest()}return\"rmd160\"===t||\"ripemd160\"===t?function(t){return(new i).update(t).digest()}:\"md5\"===t?n:e}(t),u=\"sha512\"===t||\"sha384\"===t?128:64;e.length>u?e=s(e):e.length=200&&t<300}};u.headers={common:{Accept:\"application/json, text/plain, */*\"}},n.forEach([\"delete\",\"get\",\"head\"],(function(t){u.headers[t]={}})),n.forEach([\"post\",\"put\",\"patch\"],(function(t){u.headers[t]=n.merge(o)})),t.exports=u}).call(this,r(7))},function(t,e,r){\"use strict\";var n=r(9),i=r(249),o=r(251),a=r(106),s=r(252),u=r(255),c=r(256),f=r(110);t.exports=function(t){return new Promise((function(e,r){var d=t.data,h=t.headers;n.isFormData(d)&&delete h[\"Content-Type\"],(n.isBlob(d)||n.isFile(d))&&d.type&&delete h[\"Content-Type\"];var l=new XMLHttpRequest;if(t.auth){var p=t.auth.username||\"\",b=unescape(encodeURIComponent(t.auth.password))||\"\";h.Authorization=\"Basic \"+btoa(p+\":\"+b)}var g=s(t.baseURL,t.url);if(l.open(t.method.toUpperCase(),a(g,t.params,t.paramsSerializer),!0),l.timeout=t.timeout,l.onreadystatechange=function(){if(l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf(\"file:\"))){var n=\"getAllResponseHeaders\"in l?u(l.getAllResponseHeaders()):null,o={data:t.responseType&&\"text\"!==t.responseType?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:n,config:t,request:l};i(e,r,o),l=null}},l.onabort=function(){l&&(r(f(\"Request aborted\",t,\"ECONNABORTED\",l)),l=null)},l.onerror=function(){r(f(\"Network Error\",t,null,l)),l=null},l.ontimeout=function(){var e=\"timeout of \"+t.timeout+\"ms exceeded\";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(f(e,t,\"ECONNABORTED\",l)),l=null},n.isStandardBrowserEnv()){var y=(t.withCredentials||c(g))&&t.xsrfCookieName?o.read(t.xsrfCookieName):void 0;y&&(h[t.xsrfHeaderName]=y)}if(\"setRequestHeader\"in l&&n.forEach(h,(function(t,e){void 0===d&&\"content-type\"===e.toLowerCase()?delete h[e]:l.setRequestHeader(e,t)})),n.isUndefined(t.withCredentials)||(l.withCredentials=!!t.withCredentials),t.responseType)try{l.responseType=t.responseType}catch(e){if(\"json\"!==t.responseType)throw e}\"function\"==typeof t.onDownloadProgress&&l.addEventListener(\"progress\",t.onDownloadProgress),\"function\"==typeof t.onUploadProgress&&l.upload&&l.upload.addEventListener(\"progress\",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){l&&(l.abort(),r(t),l=null)})),d||(d=null),l.send(d)}))}},function(t,e,r){\"use strict\";var n=r(250);t.exports=function(t,e,r,i,o){var a=new Error(t);return n(a,e,r,i,o)}},function(t,e,r){\"use strict\";var n=r(9);t.exports=function(t,e){e=e||{};var r={},i=[\"url\",\"method\",\"data\"],o=[\"headers\",\"auth\",\"proxy\",\"params\"],a=[\"baseURL\",\"transformRequest\",\"transformResponse\",\"paramsSerializer\",\"timeout\",\"timeoutMessage\",\"withCredentials\",\"adapter\",\"responseType\",\"xsrfCookieName\",\"xsrfHeaderName\",\"onUploadProgress\",\"onDownloadProgress\",\"decompress\",\"maxContentLength\",\"maxBodyLength\",\"maxRedirects\",\"transport\",\"httpAgent\",\"httpsAgent\",\"cancelToken\",\"socketPath\",\"responseEncoding\"],s=[\"validateStatus\"];function u(t,e){return n.isPlainObject(t)&&n.isPlainObject(e)?n.merge(t,e):n.isPlainObject(e)?n.merge({},e):n.isArray(e)?e.slice():e}function c(i){n.isUndefined(e[i])?n.isUndefined(t[i])||(r[i]=u(void 0,t[i])):r[i]=u(t[i],e[i])}n.forEach(i,(function(t){n.isUndefined(e[t])||(r[t]=u(void 0,e[t]))})),n.forEach(o,c),n.forEach(a,(function(i){n.isUndefined(e[i])?n.isUndefined(t[i])||(r[i]=u(void 0,t[i])):r[i]=u(void 0,e[i])})),n.forEach(s,(function(n){n in e?r[n]=u(t[n],e[n]):n in t&&(r[n]=u(void 0,t[n]))}));var f=i.concat(o).concat(a).concat(s),d=Object.keys(t).concat(Object.keys(e)).filter((function(t){return-1===f.indexOf(t)}));return n.forEach(d,c),r}},function(t,e,r){\"use strict\";function n(t){this.message=t}n.prototype.toString=function(){return\"Cancel\"+(this.message?\": \"+this.message:\"\")},n.prototype.__CANCEL__=!0,t.exports=n},function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(r(259),e),i(r(260),e),i(r(261),e),i(r(262),e),i(r(263),e),i(r(264),e),i(r(265),e),i(r(266),e),i(r(267),e),i(r(268),e),i(r(269),e),i(r(270),e),i(r(271),e),i(r(274),e)},function(t,e,r){\"use strict\";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},\"function\"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError(\"Generator is already executing.\");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0){for(o+=a,e=1;er)throw Error(p+t)}function A(t,e,r,n){var i,o,a,s;for(o=t[0];o>=10;o/=10)--e;return--e<0?(e+=7,i=0):(i=Math.ceil((e+1)/7),e%=7),o=g(10,7-e),s=t[i]%o|0,null==n?e<3?(0==e?s=s/100|0:1==e&&(s=s/10|0),a=r<4&&99999==s||r>3&&49999==s||5e4==s||0==s):a=(r<4&&s+1==o||r>3&&s+1==o/2)&&(t[i+1]/o/100|0)==g(10,e-2)-1||(s==o/2||0==s)&&0==(t[i+1]/o/100|0):e<4?(0==e?s=s/1e3|0:1==e?s=s/100|0:2==e&&(s=s/10|0),a=(n||r<4)&&9999==s||!n&&r>3&&4999==s):a=((n||r<4)&&s+1==o||!n&&r>3&&s+1==o/2)&&(t[i+1]/o/1e3|0)==g(10,e-3)-1,a}function E(t,e,r){for(var n,i,o=[0],a=0,s=t.length;ar-1&&(void 0===o[n+1]&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}x.absoluteValue=x.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),j(t)},x.ceil=function(){return j(new this.constructor(this),this.e+1,2)},x.comparedTo=x.cmp=function(t){var e,r,n,i,o=this,a=o.d,s=(t=new o.constructor(t)).d,u=o.s,c=t.s;if(!a||!s)return u&&c?u!==c?u:a===s?0:!a^u<0?1:-1:NaN;if(!a[0]||!s[0])return a[0]?u:s[0]?-c:0;if(u!==c)return u;if(o.e!==t.e)return o.e>t.e^u<0?1:-1;for(e=0,r=(n=a.length)<(i=s.length)?n:i;es[e]^u<0?1:-1;return n===i?0:n>i^u<0?1:-1},x.cosine=x.cos=function(){var t,e,r=this,n=r.constructor;return r.d?r.d[0]?(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(t,e){var r,n,i=e.d.length;i<32?(r=Math.ceil(i/3),n=(1/W(4,r)).toString()):(r=16,n=\"2.3283064365386962890625e-10\");t.precision+=r,e=J(t,1,e.times(n),new t(1));for(var o=r;o--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return t.precision-=r,e}(n,H(n,r)),n.precision=t,n.rounding=e,j(2==s||3==s?r.neg():r,t,e,!0)):new n(1):new n(NaN)},x.cubeRoot=x.cbrt=function(){var t,e,r,n,i,o,a,s,u,c,f=this,d=f.constructor;if(!f.isFinite()||f.isZero())return new d(f);for(l=!1,(o=f.s*g(f.s*f,1/3))&&Math.abs(o)!=1/0?n=new d(o.toString()):(r=O(f.d),(o=((t=f.e)-r.length+1)%3)&&(r+=1==o||-2==o?\"0\":\"00\"),o=g(r,1/3),t=b((t+1)/3)-(t%3==(t<0?-1:2)),(n=new d(r=o==1/0?\"5e\"+t:(r=o.toExponential()).slice(0,r.indexOf(\"e\")+1)+t)).s=f.s),a=(t=d.precision)+3;;)if(c=(u=(s=n).times(s).times(s)).plus(f),n=k(c.plus(f).times(s),c.plus(u),a+2,1),O(s.d).slice(0,a)===(r=O(n.d)).slice(0,a)){if(\"9999\"!=(r=r.slice(a-3,a+1))&&(i||\"4999\"!=r)){+r&&(+r.slice(1)||\"5\"!=r.charAt(0))||(j(n,t+1,1),e=!n.times(n).times(n).eq(f));break}if(!i&&(j(s,t+1,0),s.times(s).times(s).eq(f))){n=s;break}a+=4,i=1}return l=!0,j(n,t,d.rounding,e)},x.decimalPlaces=x.dp=function(){var t,e=this.d,r=NaN;if(e){if(r=7*((t=e.length-1)-b(this.e/7)),t=e[t])for(;t%10==0;t/=10)r--;r<0&&(r=0)}return r},x.dividedBy=x.div=function(t){return k(this,new this.constructor(t))},x.dividedToIntegerBy=x.divToInt=function(t){var e=this.constructor;return j(k(this,new e(t),0,1,1),e.precision,e.rounding)},x.equals=x.eq=function(t){return 0===this.cmp(t)},x.floor=function(){return j(new this.constructor(this),this.e+1,3)},x.greaterThan=x.gt=function(t){return this.cmp(t)>0},x.greaterThanOrEqualTo=x.gte=function(t){var e=this.cmp(t);return 1==e||0===e},x.hyperbolicCosine=x.cosh=function(){var t,e,r,n,i,o=this,a=o.constructor,s=new a(1);if(!o.isFinite())return new a(o.s?1/0:NaN);if(o.isZero())return s;r=a.precision,n=a.rounding,a.precision=r+Math.max(o.e,o.sd())+4,a.rounding=1,(i=o.d.length)<32?e=(1/W(4,t=Math.ceil(i/3))).toString():(t=16,e=\"2.3283064365386962890625e-10\"),o=J(a,1,o.times(e),new a(1),!0);for(var u,c=t,f=new a(8);c--;)u=o.times(o),o=s.minus(u.times(f.minus(u.times(f))));return j(o,a.precision=r,a.rounding=n,!0)},x.hyperbolicSine=x.sinh=function(){var t,e,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(e=o.precision,r=o.rounding,o.precision=e+Math.max(i.e,i.sd())+4,o.rounding=1,(n=i.d.length)<3)i=J(o,2,i,i,!0);else{t=(t=1.4*Math.sqrt(n))>16?16:0|t,i=J(o,2,i=i.times(1/W(5,t)),i,!0);for(var a,s=new o(5),u=new o(16),c=new o(20);t--;)a=i.times(i),i=i.times(s.plus(a.times(u.times(a).plus(c))))}return o.precision=e,o.rounding=r,j(i,e,r,!0)},x.hyperbolicTangent=x.tanh=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+7,n.rounding=1,k(r.sinh(),r.cosh(),n.precision=t,n.rounding=e)):new n(r.s)},x.inverseCosine=x.acos=function(){var t,e=this,r=e.constructor,n=e.abs().cmp(1),i=r.precision,o=r.rounding;return-1!==n?0===n?e.isNeg()?C(r,i,o):new r(0):new r(NaN):e.isZero()?C(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,e=e.asin(),t=C(r,i+4,o).times(.5),r.precision=i,r.rounding=o,t.minus(e))},x.inverseHyperbolicCosine=x.acosh=function(){var t,e,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(t=n.precision,e=n.rounding,n.precision=t+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,l=!1,r=r.times(r).minus(1).sqrt().plus(r),l=!0,n.precision=t,n.rounding=e,r.ln()):new n(r)},x.inverseHyperbolicSine=x.asinh=function(){var t,e,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,l=!1,r=r.times(r).plus(1).sqrt().plus(r),l=!0,n.precision=t,n.rounding=e,r.ln())},x.inverseHyperbolicTangent=x.atanh=function(){var t,e,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=o.precision,e=o.rounding,n=i.sd(),Math.max(n,t)<2*-i.e-1?j(new o(i),t,e,!0):(o.precision=r=n-i.e,i=k(i.plus(1),new o(1).minus(i),r+t,1),o.precision=t+4,o.rounding=1,i=i.ln(),o.precision=t,o.rounding=e,i.times(.5))):new o(NaN)},x.inverseSine=x.asin=function(){var t,e,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(e=i.abs().cmp(1),r=o.precision,n=o.rounding,-1!==e?0===e?((t=C(o,r+4,n).times(.5)).s=i.s,t):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))},x.inverseTangent=x.atan=function(){var t,e,r,n,i,o,a,s,u,c=this,f=c.constructor,d=f.precision,h=f.rounding;if(c.isFinite()){if(c.isZero())return new f(c);if(c.abs().eq(1)&&d+4<=M)return(a=C(f,d+4,h).times(.25)).s=c.s,a}else{if(!c.s)return new f(NaN);if(d+4<=M)return(a=C(f,d+4,h).times(.5)).s=c.s,a}for(f.precision=s=d+10,f.rounding=1,t=r=Math.min(28,s/7+2|0);t;--t)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(l=!1,e=Math.ceil(s/7),n=1,u=c.times(c),a=new f(c),i=c;-1!==t;)if(i=i.times(u),o=a.minus(i.div(n+=2)),i=i.times(u),void 0!==(a=o.plus(i.div(n+=2))).d[e])for(t=e;a.d[t]===o.d[t]&&t--;);return r&&(a=a.times(2<this.d.length-2},x.isNaN=function(){return!this.s},x.isNegative=x.isNeg=function(){return this.s<0},x.isPositive=x.isPos=function(){return this.s>0},x.isZero=function(){return!!this.d&&0===this.d[0]},x.lessThan=x.lt=function(t){return this.cmp(t)<0},x.lessThanOrEqualTo=x.lte=function(t){return this.cmp(t)<1},x.logarithm=x.log=function(t){var e,r,n,i,o,a,s,u,c=this.constructor,f=c.precision,d=c.rounding;if(null==t)t=new c(10),e=!0;else{if(r=(t=new c(t)).d,t.s<0||!r||!r[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(r=this.d,this.s<0||!r||!r[0]||this.eq(1))return new c(r&&!r[0]?-1/0:1!=this.s?NaN:r?0:1/0);if(e)if(r.length>1)o=!0;else{for(i=r[0];i%10==0;)i/=10;o=1!==i}if(l=!1,a=U(this,s=f+5),n=e?R(c,s+10):U(t,s),A((u=k(a,n,s,1)).d,i=f,d))do{if(a=U(this,s+=10),n=e?R(c,s+10):U(t,s),u=k(a,n,s,1),!o){+O(u.d).slice(i+1,i+15)+1==1e14&&(u=j(u,f+1,0));break}}while(A(u.d,i+=10,d));return l=!0,j(u,f,d)},x.minus=x.sub=function(t){var e,r,n,i,o,a,s,u,c,f,d,h,p=this,g=p.constructor;if(t=new g(t),!p.d||!t.d)return p.s&&t.s?p.d?t.s=-t.s:t=new g(t.d||p.s!==t.s?p:NaN):t=new g(NaN),t;if(p.s!=t.s)return t.s=-t.s,p.plus(t);if(c=p.d,h=t.d,s=g.precision,u=g.rounding,!c[0]||!h[0]){if(h[0])t.s=-t.s;else{if(!c[0])return new g(3===u?-0:0);t=new g(p)}return l?j(t,s,u):t}if(r=b(t.e/7),f=b(p.e/7),c=c.slice(),o=f-r){for((d=o<0)?(e=c,o=-o,a=h.length):(e=h,r=f,a=c.length),o>(n=Math.max(Math.ceil(s/7),a)+2)&&(o=n,e.length=1),e.reverse(),n=o;n--;)e.push(0);e.reverse()}else{for((d=(n=c.length)<(a=h.length))&&(a=n),n=0;n0;--n)c[a++]=0;for(n=h.length;n>o;){if(c[--n](a=(o=Math.ceil(s/7))>a?o+1:a+1)&&(i=a,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for((a=c.length)-(i=f.length)<0&&(i=a,r=f,f=c,c=r),e=0;i;)e=(c[--i]=c[i]+f[i]+e)/w|0,c[i]%=w;for(e&&(c.unshift(e),++n),a=c.length;0==c[--a];)c.pop();return t.d=c,t.e=I(c,n),l?j(t,s,u):t},x.precision=x.sd=function(t){var e,r=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(p+t);return r.d?(e=N(r.d),t&&r.e+1>e&&(e=r.e+1)):e=NaN,e},x.round=function(){var t=this,e=t.constructor;return j(new e(t),t.e+1,e.rounding)},x.sine=x.sin=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(t,e){var r,n=e.d.length;if(n<3)return J(t,2,e,e);r=(r=1.4*Math.sqrt(n))>16?16:0|r,e=e.times(1/W(5,r)),e=J(t,2,e,e);for(var i,o=new t(5),a=new t(16),s=new t(20);r--;)i=e.times(e),e=e.times(o.plus(i.times(a.times(i).minus(s))));return e}(n,H(n,r)),n.precision=t,n.rounding=e,j(s>2?r.neg():r,t,e,!0)):new n(NaN)},x.squareRoot=x.sqrt=function(){var t,e,r,n,i,o,a=this,s=a.d,u=a.e,c=a.s,f=a.constructor;if(1!==c||!s||!s[0])return new f(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);for(l=!1,0==(c=Math.sqrt(+a))||c==1/0?(((e=O(s)).length+u)%2==0&&(e+=\"0\"),c=Math.sqrt(e),u=b((u+1)/2)-(u<0||u%2),n=new f(e=c==1/0?\"1e\"+u:(e=c.toExponential()).slice(0,e.indexOf(\"e\")+1)+u)):n=new f(c.toString()),r=(u=f.precision)+3;;)if(n=(o=n).plus(k(a,o,r+2,1)).times(.5),O(o.d).slice(0,r)===(e=O(n.d)).slice(0,r)){if(\"9999\"!=(e=e.slice(r-3,r+1))&&(i||\"4999\"!=e)){+e&&(+e.slice(1)||\"5\"!=e.charAt(0))||(j(n,u+1,1),t=!n.times(n).eq(a));break}if(!i&&(j(o,u+1,0),o.times(o).eq(a))){n=o;break}r+=4,i=1}return l=!0,j(n,u,f.rounding,t)},x.tangent=x.tan=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+10,n.rounding=1,(r=r.sin()).s=1,r=k(r,new n(1).minus(r.times(r)).sqrt(),t+10,0),n.precision=t,n.rounding=e,j(2==s||4==s?r.neg():r,t,e,!0)):new n(NaN)},x.times=x.mul=function(t){var e,r,n,i,o,a,s,u,c,f=this,d=f.constructor,h=f.d,p=(t=new d(t)).d;if(t.s*=f.s,!(h&&h[0]&&p&&p[0]))return new d(!t.s||h&&!h[0]&&!p||p&&!p[0]&&!h?NaN:h&&p?0*t.s:t.s/0);for(r=b(f.e/7)+b(t.e/7),(u=h.length)<(c=p.length)&&(o=h,h=p,p=o,a=u,u=c,c=a),o=[],n=a=u+c;n--;)o.push(0);for(n=c;--n>=0;){for(e=0,i=u+n;i>n;)s=o[i]+p[n]*h[i-n-1]+e,o[i--]=s%w|0,e=s/w|0;o[i]=(o[i]+e)%w|0}for(;!o[--a];)o.pop();return e?++r:o.shift(),t.d=o,t.e=I(o,r),l?j(t,d.precision,d.rounding):t},x.toBinary=function(t,e){return Y(this,2,t,e)},x.toDecimalPlaces=x.toDP=function(t,e){var r=this,n=r.constructor;return r=new n(r),void 0===t?r:(P(t,0,1e9),void 0===e?e=n.rounding:P(e,0,8),j(r,t+r.e+1,e))},x.toExponential=function(t,e){var r,n=this,i=n.constructor;return void 0===t?r=D(n,!0):(P(t,0,1e9),void 0===e?e=i.rounding:P(e,0,8),r=D(n=j(new i(n),t+1,e),!0,t+1)),n.isNeg()&&!n.isZero()?\"-\"+r:r},x.toFixed=function(t,e){var r,n,i=this,o=i.constructor;return void 0===t?r=D(i):(P(t,0,1e9),void 0===e?e=o.rounding:P(e,0,8),r=D(n=j(new o(i),t+i.e+1,e),!1,t+n.e+1)),i.isNeg()&&!i.isZero()?\"-\"+r:r},x.toFraction=function(t){var e,r,n,i,o,a,s,u,c,f,d,h,b=this,y=b.d,v=b.constructor;if(!y)return new v(b);if(c=r=new v(1),n=u=new v(0),a=(o=(e=new v(n)).e=N(y)-b.e-1)%7,e.d[0]=g(10,a<0?7+a:a),null==t)t=o>0?e:c;else{if(!(s=new v(t)).isInt()||s.lt(c))throw Error(p+s);t=s.gt(e)?o>0?e:c:s}for(l=!1,s=new v(O(y)),f=v.precision,v.precision=o=7*y.length*2;d=k(s,e,0,1,1),1!=(i=r.plus(d.times(n))).cmp(t);)r=n,n=i,i=c,c=u.plus(d.times(i)),u=i,i=e,e=s.minus(d.times(i)),s=i;return i=k(t.minus(r),n,0,1,1),u=u.plus(i.times(c)),r=r.plus(i.times(n)),u.s=c.s=b.s,h=k(c,n,o,1).minus(b).abs().cmp(k(u,r,o,1).minus(b).abs())<1?[c,n]:[u,r],v.precision=f,l=!0,h},x.toHexadecimal=x.toHex=function(t,e){return Y(this,16,t,e)},x.toNearest=function(t,e){var r=this,n=r.constructor;if(r=new n(r),null==t){if(!r.d)return r;t=new n(1),e=n.rounding}else{if(t=new n(t),void 0===e?e=n.rounding:P(e,0,8),!r.d)return t.s?r:t;if(!t.d)return t.s&&(t.s=r.s),t}return t.d[0]?(l=!1,r=k(r,t,0,e,1).times(t),l=!0,j(r)):(t.s=r.s,r=t),r},x.toNumber=function(){return+this},x.toOctal=function(t,e){return Y(this,8,t,e)},x.toPower=x.pow=function(t){var e,r,n,i,o,a,s=this,u=s.constructor,c=+(t=new u(t));if(!(s.d&&t.d&&s.d[0]&&t.d[0]))return new u(g(+s,c));if((s=new u(s)).eq(1))return s;if(n=u.precision,o=u.rounding,t.eq(1))return j(s,n,o);if((e=b(t.e/7))>=t.d.length-1&&(r=c<0?-c:c)<=9007199254740991)return i=B(u,s,r,n),t.s<0?new u(1).div(i):j(i,n,o);if((a=s.s)<0){if(eu.maxE+1||e0?a/0:0):(l=!1,u.rounding=s.s=1,r=Math.min(12,(e+\"\").length),(i=q(t.times(U(s,n+r)),n)).d&&A((i=j(i,n+5,1)).d,n,o)&&(e=n+10,+O((i=j(q(t.times(U(s,e+r)),e),e+5,1)).d).slice(n+1,n+15)+1==1e14&&(i=j(i,n+1,0))),i.s=a,l=!0,u.rounding=o,j(i,n,o))},x.toPrecision=function(t,e){var r,n=this,i=n.constructor;return void 0===t?r=D(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(P(t,1,1e9),void 0===e?e=i.rounding:P(e,0,8),r=D(n=j(new i(n),t,e),t<=n.e||n.e<=i.toExpNeg,t)),n.isNeg()&&!n.isZero()?\"-\"+r:r},x.toSignificantDigits=x.toSD=function(t,e){var r=this.constructor;return void 0===t?(t=r.precision,e=r.rounding):(P(t,1,1e9),void 0===e?e=r.rounding:P(e,0,8)),j(new r(this),t,e)},x.toString=function(){var t=this,e=t.constructor,r=D(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?\"-\"+r:r},x.truncated=x.trunc=function(){return j(new this.constructor(this),this.e+1,1)},x.valueOf=x.toJSON=function(){var t=this,e=t.constructor,r=D(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?\"-\"+r:r};var k=function(){function t(t,e,r){var n,i=0,o=t.length;for(t=t.slice();o--;)n=t[o]*e+i,t[o]=n%r|0,i=n/r|0;return i&&t.unshift(i),t}function e(t,e,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;ie[i]?1:-1;break}return o}function r(t,e,r,n){for(var i=0;r--;)t[r]-=i,i=t[r]1;)t.shift()}return function(n,i,o,s,u,c){var f,d,h,l,p,g,y,v,m,_,S,M,x,O,P,A,E,k,D,I,R=n.constructor,C=n.s==i.s?1:-1,N=n.d,T=i.d;if(!(N&&N[0]&&T&&T[0]))return new R(n.s&&i.s&&(N?!T||N[0]!=T[0]:T)?N&&0==N[0]||!T?0*C:C/0:NaN);for(c?(p=1,d=n.e-i.e):(c=w,p=7,d=b(n.e/p)-b(i.e/p)),D=T.length,E=N.length,_=(m=new R(C)).d=[],h=0;T[h]==(N[h]||0);h++);if(T[h]>(N[h]||0)&&d--,null==o?(O=o=R.precision,s=R.rounding):O=u?o+(n.e-i.e)+1:o,O<0)_.push(1),g=!0;else{if(O=O/p+2|0,h=0,1==D){for(l=0,T=T[0],O++;(h1&&(T=t(T,l,c),N=t(N,l,c),D=T.length,E=N.length),A=D,M=(S=N.slice(0,D)).length;M=c/2&&++k;do{l=0,(f=e(T,S,D,M))<0?(x=S[0],D!=M&&(x=x*c+(S[1]||0)),(l=x/k|0)>1?(l>=c&&(l=c-1),1==(f=e(y=t(T,l,c),S,v=y.length,M=S.length))&&(l--,r(y,D=10;l/=10)h++;m.e=h+d*p-1,j(m,u?o+m.e+1:o,s,g)}return m}}();function j(t,e,r,n){var i,o,a,s,u,c,f,d,h,p=t.constructor;t:if(null!=e){if(!(d=t.d))return t;for(i=1,s=d[0];s>=10;s/=10)i++;if((o=e-i)<0)o+=7,a=e,u=(f=d[h=0])/g(10,i-a-1)%10|0;else if((h=Math.ceil((o+1)/7))>=(s=d.length)){if(!n)break t;for(;s++<=h;)d.push(0);f=u=0,i=1,a=(o%=7)-7+1}else{for(f=s=d[h],i=1;s>=10;s/=10)i++;u=(a=(o%=7)-7+i)<0?0:f/g(10,i-a-1)%10|0}if(n=n||e<0||void 0!==d[h+1]||(a<0?f:f%g(10,i-a-1)),c=r<4?(u||n)&&(0==r||r==(t.s<0?3:2)):u>5||5==u&&(4==r||n||6==r&&(o>0?a>0?f/g(10,i-a):0:d[h-1])%10&1||r==(t.s<0?8:7)),e<1||!d[0])return d.length=0,c?(e-=t.e+1,d[0]=g(10,(7-e%7)%7),t.e=-e||0):d[0]=t.e=0,t;if(0==o?(d.length=h,s=1,h--):(d.length=h+1,s=g(10,7-o),d[h]=a>0?(f/g(10,i-a)%g(10,a)|0)*s:0),c)for(;;){if(0==h){for(o=1,a=d[0];a>=10;a/=10)o++;for(a=d[0]+=s,s=1;a>=10;a/=10)s++;o!=s&&(t.e++,d[0]==w&&(d[0]=1));break}if(d[h]+=s,d[h]!=w)break;d[h--]=0,s=1}for(o=d.length;0===d[--o];)d.pop()}return l&&(t.e>p.maxE?(t.d=null,t.e=NaN):t.e0?o=o.charAt(0)+\".\"+o.slice(1)+T(n):a>1&&(o=o.charAt(0)+\".\"+o.slice(1)),o=o+(t.e<0?\"e\":\"e+\")+t.e):i<0?(o=\"0.\"+T(-i-1)+o,r&&(n=r-a)>0&&(o+=T(n))):i>=a?(o+=T(i+1-a),r&&(n=r-i-1)>0&&(o=o+\".\"+T(n))):((n=i+1)0&&(i+1===a&&(o+=\".\"),o+=T(n))),o}function I(t,e){var r=t[0];for(e*=7;r>=10;r/=10)e++;return e}function R(t,e,r){if(e>S)throw l=!0,r&&(t.precision=r),Error(\"[DecimalError] Precision limit exceeded\");return j(new t(f),e,1,!0)}function C(t,e,r){if(e>M)throw Error(\"[DecimalError] Precision limit exceeded\");return j(new t(d),e,r,!0)}function N(t){var e=t.length-1,r=7*e+1;if(e=t[e]){for(;e%10==0;e/=10)r--;for(e=t[0];e>=10;e/=10)r++}return r}function T(t){for(var e=\"\";t--;)e+=\"0\";return e}function B(t,e,r,n){var i,o=new t(1),a=Math.ceil(n/7+4);for(l=!1;;){if(r%2&&G((o=o.times(e)).d,a)&&(i=!0),0===(r=b(r/2))){r=o.d.length-1,i&&0===o.d[r]&&++o.d[r];break}G((e=e.times(e)).d,a)}return l=!0,o}function z(t){return 1&t.d[t.d.length-1]}function L(t,e,r){for(var n,i=new t(e[0]),o=0;++o17)return new h(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==e?(l=!1,u=b):u=e,s=new h(.03125);t.e>-2;)t=t.times(s),d+=5;for(u+=n=Math.log(g(2,d))/Math.LN10*2+5|0,r=o=a=new h(1),h.precision=u;;){if(o=j(o.times(t),u,1),r=r.times(++f),O((s=a.plus(k(o,r,u,1))).d).slice(0,u)===O(a.d).slice(0,u)){for(i=d;i--;)a=j(a.times(a),u,1);if(null!=e)return h.precision=b,a;if(!(c<3&&A(a.d,u-n,p,c)))return j(a,h.precision=b,p,l=!0);h.precision=u+=10,r=o=s=new h(1),f=0,c++}a=s}}function U(t,e){var r,n,i,o,a,s,u,c,f,d,h,p=1,b=t,g=b.d,y=b.constructor,v=y.rounding,m=y.precision;if(b.s<0||!g||!g[0]||!b.e&&1==g[0]&&1==g.length)return new y(g&&!g[0]?-1/0:1!=b.s?NaN:g?0:b);if(null==e?(l=!1,f=m):f=e,y.precision=f+=10,n=(r=O(g)).charAt(0),!(Math.abs(o=b.e)<15e14))return c=R(y,f+2,m).times(o+\"\"),b=U(new y(n+\".\"+r.slice(1)),f-10).plus(c),y.precision=m,null==e?j(b,m,v,l=!0):b;for(;n<7&&1!=n||1==n&&r.charAt(1)>3;)n=(r=O((b=b.times(t)).d)).charAt(0),p++;for(o=b.e,n>1?(b=new y(\"0.\"+r),o++):b=new y(n+\".\"+r.slice(1)),d=b,u=a=b=k(b.minus(1),b.plus(1),f,1),h=j(b.times(b),f,1),i=3;;){if(a=j(a.times(h),f,1),O((c=u.plus(k(a,new y(i),f,1))).d).slice(0,f)===O(u.d).slice(0,f)){if(u=u.times(2),0!==o&&(u=u.plus(R(y,f+2,m).times(o+\"\"))),u=k(u,new y(p),f,1),null!=e)return y.precision=m,u;if(!A(u.d,f-10,v,s))return j(u,y.precision=m,v,l=!0);y.precision=f+=10,c=a=b=k(d.minus(1),d.plus(1),f,1),h=j(b.times(b),f,1),i=s=1}u=c,i+=2}}function F(t){return String(t.s*t.s/0)}function K(t,e){var r,n,i;for((r=e.indexOf(\".\"))>-1&&(e=e.replace(\".\",\"\")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),n=0;48===e.charCodeAt(n);n++);for(i=e.length;48===e.charCodeAt(i-1);--i);if(e=e.slice(n,i)){if(i-=n,t.e=r=r-n-1,t.d=[],n=(r+1)%7,r<0&&(n+=7),nt.constructor.maxE?(t.d=null,t.e=NaN):t.e0?(c=+e.slice(a+1),e=e.substring(2,a)):e=e.slice(2),s=(a=e.indexOf(\".\"))>=0,n=t.constructor,s&&(a=(u=(e=e.replace(\".\",\"\")).length)-a,i=B(n,new n(r),a,2*a)),a=d=(f=E(e,r,w)).length-1;0===f[a];--a)f.pop();return a<0?new n(0*t.s):(t.e=I(f,d),t.d=f,l=!1,s&&(t=k(t,i,4*u)),c&&(t=t.times(Math.abs(c)<54?g(2,c):o.pow(2,c))),l=!0,t)}function J(t,e,r,n,i){var o,a,s,u,c=t.precision,f=Math.ceil(c/7);for(l=!1,u=r.times(r),s=new t(n);;){if(a=k(s.times(u),new t(e++*e++),c,1),s=i?n.plus(a):n.minus(a),n=k(a.times(u),new t(e++*e++),c,1),void 0!==(a=s.plus(n)).d[f]){for(o=f;a.d[o]===s.d[o]&&o--;);if(-1==o)break}o=s,s=n,n=a,a=o}return l=!0,a.d.length=f+1,a}function W(t,e){for(var r=t;--e;)r*=t;return r}function H(t,e){var r,n=e.s<0,i=C(t,t.precision,1),o=i.times(.5);if((e=e.abs()).lte(o))return s=n?4:1,e;if((r=e.divToInt(i)).isZero())s=n?3:2;else{if((e=e.minus(r.times(i))).lte(o))return s=z(r)?n?2:3:n?4:1,e;s=z(r)?n?1:4:n?3:2}return e.minus(i).abs()}function Y(t,e,r,n){var i,o,s,u,f,d,h,l,p,b=t.constructor,g=void 0!==r;if(g?(P(r,1,1e9),void 0===n?n=b.rounding:P(n,0,8)):(r=b.precision,n=b.rounding),t.isFinite()){for(g?(i=2,16==e?r=4*r-3:8==e&&(r=3*r-2)):i=e,(s=(h=D(t)).indexOf(\".\"))>=0&&(h=h.replace(\".\",\"\"),(p=new b(1)).e=h.length-s,p.d=E(D(p),10,i),p.e=p.d.length),o=f=(l=E(h,10,i)).length;0==l[--f];)l.pop();if(l[0]){if(s<0?o--:((t=new b(t)).d=l,t.e=o,l=(t=k(t,p,r,n,0,i)).d,o=t.e,d=a),s=l[r],u=i/2,d=d||void 0!==l[r+1],d=n<4?(void 0!==s||d)&&(0===n||n===(t.s<0?3:2)):s>u||s===u&&(4===n||d||6===n&&1&l[r-1]||n===(t.s<0?8:7)),l.length=r,d)for(;++l[--r]>i-1;)l[r]=0,r||(++o,l.unshift(1));for(f=l.length;!l[f-1];--f);for(s=0,h=\"\";s1)if(16==e||8==e){for(s=16==e?4:3,--f;f%s;f++)h+=\"0\";for(f=(l=E(h,i,e)).length;!l[f-1];--f);for(s=1,h=\"1.\";sf)for(o-=f;o--;)h+=\"0\";else oe)return t.length=e,!0}function Z(t){return new this(t).abs()}function X(t){return new this(t).acos()}function $(t){return new this(t).acosh()}function Q(t,e){return new this(t).plus(e)}function tt(t){return new this(t).asin()}function et(t){return new this(t).asinh()}function rt(t){return new this(t).atan()}function nt(t){return new this(t).atanh()}function it(t,e){t=new this(t),e=new this(e);var r,n=this.precision,i=this.rounding,o=n+4;return t.s&&e.s?t.d||e.d?!e.d||t.isZero()?(r=e.s<0?C(this,n,i):new this(0)).s=t.s:!t.d||e.isZero()?(r=C(this,o,1).times(.5)).s=t.s:e.s<0?(this.precision=o,this.rounding=1,r=this.atan(k(t,e,o,1)),e=C(this,o,1),this.precision=n,this.rounding=i,r=t.s<0?r.minus(e):r.plus(e)):r=this.atan(k(t,e,o,1)):(r=C(this,o,1).times(e.s>0?.25:.75)).s=t.s:r=new this(NaN),r}function ot(t){return new this(t).cbrt()}function at(t){return j(t=new this(t),t.e+1,2)}function st(t){if(!t||\"object\"!=typeof t)throw Error(\"[DecimalError] Object expected\");var e,r,n,i=!0===t.defaults,o=[\"precision\",1,1e9,\"rounding\",0,8,\"toExpNeg\",-u,0,\"toExpPos\",0,u,\"maxE\",0,u,\"minE\",-u,0,\"modulo\",0,9];for(e=0;e=o[e+1]&&n<=o[e+2]))throw Error(p+r+\": \"+n);this[r]=n}if(r=\"crypto\",i&&(this[r]=h[r]),void 0!==(n=t[r])){if(!0!==n&&!1!==n&&0!==n&&1!==n)throw Error(p+r+\": \"+n);if(n){if(\"undefined\"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(\"[DecimalError] crypto unavailable\");this[r]=!0}else this[r]=!1}return this}function ut(t){return new this(t).cos()}function ct(t){return new this(t).cosh()}function ft(t,e){return new this(t).div(e)}function dt(t){return new this(t).exp()}function ht(t){return j(t=new this(t),t.e+1,3)}function lt(){var t,e,r=new this(0);for(l=!1,t=0;t=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:s[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error(\"[DecimalError] crypto unavailable\");for(e=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(e,o):(s.push(i%1e7),o+=4);o=n/4}else for(;o=10;i/=10)n++;n<7&&(r-=7-n)}return a.e=r,a.d=s,a}function Ot(t){return j(t=new this(t),t.e+1,this.rounding)}function Pt(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function At(t){return new this(t).sin()}function Et(t){return new this(t).sinh()}function kt(t){return new this(t).sqrt()}function jt(t,e){return new this(t).sub(e)}function Dt(t){return new this(t).tan()}function It(t){return new this(t).tanh()}function Rt(t){return j(t=new this(t),t.e+1,1)}(o=function t(e){var r,n,i;function o(t){var e,r,n,i=this;if(!(i instanceof o))return new o(t);if(i.constructor=o,t instanceof o)return i.s=t.s,void(l?!t.d||t.e>o.maxE?(i.e=NaN,i.d=null):t.e=10;r/=10)e++;return void(l?e>o.maxE?(i.e=NaN,i.d=null):e0?a-4:a;for(r=0;r>16&255,u[f++]=e>>8&255,u[f++]=255&e;2===s&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[f++]=255&e);1===s&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e);return u},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+\"==\")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+\"=\"));return o.join(\"\")};for(var n=[],i=[],o=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,a=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",s=0,u=a.length;s0)throw new Error(\"Invalid string. Length must be a multiple of 4\");var r=t.indexOf(\"=\");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var i,o,a=[],s=e;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join(\"\")}i[\"-\".charCodeAt(0)]=62,i[\"_\".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,f=-7,d=r?i-1:0,h=r?-1:1,l=t[e+d];for(d+=h,o=l&(1<<-f)-1,l>>=-f,f+=s;f>0;o=256*o+t[e+d],d+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+t[e+d],d+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(l?-1:1);a+=Math.pow(2,n),o-=c}return(l?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,u,c=8*o-i-1,f=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,p=n?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+d>=1?h/u:h*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=f?(s=0,a=f):a+d>=1?(s=(e*u-1)*Math.pow(2,i),a+=d):(s=e*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;t[r+l]=255&s,l+=p,s/=256,i-=8);for(a=a<0;t[r+l]=255&a,l+=p,a/=256,c-=8);t[r+l-p]|=128*b}},function(t,e,r){\"use strict\";(function(t){var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,\"__esModule\",{value:!0}),e.MsgExecuteContract=void 0;var o=r(0),a=r(6),s=function(e){function r(t,r,n,i){void 0===i&&(i={});var o=e.call(this)||this;return o.sender=t,o.contract=r,o.execute_msg=n,o.coins=new a.Coins(i),o}return i(r,e),r.fromData=function(e){var n=e.value,i=n.sender,o=n.contract,s=n.execute_msg,u=n.coins;return new r(i,o,JSON.parse(t.from(s,\"base64\").toString()),a.Coins.fromData(u))},r.prototype.toData=function(){var e=this.sender,r=this.contract,n=this.execute_msg,i=this.coins;return{type:\"wasm/MsgExecuteContract\",value:{sender:e,contract:r,execute_msg:t.from(JSON.stringify(n)).toString(\"base64\"),coins:i.toData()}}},r}(o.JSONSerializable);e.MsgExecuteContract=s}).call(this,r(2).Buffer)},function(t,e,r){\"use strict\";(function(t){var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,\"__esModule\",{value:!0}),e.MsgMigrateContract=void 0;var o=function(e){function r(t,r,n,i){var o=e.call(this)||this;return o.owner=t,o.contract=r,o.new_code_id=n,o.migrate_msg=i,o}return i(r,e),r.fromData=function(e){var n=e.value,i=n.owner,o=n.contract,a=n.new_code_id,s=n.migrate_msg;return new r(i,o,Number.parseInt(a),JSON.parse(t.from(s,\"base64\").toString()))},r.prototype.toData=function(){var e=this.owner,r=this.contract,n=this.new_code_id,i=this.migrate_msg;return{type:\"wasm/MsgMigrateContract\",value:{owner:e,contract:r,new_code_id:n.toFixed(),migrate_msg:t.from(JSON.stringify(i)).toString(\"base64\")}}},r}(r(0).JSONSerializable);e.MsgMigrateContract=o}).call(this,r(2).Buffer)},function(t,e,r){\"use strict\";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,\"__esModule\",{value:!0}),e.MsgUpdateContractOwner=void 0;var o=function(t){function e(e,r,n){var i=t.call(this)||this;return i.owner=e,i.new_owner=r,i.contract=n,i}return i(e,t),e.fromData=function(t){var r=t.value;return new e(r.owner,r.new_owner,r.contract)},e.prototype.toData=function(){return{type:\"wasm/MsgUpdateContractOwner\",value:{owner:this.owner,new_owner:this.new_owner,contract:this.contract}}},e}(r(0).JSONSerializable);e.MsgUpdateContractOwner=o},function(t,e,r){\"use strict\";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,\"__esModule\",{value:!0}),e.StdSignMsg=void 0;var o=r(34),a=r(26),s=r(0),u=r(35),c=function(t){function e(e,r,n,i,o,a){void 0===a&&(a=\"\");var s=t.call(this)||this;return s.chain_id=e,s.account_number=r,s.sequence=n,s.fee=i,s.msgs=o,s.memo=a,s}return i(e,t),e.prototype.toData=function(){var t=this,e=t.chain_id,r=t.account_number,n=t.sequence,i=t.fee,o=t.msgs,a=t.memo;return{chain_id:e,account_number:r.toString(),sequence:n.toString(),fee:i.toData(),msgs:o.map((function(t){return t.toData()})),memo:a}},e.fromData=function(t){var r=t.chain_id,n=t.account_number,i=t.sequence,s=t.fee,u=t.msgs,c=t.memo;return new e(r,Number.parseInt(n),Number.parseInt(i),o.StdFee.fromData(s),u.map((function(t){return a.Msg.fromData(t)})),c)},e.prototype.toStdTx=function(){var t=this.fee,e=this.msgs,r=this.memo;return new u.StdTx(e,t,[],r)},e}(s.JSONSerializable);e.StdSignMsg=c},function(t,e,r){\"use strict\";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,\"__esModule\",{value:!0}),e.TxLog=e.EventsByType=e.TxInfo=void 0;var o,a=r(0),s=r(35),u=function(t){function e(e,r,n,i,o,a,s,u,c,f){var d=t.call(this)||this;return d.height=e,d.txhash=r,d.raw_log=n,d.logs=i,d.gas_wanted=o,d.gas_used=a,d.tx=s,d.timestamp=u,d.code=c,d.codespace=f,d}return i(e,t),e.fromData=function(t){return new e(Number.parseInt(t.height),t.txhash,t.raw_log,t.logs&&t.logs.map((function(t){return c.fromData(t)})),Number.parseInt(t.gas_wanted),Number.parseInt(t.gas_used),s.StdTx.fromData(t.tx),t.timestamp,t.code,t.codespace)},e.prototype.toData=function(){var t={height:this.height.toFixed(),txhash:this.txhash,raw_log:this.raw_log,gas_wanted:this.gas_wanted.toFixed(),gas_used:this.gas_used.toFixed(),tx:this.tx.toData(),timestamp:this.timestamp};return this.logs&&(t.logs=this.logs.map((function(t){return t.toData()}))),this.code&&(t.code=this.code),this.codespace&&(t.codespace=this.codespace),t},e}(a.JSONSerializable);e.TxInfo=u,function(t){t.parse=function(t){var e={};return t.forEach((function(t){t.attributes.forEach((function(r){t.type in e||(e[t.type]={}),r.key in e[t.type]||(e[t.type][r.key]=[]),e[t.type][r.key].push(r.value)}))})),e}}(o=e.EventsByType||(e.EventsByType={}));var c=function(t){function e(e,r,n){var i=t.call(this)||this;return i.msg_index=e,i.log=r,i.events=n,i.eventsByType=o.parse(i.events),i}return i(e,t),e.fromData=function(t){return new e(t.msg_index,t.log,t.events)},e.prototype.toData=function(){return{msg_index:this.msg_index,log:this.log,events:this.events}},e}(a.JSONSerializable);e.TxLog=c},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0})},function(t,e,r){\"use strict\";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,\"__esModule\",{value:!0}),e.Account=void 0;var o=r(6),a=r(28),s=function(t){function e(e,r,n,i,o){var a=t.call(this)||this;return a.address=e,a.coins=r,a.public_key=n,a.account_number=i,a.sequence=o,a}return i(e,t),e.prototype.toData=function(){var t=this,e=t.address,r=t.coins,n=t.public_key,i=t.account_number,o=t.sequence;return{type:\"core/Account\",value:{address:e,coins:r.toData(),public_key:n?n.toData():null,account_number:i.toFixed(),sequence:o.toFixed()}}},e.fromData=function(t){var r=t.value,n=r.address,i=r.coins,s=r.public_key,u=r.account_number,c=r.sequence;return new e(n,o.Coins.fromData(i),s?a.PublicKey.fromData(s):null,Number.parseInt(u),Number.parseInt(c))},e}(r(0).JSONSerializable);e.Account=s},function(t,e,r){\"use strict\";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,\"__esModule\",{value:!0}),e.LazyGradedVestingAccount=void 0;var o=r(6),a=r(0),s=r(5),u=r(28),c=function(t){function e(e,r,n,i,o,a,s,u,c,f){var d=t.call(this)||this;return d.address=e,d.coins=r,d.public_key=n,d.account_number=i,d.sequence=o,d.original_vesting=a,d.delegated_free=s,d.delegated_vesting=u,d.end_time=c,d.vesting_schedules=f,d}return i(e,t),e.prototype.toData=function(){var t=this,e=t.address,r=t.coins,n=t.public_key,i=t.account_number,o=t.sequence,a=t.original_vesting,s=t.delegated_free,u=t.delegated_vesting,c=t.end_time,f=t.vesting_schedules;return{type:\"core/LazyGradedVestingAccount\",value:{address:e,coins:r.toData(),public_key:n&&n.toData(),account_number:i.toFixed(),sequence:o.toFixed(),original_vesting:a.toData(),delegated_free:s.toData(),delegated_vesting:u.toData(),end_time:c.toFixed(),vesting_schedules:f.map((function(t){return t.toData()}))}}},e.fromData=function(t){var r=t.value,n=r.address,i=r.coins,a=r.public_key,s=r.account_number,c=r.sequence,f=r.original_vesting,d=r.delegated_free,h=r.delegated_vesting,l=r.end_time,p=r.vesting_schedules;return new e(n,o.Coins.fromData(i),a&&u.PublicKey.fromData(a),Number.parseInt(s),Number.parseInt(c),o.Coins.fromData(f),o.Coins.fromData(d),o.Coins.fromData(h),Number.parseInt(l),p.map((function(t){return e.VestingSchedule.fromData(t)})))},e}(a.JSONSerializable);e.LazyGradedVestingAccount=c,function(t){var e=function(t){function e(e,r){var n=t.call(this)||this;return n.denom=e,n.schedules=r,n}return i(e,t),e.prototype.toData=function(){return{denom:this.denom,schedules:this.schedules.map((function(t){return t.toData()}))}},e.fromData=function(t){return new e(t.denom,t.schedules.map((function(t){return e.Entry.fromData(t)})))},e}(a.JSONSerializable);t.VestingSchedule=e,function(t){var e=function(t){function e(e,r,n){var i=t.call(this)||this;return i.start_time=e,i.end_time=r,i.ratio=n,i}return i(e,t),e.fromData=function(t){var r=t.start_time,n=t.end_time,i=t.ratio;return new e(Number.parseInt(r),Number.parseInt(n),new s.Dec(i))},e.prototype.toData=function(){return{start_time:this.start_time.toFixed(),end_time:this.end_time.toFixed(),ratio:this.ratio.toString()}},e}(a.JSONSerializable);t.Entry=e}(e=t.VestingSchedule||(t.VestingSchedule={}))}(c=e.LazyGradedVestingAccount||(e.LazyGradedVestingAccount={})),e.LazyGradedVestingAccount=c},function(t,e,r){\"use strict\";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,\"__esModule\",{value:!0}),e.ExchangeRatePrevote=void 0;var o=function(t){function e(e,r,n,i){var o=t.call(this)||this;return o.hash=e,o.denom=r,o.voter=n,o.submit_block=i,o}return i(e,t),e.fromData=function(t){var r=t.hash,n=t.denom,i=t.voter,o=t.submit_block;return new e(r,n,i,Number.parseInt(o))},e.prototype.toData=function(){return{hash:this.hash,denom:this.denom,voter:this.voter,submit_block:this.submit_block.toFixed()}},e}(r(0).JSONSerializable);e.ExchangeRatePrevote=o},function(t,e,r){\"use strict\";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,\"__esModule\",{value:!0}),e.ExchangeRateVote=void 0;var o=r(0),a=r(5),s=function(t){function e(e,r,n){var i=t.call(this)||this;return i.exchange_rate=e,i.denom=r,i.voter=n,i}return i(e,t),e.fromData=function(t){var r=t.exchange_rate,n=t.denom,i=t.voter;return new e(new a.Dec(r),n,i)},e.prototype.toData=function(){var t=this.exchange_rate,e=this.denom,r=this.voter;return{exchange_rate:t.toString(),denom:e,voter:r}},e}(o.JSONSerializable);e.ExchangeRateVote=s},function(t,e,r){\"use strict\";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,\"__esModule\",{value:!0}),e.AggregateExchangeRatePrevote=void 0;var o=function(t){function e(e,r,n){var i=t.call(this)||this;return i.hash=e,i.voter=r,i.submit_block=n,i}return i(e,t),e.fromData=function(t){var r=t.hash,n=t.voter,i=t.submit_block;return new e(r,n,Number.parseInt(i))},e.prototype.toData=function(){return{hash:this.hash,voter:this.voter,submit_block:this.submit_block.toFixed()}},e}(r(0).JSONSerializable);e.AggregateExchangeRatePrevote=o},function(t,e,r){\"use strict\";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,\"__esModule\",{value:!0}),e.AggregateExchangeRateVote=void 0;var o=r(0),a=r(11),s=r(6),u=function(t){function e(e,r){var n=t.call(this)||this;return n.exchange_rate_tuples=e,n.voter=r,n}return i(e,t),e.fromData=function(t){var r=t.exchange_rate_tuples,n=t.voter;return new e(new s.Coins(r.map((function(t){return new a.Coin(t.denom,t.exchange_rate)}))).toDecCoins(),n)},e.prototype.toData=function(){var t=this.exchange_rate_tuples,e=this.voter;return{exchange_rate_tuples:t.map((function(t){return{denom:t.denom,exchange_rate:t.amount.toString()}})),voter:e}},e}(o.JSONSerializable);e.AggregateExchangeRateVote=u},function(t,e,r){\"use strict\";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,\"__esModule\",{value:!0}),e.UnbondingDelegation=void 0;var o=r(0),a=r(5),s=function(t){function e(e,r,n){var i=t.call(this)||this;return i.delegator_address=e,i.validator_address=r,i.entries=n,i}return i(e,t),e.fromData=function(t){return new e(t.delegator_address,t.validator_address,t.entries.map((function(t){return e.Entry.fromData(t)})))},e.prototype.toData=function(){return{delegator_address:this.delegator_address,validator_address:this.validator_address,entries:this.entries.map((function(t){return t.toData()}))}},e}(o.JSONSerializable);e.UnbondingDelegation=s,function(t){var e=function(t){function e(e,r,n,i){var o=t.call(this)||this;return o.initial_balance=e,o.balance=r,o.creation_height=n,o.completion_time=i,o}return i(e,t),e.prototype.toData=function(){return{initial_balance:this.initial_balance.toString(),balance:this.balance.toString(),creation_height:this.creation_height.toFixed(),completion_time:this.completion_time.toISOString()}},e.fromData=function(t){var r=t.initial_balance,n=t.balance,i=t.creation_height,o=t.completion_time;return new e(new a.Int(r),new a.Int(n),Number.parseInt(i),new Date(o))},e}(o.JSONSerializable);t.Entry=e}(s=e.UnbondingDelegation||(e.UnbondingDelegation={})),e.UnbondingDelegation=s},function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)\"default\"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,\"__esModule\",{value:!0}),e.ValConsPubKey=e.ValPubKey=e.AccPubKey=e.ValConsAddress=e.ValAddress=e.AccAddress=void 0;var a=o(r(70));function s(t,e,r){try{return a.decode(e).prefix===t&&e.length==r}catch(t){return!1}}!function(t){t.validate=function(t){return s(\"terra\",t,44)},t.fromValAddress=function(t){var e=a.decode(t);return a.encode(\"terra\",e.words)}}(e.AccAddress||(e.AccAddress={})),function(t){t.validate=function(t){return s(\"terravaloper\",t,51)},t.fromAccAddress=function(t){var e=a.decode(t);return a.encode(\"terravaloper\",e.words)}}(e.ValAddress||(e.ValAddress={})),function(t){t.validate=function(t){return s(\"terravalcons\",t,51)}}(e.ValConsAddress||(e.ValConsAddress={})),function(t){t.validate=function(t){return s(\"terrapub\",t,76)},t.fromValPubKey=function(t){var e=a.decode(t);return a.encode(\"terrapub\",e.words)}}(e.AccPubKey||(e.AccPubKey={})),function(t){t.validate=function(t){return s(\"terravaloperpub\",t,83)},t.fromAccPubKey=function(t){var e=a.decode(t);return a.encode(\"terravaloperpub\",e.words)}}(e.ValPubKey||(e.ValPubKey={})),function(t){t.validate=function(t){return s(\"terravalconspub\",t,83)}}(e.ValConsPubKey||(e.ValConsPubKey={}))},function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)\"default\"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(r(36),e),i(r(71),e),i(r(239),e)},function(t,e,r){var n;t.exports=(n=r(27),n.enc.Hex)},function(t,e,r){var n;t.exports=(n=r(27),\n/** @preserve\n\t(c) 2012 by Cédric Mesnil. All rights reserved.\n\n\tRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n\t - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\t - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\n\tTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\t*/\nfunction(t){var e=n,r=e.lib,i=r.WordArray,o=r.Hasher,a=e.algo,s=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),u=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),c=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),d=i.create([0,1518500249,1859775393,2400959708,2840853838]),h=i.create([1352829926,1548603684,1836072691,2053994217,0]),l=a.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var n=e+r,i=t[n];t[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,a,l,_,w,S,M,x,O,P,A,E=this._hash.words,k=d.words,j=h.words,D=s.words,I=u.words,R=c.words,C=f.words;for(S=o=E[0],M=a=E[1],x=l=E[2],O=_=E[3],P=w=E[4],r=0;r<80;r+=1)A=o+t[e+D[r]]|0,A+=r<16?p(a,l,_)+k[0]:r<32?b(a,l,_)+k[1]:r<48?g(a,l,_)+k[2]:r<64?y(a,l,_)+k[3]:v(a,l,_)+k[4],A=(A=m(A|=0,R[r]))+w|0,o=w,w=_,_=m(l,10),l=a,a=A,A=S+t[e+I[r]]|0,A+=r<16?v(M,x,O)+j[0]:r<32?y(M,x,O)+j[1]:r<48?g(M,x,O)+j[2]:r<64?b(M,x,O)+j[3]:p(M,x,O)+j[4],A=(A=m(A|=0,C[r]))+P|0,S=P,P=O,O=m(x,10),x=M,M=A;A=E[1]+l+O|0,E[1]=E[2]+_+P|0,E[2]=E[3]+w+S|0,E[3]=E[4]+o+M|0,E[4]=E[0]+a+x|0,E[0]=A},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process();for(var i=this._hash,o=i.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function p(t,e,r){return t^e^r}function b(t,e,r){return t&e|~t&r}function g(t,e,r){return(t|~e)^r}function y(t,e,r){return t&r|e&~r}function v(t,e,r){return t^(e|~r)}function m(t,e){return t<>>32-e}e.RIPEMD160=o._createHelper(l),e.HmacRIPEMD160=o._createHmacHelper(l)}(Math),n.RIPEMD160)},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=r(177);e.fromSeed=n.fromSeed,e.fromBase58=n.fromBase58,e.fromPublicKey=n.fromPublicKey,e.fromPrivateKey=n.fromPrivateKey},function(t,e,r){\"use strict\";(function(t){Object.defineProperty(e,\"__esModule\",{value:!0});const n=r(178),i=r(89),o=r(206),a=r(229),s=r(231),u=a.BufferN(32),c=a.compile({wif:a.UInt8,bip32:{public:a.UInt32,private:a.UInt32}}),f={messagePrefix:\"\u0018Bitcoin Signed Message:\\n\",bech32:\"bc\",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},d=Math.pow(2,31)-1;function h(t){return a.String(t)&&null!==t.match(/^(m\\/)?(\\d+'?\\/)*\\d+'?$/)}function l(t){return a.UInt32(t)&&t<=d}class p{constructor(t,e,r,n,i=0,o=0,s=0){this.__D=t,this.__Q=e,this.chainCode=r,this.network=n,this.__DEPTH=i,this.__INDEX=o,this.__PARENT_FINGERPRINT=s,a(c,n),this.lowR=!1}get depth(){return this.__DEPTH}get index(){return this.__INDEX}get parentFingerprint(){return this.__PARENT_FINGERPRINT}get publicKey(){return void 0===this.__Q&&(this.__Q=o.pointFromScalar(this.__D,!0)),this.__Q}get privateKey(){return this.__D}get identifier(){return n.hash160(this.publicKey)}get fingerprint(){return this.identifier.slice(0,4)}get compressed(){return!0}isNeutered(){return void 0===this.__D}neutered(){return y(this.publicKey,this.chainCode,this.network,this.depth,this.index,this.parentFingerprint)}toBase58(){const e=this.network,r=this.isNeutered()?e.bip32.public:e.bip32.private,n=t.allocUnsafe(78);return n.writeUInt32BE(r,0),n.writeUInt8(this.depth,4),n.writeUInt32BE(this.parentFingerprint,5),n.writeUInt32BE(this.index,9),this.chainCode.copy(n,13),this.isNeutered()?this.publicKey.copy(n,45):(n.writeUInt8(0,45),this.privateKey.copy(n,46)),i.encode(n)}toWIF(){if(!this.privateKey)throw new TypeError(\"Missing private key\");return s.encode(this.network.wif,this.privateKey,!0)}derive(e){a(a.UInt32,e);const r=e>=2147483648,i=t.allocUnsafe(37);if(r){if(this.isNeutered())throw new TypeError(\"Missing private key for hardened child key\");i[0]=0,this.privateKey.copy(i,1),i.writeUInt32BE(e,33)}else this.publicKey.copy(i,0),i.writeUInt32BE(e,33);const s=n.hmacSHA512(this.chainCode,i),u=s.slice(0,32),c=s.slice(32);if(!o.isPrivate(u))return this.derive(e+1);let f;if(this.isNeutered()){const t=o.pointAddScalar(this.publicKey,u,!0);if(null===t)return this.derive(e+1);f=y(t,c,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}else{const t=o.privateAdd(this.privateKey,u);if(null==t)return this.derive(e+1);f=g(t,c,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}return f}deriveHardened(t){return a(l,t),this.derive(t+2147483648)}derivePath(t){a(h,t);let e=t.split(\"/\");if(\"m\"===e[0]){if(this.parentFingerprint)throw new TypeError(\"Expected master, got child\");e=e.slice(1)}return e.reduce((t,e)=>{let r;return\"'\"===e.slice(-1)?(r=parseInt(e.slice(0,-1),10),t.deriveHardened(r)):(r=parseInt(e,10),t.derive(r))},this)}sign(e,r){if(!this.privateKey)throw new Error(\"Missing private key\");if(void 0===r&&(r=this.lowR),!1===r)return o.sign(e,this.privateKey);{let r=o.sign(e,this.privateKey);const n=t.alloc(32,0);let i=0;for(;r[0]>127;)i++,n.writeUIntLE(i,0,6),r=o.signWithEntropy(e,this.privateKey,n);return r}}verify(t,e){return o.verify(t,this.publicKey,e)}}function b(t,e,r){return g(t,e,r)}function g(t,e,r,n,i,s){if(a({privateKey:u,chainCode:u},{privateKey:t,chainCode:e}),r=r||f,!o.isPrivate(t))throw new TypeError(\"Private key not in range [1, n)\");return new p(t,void 0,e,r,n,i,s)}function y(t,e,r,n,i,s){if(a({publicKey:a.BufferN(33),chainCode:u},{publicKey:t,chainCode:e}),r=r||f,!o.isPoint(t))throw new TypeError(\"Point is not on the curve\");return new p(void 0,t,e,r,n,i,s)}e.fromBase58=function(t,e){const r=i.decode(t);if(78!==r.length)throw new TypeError(\"Invalid buffer length\");e=e||f;const n=r.readUInt32BE(0);if(n!==e.bip32.private&&n!==e.bip32.public)throw new TypeError(\"Invalid network version\");const o=r[4],a=r.readUInt32BE(5);if(0===o&&0!==a)throw new TypeError(\"Invalid parent fingerprint\");const s=r.readUInt32BE(9);if(0===o&&0!==s)throw new TypeError(\"Invalid index\");const u=r.slice(13,45);let c;if(n===e.bip32.private){if(0!==r.readUInt8(45))throw new TypeError(\"Invalid private key\");c=g(r.slice(46,78),u,e,o,s,a)}else{c=y(r.slice(45,78),u,e,o,s,a)}return c},e.fromPrivateKey=b,e.fromPublicKey=function(t,e,r){return y(t,e,r)},e.fromSeed=function(e,r){if(a(a.Buffer,e),e.length<16)throw new TypeError(\"Seed should be at least 128 bits\");if(e.length>64)throw new TypeError(\"Seed should be at most 512 bits\");r=r||f;const i=n.hmacSHA512(t.from(\"Bitcoin seed\",\"utf8\"),e);return b(i.slice(0,32),i.slice(32),r)}}).call(this,r(2).Buffer)},function(t,e,r){\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});const n=r(37),i=r(87);e.hash160=function(t){const e=n(\"sha256\").update(t).digest();try{return n(\"rmd160\").update(e).digest()}catch(t){return n(\"ripemd160\").update(e).digest()}},e.hmacSHA512=function(t,e){return i(\"sha512\",t).update(e).digest()}},function(t,e,r){(e=t.exports=r(74)).Stream=e,e.Readable=e,e.Writable=r(78),e.Duplex=r(20),e.Transform=r(80),e.PassThrough=r(185),e.finished=r(38),e.pipeline=r(186)},function(t,e){},function(t,e,r){\"use strict\";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:\"unshift\",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:\"shift\",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:\"clear\",value:function(){this.head=this.tail=null,this.length=0}},{key:\"join\",value:function(t){if(0===this.length)return\"\";for(var e=this.head,r=\"\"+e.data;e=e.next;)r+=t+e.data;return r}},{key:\"concat\",value:function(t){if(0===this.length)return a.alloc(0);for(var e,r,n,i=a.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=o.data,r=i,n=s,a.prototype.copy.call(e,r,n),s+=o.data.length,o=o.next;return i}},{key:\"consume\",value:function(t,e){var r;return ti.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:\"_getBuffer\",value:function(t){var e=a.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:u,value:function(t,e){return s(this,function(t){for(var e=1;e0,(function(t){n||(n=t),t&&a.forEach(c),o||(a.forEach(c),i(n))}))}));return e.reduce(f)}},function(t,e,r){var n=r(1),i=r(21),o=r(3).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(t){return t<<30|t>>>2}function f(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,d=0;d<16;++d)r[d]=t.readInt32BE(4*d);for(;d<80;++d)r[d]=r[d-3]^r[d-8]^r[d-14]^r[d-16];for(var h=0;h<80;++h){var l=~~(h/20),p=0|((e=n)<<5|e>>>27)+f(l,i,o,s)+u+r[h]+a[l];u=s,s=o,o=c(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},function(t,e,r){var n=r(1),i=r(21),o=r(3).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(t){return t<<5|t>>>27}function f(t){return t<<30|t>>>2}function d(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,h=0;h<16;++h)r[h]=t.readInt32BE(4*h);for(;h<80;++h)r[h]=(e=r[h-3]^r[h-8]^r[h-14]^r[h-16])<<1|e>>>31;for(var l=0;l<80;++l){var p=~~(l/20),b=c(n)+d(p,i,o,s)+u+r[l]+a[p]|0;u=s,s=o,o=f(i),i=n,n=b}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},function(t,e,r){var n=r(1),i=r(81),o=r(21),a=r(3).Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var t=a.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=u},function(t,e,r){var n=r(1),i=r(82),o=r(21),a=r(3).Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}n(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var t=a.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=u},function(t,e,r){t.exports=i;var n=r(22).EventEmitter;function i(){n.call(this)}r(1)(i,n),i.Readable=r(29),i.Writable=r(198),i.Duplex=r(199),i.Transform=r(200),i.PassThrough=r(201),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on(\"data\",i),t.on(\"drain\",o),t._isStdio||e&&!1===e.end||(r.on(\"end\",s),r.on(\"close\",u));var a=!1;function s(){a||(a=!0,t.end())}function u(){a||(a=!0,\"function\"==typeof t.destroy&&t.destroy())}function c(t){if(f(),0===n.listenerCount(this,\"error\"))throw t}function f(){r.removeListener(\"data\",i),t.removeListener(\"drain\",o),r.removeListener(\"end\",s),r.removeListener(\"close\",u),r.removeListener(\"error\",c),t.removeListener(\"error\",c),r.removeListener(\"end\",f),r.removeListener(\"close\",f),t.removeListener(\"close\",f)}return r.on(\"error\",c),t.on(\"error\",c),r.on(\"end\",f),r.on(\"close\",f),t.on(\"close\",f),t.emit(\"pipe\",r),t}},function(t,e){},function(t,e,r){\"use strict\";var n=r(42).Buffer,i=r(194);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return\"\";for(var e=this.head,r=\"\"+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var e,r,i,o=n.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,r=o,i=s,e.copy(r,i),s+=a.data.length,a=a.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+\" \"+t})},function(t,e){},function(t,e,r){(function(t){var n=void 0!==t&&t||\"undefined\"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(196),e.setImmediate=\"undefined\"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate=\"undefined\"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(12))},function(t,e,r){(function(t,e){!function(t,r){\"use strict\";if(!t.setImmediate){var n,i,o,a,s,u=1,c={},f=!1,d=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,\"[object process]\"==={}.toString.call(t.process)?n=function(t){e.nextTick((function(){p(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage(\"\",\"*\"),t.onmessage=r,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},n=function(t){o.port2.postMessage(t)}):d&&\"onreadystatechange\"in d.createElement(\"script\")?(i=d.documentElement,n=function(t){var e=d.createElement(\"script\");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):n=function(t){setTimeout(p,0,t)}:(a=\"setImmediate$\"+Math.random()+\"$\",s=function(e){e.source===t&&\"string\"==typeof e.data&&0===e.data.indexOf(a)&&p(+e.data.slice(a.length))},t.addEventListener?t.addEventListener(\"message\",s,!1):t.attachEvent(\"onmessage\",s),n=function(e){t.postMessage(a+e,\"*\")}),h.setImmediate=function(t){\"function\"!=typeof t&&(t=new Function(\"\"+t));for(var e=new Array(arguments.length-1),r=0;r64?e=t(e):e.length<64&&(e=i.concat([e,a],64));for(var r=this._ipad=i.allocUnsafe(64),n=this._opad=i.allocUnsafe(64),s=0;s<64;s++)r[s]=54^e[s],n[s]=92^e[s];this._hash=[r]}n(s,o),s.prototype._update=function(t){this._hash.push(t)},s.prototype._final=function(){var t=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,t]))},t.exports=s},function(t,e,r){\"use strict\";var n=r(204),i=r(3).Buffer;t.exports=function(t){function e(e){var r=e.slice(0,-4),n=e.slice(-4),i=t(r);if(!(n[0]^i[0]|n[1]^i[1]|n[2]^i[2]|n[3]^i[3]))return r}return{encode:function(e){var r=t(e);return n.encode(i.concat([e,r],e.length+4))},decode:function(t){var r=e(n.decode(t));if(!r)throw new Error(\"Invalid checksum\");return r},decodeUnsafe:function(t){var r=n.decodeUnsafe(t);if(r)return e(r)}}}},function(t,e,r){var n=r(205);t.exports=n(\"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\")},function(t,e,r){\"use strict\";var n=r(3).Buffer;t.exports=function(t){if(t.length>=255)throw new TypeError(\"Alphabet too long\");for(var e=new Uint8Array(256),r=0;r>>0,f=new Uint8Array(a);t[r];){var d=e[t.charCodeAt(r)];if(255===d)return;for(var h=0,l=a-1;(0!==d||h>>0,f[l]=d%256>>>0,d=d/256>>>0;if(0!==d)throw new Error(\"Non-zero carry\");o=h,r++}if(\" \"!==t[r]){for(var p=a-o;p!==a&&0===f[p];)p++;var b=n.allocUnsafe(i+(a-p));b.fill(0,0,i);for(var g=i;p!==a;)b[g++]=f[p++];return b}}}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError(\"Expected Buffer\");if(0===e.length)return\"\";for(var r=0,i=0,o=0,a=e.length;o!==a&&0===e[o];)o++,r++;for(var c=(a-o)*f+1>>>0,d=new Uint8Array(c);o!==a;){for(var h=e[o],l=0,p=c-1;(0!==h||l>>0,d[p]=h%s>>>0,h=h/s>>>0;if(0!==h)throw new Error(\"Non-zero carry\");i=l,o++}for(var b=c-i;b!==c&&0===d[b];)b++;for(var g=u.repeat(r);b=0)return!1;if((2===r||3===r)&&33===t.length){try{_(t)}catch(t){return!1}return!0}const i=t.slice(33);return 0!==i.compare(a)&&(!(i.compare(u)>=0)&&(4===r&&65===t.length))}function b(t){return 4!==t[0]}function g(t){return!!h(t)&&(t.compare(a)>0&&t.compare(s)<0)}function y(t,e){return void 0===t&&void 0!==e?b(e):void 0===t||t}function v(t){return new n(t)}function m(t){return t.toArrayLike(e,\"be\",32)}function _(t){return i.curve.decodePoint(t)}function w(t,r){return e.from(t._encode(r))}function S(t,r,n){if(!h(t))throw new TypeError(\"Expected Hash\");if(!g(r))throw new TypeError(\"Expected Private\");if(void 0!==n&&!h(n))throw new TypeError(\"Expected Extra Data (32 bytes)\");const i=v(r),a=v(t);let s,u;o(t,r,(function(t){const e=v(t),r=d.mul(e);return!r.isInfinity()&&(s=r.x.umod(c),0!==s.isZero()&&(u=e.invm(c).mul(a.add(i.mul(s))).umod(c),0!==u.isZero()))}),g,n),u.cmp(f)>0&&(u=c.sub(u));const l=e.allocUnsafe(64);return m(s).copy(l,0),m(u).copy(l,32),l}t.exports={isPoint:p,isPointCompressed:function(t){return!!p(t)&&b(t)},isPrivate:g,pointAdd:function(t,e,r){if(!p(t))throw new TypeError(\"Expected Point\");if(!p(e))throw new TypeError(\"Expected Point\");const n=_(t),i=_(e),o=n.add(i);return o.isInfinity()?null:w(o,y(r,t))},pointAddScalar:function(t,e,r){if(!p(t))throw new TypeError(\"Expected Point\");if(!l(e))throw new TypeError(\"Expected Tweak\");const n=y(r,t),i=_(t);if(0===e.compare(a))return w(i,n);const o=v(e),s=d.mul(o),u=i.add(s);return u.isInfinity()?null:w(u,n)},pointCompress:function(t,e){if(!p(t))throw new TypeError(\"Expected Point\");const r=_(t);if(r.isInfinity())throw new TypeError(\"Expected Point\");return w(r,y(e,t))},pointFromScalar:function(t,e){if(!g(t))throw new TypeError(\"Expected Private\");const r=v(t),n=d.mul(r);return n.isInfinity()?null:w(n,y(e))},pointMultiply:function(t,e,r){if(!p(t))throw new TypeError(\"Expected Point\");if(!l(e))throw new TypeError(\"Expected Tweak\");const n=y(r,t),i=_(t),o=v(e),a=i.mul(o);return a.isInfinity()?null:w(a,n)},privateAdd:function(t,e){if(!g(t))throw new TypeError(\"Expected Private\");if(!l(e))throw new TypeError(\"Expected Tweak\");const r=v(t),n=v(e),i=m(r.add(n).umod(c));return g(i)?i:null},privateSub:function(t,e){if(!g(t))throw new TypeError(\"Expected Private\");if(!l(e))throw new TypeError(\"Expected Tweak\");const r=v(t),n=v(e),i=m(r.sub(n).umod(c));return g(i)?i:null},sign:function(t,e){return S(t,e)},signWithEntropy:function(t,e,r){return S(t,e,r)},verify:function(t,r,n,i){if(!h(t))throw new TypeError(\"Expected Hash\");if(!p(r))throw new TypeError(\"Expected Point\");if(!function(t){const r=t.slice(0,32),n=t.slice(32,64);return e.isBuffer(t)&&64===t.length&&r.compare(s)<0&&n.compare(s)<0}(n))throw new TypeError(\"Expected Signature\");const o=_(r),a=v(n.slice(0,32)),u=v(n.slice(32,64));if(i&&u.cmp(f)>0)return!1;if(a.gtn(0)<=0)return!1;if(u.gtn(0)<=0)return!1;const l=v(t),b=u.invm(c),g=l.mul(b).umod(c),y=a.mul(b).umod(c),m=d.mulAdd(g,o,y);return!m.isInfinity()&&m.x.umod(c).eq(a)}}}).call(this,r(2).Buffer)},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){},function(t){t.exports=JSON.parse('{\"_args\":[[\"elliptic@6.5.3\",\"/Users/william/terra/terra.js\"]],\"_from\":\"elliptic@6.5.3\",\"_id\":\"elliptic@6.5.3\",\"_inBundle\":false,\"_integrity\":\"sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==\",\"_location\":\"/elliptic\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"version\",\"registry\":true,\"raw\":\"elliptic@6.5.3\",\"name\":\"elliptic\",\"escapedName\":\"elliptic\",\"rawSpec\":\"6.5.3\",\"saveSpec\":null,\"fetchSpec\":\"6.5.3\"},\"_requiredBy\":[\"/browserify-sign\",\"/create-ecdh\",\"/secp256k1\",\"/tiny-secp256k1\"],\"_resolved\":\"https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz\",\"_spec\":\"6.5.3\",\"_where\":\"/Users/william/terra/terra.js\",\"author\":{\"name\":\"Fedor Indutny\",\"email\":\"fedor@indutny.com\"},\"bugs\":{\"url\":\"https://github.com/indutny/elliptic/issues\"},\"dependencies\":{\"bn.js\":\"^4.4.0\",\"brorand\":\"^1.0.1\",\"hash.js\":\"^1.0.0\",\"hmac-drbg\":\"^1.0.0\",\"inherits\":\"^2.0.1\",\"minimalistic-assert\":\"^1.0.0\",\"minimalistic-crypto-utils\":\"^1.0.0\"},\"description\":\"EC cryptography\",\"devDependencies\":{\"brfs\":\"^1.4.3\",\"coveralls\":\"^3.0.8\",\"grunt\":\"^1.0.4\",\"grunt-browserify\":\"^5.0.0\",\"grunt-cli\":\"^1.2.0\",\"grunt-contrib-connect\":\"^1.0.0\",\"grunt-contrib-copy\":\"^1.0.0\",\"grunt-contrib-uglify\":\"^1.0.1\",\"grunt-mocha-istanbul\":\"^3.0.1\",\"grunt-saucelabs\":\"^9.0.1\",\"istanbul\":\"^0.4.2\",\"jscs\":\"^3.0.7\",\"jshint\":\"^2.10.3\",\"mocha\":\"^6.2.2\"},\"files\":[\"lib\"],\"homepage\":\"https://github.com/indutny/elliptic\",\"keywords\":[\"EC\",\"Elliptic\",\"curve\",\"Cryptography\"],\"license\":\"MIT\",\"main\":\"lib/elliptic.js\",\"name\":\"elliptic\",\"repository\":{\"type\":\"git\",\"url\":\"git+ssh://git@github.com/indutny/elliptic.git\"},\"scripts\":{\"jscs\":\"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js\",\"jshint\":\"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js\",\"lint\":\"npm run jscs && npm run jshint\",\"test\":\"npm run lint && npm run unit\",\"unit\":\"istanbul test _mocha --reporter=spec test/index.js\",\"version\":\"grunt dist && git add dist/\"},\"version\":\"6.5.3\"}')},function(t,e){},function(t,e,r){\"use strict\";var n=r(10),i=r(13),o=r(1),a=r(31),s=n.assert;function u(t){a.call(this,\"short\",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(t,e,r,n){a.BasePoint.call(this,t,\"affine\"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function f(t,e,r,n){a.BasePoint.call(this,t,\"jacobian\"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,a),t.exports=u,u.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new i(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new i(t.a,16),b:new i(t.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),o=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(t){for(var e,r,n,o,a,s,u,c,f,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=t,l=this.n.clone(),p=new i(1),b=new i(0),g=new i(0),y=new i(1),v=0;0!==h.cmpn(0);){var m=l.div(h);c=l.sub(m.mul(h)),f=g.sub(m.mul(p));var _=y.sub(m.mul(b));if(!n&&c.cmp(d)<0)e=u.neg(),r=p,n=c.neg(),o=f;else if(n&&2==++v)break;u=c,l=h,h=c,g=p,p=f,y=b,b=_}a=c.neg(),s=f;var w=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(w)>=0&&(a=e,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},u.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:t.sub(a).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error(\"invalid point\");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},u.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o\":\"\"},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},c.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},c.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(f,a.BasePoint),u.prototype.jpoint=function(t,e,r){return new f(this,t,e,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),f=c.redMul(s),d=n.redMul(c),h=u.redSqr().redIAdd(f).redISub(d).redISub(d),l=u.redMul(d.redISub(h)).redISub(o.redMul(f)),p=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(h,l,p)},f.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),f=r.redMul(u),d=s.redSqr().redIAdd(c).redISub(f).redISub(f),h=s.redMul(f.redISub(d)).redISub(i.redMul(c)),l=this.z.redMul(a);return this.curve.jpoint(d,h,l)},f.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},f.prototype.inspect=function(){return this.isInfinity()?\"\":\"\"},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(t,e,r){\"use strict\";var n=r(13),i=r(1),o=r(31),a=r(10);function s(t){o.call(this,\"mont\",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(t,e,r){o.BasePoint.call(this,t,\"projective\"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),t.exports=s,s.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),s.prototype.decodePoint=function(t,e){return this.point(a.toArray(t,e),1)},s.prototype.point=function(t,e){return new u(this,t,e)},s.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray(\"be\",this.curve.p.byteLength())},u.fromJSON=function(t,e){return new u(t,e[0],e[1]||t.one)},u.prototype.inspect=function(){return this.isInfinity()?\"\":\"\"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error(\"Not supported on Montgomery curve\")},u.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),a=i.redMul(n),s=e.z.redMul(o.redAdd(a).redSqr()),u=e.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error(\"Not supported on Montgomery curve\")},u.prototype.jumlAdd=function(){throw new Error(\"Not supported on Montgomery curve\")},u.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(t,e,r){\"use strict\";var n=r(10),i=r(13),o=r(1),a=r(31),s=n.assert;function u(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,a.call(this,\"edwards\",t),this.a=new i(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function c(t,e,r,n,o){a.BasePoint.call(this,t,\"projective\"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(e,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,a),t.exports=u,u.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},u.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},u.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error(\"invalid point\");var u=s.fromRed().isOdd();return(e&&!u||!e&&u)&&(s=s.redNeg()),this.point(t,s)},u.prototype.pointFromY=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(e)throw new Error(\"invalid point\");return this.point(this.zero,t)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error(\"invalid point\");return s.fromRed().isOdd()!==e&&(s=s.redNeg()),this.point(s,t)},u.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},o(c,a.BasePoint),u.prototype.pointFromJSON=function(t){return c.fromJSON(this,t)},u.prototype.point=function(t,e,r,n){return new c(this,t,e,r,n)},c.fromJSON=function(t,e){return new c(t,e[0],e[1],e[2])},c.prototype.inspect=function(){return this.isInfinity()?\"\":\"\"},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),a=o.redSub(r),s=n.redSub(e),u=i.redMul(a),c=o.redMul(s),f=i.redMul(s),d=a.redMul(o);return this.curve.point(u,c,d,f)},c.prototype._projDbl=function(){var t,e,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(c=this.curve._mulA(i)).redAdd(o);if(this.zOne)t=n.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),e=a.redMul(c.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);t=n.redSub(i).redISub(o).redMul(u),e=a.redMul(c.redSub(o)),r=a.redMul(u)}}else{var c=i.redAdd(o);s=this.curve._mulC(this.z).redSqr(),u=c.redSub(s).redSub(s);t=this.curve._mulC(n.redISub(c)).redMul(u),e=this.curve._mulC(c).redMul(i.redISub(o)),r=c.redMul(u)}return this.curve.point(t,e,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(e),c=o.redMul(a),f=s.redMul(u),d=o.redMul(u),h=a.redMul(s);return this.curve.point(c,f,h,d)},c.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),a=this.y.redMul(t.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),c=i.redAdd(s),f=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(a),d=n.redMul(u).redMul(f);return this.curve.twisted?(e=n.redMul(c).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(c)):(e=n.redMul(c).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(d,e,r)},c.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},c.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},c.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},c.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},c.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},function(t,e,r){\"use strict\";e.sha1=r(215),e.sha224=r(216),e.sha256=r(95),e.sha384=r(217),e.sha512=r(96)},function(t,e,r){\"use strict\";var n=r(14),i=r(25),o=r(94),a=n.rotl32,s=n.sum32,u=n.sum32_5,c=o.ft_1,f=i.BlockHash,d=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(h,f),t.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;nthis.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e0))return a.iaddn(1),this.keyFromPrivate(a)}},d.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},d.prototype.sign=function(t,e,r,o){\"object\"==typeof r&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var a=this.n.byteLength(),s=e.getPrivate().toArray(\"be\",a),u=t.toArray(\"be\",a),c=new i({hash:this.hash,entropy:s,nonce:u,pers:o.pers,persEnc:o.persEnc||\"utf8\"}),d=this.n.sub(new n(1)),h=0;;h++){var l=o.k?o.k(h):new n(c.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(d)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var b=p.getX(),g=b.umod(this.n);if(0!==g.cmpn(0)){var y=l.invm(this.n).mul(g.mul(e.getPrivate()).iadd(t));if(0!==(y=y.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==b.cmp(g)?2:0);return o.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),v^=1),new f({r:g,s:y,recoveryParam:v})}}}}}},d.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var o=(e=new f(e,\"hex\")).r,a=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),c=u.mul(t).umod(this.n),d=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),d)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),d)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},d.prototype.recoverPubKey=function(t,e,r,i){u((3&r)===r,\"The recovery param is more than two bits\"),e=new f(e,i);var o=this.n,a=new n(t),s=e.r,c=e.s,d=1&r,h=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error(\"Unable to find sencond key candinate\");s=h?this.curve.pointFromX(s.add(this.curve.n),d):this.curve.pointFromX(s,d);var l=e.r.invm(o),p=o.sub(a).mul(l).umod(o),b=c.mul(l).umod(o);return this.g.mulAdd(p,s,b)},d.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new f(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error(\"Unable to find valid recovery factor\")}},function(t,e,r){\"use strict\";var n=r(45),i=r(91),o=r(17);function a(t){if(!(this instanceof a))return new a(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||\"hex\"),r=i.toArray(t.nonce,t.nonceEnc||\"hex\"),n=i.toArray(t.pers,t.persEnc||\"hex\");o(e.length>=this.minEntropy/8,\"Not enough entropy. Minimum is: \"+this.minEntropy+\" bits\"),this._init(e,r,n)}t.exports=a,a.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,\"Not enough entropy. Minimum is: \"+this.minEntropy+\" bits\"),this._update(t.concat(r||[])),this._reseed=1},a.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error(\"Reseed is required\");\"string\"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||\"hex\"),this._update(r));for(var o=[];o.length\"}},function(t,e,r){\"use strict\";var n=r(13),i=r(10),o=i.assert;function a(t,e){if(t instanceof a)return t;this._importDER(t,e)||(o(t.r&&t.s,\"Signature without r or s\"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function s(){this.place=0}function u(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=e.place;o>>=0;return!(i<=127)&&(e.place=a,i)}function c(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=a,a.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new s;if(48!==t[r.place++])return!1;var o=u(t,r);if(!1===o)return!1;if(o+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var a=u(t,r);if(!1===a)return!1;var c=t.slice(r.place,a+r.place);if(r.place+=a,2!==t[r.place++])return!1;var f=u(t,r);if(!1===f)return!1;if(t.length!==f+r.place)return!1;var d=t.slice(r.place,f+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new n(c),this.s=new n(d),this.recoveryParam=null,!0},a.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=c(e),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,e.length),(n=n.concat(e)).push(2),f(n,r.length);var o=n.concat(r),a=[48];return f(a,o.length),a=a.concat(o),i.encode(a,t)}},function(t,e,r){\"use strict\";var n=r(45),i=r(44),o=r(10),a=o.assert,s=o.parseBytes,u=r(226),c=r(227);function f(t){if(a(\"ed25519\"===t,\"only tested with ed25519 so far\"),!(this instanceof f))return new f(t);t=i[t].curve;this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}t.exports=f,f.prototype.sign=function(t,e){t=s(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),u=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},f.prototype.verify=function(t,e,r){t=s(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},f.prototype.hashInt=function(){for(var t=this.hash(),e=0;ee.maxLength)&&((void 0===e.length||r.length===e.length)&&r.every((function(e,r){try{return h(t,e,n)}catch(t){throw u(t,r)}}))))))}return t=d(t),e=e||{},r.toJSON=function(){var r=\"[\"+o(t)+\"]\";return void 0!==e.length?r+=\"{\"+e.length+\"}\":void 0===e.minLength&&void 0===e.maxLength||(r+=\"{\"+(void 0===e.minLength?0:e.minLength)+\",\"+(void 0===e.maxLength?1/0:e.maxLength)+\"}\"),r},r},maybe:function t(e){function r(r,n){return i.Nil(r)||e(r,n,t)}return e=d(e),r.toJSON=function(){return\"?\"+o(e)},r},map:function(t,e){function r(r,n){if(!i.Object(r))return!1;if(i.Nil(r))return!1;for(var o in r){try{e&&h(e,o,n)}catch(t){throw u(t,o,\"key\")}try{var a=r[o];h(t,a,n)}catch(t){throw u(t,o)}}return!0}return t=d(t),e&&(e=d(e)),r.toJSON=e?function(){return\"{\"+o(e)+\": \"+o(t)+\"}\"}:function(){return\"{\"+o(t)+\"}\"},r},object:function(t){var e={};for(var r in t)e[r]=d(t[r]);function n(t,r){if(!i.Object(t))return!1;if(i.Nil(t))return!1;var n;try{for(n in e){h(e[n],t[n],r)}}catch(t){throw u(t,n)}if(r)for(n in t)if(!e[n])throw new s(void 0,n);return!0}return n.toJSON=function(){return o(e)},n},anyOf:function(){var t=[].slice.call(arguments).map(d);function e(e,r){return t.some((function(t){try{return h(t,e,r)}catch(t){return!1}}))}return e.toJSON=function(){return t.map(o).join(\"|\")},e},allOf:function(){var t=[].slice.call(arguments).map(d);function e(e,r){return t.every((function(t){try{return h(t,e,r)}catch(t){return!1}}))}return e.toJSON=function(){return t.map(o).join(\" & \")},e},quacksLike:function(t){function e(e){return t===c(e)}return e.toJSON=function(){return t},e},tuple:function(){var t=[].slice.call(arguments).map(d);function e(e,r){return!i.Nil(e)&&(!i.Nil(e.length)&&((!r||e.length===t.length)&&t.every((function(t,n){try{return h(t,e[n],r)}catch(t){throw u(t,n)}}))))}return e.toJSON=function(){return\"(\"+t.map(o).join(\", \")+\")\"},e},value:function(t){function e(e){return e===t}return e.toJSON=function(){return t},e}};function d(t){if(i.String(t))return\"?\"===t[0]?f.maybe(t.slice(1)):i[t]||f.quacksLike(t);if(t&&i.Object(t)){if(i.Array(t)){if(1!==t.length)throw new TypeError(\"Expected compile() parameter of type Array of length 1\");return f.arrayOf(t[0])}return f.object(t)}return i.Function(t)?t:f.value(t)}function h(t,e,r,n){if(i.Function(t)){if(t(e,r))return!0;throw new a(n||t,e)}return h(d(t),e,r)}for(var l in f.oneOf=f.anyOf,i)h[l]=i[l];for(l in f)h[l]=f[l];var p=r(230);for(l in p)h[l]=p[l];h.compile=d,h.TfTypeError=a,h.TfPropertyTypeError=s,t.exports=h},function(t,e,r){(function(e){var n=r(46),i=r(97);function o(t){return e.isBuffer(t)}function a(t){return\"string\"==typeof t&&/^([0-9a-f]{2})+$/i.test(t)}function s(t,e){var r=t.toJSON();function n(n){if(!t(n))return!1;if(n.length===e)return!0;throw i.tfCustomError(r+\"(Length: \"+e+\")\",r+\"(Length: \"+n.length+\")\")}return n.toJSON=function(){return r},n}var u=s.bind(null,n.Array),c=s.bind(null,o),f=s.bind(null,a),d=s.bind(null,n.String);var h=Math.pow(2,53)-1;var l={ArrayN:u,Buffer:o,BufferN:c,Finite:function(t){return\"number\"==typeof t&&isFinite(t)},Hex:a,HexN:f,Int8:function(t){return t<<24>>24===t},Int16:function(t){return t<<16>>16===t},Int32:function(t){return(0|t)===t},Int53:function(t){return\"number\"==typeof t&&t>=-h&&t<=h&&Math.floor(t)===t},Range:function(t,e,r){function i(n,i){return r(n,i)&&n>t&&n>>0===t},UInt53:function(t){return\"number\"==typeof t&&t>=0&&t<=h&&Math.floor(t)===t}};for(var p in l)l[p].toJSON=function(t){return t}.bind(null,p);t.exports=l}).call(this,r(2).Buffer)},function(t,e,r){(function(e){var n=r(89);function i(t,e){if(void 0!==e&&t[0]!==e)throw new Error(\"Invalid network version\");if(33===t.length)return{version:t[0],privateKey:t.slice(1,33),compressed:!1};if(34!==t.length)throw new Error(\"Invalid WIF length\");if(1!==t[33])throw new Error(\"Invalid compression flag\");return{version:t[0],privateKey:t.slice(1,33),compressed:!0}}function o(t,r,n){var i=new e(n?34:33);return i.writeUInt8(t,0),r.copy(i,1),n&&(i[33]=1),i}t.exports={decode:function(t,e){return i(n.decode(t),e)},decodeRaw:i,encode:function(t,e,r){return\"number\"==typeof t?n.encode(o(t,e,r)):n.encode(o(t.version,t.privateKey,t.compressed))},encodeRaw:o}}).call(this,r(2).Buffer)},function(t,e,r){\"use strict\";(function(t){Object.defineProperty(e,\"__esModule\",{value:!0});const n=r(37),i=r(233),o=r(235),a=r(102);let s=a._default;const u=\"A wordlist is required but a default could not be found.\\nPlease explicitly pass a 2048 word array explicitly.\";function c(t,e,r){for(;t.lengthc(t.toString(2),\"0\",8)).join(\"\")}function h(t){const e=8*t.length/32;return d([...n(\"sha256\").update(t).digest()]).slice(0,e)}function l(t){return\"mnemonic\"+(t||\"\")}function p(e,r){if(!(r=r||s))throw new Error(u);const n=(e||\"\").normalize(\"NFKD\").split(\" \");if(n.length%3!=0)throw new Error(\"Invalid mnemonic\");const i=n.map(t=>{const e=r.indexOf(t);if(-1===e)throw new Error(\"Invalid mnemonic\");return c(e.toString(2),\"0\",11)}).join(\"\"),o=32*Math.floor(i.length/33),a=i.slice(0,o),d=i.slice(o),l=a.match(/(.{1,8})/g).map(f);if(l.length<16)throw new Error(\"Invalid entropy\");if(l.length>32)throw new Error(\"Invalid entropy\");if(l.length%4!=0)throw new Error(\"Invalid entropy\");const p=t.from(l);if(h(p)!==d)throw new Error(\"Invalid mnemonic checksum\");return p.toString(\"hex\")}function b(e,r){if(t.isBuffer(e)||(e=t.from(e,\"hex\")),!(r=r||s))throw new Error(u);if(e.length<16)throw new TypeError(\"Invalid entropy\");if(e.length>32)throw new TypeError(\"Invalid entropy\");if(e.length%4!=0)throw new TypeError(\"Invalid entropy\");const n=(d([...e])+h(e)).match(/(.{1,11})/g).map(t=>{const e=f(t);return r[e]});return\"あいこくしん\"===r[0]?n.join(\" \"):n.join(\" \")}e.mnemonicToSeedSync=function(e,r){const n=t.from((e||\"\").normalize(\"NFKD\"),\"utf8\"),o=t.from(l((r||\"\").normalize(\"NFKD\")),\"utf8\");return i.pbkdf2Sync(n,o,2048,64,\"sha512\")},e.mnemonicToSeed=function(e,r){return new Promise((n,o)=>{try{const a=t.from((e||\"\").normalize(\"NFKD\"),\"utf8\"),s=t.from(l((r||\"\").normalize(\"NFKD\")),\"utf8\");i.pbkdf2(a,s,2048,64,\"sha512\",(t,e)=>t?o(t):n(e))}catch(t){return o(t)}})},e.mnemonicToEntropy=p,e.entropyToMnemonic=b,e.generateMnemonic=function(t,e,r){if((t=t||128)%32!=0)throw new TypeError(\"Invalid entropy\");return b((e=e||o)(t/8),r)},e.validateMnemonic=function(t,e){try{p(t,e)}catch(t){return!1}return!0},e.setDefaultWordlist=function(t){const e=a.wordlists[t];if(!e)throw new Error('Could not find wordlist for language \"'+t+'\"');s=e},e.getDefaultWordlist=function(){if(!s)throw new Error(\"No Default Wordlist set\");return Object.keys(a.wordlists).filter(t=>\"JA\"!==t&&\"EN\"!==t&&a.wordlists[t].every((t,e)=>t===s[e]))[0]};var g=r(102);e.wordlists=g.wordlists}).call(this,r(2).Buffer)},function(t,e,r){e.pbkdf2=r(234),e.pbkdf2Sync=r(100)},function(t,e,r){(function(e,n){var i,o=r(3).Buffer,a=r(98),s=r(99),u=r(100),c=r(101),f=e.crypto&&e.crypto.subtle,d={sha:\"SHA-1\",\"sha-1\":\"SHA-1\",sha1:\"SHA-1\",sha256:\"SHA-256\",\"sha-256\":\"SHA-256\",sha384:\"SHA-384\",\"sha-384\":\"SHA-384\",\"sha-512\":\"SHA-512\",sha512:\"SHA-512\"},h=[];function l(t,e,r,n,i){return f.importKey(\"raw\",t,{name:\"PBKDF2\"},!1,[\"deriveBits\"]).then((function(t){return f.deriveBits({name:\"PBKDF2\",salt:e,iterations:r,hash:{name:i}},t,n<<3)})).then((function(t){return o.from(t)}))}t.exports=function(t,r,p,b,g,y){\"function\"==typeof g&&(y=g,g=void 0);var v=d[(g=g||\"sha1\").toLowerCase()];if(!v||\"function\"!=typeof e.Promise)return n.nextTick((function(){var e;try{e=u(t,r,p,b,g)}catch(t){return y(t)}y(null,e)}));if(a(p,b),t=c(t,s,\"Password\"),r=c(r,s,\"Salt\"),\"function\"!=typeof y)throw new Error(\"No callback provided to pbkdf2\");!function(t,e){t.then((function(t){n.nextTick((function(){e(null,t)}))}),(function(t){n.nextTick((function(){e(t)}))}))}(function(t){if(e.process&&!e.process.browser)return Promise.resolve(!1);if(!f||!f.importKey||!f.deriveBits)return Promise.resolve(!1);if(void 0!==h[t])return h[t];var r=l(i=i||o.alloc(8),i,10,128,t).then((function(){return!0})).catch((function(){return!1}));return h[t]=r,r}(v).then((function(e){return e?l(t,r,p,b,v):u(t,r,p,b,g)})),y)}}).call(this,r(12),r(7))},function(t,e,r){\"use strict\";(function(e,n){var i=r(3).Buffer,o=e.crypto||e.msCrypto;o&&o.getRandomValues?t.exports=function(t,e){if(t>4294967295)throw new RangeError(\"requested too many random bytes\");var r=i.allocUnsafe(t);if(t>0)if(t>65536)for(var a=0;anew Uint8Array(t)),e){return\"function\"==typeof t&&(t=t(e)),b(\"output\",t,e),t}function v(t){return Object.prototype.toString.call(t).slice(8,-1)}t.exports=t=>({contextRandomize(e){switch(p(null===e||e instanceof Uint8Array,\"Expected seed to be an Uint8Array or null\"),null!==e&&b(\"seed\",e,32),t.contextRandomize(e)){case 1:throw new Error(o)}},privateKeyVerify:e=>(b(\"private key\",e,32),0===t.privateKeyVerify(e)),privateKeyNegate(e){switch(b(\"private key\",e,32),t.privateKeyNegate(e)){case 0:return e;case 1:throw new Error(r)}},privateKeyTweakAdd(e,r){switch(b(\"private key\",e,32),b(\"tweak\",r,32),t.privateKeyTweakAdd(e,r)){case 0:return e;case 1:throw new Error(n)}},privateKeyTweakMul(e,r){switch(b(\"private key\",e,32),b(\"tweak\",r,32),t.privateKeyTweakMul(e,r)){case 0:return e;case 1:throw new Error(i)}},publicKeyVerify:e=>(b(\"public key\",e,[33,65]),0===t.publicKeyVerify(e)),publicKeyCreate(e,r=!0,n){switch(b(\"private key\",e,32),g(r),n=y(n,r?33:65),t.publicKeyCreate(n,e)){case 0:return n;case 1:throw new Error(a);case 2:throw new Error(u)}},publicKeyConvert(e,r=!0,n){switch(b(\"public key\",e,[33,65]),g(r),n=y(n,r?33:65),t.publicKeyConvert(n,e)){case 0:return n;case 1:throw new Error(s);case 2:throw new Error(u)}},publicKeyNegate(e,n=!0,i){switch(b(\"public key\",e,[33,65]),g(n),i=y(i,n?33:65),t.publicKeyNegate(i,e)){case 0:return i;case 1:throw new Error(s);case 2:throw new Error(r);case 3:throw new Error(u)}},publicKeyCombine(e,r=!0,n){p(Array.isArray(e),\"Expected public keys to be an Array\"),p(e.length>0,\"Expected public keys array will have more than zero items\");for(const t of e)b(\"public key\",t,[33,65]);switch(g(r),n=y(n,r?33:65),t.publicKeyCombine(n,e)){case 0:return n;case 1:throw new Error(s);case 2:throw new Error(c);case 3:throw new Error(u)}},publicKeyTweakAdd(e,r,i=!0,o){switch(b(\"public key\",e,[33,65]),b(\"tweak\",r,32),g(i),o=y(o,i?33:65),t.publicKeyTweakAdd(o,e,r)){case 0:return o;case 1:throw new Error(s);case 2:throw new Error(n)}},publicKeyTweakMul(e,r,n=!0,o){switch(b(\"public key\",e,[33,65]),b(\"tweak\",r,32),g(n),o=y(o,n?33:65),t.publicKeyTweakMul(o,e,r)){case 0:return o;case 1:throw new Error(s);case 2:throw new Error(i)}},signatureNormalize(e){switch(b(\"signature\",e,64),t.signatureNormalize(e)){case 0:return e;case 1:throw new Error(f)}},signatureExport(e,n){b(\"signature\",e,64);const i={output:n=y(n,72),outputlen:72};switch(t.signatureExport(i,e)){case 0:return n.slice(0,i.outputlen);case 1:throw new Error(f);case 2:throw new Error(r)}},signatureImport(e,n){switch(b(\"signature\",e),n=y(n,64),t.signatureImport(n,e)){case 0:return n;case 1:throw new Error(f);case 2:throw new Error(r)}},ecdsaSign(e,n,i={},o){b(\"message\",e,32),b(\"private key\",n,32),p(\"Object\"===v(i),\"Expected options to be an Object\"),void 0!==i.data&&b(\"options.data\",i.data),void 0!==i.noncefn&&p(\"Function\"===v(i.noncefn),\"Expected options.noncefn to be a Function\");const a={signature:o=y(o,64),recid:null};switch(t.ecdsaSign(a,e,n,i.data,i.noncefn)){case 0:return a;case 1:throw new Error(d);case 2:throw new Error(r)}},ecdsaVerify(e,r,n){switch(b(\"signature\",e,64),b(\"message\",r,32),b(\"public key\",n,[33,65]),t.ecdsaVerify(e,r,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(f);case 2:throw new Error(s)}},ecdsaRecover(e,n,i,o=!0,a){switch(b(\"signature\",e,64),p(\"Number\"===v(n)&&n>=0&&n<=3,\"Expected recovery id to be a Number within interval [0, 3]\"),b(\"message\",i,32),g(o),a=y(a,o?33:65),t.ecdsaRecover(a,e,n,i)){case 0:return a;case 1:throw new Error(f);case 2:throw new Error(h);case 3:throw new Error(r)}},ecdh(e,r,n={},i){switch(b(\"public key\",e,[33,65]),b(\"private key\",r,32),p(\"Object\"===v(n),\"Expected options to be an Object\"),void 0!==n.data&&b(\"options.data\",n.data),void 0!==n.hashfn?(p(\"Function\"===v(n.hashfn),\"Expected options.hashfn to be a Function\"),void 0!==n.xbuf&&b(\"options.xbuf\",n.xbuf,32),void 0!==n.ybuf&&b(\"options.ybuf\",n.ybuf,32),b(\"output\",i)):i=y(i,32),t.ecdh(i,e,r,n.data,n.hashfn,n.xbuf,n.ybuf)){case 0:return i;case 1:throw new Error(s);case 2:throw new Error(l)}}})},function(t,e,r){const n=new(0,r(90).ec)(\"secp256k1\"),i=n.curve,o=i.n.constructor;function a(t){const e=t[0];switch(e){case 2:case 3:return 33!==t.length?null:function(t,e){let r=new o(e);if(r.cmp(i.p)>=0)return null;r=r.toRed(i.red);let a=r.redSqr().redIMul(r).redIAdd(i.b).redSqrt();return 3===t!==a.isOdd()&&(a=a.redNeg()),n.keyPair({pub:{x:r,y:a}})}(e,t.subarray(1,33));case 4:case 6:case 7:return 65!==t.length?null:function(t,e,r){let a=new o(e),s=new o(r);if(a.cmp(i.p)>=0||s.cmp(i.p)>=0)return null;if(a=a.toRed(i.red),s=s.toRed(i.red),(6===t||7===t)&&s.isOdd()!==(7===t))return null;const u=a.redSqr().redIMul(a);return s.redSqr().redISub(u.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:a,y:s}}):null}(e,t.subarray(1,33),t.subarray(33,65));default:return null}}function s(t,e){const r=e.encode(null,33===t.length);for(let e=0;e0,privateKeyVerify(t){const e=new o(t);return e.cmp(i.n)<0&&!e.isZero()?0:1},privateKeyNegate(t){const e=new o(t),r=i.n.sub(e).umod(i.n).toArrayLike(Uint8Array,\"be\",32);return t.set(r),0},privateKeyTweakAdd(t,e){const r=new o(e);if(r.cmp(i.n)>=0)return 1;if(r.iadd(new o(t)),r.cmp(i.n)>=0&&r.isub(i.n),r.isZero())return 1;const n=r.toArrayLike(Uint8Array,\"be\",32);return t.set(n),0},privateKeyTweakMul(t,e){let r=new o(e);if(r.cmp(i.n)>=0||r.isZero())return 1;r.imul(new o(t)),r.cmp(i.n)>=0&&(r=r.umod(i.n));const n=r.toArrayLike(Uint8Array,\"be\",32);return t.set(n),0},publicKeyVerify:t=>null===a(t)?1:0,publicKeyCreate(t,e){const r=new o(e);if(r.cmp(i.n)>=0||r.isZero())return 1;return s(t,n.keyFromPrivate(e).getPublic()),0},publicKeyConvert(t,e){const r=a(e);if(null===r)return 1;return s(t,r.getPublic()),0},publicKeyNegate(t,e){const r=a(e);if(null===r)return 1;const n=r.getPublic();return n.y=n.y.redNeg(),s(t,n),0},publicKeyCombine(t,e){const r=new Array(e.length);for(let t=0;t=0)return 2;const u=n.getPublic().add(i.g.mul(r));return u.isInfinity()?2:(s(t,u),0)},publicKeyTweakMul(t,e,r){const n=a(e);if(null===n)return 1;if((r=new o(r)).cmp(i.n)>=0||r.isZero())return 2;return s(t,n.getPublic().mul(r)),0},signatureNormalize(t){const e=new o(t.subarray(0,32)),r=new o(t.subarray(32,64));return e.cmp(i.n)>=0||r.cmp(i.n)>=0?1:(1===r.cmp(n.nh)&&t.set(i.n.sub(r).toArrayLike(Uint8Array,\"be\",32),32),0)},signatureExport(t,e){const r=e.subarray(0,32),n=e.subarray(32,64);if(new o(r).cmp(i.n)>=0)return 1;if(new o(n).cmp(i.n)>=0)return 1;const{output:a}=t;let s=a.subarray(4,37);s[0]=0,s.set(r,1);let u=33,c=0;for(;u>1&&0===s[c]&&!(128&s[c+1]);--u,++c);if(s=s.subarray(c),128&s[0])return 1;if(u>1&&0===s[0]&&!(128&s[1]))return 1;let f=a.subarray(39,72);f[0]=0,f.set(n,1);let d=33,h=0;for(;d>1&&0===f[h]&&!(128&f[h+1]);--d,++h);return f=f.subarray(h),128&f[0]||d>1&&0===f[0]&&!(128&f[1])?1:(t.outputlen=6+u+d,a[0]=48,a[1]=t.outputlen-2,a[2]=2,a[3]=s.length,a.set(s,4),a[4+u]=2,a[5+u]=f.length,a.set(f,6+u),0)},signatureImport(t,e){if(e.length<8)return 1;if(e.length>72)return 1;if(48!==e[0])return 1;if(e[1]!==e.length-2)return 1;if(2!==e[2])return 1;const r=e[3];if(0===r)return 1;if(5+r>=e.length)return 1;if(2!==e[4+r])return 1;const n=e[5+r];if(0===n)return 1;if(6+r+n!==e.length)return 1;if(128&e[4])return 1;if(r>1&&0===e[4]&&!(128&e[5]))return 1;if(128&e[r+6])return 1;if(n>1&&0===e[r+6]&&!(128&e[r+7]))return 1;let a=e.subarray(4,4+r);if(33===a.length&&0===a[0]&&(a=a.subarray(1)),a.length>32)return 1;let s=e.subarray(6+r);if(33===s.length&&0===s[0]&&(s=s.slice(1)),s.length>32)throw new Error(\"S length is too long\");let u=new o(a);u.cmp(i.n)>=0&&(u=new o(0));let c=new o(e.subarray(6+r));return c.cmp(i.n)>=0&&(c=new o(0)),t.set(u.toArrayLike(Uint8Array,\"be\",32),0),t.set(c.toArrayLike(Uint8Array,\"be\",32),32),0},ecdsaSign(t,e,r,a,s){if(s){const t=s;s=n=>{const i=t(e,r,null,a,n);if(!(i instanceof Uint8Array&&32===i.length))throw new Error(\"This is the way\");return new o(i)}}const u=new o(r);if(u.cmp(i.n)>=0||u.isZero())return 1;let c;try{c=n.sign(e,r,{canonical:!0,k:s,pers:a})}catch(t){return 1}return t.signature.set(c.r.toArrayLike(Uint8Array,\"be\",32),0),t.signature.set(c.s.toArrayLike(Uint8Array,\"be\",32),32),t.recid=c.recoveryParam,0},ecdsaVerify(t,e,r){const s={r:t.subarray(0,32),s:t.subarray(32,64)},u=new o(s.r),c=new o(s.s);if(u.cmp(i.n)>=0||c.cmp(i.n)>=0)return 1;if(1===c.cmp(n.nh)||u.isZero()||c.isZero())return 3;const f=a(r);if(null===f)return 2;const d=f.getPublic();return n.verify(e,s,d)?0:3},ecdsaRecover(t,e,r,a){const u={r:e.slice(0,32),s:e.slice(32,64)},c=new o(u.r),f=new o(u.s);if(c.cmp(i.n)>=0||f.cmp(i.n)>=0)return 1;if(c.isZero()||f.isZero())return 2;let d;try{d=n.recoverPubKey(a,u,r)}catch(t){return 2}return s(t,d),0},ecdh(t,e,r,s,u,c,f){const d=a(e);if(null===d)return 1;const h=new o(r);if(h.cmp(i.n)>=0||h.isZero())return 2;const l=d.getPublic().mul(h);if(void 0===u){const e=l.encode(null,!0),r=n.hash().update(e).digest();for(let e=0;e<32;++e)t[e]=r[e]}else{c||(c=new Uint8Array(32));const e=l.getX().toArray(\"be\",32);for(let t=0;t<32;++t)c[t]=e[t];f||(f=new Uint8Array(32));const r=l.getY().toArray(\"be\",32);for(let t=0;t<32;++t)f[t]=r[t];const n=u(c,f,s);if(!(n instanceof Uint8Array&&n.length===t.length))return 2;t.set(n)}return 0}}},function(t,e,r){\"use strict\";(function(t){var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)\"default\"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&o(e,t,r);return a(e,t),e},u=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},c=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},\"function\"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError(\"Generator is already executing.\");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0)return;a[e]=\"set-cookie\"===e?(a[e]?a[e]:[]).concat([r]):a[e]?a[e]+\", \"+r:r}})),a):a}},function(t,e,r){\"use strict\";var n=r(9);t.exports=n.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement(\"a\");function i(t){var n=t;return e&&(r.setAttribute(\"href\",n),n=r.href),r.setAttribute(\"href\",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,\"\"):\"\",host:r.host,search:r.search?r.search.replace(/^\\?/,\"\"):\"\",hash:r.hash?r.hash.replace(/^#/,\"\"):\"\",hostname:r.hostname,port:r.port,pathname:\"/\"===r.pathname.charAt(0)?r.pathname:\"/\"+r.pathname}}return t=i(window.location.href),function(e){var r=n.isString(e)?i(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0}},function(t,e,r){\"use strict\";var n=r(112);function i(t){if(\"function\"!=typeof t)throw new TypeError(\"executor must be a function.\");var e;this.promise=new Promise((function(t){e=t}));var r=this;t((function(t){r.reason||(r.reason=new n(t),e(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var t;return{token:new i((function(e){t=e})),cancel:t}},t.exports=i},function(t,e,r){\"use strict\";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,r){\"use strict\";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},\"function\"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError(\"Generator is already executing.\");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var u=n.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join(\"\")},parse:function(t){var e=t.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var o=0;o>>6-a%4*2;n[o>>>2]|=(s|u)<<24-o%4*8,o++}return i.create(n,o)}(t,e,n)},_map:\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\"},o.enc.Base64)},function(t,e,r){\"use strict\";(function(t){var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},\"function\"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError(\"Generator is already executing.\");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=o)return t;switch(t){case\"%s\":return String(n[r++]);case\"%d\":return Number(n[r++]);case\"%j\":try{return JSON.stringify(n[r++])}catch(t){return\"[Circular]\"}default:return t}})),u=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&e._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),f(n,t,n.depth)}function u(t,e){var r=s.styles[e];return r?\"\u001b[\"+s.colors[r][0]+\"m\"+t+\"\u001b[\"+s.colors[r][1]+\"m\":t}function c(t,e){return t}function f(t,r,n){if(t.customInspect&&r&&M(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return y(i)||(i=f(t,i,n)),i}var o=function(t,e){if(v(e))return t.stylize(\"undefined\",\"undefined\");if(y(e)){var r=\"'\"+JSON.stringify(e).replace(/^\"|\"$/g,\"\").replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"')+\"'\";return t.stylize(r,\"string\")}if(g(e))return t.stylize(\"\"+e,\"number\");if(p(e))return t.stylize(\"\"+e,\"boolean\");if(b(e))return t.stylize(\"null\",\"null\")}(t,r);if(o)return o;var a=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),S(r)&&(a.indexOf(\"message\")>=0||a.indexOf(\"description\")>=0))return d(r);if(0===a.length){if(M(r)){var u=r.name?\": \"+r.name:\"\";return t.stylize(\"[Function\"+u+\"]\",\"special\")}if(m(r))return t.stylize(RegExp.prototype.toString.call(r),\"regexp\");if(w(r))return t.stylize(Date.prototype.toString.call(r),\"date\");if(S(r))return d(r)}var c,_=\"\",x=!1,O=[\"{\",\"}\"];(l(r)&&(x=!0,O=[\"[\",\"]\"]),M(r))&&(_=\" [Function\"+(r.name?\": \"+r.name:\"\")+\"]\");return m(r)&&(_=\" \"+RegExp.prototype.toString.call(r)),w(r)&&(_=\" \"+Date.prototype.toUTCString.call(r)),S(r)&&(_=\" \"+d(r)),0!==a.length||x&&0!=r.length?n<0?m(r)?t.stylize(RegExp.prototype.toString.call(r),\"regexp\"):t.stylize(\"[Object]\",\"special\"):(t.seen.push(r),c=x?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a=0&&0,t+e.replace(/\\u001b\\[\\d\\d?m/g,\"\").length+1}),0)>60)return r[0]+(\"\"===e?\"\":e+\"\\n \")+\" \"+t.join(\",\\n \")+\" \"+r[1];return r[0]+e+\" \"+t.join(\", \")+\" \"+r[1]}(c,_,O)):O[0]+_+O[1]}function d(t){return\"[\"+Error.prototype.toString.call(t)+\"]\"}function h(t,e,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize(\"[Getter/Setter]\",\"special\"):t.stylize(\"[Getter]\",\"special\"):u.set&&(s=t.stylize(\"[Setter]\",\"special\")),E(n,i)||(a=\"[\"+i+\"]\"),s||(t.seen.indexOf(u.value)<0?(s=b(r)?f(t,u.value,null):f(t,u.value,r-1)).indexOf(\"\\n\")>-1&&(s=o?s.split(\"\\n\").map((function(t){return\" \"+t})).join(\"\\n\").substr(2):\"\\n\"+s.split(\"\\n\").map((function(t){return\" \"+t})).join(\"\\n\")):s=t.stylize(\"[Circular]\",\"special\")),v(a)){if(o&&i.match(/^\\d+$/))return s;(a=JSON.stringify(\"\"+i)).match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,\"name\")):(a=a.replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"').replace(/(^\"|\"$)/g,\"'\"),a=t.stylize(a,\"string\"))}return a+\": \"+s}function l(t){return Array.isArray(t)}function p(t){return\"boolean\"==typeof t}function b(t){return null===t}function g(t){return\"number\"==typeof t}function y(t){return\"string\"==typeof t}function v(t){return void 0===t}function m(t){return _(t)&&\"[object RegExp]\"===x(t)}function _(t){return\"object\"==typeof t&&null!==t}function w(t){return _(t)&&\"[object Date]\"===x(t)}function S(t){return _(t)&&(\"[object Error]\"===x(t)||t instanceof Error)}function M(t){return\"function\"==typeof t}function x(t){return Object.prototype.toString.call(t)}function O(t){return t<10?\"0\"+t.toString(10):t.toString(10)}e.debuglog=function(r){if(v(o)&&(o=t.env.NODE_DEBUG||\"\"),r=r.toUpperCase(),!a[r])if(new RegExp(\"\\\\b\"+r+\"\\\\b\",\"i\").test(o)){var n=t.pid;a[r]=function(){var t=e.format.apply(e,arguments);console.error(\"%s %d: %s\",r,n,t)}}else a[r]=function(){};return a[r]},e.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:\"cyan\",number:\"yellow\",boolean:\"yellow\",undefined:\"grey\",null:\"bold\",string:\"green\",date:\"magenta\",regexp:\"red\"},e.isArray=l,e.isBoolean=p,e.isNull=b,e.isNullOrUndefined=function(t){return null==t},e.isNumber=g,e.isString=y,e.isSymbol=function(t){return\"symbol\"==typeof t},e.isUndefined=v,e.isRegExp=m,e.isObject=_,e.isDate=w,e.isError=S,e.isFunction=M,e.isPrimitive=function(t){return null===t||\"boolean\"==typeof t||\"number\"==typeof t||\"string\"==typeof t||\"symbol\"==typeof t||void 0===t},e.isBuffer=r(279);var P=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"];function A(){var t=new Date,e=[O(t.getHours()),O(t.getMinutes()),O(t.getSeconds())].join(\":\");return[t.getDate(),P[t.getMonth()],e].join(\" \")}function E(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log(\"%s - %s\",A(),e.format.apply(e,arguments))},e.inherits=r(280),e._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var k=\"undefined\"!=typeof Symbol?Symbol(\"util.promisify.custom\"):void 0;function j(t,e){if(!t){var r=new Error(\"Promise was rejected with a falsy value\");r.reason=t,t=r}return e(t)}e.promisify=function(t){if(\"function\"!=typeof t)throw new TypeError('The \"original\" argument must be of type Function');if(k&&t[k]){var e;if(\"function\"!=typeof(e=t[k]))throw new TypeError('The \"util.promisify.custom\" argument must be of type Function');return Object.defineProperty(e,k,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o\n ) {\n this.contractAddress = options.contractAddress;\n this.codeID = options.codeID;\n this.lcd = options.lcd;\n\n this.key = options.key ? options.key : new EmptyKey();\n }\n\n public get wallet(): Wallet {\n if (this.lcd === undefined) {\n throw new Error('LCDClient not provided - unable to create wallet');\n }\n\n return this.lcd.wallet(this.key);\n }\n\n protected async query(queryMmsg: any): Promise {\n if (!this.contractAddress) {\n throw new Error('contractAddress not provided - unable to query');\n }\n\n return this.wallet.lcd.wasm.contractQuery(\n this.contractAddress,\n queryMmsg\n );\n }\n\n protected createExecuteMsg(\n executeMsg: any,\n coins: Coins.Input = {}\n ): MsgExecuteContract {\n if (!this.contractAddress) {\n throw new Error(\n 'contractAddress not provided - unable to execute message'\n );\n }\n\n return new MsgExecuteContract(\n this.key.accAddress,\n this.contractAddress,\n executeMsg,\n coins\n );\n }\n\n protected createInstantiateMsg(\n initMsg: any,\n initCoins: Coins.Input = {},\n migratable: boolean\n ): MsgInstantiateContract {\n if (!this.codeID) {\n throw new Error('codeID not provided - unable to instantiate contract');\n }\n\n return new MsgInstantiateContract(\n this.key.accAddress,\n this.codeID,\n initMsg,\n initCoins,\n migratable\n );\n }\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","import { Key } from '@terra-money/terra.js';\n\nexport class EmptyKey extends Key {\n constructor() {\n super(Buffer.from(''));\n }\n\n // eslint-disable-next-line class-methods-use-this\n public sign(): Promise {\n throw new Error(\n 'Key is empty - provide a Key when creating ContractClient to sign transactions.'\n );\n }\n}\n","/* eslint-disable camelcase */\nimport { AccAddress } from '@terra-money/terra.js';\n\nexport interface Token {\n token: {\n contract_addr: AccAddress;\n };\n}\n\nexport interface NativeToken {\n native_token: {\n denom: string;\n };\n}\n\nexport type AssetInfo = Token | NativeToken;\n\nexport function isNativeToken(assetInfo: AssetInfo): assetInfo is NativeToken {\n return 'native_token' in assetInfo;\n}\n\nexport interface Asset {\n info: AssetInfo;\n amount: string;\n}\n\nexport const UST: NativeToken = {\n native_token: {\n denom: 'uusd'\n }\n};\n","export * from './MirrorCollector';\nexport * from './MirrorFactory';\nexport * from './MirrorGov';\nexport * from './MirrorMint';\nexport * from './MirrorOracle';\nexport * from './MirrorStaking';\nexport * from './TerraswapFactory';\nexport * from './TerraswapPair';\nexport * from './TerraswapToken';\n","export * from './client';\nexport * from './utils';\nexport * from './contracts';\n","export * from './Mirror';\n","import { AccAddress, Key, LCDClient, Coin } from '@terra-money/terra.js';\nimport { EmptyKey } from '../utils/EmptyKey';\nimport {\n MirrorCollector,\n MirrorFactory,\n MirrorGov,\n MirrorMint,\n MirrorOracle,\n MirrorStaking,\n TerraswapFactory,\n TerraswapPair,\n TerraswapToken\n} from '../contracts/index';\n\nexport interface AssetOptions {\n symbol: string;\n name: string;\n token: AccAddress;\n pair: AccAddress;\n lpToken: AccAddress;\n}\n\nexport interface MirrorOptions {\n lcd: LCDClient;\n key: Key;\n collector: AccAddress;\n factory: AccAddress;\n gov: AccAddress;\n mint: AccAddress;\n oracle: AccAddress;\n staking: AccAddress;\n mirrorToken: AccAddress;\n terraswapFactory: AccAddress;\n assets: Array;\n}\n\nexport const DEFAULT_MIRROR_OPTIONS: MirrorOptions = {\n lcd: new LCDClient({\n URL: 'https://moonshine-lcd.terra.dev',\n chainID: 'localterra',\n gasPrices: [new Coin('ukrw', '1.8')],\n gasAdjustment: '1.2'\n }),\n key: new EmptyKey(),\n collector: 'terra1jmj39n0tfg6qu852fx0kr46gn4sewq6uyqyu8t',\n factory: 'terra1ndzjhjszw4pp8dkkt864drgmwhc59padjfccxg',\n gov: 'terra12pf2c9k7m2ag2893aa6sv75nmytr9uuxzv8vgx',\n mint: 'terra1ycsd7mlffq2ksmqdr20y4drtf6ctw3n8fmup5g',\n oracle: 'terra14nh9jzg6gx3qp2jnlg5lvkmky40uxu7w9mgevz',\n staking: 'terra1xxqqw7vysmh2wnq3y6hgh7d2ytmgazw62f28hh',\n mirrorToken: 'terra16y2ew6rmnehu9fn45jj55w4g37d62xgjz8zsx9',\n terraswapFactory: 'terra10w3rtrs8fmgwy6rsh2xwq6x27ym4kpz3698dr4',\n assets: [\n {\n symbol: 'MIR',\n name: 'Mirror',\n token: 'terra16y2ew6rmnehu9fn45jj55w4g37d62xgjz8zsx9',\n pair: 'terra1ck0ky4ad0ecmz7sksacejxf3rek8922n2302lh',\n lpToken: 'terra1xfm4k6qj3ryhpef4t4p9zgww6e3zuw6c0eqd05'\n },\n {\n symbol: 'mAAPL',\n name: 'Apple',\n token: 'terra17c3tsywm5h95j3z7hy62mvmyjct4euly4gj3kp',\n pair: 'terra1d6548cmpmugndjg650k0k66fhnvkeqxavv0z07',\n lpToken: 'terra1msdk05534hqupfed4v5q04f5y883ezqm0uukn7'\n },\n {\n symbol: 'mGOOGL',\n name: 'Google',\n token: 'terra1tz0c9uy0wwaaq4p57v8qzfx0g08l3zr3zcdtgl',\n pair: 'terra1t8m4cs4f32zqgsktu4pucwnlkz47dgql8crywn',\n lpToken: 'terra1wxh3lw9u3k7psmvqzraxpmscmpgp329kzg834m'\n },\n {\n symbol: 'mTSLA',\n name: 'Tesla',\n token: 'terra13fkuw7gh8r0mjswj8ckyt87m84azq43q3qldmj',\n pair: 'terra1uf29lrmpsmww4k3c9jcxdzet75c2pt353mx4tq',\n lpToken: 'terra1zccwcq7shh4yj8j2ynecd7pyyftxlhdd77fpu3'\n },\n {\n symbol: 'mNFLX',\n name: 'Netflix',\n token: 'terra1f9pk063a99g27l5nu83pd55x6rs649s3ax7pw3',\n pair: 'terra1t033f2r5phvuvysu50x2lj5ctshakcf45szn49',\n lpToken: 'terra1ch6d5kdenshk2zktap2s05arytpn8xhdffarvc'\n },\n {\n symbol: 'mQQQ',\n name: 'Invesco QQQ Trust',\n token: 'terra1hu7u866jla3vgckf4sd6vjdfxzuqvzvu0ekpc9',\n pair: 'terra19ujpfl5djdrp6w4w30vtx9cremz25gkg9nzcfa',\n lpToken: 'terra1cj8rcff3djz86rarg3uw3nzgdy2trgvj5egvdl'\n },\n {\n symbol: 'mTWTR',\n name: 'Twitter',\n token: 'terra1ua295n83qqm7kncn6g704d2a3hpmtjyx7f07u7',\n pair: 'terra14q8szcr0gy5pzksve5sp7e94kqqa0xlc3g2y9u',\n lpToken: 'terra1wunltsvvl2gfsnpwc4hf9pdxt6tnp7rt877ny8'\n },\n {\n symbol: 'mBABA',\n name: 'Alibaba Group Holdings Ltd ADR',\n token: 'terra1vekqnp3tgukt90lqfumu5467jw9jy4eewzn2fu',\n pair: 'terra1q5gyld4cjr59fdk2rjuuzs200ks28lp08fudnt',\n lpToken: 'terra1vrkjzhs26qlg6863s7rcnkqlmp3ftsxfdc6l5r'\n },\n {\n symbol: 'mIAU',\n name: 'iShares Gold Trust',\n token: 'terra1cyrhd8m2hhvvrn3mrn29d4h6unzyp6deay6g2y',\n pair: 'terra1ygeltj9hg4tsshhx2m4et4nmhn2sqpmu2cv8qk',\n lpToken: 'terra1whql3f3vukrtu3qs363vj5a67xccydjz9lpg6t'\n },\n {\n symbol: 'mSLV',\n name: 'iShares Silver Trust',\n token: 'terra17szfxhpttyp6w5p8llpqcr72yegxtaqy6uarye',\n pair: 'terra1vh4e69jq20tdzldc49wwuz22qe4pdr0zlwpvsg',\n lpToken: 'terra1d2ujj007l2tp5r6mgp78hr0ecrtq4q9afvmlwh'\n },\n {\n symbol: 'mUSO',\n name: 'United States Oil Fund, LP',\n token: 'terra19sf42kkwn85dj8hzffcytvw6jx4g8g3nxfnrdu',\n pair: 'terra1yde9tsacetgrdzdm56s5dng2uc53wpnyf9dyds',\n lpToken: 'terra1pkv2skq9pqzpfe483dn6q2dskadrhyrqg2f5ya'\n },\n {\n symbol: 'mVIXY',\n name: 'ProShares VIX',\n token: 'terra1kmt8vekwu4aq6l9y50n8hg9zcdzd3tqdp8lgdr',\n pair: 'terra195fcntnznx4f676gf383g02yguhync2fsuk03x',\n lpToken: 'terra1svhet09r7ulhyr4vs4fl6j6lnam94q6natumck'\n }\n ]\n};\n\nexport class Mirror {\n public collector: MirrorCollector;\n\n public factory: MirrorFactory;\n\n public gov: MirrorGov;\n\n public mint: MirrorMint;\n\n public oracle: MirrorOracle;\n\n public staking: MirrorStaking;\n\n public mirrorToken: TerraswapToken;\n\n public terraswapFactory: TerraswapFactory;\n\n public assets: Array<{\n name: string;\n symbol: string;\n token: TerraswapToken;\n lpToken: TerraswapToken;\n pair: TerraswapPair;\n }>;\n\n constructor(options: Partial = DEFAULT_MIRROR_OPTIONS) {\n const mirrorOptions = { ...DEFAULT_MIRROR_OPTIONS, ...options };\n const {\n lcd,\n key,\n collector,\n factory,\n gov,\n mint,\n oracle,\n staking,\n mirrorToken,\n terraswapFactory,\n assets\n } = mirrorOptions;\n\n this.collector = new MirrorCollector({\n contractAddress: collector,\n lcd,\n key\n });\n this.factory = new MirrorFactory({\n contractAddress: factory,\n lcd,\n key\n });\n this.gov = new MirrorGov({\n contractAddress: gov,\n lcd,\n key\n });\n this.mint = new MirrorMint({\n contractAddress: mint,\n lcd,\n key\n });\n this.oracle = new MirrorOracle({\n contractAddress: oracle,\n lcd,\n key\n });\n this.staking = new MirrorStaking({\n contractAddress: staking,\n lcd,\n key\n });\n this.mirrorToken = new TerraswapToken({\n contractAddress: mirrorToken,\n lcd,\n key\n });\n\n this.terraswapFactory = new TerraswapFactory({\n contractAddress: terraswapFactory,\n lcd,\n key\n });\n\n this.assets = [];\n\n assets.forEach((asset) => {\n this.assets.push({\n name: asset.name,\n symbol: asset.symbol,\n token: new TerraswapToken({\n contractAddress: asset.token,\n lcd,\n key\n }),\n lpToken: new TerraswapToken({\n contractAddress: asset.lpToken,\n lcd,\n key\n }),\n pair: new TerraswapPair({\n contractAddress: asset.pair,\n lcd,\n key\n })\n });\n });\n }\n}\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","import {\n AccAddress,\n Coins,\n MsgExecuteContract,\n MsgInstantiateContract\n} from '@terra-money/terra.js';\nimport { EmptyObject } from '../utils/EmptyObject';\nimport { ContractClient } from './ContractClient';\n\nexport namespace MirrorCollector {\n export interface InitMsg {\n distribution_contract: AccAddress;\n terraswap_factory: AccAddress;\n mirror_token: AccAddress;\n base_denom: string;\n }\n\n export interface HandleConvert {\n convert: {\n asset_token: AccAddress;\n };\n }\n\n export interface HandleSend {\n send: EmptyObject;\n }\n\n export interface QueryConfig {\n config: EmptyObject;\n }\n\n export interface ConfigResponse {\n distribution_contract: AccAddress;\n terraswap_factory: AccAddress;\n mirror_token: AccAddress;\n base_denom: string;\n }\n\n export type HandleMsg = HandleConvert | HandleSend;\n export type QueryMsg = QueryConfig;\n}\n\nexport class MirrorCollector extends ContractClient {\n public init(\n init_msg: MirrorCollector.InitMsg,\n migratable: boolean\n ): MsgInstantiateContract {\n return this.createInstantiateMsg(init_msg, {}, migratable);\n }\n\n public convert(asset_token: AccAddress): MsgExecuteContract {\n return this.createExecuteMsg({\n convert: {\n asset_token\n }\n });\n }\n\n public send(): MsgExecuteContract {\n return this.createExecuteMsg({\n send: {}\n });\n }\n\n public async getConfig(): Promise {\n return this.query({\n config: {}\n });\n }\n\n // Typed overloads\n\n protected async query(query_msg: MirrorCollector.QueryMsg): Promise {\n return super.query(query_msg);\n }\n\n protected createExecuteMsg(\n executeMsg: MirrorCollector.HandleMsg,\n coins: Coins.Input = {}\n ): MsgExecuteContract {\n return super.createExecuteMsg(executeMsg, coins);\n }\n}\n","import {\n AccAddress,\n Coins,\n Dec,\n Numeric,\n MsgExecuteContract,\n MsgInstantiateContract\n} from '@terra-money/terra.js';\nimport { EmptyObject } from '../utils/EmptyObject';\nimport { ContractClient } from './ContractClient';\n\nexport namespace MirrorFactory {\n export interface InitMsg {\n mint_per_block: string;\n token_code_id: number;\n base_denom: string;\n }\n\n export interface Params {\n weight: string;\n lp_commission: string;\n owner_commission: string;\n auction_discount: string;\n min_collateral_ratio: string;\n }\n\n export interface HandlePostInitialize {\n post_initialize: {\n owner: AccAddress;\n terraswap_factory: AccAddress;\n mirror_token: AccAddress;\n staking_contract: AccAddress;\n oracle_contract: AccAddress;\n mint_contract: AccAddress;\n commission_collector: AccAddress;\n };\n }\n\n export interface HandleUpdateConfig {\n update_config: {\n owner?: AccAddress;\n mint_per_block?: string;\n token_code_id?: number;\n };\n }\n\n export interface HandleUpdateWeight {\n update_weight: {\n asset_token: AccAddress;\n weight: string;\n };\n }\n\n export interface HandleTerraswapCreationHook {\n terraswap_creation_hook: {\n asset_token: AccAddress;\n };\n }\n\n export interface HandleWhitelist {\n whitelist: {\n name: string;\n symbol: string;\n oracle_feeder: AccAddress;\n params: Params;\n };\n }\n\n export interface HandlePassCommand {\n pass_command: {\n contract_addr: AccAddress;\n msg: string;\n };\n }\n\n export interface HandleMint {\n mint: {\n asset_token: AccAddress;\n };\n }\n\n export interface HandleMigrateAsset {\n migrate_asset: {\n name: string;\n symbol: string;\n from_token: AccAddress;\n end_price: string;\n };\n }\n\n export interface QueryConfig {\n config: EmptyObject;\n }\n\n export interface QueryDistributionInfo {\n distribution_info: { asset_token: AccAddress };\n }\n\n export interface ConfigResponse {\n owner: AccAddress;\n mirror_token: AccAddress;\n mint_contract: AccAddress;\n staking_contract: AccAddress;\n commission_collector: AccAddress;\n oracle_contract: AccAddress;\n terraswap_factory: AccAddress;\n mint_per_block: string;\n token_code_id: number;\n base_denom: string;\n }\n\n export interface DistributionInfoResponse {\n weight: string;\n last_height: number;\n }\n\n export type HandleMsg =\n | HandlePostInitialize\n | HandleUpdateWeight\n | HandleUpdateConfig\n | HandleTerraswapCreationHook\n | HandleWhitelist\n | HandlePassCommand\n | HandleMint\n | HandleMigrateAsset;\n\n export type QueryMsg = QueryConfig | QueryDistributionInfo;\n}\n\nexport class MirrorFactory extends ContractClient {\n public init(\n init_msg: MirrorFactory.InitMsg,\n migratable: boolean\n ): MsgInstantiateContract {\n return this.createInstantiateMsg(init_msg, {}, migratable);\n }\n\n public postInitialize(\n owner: AccAddress,\n terraswap_factory: AccAddress,\n mirror_token: AccAddress,\n staking_contract: AccAddress,\n oracle_contract: AccAddress,\n mint_contract: AccAddress,\n commission_collector: AccAddress\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n post_initialize: {\n owner,\n terraswap_factory,\n mirror_token,\n staking_contract,\n oracle_contract,\n mint_contract,\n commission_collector\n }\n });\n }\n\n public updateWeight(\n asset_token: AccAddress,\n weight: Dec\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n update_weight: {\n asset_token,\n weight: weight.toFixed()\n }\n });\n }\n\n public updateConfig(\n config: MirrorFactory.HandleUpdateConfig['update_config']\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n update_config: config\n });\n }\n\n public terraswapCreationHook(asset_token: AccAddress): MsgExecuteContract {\n return this.createExecuteMsg({\n terraswap_creation_hook: {\n asset_token\n }\n });\n }\n\n public whitelist(\n name: string,\n symbol: string,\n oracle_feeder: AccAddress,\n params: {\n weight: Numeric.Input;\n lp_commission: Numeric.Input;\n owner_commission: Numeric.Input;\n auction_discount: Numeric.Input;\n min_collateral_ratio: Numeric.Input;\n }\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n whitelist: {\n name,\n symbol,\n oracle_feeder,\n params: {\n weight: new Dec(params.weight).toFixed(),\n lp_commission: new Dec(params.lp_commission).toFixed(),\n owner_commission: new Dec(params.owner_commission).toFixed(),\n auction_discount: new Dec(params.auction_discount).toFixed(),\n min_collateral_ratio: new Dec(params.min_collateral_ratio).toFixed()\n }\n }\n });\n }\n\n public migrateAsset(\n name: string,\n symbol: string,\n from_token: AccAddress,\n end_price: Numeric.Input\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n migrate_asset: {\n name,\n symbol,\n from_token,\n end_price: new Dec(end_price).toString()\n }\n });\n }\n\n public passCommand(contract_addr: AccAddress, msg: any): MsgExecuteContract {\n return this.createExecuteMsg({\n pass_command: {\n contract_addr,\n msg: Buffer.from(JSON.stringify(msg)).toString('base64')\n }\n });\n }\n\n public mint(asset_token: AccAddress): MsgExecuteContract {\n return this.createExecuteMsg({\n mint: {\n asset_token\n }\n });\n }\n\n public async getConfig(): Promise {\n return this.query({\n config: {}\n });\n }\n\n public async getDistributionInfo(\n asset_token: AccAddress\n ): Promise {\n return this.query({\n distribution_info: { asset_token }\n });\n }\n\n // Typed overloads\n\n protected async query(query_msg: MirrorFactory.QueryMsg): Promise {\n return super.query(query_msg);\n }\n\n protected createExecuteMsg(\n executeMsg: MirrorFactory.HandleMsg,\n coins: Coins.Input = {}\n ): MsgExecuteContract {\n return super.createExecuteMsg(executeMsg, coins);\n }\n}\n","import {\n AccAddress,\n Coins,\n Numeric,\n MsgExecuteContract,\n MsgInstantiateContract,\n Int\n} from '@terra-money/terra.js';\nimport { EmptyObject } from '../utils/EmptyObject';\nimport { ContractClient } from './ContractClient';\nimport { TerraswapToken } from './TerraswapToken';\n\nexport namespace MirrorGov {\n export interface InitMsg {\n mirror_token: AccAddress;\n quorum: string;\n threshold: string;\n voting_period: number;\n effective_delay: number;\n proposal_deposit: string;\n }\n\n export interface HandleUpdateConfig {\n update_config: {\n owner?: AccAddress;\n quorum?: string;\n threshold?: string;\n voting_period?: number;\n effective_delay?: number;\n proposal_deposit?: string;\n };\n }\n\n export type VoteOption = 'yes' | 'no';\n export interface HandleCastVote {\n cast_vote: {\n poll_id: number;\n vote: VoteOption;\n amount: string;\n };\n }\n\n export interface HandleWithdrawVotingTokens {\n withdraw_voting_tokens: {\n amount?: string;\n };\n }\n\n export interface HandleEndPoll {\n end_poll: {\n poll_id: number;\n };\n }\n\n export interface HandleExecutePoll {\n execute_poll: {\n poll_id: number;\n };\n }\n\n export interface HookStakeVotingTokens {\n stake_voting_tokens: EmptyObject;\n }\n\n export interface ExecuteMsg {\n contract: AccAddress;\n msg: string;\n }\n\n export interface HookCreatePoll {\n create_poll: {\n title: string;\n description: string;\n link?: string;\n execute_msg?: ExecuteMsg;\n };\n }\n\n export interface QueryConfig {\n config: EmptyObject;\n }\n\n export interface QueryState {\n state: EmptyObject;\n }\n\n export interface QueryStaker {\n staker: {\n address: AccAddress;\n };\n }\n\n export interface QueryPoll {\n poll: {\n poll_id: number;\n };\n }\n\n export type PollStatus = 'in_progress' | 'passed' | 'rejected' | 'executed';\n\n export interface QueryPolls {\n polls: {\n filter?: PollStatus;\n start_after?: number;\n limit?: number;\n };\n }\n\n export interface QueryVoters {\n voters: {\n poll_id: number;\n start_after?: AccAddress;\n limit?: number;\n };\n }\n\n export interface ConfigResponse {\n owner: AccAddress;\n mirror_token: AccAddress;\n quorum: string;\n threshold: string;\n voting_period: number;\n effective_delay: number;\n proposal_deposit: string;\n }\n\n export interface StateResponse {\n poll_count: number;\n total_share: string;\n total_deposit: string;\n }\n\n export interface PollResponse {\n id: number;\n creator: AccAddress;\n status: PollStatus;\n end_height: number;\n title: string;\n description: string;\n link?: string;\n deposit_amount: string;\n execute_data?: ExecuteMsg;\n yes_votes: string;\n no_votes: string;\n }\n\n export interface PollsResponse {\n polls: Array;\n }\n\n export interface PollCountResponse {\n poll_count: number;\n }\n\n export interface VoterInfo {\n vote: VoteOption;\n share: string;\n }\n\n export interface StakerResponse {\n balance: string;\n share: string;\n locked_share: Array<[number, VoterInfo]>;\n }\n\n export interface VotersResponseItem {\n voter: AccAddress;\n vote: VoteOption;\n share: string;\n balance: string;\n }\n\n export interface VotersResponse {\n voters: Array;\n }\n\n export type HandleMsg =\n | HandleUpdateConfig\n | HandleCastVote\n | HandleWithdrawVotingTokens\n | HandleEndPoll\n | HandleExecutePoll;\n\n export type HookMsg = HookStakeVotingTokens | HookCreatePoll;\n\n export type QueryMsg =\n | QueryConfig\n | QueryState\n | QueryStaker\n | QueryPoll\n | QueryPolls\n | QueryVoters;\n}\n\nfunction createHookMsg(msg: MirrorGov.HookMsg): string {\n return Buffer.from(JSON.stringify(msg)).toString('base64');\n}\n\nexport class MirrorGov extends ContractClient {\n public init(\n init_msg: MirrorGov.InitMsg,\n migratable: boolean\n ): MsgInstantiateContract {\n return this.createInstantiateMsg(init_msg, {}, migratable);\n }\n\n public updateConfig(\n config: MirrorGov.HandleUpdateConfig['update_config']\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n update_config: config\n });\n }\n\n public castVote(\n poll_id: number,\n vote: MirrorGov.VoteOption,\n amount: Numeric.Input\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n cast_vote: {\n poll_id,\n vote,\n amount: new Int(amount).toString()\n }\n });\n }\n\n public withdrawVotingTokens(amount?: Numeric.Input): MsgExecuteContract {\n return this.createExecuteMsg({\n withdraw_voting_tokens: {\n amount: amount ? new Int(amount).toString() : undefined\n }\n });\n }\n\n public endPoll(poll_id: number): MsgExecuteContract {\n return this.createExecuteMsg({\n end_poll: {\n poll_id\n }\n });\n }\n\n public executePoll(poll_id: number): MsgExecuteContract {\n return this.createExecuteMsg({\n execute_poll: {\n poll_id\n }\n });\n }\n\n public stakeVotingTokens(\n terraswap_token: TerraswapToken,\n amount: Numeric.Input\n ): MsgExecuteContract {\n if (!this.contractAddress) {\n throw new Error(\n 'contractAddress not provided - unable to execute message'\n );\n }\n\n return terraswap_token.send(\n this.contractAddress,\n amount,\n createHookMsg({\n stake_voting_tokens: {}\n })\n );\n }\n\n public createPoll(\n terraswap_token: TerraswapToken,\n deposit_amount: Numeric.Input,\n title: string,\n description: string,\n link?: string,\n execute_msg?: MirrorGov.ExecuteMsg\n ): MsgExecuteContract {\n if (!this.contractAddress) {\n throw new Error(\n 'contractAddress not provided - unable to execute message'\n );\n }\n\n return terraswap_token.send(\n this.contractAddress,\n deposit_amount,\n createHookMsg({\n create_poll: {\n title,\n description,\n link,\n execute_msg\n }\n })\n );\n }\n\n public async getConfig(): Promise {\n return this.query({\n config: {}\n });\n }\n\n public async getState(): Promise {\n return this.query({\n state: {}\n });\n }\n\n public async getStaker(\n address: AccAddress\n ): Promise {\n return this.query({\n staker: {\n address\n }\n });\n }\n\n public async getPoll(poll_id: number): Promise {\n return this.query({\n poll: {\n poll_id\n }\n });\n }\n\n public async getPolls(\n filter?: MirrorGov.PollStatus,\n start_after?: number,\n limit?: number\n ): Promise {\n return this.query({\n polls: {\n filter,\n start_after,\n limit\n }\n });\n }\n\n public async getVoters(\n poll_id: number,\n start_after?: AccAddress,\n limit?: number\n ): Promise {\n return this.query({\n voters: {\n poll_id,\n start_after,\n limit\n }\n });\n }\n\n protected async query(query_msg: MirrorGov.QueryMsg): Promise {\n return super.query(query_msg);\n }\n\n protected createExecuteMsg(\n execute_msg: MirrorGov.HandleMsg,\n coins: Coins.Input = {}\n ): MsgExecuteContract {\n return super.createExecuteMsg(execute_msg, coins);\n }\n}\n","import {\n AccAddress,\n MsgExecuteContract,\n Coins,\n Numeric,\n Int,\n MsgInstantiateContract,\n Dec,\n Coin\n} from '@terra-money/terra.js';\nimport { EmptyObject } from '../utils/EmptyObject';\nimport { AssetInfo, Asset, isNativeToken } from '../utils/Asset';\nimport { ContractClient } from './ContractClient';\nimport { TerraswapToken } from './TerraswapToken';\n\nexport namespace MirrorMint {\n export interface InitMsg {\n owner: AccAddress;\n oracle: AccAddress;\n base_asset_info: AssetInfo;\n token_code_id: number;\n }\n\n export interface HandleUpdateConfig {\n update_config: {\n owner?: AccAddress;\n token_code_id?: number;\n };\n }\n\n export interface HandleUpdateAsset {\n udpate_asset: {\n asset_token: AccAddress;\n auction_discount?: string;\n min_collateral_ratio?: string;\n };\n }\n\n export interface HandleRegisterAsset {\n register_asset: {\n asset_token: AccAddress;\n auction_discount: string;\n min_collateral_ratio: string;\n };\n }\n\n export interface HandleRegisterMigration {\n register_migration: {\n asset_token: AccAddress;\n end_price: string;\n };\n }\n\n export interface HandleOpenPosition {\n open_position: {\n collateral: Asset;\n asset_info: AssetInfo;\n collateral_ratio: string;\n };\n }\n\n export interface HandleDeposit {\n deposit: {\n position_idx: string;\n collateral: Asset;\n };\n }\n\n export interface HandleWithdraw {\n withdraw: {\n position_idx: string;\n collateral: Asset;\n };\n }\n\n export interface HandleMint {\n mint: {\n position_idx: string;\n asset: Asset;\n };\n }\n\n export interface HookOpenPosition {\n open_position: {\n asset_info: AssetInfo;\n collateral_ratio: string;\n };\n }\n\n export interface HookDeposit {\n deposit: {\n position_idx: string;\n };\n }\n\n export interface HookBurn {\n burn: {\n position_idx: string;\n };\n }\n\n export interface HookAuction {\n auction: {\n position_idx: string;\n };\n }\n\n export interface QueryConfig {\n config: EmptyObject;\n }\n\n export interface QueryAssetConfig {\n asset_config: {\n asset_token: AccAddress;\n };\n }\n\n export interface QueryPosition {\n position: {\n position_idx: string;\n };\n }\n\n export interface QueryPositions {\n positions: {\n owner_addr: AccAddress;\n start_after?: string;\n limit?: number;\n };\n }\n\n export interface ConfigResponse {\n owner: AccAddress;\n oracle: AccAddress;\n base_asset_info: AssetInfo;\n token_code_id: number;\n }\n\n export interface AssetConfigResponse {\n token: AccAddress;\n auction_discount: string;\n min_collateral_ratio: string;\n end_price?: string;\n }\n\n export interface PositionResponse {\n idx: string;\n owner: AccAddress;\n collateral: Asset;\n asset: Asset;\n }\n\n export interface PositionsResponse {\n positions: Array;\n }\n\n export type HandleMsg =\n | HandleUpdateConfig\n | HandleUpdateAsset\n | HandleRegisterAsset\n | HandleRegisterMigration\n | HandleOpenPosition\n | HandleDeposit\n | HandleWithdraw\n | HandleMint;\n\n export type HookMsg = HookAuction | HookBurn | HookDeposit | HookOpenPosition;\n\n export type QueryMsg =\n | QueryConfig\n | QueryAssetConfig\n | QueryPosition\n | QueryPositions;\n}\n\nfunction createHookMsg(msg: MirrorMint.HookMsg): string {\n return Buffer.from(JSON.stringify(msg)).toString('base64');\n}\n\nexport class MirrorMint extends ContractClient {\n public init(\n init_msg: MirrorMint.InitMsg,\n migratable: boolean\n ): MsgInstantiateContract {\n return this.createInstantiateMsg(init_msg, {}, migratable);\n }\n\n public updateConfig(\n config: MirrorMint.HandleUpdateConfig['update_config']\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n update_config: config\n });\n }\n\n public updateAsset(\n asset_token: AccAddress,\n auction_discount?: Numeric.Input,\n min_collateral_ratio?: Numeric.Input\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n udpate_asset: {\n asset_token,\n auction_discount: auction_discount\n ? new Dec(auction_discount).toFixed()\n : undefined,\n min_collateral_ratio: min_collateral_ratio\n ? new Dec(min_collateral_ratio).toFixed()\n : undefined\n }\n });\n }\n\n public registerAsset(\n asset_token: AccAddress,\n auction_discount: Numeric.Input,\n min_collateral_ratio: Numeric.Input\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n register_asset: {\n asset_token,\n auction_discount: new Dec(auction_discount).toFixed(),\n min_collateral_ratio: new Dec(min_collateral_ratio).toFixed()\n }\n });\n }\n\n public registerMigration(\n asset_token: AccAddress,\n end_price: Numeric.Input\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n register_migration: {\n asset_token,\n end_price: new Dec(end_price).toFixed()\n }\n });\n }\n\n public openPosition(\n collateral: Asset,\n asset_info: AssetInfo,\n collateral_ratio: Numeric.Input,\n collateral_token?: TerraswapToken\n ): MsgExecuteContract {\n if (!collateral_token) {\n if (!isNativeToken(collateral.info)) {\n throw new Error(\n 'CollateralToken must be provided - unable to open position'\n );\n }\n\n return this.createExecuteMsg(\n {\n open_position: {\n collateral,\n asset_info,\n collateral_ratio: new Dec(collateral_ratio).toFixed()\n }\n },\n [new Coin(collateral.info.native_token.denom, collateral.amount)]\n );\n }\n\n if (!this.contractAddress) {\n throw new Error(\n 'contractAddress not provided - unable to execute message'\n );\n }\n\n return collateral_token.send.call(\n this,\n this.contractAddress,\n collateral.amount,\n createHookMsg({\n open_position: {\n asset_info,\n collateral_ratio: new Dec(collateral_ratio).toFixed()\n }\n })\n );\n }\n\n public deposit(\n position_idx: Numeric.Input,\n collateral: Asset,\n collateral_token?: TerraswapToken\n ): MsgExecuteContract {\n if (!collateral_token) {\n if (!isNativeToken(collateral.info)) {\n throw new Error(\n 'CollateralToken must be provided - unable to open position'\n );\n }\n\n return this.createExecuteMsg(\n {\n deposit: {\n position_idx: new Int(position_idx).toString(),\n collateral\n }\n },\n [new Coin(collateral.info.native_token.denom, collateral.amount)]\n );\n }\n\n if (!this.contractAddress) {\n throw new Error(\n 'contractAddress not provided - unable to execute message'\n );\n }\n\n return collateral_token.send.call(\n this,\n this.contractAddress,\n collateral.amount,\n createHookMsg({\n deposit: {\n position_idx: new Int(position_idx).toString()\n }\n })\n );\n }\n\n public withdraw(\n position_idx: Numeric.Input,\n collateral: Asset\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n withdraw: {\n position_idx: new Int(position_idx).toString(),\n collateral\n }\n });\n }\n\n public mint(position_idx: Numeric.Input, asset: Asset): MsgExecuteContract {\n return this.createExecuteMsg({\n mint: {\n position_idx: new Int(position_idx).toString(),\n asset\n }\n });\n }\n\n public burn(\n position_idx: Numeric.Input,\n asset: Asset,\n asset_token: TerraswapToken\n ): MsgExecuteContract {\n if (!this.contractAddress) {\n throw new Error(\n 'contractAddress not provided - unable to execute message'\n );\n }\n\n return asset_token.send.call(\n this,\n this.contractAddress,\n asset.amount,\n createHookMsg({\n burn: {\n position_idx: new Int(position_idx).toString()\n }\n })\n );\n }\n\n public auction(\n position_idx: Numeric.Input,\n asset: Asset,\n asset_token: TerraswapToken\n ): MsgExecuteContract {\n if (!this.contractAddress) {\n throw new Error(\n 'contractAddress not provided - unable to execute message'\n );\n }\n\n return asset_token.send(\n this.contractAddress,\n asset.amount,\n createHookMsg({\n auction: {\n position_idx: new Int(position_idx).toString()\n }\n })\n );\n }\n\n public async getConfig(): Promise {\n return this.query({\n config: {}\n });\n }\n\n public async getAssetConfig(\n asset_token: AccAddress\n ): Promise {\n return this.query({\n asset_config: {\n asset_token\n }\n });\n }\n\n public async getPosition(\n position_idx: Numeric.Input\n ): Promise {\n return this.query({\n position: {\n position_idx: new Int(position_idx).toString()\n }\n });\n }\n\n public async getPositions(\n owner_addr?: AccAddress,\n start_after?: Numeric.Input,\n limit?: number\n ): Promise {\n return this.query({\n positions: {\n owner_addr: owner_addr ? owner_addr : this.wallet.key.accAddress,\n start_after: start_after ? new Int(start_after).toString() : undefined,\n limit\n }\n });\n }\n\n // Typed overloads\n\n protected async query(query_msg: MirrorMint.QueryMsg): Promise {\n return super.query(query_msg);\n }\n\n protected createExecuteMsg(\n execute_msg: MirrorMint.HandleMsg,\n coins: Coins.Input = {}\n ): MsgExecuteContract {\n return super.createExecuteMsg(execute_msg, coins);\n }\n}\n","import {\n AccAddress,\n Coins,\n Dec,\n Numeric,\n MsgInstantiateContract,\n MsgExecuteContract\n} from '@terra-money/terra.js';\nimport { AssetInfo } from '../utils/Asset';\nimport { ContractClient } from './ContractClient';\nimport { EmptyObject } from '../utils/EmptyObject';\n\nexport namespace MirrorOracle {\n export interface InitMsg {\n owner: AccAddress;\n base_asset_info: AssetInfo;\n }\n\n export interface HandleUpdateConfig {\n update_config: {\n owner?: AccAddress;\n };\n }\n\n export interface HandleRegisterAsset {\n register_asset: {\n asset_token: AccAddress;\n feeder: AccAddress;\n };\n }\n\n export interface PriceInfo {\n asset_token: AccAddress;\n price: string;\n }\n\n export interface HandleFeedPrice {\n feed_price: {\n price_infos: Array;\n };\n }\n\n export interface QueryConfig {\n config: EmptyObject;\n }\n\n export interface QueryAsset {\n asset: { asset_token: AccAddress };\n }\n\n export interface QueryPrice {\n price: { asset_token: AccAddress };\n }\n\n export interface QueryPrices {\n prices: EmptyObject;\n }\n\n export interface ConfigResponse {\n owner: AccAddress;\n base_asset_info: AssetInfo;\n }\n\n export interface AssetResponse {\n asset_token: AccAddress;\n feeder: AccAddress;\n }\n\n export interface PriceResponse {\n price: string;\n last_update_time: number;\n asset_token: AccAddress;\n }\n\n export interface PricesResponse {\n prices: Array;\n }\n\n export type HandleMsg =\n | HandleUpdateConfig\n | HandleRegisterAsset\n | HandleFeedPrice;\n\n export type QueryMsg = QueryConfig | QueryAsset | QueryPrice | QueryPrices;\n}\n\nexport class MirrorOracle extends ContractClient {\n public init(\n init_msg: MirrorOracle.InitMsg,\n migratable: boolean\n ): MsgInstantiateContract {\n return this.createInstantiateMsg(init_msg, {}, migratable);\n }\n\n public updateConfig(\n config: MirrorOracle.HandleUpdateConfig['update_config']\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n update_config: config\n });\n }\n\n public registerAsset(\n asset_token: AccAddress,\n feeder: AccAddress\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n register_asset: {\n asset_token,\n feeder\n }\n });\n }\n\n public feedPrice(\n price_infos: Array<{\n asset_token: AccAddress;\n price: Numeric.Input;\n }>\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n feed_price: {\n price_infos: price_infos.map((pi) => ({\n asset_token: pi.asset_token,\n price: new Dec(pi.price).toFixed()\n }))\n }\n });\n }\n\n public async getConfig(): Promise {\n return this.query({\n config: {}\n });\n }\n\n public async getAsset(\n asset_token: AccAddress\n ): Promise {\n return this.query({\n asset: { asset_token }\n });\n }\n\n public async getPrice(\n asset_token: AccAddress\n ): Promise {\n return this.query({\n price: { asset_token }\n });\n }\n\n public async getPrices(): Promise {\n return this.query({\n prices: {}\n });\n }\n\n // Typed overloads\n\n protected async query(query_msg: MirrorOracle.QueryMsg): Promise {\n return super.query(query_msg);\n }\n\n protected createExecuteMsg(\n execute_msg: MirrorOracle.HandleMsg,\n coins: Coins.Input = {}\n ): MsgExecuteContract {\n return super.createExecuteMsg(execute_msg, coins);\n }\n}\n","/* eslint-disable camelcase */\nimport {\n AccAddress,\n Coins,\n Numeric,\n MsgInstantiateContract,\n MsgExecuteContract,\n Int\n} from '@terra-money/terra.js';\nimport { ContractClient } from './ContractClient';\nimport { EmptyObject } from '../utils/EmptyObject';\nimport { TerraswapToken } from './TerraswapToken';\n\nexport namespace MirrorStaking {\n export interface InitMsg {\n owner: AccAddress;\n mirror_token: AccAddress;\n }\n\n export interface HandleUpdateConfig {\n update_config: {\n asset_token?: AccAddress;\n staking_token?: AccAddress;\n };\n }\n\n export interface HandleRegisterAsset {\n register_asset: {\n asset_token: AccAddress;\n staking_token: AccAddress;\n };\n }\n\n export interface HandleUnbond {\n unbond: {\n asset_token: AccAddress;\n amount: string;\n };\n }\n\n export interface HandleWithdraw {\n withdraw: {\n asset_token?: AccAddress;\n };\n }\n\n export interface HookBond {\n bond: {\n asset_token: AccAddress;\n };\n }\n\n export interface HookDepositReward {\n deposit_reward: {\n asset_token: AccAddress;\n };\n }\n\n export interface QueryConfig {\n config: EmptyObject;\n }\n\n export interface QueryPoolInfo {\n pool_info: {\n asset_token: AccAddress;\n };\n }\n\n export interface QueryRewardInfo {\n reward_info: {\n staker: AccAddress;\n asset_token?: AccAddress;\n };\n }\n\n export interface ConfigResponse {\n owner: AccAddress;\n mirror_token: AccAddress;\n }\n\n export interface PoolInfoResponse {\n asset_token: AccAddress;\n staking_token: AccAddress;\n total_bond_amount: string;\n reward_index: string;\n }\n\n export interface RewardInfoResponseItem {\n asset_token: AccAddress;\n index: string;\n bond_amount: string;\n pending_reward: string;\n }\n\n export interface RewardInfoResponse {\n staker: AccAddress;\n reward_infos: Array;\n }\n\n export type HandleMsg =\n | HandleUpdateConfig\n | HandleRegisterAsset\n | HandleUnbond\n | HandleWithdraw;\n\n export type HookMsg = HookBond | HookDepositReward;\n\n export type QueryMsg = QueryConfig | QueryPoolInfo | QueryRewardInfo;\n}\n\nfunction createHookMsg(msg: MirrorStaking.HookMsg): string {\n return Buffer.from(JSON.stringify(msg)).toString('base64');\n}\n\nexport class MirrorStaking extends ContractClient {\n public init(\n init_msg: MirrorStaking.InitMsg,\n migratable: boolean\n ): MsgInstantiateContract {\n return this.createInstantiateMsg(init_msg, {}, migratable);\n }\n\n public updateConfig(\n config: MirrorStaking.HandleUpdateConfig['update_config']\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n update_config: config\n });\n }\n\n public registerAsset(\n asset_token: AccAddress,\n staking_token: AccAddress\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n register_asset: {\n asset_token,\n staking_token\n }\n });\n }\n\n public unbond(\n asset_token: AccAddress,\n amount: Numeric.Input\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n unbond: {\n asset_token,\n amount: new Int(amount).toString()\n }\n });\n }\n\n public withdraw(asset_token?: AccAddress): MsgExecuteContract {\n return this.createExecuteMsg({\n withdraw: {\n asset_token\n }\n });\n }\n\n public bond(\n asset_token: AccAddress,\n amount: Numeric.Input,\n lp_token: TerraswapToken\n ): MsgExecuteContract {\n if (!this.contractAddress) {\n throw new Error(\n 'contractAddress not provided - unable to execute message'\n );\n }\n\n if (this.wallet.key.accAddress !== lp_token.wallet.key.accAddress) {\n throw new Error('two contract instance is not from the same key');\n }\n\n return lp_token.send(\n this.contractAddress,\n amount,\n createHookMsg({\n bond: {\n asset_token\n }\n })\n );\n }\n\n public depositReward(\n asset_token: AccAddress,\n amount: Numeric.Input,\n mirror_token: TerraswapToken\n ): MsgExecuteContract {\n if (!this.contractAddress) {\n throw new Error(\n 'contractAddress not provided - unable to execute message'\n );\n }\n\n return mirror_token.send(\n this.contractAddress,\n amount,\n createHookMsg({\n deposit_reward: {\n asset_token\n }\n })\n );\n }\n\n public async getConfig(): Promise {\n return this.query({\n config: {}\n });\n }\n\n public async getPoolInfo(\n asset_token: AccAddress\n ): Promise {\n return this.query({\n pool_info: {\n asset_token\n }\n });\n }\n\n public async getRewardInfo(\n staker: AccAddress,\n asset_token?: AccAddress\n ): Promise {\n return this.query({\n reward_info: {\n staker,\n asset_token\n }\n });\n }\n\n protected async query(query_msg: MirrorStaking.QueryMsg): Promise {\n return super.query(query_msg);\n }\n\n protected createExecuteMsg(\n execute_msg: MirrorStaking.HandleMsg,\n coins: Coins.Input = {}\n ): MsgExecuteContract {\n return super.createExecuteMsg(execute_msg, coins);\n }\n}\n","import {\n AccAddress,\n MsgExecuteContract,\n Coins,\n MsgInstantiateContract,\n Numeric,\n Dec\n} from '@terra-money/terra.js';\nimport { EmptyObject } from '../utils/EmptyObject';\nimport { AssetInfo } from '../utils/Asset';\nimport { ContractClient } from './ContractClient';\n\nexport namespace TerraswapFactory {\n export interface InitHook {\n msg: string;\n contract_addr: AccAddress;\n }\n\n export interface InitMsg {\n pair_code_id: number;\n token_code_id: number;\n init_hook?: InitHook;\n }\n\n export interface HandleUpdateConfig {\n update_config: {\n owner?: AccAddress;\n token_code_id?: number;\n pair_code_id?: number;\n };\n }\n\n export interface HandleCreatePair {\n create_pair: {\n pair_owner: AccAddress;\n commission_collector: AccAddress;\n lp_commission: string;\n owner_commission: string;\n asset_infos: [AssetInfo, AssetInfo];\n init_hook?: InitHook;\n };\n }\n\n export interface QueryConfig {\n config: EmptyObject;\n }\n\n export interface QueryPair {\n pair: {\n asset_infos: [AssetInfo, AssetInfo];\n };\n }\n\n export interface ConfigResponse {\n owner: AccAddress;\n pair_code_id: number;\n token_code_id: number;\n }\n\n export interface PairResponse {\n owner: AccAddress;\n contract_addr: AccAddress;\n asset_infos: [AssetInfo, AssetInfo];\n }\n\n export type HandleMsg = HandleUpdateConfig | HandleCreatePair;\n\n export type QueryMsg = QueryConfig | QueryPair;\n}\n\nexport class TerraswapFactory extends ContractClient {\n public init(\n init_msg: TerraswapFactory.InitMsg,\n migratable: boolean\n ): MsgInstantiateContract {\n return this.createInstantiateMsg(init_msg, {}, migratable);\n }\n\n public updateConfig(\n config: TerraswapFactory.HandleUpdateConfig['update_config']\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n update_config: config\n });\n }\n\n public createPair(\n pair_owner: AccAddress,\n commission_collector: AccAddress,\n lp_commission: Numeric.Input,\n owner_commission: Numeric.Input,\n asset_infos: [AssetInfo, AssetInfo],\n init_hook?: TerraswapFactory.InitHook\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n create_pair: {\n pair_owner,\n commission_collector,\n lp_commission: new Dec(lp_commission).toString(),\n owner_commission: new Dec(owner_commission).toString(),\n asset_infos,\n init_hook\n }\n });\n }\n\n public async getConfig(): Promise {\n return this.query({\n config: {}\n });\n }\n\n public async getPair(\n asset_infos: [AssetInfo, AssetInfo]\n ): Promise {\n return this.query({\n pair: { asset_infos }\n });\n }\n\n protected async query(query_msg: TerraswapFactory.QueryMsg): Promise {\n return super.query(query_msg);\n }\n\n protected createExecuteMsg(\n execute_msg: TerraswapFactory.HandleMsg,\n coins: Coins.Input = {}\n ): MsgExecuteContract {\n return super.createExecuteMsg(execute_msg, coins);\n }\n}\n","import {\n AccAddress,\n MsgExecuteContract,\n Coins,\n MsgInstantiateContract,\n Coin,\n Numeric,\n Dec\n} from '@terra-money/terra.js';\nimport { EmptyObject } from '../utils/EmptyObject';\nimport { AssetInfo, Asset, isNativeToken } from '../utils/Asset';\nimport { ContractClient } from './ContractClient';\nimport { TerraswapToken } from './TerraswapToken';\n\nexport namespace TerraswapPair {\n export interface InitHook {\n msg: string;\n contract_addr: AccAddress;\n }\n\n export interface InitMsg {\n owner: AccAddress;\n commission_collector: AccAddress;\n asset_infos: [AssetInfo, AssetInfo];\n lp_commission: string;\n owner_commission: string;\n token_code_id: number;\n init_hook?: InitHook;\n }\n\n export interface HandleUpdateConfig {\n update_config: {\n owner?: AccAddress;\n lp_commission?: string;\n owner_commission?: string;\n };\n }\n\n export interface HandleProvideLiquidity {\n provide_liquidity: {\n assets: [Asset, Asset];\n };\n }\n\n export interface HandleSwap {\n swap: {\n offer_asset: Asset;\n belief_price?: string;\n max_spread?: string;\n to?: AccAddress;\n };\n }\n\n export interface HookSwap {\n swap: {\n belief_price?: string;\n max_spread?: string;\n to?: AccAddress;\n };\n }\n\n export interface HookWithdrawLiquidity {\n withdraw_liquidity: EmptyObject;\n }\n\n export interface QueryConfigGeneral {\n config_general: EmptyObject;\n }\n\n export interface QueryConfigAsset {\n config_asset: EmptyObject;\n }\n\n export interface QueryConfigSwap {\n config_swap: EmptyObject;\n }\n\n export interface QueryPool {\n pool: EmptyObject;\n }\n\n export interface QuerySimulation {\n simulation: {\n offer_asset: Asset;\n };\n }\n\n export interface QueryReverseSimulation {\n reverse_simulation: {\n ask_asset: Asset;\n };\n }\n\n export interface ConfigGeneralResponse {\n owner: AccAddress;\n liquidity_token: AccAddress;\n commission_collector: AccAddress;\n }\n\n export interface ConfigSwapResponse {\n lp_commission: string;\n owner_commission: string;\n }\n\n export interface ConfigAssetResponse {\n infos: [AssetInfo, AssetInfo];\n }\n\n export interface PoolResponse {\n assets: [Asset, Asset];\n total_share: string;\n }\n\n export interface SimulationResponse {\n return_amount: string;\n spread_amount: string;\n commission_amount: string;\n }\n\n export interface ReverseSimulationResponse {\n offer_amount: string;\n spread_amount: string;\n commission_amount: string;\n }\n\n export type HandleMsg =\n | HandleUpdateConfig\n | HandleProvideLiquidity\n | HandleSwap;\n\n export type HookMsg = HookSwap | HookWithdrawLiquidity;\n\n export type QueryMsg =\n | QueryConfigGeneral\n | QueryConfigAsset\n | QueryConfigSwap\n | QueryPool\n | QuerySimulation\n | QueryReverseSimulation;\n}\n\nfunction createHookMsg(msg: TerraswapPair.HookMsg): string {\n return Buffer.from(JSON.stringify(msg)).toString('base64');\n}\n\nexport class TerraswapPair extends ContractClient {\n public init(\n init_msg: TerraswapPair.InitMsg,\n migratable: boolean\n ): MsgInstantiateContract {\n return this.createInstantiateMsg(init_msg, {}, migratable);\n }\n\n public updateConfig(\n config: TerraswapPair.HandleUpdateConfig['update_config']\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n update_config: config\n });\n }\n\n /// CONTRACT - If providing asset is not native token,\n /// must increase allowance first before using it\n public provideLiquidity(assets: [Asset, Asset]): MsgExecuteContract {\n let coins: Coins = new Coins([]);\n assets.forEach((asset) => {\n if (isNativeToken(asset.info)) {\n coins = coins.add(\n new Coin(asset.info.native_token.denom, asset.amount)\n );\n }\n });\n\n return this.createExecuteMsg(\n {\n provide_liquidity: {\n assets\n }\n },\n coins\n );\n }\n\n public swap(\n offer_asset: Asset,\n params: {\n belief_price?: Numeric.Input;\n max_spread?: Numeric.Input;\n offer_token?: TerraswapToken;\n to?: AccAddress;\n }\n ): MsgExecuteContract {\n if (!params.offer_token) {\n if (!isNativeToken(offer_asset.info)) {\n throw new Error('OfferToken must be provided - unable to swap');\n }\n\n return this.createExecuteMsg(\n {\n swap: {\n offer_asset,\n belief_price: params.belief_price\n ? new Dec(params.belief_price).toString()\n : undefined,\n max_spread: params.max_spread\n ? new Dec(params.max_spread).toString()\n : undefined,\n to: params.to\n }\n },\n [new Coin(offer_asset.info.native_token.denom, offer_asset.amount)]\n );\n }\n\n if (!this.contractAddress) {\n throw new Error(\n 'contractAddress not provided - unable to execute message'\n );\n }\n\n return params.offer_token.send(\n this.contractAddress,\n offer_asset.amount,\n createHookMsg({\n swap: {\n belief_price: params.belief_price\n ? new Dec(params.belief_price).toString()\n : undefined,\n max_spread: params.max_spread\n ? new Dec(params.max_spread).toString()\n : undefined,\n to: params.to\n }\n })\n );\n }\n\n public withdrawLiquidity(\n amount: Numeric.Input,\n lp_token: TerraswapToken\n ): MsgExecuteContract {\n if (!this.contractAddress) {\n throw new Error(\n 'contractAddress not provided - unable to execute message'\n );\n }\n\n return lp_token.send.call(\n this,\n this.contractAddress,\n amount,\n createHookMsg({\n withdraw_liquidity: {}\n })\n );\n }\n\n public async getConfigGeneral(): Promise<\n TerraswapPair.ConfigGeneralResponse\n > {\n return this.query({\n config_general: {}\n });\n }\n\n public async getConfigAsset(): Promise {\n return this.query({\n config_asset: {}\n });\n }\n\n public async getConfigSwap(): Promise {\n return this.query({\n config_swap: {}\n });\n }\n\n public async getPool(): Promise {\n return this.query({\n pool: {}\n });\n }\n\n public async getSimulation(\n offer_asset: Asset\n ): Promise {\n return this.query({\n simulation: {\n offer_asset\n }\n });\n }\n\n public async getReverseSimulation(\n ask_asset: Asset\n ): Promise {\n return this.query({\n reverse_simulation: {\n ask_asset\n }\n });\n }\n\n protected async query(query_msg: TerraswapPair.QueryMsg): Promise {\n return super.query(query_msg);\n }\n\n protected createExecuteMsg(\n execute_msg: TerraswapPair.HandleMsg,\n coins: Coins.Input = {}\n ): MsgExecuteContract {\n return super.createExecuteMsg(execute_msg, coins);\n }\n}\n","import {\n AccAddress,\n Coins,\n Numeric,\n MsgExecuteContract,\n MsgInstantiateContract,\n Int\n} from '@terra-money/terra.js';\nimport { ContractClient } from './ContractClient';\nimport { EmptyObject } from '../utils/EmptyObject';\n\nexport namespace TerraswapToken {\n export interface InitHook {\n msg: string;\n contract_addr: AccAddress;\n }\n\n export interface MinterResponse {\n minter: AccAddress;\n cap?: string;\n }\n\n export interface TokenCoin {\n address: AccAddress;\n amount: string;\n }\n\n export interface InitMsg {\n name: string;\n symbol: string;\n decimals: number;\n initial_balances: Array;\n mint?: MinterResponse;\n init_hook?: InitHook;\n }\n\n export interface Cw20ReceiveMsg {\n sender: AccAddress;\n amount: string;\n msg?: string;\n }\n\n export interface Receive {\n receive: Cw20ReceiveMsg;\n }\n\n export interface Transfer {\n transfer: {\n recipient: AccAddress;\n amount: string;\n };\n }\n\n export interface Burn {\n burn: {\n amount: string;\n };\n }\n\n export interface Send {\n send: {\n contract: AccAddress;\n amount: string;\n msg?: string;\n };\n }\n\n export interface Mint {\n mint: {\n recipient: AccAddress;\n amount: string;\n };\n }\n\n export interface ExpirationAtHeight {\n at_height: number;\n }\n\n export interface ExpirationAtTime {\n at_time: number;\n }\n\n export interface ExpirationNever {\n never: EmptyObject;\n }\n\n export type Expiration =\n | ExpirationAtHeight\n | ExpirationAtTime\n | ExpirationNever;\n\n export interface IncreaseAllowance {\n increase_allowance: {\n spender: AccAddress;\n amount: string;\n expires?: Expiration;\n };\n }\n\n export interface DecreaseAllowance {\n decrease_allowance: {\n spender: AccAddress;\n amount: string;\n expires?: Expiration;\n };\n }\n\n export interface TransferFrom {\n transfer_from: {\n owner: AccAddress;\n recipient: AccAddress;\n amount: string;\n };\n }\n\n export interface SendFrom {\n send_from: {\n owner: AccAddress;\n contract: AccAddress;\n amount: string;\n msg?: string;\n };\n }\n\n export interface BurnFrom {\n burn_from: {\n owner: AccAddress;\n amount: string;\n };\n }\n\n export interface Balance {\n balance: {\n address: AccAddress;\n };\n }\n\n export interface TokenInfo {\n token_info: EmptyObject;\n }\n\n export interface Minter {\n minter: EmptyObject;\n }\n\n export interface Allownace {\n allowance: {\n owner: AccAddress;\n spender: AccAddress;\n };\n }\n\n export interface AllAllowances {\n all_allowances: {\n owner: AccAddress;\n start_after?: AccAddress;\n limit?: number;\n };\n }\n\n export interface AllAccounts {\n all_accounts: {\n start_after?: AccAddress;\n limit?: number;\n };\n }\n\n export interface BalanceResponse {\n balance: string;\n }\n\n export interface TokenInfoResponse {\n name: string;\n symbol: string;\n decimals: number;\n total_supply: string;\n }\n\n export interface AllowanceResponse {\n allowance: string;\n expires: Expiration;\n }\n\n export interface AllowanceInfo {\n spender: AccAddress;\n allowance: string;\n expires: Expiration;\n }\n\n export interface AllAllowancesResponse {\n allowances: Array;\n }\n\n export interface AllAccountsResponse {\n accounts: Array;\n }\n\n export type HandleMsg =\n | Receive\n | Transfer\n | TransferFrom\n | Burn\n | BurnFrom\n | Send\n | SendFrom\n | Mint\n | IncreaseAllowance\n | DecreaseAllowance;\n\n export type QueryMsg =\n | Balance\n | TokenInfo\n | Minter\n | Allownace\n | AllAllowances\n | AllAccounts;\n}\n\nexport class TerraswapToken extends ContractClient {\n public init(\n init_msg: TerraswapToken.InitMsg,\n migratable: boolean\n ): MsgInstantiateContract {\n return this.createInstantiateMsg(init_msg, {}, migratable);\n }\n\n public transfer(\n recipient: AccAddress,\n amount: Numeric.Input\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n transfer: {\n recipient,\n amount: new Int(amount).toString()\n }\n });\n }\n\n public transferFrom(\n owner: AccAddress,\n recipient: AccAddress,\n amount: Numeric.Input\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n transfer_from: {\n owner,\n recipient,\n amount: new Int(amount).toString()\n }\n });\n }\n\n public send(\n contract: AccAddress,\n amount: Numeric.Input,\n msg?: string\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n send: {\n contract,\n amount: new Int(amount).toString(),\n msg\n }\n });\n }\n\n public sendFrom(\n owner: AccAddress,\n contract: AccAddress,\n amount: Numeric.Input,\n msg?: any\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n send_from: {\n owner,\n contract,\n amount: new Int(amount).toString(),\n msg: msg\n ? Buffer.from(JSON.stringify(msg)).toString('base64')\n : undefined\n }\n });\n }\n\n public mint(\n recipient: AccAddress,\n amount: Numeric.Input\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n mint: {\n recipient,\n amount: new Int(amount).toString()\n }\n });\n }\n\n public burn(amount: Numeric.Input): MsgExecuteContract {\n return this.createExecuteMsg({\n burn: {\n amount: new Int(amount).toString()\n }\n });\n }\n\n public burnFrom(\n owner: AccAddress,\n amount: Numeric.Input\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n burn_from: {\n owner,\n amount: new Int(amount).toString()\n }\n });\n }\n\n public increaseAllowance(\n spender: AccAddress,\n amount: Numeric.Input,\n expires?: TerraswapToken.Expiration\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n increase_allowance: {\n spender,\n amount: new Int(amount).toString(),\n expires\n }\n });\n }\n\n public decreaseAllowance(\n spender: AccAddress,\n amount: Numeric.Input,\n expires?: TerraswapToken.Expiration\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n decrease_allowance: {\n spender,\n amount: new Int(amount).toString(),\n expires\n }\n });\n }\n\n public async getBalance(\n address?: AccAddress\n ): Promise {\n return this.query({\n balance: {\n address: address ? address : this.wallet.key.accAddress\n }\n });\n }\n\n public async getTokenInfo(): Promise {\n return this.query({\n token_info: {}\n });\n }\n\n public async getMinter(): Promise {\n return this.query({\n minter: {}\n });\n }\n\n public async getAllowance(\n owner: AccAddress,\n spender: AccAddress\n ): Promise {\n return this.query({\n allowance: {\n owner,\n spender\n }\n });\n }\n\n public async getAllAllowances(\n owner: AccAddress,\n start_after?: AccAddress,\n limit?: number\n ): Promise {\n return this.query({\n all_allowances: {\n owner,\n start_after,\n limit\n }\n });\n }\n\n public async getAllAccounts(\n start_after?: AccAddress,\n limit?: number\n ): Promise {\n return this.query({\n all_accounts: {\n start_after,\n limit\n }\n });\n }\n\n protected createExecuteMsg(\n executeMsg: TerraswapToken.HandleMsg,\n coins: Coins.Input = {}\n ): MsgExecuteContract {\n return super.createExecuteMsg(executeMsg, coins);\n }\n\n protected async query(query_msg: TerraswapToken.QueryMsg): Promise {\n return super.query(query_msg);\n }\n}\n","export * from './Asset';\nexport * from './EmptyKey';\nexport * from './EmptyObject';\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/bundle.node.js b/dist/bundle.node.js deleted file mode 100644 index 4365ce26..00000000 --- a/dist/bundle.node.js +++ /dev/null @@ -1,15 +0,0 @@ -!function(t,e){for(var r in e)t[r]=e[r]}(exports,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=109)}([function(t,e,r){"use strict";function n(t){if(Array.isArray(t))return t.map(n);if("object"!=typeof t)return t;var e={};return Object.keys(t).sort().forEach((function(r){void 0!==t[r]&&null!==t[r]&&(e[r]=n(t[r]))})),e}Object.defineProperty(e,"__esModule",{value:!0}),e.JSONSerializable=e.prepareSignBytes=void 0,e.prepareSignBytes=n;var i=function(){function t(){}return t.prototype.toJSON=function(){return JSON.stringify(n(this.toData()))},t}();e.JSONSerializable=i},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(112),e),i(r(8),e),i(r(3),e),i(r(49),e),i(r(22),e),i(r(2),e),i(r(53),e),i(r(24),e),i(r(30),e),i(r(68),e),i(r(156),e),i(r(31),e),i(r(157),e),i(r(158),e),i(r(159),e),i(r(160),e),i(r(50),e),i(r(51),e),i(r(54),e),i(r(52),e),i(r(55),e),i(r(60),e),i(r(61),e),i(r(28),e),i(r(62),e),i(r(161),e),i(r(162),e),i(r(163),e),i(r(164),e),i(r(57),e),i(r(58),e),i(r(65),e),i(r(66),e),i(r(69),e),i(r(70),e),i(r(165),e),i(r(29),e),i(r(56),e),i(r(59),e),i(r(67),e),i(r(166),e)},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.int=e.dec=e.Int=e.Dec=e.Numeric=e.DEC_PRECISION=void 0;var a=o(r(113));e.DEC_PRECISION=18;var s,u=a.default.clone();u.prototype.toString=function(){return this.toFixed(e.DEC_PRECISION)},function(t){t.parse=function(t){if(t instanceof c)return t;if("string"==typeof t)return t.includes(".")?new c(t):new f(t);var e=new a.default(t);return e.isInteger()?new f(e):new c(e.toString())}}(s=e.Numeric||(e.Numeric={}));var c=function(t){function e(e){return t.call(this,e.toString())||this}return i(e,t),e.withPrec=function(t,r){return new e(new e(t).div(Math.pow(10,r)))},e.prototype.toInt=function(){return new f(this)},e.prototype.add=function(r){var n=new e(s.parse(r));return new e(t.prototype.add.call(this,n))},e.prototype.sub=function(r){var n=new e(s.parse(r));return new e(t.prototype.sub.call(this,n))},e.prototype.mul=function(r){var n=new e(s.parse(r));return new e(t.prototype.mul.call(this,n))},e.prototype.div=function(r){var n=new e(s.parse(r));return new e(t.prototype.div.call(this,n))},e.prototype.mod=function(r){var n=new e(s.parse(r));return new e(t.prototype.mod.call(this,n))},e}(u);e.Dec=c;var f=function(t){function e(e){var r=new a.default(e.toString());return t.call(this,r.divToInt(1))||this}return i(e,t),e.prototype.toString=function(){return this.toFixed()},e.prototype.toDec=function(){return new c(this)},e.prototype.add=function(t){var r=s.parse(t);return r instanceof c?new c(this).add(r):new e(this.plus(r))},e.prototype.sub=function(t){var r=s.parse(t);return r instanceof c?new c(this).sub(r):new e(this.minus(r))},e.prototype.mul=function(t){var r=s.parse(t);return r instanceof c?new c(this).mul(r):new e(this.times(r))},e.prototype.div=function(r){var n=s.parse(r);return n instanceof c?new c(this).div(n):new e(t.prototype.div.call(this,n))},e.prototype.mod=function(r){var n=s.parse(r);return n instanceof c?new c(this).mod(n):new e(t.prototype.mod.call(this,n))},e}(a.default.clone());e.Int=f,e.dec=function(t){return new c(t[0])},e.int=function(t){return new f(t[0])}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0;t.cmpn(-n)>0||e.cmpn(-i)>0;){var o,a,s,u=t.andln(3)+n&3,c=e.andln(3)+i&3;if(3===u&&(u=-1),3===c&&(c=-1),0==(1&u))o=0;else o=3!==(s=t.andln(7)+n&7)&&5!==s||2!==c?u:-u;if(r[0].push(o),0==(1&c))a=0;else a=3!==(s=e.andln(7)+i&7)&&5!==s||2!==u?c:-c;r[1].push(a),2*n===o+1&&(n=1-n),2*i===a+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(1),e),i(r(167),e),i(r(216),e),i(r(261),e)},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Coin=void 0;var o=r(0),a=r(2),s=function(t){function e(e,r){var n=t.call(this)||this;return n.denom=e,n.amount=a.Numeric.parse(r),n}return i(e,t),e.fromData=function(t){return new e(t.denom,t.amount)},e.prototype.isIntCoin=function(){return this.amount instanceof a.Int},e.prototype.isDecCoin=function(){return this.amount instanceof a.Dec},e.prototype.toIntCoin=function(){return new e(this.denom,new a.Int(this.amount))},e.prototype.toDecCoin=function(){return new e(this.denom,new a.Dec(this.amount))},e.prototype.toData=function(){return{denom:this.denom,amount:this.amount.toString()}},e.prototype.toString=function(){var t=this.amount.toFixed();return this.isDecCoin()&&-1===t.indexOf(".")?t+".0"+this.denom:""+t+this.denom},e.fromString=function(t){var r=t.match(/^(-?[0-9]+(\.[0-9]+)?)([a-zA-Z]+)$/);if(null===r)throw new Error("failed to parse to Coin: "+t);var n=r[1];return new e(r[3],n)},e.prototype.add=function(t){var r;if(t instanceof e){if(t.denom!==this.denom)throw new e.ArithmeticError("cannot add two Coins of different denoms: "+this.denom+" and "+t.denom);r=t.amount}else r=t;return r=a.Numeric.parse(r),new e(this.denom,this.amount.add(r))},e.prototype.sub=function(t){var r;if(t instanceof e){if(t.denom!==this.denom)throw new e.ArithmeticError("cannot subtract two Coins of different denoms: "+this.denom+" and "+t.denom);r=t.amount}else r=t;return r=a.Numeric.parse(r),new e(this.denom,this.amount.sub(r))},e.prototype.mul=function(t){var r=a.Numeric.parse(t);return new e(this.denom,this.amount.mul(r))},e.prototype.div=function(t){var r=a.Numeric.parse(t);return new e(this.denom,this.amount.div(r))},e.prototype.mod=function(t){var r=a.Numeric.parse(t);return new e(this.denom,this.amount.mod(r))},e}(o.JSONSerializable);e.Coin=s,function(t){var e=function(t){this.message=t};t.ArithmeticError=e}(s=e.Coin||(e.Coin={})),e.Coin=s},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a=r(35).Buffer}catch(t){}function s(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,c=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,d=67108863&u,l=Math.min(c,e.length-1),h=Math.max(0,c-t.length+1);h<=l;h++){var p=c-h|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[h])+d)/67108864|0,d=67108863&a}r.words[c]=0|d,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=f[t],h=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(h).toString(t);r=(p=p.idivn(h)).isZero()?b+r:c[l-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,c=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,h=0|a[1],p=8191&h,b=h>>>13,y=0|a[2],m=8191&y,v=y>>>13,g=0|a[3],_=8191&g,w=g>>>13,x=0|a[4],M=8191&x,S=x>>>13,O=0|a[5],k=8191&O,P=O>>>13,A=0|a[6],j=8191&A,E=A>>>13,D=0|a[7],C=8191&D,N=D>>>13,I=0|a[8],T=8191&I,R=I>>>13,q=0|a[9],z=8191&q,B=q>>>13,U=0|s[0],L=8191&U,F=U>>>13,K=0|s[1],J=8191&K,V=K>>>13,H=0|s[2],W=8191&H,G=H>>>13,Z=0|s[3],X=8191&Z,Y=Z>>>13,$=0|s[4],Q=8191&$,tt=$>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ct=st>>>13,ft=0|s[8],dt=8191&ft,lt=ft>>>13,ht=0|s[9],pt=8191&ht,bt=ht>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(c+(n=Math.imul(d,L))|0)+((8191&(i=(i=Math.imul(d,F))+Math.imul(l,L)|0))<<13)|0;c=((o=Math.imul(l,F))+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(p,L),i=(i=Math.imul(p,F))+Math.imul(b,L)|0,o=Math.imul(b,F);var mt=(c+(n=n+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(l,J)|0))<<13)|0;c=((o=o+Math.imul(l,V)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,L),i=(i=Math.imul(m,F))+Math.imul(v,L)|0,o=Math.imul(v,F),n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,J)|0,o=o+Math.imul(b,V)|0;var vt=(c+(n=n+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(l,W)|0))<<13)|0;c=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(_,L),i=(i=Math.imul(_,F))+Math.imul(w,L)|0,o=Math.imul(w,F),n=n+Math.imul(m,J)|0,i=(i=i+Math.imul(m,V)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,V)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,G)|0;var gt=(c+(n=n+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,Y)|0)+Math.imul(l,X)|0))<<13)|0;c=((o=o+Math.imul(l,Y)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(M,L),i=(i=Math.imul(M,F))+Math.imul(S,L)|0,o=Math.imul(S,F),n=n+Math.imul(_,J)|0,i=(i=i+Math.imul(_,V)|0)+Math.imul(w,J)|0,o=o+Math.imul(w,V)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,G)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,G)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,Y)|0;var _t=(c+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,tt)|0)+Math.imul(l,Q)|0))<<13)|0;c=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(k,L),i=(i=Math.imul(k,F))+Math.imul(P,L)|0,o=Math.imul(P,F),n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,V)|0,n=n+Math.imul(_,W)|0,i=(i=i+Math.imul(_,G)|0)+Math.imul(w,W)|0,o=o+Math.imul(w,G)|0,n=n+Math.imul(m,X)|0,i=(i=i+Math.imul(m,Y)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var wt=(c+(n=n+Math.imul(d,rt)|0)|0)+((8191&(i=(i=i+Math.imul(d,nt)|0)+Math.imul(l,rt)|0))<<13)|0;c=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(j,L),i=(i=Math.imul(j,F))+Math.imul(E,L)|0,o=Math.imul(E,F),n=n+Math.imul(k,J)|0,i=(i=i+Math.imul(k,V)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,V)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(w,X)|0,o=o+Math.imul(w,Y)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0;var xt=(c+(n=n+Math.imul(d,ot)|0)|0)+((8191&(i=(i=i+Math.imul(d,at)|0)+Math.imul(l,ot)|0))<<13)|0;c=((o=o+Math.imul(l,at)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(C,L),i=(i=Math.imul(C,F))+Math.imul(N,L)|0,o=Math.imul(N,F),n=n+Math.imul(j,J)|0,i=(i=i+Math.imul(j,V)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,V)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,G)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,Y)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,at)|0;var Mt=(c+(n=n+Math.imul(d,ut)|0)|0)+((8191&(i=(i=i+Math.imul(d,ct)|0)+Math.imul(l,ut)|0))<<13)|0;c=((o=o+Math.imul(l,ct)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(T,L),i=(i=Math.imul(T,F))+Math.imul(R,L)|0,o=Math.imul(R,F),n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,V)|0,n=n+Math.imul(j,W)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,G)|0,n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,nt)|0,n=n+Math.imul(m,ot)|0,i=(i=i+Math.imul(m,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ct)|0;var St=(c+(n=n+Math.imul(d,dt)|0)|0)+((8191&(i=(i=i+Math.imul(d,lt)|0)+Math.imul(l,dt)|0))<<13)|0;c=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(z,L),i=(i=Math.imul(z,F))+Math.imul(B,L)|0,o=Math.imul(B,F),n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,V)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,Y)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,Y)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,n=n+Math.imul(m,ut)|0,i=(i=i+Math.imul(m,ct)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ct)|0,n=n+Math.imul(p,dt)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(b,dt)|0,o=o+Math.imul(b,lt)|0;var Ot=(c+(n=n+Math.imul(d,pt)|0)|0)+((8191&(i=(i=i+Math.imul(d,bt)|0)+Math.imul(l,pt)|0))<<13)|0;c=((o=o+Math.imul(l,bt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(z,J),i=(i=Math.imul(z,V))+Math.imul(B,J)|0,o=Math.imul(B,V),n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,G)|0,n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,at)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,at)|0,n=n+Math.imul(_,ut)|0,i=(i=i+Math.imul(_,ct)|0)+Math.imul(w,ut)|0,o=o+Math.imul(w,ct)|0,n=n+Math.imul(m,dt)|0,i=(i=i+Math.imul(m,lt)|0)+Math.imul(v,dt)|0,o=o+Math.imul(v,lt)|0;var kt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;c=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(z,W),i=(i=Math.imul(z,G))+Math.imul(B,W)|0,o=Math.imul(B,G),n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,Y)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(j,rt)|0,i=(i=i+Math.imul(j,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,n=n+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ct)|0,n=n+Math.imul(_,dt)|0,i=(i=i+Math.imul(_,lt)|0)+Math.imul(w,dt)|0,o=o+Math.imul(w,lt)|0;var Pt=(c+(n=n+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,bt)|0)+Math.imul(v,pt)|0))<<13)|0;c=((o=o+Math.imul(v,bt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(z,X),i=(i=Math.imul(z,Y))+Math.imul(B,X)|0,o=Math.imul(B,Y),n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(j,ot)|0,i=(i=i+Math.imul(j,at)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,at)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ct)|0,n=n+Math.imul(M,dt)|0,i=(i=i+Math.imul(M,lt)|0)+Math.imul(S,dt)|0,o=o+Math.imul(S,lt)|0;var At=(c+(n=n+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,bt)|0)+Math.imul(w,pt)|0))<<13)|0;c=((o=o+Math.imul(w,bt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(z,Q),i=(i=Math.imul(z,tt))+Math.imul(B,Q)|0,o=Math.imul(B,tt),n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,n=n+Math.imul(j,ut)|0,i=(i=i+Math.imul(j,ct)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ct)|0,n=n+Math.imul(k,dt)|0,i=(i=i+Math.imul(k,lt)|0)+Math.imul(P,dt)|0,o=o+Math.imul(P,lt)|0;var jt=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,bt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((o=o+Math.imul(S,bt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(z,rt),i=(i=Math.imul(z,nt))+Math.imul(B,rt)|0,o=Math.imul(B,nt),n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,at)|0,n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ct)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ct)|0,n=n+Math.imul(j,dt)|0,i=(i=i+Math.imul(j,lt)|0)+Math.imul(E,dt)|0,o=o+Math.imul(E,lt)|0;var Et=(c+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,bt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((o=o+Math.imul(P,bt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(z,ot),i=(i=Math.imul(z,at))+Math.imul(B,ot)|0,o=Math.imul(B,at),n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ct)|0,n=n+Math.imul(C,dt)|0,i=(i=i+Math.imul(C,lt)|0)+Math.imul(N,dt)|0,o=o+Math.imul(N,lt)|0;var Dt=(c+(n=n+Math.imul(j,pt)|0)|0)+((8191&(i=(i=i+Math.imul(j,bt)|0)+Math.imul(E,pt)|0))<<13)|0;c=((o=o+Math.imul(E,bt)|0)+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,n=Math.imul(z,ut),i=(i=Math.imul(z,ct))+Math.imul(B,ut)|0,o=Math.imul(B,ct),n=n+Math.imul(T,dt)|0,i=(i=i+Math.imul(T,lt)|0)+Math.imul(R,dt)|0,o=o+Math.imul(R,lt)|0;var Ct=(c+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,bt)|0)+Math.imul(N,pt)|0))<<13)|0;c=((o=o+Math.imul(N,bt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(z,dt),i=(i=Math.imul(z,lt))+Math.imul(B,dt)|0,o=Math.imul(B,lt);var Nt=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,bt)|0)+Math.imul(R,pt)|0))<<13)|0;c=((o=o+Math.imul(R,bt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863;var It=(c+(n=Math.imul(z,pt))|0)+((8191&(i=(i=Math.imul(z,bt))+Math.imul(B,pt)|0))<<13)|0;return c=((o=Math.imul(B,bt))+(i>>>13)|0)+(It>>>26)|0,It&=67108863,u[0]=yt,u[1]=mt,u[2]=vt,u[3]=gt,u[4]=_t,u[5]=wt,u[6]=xt,u[7]=Mt,u[8]=St,u[9]=Ot,u[10]=kt,u[11]=Pt,u[12]=At,u[13]=jt,u[14]=Et,u[15]=Dt,u[16]=Ct,u[17]=Nt,u[18]=It,0!==c&&(u[19]=c,r.length++),r};function p(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(h=l),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?h(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==f||c>=i);c--){var d=0|this.words[c];this.words[c]=f<<26-o|d>>>o,f=d&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;d--){var l=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(l=Math.min(l/a|0,67108863),n._ishlnsubmul(i,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=l)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),d=e.clone();!e.isZero();){for(var l=0,h=1;0==(e.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(d)),i.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(d)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0==(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var d=0,l=1;0==(r.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new x(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function m(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(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){m.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 n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(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)}m.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},i(v,m),v.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},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>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new g;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return y[t]=e,e},x.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},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(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var d=this.pow(f,i),l=this.pow(t,i.addn(1).iushrn(1)),h=this.pow(t,i),p=a;0!==h.cmp(s);){for(var b=h,y=0;0!==b.cmp(s);y++)b=b.redSqr();n(y=0;n--){for(var c=e.words[n],f=u-1;f>=0;f--){var d=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},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 M(t)},i(M,x),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(181)(t))},function(t,e,r){"use strict";var n=r(14),i=r(12);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function a(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function u(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i>6|192,r[n++]=63&a|128):o(t,i)?(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i>>0}return a},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,a=(o>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,o,a,s){var u=0,c=e;return u+=(c=c+n>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,r,n,i,o,a,s){return e+n+o+s>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,a,s,u,c){var f=0,d=e;return f+=(d=d+n>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,r,n,i,o,a,s,u,c){return e+n+o+s+c>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Convert=void 0;var n=r(1),i=r(59),o=r(1);!function(t){t.id=function(t){return t},t.toDec=function(t){return new o.Dec(t)},t.toString=function(t){return t.toString()},t.toFixed=function(t){return t.toFixed()},t.toNumber=Number.parseInt,t.toOracleWhitelist=function(t){return t.map((function(t){return{name:t.name,tobin_tax:new o.Dec(t.tobin_tax)}}))},t.toVotingParams=function(t){return{voting_period:Number.parseInt(t.voting_period)}},t.toDepositParams=function(t){return{min_deposit:n.Coins.fromData(t.min_deposit),max_deposit_period:Number.parseInt(t.max_deposit_period)}},t.toTallyParams=function(t){return{quorum:new o.Dec(t.quorum),threshold:new o.Dec(t.threshold),veto:new o.Dec(t.veto)}},t.toPolicyConstraints=i.PolicyConstraints.fromData,t.toData=function(t){return t.toData()},t.serializeDepositParams=function(t){return{min_deposit:t.min_deposit.toData(),max_deposit_period:t.max_deposit_period.toFixed()}},t.serializeVotingParams=function(t){return{voting_period:t.voting_period.toFixed()}},t.serializeTallyParams=function(t){return{quorum:t.quorum.toString(),threshold:t.threshold.toString(),veto:t.veto.toString()}},t.serializeOracleWhitelist=function(t){return t.map((function(t){return{name:t.name,tobin_tax:t.tobin_tax.toString()}}))}}(e.Convert||(e.Convert={}))},function(t,e,r){try{var n=r(16);if("function"!=typeof n.inherits)throw"";t.exports=n.inherits}catch(e){t.exports=r(184)}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1] */ -var n=r(35),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},function(t,e,r){"use strict";var n=r(10),i=r(14);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=o,o.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o>>2]>>>24-o%4*8&255;e[n+o>>>2]|=a<<24-(n+o)%4*8}else for(o=0;o>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var r,n=[],i=function(e){e=e;var r=987654321,n=4294967295;return function(){var i=((r=36969*(65535&r)+(r>>16)&n)<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n;return i/=4294967296,(i+=.5)*(t.random()>.5?1:-1)}},o=0;o>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new a.init(r,e/2)}},c=s.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new a.init(r,e)}},f=s.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},d=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=f.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r=this._data,n=r.words,i=r.sigBytes,o=this.blockSize,s=i/(4*o),u=(s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0))*o,c=t.min(4*u,i);if(u){for(var f=0;f0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){s(t.precomputed);var r=t._getDoubles(),n=o(e,1,this._bitLength),i=(1<=u;e--)c=(c<<1)+n[e];a.push(c)}for(var f=this.jpoint(null,null,null),d=this.jpoint(null,null,null),l=i;l>0;l--){for(u=0;u=0;c--){for(e=0;c>=0&&0===a[c];c--)e++;if(c>=0&&e++,u=u.dblp(e),c<0)break;var f=a[c];s(0!==f),u="affine"===t.type?f>0?u.mixedAdd(i[f-1>>1]):u.mixedAdd(i[-f-1>>1].neg()):f>0?u.add(i[f-1>>1]):u.add(i[-f-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,n,i){for(var s=this._wnafT1,u=this._wnafT2,c=this._wnafT3,f=0,d=0;d=1;d-=2){var h=d-1,p=d;if(1===s[h]&&1===s[p]){var b=[e[h],null,null,e[p]];0===e[h].y.cmp(e[p].y)?(b[1]=e[h].add(e[p]),b[2]=e[h].toJ().mixedAdd(e[p].neg())):0===e[h].y.cmp(e[p].y.redNeg())?(b[1]=e[h].toJ().mixedAdd(e[p]),b[2]=e[h].add(e[p].neg())):(b[1]=e[h].toJ().mixedAdd(e[p]),b[2]=e[h].toJ().mixedAdd(e[p].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],m=a(r[h],r[p]);f=Math.max(m[0].length,f),c[h]=new Array(f),c[p]=new Array(f);for(var v=0;v=0;d--){for(var M=0;d>=0;){var S=!0;for(v=0;v=0&&M++,w=w.dblp(M),d<0)break;for(v=0;v0?O=u[v][k-1>>1]:k<0&&(O=u[v][-k-1>>1].neg()),w="affine"===O.type?w.mixedAdd(O):w.add(O))}}for(d=0;d=Math.ceil((t.bitLength()+1)/e.step)},c.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]r||e!=e)throw new TypeError("Bad key length")}},function(t,e){var r;if(process.browser)r="utf-8";else if(process.version){r=parseInt(process.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else r="utf-8";t.exports=r},function(t,e,r){var n=r(19).Buffer;t.exports=function(t,e,r){if(n.isBuffer(t))return t;if("string"==typeof t)return n.from(t,e);if(ArrayBuffer.isView(t))return n.from(t.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}},function(t,e,r){"use strict";var n=r(4);function i(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,r){if(!e)return t;var o;if(r)o=r(e);else if(n.isURLSearchParams(e))o=e.toString();else{var a=[];n.forEach(e,(function(t,e){null!=t&&(n.isArray(t)?e+="[]":t=[t],n.forEach(t,(function(t){n.isDate(t)?t=t.toISOString():n.isObject(t)&&(t=JSON.stringify(t)),a.push(i(e)+"="+i(t))})))})),o=a.join("&")}if(o){var s=t.indexOf("#");-1!==s&&(t=t.slice(0,s)),t+=(-1===t.indexOf("?")?"?":"&")+o}return t}},function(t,e,r){"use strict";var n=r(91);t.exports=function(t,e,r,i,o){var a=new Error(t);return n(a,e,r,i,o)}},function(t,e){t.exports=require("stream")},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyKey=void 0;var o=function(t){function e(){return t.call(this,Buffer.from(""))||this}return i(e,t),e.prototype.sign=function(){throw new Error("Key is empty - provide a Key when creating ContractClient to sign transactions.")},e}(r(7).Key);e.EmptyKey=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UST=e.isNativeToken=void 0,e.isNativeToken=function(t){return"native_token"in t},e.UST={native_token:{denom:"uusd"}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Denom=void 0,function(t){t.LUNA="uluna",t.CNY="ucny",t.EUR="ueur",t.GBP="ugbp",t.JPY="ujpy",t.KRW="ukrw",t.MNT="umnt",t.SDR="usdr",t.USD="uusd"}(e.Denom||(e.Denom={}))},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(114),e),i(r(115),e)},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(116),e),i(r(117),e),i(r(118),e),i(r(119),e)},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(120),e),i(r(121),e),i(r(136),e)},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Proposal=void 0;var o=r(3),a=r(54),s=r(55),u=r(56),c=r(0),f=r(2),d=r(57),l=function(t){function e(e,r,n,i,o,a,s,u,c){var f=t.call(this)||this;return f.id=e,f.content=r,f.proposal_status=n,f.final_tally_result=i,f.submit_time=o,f.deposit_end_time=a,f.total_deposit=s,f.voting_start_time=u,f.voting_end_time=c,f}return i(e,t),e.fromData=function(t){var r,n=t.id,i=t.content,a=t.proposal_status,s=t.final_tally_result,u=t.submit_time,c=t.deposit_end_time,d=t.total_deposit,l=t.voting_start_time,h=t.voting_end_time;return s&&(r={yes:new f.Int(s.yes),no:new f.Int(s.no),abstain:new f.Int(s.abstain),no_with_veto:new f.Int(s.no_with_veto)}),new e(Number.parseInt(n),e.Content.fromData(i),a,r,new Date(u),new Date(c),o.Coins.fromData(d),new Date(l),new Date(h))},e.prototype.toData=function(){var t,e=this.proposal_status,r=this.final_tally_result;return r&&(t={yes:r.yes.toString(),no:r.no.toString(),abstain:r.abstain.toString(),no_with_veto:r.no_with_veto.toString()}),{id:this.id.toFixed(),content:this.content.toData(),proposal_status:e,final_tally_result:t,submit_time:this.submit_time.toISOString(),deposit_end_time:this.deposit_end_time.toISOString(),total_deposit:this.total_deposit.toData(),voting_start_time:this.voting_start_time.toISOString(),voting_end_time:this.voting_end_time.toISOString()}},e}(c.JSONSerializable);e.Proposal=l,function(t){!function(t){t.fromData=function(t){switch(t.type){case"gov/TextProposal":return s.TextProposal.fromData(t);case"distribution/CommunityPoolSpendProposal":return a.CommunityPoolSpendProposal.fromData(t);case"treasury/TaxRateUpdateProposal":return u.TaxRateUpdateProposal.fromData(t);case"treasury/RewardWeightUpdateProposal":return u.RewardWeightUpdateProposal.fromData(t);case"params/ParameterChangeProposal":return d.ParameterChangeProposal.fromData(t)}}}(t.Content||(t.Content={})),function(t){t.NIL="",t.DEPOSIT_PERIOD="DepositPeriod",t.VOTING_PERIOD="VotingPeriod",t.PASSED="Passed",t.REJECTED="Rejected",t.FAILED="Failed"}(t.Status||(t.Status={}))}(l=e.Proposal||(e.Proposal={})),e.Proposal=l},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(122),e)},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(123),e)},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(124),e),i(r(125),e)},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(126),e)},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function u(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=s(e)^n>>5}for(e=s(e),r=0;re)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;var o=(t=r).lastIndexOf("1");if(-1===o)return"No separator character for "+t;if(0===o)return"Missing prefix for "+t;var a=t.slice(0,o),c=t.slice(o+1);if(c.length<6)return"Data too short";var f=u(a);if("string"==typeof f)return f;for(var d=[],l=0;l=c.length||d.push(p)}return 1!==f?"Invalid checksum for "+t:{prefix:a,words:d}}function f(t,e,r,n){for(var i=0,o=0,a=(1<=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<=e)return"Excess padding";if(i<r)throw new TypeError("Exceeds length limit");var i=u(t=t.toLowerCase());if("string"==typeof i)throw new Error(i);for(var o=t+"1",a=0;a>5!=0)throw new Error("Non 5-bit word");i=s(i)^c,o+=n.charAt(c)}for(a=0;a<6;++a)i=s(i);for(i^=1,a=0;a<6;++a){o+=n.charAt(i>>5*(5-a)&31)}return o},toWordsUnsafe:function(t){var e=f(t,8,5,!0);if(Array.isArray(e))return e},toWords:function(t){var e=f(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)},fromWordsUnsafe:function(t){var e=f(t,5,8,!1);if(Array.isArray(e))return e},fromWords:function(t){var e=f(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(t,e){return"hex"===e?o(t):t}},function(t,e,r){var n;function i(t){this.rand=t}if(t.exports=function(t){return n||(n=new i(null)),n.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},function(t,e,r){"use strict";var n=r(10),i=r(20),o=r(78),a=r(14),s=n.sum32,u=n.sum32_4,c=n.sum32_5,f=o.ch32,d=o.maj32,l=o.s0_256,h=o.s1_256,p=o.g0_256,b=o.g1_256,y=i.BlockHash,m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}n.inherits(v,y),t.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;nnew Uint8Array(t)),e){return"function"==typeof t&&(t=t(e)),b("output",t,e),t}function v(t){return Object.prototype.toString.call(t).slice(8,-1)}t.exports=t=>({contextRandomize(e){switch(p(null===e||e instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==e&&b("seed",e,32),t.contextRandomize(e)){case 1:throw new Error(o)}},privateKeyVerify:e=>(b("private key",e,32),0===t.privateKeyVerify(e)),privateKeyNegate(e){switch(b("private key",e,32),t.privateKeyNegate(e)){case 0:return e;case 1:throw new Error(r)}},privateKeyTweakAdd(e,r){switch(b("private key",e,32),b("tweak",r,32),t.privateKeyTweakAdd(e,r)){case 0:return e;case 1:throw new Error(n)}},privateKeyTweakMul(e,r){switch(b("private key",e,32),b("tweak",r,32),t.privateKeyTweakMul(e,r)){case 0:return e;case 1:throw new Error(i)}},publicKeyVerify:e=>(b("public key",e,[33,65]),0===t.publicKeyVerify(e)),publicKeyCreate(e,r=!0,n){switch(b("private key",e,32),y(r),n=m(n,r?33:65),t.publicKeyCreate(n,e)){case 0:return n;case 1:throw new Error(a);case 2:throw new Error(u)}},publicKeyConvert(e,r=!0,n){switch(b("public key",e,[33,65]),y(r),n=m(n,r?33:65),t.publicKeyConvert(n,e)){case 0:return n;case 1:throw new Error(s);case 2:throw new Error(u)}},publicKeyNegate(e,n=!0,i){switch(b("public key",e,[33,65]),y(n),i=m(i,n?33:65),t.publicKeyNegate(i,e)){case 0:return i;case 1:throw new Error(s);case 2:throw new Error(r);case 3:throw new Error(u)}},publicKeyCombine(e,r=!0,n){p(Array.isArray(e),"Expected public keys to be an Array"),p(e.length>0,"Expected public keys array will have more than zero items");for(const t of e)b("public key",t,[33,65]);switch(y(r),n=m(n,r?33:65),t.publicKeyCombine(n,e)){case 0:return n;case 1:throw new Error(s);case 2:throw new Error(c);case 3:throw new Error(u)}},publicKeyTweakAdd(e,r,i=!0,o){switch(b("public key",e,[33,65]),b("tweak",r,32),y(i),o=m(o,i?33:65),t.publicKeyTweakAdd(o,e,r)){case 0:return o;case 1:throw new Error(s);case 2:throw new Error(n)}},publicKeyTweakMul(e,r,n=!0,o){switch(b("public key",e,[33,65]),b("tweak",r,32),y(n),o=m(o,n?33:65),t.publicKeyTweakMul(o,e,r)){case 0:return o;case 1:throw new Error(s);case 2:throw new Error(i)}},signatureNormalize(e){switch(b("signature",e,64),t.signatureNormalize(e)){case 0:return e;case 1:throw new Error(f)}},signatureExport(e,n){b("signature",e,64);const i={output:n=m(n,72),outputlen:72};switch(t.signatureExport(i,e)){case 0:return n.slice(0,i.outputlen);case 1:throw new Error(f);case 2:throw new Error(r)}},signatureImport(e,n){switch(b("signature",e),n=m(n,64),t.signatureImport(n,e)){case 0:return n;case 1:throw new Error(f);case 2:throw new Error(r)}},ecdsaSign(e,n,i={},o){b("message",e,32),b("private key",n,32),p("Object"===v(i),"Expected options to be an Object"),void 0!==i.data&&b("options.data",i.data),void 0!==i.noncefn&&p("Function"===v(i.noncefn),"Expected options.noncefn to be a Function");const a={signature:o=m(o,64),recid:null};switch(t.ecdsaSign(a,e,n,i.data,i.noncefn)){case 0:return a;case 1:throw new Error(d);case 2:throw new Error(r)}},ecdsaVerify(e,r,n){switch(b("signature",e,64),b("message",r,32),b("public key",n,[33,65]),t.ecdsaVerify(e,r,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(f);case 2:throw new Error(s)}},ecdsaRecover(e,n,i,o=!0,a){switch(b("signature",e,64),p("Number"===v(n)&&n>=0&&n<=3,"Expected recovery id to be a Number within interval [0, 3]"),b("message",i,32),y(o),a=m(a,o?33:65),t.ecdsaRecover(a,e,n,i)){case 0:return a;case 1:throw new Error(f);case 2:throw new Error(l);case 3:throw new Error(r)}},ecdh(e,r,n={},i){switch(b("public key",e,[33,65]),b("private key",r,32),p("Object"===v(n),"Expected options to be an Object"),void 0!==n.data&&b("options.data",n.data),void 0!==n.hashfn?(p("Function"===v(n.hashfn),"Expected options.hashfn to be a Function"),void 0!==n.xbuf&&b("options.xbuf",n.xbuf,32),void 0!==n.ybuf&&b("options.ybuf",n.ybuf,32),b("output",i)):i=m(i,32),t.ecdh(i,e,r,n.data,n.hashfn,n.xbuf,n.ybuf)){case 0:return i;case 1:throw new Error(s);case 2:throw new Error(h)}}})},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r=200&&t<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(t){u.headers[t]={}})),n.forEach(["post","put","patch"],(function(t){u.headers[t]=n.merge(o)})),t.exports=u},function(t,e,r){"use strict";var n=r(45);t.exports=function(t,e,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?e(n("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)}},function(t,e,r){"use strict";t.exports=function(t,e,r,n,i){return t.config=e,r&&(t.code=r),t.request=n,t.response=i,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}},function(t,e,r){"use strict";var n=r(227),i=r(228);t.exports=function(t,e){return t&&!n(e)?i(t,e):e}},function(t,e){t.exports=require("http")},function(t,e){t.exports=require("https")},function(t,e,r){var n=r(96),i=n.URL,o=r(93),a=r(94),s=r(46).Writable,u=r(232),c=r(233),f=Object.create(null);["abort","aborted","connect","error","socket","timeout"].forEach((function(t){f[t]=function(e,r,n){this._redirectable.emit(t,e,r,n)}}));var d=x("ERR_FR_REDIRECTION_FAILURE",""),l=x("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),h=x("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),p=x("ERR_STREAM_WRITE_AFTER_END","write after end");function b(t,e){s.call(this),this._sanitizeOptions(t),this._options=t,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var r=this;this._onNativeResponse=function(t){r._processResponse(t)},this._performRequest()}function y(t,e){clearTimeout(t._timeout),t._timeout=setTimeout((function(){t.emit("timeout")}),e)}function m(){clearTimeout(this._timeout)}function v(t){var e={maxRedirects:21,maxBodyLength:10485760},r={};return Object.keys(t).forEach((function(o){var a=o+":",s=r[a]=t[o],f=e[o]=Object.create(s);f.request=function(t,o,s){if("string"==typeof t){var f=t;try{t=_(new i(f))}catch(e){t=n.parse(f)}}else i&&t instanceof i?t=_(t):(s=o,o=t,t={protocol:a});return"function"==typeof o&&(s=o,o=null),(o=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},t,o)).nativeProtocols=r,u.equal(o.protocol,a,"protocol mismatch"),c("options",o),new b(o,s)},f.get=function(t,e,r){var n=f.request(t,e,r);return n.end(),n}})),e}function g(){}function _(t){var e={protocol:t.protocol,hostname:t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,hash:t.hash,search:t.search,pathname:t.pathname,path:t.pathname+t.search,href:t.href};return""!==t.port&&(e.port=Number(t.port)),e}function w(t,e){var r;for(var n in e)t.test(n)&&(r=e[n],delete e[n]);return r}function x(t,e){function r(t){Error.captureStackTrace(this,this.constructor),this.message=t||e}return r.prototype=new Error,r.prototype.constructor=r,r.prototype.name="Error ["+t+"]",r.prototype.code=t,r}b.prototype=Object.create(s.prototype),b.prototype.write=function(t,e,r){if(this._ending)throw new p;if(!("string"==typeof t||"object"==typeof t&&"length"in t))throw new TypeError("data should be a string, Buffer or Uint8Array");"function"==typeof e&&(r=e,e=null),0!==t.length?this._requestBodyLength+t.length<=this._options.maxBodyLength?(this._requestBodyLength+=t.length,this._requestBodyBuffers.push({data:t,encoding:e}),this._currentRequest.write(t,e,r)):(this.emit("error",new h),this.abort()):r&&r()},b.prototype.end=function(t,e,r){if("function"==typeof t?(r=t,t=e=null):"function"==typeof e&&(r=e,e=null),t){var n=this,i=this._currentRequest;this.write(t,e,(function(){n._ended=!0,i.end(null,null,r)})),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,r)},b.prototype.setHeader=function(t,e){this._options.headers[t]=e,this._currentRequest.setHeader(t,e)},b.prototype.removeHeader=function(t){delete this._options.headers[t],this._currentRequest.removeHeader(t)},b.prototype.setTimeout=function(t,e){if(e&&this.once("timeout",e),this.socket)y(this,t);else{var r=this;this._currentRequest.once("socket",(function(){y(r,t)}))}return this.once("response",m),this.once("error",m),this},["abort","flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(t){b.prototype[t]=function(e,r){return this._currentRequest[t](e,r)}})),["aborted","connection","socket"].forEach((function(t){Object.defineProperty(b.prototype,t,{get:function(){return this._currentRequest[t]}})})),b.prototype._sanitizeOptions=function(t){if(t.headers||(t.headers={}),t.host&&(t.hostname||(t.hostname=t.host),delete t.host),!t.pathname&&t.path){var e=t.path.indexOf("?");e<0?t.pathname=t.path:(t.pathname=t.path.substring(0,e),t.search=t.path.substring(e))}},b.prototype._performRequest=function(){var t=this._options.protocol,e=this._options.nativeProtocols[t];if(e){if(this._options.agents){var r=t.substr(0,t.length-1);this._options.agent=this._options.agents[r]}var i=this._currentRequest=e.request(this._options,this._onNativeResponse);for(var o in this._currentUrl=n.format(this._options),i._redirectable=this,f)o&&i.on(o,f[o]);if(this._isRedirect){var a=0,s=this,u=this._requestBodyBuffers;!function t(e){if(i===s._currentRequest)if(e)s.emit("error",e);else if(a=300&&e<400){if(this._currentRequest.removeAllListeners(),this._currentRequest.on("error",g),this._currentRequest.abort(),t.destroy(),++this._redirectCount>this._options.maxRedirects)return void this.emit("error",new l);((301===e||302===e)&&"POST"===this._options.method||303===e&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],w(/^content-/i,this._options.headers));var i=w(/^host$/i,this._options.headers)||n.parse(this._currentUrl).hostname,o=n.resolve(this._currentUrl,r);c("redirecting to",o),this._isRedirect=!0;var a=n.parse(o);if(Object.assign(this._options,a),a.hostname!==i&&w(/^authorization$/i,this._options.headers),"function"==typeof this._options.beforeRedirect){var s={headers:t.headers};try{this._options.beforeRedirect.call(null,this._options,s)}catch(t){return void this.emit("error",t)}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(t){var u=new d("Redirected request failed: "+t.message);u.cause=t,this.emit("error",u)}}else t.responseUrl=this._currentUrl,t.redirects=this._redirects,this.emit("response",t),this._requestBodyBuffers=[]},t.exports=v({http:o,https:a}),t.exports.wrap=v},function(t,e){t.exports=require("url")},function(t,e,r){var n;function i(t){function r(){if(r.enabled){var t=r,i=+new Date,o=i-(n||i);t.diff=o,t.prev=n,t.curr=i,n=i;for(var a=new Array(arguments.length),s=0;s0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),n?a.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):_(t,a,e,!0):a.ended?t.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?_(t,a,e,!1):S(t,a)):_(t,a,e,!1))):n||(a.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=8388608?t=8388608:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function x(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(l("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?n.nextTick(M,t):M(t))}function M(t){l("emit readable"),t.emit("readable"),A(t)}function S(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(O,t,e))}function O(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;to.length?o.length:t;if(a===o.length?i+=o:i+=o.slice(0,t),0===(t-=a)){a===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=u.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,a),0===(t-=a)){a===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(a));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function E(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,n.nextTick(D,e,t))}function D(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function C(t,e){for(var r=0,n=t.length;r=e.highWaterMark||e.ended))return l("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?E(this):x(this),null;if(0===(t=w(t,e))&&e.ended)return 0===e.length&&E(this),null;var n,i=e.needReadable;return l("need readable",i),(0===e.length||e.length-t0?j(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&E(this)),null!==n&&this.emit("data",n),n},v.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,l("pipe count=%d opts=%j",i.pipesCount,e);var s=(!e||!1!==e.end)&&t!==process.stdout&&t!==process.stderr?c:v;function u(e,n){l("onunpipe"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,l("cleanup"),t.removeListener("close",y),t.removeListener("finish",m),t.removeListener("drain",f),t.removeListener("error",b),t.removeListener("unpipe",u),r.removeListener("end",c),r.removeListener("end",v),r.removeListener("data",p),d=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}function c(){l("onend"),t.end()}i.endEmitted?n.nextTick(s):r.once("end",s),t.on("unpipe",u);var f=function(t){return function(){var e=t._readableState;l("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,A(t))}}(r);t.on("drain",f);var d=!1;var h=!1;function p(e){l("ondata"),h=!1,!1!==t.write(e)||h||((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==C(i.pipes,t))&&!d&&(l("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,h=!0),r.pause())}function b(e){l("onerror",e),v(),t.removeListener("error",b),0===a(t,"error")&&t.emit("error",e)}function y(){t.removeListener("finish",m),v()}function m(){l("onfinish"),t.removeListener("close",y),v()}function v(){l("unpipe"),r.unpipe(t)}return r.on("data",p),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?o(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",b),t.once("close",y),t.once("finish",m),t.emit("pipe",r),i.flowing||(l("pipe resume"),r.resume()),t},v.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o-1?setImmediate:n.nextTick;y.WritableState=b;var s=Object.create(r(21));s.inherits=r(12);var u={deprecate:r(267)},c=r(103),f=r(27).Buffer,d=global.Uint8Array||function(){};var l,h=r(104);function p(){}function b(t,e){o=o||r(17),t=t||{};var s=e instanceof o;this.objectMode=!!t.objectMode,s&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var u=t.highWaterMark,c=t.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=u||0===u?u:s&&(c||0===c)?c:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var d=!1===t.decodeStrings;this.decodeStrings=!d,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,i=r.sync,o=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,i,o){--e.pendingcb,r?(n.nextTick(o,i),n.nextTick(x,t,e),t._writableState.errorEmitted=!0,t.emit("error",i)):(o(i),t._writableState.errorEmitted=!0,t.emit("error",i),x(t,e))}(t,r,i,e,o);else{var s=_(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||g(t,r),i?a(v,t,r,s,o):v(t,r,s,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function y(t){if(o=o||r(17),!(l.call(y,this)||this instanceof o))return new y(t);this._writableState=new b(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),c.call(this)}function m(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function v(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),x(t,e)}function g(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,o=new Array(n),a=e.corkedRequestsFree;a.entry=r;for(var s=0,u=!0;r;)o[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;o.allBuffers=u,m(t,e,!0,e.length,o,"",a.finish),e.pendingcb++,e.lastBufferedRequest=null,a.next?(e.corkedRequestsFree=a.next,a.next=null):e.corkedRequestsFree=new i(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,d=r.callback;if(m(t,e,!1,e.objectMode?1:c.length,c,f,d),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function _(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function w(t,e){t._final((function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),x(t,e)}))}function x(t,e){var r=_(e);return r&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,n.nextTick(w,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}s.inherits(y,c),b.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(b.prototype,"buffer",{get:u.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(l=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(t){return!!l.call(this,t)||this===y&&(t&&t._writableState instanceof b)}})):l=function(t){return t instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(t,e,r){var i,o=this._writableState,a=!1,s=!o.objectMode&&(i=t,f.isBuffer(i)||i instanceof d);return s&&!f.isBuffer(t)&&(t=function(t){return f.from(t)}(t)),"function"==typeof e&&(r=e,e=null),s?e="buffer":e||(e=o.defaultEncoding),"function"!=typeof r&&(r=p),o.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),n.nextTick(e,r)}(this,r):(s||function(t,e,r,i){var o=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(t.emit("error",a),n.nextTick(i,a),o=!1),o}(this,o,t,r))&&(o.pendingcb++,a=function(t,e,r,n,i,o){if(!r){var a=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=f.from(e,r));return e}(e,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=e.objectMode?1:n.length;e.length+=s;var u=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(t,e,r){var i=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||function(t,e,r){e.ending=!0,x(t,e),r&&(e.finished?n.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,i,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),y.prototype.destroy=h.destroy,y.prototype._undestroy=h.undestroy,y.prototype._destroy=function(t,e){this.end(),e(t)}},function(t,e,r){"use strict";var n=r(27).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=c,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=f,this.end=d,e=3;break;default:return this.write=l,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function d(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l(t){return t.toString(this.encoding)}function h(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,r){"use strict";t.exports=a;var n=r(17),i=Object.create(r(21));function o(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length0){for(o+=a,e=1;er)throw Error(d+t)}function S(t,e,r,n){var i,o,a,s;for(o=t[0];o>=10;o/=10)--e;return--e<0?(e+=7,i=0):(i=Math.ceil((e+1)/7),e%=7),o=h(10,7-e),s=t[i]%o|0,null==n?e<3?(0==e?s=s/100|0:1==e&&(s=s/10|0),a=r<4&&99999==s||r>3&&49999==s||5e4==s||0==s):a=(r<4&&s+1==o||r>3&&s+1==o/2)&&(t[i+1]/o/100|0)==h(10,e-2)-1||(s==o/2||0==s)&&0==(t[i+1]/o/100|0):e<4?(0==e?s=s/1e3|0:1==e?s=s/100|0:2==e&&(s=s/10|0),a=(n||r<4)&&9999==s||!n&&r>3&&4999==s):a=((n||r<4)&&s+1==o||!n&&r>3&&s+1==o/2)&&(t[i+1]/o/1e3|0)==h(10,e-3)-1,a}function O(t,e,r){for(var n,i,o=[0],s=0,u=t.length;sr-1&&(void 0===o[n+1]&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}w.absoluteValue=w.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),P(t)},w.ceil=function(){return P(new this.constructor(this),this.e+1,2)},w.comparedTo=w.cmp=function(t){var e,r,n,i,o=this,a=o.d,s=(t=new o.constructor(t)).d,u=o.s,c=t.s;if(!a||!s)return u&&c?u!==c?u:a===s?0:!a^u<0?1:-1:NaN;if(!a[0]||!s[0])return a[0]?u:s[0]?-c:0;if(u!==c)return u;if(o.e!==t.e)return o.e>t.e^u<0?1:-1;for(e=0,r=(n=a.length)<(i=s.length)?n:i;es[e]^u<0?1:-1;return n===i?0:n>i^u<0?1:-1},w.cosine=w.cos=function(){var t,e,r=this,n=r.constructor;return r.d?r.d[0]?(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(t,e){var r,n,i=e.d.length;i<32?(r=Math.ceil(i/3),n=(1/K(4,r)).toString()):(r=16,n="2.3283064365386962890625e-10");t.precision+=r,e=F(t,1,e.times(n),new t(1));for(var o=r;o--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return t.precision-=r,e}(n,J(n,r)),n.precision=t,n.rounding=e,P(2==i||3==i?r.neg():r,t,e,!0)):new n(1):new n(NaN)},w.cubeRoot=w.cbrt=function(){var t,e,r,n,i,o,a,s,u,c,d=this,p=d.constructor;if(!d.isFinite()||d.isZero())return new p(d);for(f=!1,(o=d.s*h(d.s*d,1/3))&&Math.abs(o)!=1/0?n=new p(o.toString()):(r=x(d.d),(o=((t=d.e)-r.length+1)%3)&&(r+=1==o||-2==o?"0":"00"),o=h(r,1/3),t=l((t+1)/3)-(t%3==(t<0?-1:2)),(n=new p(r=o==1/0?"5e"+t:(r=o.toExponential()).slice(0,r.indexOf("e")+1)+t)).s=d.s),a=(t=p.precision)+3;;)if(c=(u=(s=n).times(s).times(s)).plus(d),n=k(c.plus(d).times(s),c.plus(u),a+2,1),x(s.d).slice(0,a)===(r=x(n.d)).slice(0,a)){if("9999"!=(r=r.slice(a-3,a+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(P(n,t+1,1),e=!n.times(n).times(n).eq(d));break}if(!i&&(P(s,t+1,0),s.times(s).times(s).eq(d))){n=s;break}a+=4,i=1}return f=!0,P(n,t,p.rounding,e)},w.decimalPlaces=w.dp=function(){var t,e=this.d,r=NaN;if(e){if(r=7*((t=e.length-1)-l(this.e/7)),t=e[t])for(;t%10==0;t/=10)r--;r<0&&(r=0)}return r},w.dividedBy=w.div=function(t){return k(this,new this.constructor(t))},w.dividedToIntegerBy=w.divToInt=function(t){var e=this.constructor;return P(k(this,new e(t),0,1,1),e.precision,e.rounding)},w.equals=w.eq=function(t){return 0===this.cmp(t)},w.floor=function(){return P(new this.constructor(this),this.e+1,3)},w.greaterThan=w.gt=function(t){return this.cmp(t)>0},w.greaterThanOrEqualTo=w.gte=function(t){var e=this.cmp(t);return 1==e||0===e},w.hyperbolicCosine=w.cosh=function(){var t,e,r,n,i,o=this,a=o.constructor,s=new a(1);if(!o.isFinite())return new a(o.s?1/0:NaN);if(o.isZero())return s;r=a.precision,n=a.rounding,a.precision=r+Math.max(o.e,o.sd())+4,a.rounding=1,(i=o.d.length)<32?e=(1/K(4,t=Math.ceil(i/3))).toString():(t=16,e="2.3283064365386962890625e-10"),o=F(a,1,o.times(e),new a(1),!0);for(var u,c=t,f=new a(8);c--;)u=o.times(o),o=s.minus(u.times(f.minus(u.times(f))));return P(o,a.precision=r,a.rounding=n,!0)},w.hyperbolicSine=w.sinh=function(){var t,e,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(e=o.precision,r=o.rounding,o.precision=e+Math.max(i.e,i.sd())+4,o.rounding=1,(n=i.d.length)<3)i=F(o,2,i,i,!0);else{t=(t=1.4*Math.sqrt(n))>16?16:0|t,i=F(o,2,i=i.times(1/K(5,t)),i,!0);for(var a,s=new o(5),u=new o(16),c=new o(20);t--;)a=i.times(i),i=i.times(s.plus(a.times(u.times(a).plus(c))))}return o.precision=e,o.rounding=r,P(i,e,r,!0)},w.hyperbolicTangent=w.tanh=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+7,n.rounding=1,k(r.sinh(),r.cosh(),n.precision=t,n.rounding=e)):new n(r.s)},w.inverseCosine=w.acos=function(){var t,e=this,r=e.constructor,n=e.abs().cmp(1),i=r.precision,o=r.rounding;return-1!==n?0===n?e.isNeg()?D(r,i,o):new r(0):new r(NaN):e.isZero()?D(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,e=e.asin(),t=D(r,i+4,o).times(.5),r.precision=i,r.rounding=o,t.minus(e))},w.inverseHyperbolicCosine=w.acosh=function(){var t,e,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(t=n.precision,e=n.rounding,n.precision=t+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,f=!1,r=r.times(r).minus(1).sqrt().plus(r),f=!0,n.precision=t,n.rounding=e,r.ln()):new n(r)},w.inverseHyperbolicSine=w.asinh=function(){var t,e,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,f=!1,r=r.times(r).plus(1).sqrt().plus(r),f=!0,n.precision=t,n.rounding=e,r.ln())},w.inverseHyperbolicTangent=w.atanh=function(){var t,e,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=o.precision,e=o.rounding,n=i.sd(),Math.max(n,t)<2*-i.e-1?P(new o(i),t,e,!0):(o.precision=r=n-i.e,i=k(i.plus(1),new o(1).minus(i),r+t,1),o.precision=t+4,o.rounding=1,i=i.ln(),o.precision=t,o.rounding=e,i.times(.5))):new o(NaN)},w.inverseSine=w.asin=function(){var t,e,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(e=i.abs().cmp(1),r=o.precision,n=o.rounding,-1!==e?0===e?((t=D(o,r+4,n).times(.5)).s=i.s,t):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))},w.inverseTangent=w.atan=function(){var t,e,r,n,i,o,a,s,u,c=this,d=c.constructor,l=d.precision,h=d.rounding;if(c.isFinite()){if(c.isZero())return new d(c);if(c.abs().eq(1)&&l+4<=_)return(a=D(d,l+4,h).times(.25)).s=c.s,a}else{if(!c.s)return new d(NaN);if(l+4<=_)return(a=D(d,l+4,h).times(.5)).s=c.s,a}for(d.precision=s=l+10,d.rounding=1,t=r=Math.min(28,s/7+2|0);t;--t)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(f=!1,e=Math.ceil(s/7),n=1,u=c.times(c),a=new d(c),i=c;-1!==t;)if(i=i.times(u),o=a.minus(i.div(n+=2)),i=i.times(u),void 0!==(a=o.plus(i.div(n+=2))).d[e])for(t=e;a.d[t]===o.d[t]&&t--;);return r&&(a=a.times(2<this.d.length-2},w.isNaN=function(){return!this.s},w.isNegative=w.isNeg=function(){return this.s<0},w.isPositive=w.isPos=function(){return this.s>0},w.isZero=function(){return!!this.d&&0===this.d[0]},w.lessThan=w.lt=function(t){return this.cmp(t)<0},w.lessThanOrEqualTo=w.lte=function(t){return this.cmp(t)<1},w.logarithm=w.log=function(t){var e,r,n,i,o,a,s,u,c=this.constructor,d=c.precision,l=c.rounding;if(null==t)t=new c(10),e=!0;else{if(r=(t=new c(t)).d,t.s<0||!r||!r[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(r=this.d,this.s<0||!r||!r[0]||this.eq(1))return new c(r&&!r[0]?-1/0:1!=this.s?NaN:r?0:1/0);if(e)if(r.length>1)o=!0;else{for(i=r[0];i%10==0;)i/=10;o=1!==i}if(f=!1,a=z(this,s=d+5),n=e?E(c,s+10):z(t,s),S((u=k(a,n,s,1)).d,i=d,l))do{if(a=z(this,s+=10),n=e?E(c,s+10):z(t,s),u=k(a,n,s,1),!o){+x(u.d).slice(i+1,i+15)+1==1e14&&(u=P(u,d+1,0));break}}while(S(u.d,i+=10,l));return f=!0,P(u,d,l)},w.minus=w.sub=function(t){var e,r,n,i,o,a,s,u,c,d,h,p,b=this,y=b.constructor;if(t=new y(t),!b.d||!t.d)return b.s&&t.s?b.d?t.s=-t.s:t=new y(t.d||b.s!==t.s?b:NaN):t=new y(NaN),t;if(b.s!=t.s)return t.s=-t.s,b.plus(t);if(c=b.d,p=t.d,s=y.precision,u=y.rounding,!c[0]||!p[0]){if(p[0])t.s=-t.s;else{if(!c[0])return new y(3===u?-0:0);t=new y(b)}return f?P(t,s,u):t}if(r=l(t.e/7),d=l(b.e/7),c=c.slice(),o=d-r){for((h=o<0)?(e=c,o=-o,a=p.length):(e=p,r=d,a=c.length),o>(n=Math.max(Math.ceil(s/7),a)+2)&&(o=n,e.length=1),e.reverse(),n=o;n--;)e.push(0);e.reverse()}else{for((h=(n=c.length)<(a=p.length))&&(a=n),n=0;n0;--n)c[a++]=0;for(n=p.length;n>o;){if(c[--n](a=(o=Math.ceil(s/7))>a?o+1:a+1)&&(i=a,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for((a=c.length)-(i=d.length)<0&&(i=a,r=d,d=c,c=r),e=0;i;)e=(c[--i]=c[i]+d[i]+e)/v|0,c[i]%=v;for(e&&(c.unshift(e),++n),a=c.length;0==c[--a];)c.pop();return t.d=c,t.e=j(c,n),f?P(t,s,u):t},w.precision=w.sd=function(t){var e,r=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(d+t);return r.d?(e=C(r.d),t&&r.e+1>e&&(e=r.e+1)):e=NaN,e},w.round=function(){var t=this,e=t.constructor;return P(new e(t),t.e+1,e.rounding)},w.sine=w.sin=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(t,e){var r,n=e.d.length;if(n<3)return F(t,2,e,e);r=(r=1.4*Math.sqrt(n))>16?16:0|r,e=e.times(1/K(5,r)),e=F(t,2,e,e);for(var i,o=new t(5),a=new t(16),s=new t(20);r--;)i=e.times(e),e=e.times(o.plus(i.times(a.times(i).minus(s))));return e}(n,J(n,r)),n.precision=t,n.rounding=e,P(i>2?r.neg():r,t,e,!0)):new n(NaN)},w.squareRoot=w.sqrt=function(){var t,e,r,n,i,o,a=this,s=a.d,u=a.e,c=a.s,d=a.constructor;if(1!==c||!s||!s[0])return new d(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);for(f=!1,0==(c=Math.sqrt(+a))||c==1/0?(((e=x(s)).length+u)%2==0&&(e+="0"),c=Math.sqrt(e),u=l((u+1)/2)-(u<0||u%2),n=new d(e=c==1/0?"5e"+u:(e=c.toExponential()).slice(0,e.indexOf("e")+1)+u)):n=new d(c.toString()),r=(u=d.precision)+3;;)if(n=(o=n).plus(k(a,o,r+2,1)).times(.5),x(o.d).slice(0,r)===(e=x(n.d)).slice(0,r)){if("9999"!=(e=e.slice(r-3,r+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(P(n,u+1,1),t=!n.times(n).eq(a));break}if(!i&&(P(o,u+1,0),o.times(o).eq(a))){n=o;break}r+=4,i=1}return f=!0,P(n,u,d.rounding,t)},w.tangent=w.tan=function(){var t,e,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(t=n.precision,e=n.rounding,n.precision=t+10,n.rounding=1,(r=r.sin()).s=1,r=k(r,new n(1).minus(r.times(r)).sqrt(),t+10,0),n.precision=t,n.rounding=e,P(2==i||4==i?r.neg():r,t,e,!0)):new n(NaN)},w.times=w.mul=function(t){var e,r,n,i,o,a,s,u,c,d=this,h=d.constructor,p=d.d,b=(t=new h(t)).d;if(t.s*=d.s,!(p&&p[0]&&b&&b[0]))return new h(!t.s||p&&!p[0]&&!b||b&&!b[0]&&!p?NaN:p&&b?0*t.s:t.s/0);for(r=l(d.e/7)+l(t.e/7),(u=p.length)<(c=b.length)&&(o=p,p=b,b=o,a=u,u=c,c=a),o=[],n=a=u+c;n--;)o.push(0);for(n=c;--n>=0;){for(e=0,i=u+n;i>n;)s=o[i]+b[n]*p[i-n-1]+e,o[i--]=s%v|0,e=s/v|0;o[i]=(o[i]+e)%v|0}for(;!o[--a];)o.pop();return e?++r:o.shift(),t.d=o,t.e=j(o,r),f?P(t,h.precision,h.rounding):t},w.toBinary=function(t,e){return V(this,2,t,e)},w.toDecimalPlaces=w.toDP=function(t,e){var r=this,n=r.constructor;return r=new n(r),void 0===t?r:(M(t,0,1e9),void 0===e?e=n.rounding:M(e,0,8),P(r,t+r.e+1,e))},w.toExponential=function(t,e){var r,n=this,i=n.constructor;return void 0===t?r=A(n,!0):(M(t,0,1e9),void 0===e?e=i.rounding:M(e,0,8),r=A(n=P(new i(n),t+1,e),!0,t+1)),n.isNeg()&&!n.isZero()?"-"+r:r},w.toFixed=function(t,e){var r,n,i=this,o=i.constructor;return void 0===t?r=A(i):(M(t,0,1e9),void 0===e?e=o.rounding:M(e,0,8),r=A(n=P(new o(i),t+i.e+1,e),!1,t+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r},w.toFraction=function(t){var e,r,n,i,o,a,s,u,c,l,p,b,y=this,m=y.d,v=y.constructor;if(!m)return new v(y);if(c=r=new v(1),n=u=new v(0),a=(o=(e=new v(n)).e=C(m)-y.e-1)%7,e.d[0]=h(10,a<0?7+a:a),null==t)t=o>0?e:c;else{if(!(s=new v(t)).isInt()||s.lt(c))throw Error(d+s);t=s.gt(e)?o>0?e:c:s}for(f=!1,s=new v(x(m)),l=v.precision,v.precision=o=7*m.length*2;p=k(s,e,0,1,1),1!=(i=r.plus(p.times(n))).cmp(t);)r=n,n=i,i=c,c=u.plus(p.times(i)),u=i,i=e,e=s.minus(p.times(i)),s=i;return i=k(t.minus(r),n,0,1,1),u=u.plus(i.times(c)),r=r.plus(i.times(n)),u.s=c.s=y.s,b=k(c,n,o,1).minus(y).abs().cmp(k(u,r,o,1).minus(y).abs())<1?[c,n]:[u,r],v.precision=l,f=!0,b},w.toHexadecimal=w.toHex=function(t,e){return V(this,16,t,e)},w.toNearest=function(t,e){var r=this,n=r.constructor;if(r=new n(r),null==t){if(!r.d)return r;t=new n(1),e=n.rounding}else{if(t=new n(t),void 0===e?e=n.rounding:M(e,0,8),!r.d)return t.s?r:t;if(!t.d)return t.s&&(t.s=r.s),t}return t.d[0]?(f=!1,r=k(r,t,0,e,1).times(t),f=!0,P(r)):(t.s=r.s,r=t),r},w.toNumber=function(){return+this},w.toOctal=function(t,e){return V(this,8,t,e)},w.toPower=w.pow=function(t){var e,r,n,i,o,a,s=this,u=s.constructor,c=+(t=new u(t));if(!(s.d&&t.d&&s.d[0]&&t.d[0]))return new u(h(+s,c));if((s=new u(s)).eq(1))return s;if(n=u.precision,o=u.rounding,t.eq(1))return P(s,n,o);if((e=l(t.e/7))>=t.d.length-1&&(r=c<0?-c:c)<=9007199254740991)return i=I(u,s,r,n),t.s<0?new u(1).div(i):P(i,n,o);if((a=s.s)<0){if(eu.maxE+1||e0?a/0:0):(f=!1,u.rounding=s.s=1,r=Math.min(12,(e+"").length),(i=q(t.times(z(s,n+r)),n)).d&&S((i=P(i,n+5,1)).d,n,o)&&(e=n+10,+x((i=P(q(t.times(z(s,e+r)),e),e+5,1)).d).slice(n+1,n+15)+1==1e14&&(i=P(i,n+1,0))),i.s=a,f=!0,u.rounding=o,P(i,n,o))},w.toPrecision=function(t,e){var r,n=this,i=n.constructor;return void 0===t?r=A(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(M(t,1,1e9),void 0===e?e=i.rounding:M(e,0,8),r=A(n=P(new i(n),t,e),t<=n.e||n.e<=i.toExpNeg,t)),n.isNeg()&&!n.isZero()?"-"+r:r},w.toSignificantDigits=w.toSD=function(t,e){var r=this.constructor;return void 0===t?(t=r.precision,e=r.rounding):(M(t,1,1e9),void 0===e?e=r.rounding:M(e,0,8)),P(new r(this),t,e)},w.toString=function(){var t=this,e=t.constructor,r=A(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+r:r},w.truncated=w.trunc=function(){return P(new this.constructor(this),this.e+1,1)},w.valueOf=w.toJSON=function(){var t=this,e=t.constructor,r=A(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+r:r};var k=function(){function t(t,e,r){var n,i=0,o=t.length;for(t=t.slice();o--;)n=t[o]*e+i,t[o]=n%r|0,i=n/r|0;return i&&t.unshift(i),t}function e(t,e,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;ie[i]?1:-1;break}return o}function r(t,e,r,n){for(var i=0;r--;)t[r]-=i,i=t[r]1;)t.shift()}return function(i,o,a,s,u,c){var f,d,h,p,b,y,m,g,_,w,x,M,S,O,k,A,j,E,D,C,N=i.constructor,I=i.s==o.s?1:-1,T=i.d,R=o.d;if(!(T&&T[0]&&R&&R[0]))return new N(i.s&&o.s&&(T?!R||T[0]!=R[0]:R)?T&&0==T[0]||!R?0*I:I/0:NaN);for(c?(b=1,d=i.e-o.e):(c=v,b=7,d=l(i.e/b)-l(o.e/b)),D=R.length,j=T.length,w=(_=new N(I)).d=[],h=0;R[h]==(T[h]||0);h++);if(R[h]>(T[h]||0)&&d--,null==a?(O=a=N.precision,s=N.rounding):O=u?a+(i.e-o.e)+1:a,O<0)w.push(1),y=!0;else{if(O=O/b+2|0,h=0,1==D){for(p=0,R=R[0],O++;(h1&&(R=t(R,p,c),T=t(T,p,c),D=R.length,j=T.length),A=D,M=(x=T.slice(0,D)).length;M=c/2&&++E;do{p=0,(f=e(R,x,D,M))<0?(S=x[0],D!=M&&(S=S*c+(x[1]||0)),(p=S/E|0)>1?(p>=c&&(p=c-1),1==(f=e(m=t(R,p,c),x,g=m.length,M=x.length))&&(p--,r(m,D=10;p/=10)h++;_.e=h+d*b-1,P(_,u?a+_.e+1:a,s,y)}return _}}();function P(t,e,r,n){var i,o,a,s,u,c,d,l,p,b=t.constructor;t:if(null!=e){if(!(l=t.d))return t;for(i=1,s=l[0];s>=10;s/=10)i++;if((o=e-i)<0)o+=7,a=e,u=(d=l[p=0])/h(10,i-a-1)%10|0;else if((p=Math.ceil((o+1)/7))>=(s=l.length)){if(!n)break t;for(;s++<=p;)l.push(0);d=u=0,i=1,a=(o%=7)-7+1}else{for(d=s=l[p],i=1;s>=10;s/=10)i++;u=(a=(o%=7)-7+i)<0?0:d/h(10,i-a-1)%10|0}if(n=n||e<0||void 0!==l[p+1]||(a<0?d:d%h(10,i-a-1)),c=r<4?(u||n)&&(0==r||r==(t.s<0?3:2)):u>5||5==u&&(4==r||n||6==r&&(o>0?a>0?d/h(10,i-a):0:l[p-1])%10&1||r==(t.s<0?8:7)),e<1||!l[0])return l.length=0,c?(e-=t.e+1,l[0]=h(10,(7-e%7)%7),t.e=-e||0):l[0]=t.e=0,t;if(0==o?(l.length=p,s=1,p--):(l.length=p+1,s=h(10,7-o),l[p]=a>0?(d/h(10,i-a)%h(10,a)|0)*s:0),c)for(;;){if(0==p){for(o=1,a=l[0];a>=10;a/=10)o++;for(a=l[0]+=s,s=1;a>=10;a/=10)s++;o!=s&&(t.e++,l[0]==v&&(l[0]=1));break}if(l[p]+=s,l[p]!=v)break;l[p--]=0,s=1}for(o=l.length;0===l[--o];)l.pop()}return f&&(t.e>b.maxE?(t.d=null,t.e=NaN):t.e0?o=o.charAt(0)+"."+o.slice(1)+N(n):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(t.e<0?"e":"e+")+t.e):i<0?(o="0."+N(-i-1)+o,r&&(n=r-a)>0&&(o+=N(n))):i>=a?(o+=N(i+1-a),r&&(n=r-i-1)>0&&(o=o+"."+N(n))):((n=i+1)0&&(i+1===a&&(o+="."),o+=N(n))),o}function j(t,e){var r=t[0];for(e*=7;r>=10;r/=10)e++;return e}function E(t,e,r){if(e>g)throw f=!0,r&&(t.precision=r),Error("[DecimalError] Precision limit exceeded");return P(new t(s),e,1,!0)}function D(t,e,r){if(e>_)throw Error("[DecimalError] Precision limit exceeded");return P(new t(u),e,r,!0)}function C(t){var e=t.length-1,r=7*e+1;if(e=t[e]){for(;e%10==0;e/=10)r--;for(e=t[0];e>=10;e/=10)r++}return r}function N(t){for(var e="";t--;)e+="0";return e}function I(t,e,r,n){var i,o=new t(1),a=Math.ceil(n/7+4);for(f=!1;;){if(r%2&&H((o=o.times(e)).d,a)&&(i=!0),0===(r=l(r/2))){r=o.d.length-1,i&&0===o.d[r]&&++o.d[r];break}H((e=e.times(e)).d,a)}return f=!0,o}function T(t){return 1&t.d[t.d.length-1]}function R(t,e,r){for(var n,i=new t(e[0]),o=0;++o17)return new p(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==e?(f=!1,u=y):u=e,s=new p(.03125);t.e>-2;)t=t.times(s),l+=5;for(u+=n=Math.log(h(2,l))/Math.LN10*2+5|0,r=o=a=new p(1),p.precision=u;;){if(o=P(o.times(t),u,1),r=r.times(++d),x((s=a.plus(k(o,r,u,1))).d).slice(0,u)===x(a.d).slice(0,u)){for(i=l;i--;)a=P(a.times(a),u,1);if(null!=e)return p.precision=y,a;if(!(c<3&&S(a.d,u-n,b,c)))return P(a,p.precision=y,b,f=!0);p.precision=u+=10,r=o=s=new p(1),d=0,c++}a=s}}function z(t,e){var r,n,i,o,a,s,u,c,d,l,h,p=1,b=t,y=b.d,m=b.constructor,v=m.rounding,g=m.precision;if(b.s<0||!y||!y[0]||!b.e&&1==y[0]&&1==y.length)return new m(y&&!y[0]?-1/0:1!=b.s?NaN:y?0:b);if(null==e?(f=!1,d=g):d=e,m.precision=d+=10,n=(r=x(y)).charAt(0),!(Math.abs(o=b.e)<15e14))return c=E(m,d+2,g).times(o+""),b=z(new m(n+"."+r.slice(1)),d-10).plus(c),m.precision=g,null==e?P(b,g,v,f=!0):b;for(;n<7&&1!=n||1==n&&r.charAt(1)>3;)n=(r=x((b=b.times(t)).d)).charAt(0),p++;for(o=b.e,n>1?(b=new m("0."+r),o++):b=new m(n+"."+r.slice(1)),l=b,u=a=b=k(b.minus(1),b.plus(1),d,1),h=P(b.times(b),d,1),i=3;;){if(a=P(a.times(h),d,1),x((c=u.plus(k(a,new m(i),d,1))).d).slice(0,d)===x(u.d).slice(0,d)){if(u=u.times(2),0!==o&&(u=u.plus(E(m,d+2,g).times(o+""))),u=k(u,new m(p),d,1),null!=e)return m.precision=g,u;if(!S(u.d,d-10,v,s))return P(u,m.precision=g,v,f=!0);m.precision=d+=10,c=a=b=k(l.minus(1),l.plus(1),d,1),h=P(b.times(b),d,1),i=s=1}u=c,i+=2}}function B(t){return String(t.s*t.s/0)}function U(t,e){var r,n,i;for((r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),n=0;48===e.charCodeAt(n);n++);for(i=e.length;48===e.charCodeAt(i-1);--i);if(e=e.slice(n,i)){if(i-=n,t.e=r=r-n-1,t.d=[],n=(r+1)%7,r<0&&(n+=7),nt.constructor.maxE?(t.d=null,t.e=NaN):t.e0?(u=+e.slice(o+1),e=e.substring(2,o)):e=e.slice(2),a=(o=e.indexOf("."))>=0,n=t.constructor,a&&(o=(s=(e=e.replace(".","")).length)-o,i=I(n,new n(r),o,2*o)),o=l=(c=O(e,r,v)).length-1;0===c[o];--o)c.pop();return o<0?new n(0*t.s):(t.e=j(c,l),t.d=c,f=!1,a&&(t=k(t,i,4*s)),u&&(t=t.times(Math.abs(u)<54?h(2,u):Dt.pow(2,u))),f=!0,t)}function F(t,e,r,n,i){var o,a,s,u,c=t.precision,d=Math.ceil(c/7);for(f=!1,u=r.times(r),s=new t(n);;){if(a=k(s.times(u),new t(e++*e++),c,1),s=i?n.plus(a):n.minus(a),n=k(a.times(u),new t(e++*e++),c,1),void 0!==(a=s.plus(n)).d[d]){for(o=d;a.d[o]===s.d[o]&&o--;);if(-1==o)break}o=s,s=n,n=a,a=o}return f=!0,a.d.length=d+1,a}function K(t,e){for(var r=t;--e;)r*=t;return r}function J(t,e){var r,n=e.s<0,o=D(t,t.precision,1),a=o.times(.5);if((e=e.abs()).lte(a))return i=n?4:1,e;if((r=e.divToInt(o)).isZero())i=n?3:2;else{if((e=e.minus(r.times(o))).lte(a))return i=T(r)?n?2:3:n?4:1,e;i=T(r)?n?1:4:n?3:2}return e.minus(o).abs()}function V(t,e,r,i){var o,s,u,c,f,d,l,h,p,b=t.constructor,y=void 0!==r;if(y?(M(r,1,1e9),void 0===i?i=b.rounding:M(i,0,8)):(r=b.precision,i=b.rounding),t.isFinite()){for(y?(o=2,16==e?r=4*r-3:8==e&&(r=3*r-2)):o=e,(u=(l=A(t)).indexOf("."))>=0&&(l=l.replace(".",""),(p=new b(1)).e=l.length-u,p.d=O(A(p),10,o),p.e=p.d.length),s=f=(h=O(l,10,o)).length;0==h[--f];)h.pop();if(h[0]){if(u<0?s--:((t=new b(t)).d=h,t.e=s,h=(t=k(t,p,r,i,0,o)).d,s=t.e,d=n),u=h[r],c=o/2,d=d||void 0!==h[r+1],d=i<4?(void 0!==u||d)&&(0===i||i===(t.s<0?3:2)):u>c||u===c&&(4===i||d||6===i&&1&h[r-1]||i===(t.s<0?8:7)),h.length=r,d)for(;++h[--r]>o-1;)h[r]=0,r||(++s,h.unshift(1));for(f=h.length;!h[f-1];--f);for(u=0,l="";u1)if(16==e||8==e){for(u=16==e?4:3,--f;f%u;f++)l+="0";for(f=(h=O(l,o,e)).length;!h[f-1];--f);for(u=1,l="1.";uf)for(s-=f;s--;)l+="0";else se)return t.length=e,!0}function W(t){return new this(t).abs()}function G(t){return new this(t).acos()}function Z(t){return new this(t).acosh()}function X(t,e){return new this(t).plus(e)}function Y(t){return new this(t).asin()}function $(t){return new this(t).asinh()}function Q(t){return new this(t).atan()}function tt(t){return new this(t).atanh()}function et(t,e){t=new this(t),e=new this(e);var r,n=this.precision,i=this.rounding,o=n+4;return t.s&&e.s?t.d||e.d?!e.d||t.isZero()?(r=e.s<0?D(this,n,i):new this(0)).s=t.s:!t.d||e.isZero()?(r=D(this,o,1).times(.5)).s=t.s:e.s<0?(this.precision=o,this.rounding=1,r=this.atan(k(t,e,o,1)),e=D(this,o,1),this.precision=n,this.rounding=i,r=t.s<0?r.minus(e):r.plus(e)):r=this.atan(k(t,e,o,1)):(r=D(this,o,1).times(e.s>0?.25:.75)).s=t.s:r=new this(NaN),r}function rt(t){return new this(t).cbrt()}function nt(t){return P(t=new this(t),t.e+1,2)}function it(t){if(!t||"object"!=typeof t)throw Error("[DecimalError] Object expected");var e,r,n,i=!0===t.defaults,a=["precision",1,1e9,"rounding",0,8,"toExpNeg",-o,0,"toExpPos",0,o,"maxE",0,o,"minE",-o,0,"modulo",0,9];for(e=0;e=a[e+1]&&n<=a[e+2]))throw Error(d+r+": "+n);this[r]=n}if(r="crypto",i&&(this[r]=c[r]),void 0!==(n=t[r])){if(!0!==n&&!1!==n&&0!==n&&1!==n)throw Error(d+r+": "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");this[r]=!0}else this[r]=!1}return this}function ot(t){return new this(t).cos()}function at(t){return new this(t).cosh()}function st(t,e){return new this(t).div(e)}function ut(t){return new this(t).exp()}function ct(t){return P(t=new this(t),t.e+1,3)}function ft(){var t,e,r=new this(0);for(f=!1,t=0;t=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:s[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");for(e=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(e,o):(s.push(i%1e7),o+=4);o=n/4}else for(;o=10;i/=10)n++;n<7&&(r-=7-n)}return a.e=r,a.d=s,a}function xt(t){return P(t=new this(t),t.e+1,this.rounding)}function Mt(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function St(t){return new this(t).sin()}function Ot(t){return new this(t).sinh()}function kt(t){return new this(t).sqrt()}function Pt(t,e){return new this(t).sub(e)}function At(t){return new this(t).tan()}function jt(t){return new this(t).tanh()}function Et(t){return P(t=new this(t),t.e+1,1)}w[Symbol.for("nodejs.util.inspect.custom")]=w.toString,w[Symbol.toStringTag]="Decimal";var Dt=function t(e){var r,n,i;function o(t){var e,r,n,i=this;if(!(i instanceof o))return new o(t);if(i.constructor=o,t instanceof o)return i.s=t.s,void(f?!t.d||t.e>o.maxE?(i.e=NaN,i.d=null):t.e=10;r/=10)e++;return void(f?e>o.maxE?(i.e=NaN,i.d=null):e>>24)|4278255360&(i<<24|i>>>8)}var o,a,h,_,w,x,M,S,O,k,P,A=this._hash.words,j=d.words,E=l.words,D=s.words,C=u.words,N=c.words,I=f.words;for(x=o=A[0],M=a=A[1],S=h=A[2],O=_=A[3],k=w=A[4],r=0;r<80;r+=1)P=o+t[e+D[r]]|0,P+=r<16?p(a,h,_)+j[0]:r<32?b(a,h,_)+j[1]:r<48?y(a,h,_)+j[2]:r<64?m(a,h,_)+j[3]:v(a,h,_)+j[4],P=(P=g(P|=0,N[r]))+w|0,o=w,w=_,_=g(h,10),h=a,a=P,P=x+t[e+C[r]]|0,P+=r<16?v(M,S,O)+E[0]:r<32?m(M,S,O)+E[1]:r<48?y(M,S,O)+E[2]:r<64?b(M,S,O)+E[3]:p(M,S,O)+E[4],P=(P=g(P|=0,I[r]))+k|0,x=k,k=O,O=g(S,10),S=M,M=P;P=A[1]+h+O|0,A[1]=A[2]+_+k|0,A[2]=A[3]+w+x|0,A[3]=A[4]+o+M|0,A[4]=A[0]+a+S|0,A[0]=P},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;e[n>>>5]|=128<<24-n%32,e[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process();for(var i=this._hash,o=i.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function p(t,e,r){return t^e^r}function b(t,e,r){return t&e|~t&r}function y(t,e,r){return(t|~e)^r}function m(t,e,r){return t&r|e&~r}function v(t,e,r){return t^(e|~r)}function g(t,e){return t<>>32-e}e.RIPEMD160=o._createHelper(h),e.HmacRIPEMD160=o._createHmacHelper(h)}(Math),n.RIPEMD160)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(171);e.fromSeed=n.fromSeed,e.fromBase58=n.fromBase58,e.fromPublicKey=n.fromPublicKey,e.fromPrivateKey=n.fromPrivateKey},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(172),i=r(73),o=r(176),a=r(202),s=r(204),u=a.BufferN(32),c=a.compile({wif:a.UInt8,bip32:{public:a.UInt32,private:a.UInt32}}),f={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},d=Math.pow(2,31)-1;function l(t){return a.String(t)&&null!==t.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}function h(t){return a.UInt32(t)&&t<=d}class p{constructor(t,e,r,n,i=0,o=0,s=0){this.__D=t,this.__Q=e,this.chainCode=r,this.network=n,this.__DEPTH=i,this.__INDEX=o,this.__PARENT_FINGERPRINT=s,a(c,n),this.lowR=!1}get depth(){return this.__DEPTH}get index(){return this.__INDEX}get parentFingerprint(){return this.__PARENT_FINGERPRINT}get publicKey(){return void 0===this.__Q&&(this.__Q=o.pointFromScalar(this.__D,!0)),this.__Q}get privateKey(){return this.__D}get identifier(){return n.hash160(this.publicKey)}get fingerprint(){return this.identifier.slice(0,4)}get compressed(){return!0}isNeutered(){return void 0===this.__D}neutered(){return m(this.publicKey,this.chainCode,this.network,this.depth,this.index,this.parentFingerprint)}toBase58(){const t=this.network,e=this.isNeutered()?t.bip32.public:t.bip32.private,r=Buffer.allocUnsafe(78);return r.writeUInt32BE(e,0),r.writeUInt8(this.depth,4),r.writeUInt32BE(this.parentFingerprint,5),r.writeUInt32BE(this.index,9),this.chainCode.copy(r,13),this.isNeutered()?this.publicKey.copy(r,45):(r.writeUInt8(0,45),this.privateKey.copy(r,46)),i.encode(r)}toWIF(){if(!this.privateKey)throw new TypeError("Missing private key");return s.encode(this.network.wif,this.privateKey,!0)}derive(t){a(a.UInt32,t);const e=t>=2147483648,r=Buffer.allocUnsafe(37);if(e){if(this.isNeutered())throw new TypeError("Missing private key for hardened child key");r[0]=0,this.privateKey.copy(r,1),r.writeUInt32BE(t,33)}else this.publicKey.copy(r,0),r.writeUInt32BE(t,33);const i=n.hmacSHA512(this.chainCode,r),s=i.slice(0,32),u=i.slice(32);if(!o.isPrivate(s))return this.derive(t+1);let c;if(this.isNeutered()){const e=o.pointAddScalar(this.publicKey,s,!0);if(null===e)return this.derive(t+1);c=m(e,u,this.network,this.depth+1,t,this.fingerprint.readUInt32BE(0))}else{const e=o.privateAdd(this.privateKey,s);if(null==e)return this.derive(t+1);c=y(e,u,this.network,this.depth+1,t,this.fingerprint.readUInt32BE(0))}return c}deriveHardened(t){return a(h,t),this.derive(t+2147483648)}derivePath(t){a(l,t);let e=t.split("/");if("m"===e[0]){if(this.parentFingerprint)throw new TypeError("Expected master, got child");e=e.slice(1)}return e.reduce((t,e)=>{let r;return"'"===e.slice(-1)?(r=parseInt(e.slice(0,-1),10),t.deriveHardened(r)):(r=parseInt(e,10),t.derive(r))},this)}sign(t,e){if(!this.privateKey)throw new Error("Missing private key");if(void 0===e&&(e=this.lowR),!1===e)return o.sign(t,this.privateKey);{let e=o.sign(t,this.privateKey);const r=Buffer.alloc(32,0);let n=0;for(;e[0]>127;)n++,r.writeUIntLE(n,0,6),e=o.signWithEntropy(t,this.privateKey,r);return e}}verify(t,e){return o.verify(t,this.publicKey,e)}}function b(t,e,r){return y(t,e,r)}function y(t,e,r,n,i,s){if(a({privateKey:u,chainCode:u},{privateKey:t,chainCode:e}),r=r||f,!o.isPrivate(t))throw new TypeError("Private key not in range [1, n)");return new p(t,void 0,e,r,n,i,s)}function m(t,e,r,n,i,s){if(a({publicKey:a.BufferN(33),chainCode:u},{publicKey:t,chainCode:e}),r=r||f,!o.isPoint(t))throw new TypeError("Point is not on the curve");return new p(void 0,t,e,r,n,i,s)}e.fromBase58=function(t,e){const r=i.decode(t);if(78!==r.length)throw new TypeError("Invalid buffer length");e=e||f;const n=r.readUInt32BE(0);if(n!==e.bip32.private&&n!==e.bip32.public)throw new TypeError("Invalid network version");const o=r[4],a=r.readUInt32BE(5);if(0===o&&0!==a)throw new TypeError("Invalid parent fingerprint");const s=r.readUInt32BE(9);if(0===o&&0!==s)throw new TypeError("Invalid index");const u=r.slice(13,45);let c;if(n===e.bip32.private){if(0!==r.readUInt8(45))throw new TypeError("Invalid private key");c=y(r.slice(46,78),u,e,o,s,a)}else{c=m(r.slice(45,78),u,e,o,s,a)}return c},e.fromPrivateKey=b,e.fromPublicKey=function(t,e,r){return m(t,e,r)},e.fromSeed=function(t,e){if(a(a.Buffer,t),t.length<16)throw new TypeError("Seed should be at least 128 bits");if(t.length>64)throw new TypeError("Seed should be at most 512 bits");e=e||f;const r=n.hmacSHA512(Buffer.from("Bitcoin seed","utf8"),t);return b(r.slice(0,32),r.slice(32),e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(33),i=r(34);e.hash160=function(t){const e=n("sha256").update(t).digest();try{return n("rmd160").update(e).digest()}catch(t){return n("ripemd160").update(e).digest()}},e.hmacSHA512=function(t,e){return i("sha512",t).update(e).digest()}},function(t,e,r){"use strict";var n=r(174),i=r(19).Buffer;t.exports=function(t){function e(e){var r=e.slice(0,-4),n=e.slice(-4),i=t(r);if(!(n[0]^i[0]|n[1]^i[1]|n[2]^i[2]|n[3]^i[3]))return r}return{encode:function(e){var r=t(e);return n.encode(i.concat([e,r],e.length+4))},decode:function(t){var r=e(n.decode(t));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(t){var r=n.decodeUnsafe(t);if(r)return e(r)}}}},function(t,e,r){var n=r(175);t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(t,e,r){"use strict";var n=r(19).Buffer;t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r>>0,f=new Uint8Array(a);t[r];){var d=e[t.charCodeAt(r)];if(255===d)return;for(var l=0,h=a-1;(0!==d||l>>0,f[h]=d%256>>>0,d=d/256>>>0;if(0!==d)throw new Error("Non-zero carry");o=l,r++}if(" "!==t[r]){for(var p=a-o;p!==a&&0===f[p];)p++;var b=n.allocUnsafe(i+(a-p));b.fill(0,0,i);for(var y=i;p!==a;)b[y++]=f[p++];return b}}}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,i=0,o=0,a=e.length;o!==a&&0===e[o];)o++,r++;for(var c=(a-o)*f+1>>>0,d=new Uint8Array(c);o!==a;){for(var l=e[o],h=0,p=c-1;(0!==l||h>>0,d[p]=l%s>>>0,l=l/s>>>0;if(0!==l)throw new Error("Non-zero carry");i=h,o++}for(var b=c-i;b!==c&&0===d[b];)b++;for(var y=u.repeat(r);b=0)return!1;if((2===e||3===e)&&33===t.length){try{_(t)}catch(t){return!1}return!0}const n=t.slice(33);return 0!==n.compare(a)&&(!(n.compare(u)>=0)&&(4===e&&65===t.length))}function b(t){return 4!==t[0]}function y(t){return!!l(t)&&(t.compare(a)>0&&t.compare(s)<0)}function m(t,e){return void 0===t&&void 0!==e?b(e):void 0===t||t}function v(t){return new n(t)}function g(t){return t.toArrayLike(Buffer,"be",32)}function _(t){return i.curve.decodePoint(t)}function w(t,e){return Buffer.from(t._encode(e))}function x(t,e,r){if(!l(t))throw new TypeError("Expected Hash");if(!y(e))throw new TypeError("Expected Private");if(void 0!==r&&!l(r))throw new TypeError("Expected Extra Data (32 bytes)");const n=v(e),i=v(t);let a,s;o(t,e,(function(t){const e=v(t),r=d.mul(e);return!r.isInfinity()&&(a=r.x.umod(c),0!==a.isZero()&&(s=e.invm(c).mul(i.add(n.mul(a))).umod(c),0!==s.isZero()))}),y,r),s.cmp(f)>0&&(s=c.sub(s));const u=Buffer.allocUnsafe(64);return g(a).copy(u,0),g(s).copy(u,32),u}t.exports={isPoint:p,isPointCompressed:function(t){return!!p(t)&&b(t)},isPrivate:y,pointAdd:function(t,e,r){if(!p(t))throw new TypeError("Expected Point");if(!p(e))throw new TypeError("Expected Point");const n=_(t),i=_(e),o=n.add(i);return o.isInfinity()?null:w(o,m(r,t))},pointAddScalar:function(t,e,r){if(!p(t))throw new TypeError("Expected Point");if(!h(e))throw new TypeError("Expected Tweak");const n=m(r,t),i=_(t);if(0===e.compare(a))return w(i,n);const o=v(e),s=d.mul(o),u=i.add(s);return u.isInfinity()?null:w(u,n)},pointCompress:function(t,e){if(!p(t))throw new TypeError("Expected Point");const r=_(t);if(r.isInfinity())throw new TypeError("Expected Point");return w(r,m(e,t))},pointFromScalar:function(t,e){if(!y(t))throw new TypeError("Expected Private");const r=v(t),n=d.mul(r);return n.isInfinity()?null:w(n,m(e))},pointMultiply:function(t,e,r){if(!p(t))throw new TypeError("Expected Point");if(!h(e))throw new TypeError("Expected Tweak");const n=m(r,t),i=_(t),o=v(e),a=i.mul(o);return a.isInfinity()?null:w(a,n)},privateAdd:function(t,e){if(!y(t))throw new TypeError("Expected Private");if(!h(e))throw new TypeError("Expected Tweak");const r=v(t),n=v(e),i=g(r.add(n).umod(c));return y(i)?i:null},privateSub:function(t,e){if(!y(t))throw new TypeError("Expected Private");if(!h(e))throw new TypeError("Expected Tweak");const r=v(t),n=v(e),i=g(r.sub(n).umod(c));return y(i)?i:null},sign:function(t,e){return x(t,e)},signWithEntropy:function(t,e,r){return x(t,e,r)},verify:function(t,e,r,n){if(!l(t))throw new TypeError("Expected Hash");if(!p(e))throw new TypeError("Expected Point");if(!function(t){const e=t.slice(0,32),r=t.slice(32,64);return Buffer.isBuffer(t)&&64===t.length&&e.compare(s)<0&&r.compare(s)<0}(r))throw new TypeError("Expected Signature");const i=_(e),o=v(r.slice(0,32)),a=v(r.slice(32,64));if(n&&a.cmp(f)>0)return!1;if(o.gtn(0)<=0)return!1;if(a.gtn(0)<=0)return!1;const u=v(t),h=a.invm(c),b=u.mul(h).umod(c),y=o.mul(h).umod(c),m=d.mulAdd(b,i,y);return!m.isInfinity()&&m.x.umod(c).eq(o)}}},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){t.exports=JSON.parse('{"_args":[["elliptic@6.5.3","/Users/hanjukim/Mirror/mirror.js"]],"_from":"elliptic@6.5.3","_id":"elliptic@6.5.3","_inBundle":false,"_integrity":"sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==","_location":"/elliptic","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"elliptic@6.5.3","name":"elliptic","escapedName":"elliptic","rawSpec":"6.5.3","saveSpec":null,"fetchSpec":"6.5.3"},"_requiredBy":["/browserify-sign","/create-ecdh","/secp256k1","/tiny-secp256k1"],"_resolved":"https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz","_spec":"6.5.3","_where":"/Users/hanjukim/Mirror/mirror.js","author":{"name":"Fedor Indutny","email":"fedor@indutny.com"},"bugs":{"url":"https://github.com/indutny/elliptic/issues"},"dependencies":{"bn.js":"^4.4.0","brorand":"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0","inherits":"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},"description":"EC cryptography","devDependencies":{"brfs":"^1.4.3","coveralls":"^3.0.8","grunt":"^1.0.4","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.2","jscs":"^3.0.7","jshint":"^2.10.3","mocha":"^6.2.2"},"files":["lib"],"homepage":"https://github.com/indutny/elliptic","keywords":["EC","Elliptic","curve","Cryptography"],"license":"MIT","main":"lib/elliptic.js","name":"elliptic","repository":{"type":"git","url":"git+ssh://git@github.com/indutny/elliptic.git"},"scripts":{"jscs":"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js","jshint":"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js","lint":"npm run jscs && npm run jshint","test":"npm run lint && npm run unit","unit":"istanbul test _mocha --reporter=spec test/index.js","version":"grunt dist && git add dist/"},"version":"6.5.3"}')},function(t,e,r){"use strict";var n=r(6),i=r(9),o=r(12),a=r(25),s=n.assert;function u(t){a.call(this,"short",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(t,e,r,n){a.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function f(t,e,r,n){a.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,a),t.exports=u,u.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new i(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new i(t.a,16),b:new i(t.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),o=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(t){for(var e,r,n,o,a,s,u,c,f,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=t,h=this.n.clone(),p=new i(1),b=new i(0),y=new i(0),m=new i(1),v=0;0!==l.cmpn(0);){var g=h.div(l);c=h.sub(g.mul(l)),f=y.sub(g.mul(p));var _=m.sub(g.mul(b));if(!n&&c.cmp(d)<0)e=u.neg(),r=p,n=c.neg(),o=f;else if(n&&2==++v)break;u=c,h=l,l=c,y=p,p=f,m=b,b=_}a=c.neg(),s=f;var w=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(w)>=0&&(a=e,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},u.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:t.sub(a).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},u.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},c.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},c.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(f,a.BasePoint),u.prototype.jpoint=function(t,e,r){return new f(this,t,e,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),f=c.redMul(s),d=n.redMul(c),l=u.redSqr().redIAdd(f).redISub(d).redISub(d),h=u.redMul(d.redISub(l)).redISub(o.redMul(f)),p=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(l,h,p)},f.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),f=r.redMul(u),d=s.redSqr().redIAdd(c).redISub(f).redISub(f),l=s.redMul(f.redISub(d)).redISub(i.redMul(c)),h=this.z.redMul(a);return this.curve.jpoint(d,l,h)},f.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},function(t,e,r){"use strict";var n=r(9),i=r(12),o=r(25),a=r(6);function s(t){o.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),t.exports=s,s.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),s.prototype.decodePoint=function(t,e){return this.point(a.toArray(t,e),1)},s.prototype.point=function(t,e){return new u(this,t,e)},s.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(t,e){return new u(t,e[0],e[1]||t.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),a=i.redMul(n),s=e.z.redMul(o.redAdd(a).redSqr()),u=e.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(t,e,r){"use strict";var n=r(6),i=r(9),o=r(12),a=r(25),s=n.assert;function u(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,a.call(this,"edwards",t),this.a=new i(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function c(t,e,r,n,o){a.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(e,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,a),t.exports=u,u.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},u.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},u.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var u=s.fromRed().isOdd();return(e&&!u||!e&&u)&&(s=s.redNeg()),this.point(t,s)},u.prototype.pointFromY=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==e&&(s=s.redNeg()),this.point(s,t)},u.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},o(c,a.BasePoint),u.prototype.pointFromJSON=function(t){return c.fromJSON(this,t)},u.prototype.point=function(t,e,r,n){return new c(this,t,e,r,n)},c.fromJSON=function(t,e){return new c(t,e[0],e[1],e[2])},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),a=o.redSub(r),s=n.redSub(e),u=i.redMul(a),c=o.redMul(s),f=i.redMul(s),d=a.redMul(o);return this.curve.point(u,c,d,f)},c.prototype._projDbl=function(){var t,e,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(c=this.curve._mulA(i)).redAdd(o);if(this.zOne)t=n.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),e=a.redMul(c.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);t=n.redSub(i).redISub(o).redMul(u),e=a.redMul(c.redSub(o)),r=a.redMul(u)}}else{var c=i.redAdd(o);s=this.curve._mulC(this.z).redSqr(),u=c.redSub(s).redSub(s);t=this.curve._mulC(n.redISub(c)).redMul(u),e=this.curve._mulC(c).redMul(i.redISub(o)),r=c.redMul(u)}return this.curve.point(t,e,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(e),c=o.redMul(a),f=s.redMul(u),d=o.redMul(u),l=a.redMul(s);return this.curve.point(c,f,l,d)},c.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),a=this.y.redMul(t.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),c=i.redAdd(s),f=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(a),d=n.redMul(u).redMul(f);return this.curve.twisted?(e=n.redMul(c).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(c)):(e=n.redMul(c).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(d,e,r)},c.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},c.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},c.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},c.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},c.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},function(t,e,r){"use strict";e.sha1=r(188),e.sha224=r(189),e.sha256=r(79),e.sha384=r(190),e.sha512=r(80)},function(t,e,r){"use strict";var n=r(10),i=r(20),o=r(78),a=n.rotl32,s=n.sum32,u=n.sum32_5,c=o.ft_1,f=i.BlockHash,d=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(l,f),t.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;nthis.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e0))return a.iaddn(1),this.keyFromPrivate(a)}},d.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},d.prototype.sign=function(t,e,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var a=this.n.byteLength(),s=e.getPrivate().toArray("be",a),u=t.toArray("be",a),c=new i({hash:this.hash,entropy:s,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),d=this.n.sub(new n(1)),l=0;;l++){var h=o.k?o.k(l):new n(c.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(d)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var b=p.getX(),y=b.umod(this.n);if(0!==y.cmpn(0)){var m=h.invm(this.n).mul(y.mul(e.getPrivate()).iadd(t));if(0!==(m=m.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==b.cmp(y)?2:0);return o.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),v^=1),new f({r:y,s:m,recoveryParam:v})}}}}}},d.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var o=(e=new f(e,"hex")).r,a=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),c=u.mul(t).umod(this.n),d=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),d)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),d)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},d.prototype.recoverPubKey=function(t,e,r,i){u((3&r)===r,"The recovery param is more than two bits"),e=new f(e,i);var o=this.n,a=new n(t),s=e.r,c=e.s,d=1&r,l=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");s=l?this.curve.pointFromX(s.add(this.curve.n),d):this.curve.pointFromX(s,d);var h=e.r.invm(o),p=o.sub(a).mul(h).umod(o),b=c.mul(h).umod(o);return this.g.mulAdd(p,s,b)},d.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new f(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(t,e,r){"use strict";var n=r(39),i=r(75),o=r(14);function a(t){if(!(this instanceof a))return new a(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}t.exports=a,a.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},a.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length"}},function(t,e,r){"use strict";var n=r(9),i=r(6),o=i.assert;function a(t,e){if(t instanceof a)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function s(){this.place=0}function u(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=e.place;o>>=0;return!(i<=127)&&(e.place=a,i)}function c(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=a,a.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new s;if(48!==t[r.place++])return!1;var o=u(t,r);if(!1===o)return!1;if(o+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var a=u(t,r);if(!1===a)return!1;var c=t.slice(r.place,a+r.place);if(r.place+=a,2!==t[r.place++])return!1;var f=u(t,r);if(!1===f)return!1;if(t.length!==f+r.place)return!1;var d=t.slice(r.place,f+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new n(c),this.s=new n(d),this.recoveryParam=null,!0},a.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=c(e),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,e.length),(n=n.concat(e)).push(2),f(n,r.length);var o=n.concat(r),a=[48];return f(a,o.length),a=a.concat(o),i.encode(a,t)}},function(t,e,r){"use strict";var n=r(39),i=r(38),o=r(6),a=o.assert,s=o.parseBytes,u=r(199),c=r(200);function f(t){if(a("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof f))return new f(t);t=i[t].curve;this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}t.exports=f,f.prototype.sign=function(t,e){t=s(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),u=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},f.prototype.verify=function(t,e,r){t=s(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},f.prototype.hashInt=function(){for(var t=this.hash(),e=0;ee.maxLength)&&((void 0===e.length||r.length===e.length)&&r.every((function(e,r){try{return l(t,e,n)}catch(t){throw u(t,r)}}))))))}return t=d(t),e=e||{},r.toJSON=function(){var r="["+o(t)+"]";return void 0!==e.length?r+="{"+e.length+"}":void 0===e.minLength&&void 0===e.maxLength||(r+="{"+(void 0===e.minLength?0:e.minLength)+","+(void 0===e.maxLength?1/0:e.maxLength)+"}"),r},r},maybe:function t(e){function r(r,n){return i.Nil(r)||e(r,n,t)}return e=d(e),r.toJSON=function(){return"?"+o(e)},r},map:function(t,e){function r(r,n){if(!i.Object(r))return!1;if(i.Nil(r))return!1;for(var o in r){try{e&&l(e,o,n)}catch(t){throw u(t,o,"key")}try{var a=r[o];l(t,a,n)}catch(t){throw u(t,o)}}return!0}return t=d(t),e&&(e=d(e)),r.toJSON=e?function(){return"{"+o(e)+": "+o(t)+"}"}:function(){return"{"+o(t)+"}"},r},object:function(t){var e={};for(var r in t)e[r]=d(t[r]);function n(t,r){if(!i.Object(t))return!1;if(i.Nil(t))return!1;var n;try{for(n in e){l(e[n],t[n],r)}}catch(t){throw u(t,n)}if(r)for(n in t)if(!e[n])throw new s(void 0,n);return!0}return n.toJSON=function(){return o(e)},n},anyOf:function(){var t=[].slice.call(arguments).map(d);function e(e,r){return t.some((function(t){try{return l(t,e,r)}catch(t){return!1}}))}return e.toJSON=function(){return t.map(o).join("|")},e},allOf:function(){var t=[].slice.call(arguments).map(d);function e(e,r){return t.every((function(t){try{return l(t,e,r)}catch(t){return!1}}))}return e.toJSON=function(){return t.map(o).join(" & ")},e},quacksLike:function(t){function e(e){return t===c(e)}return e.toJSON=function(){return t},e},tuple:function(){var t=[].slice.call(arguments).map(d);function e(e,r){return!i.Nil(e)&&(!i.Nil(e.length)&&((!r||e.length===t.length)&&t.every((function(t,n){try{return l(t,e[n],r)}catch(t){throw u(t,n)}}))))}return e.toJSON=function(){return"("+t.map(o).join(", ")+")"},e},value:function(t){function e(e){return e===t}return e.toJSON=function(){return t},e}};function d(t){if(i.String(t))return"?"===t[0]?f.maybe(t.slice(1)):i[t]||f.quacksLike(t);if(t&&i.Object(t)){if(i.Array(t)){if(1!==t.length)throw new TypeError("Expected compile() parameter of type Array of length 1");return f.arrayOf(t[0])}return f.object(t)}return i.Function(t)?t:f.value(t)}function l(t,e,r,n){if(i.Function(t)){if(t(e,r))return!0;throw new a(n||t,e)}return l(d(t),e,r)}for(var h in f.oneOf=f.anyOf,i)l[h]=i[h];for(h in f)l[h]=f[h];var p=r(203);for(h in p)l[h]=p[h];l.compile=d,l.TfTypeError=a,l.TfPropertyTypeError=s,t.exports=l},function(t,e,r){var n=r(40),i=r(81);function o(t){return Buffer.isBuffer(t)}function a(t){return"string"==typeof t&&/^([0-9a-f]{2})+$/i.test(t)}function s(t,e){var r=t.toJSON();function n(n){if(!t(n))return!1;if(n.length===e)return!0;throw i.tfCustomError(r+"(Length: "+e+")",r+"(Length: "+n.length+")")}return n.toJSON=function(){return r},n}var u=s.bind(null,n.Array),c=s.bind(null,o),f=s.bind(null,a),d=s.bind(null,n.String);var l=Math.pow(2,53)-1;var h={ArrayN:u,Buffer:o,BufferN:c,Finite:function(t){return"number"==typeof t&&isFinite(t)},Hex:a,HexN:f,Int8:function(t){return t<<24>>24===t},Int16:function(t){return t<<16>>16===t},Int32:function(t){return(0|t)===t},Int53:function(t){return"number"==typeof t&&t>=-l&&t<=l&&Math.floor(t)===t},Range:function(t,e,r){function i(n,i){return r(n,i)&&n>t&&n>>0===t},UInt53:function(t){return"number"==typeof t&&t>=0&&t<=l&&Math.floor(t)===t}};for(var p in h)h[p].toJSON=function(t){return t}.bind(null,p);t.exports=h},function(t,e,r){var n=r(73);function i(t,e){if(void 0!==e&&t[0]!==e)throw new Error("Invalid network version");if(33===t.length)return{version:t[0],privateKey:t.slice(1,33),compressed:!1};if(34!==t.length)throw new Error("Invalid WIF length");if(1!==t[33])throw new Error("Invalid compression flag");return{version:t[0],privateKey:t.slice(1,33),compressed:!0}}function o(t,e,r){var n=new Buffer(r?34:33);return n.writeUInt8(t,0),e.copy(n,1),r&&(n[33]=1),n}t.exports={decode:function(t,e){return i(n.decode(t),e)},decodeRaw:i,encode:function(t,e,r){return"number"==typeof t?n.encode(o(t,e,r)):n.encode(o(t.version,t.privateKey,t.compressed))},encodeRaw:o}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(33),i=r(206),o=r(208),a=r(83);let s=a._default;const u="A wordlist is required but a default could not be found.\nPlease explicitly pass a 2048 word array explicitly.";function c(t,e,r){for(;t.lengthc(t.toString(2),"0",8)).join("")}function l(t){const e=8*t.length/32;return d([...n("sha256").update(t).digest()]).slice(0,e)}function h(t){return"mnemonic"+(t||"")}function p(t,e){if(!(e=e||s))throw new Error(u);const r=(t||"").normalize("NFKD").split(" ");if(r.length%3!=0)throw new Error("Invalid mnemonic");const n=r.map(t=>{const r=e.indexOf(t);if(-1===r)throw new Error("Invalid mnemonic");return c(r.toString(2),"0",11)}).join(""),i=32*Math.floor(n.length/33),o=n.slice(0,i),a=n.slice(i),d=o.match(/(.{1,8})/g).map(f);if(d.length<16)throw new Error("Invalid entropy");if(d.length>32)throw new Error("Invalid entropy");if(d.length%4!=0)throw new Error("Invalid entropy");const h=Buffer.from(d);if(l(h)!==a)throw new Error("Invalid mnemonic checksum");return h.toString("hex")}function b(t,e){if(Buffer.isBuffer(t)||(t=Buffer.from(t,"hex")),!(e=e||s))throw new Error(u);if(t.length<16)throw new TypeError("Invalid entropy");if(t.length>32)throw new TypeError("Invalid entropy");if(t.length%4!=0)throw new TypeError("Invalid entropy");const r=(d([...t])+l(t)).match(/(.{1,11})/g).map(t=>{const r=f(t);return e[r]});return"あいこくしん"===e[0]?r.join(" "):r.join(" ")}e.mnemonicToSeedSync=function(t,e){const r=Buffer.from((t||"").normalize("NFKD"),"utf8"),n=Buffer.from(h((e||"").normalize("NFKD")),"utf8");return i.pbkdf2Sync(r,n,2048,64,"sha512")},e.mnemonicToSeed=function(t,e){return new Promise((r,n)=>{try{const o=Buffer.from((t||"").normalize("NFKD"),"utf8"),a=Buffer.from(h((e||"").normalize("NFKD")),"utf8");i.pbkdf2(o,a,2048,64,"sha512",(t,e)=>t?n(t):r(e))}catch(t){return n(t)}})},e.mnemonicToEntropy=p,e.entropyToMnemonic=b,e.generateMnemonic=function(t,e,r){if((t=t||128)%32!=0)throw new TypeError("Invalid entropy");return b((e=e||o)(t/8),r)},e.validateMnemonic=function(t,e){try{p(t,e)}catch(t){return!1}return!0},e.setDefaultWordlist=function(t){const e=a.wordlists[t];if(!e)throw new Error('Could not find wordlist for language "'+t+'"');s=e},e.getDefaultWordlist=function(){if(!s)throw new Error("No Default Wordlist set");return Object.keys(a.wordlists).filter(t=>"JA"!==t&&"EN"!==t&&a.wordlists[t].every((t,e)=>t===s[e]))[0]};var y=r(83);e.wordlists=y.wordlists},function(t,e,r){var n=r(18),i=r(41),o=r(42),a=r(43);n.pbkdf2Sync&&-1!==n.pbkdf2Sync.toString().indexOf("keylen, digest")?(e.pbkdf2Sync=function(t,e,r,s,u){return i(r,s),t=a(t,o,"Password"),e=a(e,o,"Salt"),u=u||"sha1",n.pbkdf2Sync(t,e,r,s,u)},e.pbkdf2=function(t,e,r,s,u,c){if(i(r,s),t=a(t,o,"Password"),e=a(e,o,"Salt"),"function"==typeof u&&(c=u,u="sha1"),"function"!=typeof c)throw new Error("No callback provided to pbkdf2");return n.pbkdf2(t,e,r,s,u,c)}):(e.pbkdf2Sync=r(82),e.pbkdf2=r(207))},function(t,e,r){var n,i=r(19).Buffer,o=r(41),a=r(42),s=r(82),u=r(43),c=global.crypto&&global.crypto.subtle,f={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},d=[];function l(t,e,r,n,o){return c.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then((function(t){return c.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:o}},t,n<<3)})).then((function(t){return i.from(t)}))}t.exports=function(t,e,r,h,p,b){"function"==typeof p&&(b=p,p=void 0);var y=f[(p=p||"sha1").toLowerCase()];if(!y||"function"!=typeof global.Promise)return process.nextTick((function(){var n;try{n=s(t,e,r,h,p)}catch(t){return b(t)}b(null,n)}));if(o(r,h),t=u(t,a,"Password"),e=u(e,a,"Salt"),"function"!=typeof b)throw new Error("No callback provided to pbkdf2");!function(t,e){t.then((function(t){process.nextTick((function(){e(null,t)}))}),(function(t){process.nextTick((function(){e(t)}))}))}(function(t){if(global.process&&!global.process.browser)return Promise.resolve(!1);if(!c||!c.importKey||!c.deriveBits)return Promise.resolve(!1);if(void 0!==d[t])return d[t];var e=l(n=n||i.alloc(8),n,10,128,t).then((function(){return!0})).catch((function(){return!1}));return d[t]=e,e}(y).then((function(n){return n?l(t,e,r,h,y):s(t,e,r,h,p)})),b)}},function(t,e,r){t.exports=r(18).randomBytes},function(t){t.exports=JSON.parse('["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"]')},function(t,e,r){(function(e){const n=r(211)(e);t.exports=r(85)(new n.Secp256k1)}).call(this,"/")},function(t,e,r){var n=r(36),i=r(37),o=r(212),a=require,s=process.config&&process.config.variables||{},u=!!process.env.PREBUILDS_ONLY,c=process.versions.modules,f=!(!process.versions||!process.versions.electron)||!!process.env.ELECTRON_RUN_AS_NODE||"undefined"!=typeof window&&window.process&&"renderer"===window.process.type?"electron":"node",d=o.arch(),l=o.platform(),h=process.env.LIBC||(function(t){return"linux"===t&&n.existsSync("/etc/alpine-release")}(l)?"musl":"glibc"),p=process.env.ARM_VERSION||("arm64"===d?"8":s.arm_version)||"",b=(process.versions.uv||"").split(".")[0];function y(t){return a(y.path(t))}function m(t){try{return n.readdirSync(t)}catch(t){return[]}}function v(t,e){var r=m(t).filter(e);return r[0]&&i.join(t,r[0])}function g(t){return/\.node$/.test(t)}function _(t){var e=t.split("."),r={file:t,specificity:0};if("node"===e.pop()){for(var n=0;nr.specificity?-1:1:0}}t.exports=y,y.path=function(t){t=i.resolve(t||".");try{var e=a(i.join(t,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(t=process.env[e+"_PREBUILD"])}catch(t){}if(!u){var r=v(i.join(t,"build/Release"),g);if(r)return r;var n=v(i.join(t,"build/Debug"),g);if(n)return n}var o=M(t);if(o)return o;var s=M(i.dirname(process.execPath));if(s)return s;var y=["platform="+l,"arch="+d,"runtime="+f,"abi="+c,"uv="+b,p?"armv="+p:"","libc="+h,"node="+process.versions.node,process.versions&&process.versions.electron?"electron="+process.versions.electron:"","webpack=true"].filter(Boolean).join(" ");throw new Error("No native build was found for "+y+"\n loaded from: "+t+"\n");function M(t){var e=i.join(t,"prebuilds",l+"-"+d),r=m(e).map(_).filter(w(f,c)).sort(x(f))[0];if(r)return i.join(e,r.file)}},y.parseTags=_,y.matchTags=w,y.compareTags=x},function(t,e){t.exports=require("os")},function(t,e,r){t.exports=r(85)(r(214))},function(t,e,r){const n=new(0,r(74).ec)("secp256k1"),i=n.curve,o=i.n.constructor;function a(t){const e=t[0];switch(e){case 2:case 3:return 33!==t.length?null:function(t,e){let r=new o(e);if(r.cmp(i.p)>=0)return null;r=r.toRed(i.red);let a=r.redSqr().redIMul(r).redIAdd(i.b).redSqrt();return 3===t!==a.isOdd()&&(a=a.redNeg()),n.keyPair({pub:{x:r,y:a}})}(e,t.subarray(1,33));case 4:case 6:case 7:return 65!==t.length?null:function(t,e,r){let a=new o(e),s=new o(r);if(a.cmp(i.p)>=0||s.cmp(i.p)>=0)return null;if(a=a.toRed(i.red),s=s.toRed(i.red),(6===t||7===t)&&s.isOdd()!==(7===t))return null;const u=a.redSqr().redIMul(a);return s.redSqr().redISub(u.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:a,y:s}}):null}(e,t.subarray(1,33),t.subarray(33,65));default:return null}}function s(t,e){const r=e.encode(null,33===t.length);for(let e=0;e0,privateKeyVerify(t){const e=new o(t);return e.cmp(i.n)<0&&!e.isZero()?0:1},privateKeyNegate(t){const e=new o(t),r=i.n.sub(e).umod(i.n).toArrayLike(Uint8Array,"be",32);return t.set(r),0},privateKeyTweakAdd(t,e){const r=new o(e);if(r.cmp(i.n)>=0)return 1;if(r.iadd(new o(t)),r.cmp(i.n)>=0&&r.isub(i.n),r.isZero())return 1;const n=r.toArrayLike(Uint8Array,"be",32);return t.set(n),0},privateKeyTweakMul(t,e){let r=new o(e);if(r.cmp(i.n)>=0||r.isZero())return 1;r.imul(new o(t)),r.cmp(i.n)>=0&&(r=r.umod(i.n));const n=r.toArrayLike(Uint8Array,"be",32);return t.set(n),0},publicKeyVerify:t=>null===a(t)?1:0,publicKeyCreate(t,e){const r=new o(e);if(r.cmp(i.n)>=0||r.isZero())return 1;return s(t,n.keyFromPrivate(e).getPublic()),0},publicKeyConvert(t,e){const r=a(e);if(null===r)return 1;return s(t,r.getPublic()),0},publicKeyNegate(t,e){const r=a(e);if(null===r)return 1;const n=r.getPublic();return n.y=n.y.redNeg(),s(t,n),0},publicKeyCombine(t,e){const r=new Array(e.length);for(let t=0;t=0)return 2;const u=n.getPublic().add(i.g.mul(r));return u.isInfinity()?2:(s(t,u),0)},publicKeyTweakMul(t,e,r){const n=a(e);if(null===n)return 1;if((r=new o(r)).cmp(i.n)>=0||r.isZero())return 2;return s(t,n.getPublic().mul(r)),0},signatureNormalize(t){const e=new o(t.subarray(0,32)),r=new o(t.subarray(32,64));return e.cmp(i.n)>=0||r.cmp(i.n)>=0?1:(1===r.cmp(n.nh)&&t.set(i.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(t,e){const r=e.subarray(0,32),n=e.subarray(32,64);if(new o(r).cmp(i.n)>=0)return 1;if(new o(n).cmp(i.n)>=0)return 1;const{output:a}=t;let s=a.subarray(4,37);s[0]=0,s.set(r,1);let u=33,c=0;for(;u>1&&0===s[c]&&!(128&s[c+1]);--u,++c);if(s=s.subarray(c),128&s[0])return 1;if(u>1&&0===s[0]&&!(128&s[1]))return 1;let f=a.subarray(39,72);f[0]=0,f.set(n,1);let d=33,l=0;for(;d>1&&0===f[l]&&!(128&f[l+1]);--d,++l);return f=f.subarray(l),128&f[0]||d>1&&0===f[0]&&!(128&f[1])?1:(t.outputlen=6+u+d,a[0]=48,a[1]=t.outputlen-2,a[2]=2,a[3]=s.length,a.set(s,4),a[4+u]=2,a[5+u]=f.length,a.set(f,6+u),0)},signatureImport(t,e){if(e.length<8)return 1;if(e.length>72)return 1;if(48!==e[0])return 1;if(e[1]!==e.length-2)return 1;if(2!==e[2])return 1;const r=e[3];if(0===r)return 1;if(5+r>=e.length)return 1;if(2!==e[4+r])return 1;const n=e[5+r];if(0===n)return 1;if(6+r+n!==e.length)return 1;if(128&e[4])return 1;if(r>1&&0===e[4]&&!(128&e[5]))return 1;if(128&e[r+6])return 1;if(n>1&&0===e[r+6]&&!(128&e[r+7]))return 1;let a=e.subarray(4,4+r);if(33===a.length&&0===a[0]&&(a=a.subarray(1)),a.length>32)return 1;let s=e.subarray(6+r);if(33===s.length&&0===s[0]&&(s=s.slice(1)),s.length>32)throw new Error("S length is too long");let u=new o(a);u.cmp(i.n)>=0&&(u=new o(0));let c=new o(e.subarray(6+r));return c.cmp(i.n)>=0&&(c=new o(0)),t.set(u.toArrayLike(Uint8Array,"be",32),0),t.set(c.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(t,e,r,a,s){if(s){const t=s;s=n=>{const i=t(e,r,null,a,n);if(!(i instanceof Uint8Array&&32===i.length))throw new Error("This is the way");return new o(i)}}const u=new o(r);if(u.cmp(i.n)>=0||u.isZero())return 1;let c;try{c=n.sign(e,r,{canonical:!0,k:s,pers:a})}catch(t){return 1}return t.signature.set(c.r.toArrayLike(Uint8Array,"be",32),0),t.signature.set(c.s.toArrayLike(Uint8Array,"be",32),32),t.recid=c.recoveryParam,0},ecdsaVerify(t,e,r){const s={r:t.subarray(0,32),s:t.subarray(32,64)},u=new o(s.r),c=new o(s.s);if(u.cmp(i.n)>=0||c.cmp(i.n)>=0)return 1;if(1===c.cmp(n.nh)||u.isZero()||c.isZero())return 3;const f=a(r);if(null===f)return 2;const d=f.getPublic();return n.verify(e,s,d)?0:3},ecdsaRecover(t,e,r,a){const u={r:e.slice(0,32),s:e.slice(32,64)},c=new o(u.r),f=new o(u.s);if(c.cmp(i.n)>=0||f.cmp(i.n)>=0)return 1;if(c.isZero()||f.isZero())return 2;let d;try{d=n.recoverPubKey(a,u,r)}catch(t){return 2}return s(t,d),0},ecdh(t,e,r,s,u,c,f){const d=a(e);if(null===d)return 1;const l=new o(r);if(l.cmp(i.n)>=0||l.isZero())return 2;const h=d.getPublic().mul(l);if(void 0===u){const e=h.encode(null,!0),r=n.hash().update(e).digest();for(let e=0;e<32;++e)t[e]=r[e]}else{c||(c=new Uint8Array(32));const e=h.getX().toArray("be",32);for(let t=0;t<32;++t)c[t]=e[t];f||(f=new Uint8Array(32));const r=h.getY().toArray("be",32);for(let t=0;t<32;++t)f[t]=r[t];const n=u(c,f,s);if(!(n instanceof Uint8Array&&n.length===t.length))return 2;t.set(n)}return 0}}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&o(e,t,r);return a(e,t),e},u=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},c=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0)return;a[e]="set-cookie"===e?(a[e]?a[e]:[]).concat([r]):a[e]?a[e]+", "+r:r}})),a):a}},function(t,e,r){"use strict";var n=r(4);t.exports=n.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(t){var n=t;return e&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=i(window.location.href),function(e){var r=n.isString(e)?i(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0}},function(t,e,r){"use strict";var n=r(4),i=r(90),o=r(92),a=r(44),s=r(93),u=r(94),c=r(95).http,f=r(95).https,d=r(96),l=r(240),h=r(241),p=r(45),b=r(91),y=/https:?/;t.exports=function(t){return new Promise((function(e,r){var m=function(t){e(t)},v=function(t){r(t)},g=t.data,_=t.headers;if(_["User-Agent"]||_["user-agent"]||(_["User-Agent"]="axios/"+h.version),g&&!n.isStream(g)){if(Buffer.isBuffer(g));else if(n.isArrayBuffer(g))g=Buffer.from(new Uint8Array(g));else{if(!n.isString(g))return v(p("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",t));g=Buffer.from(g,"utf-8")}_["Content-Length"]=g.length}var w=void 0;t.auth&&(w=(t.auth.username||"")+":"+(t.auth.password||""));var x=o(t.baseURL,t.url),M=d.parse(x),S=M.protocol||"http:";if(!w&&M.auth){var O=M.auth.split(":");w=(O[0]||"")+":"+(O[1]||"")}w&&delete _.Authorization;var k=y.test(S),P=k?t.httpsAgent:t.httpAgent,A={path:a(M.path,t.params,t.paramsSerializer).replace(/^\?/,""),method:t.method.toUpperCase(),headers:_,agent:P,agents:{http:t.httpAgent,https:t.httpsAgent},auth:w};t.socketPath?A.socketPath=t.socketPath:(A.hostname=M.hostname,A.port=M.port);var j,E=t.proxy;if(!E&&!1!==E){var D=S.slice(0,-1)+"_proxy",C=process.env[D]||process.env[D.toUpperCase()];if(C){var N=d.parse(C),I=process.env.no_proxy||process.env.NO_PROXY,T=!0;if(I)T=!I.split(",").map((function(t){return t.trim()})).some((function(t){return!!t&&("*"===t||("."===t[0]&&M.hostname.substr(M.hostname.length-t.length)===t||M.hostname===t))}));if(T&&(E={host:N.hostname,port:N.port},N.auth)){var R=N.auth.split(":");E.auth={username:R[0],password:R[1]}}}}if(E&&(A.hostname=E.host,A.host=E.host,A.headers.host=M.hostname+(M.port?":"+M.port:""),A.port=E.port,A.path=S+"//"+M.hostname+(M.port?":"+M.port:"")+A.path,E.auth)){var q=Buffer.from(E.auth.username+":"+E.auth.password,"utf8").toString("base64");A.headers["Proxy-Authorization"]="Basic "+q}var z=k&&(!E||y.test(E.protocol));t.transport?j=t.transport:0===t.maxRedirects?j=z?u:s:(t.maxRedirects&&(A.maxRedirects=t.maxRedirects),j=z?f:c),t.maxBodyLength>-1&&(A.maxBodyLength=t.maxBodyLength);var B=j.request(A,(function(e){if(!B.aborted){var r=e,o=e.req||B;if(204!==e.statusCode&&"HEAD"!==o.method&&!1!==t.decompress)switch(e.headers["content-encoding"]){case"gzip":case"compress":case"deflate":r=r.pipe(l.createUnzip()),delete e.headers["content-encoding"]}var a={status:e.statusCode,statusText:e.statusMessage,headers:e.headers,config:t,request:o};if("stream"===t.responseType)a.data=r,i(m,v,a);else{var s=[];r.on("data",(function(e){s.push(e),t.maxContentLength>-1&&Buffer.concat(s).length>t.maxContentLength&&(r.destroy(),v(p("maxContentLength size of "+t.maxContentLength+" exceeded",t,null,o)))})),r.on("error",(function(e){B.aborted||v(b(e,t,null,o))})),r.on("end",(function(){var e=Buffer.concat(s);"arraybuffer"!==t.responseType&&(e=e.toString(t.responseEncoding),t.responseEncoding&&"utf8"!==t.responseEncoding||(e=n.stripBOM(e))),a.data=e,i(m,v,a)}))}}}));B.on("error",(function(e){B.aborted&&"ERR_FR_TOO_MANY_REDIRECTS"!==e.code||v(b(e,t,null,B))})),t.timeout&&B.setTimeout(t.timeout,(function(){B.abort(),v(p("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",B))})),t.cancelToken&&t.cancelToken.promise.then((function(t){B.aborted||(B.abort(),v(t))})),n.isStream(g)?g.on("error",(function(e){v(b(e,t,null,B))})).pipe(B):B.end(g)}))}},function(t,e){t.exports=require("assert")},function(t,e,r){var n;try{n=r(234)("follow-redirects")}catch(t){n=function(){}}t.exports=n},function(t,e,r){"undefined"!=typeof process&&"renderer"===process.type?t.exports=r(235):t.exports=r(237)},function(t,e,r){function n(){var t;try{t=e.storage.debug}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t}(e=t.exports=r(97)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},e.formatArgs=function(t){var r=this.useColors;if(t[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+t[0]+(r?"%c ":" ")+"+"+e.humanize(this.diff),!r)return;var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var i=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(i++,"%c"===t&&(o=i))})),t.splice(o,0,n)},e.save=function(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}},e.load=n,e.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(n())},function(t,e){var r=1e3,n=6e4,i=60*n,o=24*i;function a(t,e,r){if(!(t0)return function(t){if((t=String(t)).length>100)return;var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(!e)return;var a=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"days":case"day":case"d":return a*o;case"hours":case"hour":case"hrs":case"hr":case"h":return a*i;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(t);if("number"===u&&!1===isNaN(t))return e.long?a(s=t,o,"day")||a(s,i,"hour")||a(s,n,"minute")||a(s,r,"second")||s+" ms":function(t){if(t>=o)return Math.round(t/o)+"d";if(t>=i)return Math.round(t/i)+"h";if(t>=n)return Math.round(t/n)+"m";if(t>=r)return Math.round(t/r)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},function(t,e,r){var n=r(238),i=r(16);(e=t.exports=r(97)).init=function(t){t.inspectOpts={};for(var r=Object.keys(e.inspectOpts),n=0;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var u=n.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(t){var e=t.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var o=0;o>>6-a%4*2;n[o>>>2]|=(s|u)<<24-o%4*8,o++}return i.create(n,o)}(t,e,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},o.enc.Base64)},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var e,r,i,o=n.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,r=o,i=s,e.copy(r,i),s+=a.data.length,a=a.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e,r){t.exports=r(16).deprecate},function(t,e,r){"use strict";t.exports=o;var n=r(107),i=Object.create(r(21));function o(t){if(!(this instanceof o))return new o(t);n.call(this,t)}i.inherits=r(12),i.inherits(o,n),o.prototype._transform=function(t,e,r){r(null,t)}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1] undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BaseAPI = void 0;\nvar BaseAPI = /** @class */ (function () {\n function BaseAPI(c) {\n this.c = c;\n }\n return BaseAPI;\n}());\nexports.BaseAPI = BaseAPI;\n//# sourceMappingURL=BaseAPI.js.map","'use strict';\n\nvar utils = exports;\nvar BN = require('bn.js');\nvar minAssert = require('minimalistic-assert');\nvar minUtils = require('minimalistic-crypto-utils');\n\nutils.assert = minAssert;\nutils.toArray = minUtils.toArray;\nutils.zero2 = minUtils.zero2;\nutils.toHex = minUtils.toHex;\nutils.encode = minUtils.encode;\n\n// Represent num in a w-NAF form\nfunction getNAF(num, w, bits) {\n var naf = new Array(Math.max(num.bitLength(), bits) + 1);\n naf.fill(0);\n\n var ws = 1 << (w + 1);\n var k = num.clone();\n\n for (var i = 0; i < naf.length; i++) {\n var z;\n var mod = k.andln(ws - 1);\n if (k.isOdd()) {\n if (mod > (ws >> 1) - 1)\n z = (ws >> 1) - mod;\n else\n z = mod;\n k.isubn(z);\n } else {\n z = 0;\n }\n\n naf[i] = z;\n k.iushrn(1);\n }\n\n return naf;\n}\nutils.getNAF = getNAF;\n\n// Represent k1, k2 in a Joint Sparse Form\nfunction getJSF(k1, k2) {\n var jsf = [\n [],\n []\n ];\n\n k1 = k1.clone();\n k2 = k2.clone();\n var d1 = 0;\n var d2 = 0;\n while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {\n\n // First phase\n var m14 = (k1.andln(3) + d1) & 3;\n var m24 = (k2.andln(3) + d2) & 3;\n if (m14 === 3)\n m14 = -1;\n if (m24 === 3)\n m24 = -1;\n var u1;\n if ((m14 & 1) === 0) {\n u1 = 0;\n } else {\n var m8 = (k1.andln(7) + d1) & 7;\n if ((m8 === 3 || m8 === 5) && m24 === 2)\n u1 = -m14;\n else\n u1 = m14;\n }\n jsf[0].push(u1);\n\n var u2;\n if ((m24 & 1) === 0) {\n u2 = 0;\n } else {\n var m8 = (k2.andln(7) + d2) & 7;\n if ((m8 === 3 || m8 === 5) && m14 === 2)\n u2 = -m24;\n else\n u2 = m24;\n }\n jsf[1].push(u2);\n\n // Second phase\n if (2 * d1 === u1 + 1)\n d1 = 1 - d1;\n if (2 * d2 === u2 + 1)\n d2 = 1 - d2;\n k1.iushrn(1);\n k2.iushrn(1);\n }\n\n return jsf;\n}\nutils.getJSF = getJSF;\n\nfunction cachedProperty(obj, name, computer) {\n var key = '_' + name;\n obj.prototype[name] = function cachedProperty() {\n return this[key] !== undefined ? this[key] :\n this[key] = computer.call(this);\n };\n}\nutils.cachedProperty = cachedProperty;\n\nfunction parseBytes(bytes) {\n return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') :\n bytes;\n}\nutils.parseBytes = parseBytes;\n\nfunction intFromLE(bytes) {\n return new BN(bytes, 'hex', 'le');\n}\nutils.intFromLE = intFromLE;\n\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./core\"), exports);\n__exportStar(require(\"./key\"), exports);\n__exportStar(require(\"./client\"), exports);\n__exportStar(require(\"./extension\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Coin = void 0;\nvar json_1 = require(\"../util/json\");\nvar numeric_1 = require(\"./numeric\");\n/**\n * Captures `sdk.Coin` and `sdk.DecCoin` from Cosmos SDK. A composite value that combines\n * a denomination with an amount value. Coins are immutable once created, and operations\n * that return Coin will return a new Coin. See [[Coins]] for a collection of Coin objects.\n */\nvar Coin = /** @class */ (function (_super) {\n __extends(Coin, _super);\n /**\n * Creates a new coin. Depending on the type of amount, it will be converted to an\n * integer coin or decimal coin.\n *\n * @param denom denomination\n * @param amount coin's amount\n */\n function Coin(denom, amount) {\n var _this = _super.call(this) || this;\n _this.denom = denom;\n _this.amount = numeric_1.Numeric.parse(amount);\n return _this;\n }\n Coin.fromData = function (data) {\n var denom = data.denom, amount = data.amount;\n return new Coin(denom, amount);\n };\n /**\n * Checks whether the Coin is an Integer coin.\n */\n Coin.prototype.isIntCoin = function () {\n // TODO: convert into typeguard\n return this.amount instanceof numeric_1.Int;\n };\n /**\n * Checks whether the Coin is a Decimal coin.\n */\n Coin.prototype.isDecCoin = function () {\n return this.amount instanceof numeric_1.Dec;\n };\n /**\n * Turns the Coin into an Integer coin.\n */\n Coin.prototype.toIntCoin = function () {\n return new Coin(this.denom, new numeric_1.Int(this.amount));\n };\n /**\n * Turns the Coin into a Decimal coin.\n */\n Coin.prototype.toDecCoin = function () {\n return new Coin(this.denom, new numeric_1.Dec(this.amount));\n };\n Coin.prototype.toData = function () {\n var _a = this, denom = _a.denom, amount = _a.amount;\n return {\n denom: denom,\n amount: amount.toString(),\n };\n };\n /**\n * Outputs ``.\n *\n * Eg: `Coin('uluna', 1500) -> 1500uluna`\n */\n Coin.prototype.toString = function () {\n var amount = this.amount.toFixed();\n if (this.isDecCoin() && amount.indexOf('.') === -1) {\n return amount + \".0\" + this.denom;\n }\n return \"\" + amount + this.denom;\n };\n Coin.fromString = function (str) {\n var m = str.match(/^(-?[0-9]+(\\.[0-9]+)?)([a-zA-Z]+)$/);\n if (m === null) {\n throw new Error(\"failed to parse to Coin: \" + str);\n }\n var amount = m[1];\n var denom = m[3];\n return new Coin(denom, amount);\n };\n /**\n * Creates a new Coin adding to the current value.\n *\n * @param other\n */\n Coin.prototype.add = function (other) {\n var otherAmount;\n if (other instanceof Coin) {\n if (other.denom !== this.denom) {\n throw new Coin.ArithmeticError(\"cannot add two Coins of different denoms: \" + this.denom + \" and \" + other.denom);\n }\n otherAmount = other.amount;\n }\n else {\n otherAmount = other;\n }\n otherAmount = numeric_1.Numeric.parse(otherAmount);\n return new Coin(this.denom, this.amount.add(otherAmount));\n };\n /**\n * Creates a new Coin subtracting from the current value.\n * @param other\n */\n Coin.prototype.sub = function (other) {\n var otherAmount;\n if (other instanceof Coin) {\n if (other.denom !== this.denom) {\n throw new Coin.ArithmeticError(\"cannot subtract two Coins of different denoms: \" + this.denom + \" and \" + other.denom);\n }\n otherAmount = other.amount;\n }\n else {\n otherAmount = other;\n }\n otherAmount = numeric_1.Numeric.parse(otherAmount);\n return new Coin(this.denom, this.amount.sub(otherAmount));\n };\n /**\n * Multiplies the current value with an amount.\n * @param other\n */\n Coin.prototype.mul = function (other) {\n var otherAmount = numeric_1.Numeric.parse(other);\n return new Coin(this.denom, this.amount.mul(otherAmount));\n };\n /**\n * Divides the current value with an amount.\n * @param other\n */\n Coin.prototype.div = function (other) {\n var otherAmount = numeric_1.Numeric.parse(other);\n return new Coin(this.denom, this.amount.div(otherAmount));\n };\n /**\n * Modulo the current value with an amount.\n * @param other\n */\n Coin.prototype.mod = function (other) {\n var otherAmount = numeric_1.Numeric.parse(other);\n return new Coin(this.denom, this.amount.mod(otherAmount));\n };\n return Coin;\n}(json_1.JSONSerializable));\nexports.Coin = Coin;\n(function (Coin) {\n var ArithmeticError = /** @class */ (function () {\n function ArithmeticError(message) {\n this.message = message;\n }\n return ArithmeticError;\n }());\n Coin.ArithmeticError = ArithmeticError;\n})(Coin = exports.Coin || (exports.Coin = {}));\nexports.Coin = Coin;\n//# sourceMappingURL=Coin.js.map","(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n Buffer = require('buffer').Buffer;\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n }\n\n if (base === 16) {\n this._parseHex(number, start);\n } else {\n this._parseBase(number, base, start);\n }\n\n if (number[0] === '-') {\n this.negative = 1;\n }\n\n this.strip();\n\n if (endian !== 'le') return;\n\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [ number & 0x3ffffff ];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [ 0 ];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this.strip();\n };\n\n function parseHex (str, start, end) {\n var r = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r <<= 4;\n\n // 'a' - 'f'\n if (c >= 49 && c <= 54) {\n r |= c - 49 + 0xa;\n\n // 'A' - 'F'\n } else if (c >= 17 && c <= 22) {\n r |= c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n r |= c & 0xf;\n }\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n // Scan 24-bit chunks and add them to the number\n var off = 0;\n for (i = number.length - 6, j = 0; i >= start; i -= 6) {\n w = parseHex(number, i, i + 6);\n this.words[j] |= (w << off) & 0x3ffffff;\n // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb\n this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n if (i + 6 !== start) {\n w = parseHex(number, start, i + 6);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n }\n this.strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n r += c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n r += c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n r += c;\n }\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [ 0 ];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype.strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n BN.prototype.inspect = function inspect () {\n return (this.red ? '';\n };\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16);\n };\n\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n assert(typeof Buffer !== 'undefined');\n return this.toArrayLike(Buffer, endian, length);\n };\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n this.strip();\n var littleEndian = endian === 'le';\n var res = new ArrayType(reqLength);\n\n var b, i;\n var q = this.clone();\n if (!littleEndian) {\n // Assume big-endian\n for (i = 0; i < reqLength - byteLength; i++) {\n res[i] = 0;\n }\n\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n\n res[reqLength - i - 1] = b;\n }\n } else {\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n\n res[i] = b;\n }\n\n for (; i < reqLength; i++) {\n res[i] = 0;\n }\n }\n\n return res;\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this.strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this.strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this.strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n }\n\n // And remove leading zeroes\n return this.strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this.strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this.strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out.strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out.strip();\n }\n\n function jumboMulTo (self, num, out) {\n var fftm = new FFTM();\n return fftm.mulp(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out.strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n\n return this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this.strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this.strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n return this.strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) < num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this.strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this.strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this.strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q.strip();\n }\n a.strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n var half = num.ushrn(1);\n var r2 = num.andln(1);\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;\n\n // Round up\n return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n };\n\n BN.prototype.modn = function modn (num) {\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return acc;\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n return this.strip();\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this.strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n if (r.strip !== undefined) {\n // r is BN v4 instance\n r.strip();\n } else {\n // r is BN v5 instance\n r._strip();\n }\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n return a.umod(this.m)._forceRed(this);\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1).toRed(this);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})(typeof module === 'undefined' || module, this);\n","'use strict';\n\nvar assert = require('minimalistic-assert');\nvar inherits = require('inherits');\n\nexports.inherits = inherits;\n\nfunction isSurrogatePair(msg, i) {\n if ((msg.charCodeAt(i) & 0xFC00) !== 0xD800) {\n return false;\n }\n if (i < 0 || i + 1 >= msg.length) {\n return false;\n }\n return (msg.charCodeAt(i + 1) & 0xFC00) === 0xDC00;\n}\n\nfunction toArray(msg, enc) {\n if (Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg === 'string') {\n if (!enc) {\n // Inspired by stringToUtf8ByteArray() in closure-library by Google\n // https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143\n // Apache License 2.0\n // https://github.com/google/closure-library/blob/master/LICENSE\n var p = 0;\n for (var i = 0; i < msg.length; i++) {\n var c = msg.charCodeAt(i);\n if (c < 128) {\n res[p++] = c;\n } else if (c < 2048) {\n res[p++] = (c >> 6) | 192;\n res[p++] = (c & 63) | 128;\n } else if (isSurrogatePair(msg, i)) {\n c = 0x10000 + ((c & 0x03FF) << 10) + (msg.charCodeAt(++i) & 0x03FF);\n res[p++] = (c >> 18) | 240;\n res[p++] = ((c >> 12) & 63) | 128;\n res[p++] = ((c >> 6) & 63) | 128;\n res[p++] = (c & 63) | 128;\n } else {\n res[p++] = (c >> 12) | 224;\n res[p++] = ((c >> 6) & 63) | 128;\n res[p++] = (c & 63) | 128;\n }\n }\n } else if (enc === 'hex') {\n msg = msg.replace(/[^a-z0-9]+/ig, '');\n if (msg.length % 2 !== 0)\n msg = '0' + msg;\n for (i = 0; i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n }\n } else {\n for (i = 0; i < msg.length; i++)\n res[i] = msg[i] | 0;\n }\n return res;\n}\nexports.toArray = toArray;\n\nfunction toHex(msg) {\n var res = '';\n for (var i = 0; i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n}\nexports.toHex = toHex;\n\nfunction htonl(w) {\n var res = (w >>> 24) |\n ((w >>> 8) & 0xff00) |\n ((w << 8) & 0xff0000) |\n ((w & 0xff) << 24);\n return res >>> 0;\n}\nexports.htonl = htonl;\n\nfunction toHex32(msg, endian) {\n var res = '';\n for (var i = 0; i < msg.length; i++) {\n var w = msg[i];\n if (endian === 'little')\n w = htonl(w);\n res += zero8(w.toString(16));\n }\n return res;\n}\nexports.toHex32 = toHex32;\n\nfunction zero2(word) {\n if (word.length === 1)\n return '0' + word;\n else\n return word;\n}\nexports.zero2 = zero2;\n\nfunction zero8(word) {\n if (word.length === 7)\n return '0' + word;\n else if (word.length === 6)\n return '00' + word;\n else if (word.length === 5)\n return '000' + word;\n else if (word.length === 4)\n return '0000' + word;\n else if (word.length === 3)\n return '00000' + word;\n else if (word.length === 2)\n return '000000' + word;\n else if (word.length === 1)\n return '0000000' + word;\n else\n return word;\n}\nexports.zero8 = zero8;\n\nfunction join32(msg, start, end, endian) {\n var len = end - start;\n assert(len % 4 === 0);\n var res = new Array(len / 4);\n for (var i = 0, k = start; i < res.length; i++, k += 4) {\n var w;\n if (endian === 'big')\n w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];\n else\n w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];\n res[i] = w >>> 0;\n }\n return res;\n}\nexports.join32 = join32;\n\nfunction split32(msg, endian) {\n var res = new Array(msg.length * 4);\n for (var i = 0, k = 0; i < msg.length; i++, k += 4) {\n var m = msg[i];\n if (endian === 'big') {\n res[k] = m >>> 24;\n res[k + 1] = (m >>> 16) & 0xff;\n res[k + 2] = (m >>> 8) & 0xff;\n res[k + 3] = m & 0xff;\n } else {\n res[k + 3] = m >>> 24;\n res[k + 2] = (m >>> 16) & 0xff;\n res[k + 1] = (m >>> 8) & 0xff;\n res[k] = m & 0xff;\n }\n }\n return res;\n}\nexports.split32 = split32;\n\nfunction rotr32(w, b) {\n return (w >>> b) | (w << (32 - b));\n}\nexports.rotr32 = rotr32;\n\nfunction rotl32(w, b) {\n return (w << b) | (w >>> (32 - b));\n}\nexports.rotl32 = rotl32;\n\nfunction sum32(a, b) {\n return (a + b) >>> 0;\n}\nexports.sum32 = sum32;\n\nfunction sum32_3(a, b, c) {\n return (a + b + c) >>> 0;\n}\nexports.sum32_3 = sum32_3;\n\nfunction sum32_4(a, b, c, d) {\n return (a + b + c + d) >>> 0;\n}\nexports.sum32_4 = sum32_4;\n\nfunction sum32_5(a, b, c, d, e) {\n return (a + b + c + d + e) >>> 0;\n}\nexports.sum32_5 = sum32_5;\n\nfunction sum64(buf, pos, ah, al) {\n var bh = buf[pos];\n var bl = buf[pos + 1];\n\n var lo = (al + bl) >>> 0;\n var hi = (lo < al ? 1 : 0) + ah + bh;\n buf[pos] = hi >>> 0;\n buf[pos + 1] = lo;\n}\nexports.sum64 = sum64;\n\nfunction sum64_hi(ah, al, bh, bl) {\n var lo = (al + bl) >>> 0;\n var hi = (lo < al ? 1 : 0) + ah + bh;\n return hi >>> 0;\n}\nexports.sum64_hi = sum64_hi;\n\nfunction sum64_lo(ah, al, bh, bl) {\n var lo = al + bl;\n return lo >>> 0;\n}\nexports.sum64_lo = sum64_lo;\n\nfunction sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {\n var carry = 0;\n var lo = al;\n lo = (lo + bl) >>> 0;\n carry += lo < al ? 1 : 0;\n lo = (lo + cl) >>> 0;\n carry += lo < cl ? 1 : 0;\n lo = (lo + dl) >>> 0;\n carry += lo < dl ? 1 : 0;\n\n var hi = ah + bh + ch + dh + carry;\n return hi >>> 0;\n}\nexports.sum64_4_hi = sum64_4_hi;\n\nfunction sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {\n var lo = al + bl + cl + dl;\n return lo >>> 0;\n}\nexports.sum64_4_lo = sum64_4_lo;\n\nfunction sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var carry = 0;\n var lo = al;\n lo = (lo + bl) >>> 0;\n carry += lo < al ? 1 : 0;\n lo = (lo + cl) >>> 0;\n carry += lo < cl ? 1 : 0;\n lo = (lo + dl) >>> 0;\n carry += lo < dl ? 1 : 0;\n lo = (lo + el) >>> 0;\n carry += lo < el ? 1 : 0;\n\n var hi = ah + bh + ch + dh + eh + carry;\n return hi >>> 0;\n}\nexports.sum64_5_hi = sum64_5_hi;\n\nfunction sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var lo = al + bl + cl + dl + el;\n\n return lo >>> 0;\n}\nexports.sum64_5_lo = sum64_5_lo;\n\nfunction rotr64_hi(ah, al, num) {\n var r = (al << (32 - num)) | (ah >>> num);\n return r >>> 0;\n}\nexports.rotr64_hi = rotr64_hi;\n\nfunction rotr64_lo(ah, al, num) {\n var r = (ah << (32 - num)) | (al >>> num);\n return r >>> 0;\n}\nexports.rotr64_lo = rotr64_lo;\n\nfunction shr64_hi(ah, al, num) {\n return ah >>> num;\n}\nexports.shr64_hi = shr64_hi;\n\nfunction shr64_lo(ah, al, num) {\n var r = (ah << (32 - num)) | (al >>> num);\n return r >>> 0;\n}\nexports.shr64_lo = shr64_lo;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Convert = void 0;\nvar core_1 = require(\"../core\");\nvar PolicyConstraints_1 = require(\"../core/treasury/PolicyConstraints\");\nvar core_2 = require(\"../core\");\nvar Convert;\n(function (Convert) {\n Convert.id = function (c) { return c; };\n Convert.toDec = function (c) { return new core_2.Dec(c); };\n Convert.toString = function (c) { return c.toString(); };\n Convert.toFixed = function (c) { return c.toFixed(); };\n Convert.toNumber = Number.parseInt;\n Convert.toOracleWhitelist = function (c) {\n return c.map(function (v) { return ({\n name: v.name,\n tobin_tax: new core_2.Dec(v.tobin_tax),\n }); });\n };\n Convert.toVotingParams = function (c) { return ({\n voting_period: Number.parseInt(c.voting_period),\n }); };\n Convert.toDepositParams = function (c) { return ({\n min_deposit: core_1.Coins.fromData(c.min_deposit),\n max_deposit_period: Number.parseInt(c.max_deposit_period),\n }); };\n Convert.toTallyParams = function (c) { return ({\n quorum: new core_2.Dec(c.quorum),\n threshold: new core_2.Dec(c.threshold),\n veto: new core_2.Dec(c.veto),\n }); };\n Convert.toPolicyConstraints = PolicyConstraints_1.PolicyConstraints.fromData;\n Convert.toData = function (c) { return c.toData(); };\n Convert.serializeDepositParams = function (c) { return ({\n min_deposit: c.min_deposit.toData(),\n max_deposit_period: c.max_deposit_period.toFixed(),\n }); };\n Convert.serializeVotingParams = function (c) { return ({\n voting_period: c.voting_period.toFixed(),\n }); };\n Convert.serializeTallyParams = function (c) { return ({\n quorum: c.quorum.toString(),\n threshold: c.threshold.toString(),\n veto: c.veto.toString(),\n }); };\n Convert.serializeOracleWhitelist = function (c) {\n return c.map(function (v) { return ({\n name: v.name,\n tobin_tax: v.tobin_tax.toString(),\n }); });\n };\n})(Convert = exports.Convert || (exports.Convert = {}));\n//# sourceMappingURL=convert.js.map","try {\n var util = require('util');\n /* istanbul ignore next */\n if (typeof util.inherits !== 'function') throw '';\n module.exports = util.inherits;\n} catch (e) {\n /* istanbul ignore next */\n module.exports = require('./inherits_browser.js');\n}\n","import {\n AccAddress,\n Coins,\n Key,\n LCDClient,\n MsgExecuteContract,\n Wallet,\n MsgInstantiateContract\n} from '@terra-money/terra.js';\n\nimport { EmptyKey } from '../utils/EmptyKey';\n\nexport class ContractClient {\n public contractAddress?: AccAddress;\n\n public codeID?: number;\n\n public lcd?: LCDClient;\n\n public key: Key;\n\n constructor(\n options: Partial<{\n contractAddress: AccAddress;\n codeID: number;\n lcd: LCDClient;\n key: Key;\n }>\n ) {\n this.contractAddress = options.contractAddress;\n this.codeID = options.codeID;\n this.lcd = options.lcd;\n\n this.key = options.key ? options.key : new EmptyKey();\n }\n\n public get wallet(): Wallet {\n if (this.lcd === undefined) {\n throw new Error('LCDClient not provided - unable to create wallet');\n }\n\n return this.lcd.wallet(this.key);\n }\n\n protected async query(queryMmsg: any): Promise {\n if (!this.contractAddress) {\n throw new Error('contractAddress not provided - unable to query');\n }\n\n return this.wallet.lcd.wasm.contractQuery(\n this.contractAddress,\n queryMmsg\n );\n }\n\n protected createExecuteMsg(\n executeMsg: any,\n coins: Coins.Input = {}\n ): MsgExecuteContract {\n if (!this.contractAddress) {\n throw new Error(\n 'contractAddress not provided - unable to execute message'\n );\n }\n\n return new MsgExecuteContract(\n this.key.accAddress,\n this.contractAddress,\n executeMsg,\n coins\n );\n }\n\n protected createInstantiateMsg(\n initMsg: any,\n initCoins: Coins.Input = {},\n migratable: boolean\n ): MsgInstantiateContract {\n if (!this.codeID) {\n throw new Error('codeID not provided - unable to instantiate contract');\n }\n\n return new MsgInstantiateContract(\n this.key.accAddress,\n this.codeID,\n initMsg,\n initCoins,\n migratable\n );\n }\n}\n","module.exports = assert;\n\nfunction assert(val, msg) {\n if (!val)\n throw new Error(msg || 'Assertion failed');\n}\n\nassert.equal = function assertEqual(l, r, msg) {\n if (l != r)\n throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));\n};\n",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function (Math) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var Hasher = C_lib.Hasher;\n\t var C_algo = C.algo;\n\n\t // Initialization and round constants tables\n\t var H = [];\n\t var K = [];\n\n\t // Compute constants\n\t (function () {\n\t function isPrime(n) {\n\t var sqrtN = Math.sqrt(n);\n\t for (var factor = 2; factor <= sqrtN; factor++) {\n\t if (!(n % factor)) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t }\n\n\t function getFractionalBits(n) {\n\t return ((n - (n | 0)) * 0x100000000) | 0;\n\t }\n\n\t var n = 2;\n\t var nPrime = 0;\n\t while (nPrime < 64) {\n\t if (isPrime(n)) {\n\t if (nPrime < 8) {\n\t H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));\n\t }\n\t K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));\n\n\t nPrime++;\n\t }\n\n\t n++;\n\t }\n\t }());\n\n\t // Reusable object\n\t var W = [];\n\n\t /**\n\t * SHA-256 hash algorithm.\n\t */\n\t var SHA256 = C_algo.SHA256 = Hasher.extend({\n\t _doReset: function () {\n\t this._hash = new WordArray.init(H.slice(0));\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Shortcut\n\t var H = this._hash.words;\n\n\t // Working variables\n\t var a = H[0];\n\t var b = H[1];\n\t var c = H[2];\n\t var d = H[3];\n\t var e = H[4];\n\t var f = H[5];\n\t var g = H[6];\n\t var h = H[7];\n\n\t // Computation\n\t for (var i = 0; i < 64; i++) {\n\t if (i < 16) {\n\t W[i] = M[offset + i] | 0;\n\t } else {\n\t var gamma0x = W[i - 15];\n\t var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^\n\t ((gamma0x << 14) | (gamma0x >>> 18)) ^\n\t (gamma0x >>> 3);\n\n\t var gamma1x = W[i - 2];\n\t var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^\n\t ((gamma1x << 13) | (gamma1x >>> 19)) ^\n\t (gamma1x >>> 10);\n\n\t W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];\n\t }\n\n\t var ch = (e & f) ^ (~e & g);\n\t var maj = (a & b) ^ (a & c) ^ (b & c);\n\n\t var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));\n\t var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));\n\n\t var t1 = h + sigma1 + ch + K[i] + W[i];\n\t var t2 = sigma0 + maj;\n\n\t h = g;\n\t g = f;\n\t f = e;\n\t e = (d + t1) | 0;\n\t d = c;\n\t c = b;\n\t b = a;\n\t a = (t1 + t2) | 0;\n\t }\n\n\t // Intermediate hash value\n\t H[0] = (H[0] + a) | 0;\n\t H[1] = (H[1] + b) | 0;\n\t H[2] = (H[2] + c) | 0;\n\t H[3] = (H[3] + d) | 0;\n\t H[4] = (H[4] + e) | 0;\n\t H[5] = (H[5] + f) | 0;\n\t H[6] = (H[6] + g) | 0;\n\t H[7] = (H[7] + h) | 0;\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;\n\t data.sigBytes = dataWords.length * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Return final computed hash\n\t return this._hash;\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\t clone._hash = this._hash.clone();\n\n\t return clone;\n\t }\n\t });\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.SHA256('message');\n\t * var hash = CryptoJS.SHA256(wordArray);\n\t */\n\t C.SHA256 = Hasher._createHelper(SHA256);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacSHA256(message, key);\n\t */\n\t C.HmacSHA256 = Hasher._createHmacHelper(SHA256);\n\t}(Math));\n\n\n\treturn CryptoJS.SHA256;\n\n}));","module.exports = require(\"util\");","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n'use strict';\n\n/**/\n\nvar pna = require('process-nextick-args');\n/**/\n\n/**/\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n keys.push(key);\n }return keys;\n};\n/**/\n\nmodule.exports = Duplex;\n\n/**/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/**/\n\nvar Readable = require('./_stream_readable');\nvar Writable = require('./_stream_writable');\n\nutil.inherits(Duplex, Readable);\n\n{\n // avoid scope creep, the keys array can then be collected\n var keys = objectKeys(Writable.prototype);\n for (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n }\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex)) return new Duplex(options);\n\n Readable.call(this, options);\n Writable.call(this, options);\n\n if (options && options.readable === false) this.readable = false;\n\n if (options && options.writable === false) this.writable = false;\n\n this.allowHalfOpen = true;\n if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\n\n this.once('end', onend);\n}\n\nObject.defineProperty(Duplex.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// the no-half-open enforcer\nfunction onend() {\n // if we allow half-open state, or if the writable side ended,\n // then we're ok.\n if (this.allowHalfOpen || this._writableState.ended) return;\n\n // no more data can be written.\n // But allow more writes to happen in this tick.\n pna.nextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined || this._writableState === undefined) {\n return false;\n }\n return this._readableState.destroyed && this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (this._readableState === undefined || this._writableState === undefined) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n this._writableState.destroyed = value;\n }\n});\n\nDuplex.prototype._destroy = function (err, cb) {\n this.push(null);\n this.end();\n\n pna.nextTick(cb, err);\n};","module.exports = require(\"crypto\");","/*! safe-buffer. MIT License. Feross Aboukhadijeh */\n/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.prototype = Object.create(Buffer.prototype)\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","'use strict';\n\nvar utils = require('./utils');\nvar assert = require('minimalistic-assert');\n\nfunction BlockHash() {\n this.pending = null;\n this.pendingTotal = 0;\n this.blockSize = this.constructor.blockSize;\n this.outSize = this.constructor.outSize;\n this.hmacStrength = this.constructor.hmacStrength;\n this.padLength = this.constructor.padLength / 8;\n this.endian = 'big';\n\n this._delta8 = this.blockSize / 8;\n this._delta32 = this.blockSize / 32;\n}\nexports.BlockHash = BlockHash;\n\nBlockHash.prototype.update = function update(msg, enc) {\n // Convert message to array, pad it, and join into 32bit blocks\n msg = utils.toArray(msg, enc);\n if (!this.pending)\n this.pending = msg;\n else\n this.pending = this.pending.concat(msg);\n this.pendingTotal += msg.length;\n\n // Enough data, try updating\n if (this.pending.length >= this._delta8) {\n msg = this.pending;\n\n // Process pending data in blocks\n var r = msg.length % this._delta8;\n this.pending = msg.slice(msg.length - r, msg.length);\n if (this.pending.length === 0)\n this.pending = null;\n\n msg = utils.join32(msg, 0, msg.length - r, this.endian);\n for (var i = 0; i < msg.length; i += this._delta32)\n this._update(msg, i, i + this._delta32);\n }\n\n return this;\n};\n\nBlockHash.prototype.digest = function digest(enc) {\n this.update(this._pad());\n assert(this.pending === null);\n\n return this._digest(enc);\n};\n\nBlockHash.prototype._pad = function pad() {\n var len = this.pendingTotal;\n var bytes = this._delta8;\n var k = bytes - ((len + this.padLength) % bytes);\n var res = new Array(k + this.padLength);\n res[0] = 0x80;\n for (var i = 1; i < k; i++)\n res[i] = 0;\n\n // Append length\n len <<= 3;\n if (this.endian === 'big') {\n for (var t = 8; t < this.padLength; t++)\n res[i++] = 0;\n\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = (len >>> 24) & 0xff;\n res[i++] = (len >>> 16) & 0xff;\n res[i++] = (len >>> 8) & 0xff;\n res[i++] = len & 0xff;\n } else {\n res[i++] = len & 0xff;\n res[i++] = (len >>> 8) & 0xff;\n res[i++] = (len >>> 16) & 0xff;\n res[i++] = (len >>> 24) & 0xff;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n\n for (t = 8; t < this.padLength; t++)\n res[i++] = 0;\n }\n\n return res;\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\n\nfunction isArray(arg) {\n if (Array.isArray) {\n return Array.isArray(arg);\n }\n return objectToString(arg) === '[object Array]';\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = Buffer.isBuffer;\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Msg = void 0;\nvar msgs_1 = require(\"./bank/msgs\");\nvar msgs_2 = require(\"./distribution/msgs\");\nvar msgs_3 = require(\"./gov/msgs\");\nvar msgs_4 = require(\"./market/msgs\");\nvar msgs_5 = require(\"./msgauth/msgs\");\nvar msgs_6 = require(\"./oracle/msgs\");\nvar msgs_7 = require(\"./slashing/msgs\");\nvar msgs_8 = require(\"./staking/msgs\");\nvar msgs_9 = require(\"./wasm/msgs\");\nvar Msg;\n(function (Msg) {\n function fromData(data) {\n switch (data.type) {\n // bank\n case 'bank/MsgSend':\n return msgs_1.MsgSend.fromData(data);\n case 'bank/MsgMultiSend':\n return msgs_1.MsgMultiSend.fromData(data);\n // distribution\n case 'distribution/MsgModifyWithdrawAddress':\n return msgs_2.MsgModifyWithdrawAddress.fromData(data);\n case 'distribution/MsgWithdrawDelegationReward':\n return msgs_2.MsgWithdrawDelegationReward.fromData(data);\n case 'distribution/MsgWithdrawValidatorCommission':\n return msgs_2.MsgWithdrawValidatorCommission.fromData(data);\n case 'distribution/MsgFundCommunityPool':\n return msgs_2.MsgFundCommunityPool.fromData(data);\n // gov\n case 'gov/MsgDeposit':\n return msgs_3.MsgDeposit.fromData(data);\n case 'gov/MsgSubmitProposal':\n return msgs_3.MsgSubmitProposal.fromData(data);\n case 'gov/MsgVote':\n return msgs_3.MsgVote.fromData(data);\n // market\n case 'market/MsgSwap':\n return msgs_4.MsgSwap.fromData(data);\n case 'market/MsgSwapSend':\n return msgs_4.MsgSwapSend.fromData(data);\n // msgauth\n case 'msgauth/MsgGrantAuthorization':\n return msgs_5.MsgGrantAuthorization.fromData(data);\n case 'msgauth/MsgRevokeAuthorization':\n return msgs_5.MsgRevokeAuthorization.fromData(data);\n case 'msgauth/MsgExecAuthorized':\n return msgs_5.MsgExecAuthorized.fromData(data);\n // oracle\n case 'oracle/MsgExchangeRateVote':\n return msgs_6.MsgExchangeRateVote.fromData(data);\n case 'oracle/MsgExchangeRatePrevote':\n return msgs_6.MsgExchangeRatePrevote.fromData(data);\n case 'oracle/MsgDelegateFeedConsent':\n return msgs_6.MsgDelegateFeedConsent.fromData(data);\n case 'oracle/MsgAggregateExchangeRatePrevote':\n return msgs_6.MsgAggregateExchangeRatePrevote.fromData(data);\n case 'oracle/MsgAggregateExchangeRateVote':\n return msgs_6.MsgAggregateExchangeRateVote.fromData(data);\n // slashing\n case 'cosmos/MsgUnjail':\n return msgs_7.MsgUnjail.fromData(data);\n // staking\n case 'staking/MsgDelegate':\n return msgs_8.MsgDelegate.fromData(data);\n case 'staking/MsgUndelegate':\n return msgs_8.MsgUndelegate.fromData(data);\n case 'staking/MsgBeginRedelegate':\n return msgs_8.MsgBeginRedelegate.fromData(data);\n case 'staking/MsgCreateValidator':\n return msgs_8.MsgCreateValidator.fromData(data);\n case 'staking/MsgEditValidator':\n return msgs_8.MsgEditValidator.fromData(data);\n // wasm\n case 'wasm/MsgStoreCode':\n return msgs_9.MsgStoreCode.fromData(data);\n case 'wasm/MsgInstantiateContract':\n return msgs_9.MsgInstantiateContract.fromData(data);\n case 'wasm/MsgExecuteContract':\n return msgs_9.MsgExecuteContract.fromData(data);\n case 'wasm/MsgMigrateContract':\n return msgs_9.MsgMigrateContract.fromData(data);\n case 'wasm/MsgUpdateContractOwner':\n return msgs_9.MsgUpdateContractOwner.fromData(data);\n }\n }\n Msg.fromData = fromData;\n})(Msg = exports.Msg || (exports.Msg = {}));\n//# sourceMappingURL=Msg.js.map",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory();\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\troot.CryptoJS = factory();\n\t}\n}(this, function () {\n\n\t/**\n\t * CryptoJS core components.\n\t */\n\tvar CryptoJS = CryptoJS || (function (Math, undefined) {\n\t /*\n\t * Local polyfil of Object.create\n\t */\n\t var create = Object.create || (function () {\n\t function F() {};\n\n\t return function (obj) {\n\t var subtype;\n\n\t F.prototype = obj;\n\n\t subtype = new F();\n\n\t F.prototype = null;\n\n\t return subtype;\n\t };\n\t }())\n\n\t /**\n\t * CryptoJS namespace.\n\t */\n\t var C = {};\n\n\t /**\n\t * Library namespace.\n\t */\n\t var C_lib = C.lib = {};\n\n\t /**\n\t * Base object for prototypal inheritance.\n\t */\n\t var Base = C_lib.Base = (function () {\n\n\n\t return {\n\t /**\n\t * Creates a new object that inherits from this object.\n\t *\n\t * @param {Object} overrides Properties to copy into the new object.\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * field: 'value',\n\t *\n\t * method: function () {\n\t * }\n\t * });\n\t */\n\t extend: function (overrides) {\n\t // Spawn\n\t var subtype = create(this);\n\n\t // Augment\n\t if (overrides) {\n\t subtype.mixIn(overrides);\n\t }\n\n\t // Create default initializer\n\t if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {\n\t subtype.init = function () {\n\t subtype.$super.init.apply(this, arguments);\n\t };\n\t }\n\n\t // Initializer's prototype is the subtype object\n\t subtype.init.prototype = subtype;\n\n\t // Reference supertype\n\t subtype.$super = this;\n\n\t return subtype;\n\t },\n\n\t /**\n\t * Extends this object and runs the init method.\n\t * Arguments to create() will be passed to init().\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var instance = MyType.create();\n\t */\n\t create: function () {\n\t var instance = this.extend();\n\t instance.init.apply(instance, arguments);\n\n\t return instance;\n\t },\n\n\t /**\n\t * Initializes a newly created object.\n\t * Override this method to add some logic when your objects are created.\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * init: function () {\n\t * // ...\n\t * }\n\t * });\n\t */\n\t init: function () {\n\t },\n\n\t /**\n\t * Copies properties into this object.\n\t *\n\t * @param {Object} properties The properties to mix in.\n\t *\n\t * @example\n\t *\n\t * MyType.mixIn({\n\t * field: 'value'\n\t * });\n\t */\n\t mixIn: function (properties) {\n\t for (var propertyName in properties) {\n\t if (properties.hasOwnProperty(propertyName)) {\n\t this[propertyName] = properties[propertyName];\n\t }\n\t }\n\n\t // IE won't copy toString using the loop above\n\t if (properties.hasOwnProperty('toString')) {\n\t this.toString = properties.toString;\n\t }\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = instance.clone();\n\t */\n\t clone: function () {\n\t return this.init.prototype.extend(this);\n\t }\n\t };\n\t }());\n\n\t /**\n\t * An array of 32-bit words.\n\t *\n\t * @property {Array} words The array of 32-bit words.\n\t * @property {number} sigBytes The number of significant bytes in this word array.\n\t */\n\t var WordArray = C_lib.WordArray = Base.extend({\n\t /**\n\t * Initializes a newly created word array.\n\t *\n\t * @param {Array} words (Optional) An array of 32-bit words.\n\t * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.create();\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);\n\t */\n\t init: function (words, sigBytes) {\n\t words = this.words = words || [];\n\n\t if (sigBytes != undefined) {\n\t this.sigBytes = sigBytes;\n\t } else {\n\t this.sigBytes = words.length * 4;\n\t }\n\t },\n\n\t /**\n\t * Converts this word array to a string.\n\t *\n\t * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex\n\t *\n\t * @return {string} The stringified word array.\n\t *\n\t * @example\n\t *\n\t * var string = wordArray + '';\n\t * var string = wordArray.toString();\n\t * var string = wordArray.toString(CryptoJS.enc.Utf8);\n\t */\n\t toString: function (encoder) {\n\t return (encoder || Hex).stringify(this);\n\t },\n\n\t /**\n\t * Concatenates a word array to this word array.\n\t *\n\t * @param {WordArray} wordArray The word array to append.\n\t *\n\t * @return {WordArray} This word array.\n\t *\n\t * @example\n\t *\n\t * wordArray1.concat(wordArray2);\n\t */\n\t concat: function (wordArray) {\n\t // Shortcuts\n\t var thisWords = this.words;\n\t var thatWords = wordArray.words;\n\t var thisSigBytes = this.sigBytes;\n\t var thatSigBytes = wordArray.sigBytes;\n\n\t // Clamp excess bits\n\t this.clamp();\n\n\t // Concat\n\t if (thisSigBytes % 4) {\n\t // Copy one byte at a time\n\t for (var i = 0; i < thatSigBytes; i++) {\n\t var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);\n\t }\n\t } else {\n\t // Copy one word at a time\n\t for (var i = 0; i < thatSigBytes; i += 4) {\n\t thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];\n\t }\n\t }\n\t this.sigBytes += thatSigBytes;\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Removes insignificant bits.\n\t *\n\t * @example\n\t *\n\t * wordArray.clamp();\n\t */\n\t clamp: function () {\n\t // Shortcuts\n\t var words = this.words;\n\t var sigBytes = this.sigBytes;\n\n\t // Clamp\n\t words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);\n\t words.length = Math.ceil(sigBytes / 4);\n\t },\n\n\t /**\n\t * Creates a copy of this word array.\n\t *\n\t * @return {WordArray} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = wordArray.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone.words = this.words.slice(0);\n\n\t return clone;\n\t },\n\n\t /**\n\t * Creates a word array filled with random bytes.\n\t *\n\t * @param {number} nBytes The number of random bytes to generate.\n\t *\n\t * @return {WordArray} The random word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.random(16);\n\t */\n\t random: function (nBytes) {\n\t var words = [];\n\n\t var r = (function (m_w) {\n\t var m_w = m_w;\n\t var m_z = 0x3ade68b1;\n\t var mask = 0xffffffff;\n\n\t return function () {\n\t m_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask;\n\t m_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask;\n\t var result = ((m_z << 0x10) + m_w) & mask;\n\t result /= 0x100000000;\n\t result += 0.5;\n\t return result * (Math.random() > .5 ? 1 : -1);\n\t }\n\t });\n\n\t for (var i = 0, rcache; i < nBytes; i += 4) {\n\t var _r = r((rcache || Math.random()) * 0x100000000);\n\n\t rcache = _r() * 0x3ade67b7;\n\t words.push((_r() * 0x100000000) | 0);\n\t }\n\n\t return new WordArray.init(words, nBytes);\n\t }\n\t });\n\n\t /**\n\t * Encoder namespace.\n\t */\n\t var C_enc = C.enc = {};\n\n\t /**\n\t * Hex encoding strategy.\n\t */\n\t var Hex = C_enc.Hex = {\n\t /**\n\t * Converts a word array to a hex string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The hex string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hexString = CryptoJS.enc.Hex.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var hexChars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t hexChars.push((bite >>> 4).toString(16));\n\t hexChars.push((bite & 0x0f).toString(16));\n\t }\n\n\t return hexChars.join('');\n\t },\n\n\t /**\n\t * Converts a hex string to a word array.\n\t *\n\t * @param {string} hexStr The hex string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Hex.parse(hexString);\n\t */\n\t parse: function (hexStr) {\n\t // Shortcut\n\t var hexStrLength = hexStr.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < hexStrLength; i += 2) {\n\t words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);\n\t }\n\n\t return new WordArray.init(words, hexStrLength / 2);\n\t }\n\t };\n\n\t /**\n\t * Latin1 encoding strategy.\n\t */\n\t var Latin1 = C_enc.Latin1 = {\n\t /**\n\t * Converts a word array to a Latin1 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The Latin1 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var latin1Chars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t latin1Chars.push(String.fromCharCode(bite));\n\t }\n\n\t return latin1Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Latin1 string to a word array.\n\t *\n\t * @param {string} latin1Str The Latin1 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);\n\t */\n\t parse: function (latin1Str) {\n\t // Shortcut\n\t var latin1StrLength = latin1Str.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < latin1StrLength; i++) {\n\t words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);\n\t }\n\n\t return new WordArray.init(words, latin1StrLength);\n\t }\n\t };\n\n\t /**\n\t * UTF-8 encoding strategy.\n\t */\n\t var Utf8 = C_enc.Utf8 = {\n\t /**\n\t * Converts a word array to a UTF-8 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The UTF-8 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t try {\n\t return decodeURIComponent(escape(Latin1.stringify(wordArray)));\n\t } catch (e) {\n\t throw new Error('Malformed UTF-8 data');\n\t }\n\t },\n\n\t /**\n\t * Converts a UTF-8 string to a word array.\n\t *\n\t * @param {string} utf8Str The UTF-8 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);\n\t */\n\t parse: function (utf8Str) {\n\t return Latin1.parse(unescape(encodeURIComponent(utf8Str)));\n\t }\n\t };\n\n\t /**\n\t * Abstract buffered block algorithm template.\n\t *\n\t * The property blockSize must be implemented in a concrete subtype.\n\t *\n\t * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0\n\t */\n\t var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({\n\t /**\n\t * Resets this block algorithm's data buffer to its initial state.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm.reset();\n\t */\n\t reset: function () {\n\t // Initial values\n\t this._data = new WordArray.init();\n\t this._nDataBytes = 0;\n\t },\n\n\t /**\n\t * Adds new data to this block algorithm's buffer.\n\t *\n\t * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm._append('data');\n\t * bufferedBlockAlgorithm._append(wordArray);\n\t */\n\t _append: function (data) {\n\t // Convert string to WordArray, else assume WordArray already\n\t if (typeof data == 'string') {\n\t data = Utf8.parse(data);\n\t }\n\n\t // Append\n\t this._data.concat(data);\n\t this._nDataBytes += data.sigBytes;\n\t },\n\n\t /**\n\t * Processes available data blocks.\n\t *\n\t * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.\n\t *\n\t * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.\n\t *\n\t * @return {WordArray} The processed data.\n\t *\n\t * @example\n\t *\n\t * var processedData = bufferedBlockAlgorithm._process();\n\t * var processedData = bufferedBlockAlgorithm._process(!!'flush');\n\t */\n\t _process: function (doFlush) {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\t var dataSigBytes = data.sigBytes;\n\t var blockSize = this.blockSize;\n\t var blockSizeBytes = blockSize * 4;\n\n\t // Count blocks ready\n\t var nBlocksReady = dataSigBytes / blockSizeBytes;\n\t if (doFlush) {\n\t // Round up to include partial blocks\n\t nBlocksReady = Math.ceil(nBlocksReady);\n\t } else {\n\t // Round down to include only full blocks,\n\t // less the number of blocks that must remain in the buffer\n\t nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);\n\t }\n\n\t // Count words ready\n\t var nWordsReady = nBlocksReady * blockSize;\n\n\t // Count bytes ready\n\t var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);\n\n\t // Process blocks\n\t if (nWordsReady) {\n\t for (var offset = 0; offset < nWordsReady; offset += blockSize) {\n\t // Perform concrete-algorithm logic\n\t this._doProcessBlock(dataWords, offset);\n\t }\n\n\t // Remove processed words\n\t var processedWords = dataWords.splice(0, nWordsReady);\n\t data.sigBytes -= nBytesReady;\n\t }\n\n\t // Return processed words\n\t return new WordArray.init(processedWords, nBytesReady);\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = bufferedBlockAlgorithm.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone._data = this._data.clone();\n\n\t return clone;\n\t },\n\n\t _minBufferSize: 0\n\t });\n\n\t /**\n\t * Abstract hasher template.\n\t *\n\t * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)\n\t */\n\t var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({\n\t /**\n\t * Configuration options.\n\t */\n\t cfg: Base.extend(),\n\n\t /**\n\t * Initializes a newly created hasher.\n\t *\n\t * @param {Object} cfg (Optional) The configuration options to use for this hash computation.\n\t *\n\t * @example\n\t *\n\t * var hasher = CryptoJS.algo.SHA256.create();\n\t */\n\t init: function (cfg) {\n\t // Apply config defaults\n\t this.cfg = this.cfg.extend(cfg);\n\n\t // Set initial values\n\t this.reset();\n\t },\n\n\t /**\n\t * Resets this hasher to its initial state.\n\t *\n\t * @example\n\t *\n\t * hasher.reset();\n\t */\n\t reset: function () {\n\t // Reset data buffer\n\t BufferedBlockAlgorithm.reset.call(this);\n\n\t // Perform concrete-hasher logic\n\t this._doReset();\n\t },\n\n\t /**\n\t * Updates this hasher with a message.\n\t *\n\t * @param {WordArray|string} messageUpdate The message to append.\n\t *\n\t * @return {Hasher} This hasher.\n\t *\n\t * @example\n\t *\n\t * hasher.update('message');\n\t * hasher.update(wordArray);\n\t */\n\t update: function (messageUpdate) {\n\t // Append\n\t this._append(messageUpdate);\n\n\t // Update the hash\n\t this._process();\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Finalizes the hash computation.\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\n\t *\n\t * @param {WordArray|string} messageUpdate (Optional) A final message update.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @example\n\t *\n\t * var hash = hasher.finalize();\n\t * var hash = hasher.finalize('message');\n\t * var hash = hasher.finalize(wordArray);\n\t */\n\t finalize: function (messageUpdate) {\n\t // Final message update\n\t if (messageUpdate) {\n\t this._append(messageUpdate);\n\t }\n\n\t // Perform concrete-hasher logic\n\t var hash = this._doFinalize();\n\n\t return hash;\n\t },\n\n\t blockSize: 512/32,\n\n\t /**\n\t * Creates a shortcut function to a hasher's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to create a helper for.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHelper: function (hasher) {\n\t return function (message, cfg) {\n\t return new hasher.init(cfg).finalize(message);\n\t };\n\t },\n\n\t /**\n\t * Creates a shortcut function to the HMAC's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to use in this HMAC helper.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHmacHelper: function (hasher) {\n\t return function (message, key) {\n\t return new C_algo.HMAC.init(hasher, key).finalize(message);\n\t };\n\t }\n\t });\n\n\t /**\n\t * Algorithm namespace.\n\t */\n\t var C_algo = C.algo = {};\n\n\t return C;\n\t}(Math));\n\n\n\treturn CryptoJS;\n\n}));","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PublicKey = void 0;\nvar json_1 = require(\"../util/json\");\nvar PublicKey = /** @class */ (function (_super) {\n __extends(PublicKey, _super);\n function PublicKey(type, value) {\n var _this = _super.call(this) || this;\n _this.type = type;\n _this.value = value;\n return _this;\n }\n PublicKey.fromData = function (data) {\n var type = data.type, value = data.value;\n return new PublicKey(type, value);\n };\n PublicKey.prototype.toData = function () {\n var _a = this, type = _a.type, value = _a.value;\n if (type === 'tendermint/PubKeySecp256k1' && typeof value === 'string') {\n return {\n type: type,\n value: value,\n };\n }\n else if (type === 'tendermint/PubKeyMultisigThreshold' &&\n typeof value !== 'string') {\n return {\n type: type,\n value: value,\n };\n }\n throw new TypeError('invalid public key: type and value do not match');\n };\n return PublicKey;\n}(json_1.JSONSerializable));\nexports.PublicKey = PublicKey;\n//# sourceMappingURL=PublicKey.js.map","'use strict';\n\nvar BN = require('bn.js');\nvar utils = require('../utils');\nvar getNAF = utils.getNAF;\nvar getJSF = utils.getJSF;\nvar assert = utils.assert;\n\nfunction BaseCurve(type, conf) {\n this.type = type;\n this.p = new BN(conf.p, 16);\n\n // Use Montgomery, when there is no fast reduction for the prime\n this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);\n\n // Useful for many curves\n this.zero = new BN(0).toRed(this.red);\n this.one = new BN(1).toRed(this.red);\n this.two = new BN(2).toRed(this.red);\n\n // Curve configuration, optional\n this.n = conf.n && new BN(conf.n, 16);\n this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);\n\n // Temporary arrays\n this._wnafT1 = new Array(4);\n this._wnafT2 = new Array(4);\n this._wnafT3 = new Array(4);\n this._wnafT4 = new Array(4);\n\n this._bitLength = this.n ? this.n.bitLength() : 0;\n\n // Generalized Greg Maxwell's trick\n var adjustCount = this.n && this.p.div(this.n);\n if (!adjustCount || adjustCount.cmpn(100) > 0) {\n this.redN = null;\n } else {\n this._maxwellTrick = true;\n this.redN = this.n.toRed(this.red);\n }\n}\nmodule.exports = BaseCurve;\n\nBaseCurve.prototype.point = function point() {\n throw new Error('Not implemented');\n};\n\nBaseCurve.prototype.validate = function validate() {\n throw new Error('Not implemented');\n};\n\nBaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {\n assert(p.precomputed);\n var doubles = p._getDoubles();\n\n var naf = getNAF(k, 1, this._bitLength);\n var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1);\n I /= 3;\n\n // Translate into more windowed form\n var repr = [];\n for (var j = 0; j < naf.length; j += doubles.step) {\n var nafW = 0;\n for (var k = j + doubles.step - 1; k >= j; k--)\n nafW = (nafW << 1) + naf[k];\n repr.push(nafW);\n }\n\n var a = this.jpoint(null, null, null);\n var b = this.jpoint(null, null, null);\n for (var i = I; i > 0; i--) {\n for (var j = 0; j < repr.length; j++) {\n var nafW = repr[j];\n if (nafW === i)\n b = b.mixedAdd(doubles.points[j]);\n else if (nafW === -i)\n b = b.mixedAdd(doubles.points[j].neg());\n }\n a = a.add(b);\n }\n return a.toP();\n};\n\nBaseCurve.prototype._wnafMul = function _wnafMul(p, k) {\n var w = 4;\n\n // Precompute window\n var nafPoints = p._getNAFPoints(w);\n w = nafPoints.wnd;\n var wnd = nafPoints.points;\n\n // Get NAF form\n var naf = getNAF(k, w, this._bitLength);\n\n // Add `this`*(N+1) for every w-NAF index\n var acc = this.jpoint(null, null, null);\n for (var i = naf.length - 1; i >= 0; i--) {\n // Count zeroes\n for (var k = 0; i >= 0 && naf[i] === 0; i--)\n k++;\n if (i >= 0)\n k++;\n acc = acc.dblp(k);\n\n if (i < 0)\n break;\n var z = naf[i];\n assert(z !== 0);\n if (p.type === 'affine') {\n // J +- P\n if (z > 0)\n acc = acc.mixedAdd(wnd[(z - 1) >> 1]);\n else\n acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg());\n } else {\n // J +- J\n if (z > 0)\n acc = acc.add(wnd[(z - 1) >> 1]);\n else\n acc = acc.add(wnd[(-z - 1) >> 1].neg());\n }\n }\n return p.type === 'affine' ? acc.toP() : acc;\n};\n\nBaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW,\n points,\n coeffs,\n len,\n jacobianResult) {\n var wndWidth = this._wnafT1;\n var wnd = this._wnafT2;\n var naf = this._wnafT3;\n\n // Fill all arrays\n var max = 0;\n for (var i = 0; i < len; i++) {\n var p = points[i];\n var nafPoints = p._getNAFPoints(defW);\n wndWidth[i] = nafPoints.wnd;\n wnd[i] = nafPoints.points;\n }\n\n // Comb small window NAFs\n for (var i = len - 1; i >= 1; i -= 2) {\n var a = i - 1;\n var b = i;\n if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {\n naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength);\n naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength);\n max = Math.max(naf[a].length, max);\n max = Math.max(naf[b].length, max);\n continue;\n }\n\n var comb = [\n points[a], /* 1 */\n null, /* 3 */\n null, /* 5 */\n points[b] /* 7 */\n ];\n\n // Try to avoid Projective points, if possible\n if (points[a].y.cmp(points[b].y) === 0) {\n comb[1] = points[a].add(points[b]);\n comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {\n comb[1] = points[a].toJ().mixedAdd(points[b]);\n comb[2] = points[a].add(points[b].neg());\n } else {\n comb[1] = points[a].toJ().mixedAdd(points[b]);\n comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n }\n\n var index = [\n -3, /* -1 -1 */\n -1, /* -1 0 */\n -5, /* -1 1 */\n -7, /* 0 -1 */\n 0, /* 0 0 */\n 7, /* 0 1 */\n 5, /* 1 -1 */\n 1, /* 1 0 */\n 3 /* 1 1 */\n ];\n\n var jsf = getJSF(coeffs[a], coeffs[b]);\n max = Math.max(jsf[0].length, max);\n naf[a] = new Array(max);\n naf[b] = new Array(max);\n for (var j = 0; j < max; j++) {\n var ja = jsf[0][j] | 0;\n var jb = jsf[1][j] | 0;\n\n naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];\n naf[b][j] = 0;\n wnd[a] = comb;\n }\n }\n\n var acc = this.jpoint(null, null, null);\n var tmp = this._wnafT4;\n for (var i = max; i >= 0; i--) {\n var k = 0;\n\n while (i >= 0) {\n var zero = true;\n for (var j = 0; j < len; j++) {\n tmp[j] = naf[j][i] | 0;\n if (tmp[j] !== 0)\n zero = false;\n }\n if (!zero)\n break;\n k++;\n i--;\n }\n if (i >= 0)\n k++;\n acc = acc.dblp(k);\n if (i < 0)\n break;\n\n for (var j = 0; j < len; j++) {\n var z = tmp[j];\n var p;\n if (z === 0)\n continue;\n else if (z > 0)\n p = wnd[j][(z - 1) >> 1];\n else if (z < 0)\n p = wnd[j][(-z - 1) >> 1].neg();\n\n if (p.type === 'affine')\n acc = acc.mixedAdd(p);\n else\n acc = acc.add(p);\n }\n }\n // Zeroify references\n for (var i = 0; i < len; i++)\n wnd[i] = null;\n\n if (jacobianResult)\n return acc;\n else\n return acc.toP();\n};\n\nfunction BasePoint(curve, type) {\n this.curve = curve;\n this.type = type;\n this.precomputed = null;\n}\nBaseCurve.BasePoint = BasePoint;\n\nBasePoint.prototype.eq = function eq(/*other*/) {\n throw new Error('Not implemented');\n};\n\nBasePoint.prototype.validate = function validate() {\n return this.curve.validate(this);\n};\n\nBaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {\n bytes = utils.toArray(bytes, enc);\n\n var len = this.p.byteLength();\n\n // uncompressed, hybrid-odd, hybrid-even\n if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) &&\n bytes.length - 1 === 2 * len) {\n if (bytes[0] === 0x06)\n assert(bytes[bytes.length - 1] % 2 === 0);\n else if (bytes[0] === 0x07)\n assert(bytes[bytes.length - 1] % 2 === 1);\n\n var res = this.point(bytes.slice(1, 1 + len),\n bytes.slice(1 + len, 1 + 2 * len));\n\n return res;\n } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) &&\n bytes.length - 1 === len) {\n return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03);\n }\n throw new Error('Unknown point format');\n};\n\nBasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {\n return this.encode(enc, true);\n};\n\nBasePoint.prototype._encode = function _encode(compact) {\n var len = this.curve.p.byteLength();\n var x = this.getX().toArray('be', len);\n\n if (compact)\n return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x);\n\n return [ 0x04 ].concat(x, this.getY().toArray('be', len)) ;\n};\n\nBasePoint.prototype.encode = function encode(enc, compact) {\n return utils.encode(this._encode(compact), enc);\n};\n\nBasePoint.prototype.precompute = function precompute(power) {\n if (this.precomputed)\n return this;\n\n var precomputed = {\n doubles: null,\n naf: null,\n beta: null\n };\n precomputed.naf = this._getNAFPoints(8);\n precomputed.doubles = this._getDoubles(4, power);\n precomputed.beta = this._getBeta();\n this.precomputed = precomputed;\n\n return this;\n};\n\nBasePoint.prototype._hasDoubles = function _hasDoubles(k) {\n if (!this.precomputed)\n return false;\n\n var doubles = this.precomputed.doubles;\n if (!doubles)\n return false;\n\n return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);\n};\n\nBasePoint.prototype._getDoubles = function _getDoubles(step, power) {\n if (this.precomputed && this.precomputed.doubles)\n return this.precomputed.doubles;\n\n var doubles = [ this ];\n var acc = this;\n for (var i = 0; i < power; i += step) {\n for (var j = 0; j < step; j++)\n acc = acc.dbl();\n doubles.push(acc);\n }\n return {\n step: step,\n points: doubles\n };\n};\n\nBasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {\n if (this.precomputed && this.precomputed.naf)\n return this.precomputed.naf;\n\n var res = [ this ];\n var max = (1 << wnd) - 1;\n var dbl = max === 1 ? null : this.dbl();\n for (var i = 1; i < max; i++)\n res[i] = res[i - 1].add(dbl);\n return {\n wnd: wnd,\n points: res\n };\n};\n\nBasePoint.prototype._getBeta = function _getBeta() {\n return null;\n};\n\nBasePoint.prototype.dblp = function dblp(k) {\n var r = this;\n for (var i = 0; i < k; i++)\n r = r.dbl();\n return r;\n};\n","'use strict';\n\nif (typeof process === 'undefined' ||\n !process.version ||\n process.version.indexOf('v0.') === 0 ||\n process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {\n module.exports = { nextTick: nextTick };\n} else {\n module.exports = process\n}\n\nfunction nextTick(fn, arg1, arg2, arg3) {\n if (typeof fn !== 'function') {\n throw new TypeError('\"callback\" argument must be a function');\n }\n var len = arguments.length;\n var args, i;\n switch (len) {\n case 0:\n case 1:\n return process.nextTick(fn);\n case 2:\n return process.nextTick(function afterTickOne() {\n fn.call(null, arg1);\n });\n case 3:\n return process.nextTick(function afterTickTwo() {\n fn.call(null, arg1, arg2);\n });\n case 4:\n return process.nextTick(function afterTickThree() {\n fn.call(null, arg1, arg2, arg3);\n });\n default:\n args = new Array(len - 1);\n i = 0;\n while (i < args.length) {\n args[i++] = arguments[i];\n }\n return process.nextTick(function afterTick() {\n fn.apply(null, args);\n });\n }\n}\n\n","/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GenericAuthorization = exports.SendAuthorization = exports.Authorization = exports.AuthorizationGrant = void 0;\nvar json_1 = require(\"../../util/json\");\nvar Coins_1 = require(\"../Coins\");\nvar AuthorizationGrant = /** @class */ (function (_super) {\n __extends(AuthorizationGrant, _super);\n function AuthorizationGrant(authorization, expiration) {\n var _this = _super.call(this) || this;\n _this.authorization = authorization;\n _this.expiration = expiration;\n return _this;\n }\n AuthorizationGrant.fromData = function (data) {\n var authorization = data.authorization, expiration = data.expiration;\n return new AuthorizationGrant(Authorization.fromData(authorization), new Date(expiration));\n };\n AuthorizationGrant.prototype.toData = function () {\n var _a = this, authorization = _a.authorization, expiration = _a.expiration;\n return {\n authorization: authorization.toData(),\n expiration: expiration.toISOString(),\n };\n };\n return AuthorizationGrant;\n}(json_1.JSONSerializable));\nexports.AuthorizationGrant = AuthorizationGrant;\nvar Authorization;\n(function (Authorization) {\n function fromData(data) {\n switch (data.type) {\n case 'msgauth/SendAuthorization':\n return SendAuthorization.fromData(data);\n case 'msgauth/GenericAuthorization':\n return GenericAuthorization.fromData(data);\n }\n }\n Authorization.fromData = fromData;\n})(Authorization = exports.Authorization || (exports.Authorization = {}));\nvar SendAuthorization = /** @class */ (function (_super) {\n __extends(SendAuthorization, _super);\n function SendAuthorization(spend_limit) {\n var _this = _super.call(this) || this;\n _this.spend_limit = new Coins_1.Coins(spend_limit);\n return _this;\n }\n SendAuthorization.fromData = function (data) {\n return new SendAuthorization(Coins_1.Coins.fromData(data.value.spend_limit));\n };\n SendAuthorization.prototype.toData = function () {\n var spend_limit = this.spend_limit;\n return {\n type: 'msgauth/SendAuthorization',\n value: {\n spend_limit: spend_limit.toData(),\n },\n };\n };\n return SendAuthorization;\n}(json_1.JSONSerializable));\nexports.SendAuthorization = SendAuthorization;\nvar GenericAuthorization = /** @class */ (function (_super) {\n __extends(GenericAuthorization, _super);\n function GenericAuthorization(grant_msg_type) {\n var _this = _super.call(this) || this;\n _this.grant_msg_type = grant_msg_type;\n return _this;\n }\n GenericAuthorization.fromData = function (data) {\n return new GenericAuthorization(data.value.grant_msg_type);\n };\n GenericAuthorization.prototype.toData = function () {\n var grant_msg_type = this.grant_msg_type;\n return {\n type: 'msgauth/GenericAuthorization',\n value: {\n grant_msg_type: grant_msg_type,\n },\n };\n };\n return GenericAuthorization;\n}(json_1.JSONSerializable));\nexports.GenericAuthorization = GenericAuthorization;\n//# sourceMappingURL=Authorization.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Validator = void 0;\nvar json_1 = require(\"../../util/json\");\nvar numeric_1 = require(\"../numeric\");\n/**\n * Stores information fetched from the blockchain about the current status of a validator.\n * As an end user, you will not have to create an instance of this class, one will be\n * generated for you to store information about a validator polled from the API functions\n * in [[StakingAPI]].\n */\nvar Validator = /** @class */ (function (_super) {\n __extends(Validator, _super);\n /**\n *\n * @param operator_address validator's operator address\n * @param consensus_pubkey validator's consensus public key\n * @param jailed whether the current validator is jailed\n * @param status unbonded `0`, unbonding `1`, bonded `2`\n * @param tokens total Luna from all delegations (including self)\n * @param delegator_shares total shares of all delegators\n * @param description validator's delegate description\n * @param unbonding_height if unbonding, height at which this validator began unbonding\n * @param unbonding_time if unbonding, min time for the validator to complete unbonding\n * @param commission validator commission\n * @param min_self_delegation minimum self delegation\n */\n function Validator(operator_address, consensus_pubkey, jailed, status, tokens, delegator_shares, description, unbonding_height, unbonding_time, commission, min_self_delegation) {\n var _this = _super.call(this) || this;\n _this.operator_address = operator_address;\n _this.consensus_pubkey = consensus_pubkey;\n _this.jailed = jailed;\n _this.status = status;\n _this.tokens = tokens;\n _this.delegator_shares = delegator_shares;\n _this.description = description;\n _this.unbonding_height = unbonding_height;\n _this.unbonding_time = unbonding_time;\n _this.commission = commission;\n _this.min_self_delegation = min_self_delegation;\n return _this;\n }\n Validator.prototype.toData = function () {\n return {\n operator_address: this.operator_address,\n consensus_pubkey: this.consensus_pubkey,\n jailed: this.jailed,\n status: this.status,\n tokens: this.tokens.toString(),\n delegator_shares: this.delegator_shares.toString(),\n description: this.description,\n unbonding_height: this.unbonding_height.toFixed(),\n unbonding_time: this.unbonding_time.toISOString(),\n commission: this.commission.toData(),\n min_self_delegation: this.min_self_delegation.toString(),\n };\n };\n Validator.fromData = function (data) {\n return new Validator(data.operator_address, data.consensus_pubkey, data.jailed, data.status, new numeric_1.Int(data.tokens), new numeric_1.Dec(data.delegator_shares), data.description, Number.parseInt(data.unbonding_height), new Date(data.unbonding_time), Validator.Commission.fromData(data.commission), new numeric_1.Int(data.min_self_delegation));\n };\n return Validator;\n}(json_1.JSONSerializable));\nexports.Validator = Validator;\n(function (Validator) {\n var CommissionRates = /** @class */ (function (_super) {\n __extends(CommissionRates, _super);\n /**\n * @param rate current commission rate\n * @param max_rate max commission rate\n * @param max_change_rate max percentage commission can change in 24hrs\n */\n function CommissionRates(rate, max_rate, max_change_rate) {\n var _this = _super.call(this) || this;\n _this.rate = rate;\n _this.max_rate = max_rate;\n _this.max_change_rate = max_change_rate;\n return _this;\n }\n CommissionRates.fromData = function (data) {\n var rate = data.rate, max_rate = data.max_rate, max_change_rate = data.max_change_rate;\n return new CommissionRates(new numeric_1.Dec(rate), new numeric_1.Dec(max_rate), new numeric_1.Dec(max_change_rate));\n };\n CommissionRates.prototype.toData = function () {\n var _a = this, rate = _a.rate, max_rate = _a.max_rate, max_change_rate = _a.max_change_rate;\n return {\n rate: rate.toString(),\n max_rate: max_rate.toString(),\n max_change_rate: max_change_rate.toString(),\n };\n };\n return CommissionRates;\n }(json_1.JSONSerializable));\n Validator.CommissionRates = CommissionRates;\n var Commission = /** @class */ (function (_super) {\n __extends(Commission, _super);\n /**\n * @param commission_rates commission rates\n * @param update_time time at which commission was last updated\n */\n function Commission(commission_rates, update_time) {\n var _this = _super.call(this) || this;\n _this.commission_rates = commission_rates;\n _this.update_time = update_time;\n return _this;\n }\n Commission.prototype.toData = function () {\n return {\n commission_rates: this.commission_rates.toData(),\n update_time: this.update_time.toISOString(),\n };\n };\n Commission.fromData = function (data) {\n return new Commission(CommissionRates.fromData(data.commission_rates), new Date(data.update_time));\n };\n return Commission;\n }(json_1.JSONSerializable));\n Validator.Commission = Commission;\n})(Validator = exports.Validator || (exports.Validator = {}));\nexports.Validator = Validator;\n//# sourceMappingURL=Validator.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StdFee = void 0;\nvar json_1 = require(\"../util/json\");\nvar Coins_1 = require(\"./Coins\");\nvar numeric_1 = require(\"./numeric\");\n/**\n * A transaction must include a fee, otherwise it will be rejected.\n */\nvar StdFee = /** @class */ (function (_super) {\n __extends(StdFee, _super);\n /**\n * Creates a new StdFee object.\n * @param gas gas limit\n * @param amount amount to be paid to validator\n */\n function StdFee(gas, amount) {\n var _this = _super.call(this) || this;\n _this.gas = gas;\n _this.amount = new Coins_1.Coins(amount);\n return _this;\n }\n StdFee.fromData = function (data) {\n var gas = data.gas, amount = data.amount;\n return new StdFee(Number.parseInt(gas), Coins_1.Coins.fromData(amount));\n };\n StdFee.prototype.toData = function () {\n return {\n gas: new numeric_1.Int(this.gas).toString(),\n amount: this.amount.toData(),\n };\n };\n /**\n * Gets the mininimum gas prices implied by the fee. Minimum gas prices are `fee amount / gas`.\n */\n StdFee.prototype.gasPrices = function () {\n return this.amount.toDecCoins().div(this.gas);\n };\n return StdFee;\n}(json_1.JSONSerializable));\nexports.StdFee = StdFee;\n//# sourceMappingURL=StdFee.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StdTx = void 0;\nvar StdSignature_1 = require(\"./StdSignature\");\nvar json_1 = require(\"../util/json\");\nvar StdFee_1 = require(\"./StdFee\");\nvar Msg_1 = require(\"./Msg\");\n/**\n * The StdTx data structure contains the signatures from [[StdSignMsg]] with the same\n * information, and can be broadcasted to the node to be included in a block.\n */\nvar StdTx = /** @class */ (function (_super) {\n __extends(StdTx, _super);\n /**\n * @param msg list of messages to include (not a typo)\n * @param fee transaction fee\n * @param signatures list of signatures\n * @param memo optional note\n */\n function StdTx(msg, fee, signatures, memo) {\n if (memo === void 0) { memo = ''; }\n var _this = _super.call(this) || this;\n _this.msg = msg;\n _this.fee = fee;\n _this.signatures = signatures;\n _this.memo = memo;\n return _this;\n }\n StdTx.fromData = function (data) {\n var _a = data.value, msg = _a.msg, fee = _a.fee, signatures = _a.signatures, memo = _a.memo;\n return new StdTx(msg.map(function (m) { return Msg_1.Msg.fromData(m); }), StdFee_1.StdFee.fromData(fee), signatures.map(function (s) { return StdSignature_1.StdSignature.fromData(s); }), memo);\n };\n StdTx.prototype.toData = function () {\n var _a = this, msg = _a.msg, fee = _a.fee, signatures = _a.signatures, memo = _a.memo;\n return {\n type: 'core/StdTx',\n value: {\n msg: msg.map(function (m) { return m.toData(); }),\n fee: fee.toData(),\n signatures: signatures.map(function (s) { return s.toData(); }),\n memo: memo,\n },\n };\n };\n return StdTx;\n}(json_1.JSONSerializable));\nexports.StdTx = StdTx;\n//# sourceMappingURL=StdTx.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Key = void 0;\nvar bech32 = __importStar(require(\"bech32\"));\nvar HEX = __importStar(require(\"crypto-js/enc-hex\"));\nvar ripemd160_1 = __importDefault(require(\"crypto-js/ripemd160\"));\nvar sha256_1 = __importDefault(require(\"crypto-js/sha256\"));\nvar core_1 = require(\"../core\");\nvar core_2 = require(\"../core\");\nvar BECH32_PUBKEY_DATA_PREFIX = 'eb5ae98721';\n/**\n * Gets a raw address from a compressed bytes public key.\n *\n * @param publicKey raw public key\n */\nfunction addressFromPublicKey(publicKey) {\n if (typeof publicKey !== 'object' || !(publicKey instanceof Buffer)) {\n throw new TypeError('parameter must be Buffer that contains public key');\n }\n var message = HEX.parse(publicKey.toString('hex'));\n var hash = ripemd160_1.default(sha256_1.default(message)).toString();\n var address = Buffer.from(hash, 'hex');\n return Buffer.from(bech32.toWords(address));\n}\n/**\n * Gets a bech32-words pubkey from a compressed bytes public key.\n *\n * @param publicKey raw public key\n */\nfunction pubKeyFromPublicKey(publicKey) {\n var buffer = Buffer.from(BECH32_PUBKEY_DATA_PREFIX, 'hex');\n var combined = Buffer.concat([buffer, publicKey]);\n return Buffer.from(bech32.toWords(combined));\n}\n/**\n * Abstract key interface that provides transaction signing features and Bech32 address\n * and public key derivation from a public key. This allows you to create custom key\n * solutions, such as for various hardware wallets, by implementing signing and calling\n * `super` with the raw public key from within your subclass. See [[MnemonicKey]] for\n * an implementation of a basic mnemonic-based key.\n */\nvar Key = /** @class */ (function () {\n /**\n * Called to derive the relevant account and validator addresses and public keys from\n * the raw compressed public key in bytes.\n *\n * @param publicKey raw compressed bytes public key\n */\n function Key(publicKey) {\n this.publicKey = publicKey;\n var rawAddress = addressFromPublicKey(publicKey);\n var rawPubKey = pubKeyFromPublicKey(publicKey);\n this.accAddress = bech32.encode('terra', Array.from(rawAddress));\n this.valAddress = bech32.encode('terravaloper', Array.from(rawAddress));\n this.accPubKey = bech32.encode('terrapub', Array.from(rawPubKey));\n this.valPubKey = bech32.encode('terravaloperpub', Array.from(rawPubKey));\n }\n /**\n * Signs a [[StdSignMsg]] with the method supplied by the child class.\n *\n * @param tx sign-message of the transaction to sign\n */\n Key.prototype.createSignature = function (tx) {\n return __awaiter(this, void 0, void 0, function () {\n var sigBuffer;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.sign(Buffer.from(tx.toJSON()))];\n case 1:\n sigBuffer = _a.sent();\n return [2 /*return*/, core_1.StdSignature.fromData({\n signature: sigBuffer.toString('base64'),\n pub_key: {\n type: 'tendermint/PubKeySecp256k1',\n value: this.publicKey.toString('base64'),\n },\n })];\n }\n });\n });\n };\n /**\n * Signs a [[StdSignMsg]] and adds the signature to a generated StdTx that is ready to be broadcasted.\n * @param tx\n */\n Key.prototype.signTx = function (tx) {\n return __awaiter(this, void 0, void 0, function () {\n var sig;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.createSignature(tx)];\n case 1:\n sig = _a.sent();\n return [2 /*return*/, new core_2.StdTx(tx.msgs, tx.fee, [sig], tx.memo)];\n }\n });\n });\n };\n return Key;\n}());\nexports.Key = Key;\n//# sourceMappingURL=Key.js.map","module.exports = require('crypto').createHash\n","module.exports = require('crypto').createHmac\n","module.exports = require(\"buffer\");","module.exports = require(\"fs\");","module.exports = require(\"path\");","'use strict';\n\nvar curves = exports;\n\nvar hash = require('hash.js');\nvar curve = require('./curve');\nvar utils = require('./utils');\n\nvar assert = utils.assert;\n\nfunction PresetCurve(options) {\n if (options.type === 'short')\n this.curve = new curve.short(options);\n else if (options.type === 'edwards')\n this.curve = new curve.edwards(options);\n else\n this.curve = new curve.mont(options);\n this.g = this.curve.g;\n this.n = this.curve.n;\n this.hash = options.hash;\n\n assert(this.g.validate(), 'Invalid curve');\n assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O');\n}\ncurves.PresetCurve = PresetCurve;\n\nfunction defineCurve(name, options) {\n Object.defineProperty(curves, name, {\n configurable: true,\n enumerable: true,\n get: function() {\n var curve = new PresetCurve(options);\n Object.defineProperty(curves, name, {\n configurable: true,\n enumerable: true,\n value: curve\n });\n return curve;\n }\n });\n}\n\ndefineCurve('p192', {\n type: 'short',\n prime: 'p192',\n p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff',\n a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc',\n b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1',\n n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831',\n hash: hash.sha256,\n gRed: false,\n g: [\n '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012',\n '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811'\n ]\n});\n\ndefineCurve('p224', {\n type: 'short',\n prime: 'p224',\n p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001',\n a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe',\n b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4',\n n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d',\n hash: hash.sha256,\n gRed: false,\n g: [\n 'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21',\n 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34'\n ]\n});\n\ndefineCurve('p256', {\n type: 'short',\n prime: null,\n p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff',\n a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc',\n b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b',\n n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551',\n hash: hash.sha256,\n gRed: false,\n g: [\n '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296',\n '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5'\n ]\n});\n\ndefineCurve('p384', {\n type: 'short',\n prime: null,\n p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'fffffffe ffffffff 00000000 00000000 ffffffff',\n a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'fffffffe ffffffff 00000000 00000000 fffffffc',\n b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' +\n '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef',\n n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' +\n 'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973',\n hash: hash.sha384,\n gRed: false,\n g: [\n 'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' +\n '5502f25d bf55296c 3a545e38 72760ab7',\n '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' +\n '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'\n ]\n});\n\ndefineCurve('p521', {\n type: 'short',\n prime: null,\n p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff ffffffff',\n a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff fffffffc',\n b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' +\n '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' +\n '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00',\n n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' +\n 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409',\n hash: hash.sha512,\n gRed: false,\n g: [\n '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' +\n '053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' +\n 'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66',\n '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' +\n '579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' +\n '3fad0761 353c7086 a272c240 88be9476 9fd16650'\n ]\n});\n\ndefineCurve('curve25519', {\n type: 'mont',\n prime: 'p25519',\n p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',\n a: '76d06',\n b: '1',\n n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',\n hash: hash.sha256,\n gRed: false,\n g: [\n '9'\n ]\n});\n\ndefineCurve('ed25519', {\n type: 'edwards',\n prime: 'p25519',\n p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',\n a: '-1',\n c: '1',\n // -121665 * (121666^(-1)) (mod P)\n d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3',\n n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',\n hash: hash.sha256,\n gRed: false,\n g: [\n '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a',\n\n // 4/5\n '6666666666666666666666666666666666666666666666666666666666666658'\n ]\n});\n\nvar pre;\ntry {\n pre = require('./precomputed/secp256k1');\n} catch (e) {\n pre = undefined;\n}\n\ndefineCurve('secp256k1', {\n type: 'short',\n prime: 'k256',\n p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f',\n a: '0',\n b: '7',\n n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141',\n h: '1',\n hash: hash.sha256,\n\n // Precomputed endomorphism\n beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee',\n lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72',\n basis: [\n {\n a: '3086d221a7d46bcde86c90e49284eb15',\n b: '-e4437ed6010e88286f547fa90abfe4c3'\n },\n {\n a: '114ca50f7a8e2f3f657c1108d9d44cfd8',\n b: '3086d221a7d46bcde86c90e49284eb15'\n }\n ],\n\n gRed: false,\n g: [\n '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',\n '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',\n pre\n ]\n});\n","var hash = exports;\n\nhash.utils = require('./hash/utils');\nhash.common = require('./hash/common');\nhash.sha = require('./hash/sha');\nhash.ripemd = require('./hash/ripemd');\nhash.hmac = require('./hash/hmac');\n\n// Proxy hash functions to the main object\nhash.sha1 = hash.sha.sha1;\nhash.sha256 = hash.sha.sha256;\nhash.sha224 = hash.sha.sha224;\nhash.sha384 = hash.sha.sha384;\nhash.sha512 = hash.sha.sha512;\nhash.ripemd160 = hash.ripemd.ripemd160;\n","var types = {\n Array: function (value) { return value !== null && value !== undefined && value.constructor === Array },\n Boolean: function (value) { return typeof value === 'boolean' },\n Function: function (value) { return typeof value === 'function' },\n Nil: function (value) { return value === undefined || value === null },\n Number: function (value) { return typeof value === 'number' },\n Object: function (value) { return typeof value === 'object' },\n String: function (value) { return typeof value === 'string' },\n '': function () { return true }\n}\n\n// TODO: deprecate\ntypes.Null = types.Nil\n\nfor (var typeName in types) {\n types[typeName].toJSON = function (t) {\n return t\n }.bind(null, typeName)\n}\n\nmodule.exports = types\n","var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs\n\nmodule.exports = function (iterations, keylen) {\n if (typeof iterations !== 'number') {\n throw new TypeError('Iterations not a number')\n }\n\n if (iterations < 0) {\n throw new TypeError('Bad iterations')\n }\n\n if (typeof keylen !== 'number') {\n throw new TypeError('Key length not a number')\n }\n\n if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { /* eslint no-self-compare: 0 */\n throw new TypeError('Bad key length')\n }\n}\n","var defaultEncoding\n/* istanbul ignore next */\nif (process.browser) {\n defaultEncoding = 'utf-8'\n} else if (process.version) {\n var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10)\n\n defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'\n} else {\n defaultEncoding = 'utf-8'\n}\nmodule.exports = defaultEncoding\n","var Buffer = require('safe-buffer').Buffer\n\nmodule.exports = function (thing, encoding, name) {\n if (Buffer.isBuffer(thing)) {\n return thing\n } else if (typeof thing === 'string') {\n return Buffer.from(thing, encoding)\n } else if (ArrayBuffer.isView(thing)) {\n return Buffer.from(thing.buffer)\n } else {\n throw new TypeError(name + ' must be a string, a Buffer, a typed array or a DataView')\n }\n}\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","module.exports = require(\"stream\");","import { Key } from '@terra-money/terra.js';\n\nexport class EmptyKey extends Key {\n constructor() {\n super(Buffer.from(''));\n }\n\n // eslint-disable-next-line class-methods-use-this\n public sign(): Promise {\n throw new Error(\n 'Key is empty - provide a Key when creating ContractClient to sign transactions.'\n );\n }\n}\n","/* eslint-disable camelcase */\nimport { AccAddress } from '@terra-money/terra.js';\n\nexport interface Token {\n token: {\n contract_addr: AccAddress;\n };\n}\n\nexport interface NativeToken {\n native_token: {\n denom: string;\n };\n}\n\nexport type AssetInfo = Token | NativeToken;\n\nexport function isNativeToken(assetInfo: AssetInfo): assetInfo is NativeToken {\n return 'native_token' in assetInfo;\n}\n\nexport interface Asset {\n info: AssetInfo;\n amount: string;\n}\n\nexport const UST: NativeToken = {\n native_token: {\n denom: 'uusd'\n }\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Denom = void 0;\nvar Denom;\n(function (Denom) {\n Denom.LUNA = 'uluna';\n Denom.CNY = 'ucny';\n Denom.EUR = 'ueur';\n Denom.GBP = 'ugbp';\n Denom.JPY = 'ujpy';\n Denom.KRW = 'ukrw';\n Denom.MNT = 'umnt';\n Denom.SDR = 'usdr';\n Denom.USD = 'uusd';\n})(Denom = exports.Denom || (exports.Denom = {}));\n//# sourceMappingURL=Denom.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./MsgSend\"), exports);\n__exportStar(require(\"./MsgMultiSend\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./MsgModifyWithdrawAddress\"), exports);\n__exportStar(require(\"./MsgWithdrawDelegationReward\"), exports);\n__exportStar(require(\"./MsgWithdrawValidatorCommission\"), exports);\n__exportStar(require(\"./MsgFundCommunityPool\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./MsgDeposit\"), exports);\n__exportStar(require(\"./MsgSubmitProposal\"), exports);\n__exportStar(require(\"./MsgVote\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Proposal = void 0;\nvar Coins_1 = require(\"./Coins\");\nvar proposals_1 = require(\"./distribution/proposals\");\nvar proposals_2 = require(\"./gov/proposals\");\nvar proposals_3 = require(\"./treasury/proposals\");\nvar json_1 = require(\"../util/json\");\nvar numeric_1 = require(\"./numeric\");\nvar proposals_4 = require(\"./params/proposals\");\n/**\n * Stores information pertaining to a submitted proposal, such as its status and time of\n * the voting period\n */\nvar Proposal = /** @class */ (function (_super) {\n __extends(Proposal, _super);\n /**\n *\n * @param id proposal's ID\n * @param content content of the proposal\n * @param proposal_status proposal's status\n * @param final_tally_result tally result\n * @param submit_time time proposal was submitted and deposit period started\n * @param deposit_end_time time deposit period will end\n * @param total_deposit amount of coins deposited by all users\n * @param voting_start_time time voting period will start\n * @param voting_end_time time voting period will end\n */\n function Proposal(id, content, proposal_status, final_tally_result, submit_time, deposit_end_time, total_deposit, voting_start_time, voting_end_time) {\n var _this = _super.call(this) || this;\n _this.id = id;\n _this.content = content;\n _this.proposal_status = proposal_status;\n _this.final_tally_result = final_tally_result;\n _this.submit_time = submit_time;\n _this.deposit_end_time = deposit_end_time;\n _this.total_deposit = total_deposit;\n _this.voting_start_time = voting_start_time;\n _this.voting_end_time = voting_end_time;\n return _this;\n }\n Proposal.fromData = function (data) {\n var id = data.id, content = data.content, proposal_status = data.proposal_status, final_tally_result = data.final_tally_result, submit_time = data.submit_time, deposit_end_time = data.deposit_end_time, total_deposit = data.total_deposit, voting_start_time = data.voting_start_time, voting_end_time = data.voting_end_time;\n var ftr;\n if (final_tally_result) {\n ftr = {\n yes: new numeric_1.Int(final_tally_result.yes),\n no: new numeric_1.Int(final_tally_result.no),\n abstain: new numeric_1.Int(final_tally_result.abstain),\n no_with_veto: new numeric_1.Int(final_tally_result.no_with_veto),\n };\n }\n return new Proposal(Number.parseInt(id), Proposal.Content.fromData(content), proposal_status, ftr, new Date(submit_time), new Date(deposit_end_time), Coins_1.Coins.fromData(total_deposit), new Date(voting_start_time), new Date(voting_end_time));\n };\n Proposal.prototype.toData = function () {\n var _a = this, proposal_status = _a.proposal_status, final_tally_result = _a.final_tally_result;\n var ftr;\n if (final_tally_result) {\n ftr = {\n yes: final_tally_result.yes.toString(),\n no: final_tally_result.no.toString(),\n abstain: final_tally_result.abstain.toString(),\n no_with_veto: final_tally_result.no_with_veto.toString(),\n };\n }\n return {\n id: this.id.toFixed(),\n content: this.content.toData(),\n proposal_status: proposal_status,\n final_tally_result: ftr,\n submit_time: this.submit_time.toISOString(),\n deposit_end_time: this.deposit_end_time.toISOString(),\n total_deposit: this.total_deposit.toData(),\n voting_start_time: this.voting_start_time.toISOString(),\n voting_end_time: this.voting_end_time.toISOString(),\n };\n };\n return Proposal;\n}(json_1.JSONSerializable));\nexports.Proposal = Proposal;\n(function (Proposal) {\n var Content;\n (function (Content) {\n function fromData(data) {\n switch (data.type) {\n case 'gov/TextProposal':\n return proposals_2.TextProposal.fromData(data);\n case 'distribution/CommunityPoolSpendProposal':\n return proposals_1.CommunityPoolSpendProposal.fromData(data);\n case 'treasury/TaxRateUpdateProposal':\n return proposals_3.TaxRateUpdateProposal.fromData(data);\n case 'treasury/RewardWeightUpdateProposal':\n return proposals_3.RewardWeightUpdateProposal.fromData(data);\n case 'params/ParameterChangeProposal':\n return proposals_4.ParameterChangeProposal.fromData(data);\n }\n }\n Content.fromData = fromData;\n })(Content = Proposal.Content || (Proposal.Content = {}));\n var Status;\n (function (Status) {\n Status[\"NIL\"] = \"\";\n Status[\"DEPOSIT_PERIOD\"] = \"DepositPeriod\";\n Status[\"VOTING_PERIOD\"] = \"VotingPeriod\";\n Status[\"PASSED\"] = \"Passed\";\n Status[\"REJECTED\"] = \"Rejected\";\n Status[\"FAILED\"] = \"Failed\";\n })(Status = Proposal.Status || (Proposal.Status = {}));\n})(Proposal = exports.Proposal || (exports.Proposal = {}));\nexports.Proposal = Proposal;\n//# sourceMappingURL=Proposal.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./CommunityPoolSpendProposal\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./TextProposal\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./RewardWeightUpdateProposal\"), exports);\n__exportStar(require(\"./TaxRateUpdateProposal\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./ParameterChangeProposal\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ParamChanges = void 0;\nvar params_1 = require(\"../distribution/params\");\nvar params_2 = require(\"../gov/params\");\nvar params_3 = require(\"../market/params\");\nvar params_4 = require(\"../oracle/params\");\nvar params_5 = require(\"../slashing/params\");\nvar params_6 = require(\"../staking/params\");\nvar params_7 = require(\"../treasury/params\");\nvar params_8 = require(\"../wasm/params\");\nvar params_9 = require(\"../mint/params\");\nvar ParamChanges;\n(function (ParamChanges) {\n ParamChanges.ConversionTable = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, params_1.DistributionParamChanges.ConversionTable), params_2.GovParamChanges.ConversionTable), params_3.MarketParamChanges.ConversionTable), params_4.OracleParamChanges.ConversionTable), params_5.SlashingParamChanges.ConversionTable), params_6.StakingParamChanges.ConversionTable), params_7.TreasuryParamChanges.ConversionTable), params_8.WasmParamChanges.ConversionTable), params_9.MintParamChanges.ConversionTable);\n function fromData(data) {\n var result = {};\n for (var _i = 0, data_1 = data; _i < data_1.length; _i++) {\n var pc = data_1[_i];\n if (result[pc.subspace] === undefined) {\n result[pc.subspace] = {};\n }\n // @ts-ignore\n var converter = ParamChanges.ConversionTable[pc.subspace][pc.key][0];\n // @ts-ignore\n result[pc.subspace][pc.key] = converter(JSON.parse(pc.value));\n }\n return result;\n }\n ParamChanges.fromData = fromData;\n function toData(pc) {\n var result = [];\n for (var _i = 0, _a = Object.keys(pc); _i < _a.length; _i++) {\n var subspace = _a[_i];\n // @ts-ignore\n for (var _b = 0, _c = Object.keys(pc[subspace]); _b < _c.length; _b++) {\n var key = _c[_b];\n // @ts-ignore\n var serializer = ParamChanges.ConversionTable[subspace][key][1];\n result.push({\n // @ts-ignore\n subspace: subspace,\n // @ts-ignore\n key: key,\n // @ts-ignore\n value: JSON.stringify(serializer(pc[subspace][key])),\n });\n }\n }\n return result;\n }\n ParamChanges.toData = toData;\n})(ParamChanges = exports.ParamChanges || (exports.ParamChanges = {}));\n//# sourceMappingURL=ParamChange.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PolicyConstraints = void 0;\nvar json_1 = require(\"../../util/json\");\nvar Coin_1 = require(\"../Coin\");\nvar numeric_1 = require(\"../numeric\");\n/**\n * This captures the Treasury module's `tax_policy` and `reward_policy` parameters, which\n * determine how the Tax Rate and Reward Weight values are allowed to change.\n */\nvar PolicyConstraints = /** @class */ (function (_super) {\n __extends(PolicyConstraints, _super);\n /**\n *\n * @param rate_min minimum value\n * @param rate_max maximum value\n * @param cap Tax Cap (only applicable for Tax Rate)\n * @param change_max max change %\n */\n function PolicyConstraints(rate_min, rate_max, cap, change_max) {\n var _this = _super.call(this) || this;\n _this.cap = cap;\n _this.rate_min = new numeric_1.Dec(rate_min);\n _this.rate_max = new numeric_1.Dec(rate_max);\n _this.change_max = new numeric_1.Dec(change_max);\n return _this;\n }\n PolicyConstraints.fromData = function (data) {\n var rate_min = data.rate_min, rate_max = data.rate_max, cap = data.cap, change_max = data.change_max;\n return new PolicyConstraints(rate_min, rate_max, Coin_1.Coin.fromData(cap), change_max);\n };\n PolicyConstraints.prototype.toData = function () {\n var _a = this, rate_min = _a.rate_min, rate_max = _a.rate_max, cap = _a.cap, change_max = _a.change_max;\n return {\n rate_min: rate_min.toString(),\n rate_max: rate_max.toString(),\n cap: cap.toData(),\n change_max: change_max.toString(),\n };\n };\n /**\n * You can simulate the result of the clamping algorithm, which subjects updates in\n * rate to the rules defined by the `PolicyConstraints`.\n *\n * @param prevRate previous rate\n * @param newRate next rate\n * @returns New rate, after clamping constraints have been applied\n */\n PolicyConstraints.prototype.clamp = function (prevRate, newRate) {\n var p = new numeric_1.Dec(prevRate); // prev\n var n = new numeric_1.Dec(newRate); // new\n if (n.lt(this.rate_min)) {\n n = this.rate_min;\n }\n else if (n.gt(this.rate_max)) {\n n = this.rate_max;\n }\n var delta = n.sub(p);\n if (n.gt(p)) {\n if (delta.gt(this.change_max)) {\n n = p.add(this.change_max);\n }\n }\n else {\n if (delta.abs().gt(this.change_max)) {\n n = p.sub(this.change_max);\n }\n }\n return n;\n };\n return PolicyConstraints;\n}(json_1.JSONSerializable));\nexports.PolicyConstraints = PolicyConstraints;\n//# sourceMappingURL=PolicyConstraints.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./MsgSwap\"), exports);\n__exportStar(require(\"./MsgSwapSend\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./MsgGrantAuthorization\"), exports);\n__exportStar(require(\"./MsgRevokeAuthorization\"), exports);\n__exportStar(require(\"./MsgExecAuthorized\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./MsgDelegateFeedConsent\"), exports);\n__exportStar(require(\"./MsgExchangeRatePrevote\"), exports);\n__exportStar(require(\"./MsgExchangeRateVote\"), exports);\n__exportStar(require(\"./MsgAggregateExchangeRateVote\"), exports);\n__exportStar(require(\"./MsgAggregateExchangeRatePrevote\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgExchangeRatePrevote = void 0;\nvar json_1 = require(\"../../../util/json\");\n/**\n * In order to prevent validators from copying each others' price votes, voting occurs\n * in 2 stages. Firstly, you must pre-commit to a price by submitting a\n * MsgExchangeRatePrevote containing a hash, and then reveal your price in the\n * subsequent vote period.\n *\n * The vote hash reported in the prevote must match the hash of the vote's data in order\n * for the vote to count. Otherwise, it is automatically a miss.\n */\nvar MsgExchangeRatePrevote = /** @class */ (function (_super) {\n __extends(MsgExchangeRatePrevote, _super);\n /**\n * @param hash vote hash\n * @param denom denom for reporting the exchange rate\n * @param feeder validator's feeder account address\n * @param validator validator's operator address\n */\n function MsgExchangeRatePrevote(hash, denom, feeder, validator) {\n var _this = _super.call(this) || this;\n _this.hash = hash;\n _this.denom = denom;\n _this.feeder = feeder;\n _this.validator = validator;\n return _this;\n }\n MsgExchangeRatePrevote.fromData = function (data) {\n var _a = data.value, hash = _a.hash, denom = _a.denom, feeder = _a.feeder, validator = _a.validator;\n return new MsgExchangeRatePrevote(hash, denom, feeder, validator);\n };\n MsgExchangeRatePrevote.prototype.toData = function () {\n var _a = this, hash = _a.hash, denom = _a.denom, feeder = _a.feeder, validator = _a.validator;\n return {\n type: 'oracle/MsgExchangeRatePrevote',\n value: {\n hash: hash,\n denom: denom,\n feeder: feeder,\n validator: validator,\n },\n };\n };\n return MsgExchangeRatePrevote;\n}(json_1.JSONSerializable));\nexports.MsgExchangeRatePrevote = MsgExchangeRatePrevote;\n//# sourceMappingURL=MsgExchangeRatePrevote.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgAggregateExchangeRatePrevote = void 0;\nvar json_1 = require(\"../../../util/json\");\n/**\n * Aggregate analog of MsgExchangeRatePrevote\n */\nvar MsgAggregateExchangeRatePrevote = /** @class */ (function (_super) {\n __extends(MsgAggregateExchangeRatePrevote, _super);\n /**\n * @param hash vote hash\n * @param feeder validator's feeder account address\n * @param validator validator's operator address\n */\n function MsgAggregateExchangeRatePrevote(hash, feeder, validator) {\n var _this = _super.call(this) || this;\n _this.hash = hash;\n _this.feeder = feeder;\n _this.validator = validator;\n return _this;\n }\n MsgAggregateExchangeRatePrevote.fromData = function (data) {\n var _a = data.value, hash = _a.hash, feeder = _a.feeder, validator = _a.validator;\n return new MsgAggregateExchangeRatePrevote(hash, feeder, validator);\n };\n MsgAggregateExchangeRatePrevote.prototype.toData = function () {\n var _a = this, hash = _a.hash, feeder = _a.feeder, validator = _a.validator;\n return {\n type: 'oracle/MsgAggregateExchangeRatePrevote',\n value: {\n hash: hash,\n feeder: feeder,\n validator: validator,\n },\n };\n };\n return MsgAggregateExchangeRatePrevote;\n}(json_1.JSONSerializable));\nexports.MsgAggregateExchangeRatePrevote = MsgAggregateExchangeRatePrevote;\n//# sourceMappingURL=MsgAggregateExchangeRatePrevote.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./MsgUnjail\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./MsgDelegate\"), exports);\n__exportStar(require(\"./MsgUndelegate\"), exports);\n__exportStar(require(\"./MsgBeginRedelegate\"), exports);\n__exportStar(require(\"./MsgCreateValidator\"), exports);\n__exportStar(require(\"./MsgEditValidator\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./MsgStoreCode\"), exports);\n__exportStar(require(\"./MsgInstantiateContract\"), exports);\n__exportStar(require(\"./MsgExecuteContract\"), exports);\n__exportStar(require(\"./MsgMigrateContract\"), exports);\n__exportStar(require(\"./MsgUpdateContractOwner\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StdSignature = void 0;\nvar PublicKey_1 = require(\"./PublicKey\");\nvar json_1 = require(\"../util/json\");\n/**\n * A signature consists of a message signature with a public key to verify its validity.\n * You likely will not need to work with StdSignature objects directly as they are automatically created for you.\n */\nvar StdSignature = /** @class */ (function (_super) {\n __extends(StdSignature, _super);\n /**\n *\n * @param signature Message signature string (base64-encoded).\n * @param pub_key Public key\n */\n function StdSignature(signature, pub_key) {\n var _this = _super.call(this) || this;\n _this.signature = signature;\n _this.pub_key = pub_key;\n return _this;\n }\n StdSignature.fromData = function (data) {\n var signature = data.signature, pub_key = data.pub_key;\n return new StdSignature(signature, PublicKey_1.PublicKey.fromData(pub_key));\n };\n StdSignature.prototype.toData = function () {\n var _a = this, signature = _a.signature, pub_key = _a.pub_key;\n return {\n signature: signature,\n pub_key: pub_key.toData(),\n };\n };\n return StdSignature;\n}(json_1.JSONSerializable));\nexports.StdSignature = StdSignature;\n//# sourceMappingURL=StdSignature.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Delegation = void 0;\nvar json_1 = require(\"../../util/json\");\nvar numeric_1 = require(\"../numeric\");\n/**\n * Stores information about the status of a delegation between a delegator and validator, fetched from the blockchain.\n */\nvar Delegation = /** @class */ (function (_super) {\n __extends(Delegation, _super);\n /**\n * @param delegator_address \tdelegator's account address\n * @param validator_address \tvalidator's operator address\n * @param shares \tdelegator's shares\n * @param balance balance of the delegation\n */\n function Delegation(delegator_address, validator_address, shares, balance) {\n var _this = _super.call(this) || this;\n _this.delegator_address = delegator_address;\n _this.validator_address = validator_address;\n _this.shares = shares;\n _this.balance = balance;\n return _this;\n }\n Delegation.fromData = function (data) {\n var delegator_address = data.delegator_address, validator_address = data.validator_address, shares = data.shares, balance = data.balance;\n return new Delegation(delegator_address, validator_address, new numeric_1.Dec(shares), new numeric_1.Int(balance));\n };\n Delegation.prototype.toData = function () {\n var _a = this, delegator_address = _a.delegator_address, validator_address = _a.validator_address, shares = _a.shares, balance = _a.balance;\n return {\n delegator_address: delegator_address,\n validator_address: validator_address,\n shares: shares.toString(),\n balance: balance.toString(),\n };\n };\n return Delegation;\n}(json_1.JSONSerializable));\nexports.Delegation = Delegation;\n//# sourceMappingURL=Delegation.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Redelegation = void 0;\nvar json_1 = require(\"../../util/json\");\nvar numeric_1 = require(\"../numeric\");\n/**\n * A redelegation is when a delegator decides to stop staking with one validator and\n * transfer their delegation to another validator. Rather than unbonding (which takes\n * some time) and re-staking, the funds can be redelegated immediately if a\n * [[Redelegation.Entry]] can be created.\n *\n * A redelegation, like an unbonding delegation, is implemented through\n * [[Redelegation.Entry]] objects, limited by the `max_entry` parameter in the staking\n * module params. For each pair of source and target validators, you cannot redelegate\n * more times than the amount of entries. Entries are cleared when the redelegation is\n * completed, the same amount of time as unbonding.\n */\nvar Redelegation = /** @class */ (function (_super) {\n __extends(Redelegation, _super);\n /**\n *\n * @param delegator_address delegator's account address\n * @param validator_src_address source validator's operator address (from)\n * @param validator_dst_address target validator's operator address (to)\n * @param entries entries\n */\n function Redelegation(delegator_address, validator_src_address, validator_dst_address, entries) {\n var _this = _super.call(this) || this;\n _this.delegator_address = delegator_address;\n _this.validator_src_address = validator_src_address;\n _this.validator_dst_address = validator_dst_address;\n _this.entries = entries;\n return _this;\n }\n Redelegation.fromData = function (data) {\n var delegator_address = data.delegator_address, validator_src_address = data.validator_src_address, validator_dst_address = data.validator_dst_address, entries = data.entries;\n return new Redelegation(delegator_address, validator_src_address, validator_dst_address, entries.map(function (e) { return Redelegation.Entry.fromData(e); }));\n };\n Redelegation.prototype.toData = function () {\n var _a = this, delegator_address = _a.delegator_address, validator_src_address = _a.validator_src_address, validator_dst_address = _a.validator_dst_address, entries = _a.entries;\n return {\n delegator_address: delegator_address,\n validator_src_address: validator_src_address,\n validator_dst_address: validator_dst_address,\n entries: entries.map(function (e) { return e.toData(); }),\n };\n };\n return Redelegation;\n}(json_1.JSONSerializable));\nexports.Redelegation = Redelegation;\n(function (Redelegation) {\n var Entry = /** @class */ (function (_super) {\n __extends(Entry, _super);\n /**\n *\n * @param initial_balance balance of delegation prior to initiating redelegation\n * @param balance \tbalance of delegation after initiating redelegation\n * @param shares_dst\n * @param creation_height \theight of blockchain when entry was created\n * @param completion_time time when redelegation entry will be removed\n */\n function Entry(initial_balance, balance, shares_dst, creation_height, completion_time) {\n var _this = _super.call(this) || this;\n _this.initial_balance = initial_balance;\n _this.balance = balance;\n _this.shares_dst = shares_dst;\n _this.creation_height = creation_height;\n _this.completion_time = completion_time;\n return _this;\n }\n Entry.prototype.toData = function () {\n return {\n initial_balance: this.initial_balance.toString(),\n balance: this.balance.toString(),\n shares_dst: this.shares_dst.toString(),\n creation_height: this.creation_height,\n completion_time: this.completion_time.toISOString(),\n };\n };\n Entry.fromData = function (data) {\n var initial_balance = data.initial_balance, balance = data.balance, shares_dst = data.shares_dst, creation_height = data.creation_height, completion_time = data.completion_time;\n return new Entry(new numeric_1.Int(initial_balance), new numeric_1.Int(balance), new numeric_1.Dec(shares_dst), creation_height, new Date(completion_time));\n };\n return Entry;\n }(json_1.JSONSerializable));\n Redelegation.Entry = Entry;\n})(Redelegation = exports.Redelegation || (exports.Redelegation = {}));\nexports.Redelegation = Redelegation;\n//# sourceMappingURL=Redelegation.js.map","'use strict'\nvar ALPHABET = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l'\n\n// pre-compute lookup table\nvar ALPHABET_MAP = {}\nfor (var z = 0; z < ALPHABET.length; z++) {\n var x = ALPHABET.charAt(z)\n\n if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous')\n ALPHABET_MAP[x] = z\n}\n\nfunction polymodStep (pre) {\n var b = pre >> 25\n return ((pre & 0x1FFFFFF) << 5) ^\n (-((b >> 0) & 1) & 0x3b6a57b2) ^\n (-((b >> 1) & 1) & 0x26508e6d) ^\n (-((b >> 2) & 1) & 0x1ea119fa) ^\n (-((b >> 3) & 1) & 0x3d4233dd) ^\n (-((b >> 4) & 1) & 0x2a1462b3)\n}\n\nfunction prefixChk (prefix) {\n var chk = 1\n for (var i = 0; i < prefix.length; ++i) {\n var c = prefix.charCodeAt(i)\n if (c < 33 || c > 126) return 'Invalid prefix (' + prefix + ')'\n\n chk = polymodStep(chk) ^ (c >> 5)\n }\n chk = polymodStep(chk)\n\n for (i = 0; i < prefix.length; ++i) {\n var v = prefix.charCodeAt(i)\n chk = polymodStep(chk) ^ (v & 0x1f)\n }\n return chk\n}\n\nfunction encode (prefix, words, LIMIT) {\n LIMIT = LIMIT || 90\n if ((prefix.length + 7 + words.length) > LIMIT) throw new TypeError('Exceeds length limit')\n\n prefix = prefix.toLowerCase()\n\n // determine chk mod\n var chk = prefixChk(prefix)\n if (typeof chk === 'string') throw new Error(chk)\n\n var result = prefix + '1'\n for (var i = 0; i < words.length; ++i) {\n var x = words[i]\n if ((x >> 5) !== 0) throw new Error('Non 5-bit word')\n\n chk = polymodStep(chk) ^ x\n result += ALPHABET.charAt(x)\n }\n\n for (i = 0; i < 6; ++i) {\n chk = polymodStep(chk)\n }\n chk ^= 1\n\n for (i = 0; i < 6; ++i) {\n var v = (chk >> ((5 - i) * 5)) & 0x1f\n result += ALPHABET.charAt(v)\n }\n\n return result\n}\n\nfunction __decode (str, LIMIT) {\n LIMIT = LIMIT || 90\n if (str.length < 8) return str + ' too short'\n if (str.length > LIMIT) return 'Exceeds length limit'\n\n // don't allow mixed case\n var lowered = str.toLowerCase()\n var uppered = str.toUpperCase()\n if (str !== lowered && str !== uppered) return 'Mixed-case string ' + str\n str = lowered\n\n var split = str.lastIndexOf('1')\n if (split === -1) return 'No separator character for ' + str\n if (split === 0) return 'Missing prefix for ' + str\n\n var prefix = str.slice(0, split)\n var wordChars = str.slice(split + 1)\n if (wordChars.length < 6) return 'Data too short'\n\n var chk = prefixChk(prefix)\n if (typeof chk === 'string') return chk\n\n var words = []\n for (var i = 0; i < wordChars.length; ++i) {\n var c = wordChars.charAt(i)\n var v = ALPHABET_MAP[c]\n if (v === undefined) return 'Unknown character ' + c\n chk = polymodStep(chk) ^ v\n\n // not in the checksum?\n if (i + 6 >= wordChars.length) continue\n words.push(v)\n }\n\n if (chk !== 1) return 'Invalid checksum for ' + str\n return { prefix: prefix, words: words }\n}\n\nfunction decodeUnsafe () {\n var res = __decode.apply(null, arguments)\n if (typeof res === 'object') return res\n}\n\nfunction decode (str) {\n var res = __decode.apply(null, arguments)\n if (typeof res === 'object') return res\n\n throw new Error(res)\n}\n\nfunction convert (data, inBits, outBits, pad) {\n var value = 0\n var bits = 0\n var maxV = (1 << outBits) - 1\n\n var result = []\n for (var i = 0; i < data.length; ++i) {\n value = (value << inBits) | data[i]\n bits += inBits\n\n while (bits >= outBits) {\n bits -= outBits\n result.push((value >> bits) & maxV)\n }\n }\n\n if (pad) {\n if (bits > 0) {\n result.push((value << (outBits - bits)) & maxV)\n }\n } else {\n if (bits >= inBits) return 'Excess padding'\n if ((value << (outBits - bits)) & maxV) return 'Non-zero padding'\n }\n\n return result\n}\n\nfunction toWordsUnsafe (bytes) {\n var res = convert(bytes, 8, 5, true)\n if (Array.isArray(res)) return res\n}\n\nfunction toWords (bytes) {\n var res = convert(bytes, 8, 5, true)\n if (Array.isArray(res)) return res\n\n throw new Error(res)\n}\n\nfunction fromWordsUnsafe (words) {\n var res = convert(words, 5, 8, false)\n if (Array.isArray(res)) return res\n}\n\nfunction fromWords (words) {\n var res = convert(words, 5, 8, false)\n if (Array.isArray(res)) return res\n\n throw new Error(res)\n}\n\nmodule.exports = {\n decodeUnsafe: decodeUnsafe,\n decode: decode,\n encode: encode,\n toWordsUnsafe: toWordsUnsafe,\n toWords: toWords,\n fromWordsUnsafe: fromWordsUnsafe,\n fromWords: fromWords\n}\n","\"use strict\";\n// Adapted from https://github.com/terra-project/terra-js/blob/master/src/utils/keyUtils.ts\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MnemonicKey = exports.LUNA_COIN_TYPE = void 0;\nvar bip32 = __importStar(require(\"bip32\"));\nvar bip39 = __importStar(require(\"bip39\"));\nvar sha256_1 = __importDefault(require(\"crypto-js/sha256\"));\nvar secp256k1 = __importStar(require(\"secp256k1\"));\nvar Key_1 = require(\"./Key\");\nexports.LUNA_COIN_TYPE = 330;\nvar DEFAULT_OPTIONS = {\n account: 0,\n index: 0,\n coinType: exports.LUNA_COIN_TYPE,\n};\n/**\n * Implements a BIP39 mnemonic wallet with standard key derivation from a word list. Note\n * that this implementation exposes the private key in memory, so it is not advised to use\n * for applications requiring high security.\n */\nvar MnemonicKey = /** @class */ (function (_super) {\n __extends(MnemonicKey, _super);\n /**\n * Creates a new signing key from a mnemonic phrase. If no mnemonic is provided, one\n * will be automatically generated.\n *\n * ### Providing a mnemonic\n *\n * ```ts\n * import { MnemonicKey } from 'terra.js';\n *\n * const mk = new MnemonicKey({ mnemonic: '...' });\n * console.log(mk.accAddress);\n * ```\n *\n * ### Generating a random mnemonic\n *\n * ```ts\n * const mk2 = new MnemonicKey();\n * console.log(mk2.mnemonic);\n * ```\n *\n * @param options\n */\n function MnemonicKey(options) {\n if (options === void 0) { options = {}; }\n var _this = this;\n var _a = __assign(__assign({}, DEFAULT_OPTIONS), options), account = _a.account, index = _a.index, coinType = _a.coinType;\n var mnemonic = options.mnemonic;\n if (mnemonic === undefined) {\n mnemonic = bip39.generateMnemonic(256);\n }\n var seed = bip39.mnemonicToSeedSync(mnemonic);\n var masterKey = bip32.fromSeed(seed);\n var hdPathLuna = \"m/44'/\" + coinType + \"'/\" + account + \"'/0/\" + index;\n var terraHD = masterKey.derivePath(hdPathLuna);\n var privateKey = terraHD.privateKey;\n if (!privateKey) {\n throw new Error('Failed to derive key pair');\n }\n var publicKey = secp256k1.publicKeyCreate(new Uint8Array(privateKey), true);\n _this = _super.call(this, Buffer.from(publicKey)) || this;\n _this.privateKey = Buffer.from(privateKey);\n _this.mnemonic = mnemonic;\n return _this;\n }\n MnemonicKey.prototype.ecdsaSign = function (payload) {\n var hash = Buffer.from(sha256_1.default(payload.toString()).toString(), 'hex');\n return secp256k1.ecdsaSign(Uint8Array.from(hash), Uint8Array.from(this.privateKey));\n };\n MnemonicKey.prototype.sign = function (payload) {\n return __awaiter(this, void 0, void 0, function () {\n var signature;\n return __generator(this, function (_a) {\n signature = this.ecdsaSign(payload).signature;\n return [2 /*return*/, Buffer.from(signature)];\n });\n });\n };\n return MnemonicKey;\n}(Key_1.Key));\nexports.MnemonicKey = MnemonicKey;\n//# sourceMappingURL=MnemonicKey.js.map","'use strict'\n\nvar createHash = require('create-hash')\nvar bs58checkBase = require('./base')\n\n// SHA256(SHA256(buffer))\nfunction sha256x2 (buffer) {\n var tmp = createHash('sha256').update(buffer).digest()\n return createHash('sha256').update(tmp).digest()\n}\n\nmodule.exports = bs58checkBase(sha256x2)\n","'use strict';\n\nvar elliptic = exports;\n\nelliptic.version = require('../package.json').version;\nelliptic.utils = require('./elliptic/utils');\nelliptic.rand = require('brorand');\nelliptic.curve = require('./elliptic/curve');\nelliptic.curves = require('./elliptic/curves');\n\n// Protocols\nelliptic.ec = require('./elliptic/ec');\nelliptic.eddsa = require('./elliptic/eddsa');\n","'use strict';\n\nvar utils = exports;\n\nfunction toArray(msg, enc) {\n if (Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg !== 'string') {\n for (var i = 0; i < msg.length; i++)\n res[i] = msg[i] | 0;\n return res;\n }\n if (enc === 'hex') {\n msg = msg.replace(/[^a-z0-9]+/ig, '');\n if (msg.length % 2 !== 0)\n msg = '0' + msg;\n for (var i = 0; i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n } else {\n for (var i = 0; i < msg.length; i++) {\n var c = msg.charCodeAt(i);\n var hi = c >> 8;\n var lo = c & 0xff;\n if (hi)\n res.push(hi, lo);\n else\n res.push(lo);\n }\n }\n return res;\n}\nutils.toArray = toArray;\n\nfunction zero2(word) {\n if (word.length === 1)\n return '0' + word;\n else\n return word;\n}\nutils.zero2 = zero2;\n\nfunction toHex(msg) {\n var res = '';\n for (var i = 0; i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n}\nutils.toHex = toHex;\n\nutils.encode = function encode(arr, enc) {\n if (enc === 'hex')\n return toHex(arr);\n else\n return arr;\n};\n","var r;\n\nmodule.exports = function rand(len) {\n if (!r)\n r = new Rand(null);\n\n return r.generate(len);\n};\n\nfunction Rand(rand) {\n this.rand = rand;\n}\nmodule.exports.Rand = Rand;\n\nRand.prototype.generate = function generate(len) {\n return this._rand(len);\n};\n\n// Emulate crypto API using randy\nRand.prototype._rand = function _rand(n) {\n if (this.rand.getBytes)\n return this.rand.getBytes(n);\n\n var res = new Uint8Array(n);\n for (var i = 0; i < res.length; i++)\n res[i] = this.rand.getByte();\n return res;\n};\n\nif (typeof self === 'object') {\n if (self.crypto && self.crypto.getRandomValues) {\n // Modern browsers\n Rand.prototype._rand = function _rand(n) {\n var arr = new Uint8Array(n);\n self.crypto.getRandomValues(arr);\n return arr;\n };\n } else if (self.msCrypto && self.msCrypto.getRandomValues) {\n // IE\n Rand.prototype._rand = function _rand(n) {\n var arr = new Uint8Array(n);\n self.msCrypto.getRandomValues(arr);\n return arr;\n };\n\n // Safari's WebWorkers do not have `crypto`\n } else if (typeof window === 'object') {\n // Old junk\n Rand.prototype._rand = function() {\n throw new Error('Not implemented yet');\n };\n }\n} else {\n // Node.js or Web worker with no crypto support\n try {\n var crypto = require('crypto');\n if (typeof crypto.randomBytes !== 'function')\n throw new Error('Not supported');\n\n Rand.prototype._rand = function _rand(n) {\n return crypto.randomBytes(n);\n };\n } catch (e) {\n }\n}\n","'use strict';\n\nvar curve = exports;\n\ncurve.base = require('./base');\ncurve.short = require('./short');\ncurve.mont = require('./mont');\ncurve.edwards = require('./edwards');\n","'use strict';\n\nvar utils = require('../utils');\nvar rotr32 = utils.rotr32;\n\nfunction ft_1(s, x, y, z) {\n if (s === 0)\n return ch32(x, y, z);\n if (s === 1 || s === 3)\n return p32(x, y, z);\n if (s === 2)\n return maj32(x, y, z);\n}\nexports.ft_1 = ft_1;\n\nfunction ch32(x, y, z) {\n return (x & y) ^ ((~x) & z);\n}\nexports.ch32 = ch32;\n\nfunction maj32(x, y, z) {\n return (x & y) ^ (x & z) ^ (y & z);\n}\nexports.maj32 = maj32;\n\nfunction p32(x, y, z) {\n return x ^ y ^ z;\n}\nexports.p32 = p32;\n\nfunction s0_256(x) {\n return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);\n}\nexports.s0_256 = s0_256;\n\nfunction s1_256(x) {\n return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);\n}\nexports.s1_256 = s1_256;\n\nfunction g0_256(x) {\n return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);\n}\nexports.g0_256 = g0_256;\n\nfunction g1_256(x) {\n return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);\n}\nexports.g1_256 = g1_256;\n","'use strict';\n\nvar utils = require('../utils');\nvar common = require('../common');\nvar shaCommon = require('./common');\nvar assert = require('minimalistic-assert');\n\nvar sum32 = utils.sum32;\nvar sum32_4 = utils.sum32_4;\nvar sum32_5 = utils.sum32_5;\nvar ch32 = shaCommon.ch32;\nvar maj32 = shaCommon.maj32;\nvar s0_256 = shaCommon.s0_256;\nvar s1_256 = shaCommon.s1_256;\nvar g0_256 = shaCommon.g0_256;\nvar g1_256 = shaCommon.g1_256;\n\nvar BlockHash = common.BlockHash;\n\nvar sha256_K = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,\n 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\n 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,\n 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\n 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,\n 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n];\n\nfunction SHA256() {\n if (!(this instanceof SHA256))\n return new SHA256();\n\n BlockHash.call(this);\n this.h = [\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,\n 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19\n ];\n this.k = sha256_K;\n this.W = new Array(64);\n}\nutils.inherits(SHA256, BlockHash);\nmodule.exports = SHA256;\n\nSHA256.blockSize = 512;\nSHA256.outSize = 256;\nSHA256.hmacStrength = 192;\nSHA256.padLength = 64;\n\nSHA256.prototype._update = function _update(msg, start) {\n var W = this.W;\n\n for (var i = 0; i < 16; i++)\n W[i] = msg[start + i];\n for (; i < W.length; i++)\n W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);\n\n var a = this.h[0];\n var b = this.h[1];\n var c = this.h[2];\n var d = this.h[3];\n var e = this.h[4];\n var f = this.h[5];\n var g = this.h[6];\n var h = this.h[7];\n\n assert(this.k.length === W.length);\n for (i = 0; i < W.length; i++) {\n var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);\n var T2 = sum32(s0_256(a), maj32(a, b, c));\n h = g;\n g = f;\n f = e;\n e = sum32(d, T1);\n d = c;\n c = b;\n b = a;\n a = sum32(T1, T2);\n }\n\n this.h[0] = sum32(this.h[0], a);\n this.h[1] = sum32(this.h[1], b);\n this.h[2] = sum32(this.h[2], c);\n this.h[3] = sum32(this.h[3], d);\n this.h[4] = sum32(this.h[4], e);\n this.h[5] = sum32(this.h[5], f);\n this.h[6] = sum32(this.h[6], g);\n this.h[7] = sum32(this.h[7], h);\n};\n\nSHA256.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'big');\n else\n return utils.split32(this.h, 'big');\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar common = require('../common');\nvar assert = require('minimalistic-assert');\n\nvar rotr64_hi = utils.rotr64_hi;\nvar rotr64_lo = utils.rotr64_lo;\nvar shr64_hi = utils.shr64_hi;\nvar shr64_lo = utils.shr64_lo;\nvar sum64 = utils.sum64;\nvar sum64_hi = utils.sum64_hi;\nvar sum64_lo = utils.sum64_lo;\nvar sum64_4_hi = utils.sum64_4_hi;\nvar sum64_4_lo = utils.sum64_4_lo;\nvar sum64_5_hi = utils.sum64_5_hi;\nvar sum64_5_lo = utils.sum64_5_lo;\n\nvar BlockHash = common.BlockHash;\n\nvar sha512_K = [\n 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n];\n\nfunction SHA512() {\n if (!(this instanceof SHA512))\n return new SHA512();\n\n BlockHash.call(this);\n this.h = [\n 0x6a09e667, 0xf3bcc908,\n 0xbb67ae85, 0x84caa73b,\n 0x3c6ef372, 0xfe94f82b,\n 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1,\n 0x9b05688c, 0x2b3e6c1f,\n 0x1f83d9ab, 0xfb41bd6b,\n 0x5be0cd19, 0x137e2179 ];\n this.k = sha512_K;\n this.W = new Array(160);\n}\nutils.inherits(SHA512, BlockHash);\nmodule.exports = SHA512;\n\nSHA512.blockSize = 1024;\nSHA512.outSize = 512;\nSHA512.hmacStrength = 192;\nSHA512.padLength = 128;\n\nSHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {\n var W = this.W;\n\n // 32 x 32bit words\n for (var i = 0; i < 32; i++)\n W[i] = msg[start + i];\n for (; i < W.length; i += 2) {\n var c0_hi = g1_512_hi(W[i - 4], W[i - 3]); // i - 2\n var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);\n var c1_hi = W[i - 14]; // i - 7\n var c1_lo = W[i - 13];\n var c2_hi = g0_512_hi(W[i - 30], W[i - 29]); // i - 15\n var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);\n var c3_hi = W[i - 32]; // i - 16\n var c3_lo = W[i - 31];\n\n W[i] = sum64_4_hi(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo);\n W[i + 1] = sum64_4_lo(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo);\n }\n};\n\nSHA512.prototype._update = function _update(msg, start) {\n this._prepareBlock(msg, start);\n\n var W = this.W;\n\n var ah = this.h[0];\n var al = this.h[1];\n var bh = this.h[2];\n var bl = this.h[3];\n var ch = this.h[4];\n var cl = this.h[5];\n var dh = this.h[6];\n var dl = this.h[7];\n var eh = this.h[8];\n var el = this.h[9];\n var fh = this.h[10];\n var fl = this.h[11];\n var gh = this.h[12];\n var gl = this.h[13];\n var hh = this.h[14];\n var hl = this.h[15];\n\n assert(this.k.length === W.length);\n for (var i = 0; i < W.length; i += 2) {\n var c0_hi = hh;\n var c0_lo = hl;\n var c1_hi = s1_512_hi(eh, el);\n var c1_lo = s1_512_lo(eh, el);\n var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);\n var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);\n var c3_hi = this.k[i];\n var c3_lo = this.k[i + 1];\n var c4_hi = W[i];\n var c4_lo = W[i + 1];\n\n var T1_hi = sum64_5_hi(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo,\n c4_hi, c4_lo);\n var T1_lo = sum64_5_lo(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo,\n c4_hi, c4_lo);\n\n c0_hi = s0_512_hi(ah, al);\n c0_lo = s0_512_lo(ah, al);\n c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);\n c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);\n\n var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);\n var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);\n\n hh = gh;\n hl = gl;\n\n gh = fh;\n gl = fl;\n\n fh = eh;\n fl = el;\n\n eh = sum64_hi(dh, dl, T1_hi, T1_lo);\n el = sum64_lo(dl, dl, T1_hi, T1_lo);\n\n dh = ch;\n dl = cl;\n\n ch = bh;\n cl = bl;\n\n bh = ah;\n bl = al;\n\n ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);\n al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);\n }\n\n sum64(this.h, 0, ah, al);\n sum64(this.h, 2, bh, bl);\n sum64(this.h, 4, ch, cl);\n sum64(this.h, 6, dh, dl);\n sum64(this.h, 8, eh, el);\n sum64(this.h, 10, fh, fl);\n sum64(this.h, 12, gh, gl);\n sum64(this.h, 14, hh, hl);\n};\n\nSHA512.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'big');\n else\n return utils.split32(this.h, 'big');\n};\n\nfunction ch64_hi(xh, xl, yh, yl, zh) {\n var r = (xh & yh) ^ ((~xh) & zh);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction ch64_lo(xh, xl, yh, yl, zh, zl) {\n var r = (xl & yl) ^ ((~xl) & zl);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction maj64_hi(xh, xl, yh, yl, zh) {\n var r = (xh & yh) ^ (xh & zh) ^ (yh & zh);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction maj64_lo(xh, xl, yh, yl, zh, zl) {\n var r = (xl & yl) ^ (xl & zl) ^ (yl & zl);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 28);\n var c1_hi = rotr64_hi(xl, xh, 2); // 34\n var c2_hi = rotr64_hi(xl, xh, 7); // 39\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 28);\n var c1_lo = rotr64_lo(xl, xh, 2); // 34\n var c2_lo = rotr64_lo(xl, xh, 7); // 39\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 14);\n var c1_hi = rotr64_hi(xh, xl, 18);\n var c2_hi = rotr64_hi(xl, xh, 9); // 41\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 14);\n var c1_lo = rotr64_lo(xh, xl, 18);\n var c2_lo = rotr64_lo(xl, xh, 9); // 41\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 1);\n var c1_hi = rotr64_hi(xh, xl, 8);\n var c2_hi = shr64_hi(xh, xl, 7);\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 1);\n var c1_lo = rotr64_lo(xh, xl, 8);\n var c2_lo = shr64_lo(xh, xl, 7);\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 19);\n var c1_hi = rotr64_hi(xl, xh, 29); // 61\n var c2_hi = shr64_hi(xh, xl, 6);\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 19);\n var c1_lo = rotr64_lo(xl, xh, 29); // 61\n var c2_lo = shr64_lo(xh, xl, 6);\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n","var native = require('./native')\n\nfunction getTypeName (fn) {\n return fn.name || fn.toString().match(/function (.*?)\\s*\\(/)[1]\n}\n\nfunction getValueTypeName (value) {\n return native.Nil(value) ? '' : getTypeName(value.constructor)\n}\n\nfunction getValue (value) {\n if (native.Function(value)) return ''\n if (native.String(value)) return JSON.stringify(value)\n if (value && native.Object(value)) return ''\n return value\n}\n\nfunction captureStackTrace (e, t) {\n if (Error.captureStackTrace) {\n Error.captureStackTrace(e, t)\n }\n}\n\nfunction tfJSON (type) {\n if (native.Function(type)) return type.toJSON ? type.toJSON() : getTypeName(type)\n if (native.Array(type)) return 'Array'\n if (type && native.Object(type)) return 'Object'\n\n return type !== undefined ? type : ''\n}\n\nfunction tfErrorString (type, value, valueTypeName) {\n var valueJson = getValue(value)\n\n return 'Expected ' + tfJSON(type) + ', got' +\n (valueTypeName !== '' ? ' ' + valueTypeName : '') +\n (valueJson !== '' ? ' ' + valueJson : '')\n}\n\nfunction TfTypeError (type, value, valueTypeName) {\n valueTypeName = valueTypeName || getValueTypeName(value)\n this.message = tfErrorString(type, value, valueTypeName)\n\n captureStackTrace(this, TfTypeError)\n this.__type = type\n this.__value = value\n this.__valueTypeName = valueTypeName\n}\n\nTfTypeError.prototype = Object.create(Error.prototype)\nTfTypeError.prototype.constructor = TfTypeError\n\nfunction tfPropertyErrorString (type, label, name, value, valueTypeName) {\n var description = '\" of type '\n if (label === 'key') description = '\" with key type '\n\n return tfErrorString('property \"' + tfJSON(name) + description + tfJSON(type), value, valueTypeName)\n}\n\nfunction TfPropertyTypeError (type, property, label, value, valueTypeName) {\n if (type) {\n valueTypeName = valueTypeName || getValueTypeName(value)\n this.message = tfPropertyErrorString(type, label, property, value, valueTypeName)\n } else {\n this.message = 'Unexpected property \"' + property + '\"'\n }\n\n captureStackTrace(this, TfTypeError)\n this.__label = label\n this.__property = property\n this.__type = type\n this.__value = value\n this.__valueTypeName = valueTypeName\n}\n\nTfPropertyTypeError.prototype = Object.create(Error.prototype)\nTfPropertyTypeError.prototype.constructor = TfTypeError\n\nfunction tfCustomError (expected, actual) {\n return new TfTypeError(expected, {}, actual)\n}\n\nfunction tfSubError (e, property, label) {\n // sub child?\n if (e instanceof TfPropertyTypeError) {\n property = property + '.' + e.__property\n\n e = new TfPropertyTypeError(\n e.__type, property, e.__label, e.__value, e.__valueTypeName\n )\n\n // child?\n } else if (e instanceof TfTypeError) {\n e = new TfPropertyTypeError(\n e.__type, property, label, e.__value, e.__valueTypeName\n )\n }\n\n captureStackTrace(e)\n return e\n}\n\nmodule.exports = {\n TfTypeError: TfTypeError,\n TfPropertyTypeError: TfPropertyTypeError,\n tfCustomError: tfCustomError,\n tfSubError: tfSubError,\n tfJSON: tfJSON,\n getValueTypeName: getValueTypeName\n}\n","var sizes = {\n md5: 16,\n sha1: 20,\n sha224: 28,\n sha256: 32,\n sha384: 48,\n sha512: 64,\n rmd160: 20,\n ripemd160: 20\n}\n\nvar createHmac = require('create-hmac')\nvar Buffer = require('safe-buffer').Buffer\n\nvar checkParameters = require('./precondition')\nvar defaultEncoding = require('./default-encoding')\nvar toBuffer = require('./to-buffer')\n\nfunction pbkdf2 (password, salt, iterations, keylen, digest) {\n checkParameters(iterations, keylen)\n password = toBuffer(password, defaultEncoding, 'Password')\n salt = toBuffer(salt, defaultEncoding, 'Salt')\n\n digest = digest || 'sha1'\n\n var DK = Buffer.allocUnsafe(keylen)\n var block1 = Buffer.allocUnsafe(salt.length + 4)\n salt.copy(block1, 0, 0, salt.length)\n\n var destPos = 0\n var hLen = sizes[digest]\n var l = Math.ceil(keylen / hLen)\n\n for (var i = 1; i <= l; i++) {\n block1.writeUInt32BE(i, salt.length)\n\n var T = createHmac(digest, password).update(block1).digest()\n var U = T\n\n for (var j = 1; j < iterations; j++) {\n U = createHmac(digest, password).update(U).digest()\n for (var k = 0; k < hLen; k++) T[k] ^= U[k]\n }\n\n T.copy(DK, destPos)\n destPos += hLen\n }\n\n return DK\n}\n\nmodule.exports = pbkdf2\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// browserify by default only pulls in files that are hard coded in requires\n// In order of last to first in this file, the default wordlist will be chosen\n// based on what is present. (Bundles may remove wordlists they don't need)\nconst wordlists = {};\nexports.wordlists = wordlists;\nlet _default;\nexports._default = _default;\ntry {\n exports._default = _default = require('./wordlists/chinese_simplified.json');\n wordlists.chinese_simplified = _default;\n}\ncatch (err) { }\ntry {\n exports._default = _default = require('./wordlists/chinese_traditional.json');\n wordlists.chinese_traditional = _default;\n}\ncatch (err) { }\ntry {\n exports._default = _default = require('./wordlists/korean.json');\n wordlists.korean = _default;\n}\ncatch (err) { }\ntry {\n exports._default = _default = require('./wordlists/french.json');\n wordlists.french = _default;\n}\ncatch (err) { }\ntry {\n exports._default = _default = require('./wordlists/italian.json');\n wordlists.italian = _default;\n}\ncatch (err) { }\ntry {\n exports._default = _default = require('./wordlists/spanish.json');\n wordlists.spanish = _default;\n}\ncatch (err) { }\ntry {\n exports._default = _default = require('./wordlists/japanese.json');\n wordlists.japanese = _default;\n wordlists.JA = _default;\n}\ncatch (err) { }\ntry {\n exports._default = _default = require('./wordlists/english.json');\n wordlists.english = _default;\n wordlists.EN = _default;\n}\ncatch (err) { }\n","try {\n module.exports = require('./bindings')\n} catch (err) {\n module.exports = require('./elliptic')\n}\n","const errors = {\n IMPOSSIBLE_CASE: 'Impossible case. Please create issue.',\n TWEAK_ADD:\n 'The tweak was out of range or the resulted private key is invalid',\n TWEAK_MUL: 'The tweak was out of range or equal to zero',\n CONTEXT_RANDOMIZE_UNKNOW: 'Unknow error on context randomization',\n SECKEY_INVALID: 'Private Key is invalid',\n PUBKEY_PARSE: 'Public Key could not be parsed',\n PUBKEY_SERIALIZE: 'Public Key serialization error',\n PUBKEY_COMBINE: 'The sum of the public keys is not valid',\n SIG_PARSE: 'Signature could not be parsed',\n SIGN: 'The nonce generation function failed, or the private key was invalid',\n RECOVER: 'Public key could not be recover',\n ECDH: 'Scalar was invalid (zero or overflow)'\n}\n\nfunction assert (cond, msg) {\n if (!cond) throw new Error(msg)\n}\n\nfunction isUint8Array (name, value, length) {\n assert(value instanceof Uint8Array, `Expected ${name} to be an Uint8Array`)\n\n if (length !== undefined) {\n if (Array.isArray(length)) {\n const numbers = length.join(', ')\n const msg = `Expected ${name} to be an Uint8Array with length [${numbers}]`\n assert(length.includes(value.length), msg)\n } else {\n const msg = `Expected ${name} to be an Uint8Array with length ${length}`\n assert(value.length === length, msg)\n }\n }\n}\n\nfunction isCompressed (value) {\n assert(toTypeString(value) === 'Boolean', 'Expected compressed to be a Boolean')\n}\n\nfunction getAssertedOutput (output = (len) => new Uint8Array(len), length) {\n if (typeof output === 'function') output = output(length)\n isUint8Array('output', output, length)\n return output\n}\n\nfunction toTypeString (value) {\n return Object.prototype.toString.call(value).slice(8, -1)\n}\n\nmodule.exports = (secp256k1) => {\n return {\n contextRandomize (seed) {\n assert(\n seed === null || seed instanceof Uint8Array,\n 'Expected seed to be an Uint8Array or null'\n )\n if (seed !== null) isUint8Array('seed', seed, 32)\n\n switch (secp256k1.contextRandomize(seed)) {\n case 1:\n throw new Error(errors.CONTEXT_RANDOMIZE_UNKNOW)\n }\n },\n\n privateKeyVerify (seckey) {\n isUint8Array('private key', seckey, 32)\n\n return secp256k1.privateKeyVerify(seckey) === 0\n },\n\n privateKeyNegate (seckey) {\n isUint8Array('private key', seckey, 32)\n\n switch (secp256k1.privateKeyNegate(seckey)) {\n case 0:\n return seckey\n case 1:\n throw new Error(errors.IMPOSSIBLE_CASE)\n }\n },\n\n privateKeyTweakAdd (seckey, tweak) {\n isUint8Array('private key', seckey, 32)\n isUint8Array('tweak', tweak, 32)\n\n switch (secp256k1.privateKeyTweakAdd(seckey, tweak)) {\n case 0:\n return seckey\n case 1:\n throw new Error(errors.TWEAK_ADD)\n }\n },\n\n privateKeyTweakMul (seckey, tweak) {\n isUint8Array('private key', seckey, 32)\n isUint8Array('tweak', tweak, 32)\n\n switch (secp256k1.privateKeyTweakMul(seckey, tweak)) {\n case 0:\n return seckey\n case 1:\n throw new Error(errors.TWEAK_MUL)\n }\n },\n\n publicKeyVerify (pubkey) {\n isUint8Array('public key', pubkey, [33, 65])\n\n return secp256k1.publicKeyVerify(pubkey) === 0\n },\n\n publicKeyCreate (seckey, compressed = true, output) {\n isUint8Array('private key', seckey, 32)\n isCompressed(compressed)\n output = getAssertedOutput(output, compressed ? 33 : 65)\n\n switch (secp256k1.publicKeyCreate(output, seckey)) {\n case 0:\n return output\n case 1:\n throw new Error(errors.SECKEY_INVALID)\n case 2:\n throw new Error(errors.PUBKEY_SERIALIZE)\n }\n },\n\n publicKeyConvert (pubkey, compressed = true, output) {\n isUint8Array('public key', pubkey, [33, 65])\n isCompressed(compressed)\n output = getAssertedOutput(output, compressed ? 33 : 65)\n\n switch (secp256k1.publicKeyConvert(output, pubkey)) {\n case 0:\n return output\n case 1:\n throw new Error(errors.PUBKEY_PARSE)\n case 2:\n throw new Error(errors.PUBKEY_SERIALIZE)\n }\n },\n\n publicKeyNegate (pubkey, compressed = true, output) {\n isUint8Array('public key', pubkey, [33, 65])\n isCompressed(compressed)\n output = getAssertedOutput(output, compressed ? 33 : 65)\n\n switch (secp256k1.publicKeyNegate(output, pubkey)) {\n case 0:\n return output\n case 1:\n throw new Error(errors.PUBKEY_PARSE)\n case 2:\n throw new Error(errors.IMPOSSIBLE_CASE)\n case 3:\n throw new Error(errors.PUBKEY_SERIALIZE)\n }\n },\n\n publicKeyCombine (pubkeys, compressed = true, output) {\n assert(Array.isArray(pubkeys), 'Expected public keys to be an Array')\n assert(pubkeys.length > 0, 'Expected public keys array will have more than zero items')\n for (const pubkey of pubkeys) {\n isUint8Array('public key', pubkey, [33, 65])\n }\n isCompressed(compressed)\n output = getAssertedOutput(output, compressed ? 33 : 65)\n\n switch (secp256k1.publicKeyCombine(output, pubkeys)) {\n case 0:\n return output\n case 1:\n throw new Error(errors.PUBKEY_PARSE)\n case 2:\n throw new Error(errors.PUBKEY_COMBINE)\n case 3:\n throw new Error(errors.PUBKEY_SERIALIZE)\n }\n },\n\n publicKeyTweakAdd (pubkey, tweak, compressed = true, output) {\n isUint8Array('public key', pubkey, [33, 65])\n isUint8Array('tweak', tweak, 32)\n isCompressed(compressed)\n output = getAssertedOutput(output, compressed ? 33 : 65)\n\n switch (secp256k1.publicKeyTweakAdd(output, pubkey, tweak)) {\n case 0:\n return output\n case 1:\n throw new Error(errors.PUBKEY_PARSE)\n case 2:\n throw new Error(errors.TWEAK_ADD)\n }\n },\n\n publicKeyTweakMul (pubkey, tweak, compressed = true, output) {\n isUint8Array('public key', pubkey, [33, 65])\n isUint8Array('tweak', tweak, 32)\n isCompressed(compressed)\n output = getAssertedOutput(output, compressed ? 33 : 65)\n\n switch (secp256k1.publicKeyTweakMul(output, pubkey, tweak)) {\n case 0:\n return output\n case 1:\n throw new Error(errors.PUBKEY_PARSE)\n case 2:\n throw new Error(errors.TWEAK_MUL)\n }\n },\n\n signatureNormalize (sig) {\n isUint8Array('signature', sig, 64)\n\n switch (secp256k1.signatureNormalize(sig)) {\n case 0:\n return sig\n case 1:\n throw new Error(errors.SIG_PARSE)\n }\n },\n\n signatureExport (sig, output) {\n isUint8Array('signature', sig, 64)\n output = getAssertedOutput(output, 72)\n\n const obj = { output, outputlen: 72 }\n switch (secp256k1.signatureExport(obj, sig)) {\n case 0:\n return output.slice(0, obj.outputlen)\n case 1:\n throw new Error(errors.SIG_PARSE)\n case 2:\n throw new Error(errors.IMPOSSIBLE_CASE)\n }\n },\n\n signatureImport (sig, output) {\n isUint8Array('signature', sig)\n output = getAssertedOutput(output, 64)\n\n switch (secp256k1.signatureImport(output, sig)) {\n case 0:\n return output\n case 1:\n throw new Error(errors.SIG_PARSE)\n case 2:\n throw new Error(errors.IMPOSSIBLE_CASE)\n }\n },\n\n ecdsaSign (msg32, seckey, options = {}, output) {\n isUint8Array('message', msg32, 32)\n isUint8Array('private key', seckey, 32)\n assert(toTypeString(options) === 'Object', 'Expected options to be an Object')\n if (options.data !== undefined) isUint8Array('options.data', options.data)\n if (options.noncefn !== undefined) assert(toTypeString(options.noncefn) === 'Function', 'Expected options.noncefn to be a Function')\n output = getAssertedOutput(output, 64)\n\n const obj = { signature: output, recid: null }\n switch (secp256k1.ecdsaSign(obj, msg32, seckey, options.data, options.noncefn)) {\n case 0:\n return obj\n case 1:\n throw new Error(errors.SIGN)\n case 2:\n throw new Error(errors.IMPOSSIBLE_CASE)\n }\n },\n\n ecdsaVerify (sig, msg32, pubkey) {\n isUint8Array('signature', sig, 64)\n isUint8Array('message', msg32, 32)\n isUint8Array('public key', pubkey, [33, 65])\n\n switch (secp256k1.ecdsaVerify(sig, msg32, pubkey)) {\n case 0:\n return true\n case 3:\n return false\n case 1:\n throw new Error(errors.SIG_PARSE)\n case 2:\n throw new Error(errors.PUBKEY_PARSE)\n }\n },\n\n ecdsaRecover (sig, recid, msg32, compressed = true, output) {\n isUint8Array('signature', sig, 64)\n assert(\n toTypeString(recid) === 'Number' &&\n recid >= 0 &&\n recid <= 3,\n 'Expected recovery id to be a Number within interval [0, 3]'\n )\n isUint8Array('message', msg32, 32)\n isCompressed(compressed)\n output = getAssertedOutput(output, compressed ? 33 : 65)\n\n switch (secp256k1.ecdsaRecover(output, sig, recid, msg32)) {\n case 0:\n return output\n case 1:\n throw new Error(errors.SIG_PARSE)\n case 2:\n throw new Error(errors.RECOVER)\n case 3:\n throw new Error(errors.IMPOSSIBLE_CASE)\n }\n },\n\n ecdh (pubkey, seckey, options = {}, output) {\n isUint8Array('public key', pubkey, [33, 65])\n isUint8Array('private key', seckey, 32)\n assert(toTypeString(options) === 'Object', 'Expected options to be an Object')\n if (options.data !== undefined) isUint8Array('options.data', options.data)\n if (options.hashfn !== undefined) {\n assert(toTypeString(options.hashfn) === 'Function', 'Expected options.hashfn to be a Function')\n if (options.xbuf !== undefined) isUint8Array('options.xbuf', options.xbuf, 32)\n if (options.ybuf !== undefined) isUint8Array('options.ybuf', options.ybuf, 32)\n isUint8Array('output', output)\n } else {\n output = getAssertedOutput(output, 32)\n }\n\n switch (secp256k1.ecdh(output, pubkey, seckey, options.data, options.hashfn, options.xbuf, options.ybuf)) {\n case 0:\n return output\n case 1:\n throw new Error(errors.PUBKEY_PARSE)\n case 2:\n throw new Error(errors.ECDH)\n }\n }\n }\n}\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LCDClient = void 0;\nvar APIRequester_1 = require(\"./APIRequester\");\nvar api_1 = require(\"./api\");\nvar Wallet_1 = require(\"./Wallet\");\nvar DEFAULT_LCD_OPTIONS = {\n gasAdjustment: 1.4,\n};\nvar DEFAULT_GAS_PRICES_BY_CHAIN_ID = {\n default: {\n uluna: 0.00506,\n },\n 'columbus-3': {\n uluna: 0.015,\n },\n 'tequila-0004': {\n uluna: 0.15,\n },\n};\n/**\n * An object repesenting a connection to a terrad node running the Lite Client Daemon (LCD)\n * server, a REST server providing access to a node.\n *\n * ### Example\n *\n * ```ts\n * import { LCDClient, Coin } from 'terra.js';\n *\n * const terra = new LCDClient({\n * URL: \"https://lcd.terra.dev\",\n * chainID: \"columbus-3\"\n * });\n *\n * terra.market.swapRate(new Coin('uluna', 10000), 'ukrw').then(c => console.log(c.toString()));\n * ```\n */\nvar LCDClient = /** @class */ (function () {\n /**\n * Creates a new LCD client with the specified configuration.\n *\n * @param config LCD configuration\n */\n function LCDClient(config) {\n this.config = __assign(__assign(__assign({}, DEFAULT_LCD_OPTIONS), { gasPrices: DEFAULT_GAS_PRICES_BY_CHAIN_ID[config.chainID] ||\n DEFAULT_GAS_PRICES_BY_CHAIN_ID['default'] }), config);\n this.apiRequester = new APIRequester_1.APIRequester(this.config.URL);\n // instantiate APIs\n this.auth = new api_1.AuthAPI(this.apiRequester);\n this.bank = new api_1.BankAPI(this.apiRequester);\n this.distribution = new api_1.DistributionAPI(this.apiRequester);\n this.gov = new api_1.GovAPI(this.apiRequester);\n this.market = new api_1.MarketAPI(this.apiRequester);\n this.msgauth = new api_1.MsgAuthAPI(this.apiRequester);\n this.oracle = new api_1.OracleAPI(this.apiRequester);\n this.slashing = new api_1.SlashingAPI(this.apiRequester);\n this.staking = new api_1.StakingAPI(this.apiRequester);\n this.supply = new api_1.SupplyAPI(this.apiRequester);\n this.tendermint = new api_1.TendermintAPI(this.apiRequester);\n this.treasury = new api_1.TreasuryAPI(this.apiRequester);\n this.wasm = new api_1.WasmAPI(this.apiRequester);\n this.tx = new api_1.TxAPI(this);\n }\n /** Creates a new wallet with the Key. */\n LCDClient.prototype.wallet = function (key) {\n return new Wallet_1.Wallet(this, key);\n };\n return LCDClient;\n}());\nexports.LCDClient = LCDClient;\n//# sourceMappingURL=LCDClient.js.map","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","module.exports = require(\"http\");","module.exports = require(\"https\");","var url = require(\"url\");\nvar URL = url.URL;\nvar http = require(\"http\");\nvar https = require(\"https\");\nvar Writable = require(\"stream\").Writable;\nvar assert = require(\"assert\");\nvar debug = require(\"./debug\");\n\n// Create handlers that pass events from native requests\nvar eventHandlers = Object.create(null);\n[\"abort\", \"aborted\", \"connect\", \"error\", \"socket\", \"timeout\"].forEach(function (event) {\n eventHandlers[event] = function (arg1, arg2, arg3) {\n this._redirectable.emit(event, arg1, arg2, arg3);\n };\n});\n\n// Error types with codes\nvar RedirectionError = createErrorType(\n \"ERR_FR_REDIRECTION_FAILURE\",\n \"\"\n);\nvar TooManyRedirectsError = createErrorType(\n \"ERR_FR_TOO_MANY_REDIRECTS\",\n \"Maximum number of redirects exceeded\"\n);\nvar MaxBodyLengthExceededError = createErrorType(\n \"ERR_FR_MAX_BODY_LENGTH_EXCEEDED\",\n \"Request body larger than maxBodyLength limit\"\n);\nvar WriteAfterEndError = createErrorType(\n \"ERR_STREAM_WRITE_AFTER_END\",\n \"write after end\"\n);\n\n// An HTTP(S) request that can be redirected\nfunction RedirectableRequest(options, responseCallback) {\n // Initialize the request\n Writable.call(this);\n this._sanitizeOptions(options);\n this._options = options;\n this._ended = false;\n this._ending = false;\n this._redirectCount = 0;\n this._redirects = [];\n this._requestBodyLength = 0;\n this._requestBodyBuffers = [];\n\n // Attach a callback if passed\n if (responseCallback) {\n this.on(\"response\", responseCallback);\n }\n\n // React to responses of native requests\n var self = this;\n this._onNativeResponse = function (response) {\n self._processResponse(response);\n };\n\n // Perform the first request\n this._performRequest();\n}\nRedirectableRequest.prototype = Object.create(Writable.prototype);\n\n// Writes buffered data to the current native request\nRedirectableRequest.prototype.write = function (data, encoding, callback) {\n // Writing is not allowed if end has been called\n if (this._ending) {\n throw new WriteAfterEndError();\n }\n\n // Validate input and shift parameters if necessary\n if (!(typeof data === \"string\" || typeof data === \"object\" && (\"length\" in data))) {\n throw new TypeError(\"data should be a string, Buffer or Uint8Array\");\n }\n if (typeof encoding === \"function\") {\n callback = encoding;\n encoding = null;\n }\n\n // Ignore empty buffers, since writing them doesn't invoke the callback\n // https://github.com/nodejs/node/issues/22066\n if (data.length === 0) {\n if (callback) {\n callback();\n }\n return;\n }\n // Only write when we don't exceed the maximum body length\n if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {\n this._requestBodyLength += data.length;\n this._requestBodyBuffers.push({ data: data, encoding: encoding });\n this._currentRequest.write(data, encoding, callback);\n }\n // Error when we exceed the maximum body length\n else {\n this.emit(\"error\", new MaxBodyLengthExceededError());\n this.abort();\n }\n};\n\n// Ends the current native request\nRedirectableRequest.prototype.end = function (data, encoding, callback) {\n // Shift parameters if necessary\n if (typeof data === \"function\") {\n callback = data;\n data = encoding = null;\n }\n else if (typeof encoding === \"function\") {\n callback = encoding;\n encoding = null;\n }\n\n // Write data if needed and end\n if (!data) {\n this._ended = this._ending = true;\n this._currentRequest.end(null, null, callback);\n }\n else {\n var self = this;\n var currentRequest = this._currentRequest;\n this.write(data, encoding, function () {\n self._ended = true;\n currentRequest.end(null, null, callback);\n });\n this._ending = true;\n }\n};\n\n// Sets a header value on the current native request\nRedirectableRequest.prototype.setHeader = function (name, value) {\n this._options.headers[name] = value;\n this._currentRequest.setHeader(name, value);\n};\n\n// Clears a header value on the current native request\nRedirectableRequest.prototype.removeHeader = function (name) {\n delete this._options.headers[name];\n this._currentRequest.removeHeader(name);\n};\n\n// Global timeout for all underlying requests\nRedirectableRequest.prototype.setTimeout = function (msecs, callback) {\n if (callback) {\n this.once(\"timeout\", callback);\n }\n\n if (this.socket) {\n startTimer(this, msecs);\n }\n else {\n var self = this;\n this._currentRequest.once(\"socket\", function () {\n startTimer(self, msecs);\n });\n }\n\n this.once(\"response\", clearTimer);\n this.once(\"error\", clearTimer);\n\n return this;\n};\n\nfunction startTimer(request, msecs) {\n clearTimeout(request._timeout);\n request._timeout = setTimeout(function () {\n request.emit(\"timeout\");\n }, msecs);\n}\n\nfunction clearTimer() {\n clearTimeout(this._timeout);\n}\n\n// Proxy all other public ClientRequest methods\n[\n \"abort\", \"flushHeaders\", \"getHeader\",\n \"setNoDelay\", \"setSocketKeepAlive\",\n].forEach(function (method) {\n RedirectableRequest.prototype[method] = function (a, b) {\n return this._currentRequest[method](a, b);\n };\n});\n\n// Proxy all public ClientRequest properties\n[\"aborted\", \"connection\", \"socket\"].forEach(function (property) {\n Object.defineProperty(RedirectableRequest.prototype, property, {\n get: function () { return this._currentRequest[property]; },\n });\n});\n\nRedirectableRequest.prototype._sanitizeOptions = function (options) {\n // Ensure headers are always present\n if (!options.headers) {\n options.headers = {};\n }\n\n // Since http.request treats host as an alias of hostname,\n // but the url module interprets host as hostname plus port,\n // eliminate the host property to avoid confusion.\n if (options.host) {\n // Use hostname if set, because it has precedence\n if (!options.hostname) {\n options.hostname = options.host;\n }\n delete options.host;\n }\n\n // Complete the URL object when necessary\n if (!options.pathname && options.path) {\n var searchPos = options.path.indexOf(\"?\");\n if (searchPos < 0) {\n options.pathname = options.path;\n }\n else {\n options.pathname = options.path.substring(0, searchPos);\n options.search = options.path.substring(searchPos);\n }\n }\n};\n\n\n// Executes the next native request (initial or redirect)\nRedirectableRequest.prototype._performRequest = function () {\n // Load the native protocol\n var protocol = this._options.protocol;\n var nativeProtocol = this._options.nativeProtocols[protocol];\n if (!nativeProtocol) {\n this.emit(\"error\", new TypeError(\"Unsupported protocol \" + protocol));\n return;\n }\n\n // If specified, use the agent corresponding to the protocol\n // (HTTP and HTTPS use different types of agents)\n if (this._options.agents) {\n var scheme = protocol.substr(0, protocol.length - 1);\n this._options.agent = this._options.agents[scheme];\n }\n\n // Create the native request\n var request = this._currentRequest =\n nativeProtocol.request(this._options, this._onNativeResponse);\n this._currentUrl = url.format(this._options);\n\n // Set up event handlers\n request._redirectable = this;\n for (var event in eventHandlers) {\n /* istanbul ignore else */\n if (event) {\n request.on(event, eventHandlers[event]);\n }\n }\n\n // End a redirected request\n // (The first request must be ended explicitly with RedirectableRequest#end)\n if (this._isRedirect) {\n // Write the request entity and end.\n var i = 0;\n var self = this;\n var buffers = this._requestBodyBuffers;\n (function writeNext(error) {\n // Only write if this request has not been redirected yet\n /* istanbul ignore else */\n if (request === self._currentRequest) {\n // Report any write errors\n /* istanbul ignore if */\n if (error) {\n self.emit(\"error\", error);\n }\n // Write the next buffer if there are still left\n else if (i < buffers.length) {\n var buffer = buffers[i++];\n /* istanbul ignore else */\n if (!request.finished) {\n request.write(buffer.data, buffer.encoding, writeNext);\n }\n }\n // End the request if `end` has been called on us\n else if (self._ended) {\n request.end();\n }\n }\n }());\n }\n};\n\n// Processes a response from the current native request\nRedirectableRequest.prototype._processResponse = function (response) {\n // Store the redirected response\n var statusCode = response.statusCode;\n if (this._options.trackRedirects) {\n this._redirects.push({\n url: this._currentUrl,\n headers: response.headers,\n statusCode: statusCode,\n });\n }\n\n // RFC7231§6.4: The 3xx (Redirection) class of status code indicates\n // that further action needs to be taken by the user agent in order to\n // fulfill the request. If a Location header field is provided,\n // the user agent MAY automatically redirect its request to the URI\n // referenced by the Location field value,\n // even if the specific status code is not understood.\n var location = response.headers.location;\n if (location && this._options.followRedirects !== false &&\n statusCode >= 300 && statusCode < 400) {\n // Abort the current request\n this._currentRequest.removeAllListeners();\n this._currentRequest.on(\"error\", noop);\n this._currentRequest.abort();\n // Discard the remainder of the response to avoid waiting for data\n response.destroy();\n\n // RFC7231§6.4: A client SHOULD detect and intervene\n // in cyclical redirections (i.e., \"infinite\" redirection loops).\n if (++this._redirectCount > this._options.maxRedirects) {\n this.emit(\"error\", new TooManyRedirectsError());\n return;\n }\n\n // RFC7231§6.4: Automatic redirection needs to done with\n // care for methods not known to be safe, […]\n // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change\n // the request method from POST to GET for the subsequent request.\n if ((statusCode === 301 || statusCode === 302) && this._options.method === \"POST\" ||\n // RFC7231§6.4.4: The 303 (See Other) status code indicates that\n // the server is redirecting the user agent to a different resource […]\n // A user agent can perform a retrieval request targeting that URI\n // (a GET or HEAD request if using HTTP) […]\n (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {\n this._options.method = \"GET\";\n // Drop a possible entity and headers related to it\n this._requestBodyBuffers = [];\n removeMatchingHeaders(/^content-/i, this._options.headers);\n }\n\n // Drop the Host header, as the redirect might lead to a different host\n var previousHostName = removeMatchingHeaders(/^host$/i, this._options.headers) ||\n url.parse(this._currentUrl).hostname;\n\n // Create the redirected request\n var redirectUrl = url.resolve(this._currentUrl, location);\n debug(\"redirecting to\", redirectUrl);\n this._isRedirect = true;\n var redirectUrlParts = url.parse(redirectUrl);\n Object.assign(this._options, redirectUrlParts);\n\n // Drop the Authorization header if redirecting to another host\n if (redirectUrlParts.hostname !== previousHostName) {\n removeMatchingHeaders(/^authorization$/i, this._options.headers);\n }\n\n // Evaluate the beforeRedirect callback\n if (typeof this._options.beforeRedirect === \"function\") {\n var responseDetails = { headers: response.headers };\n try {\n this._options.beforeRedirect.call(null, this._options, responseDetails);\n }\n catch (err) {\n this.emit(\"error\", err);\n return;\n }\n this._sanitizeOptions(this._options);\n }\n\n // Perform the redirected request\n try {\n this._performRequest();\n }\n catch (cause) {\n var error = new RedirectionError(\"Redirected request failed: \" + cause.message);\n error.cause = cause;\n this.emit(\"error\", error);\n }\n }\n else {\n // The response is not a redirect; return it as-is\n response.responseUrl = this._currentUrl;\n response.redirects = this._redirects;\n this.emit(\"response\", response);\n\n // Clean up\n this._requestBodyBuffers = [];\n }\n};\n\n// Wraps the key/value object of protocols with redirect functionality\nfunction wrap(protocols) {\n // Default settings\n var exports = {\n maxRedirects: 21,\n maxBodyLength: 10 * 1024 * 1024,\n };\n\n // Wrap each protocol\n var nativeProtocols = {};\n Object.keys(protocols).forEach(function (scheme) {\n var protocol = scheme + \":\";\n var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];\n var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);\n\n // Executes a request, following redirects\n wrappedProtocol.request = function (input, options, callback) {\n // Parse parameters\n if (typeof input === \"string\") {\n var urlStr = input;\n try {\n input = urlToOptions(new URL(urlStr));\n }\n catch (err) {\n /* istanbul ignore next */\n input = url.parse(urlStr);\n }\n }\n else if (URL && (input instanceof URL)) {\n input = urlToOptions(input);\n }\n else {\n callback = options;\n options = input;\n input = { protocol: protocol };\n }\n if (typeof options === \"function\") {\n callback = options;\n options = null;\n }\n\n // Set defaults\n options = Object.assign({\n maxRedirects: exports.maxRedirects,\n maxBodyLength: exports.maxBodyLength,\n }, input, options);\n options.nativeProtocols = nativeProtocols;\n\n assert.equal(options.protocol, protocol, \"protocol mismatch\");\n debug(\"options\", options);\n return new RedirectableRequest(options, callback);\n };\n\n // Executes a GET request, following redirects\n wrappedProtocol.get = function (input, options, callback) {\n var request = wrappedProtocol.request(input, options, callback);\n request.end();\n return request;\n };\n });\n return exports;\n}\n\n/* istanbul ignore next */\nfunction noop() { /* empty */ }\n\n// from https://github.com/nodejs/node/blob/master/lib/internal/url.js\nfunction urlToOptions(urlObject) {\n var options = {\n protocol: urlObject.protocol,\n hostname: urlObject.hostname.startsWith(\"[\") ?\n /* istanbul ignore next */\n urlObject.hostname.slice(1, -1) :\n urlObject.hostname,\n hash: urlObject.hash,\n search: urlObject.search,\n pathname: urlObject.pathname,\n path: urlObject.pathname + urlObject.search,\n href: urlObject.href,\n };\n if (urlObject.port !== \"\") {\n options.port = Number(urlObject.port);\n }\n return options;\n}\n\nfunction removeMatchingHeaders(regex, headers) {\n var lastValue;\n for (var header in headers) {\n if (regex.test(header)) {\n lastValue = headers[header];\n delete headers[header];\n }\n }\n return lastValue;\n}\n\nfunction createErrorType(code, defaultMessage) {\n function CustomError(message) {\n Error.captureStackTrace(this, this.constructor);\n this.message = message || defaultMessage;\n }\n CustomError.prototype = new Error();\n CustomError.prototype.constructor = CustomError;\n CustomError.prototype.name = \"Error [\" + code + \"]\";\n CustomError.prototype.code = code;\n return CustomError;\n}\n\n// Exports\nmodule.exports = wrap({ http: http, https: https });\nmodule.exports.wrap = wrap;\n","module.exports = require(\"url\");","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./AuthAPI\"), exports);\n__exportStar(require(\"./BankAPI\"), exports);\n__exportStar(require(\"./DistributionAPI\"), exports);\n__exportStar(require(\"./GovAPI\"), exports);\n__exportStar(require(\"./MarketAPI\"), exports);\n__exportStar(require(\"./MsgAuthAPI\"), exports);\n__exportStar(require(\"./OracleAPI\"), exports);\n__exportStar(require(\"./SlashingAPI\"), exports);\n__exportStar(require(\"./StakingAPI\"), exports);\n__exportStar(require(\"./SupplyAPI\"), exports);\n__exportStar(require(\"./TendermintAPI\"), exports);\n__exportStar(require(\"./TreasuryAPI\"), exports);\n__exportStar(require(\"./TxAPI\"), exports);\n__exportStar(require(\"./WasmAPI\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Wallet = void 0;\nvar Wallet = /** @class */ (function () {\n function Wallet(lcd, key) {\n this.lcd = lcd;\n this.key = key;\n }\n Wallet.prototype.accountNumberAndSequence = function () {\n return this.lcd.auth.accountInfo(this.key.accAddress).then(function (d) {\n return {\n account_number: d.account_number,\n sequence: d.sequence,\n };\n });\n };\n Wallet.prototype.accountNumber = function () {\n return this.lcd.auth.accountInfo(this.key.accAddress).then(function (d) {\n return d.account_number;\n });\n };\n Wallet.prototype.sequence = function () {\n return this.lcd.auth.accountInfo(this.key.accAddress).then(function (d) {\n return d.sequence;\n });\n };\n Wallet.prototype.createTx = function (options) {\n return this.lcd.tx.create(this.key.accAddress, options);\n };\n Wallet.prototype.createAndSignTx = function (options) {\n return __awaiter(this, void 0, void 0, function () {\n var stdSignMsg;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.createTx(options)];\n case 1:\n stdSignMsg = _a.sent();\n return [2 /*return*/, this.key.signTx(stdSignMsg)];\n }\n });\n });\n };\n return Wallet;\n}());\nexports.Wallet = Wallet;\n//# sourceMappingURL=Wallet.js.map","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n/**/\n\nvar pna = require('process-nextick-args');\n/**/\n\nmodule.exports = Readable;\n\n/**/\nvar isArray = require('isarray');\n/**/\n\n/**/\nvar Duplex;\n/**/\n\nReadable.ReadableState = ReadableState;\n\n/**/\nvar EE = require('events').EventEmitter;\n\nvar EElistenerCount = function (emitter, type) {\n return emitter.listeners(type).length;\n};\n/**/\n\n/**/\nvar Stream = require('./internal/streams/stream');\n/**/\n\n/**/\n\nvar Buffer = require('safe-buffer').Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/**/\n\n/**/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/**/\n\n/**/\nvar debugUtil = require('util');\nvar debug = void 0;\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function () {};\n}\n/**/\n\nvar BufferList = require('./internal/streams/BufferList');\nvar destroyImpl = require('./internal/streams/destroy');\nvar StringDecoder;\n\nutil.inherits(Readable, Stream);\n\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n // Sadly this is not cacheable as some libraries bundle their own\n // event emitter implementation with them.\n if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);\n\n // This is a hack to make sure that our error handler is attached before any\n // userland ones. NEVER DO THIS. This is here only because this code needs\n // to continue to work with older versions of Node.js that do not include\n // the prependListener() method. The goal is to eventually remove this hack.\n if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream) {\n Duplex = Duplex || require('./_stream_duplex');\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n var hwm = options.highWaterMark;\n var readableHwm = options.readableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // A linked list is used to store data chunks instead of an array because the\n // linked list can remove elements from the beginning faster than\n // array.shift()\n this.buffer = new BufferList();\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false;\n\n // a flag to be able to tell if the event 'readable'/'data' is emitted\n // immediately, or on a later tick. We set this to true at first, because\n // any actions that shouldn't happen until \"later\" should generally also\n // not happen before the first read call.\n this.sync = true;\n\n // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n this.resumeScheduled = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // the number of writers that are awaiting a drain event in .pipe()s\n this.awaitDrain = 0;\n\n // if true, a maybeReadMore has been scheduled\n this.readingMore = false;\n\n this.decoder = null;\n this.encoding = null;\n if (options.encoding) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nfunction Readable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n\n if (!(this instanceof Readable)) return new Readable(options);\n\n this._readableState = new ReadableState(options, this);\n\n // legacy\n this.readable = true;\n\n if (options) {\n if (typeof options.read === 'function') this._read = options.read;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n }\n\n Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n get: function () {\n if (this._readableState === undefined) {\n return false;\n }\n return this._readableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._readableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._readableState.destroyed = value;\n }\n});\n\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\nReadable.prototype._destroy = function (err, cb) {\n this.push(null);\n cb(err);\n};\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n var state = this._readableState;\n var skipChunkCheck;\n\n if (!state.objectMode) {\n if (typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n if (encoding !== state.encoding) {\n chunk = Buffer.from(chunk, encoding);\n encoding = '';\n }\n skipChunkCheck = true;\n }\n } else {\n skipChunkCheck = true;\n }\n\n return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function (chunk) {\n return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n var state = stream._readableState;\n if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else {\n var er;\n if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n if (er) {\n stream.emit('error', er);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (addToFront) {\n if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);\n } else if (state.ended) {\n stream.emit('error', new Error('stream.push() after EOF'));\n } else {\n state.reading = false;\n if (state.decoder && !encoding) {\n chunk = state.decoder.write(chunk);\n if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n } else {\n addChunk(stream, state, chunk, false);\n }\n }\n } else if (!addToFront) {\n state.reading = false;\n }\n }\n\n return needMoreData(state);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n if (state.flowing && state.length === 0 && !state.sync) {\n stream.emit('data', chunk);\n stream.read(0);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n\n if (state.needReadable) emitReadable(stream);\n }\n maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n var er;\n if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n return er;\n}\n\n// if it's past the high water mark, we can push in some more.\n// Also, if we have no data yet, we can stand some\n// more bytes. This is to work around cases where hwm=0,\n// such as the repl. Also, if the push() triggered a\n// readable event, and the user called read(largeNumber) such that\n// needReadable was set, then we ought to push more, so that another\n// 'readable' event will be triggered.\nfunction needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}\n\nReadable.prototype.isPaused = function () {\n return this._readableState.flowing === false;\n};\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;\n this._readableState.decoder = new StringDecoder(enc);\n this._readableState.encoding = enc;\n return this;\n};\n\n// Don't raise the hwm > 8MB\nvar MAX_HWM = 0x800000;\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2 to prevent increasing hwm excessively in\n // tiny amounts\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n return n;\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n if (n <= 0 || state.length === 0 && state.ended) return 0;\n if (state.objectMode) return 1;\n if (n !== n) {\n // Only flow one buffer at a time\n if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n }\n // If we're asking for more than the current hwm, then raise the hwm.\n if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n if (n <= state.length) return n;\n // Don't have enough\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n }\n return state.length;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n debug('read', n);\n n = parseInt(n, 10);\n var state = this._readableState;\n var nOrig = n;\n\n if (n !== 0) state.emittedReadable = false;\n\n // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state);\n\n // if we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0) endReadable(this);\n return null;\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n var doRead = state.needReadable;\n debug('need readable', doRead);\n\n // if we currently have less than the highWaterMark, then also read some\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n }\n\n // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n } else if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true;\n // if the length is currently zero, then we *need* a readable event.\n if (state.length === 0) state.needReadable = true;\n // call internal read method\n this._read(state.highWaterMark);\n state.sync = false;\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (!state.reading) n = howMuchToRead(nOrig, state);\n }\n\n var ret;\n if (n > 0) ret = fromList(n, state);else ret = null;\n\n if (ret === null) {\n state.needReadable = true;\n n = 0;\n } else {\n state.length -= n;\n }\n\n if (state.length === 0) {\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (!state.ended) state.needReadable = true;\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended) endReadable(this);\n }\n\n if (ret !== null) this.emit('data', ret);\n\n return ret;\n};\n\nfunction onEofChunk(stream, state) {\n if (state.ended) return;\n if (state.decoder) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n state.ended = true;\n\n // emit 'readable' now to make sure it gets picked up.\n emitReadable(stream);\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);\n }\n}\n\nfunction emitReadable_(stream) {\n debug('emit readable');\n stream.emit('readable');\n flow(stream);\n}\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n pna.nextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n var len = state.length;\n while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length)\n // didn't get any data, stop spinning.\n break;else len = state.length;\n }\n state.readingMore = false;\n}\n\n// abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n this.emit('error', new Error('_read() is not implemented'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n default:\n state.pipes.push(dest);\n break;\n }\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n\n var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n\n var endFn = doEnd ? onend : unpipe;\n if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);\n\n dest.on('unpipe', onunpipe);\n function onunpipe(readable, unpipeInfo) {\n debug('onunpipe');\n if (readable === src) {\n if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n unpipeInfo.hasUnpiped = true;\n cleanup();\n }\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n }\n\n // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n\n var cleanedUp = false;\n function cleanup() {\n debug('cleanup');\n // cleanup event handlers once the pipe is broken\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', unpipe);\n src.removeListener('data', ondata);\n\n cleanedUp = true;\n\n // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n }\n\n // If the user pushes more data while we're writing to dest then we'll end up\n // in ondata again. However, we only want to increase awaitDrain once because\n // dest will only emit one 'drain' event for the multiple writes.\n // => Introduce a guard on increasing awaitDrain.\n var increasedAwaitDrain = false;\n src.on('data', ondata);\n function ondata(chunk) {\n debug('ondata');\n increasedAwaitDrain = false;\n var ret = dest.write(chunk);\n if (false === ret && !increasedAwaitDrain) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n // => Check whether `dest` is still a piping destination.\n if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n debug('false write response, pause', src._readableState.awaitDrain);\n src._readableState.awaitDrain++;\n increasedAwaitDrain = true;\n }\n src.pause();\n }\n }\n\n // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n }\n\n // Make sure our error handler is attached before userland ones.\n prependListener(dest, 'error', onerror);\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n dest.once('close', onclose);\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n }\n\n // tell the dest that it's being piped to\n dest.emit('pipe', src);\n\n // start the flow if it hasn't been started already.\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function () {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain) state.awaitDrain--;\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\nReadable.prototype.unpipe = function (dest) {\n var state = this._readableState;\n var unpipeInfo = { hasUnpiped: false };\n\n // if we're not piping anywhere, then do nothing.\n if (state.pipesCount === 0) return this;\n\n // just one destination. most common case.\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes) return this;\n\n if (!dest) dest = state.pipes;\n\n // got a match.\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest) dest.emit('unpipe', this, unpipeInfo);\n return this;\n }\n\n // slow case. multiple pipe destinations.\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++) {\n dests[i].emit('unpipe', this, unpipeInfo);\n }return this;\n }\n\n // try to find the right one.\n var index = indexOf(state.pipes, dest);\n if (index === -1) return this;\n\n state.pipes.splice(index, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1) state.pipes = state.pipes[0];\n\n dest.emit('unpipe', this, unpipeInfo);\n\n return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function (ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n\n if (ev === 'data') {\n // Start flowing on next tick if stream isn't explicitly paused\n if (this._readableState.flowing !== false) this.resume();\n } else if (ev === 'readable') {\n var state = this._readableState;\n if (!state.endEmitted && !state.readableListening) {\n state.readableListening = state.needReadable = true;\n state.emittedReadable = false;\n if (!state.reading) {\n pna.nextTick(nReadingNextTick, this);\n } else if (state.length) {\n emitReadable(this);\n }\n }\n }\n\n return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n var state = this._readableState;\n if (!state.flowing) {\n debug('resume');\n state.flowing = true;\n resume(this, state);\n }\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n pna.nextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n if (!state.reading) {\n debug('resume read 0');\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n state.awaitDrain = 0;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n debug('call pause flowing=%j', this._readableState.flowing);\n if (false !== this._readableState.flowing) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n while (state.flowing && stream.read() !== null) {}\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n var _this = this;\n\n var state = this._readableState;\n var paused = false;\n\n stream.on('end', function () {\n debug('wrapped end');\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) _this.push(chunk);\n }\n\n _this.push(null);\n });\n\n stream.on('data', function (chunk) {\n debug('wrapped data');\n if (state.decoder) chunk = state.decoder.write(chunk);\n\n // don't skip over falsy values in objectMode\n if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n var ret = _this.push(chunk);\n if (!ret) {\n paused = true;\n stream.pause();\n }\n });\n\n // proxy all the other methods.\n // important when wrapping filters and duplexes.\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function (method) {\n return function () {\n return stream[method].apply(stream, arguments);\n };\n }(i);\n }\n }\n\n // proxy certain important events.\n for (var n = 0; n < kProxyEvents.length; n++) {\n stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n }\n\n // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n this._read = function (n) {\n debug('wrapped _read', n);\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return this;\n};\n\nObject.defineProperty(Readable.prototype, 'readableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._readableState.highWaterMark;\n }\n});\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n // nothing buffered\n if (state.length === 0) return null;\n\n var ret;\n if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n // read it all, truncate the list\n if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);\n state.buffer.clear();\n } else {\n // read part of list\n ret = fromListPartial(n, state.buffer, state.decoder);\n }\n\n return ret;\n}\n\n// Extracts only enough buffered data to satisfy the amount requested.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromListPartial(n, list, hasStrings) {\n var ret;\n if (n < list.head.data.length) {\n // slice is the same for buffers and strings\n ret = list.head.data.slice(0, n);\n list.head.data = list.head.data.slice(n);\n } else if (n === list.head.data.length) {\n // first chunk is a perfect match\n ret = list.shift();\n } else {\n // result spans more than one buffer\n ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\n }\n return ret;\n}\n\n// Copies a specified amount of characters from the list of buffered data\n// chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBufferString(n, list) {\n var p = list.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = str.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\n// Copies a specified amount of bytes from the list of buffered data chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = buf.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n\n // If we get here before consuming all the bytes, then that is a\n // bug in node. Should never happen.\n if (state.length > 0) throw new Error('\"endReadable()\" called on non-empty stream');\n\n if (!state.endEmitted) {\n state.ended = true;\n pna.nextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n // Check that we didn't get one last unshift.\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n }\n}\n\nfunction indexOf(xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n return -1;\n}","module.exports = require('stream');\n","'use strict';\n\n/**/\n\nvar pna = require('process-nextick-args');\n/**/\n\n// undocumented cb() API, needed for core, not for public API\nfunction destroy(err, cb) {\n var _this = this;\n\n var readableDestroyed = this._readableState && this._readableState.destroyed;\n var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n if (readableDestroyed || writableDestroyed) {\n if (cb) {\n cb(err);\n } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {\n pna.nextTick(emitErrorNT, this, err);\n }\n return this;\n }\n\n // we set destroyed to true before firing error callbacks in order\n // to make it re-entrance safe in case destroy() is called within callbacks\n\n if (this._readableState) {\n this._readableState.destroyed = true;\n }\n\n // if this is a duplex stream mark the writable part as destroyed as well\n if (this._writableState) {\n this._writableState.destroyed = true;\n }\n\n this._destroy(err || null, function (err) {\n if (!cb && err) {\n pna.nextTick(emitErrorNT, _this, err);\n if (_this._writableState) {\n _this._writableState.errorEmitted = true;\n }\n } else if (cb) {\n cb(err);\n }\n });\n\n return this;\n}\n\nfunction undestroy() {\n if (this._readableState) {\n this._readableState.destroyed = false;\n this._readableState.reading = false;\n this._readableState.ended = false;\n this._readableState.endEmitted = false;\n }\n\n if (this._writableState) {\n this._writableState.destroyed = false;\n this._writableState.ended = false;\n this._writableState.ending = false;\n this._writableState.finished = false;\n this._writableState.errorEmitted = false;\n }\n}\n\nfunction emitErrorNT(self, err) {\n self.emit('error', err);\n}\n\nmodule.exports = {\n destroy: destroy,\n undestroy: undestroy\n};","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n'use strict';\n\n/**/\n\nvar pna = require('process-nextick-args');\n/**/\n\nmodule.exports = Writable;\n\n/* */\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n}\n\n// It seems a linked list but it is not\n// there will be only 2 of these for each stream\nfunction CorkedRequest(state) {\n var _this = this;\n\n this.next = null;\n this.entry = null;\n this.finish = function () {\n onCorkedFinish(_this, state);\n };\n}\n/* */\n\n/**/\nvar asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;\n/**/\n\n/**/\nvar Duplex;\n/**/\n\nWritable.WritableState = WritableState;\n\n/**/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/**/\n\n/**/\nvar internalUtil = {\n deprecate: require('util-deprecate')\n};\n/**/\n\n/**/\nvar Stream = require('./internal/streams/stream');\n/**/\n\n/**/\n\nvar Buffer = require('safe-buffer').Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/**/\n\nvar destroyImpl = require('./internal/streams/destroy');\n\nutil.inherits(Writable, Stream);\n\nfunction nop() {}\n\nfunction WritableState(options, stream) {\n Duplex = Duplex || require('./_stream_duplex');\n\n options = options || {};\n\n // Duplex streams are both readable and writable, but share\n // the same options object.\n // However, some cases require setting options to different\n // values for the readable and the writable sides of the duplex stream.\n // These options can be provided separately as readableXXX and writableXXX.\n var isDuplex = stream instanceof Duplex;\n\n // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!options.objectMode;\n\n if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n var hwm = options.highWaterMark;\n var writableHwm = options.writableHighWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;\n\n // cast to ints.\n this.highWaterMark = Math.floor(this.highWaterMark);\n\n // if _final has been called\n this.finalCalled = false;\n\n // drain event flag.\n this.needDrain = false;\n // at the start of calling end()\n this.ending = false;\n // when end() has been called, and returned\n this.ended = false;\n // when 'finish' is emitted\n this.finished = false;\n\n // has it been destroyed\n this.destroyed = false;\n\n // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0;\n\n // a flag to see when we're in the middle of a write.\n this.writing = false;\n\n // when true all writes will be buffered until .uncork() call\n this.corked = 0;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false;\n\n // the callback that's passed to _write(chunk,cb)\n this.onwrite = function (er) {\n onwrite(stream, er);\n };\n\n // the callback that the user supplies to write(chunk,encoding,cb)\n this.writecb = null;\n\n // the amount that is being written when _write is called.\n this.writelen = 0;\n\n this.bufferedRequest = null;\n this.lastBufferedRequest = null;\n\n // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n this.pendingcb = 0;\n\n // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n this.prefinished = false;\n\n // True if the error was already emitted and should not be thrown again\n this.errorEmitted = false;\n\n // count buffered requests\n this.bufferedRequestCount = 0;\n\n // allocate the first CorkedRequest, there is always\n // one allocated and free to use, and we maintain at most two\n this.corkedRequestsFree = new CorkedRequest(this);\n}\n\nWritableState.prototype.getBuffer = function getBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n while (current) {\n out.push(current);\n current = current.next;\n }\n return out;\n};\n\n(function () {\n try {\n Object.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function () {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n });\n } catch (_) {}\n})();\n\n// Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\nvar realHasInstance;\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n realHasInstance = Function.prototype[Symbol.hasInstance];\n Object.defineProperty(Writable, Symbol.hasInstance, {\n value: function (object) {\n if (realHasInstance.call(this, object)) return true;\n if (this !== Writable) return false;\n\n return object && object._writableState instanceof WritableState;\n }\n });\n} else {\n realHasInstance = function (object) {\n return object instanceof this;\n };\n}\n\nfunction Writable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n\n // Writable ctor is applied to Duplexes, too.\n // `realHasInstance` is necessary because using plain `instanceof`\n // would return false, as no `_writableState` property is attached.\n\n // Trying to use the custom `instanceof` for Writable here will also break the\n // Node.js LazyTransform implementation, which has a non-trivial getter for\n // `_writableState` that would lead to infinite recursion.\n if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\n return new Writable(options);\n }\n\n this._writableState = new WritableState(options, this);\n\n // legacy.\n this.writable = true;\n\n if (options) {\n if (typeof options.write === 'function') this._write = options.write;\n\n if (typeof options.writev === 'function') this._writev = options.writev;\n\n if (typeof options.destroy === 'function') this._destroy = options.destroy;\n\n if (typeof options.final === 'function') this._final = options.final;\n }\n\n Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n this.emit('error', new Error('Cannot pipe, not readable'));\n};\n\nfunction writeAfterEnd(stream, cb) {\n var er = new Error('write after end');\n // TODO: defer error events consistently everywhere, not just the cb\n stream.emit('error', er);\n pna.nextTick(cb, er);\n}\n\n// Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\nfunction validChunk(stream, state, chunk, cb) {\n var valid = true;\n var er = false;\n\n if (chunk === null) {\n er = new TypeError('May not write null values to stream');\n } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n if (er) {\n stream.emit('error', er);\n pna.nextTick(cb, er);\n valid = false;\n }\n return valid;\n}\n\nWritable.prototype.write = function (chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n var isBuf = !state.objectMode && _isUint8Array(chunk);\n\n if (isBuf && !Buffer.isBuffer(chunk)) {\n chunk = _uint8ArrayToBuffer(chunk);\n }\n\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n\n if (typeof cb !== 'function') cb = nop;\n\n if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n }\n\n return ret;\n};\n\nWritable.prototype.cork = function () {\n var state = this._writableState;\n\n state.corked++;\n};\n\nWritable.prototype.uncork = function () {\n var state = this._writableState;\n\n if (state.corked) {\n state.corked--;\n\n if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);\n this._writableState.defaultEncoding = encoding;\n return this;\n};\n\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n chunk = Buffer.from(chunk, encoding);\n }\n return chunk;\n}\n\nObject.defineProperty(Writable.prototype, 'writableHighWaterMark', {\n // making it explicit this property is not enumerable\n // because otherwise some prototype manipulation in\n // userland will fail\n enumerable: false,\n get: function () {\n return this._writableState.highWaterMark;\n }\n});\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n if (!isBuf) {\n var newChunk = decodeChunk(state, chunk, encoding);\n if (chunk !== newChunk) {\n isBuf = true;\n encoding = 'buffer';\n chunk = newChunk;\n }\n }\n var len = state.objectMode ? 1 : chunk.length;\n\n state.length += len;\n\n var ret = state.length < state.highWaterMark;\n // we must ensure that previous needDrain will not be reset to false.\n if (!ret) state.needDrain = true;\n\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = {\n chunk: chunk,\n encoding: encoding,\n isBuf: isBuf,\n callback: cb,\n next: null\n };\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n state.bufferedRequestCount += 1;\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n\n return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n\n if (sync) {\n // defer the callback if we are being called synchronously\n // to avoid piling up things on the stack\n pna.nextTick(cb, er);\n // this can emit finish, and it will always happen\n // after error\n pna.nextTick(finishMaybe, stream, state);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n } else {\n // the caller expect this to happen before if\n // it is async\n cb(er);\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n // this can emit finish, but finish must\n // always follow error\n finishMaybe(stream, state);\n }\n}\n\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n\n onwriteStateUpdate(state);\n\n if (er) onwriteError(stream, state, sync, er, cb);else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state);\n\n if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n\n if (sync) {\n /**/\n asyncWrite(afterWrite, stream, state, finished, cb);\n /**/\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished) onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n}\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n state.bufferedRequestCount = 0;\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n state.bufferedRequestCount--;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function (chunk, encoding, cb) {\n cb(new Error('_write() is not implemented'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function (chunk, encoding, cb) {\n var state = this._writableState;\n\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\n // .end() fully uncorks\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n }\n\n // ignore unnecessary end() calls.\n if (!state.ending && !state.finished) endWritable(this, state, cb);\n};\n\nfunction needFinish(state) {\n return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\nfunction callFinal(stream, state) {\n stream._final(function (err) {\n state.pendingcb--;\n if (err) {\n stream.emit('error', err);\n }\n state.prefinished = true;\n stream.emit('prefinish');\n finishMaybe(stream, state);\n });\n}\nfunction prefinish(stream, state) {\n if (!state.prefinished && !state.finalCalled) {\n if (typeof stream._final === 'function') {\n state.pendingcb++;\n state.finalCalled = true;\n pna.nextTick(callFinal, stream, state);\n } else {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n }\n}\n\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n if (need) {\n prefinish(stream, state);\n if (state.pendingcb === 0) {\n state.finished = true;\n stream.emit('finish');\n }\n }\n return need;\n}\n\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n if (cb) {\n if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);\n }\n state.ended = true;\n stream.writable = false;\n}\n\nfunction onCorkedFinish(corkReq, state, err) {\n var entry = corkReq.entry;\n corkReq.entry = null;\n while (entry) {\n var cb = entry.callback;\n state.pendingcb--;\n cb(err);\n entry = entry.next;\n }\n if (state.corkedRequestsFree) {\n state.corkedRequestsFree.next = corkReq;\n } else {\n state.corkedRequestsFree = corkReq;\n }\n}\n\nObject.defineProperty(Writable.prototype, 'destroyed', {\n get: function () {\n if (this._writableState === undefined) {\n return false;\n }\n return this._writableState.destroyed;\n },\n set: function (value) {\n // we ignore the value if the stream\n // has not been initialized yet\n if (!this._writableState) {\n return;\n }\n\n // backward compatibility, the user is explicitly\n // managing destroyed\n this._writableState.destroyed = value;\n }\n});\n\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\nWritable.prototype._destroy = function (err, cb) {\n this.end();\n cb(err);\n};","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n/**/\n\nvar Buffer = require('safe-buffer').Buffer;\n/**/\n\nvar isEncoding = Buffer.isEncoding || function (encoding) {\n encoding = '' + encoding;\n switch (encoding && encoding.toLowerCase()) {\n case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':\n return true;\n default:\n return false;\n }\n};\n\nfunction _normalizeEncoding(enc) {\n if (!enc) return 'utf8';\n var retried;\n while (true) {\n switch (enc) {\n case 'utf8':\n case 'utf-8':\n return 'utf8';\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return 'utf16le';\n case 'latin1':\n case 'binary':\n return 'latin1';\n case 'base64':\n case 'ascii':\n case 'hex':\n return enc;\n default:\n if (retried) return; // undefined\n enc = ('' + enc).toLowerCase();\n retried = true;\n }\n }\n};\n\n// Do not cache `Buffer.isEncoding` when checking encoding names as some\n// modules monkey-patch it to support additional encodings\nfunction normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}\n\n// StringDecoder provides an interface for efficiently splitting a series of\n// buffers into a series of JS strings without breaking apart multi-byte\n// characters.\nexports.StringDecoder = StringDecoder;\nfunction StringDecoder(encoding) {\n this.encoding = normalizeEncoding(encoding);\n var nb;\n switch (this.encoding) {\n case 'utf16le':\n this.text = utf16Text;\n this.end = utf16End;\n nb = 4;\n break;\n case 'utf8':\n this.fillLast = utf8FillLast;\n nb = 4;\n break;\n case 'base64':\n this.text = base64Text;\n this.end = base64End;\n nb = 3;\n break;\n default:\n this.write = simpleWrite;\n this.end = simpleEnd;\n return;\n }\n this.lastNeed = 0;\n this.lastTotal = 0;\n this.lastChar = Buffer.allocUnsafe(nb);\n}\n\nStringDecoder.prototype.write = function (buf) {\n if (buf.length === 0) return '';\n var r;\n var i;\n if (this.lastNeed) {\n r = this.fillLast(buf);\n if (r === undefined) return '';\n i = this.lastNeed;\n this.lastNeed = 0;\n } else {\n i = 0;\n }\n if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);\n return r || '';\n};\n\nStringDecoder.prototype.end = utf8End;\n\n// Returns only complete characters in a Buffer\nStringDecoder.prototype.text = utf8Text;\n\n// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer\nStringDecoder.prototype.fillLast = function (buf) {\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);\n this.lastNeed -= buf.length;\n};\n\n// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a\n// continuation byte. If an invalid byte is detected, -2 is returned.\nfunction utf8CheckByte(byte) {\n if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;\n return byte >> 6 === 0x02 ? -1 : -2;\n}\n\n// Checks at most 3 bytes at the end of a Buffer in order to detect an\n// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)\n// needed to complete the UTF-8 character (if applicable) are returned.\nfunction utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i || nb === -2) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}\n\n// Validates as many continuation bytes for a multi-byte UTF-8 character as\n// needed or are available. If we see a non-continuation byte where we expect\n// one, we \"replace\" the validated continuation bytes we've seen so far with\n// a single UTF-8 replacement character ('\\ufffd'), to match v8's UTF-8 decoding\n// behavior. The continuation byte check is included three times in the case\n// where all of the continuation bytes for a character exist in the same buffer.\n// It is also done this way as a slight performance increase instead of using a\n// loop.\nfunction utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd';\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd';\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd';\n }\n }\n }\n}\n\n// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.\nfunction utf8FillLast(buf) {\n var p = this.lastTotal - this.lastNeed;\n var r = utf8CheckExtraBytes(this, buf, p);\n if (r !== undefined) return r;\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, p, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, p, 0, buf.length);\n this.lastNeed -= buf.length;\n}\n\n// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a\n// partial character, the character's bytes are buffered until the required\n// number of bytes are available.\nfunction utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}\n\n// For UTF-8, a replacement character is added when ending on a partial\n// character.\nfunction utf8End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + '\\ufffd';\n return r;\n}\n\n// UTF-16LE typically needs two bytes per character, but even if we have an even\n// number of bytes available, we need to check if we end on a leading/high\n// surrogate. In that case, we need to wait for the next two bytes in order to\n// decode the last character properly.\nfunction utf16Text(buf, i) {\n if ((buf.length - i) % 2 === 0) {\n var r = buf.toString('utf16le', i);\n if (r) {\n var c = r.charCodeAt(r.length - 1);\n if (c >= 0xD800 && c <= 0xDBFF) {\n this.lastNeed = 2;\n this.lastTotal = 4;\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n return r.slice(0, -1);\n }\n }\n return r;\n }\n this.lastNeed = 1;\n this.lastTotal = 2;\n this.lastChar[0] = buf[buf.length - 1];\n return buf.toString('utf16le', i, buf.length - 1);\n}\n\n// For UTF-16LE we do not explicitly append special replacement characters if we\n// end on a partial character, we simply let v8 handle that.\nfunction utf16End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) {\n var end = this.lastTotal - this.lastNeed;\n return r + this.lastChar.toString('utf16le', 0, end);\n }\n return r;\n}\n\nfunction base64Text(buf, i) {\n var n = (buf.length - i) % 3;\n if (n === 0) return buf.toString('base64', i);\n this.lastNeed = 3 - n;\n this.lastTotal = 3;\n if (n === 1) {\n this.lastChar[0] = buf[buf.length - 1];\n } else {\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n }\n return buf.toString('base64', i, buf.length - n);\n}\n\nfunction base64End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);\n return r;\n}\n\n// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)\nfunction simpleWrite(buf) {\n return buf.toString(this.encoding);\n}\n\nfunction simpleEnd(buf) {\n return buf && buf.length ? this.write(buf) : '';\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n'use strict';\n\nmodule.exports = Transform;\n\nvar Duplex = require('./_stream_duplex');\n\n/**/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/**/\n\nutil.inherits(Transform, Duplex);\n\nfunction afterTransform(er, data) {\n var ts = this._transformState;\n ts.transforming = false;\n\n var cb = ts.writecb;\n\n if (!cb) {\n return this.emit('error', new Error('write callback called multiple times'));\n }\n\n ts.writechunk = null;\n ts.writecb = null;\n\n if (data != null) // single equals check for both `null` and `undefined`\n this.push(data);\n\n cb(er);\n\n var rs = this._readableState;\n rs.reading = false;\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n this._read(rs.highWaterMark);\n }\n}\n\nfunction Transform(options) {\n if (!(this instanceof Transform)) return new Transform(options);\n\n Duplex.call(this, options);\n\n this._transformState = {\n afterTransform: afterTransform.bind(this),\n needTransform: false,\n transforming: false,\n writecb: null,\n writechunk: null,\n writeencoding: null\n };\n\n // start out asking for a readable event once data is transformed.\n this._readableState.needReadable = true;\n\n // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false;\n\n if (options) {\n if (typeof options.transform === 'function') this._transform = options.transform;\n\n if (typeof options.flush === 'function') this._flush = options.flush;\n }\n\n // When the writable side finishes, then flush out anything remaining.\n this.on('prefinish', prefinish);\n}\n\nfunction prefinish() {\n var _this = this;\n\n if (typeof this._flush === 'function') {\n this._flush(function (er, data) {\n done(_this, er, data);\n });\n } else {\n done(this, null, null);\n }\n}\n\nTransform.prototype.push = function (chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function (chunk, encoding, cb) {\n throw new Error('_transform() is not implemented');\n};\n\nTransform.prototype._write = function (chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function (n) {\n var ts = this._transformState;\n\n if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\n ts.transforming = true;\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\n\nTransform.prototype._destroy = function (err, cb) {\n var _this2 = this;\n\n Duplex.prototype._destroy.call(this, err, function (err2) {\n cb(err2);\n _this2.emit('close');\n });\n};\n\nfunction done(stream, er, data) {\n if (er) return stream.emit('error', er);\n\n if (data != null) // single equals check for both `null` and `undefined`\n stream.push(data);\n\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');\n\n if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');\n\n return stream.push(null);\n}","export * from './MirrorCollector';\nexport * from './MirrorFactory';\nexport * from './MirrorGov';\nexport * from './MirrorMint';\nexport * from './MirrorOracle';\nexport * from './MirrorStaking';\nexport * from './TerraswapFactory';\nexport * from './TerraswapPair';\nexport * from './TerraswapToken';\n","export * from './client';\nexport * from './utils';\nexport * from './contracts';\n","export * from './Mirror';\n","import { AccAddress, Key, LCDClient, Coin } from '@terra-money/terra.js';\nimport { EmptyKey } from '../utils/EmptyKey';\nimport {\n MirrorCollector,\n MirrorFactory,\n MirrorGov,\n MirrorMint,\n MirrorOracle,\n MirrorStaking,\n TerraswapFactory,\n TerraswapPair,\n TerraswapToken\n} from '../contracts/index';\n\nexport interface AssetOptions {\n symbol: string;\n name: string;\n token: AccAddress;\n pair: AccAddress;\n lpToken: AccAddress;\n}\n\nexport interface MirrorOptions {\n lcd: LCDClient;\n key: Key;\n collector: AccAddress;\n factory: AccAddress;\n gov: AccAddress;\n mint: AccAddress;\n oracle: AccAddress;\n staking: AccAddress;\n mirrorToken: AccAddress;\n terraswapFactory: AccAddress;\n assets: Array;\n}\n\nexport const DEFAULT_MIRROR_OPTIONS: MirrorOptions = {\n lcd: new LCDClient({\n URL: 'https://moonshine-lcd.terra.dev',\n chainID: 'localterra',\n gasPrices: [new Coin('ukrw', '1.8')],\n gasAdjustment: '1.2'\n }),\n key: new EmptyKey(),\n collector: 'terra1jmj39n0tfg6qu852fx0kr46gn4sewq6uyqyu8t',\n factory: 'terra1ndzjhjszw4pp8dkkt864drgmwhc59padjfccxg',\n gov: 'terra12pf2c9k7m2ag2893aa6sv75nmytr9uuxzv8vgx',\n mint: 'terra1ycsd7mlffq2ksmqdr20y4drtf6ctw3n8fmup5g',\n oracle: 'terra14nh9jzg6gx3qp2jnlg5lvkmky40uxu7w9mgevz',\n staking: 'terra1xxqqw7vysmh2wnq3y6hgh7d2ytmgazw62f28hh',\n mirrorToken: 'terra16y2ew6rmnehu9fn45jj55w4g37d62xgjz8zsx9',\n terraswapFactory: 'terra10w3rtrs8fmgwy6rsh2xwq6x27ym4kpz3698dr4',\n assets: [\n {\n symbol: 'MIR',\n name: 'Mirror',\n token: 'terra16y2ew6rmnehu9fn45jj55w4g37d62xgjz8zsx9',\n pair: 'terra1ck0ky4ad0ecmz7sksacejxf3rek8922n2302lh',\n lpToken: 'terra1xfm4k6qj3ryhpef4t4p9zgww6e3zuw6c0eqd05'\n },\n {\n symbol: 'mAAPL',\n name: 'Apple',\n token: 'terra17c3tsywm5h95j3z7hy62mvmyjct4euly4gj3kp',\n pair: 'terra1d6548cmpmugndjg650k0k66fhnvkeqxavv0z07',\n lpToken: 'terra1msdk05534hqupfed4v5q04f5y883ezqm0uukn7'\n },\n {\n symbol: 'mGOOGL',\n name: 'Google',\n token: 'terra1tz0c9uy0wwaaq4p57v8qzfx0g08l3zr3zcdtgl',\n pair: 'terra1t8m4cs4f32zqgsktu4pucwnlkz47dgql8crywn',\n lpToken: 'terra1wxh3lw9u3k7psmvqzraxpmscmpgp329kzg834m'\n },\n {\n symbol: 'mTSLA',\n name: 'Tesla',\n token: 'terra13fkuw7gh8r0mjswj8ckyt87m84azq43q3qldmj',\n pair: 'terra1uf29lrmpsmww4k3c9jcxdzet75c2pt353mx4tq',\n lpToken: 'terra1zccwcq7shh4yj8j2ynecd7pyyftxlhdd77fpu3'\n },\n {\n symbol: 'mNFLX',\n name: 'Netflix',\n token: 'terra1f9pk063a99g27l5nu83pd55x6rs649s3ax7pw3',\n pair: 'terra1t033f2r5phvuvysu50x2lj5ctshakcf45szn49',\n lpToken: 'terra1ch6d5kdenshk2zktap2s05arytpn8xhdffarvc'\n },\n {\n symbol: 'mQQQ',\n name: 'Invesco QQQ Trust',\n token: 'terra1hu7u866jla3vgckf4sd6vjdfxzuqvzvu0ekpc9',\n pair: 'terra19ujpfl5djdrp6w4w30vtx9cremz25gkg9nzcfa',\n lpToken: 'terra1cj8rcff3djz86rarg3uw3nzgdy2trgvj5egvdl'\n },\n {\n symbol: 'mTWTR',\n name: 'Twitter',\n token: 'terra1ua295n83qqm7kncn6g704d2a3hpmtjyx7f07u7',\n pair: 'terra14q8szcr0gy5pzksve5sp7e94kqqa0xlc3g2y9u',\n lpToken: 'terra1wunltsvvl2gfsnpwc4hf9pdxt6tnp7rt877ny8'\n },\n {\n symbol: 'mBABA',\n name: 'Alibaba Group Holdings Ltd ADR',\n token: 'terra1vekqnp3tgukt90lqfumu5467jw9jy4eewzn2fu',\n pair: 'terra1q5gyld4cjr59fdk2rjuuzs200ks28lp08fudnt',\n lpToken: 'terra1vrkjzhs26qlg6863s7rcnkqlmp3ftsxfdc6l5r'\n },\n {\n symbol: 'mIAU',\n name: 'iShares Gold Trust',\n token: 'terra1cyrhd8m2hhvvrn3mrn29d4h6unzyp6deay6g2y',\n pair: 'terra1ygeltj9hg4tsshhx2m4et4nmhn2sqpmu2cv8qk',\n lpToken: 'terra1whql3f3vukrtu3qs363vj5a67xccydjz9lpg6t'\n },\n {\n symbol: 'mSLV',\n name: 'iShares Silver Trust',\n token: 'terra17szfxhpttyp6w5p8llpqcr72yegxtaqy6uarye',\n pair: 'terra1vh4e69jq20tdzldc49wwuz22qe4pdr0zlwpvsg',\n lpToken: 'terra1d2ujj007l2tp5r6mgp78hr0ecrtq4q9afvmlwh'\n },\n {\n symbol: 'mUSO',\n name: 'United States Oil Fund, LP',\n token: 'terra19sf42kkwn85dj8hzffcytvw6jx4g8g3nxfnrdu',\n pair: 'terra1yde9tsacetgrdzdm56s5dng2uc53wpnyf9dyds',\n lpToken: 'terra1pkv2skq9pqzpfe483dn6q2dskadrhyrqg2f5ya'\n },\n {\n symbol: 'mVIXY',\n name: 'ProShares VIX',\n token: 'terra1kmt8vekwu4aq6l9y50n8hg9zcdzd3tqdp8lgdr',\n pair: 'terra195fcntnznx4f676gf383g02yguhync2fsuk03x',\n lpToken: 'terra1svhet09r7ulhyr4vs4fl6j6lnam94q6natumck'\n }\n ]\n};\n\nexport class Mirror {\n public collector: MirrorCollector;\n\n public factory: MirrorFactory;\n\n public gov: MirrorGov;\n\n public mint: MirrorMint;\n\n public oracle: MirrorOracle;\n\n public staking: MirrorStaking;\n\n public mirrorToken: TerraswapToken;\n\n public terraswapFactory: TerraswapFactory;\n\n public assets: Array<{\n name: string;\n symbol: string;\n token: TerraswapToken;\n lpToken: TerraswapToken;\n pair: TerraswapPair;\n }>;\n\n constructor(options: Partial = DEFAULT_MIRROR_OPTIONS) {\n const mirrorOptions = { ...DEFAULT_MIRROR_OPTIONS, ...options };\n const {\n lcd,\n key,\n collector,\n factory,\n gov,\n mint,\n oracle,\n staking,\n mirrorToken,\n terraswapFactory,\n assets\n } = mirrorOptions;\n\n this.collector = new MirrorCollector({\n contractAddress: collector,\n lcd,\n key\n });\n this.factory = new MirrorFactory({\n contractAddress: factory,\n lcd,\n key\n });\n this.gov = new MirrorGov({\n contractAddress: gov,\n lcd,\n key\n });\n this.mint = new MirrorMint({\n contractAddress: mint,\n lcd,\n key\n });\n this.oracle = new MirrorOracle({\n contractAddress: oracle,\n lcd,\n key\n });\n this.staking = new MirrorStaking({\n contractAddress: staking,\n lcd,\n key\n });\n this.mirrorToken = new TerraswapToken({\n contractAddress: mirrorToken,\n lcd,\n key\n });\n\n this.terraswapFactory = new TerraswapFactory({\n contractAddress: terraswapFactory,\n lcd,\n key\n });\n\n this.assets = [];\n\n assets.forEach((asset) => {\n this.assets.push({\n name: asset.name,\n symbol: asset.symbol,\n token: new TerraswapToken({\n contractAddress: asset.token,\n lcd,\n key\n }),\n lpToken: new TerraswapToken({\n contractAddress: asset.lpToken,\n lcd,\n key\n }),\n pair: new TerraswapPair({\n contractAddress: asset.pair,\n lcd,\n key\n })\n });\n });\n }\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=Block.js.map","/*\r\n * decimal.js v10.2.1\r\n * An arbitrary-precision Decimal type for JavaScript.\r\n * https://github.com/MikeMcl/decimal.js\r\n * Copyright (c) 2020 Michael Mclaughlin \r\n * MIT Licence\r\n */\r\n\r\n\r\n// ----------------------------------- EDITABLE DEFAULTS ------------------------------------ //\r\n\r\n\r\n // The maximum exponent magnitude.\r\n // The limit on the value of `toExpNeg`, `toExpPos`, `minE` and `maxE`.\r\nvar EXP_LIMIT = 9e15, // 0 to 9e15\r\n\r\n // The limit on the value of `precision`, and on the value of the first argument to\r\n // `toDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision` and `toSignificantDigits`.\r\n MAX_DIGITS = 1e9, // 0 to 1e9\r\n\r\n // Base conversion alphabet.\r\n NUMERALS = '0123456789abcdef',\r\n\r\n // The natural logarithm of 10 (1025 digits).\r\n LN10 = '2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058',\r\n\r\n // Pi (1025 digits).\r\n PI = '3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789',\r\n\r\n\r\n // The initial configuration properties of the Decimal constructor.\r\n DEFAULTS = {\r\n\r\n // These values must be integers within the stated ranges (inclusive).\r\n // Most of these values can be changed at run-time using the `Decimal.config` method.\r\n\r\n // The maximum number of significant digits of the result of a calculation or base conversion.\r\n // E.g. `Decimal.config({ precision: 20 });`\r\n precision: 20, // 1 to MAX_DIGITS\r\n\r\n // The rounding mode used when rounding to `precision`.\r\n //\r\n // ROUND_UP 0 Away from zero.\r\n // ROUND_DOWN 1 Towards zero.\r\n // ROUND_CEIL 2 Towards +Infinity.\r\n // ROUND_FLOOR 3 Towards -Infinity.\r\n // ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up.\r\n // ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.\r\n // ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.\r\n // ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.\r\n // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\r\n //\r\n // E.g.\r\n // `Decimal.rounding = 4;`\r\n // `Decimal.rounding = Decimal.ROUND_HALF_UP;`\r\n rounding: 4, // 0 to 8\r\n\r\n // The modulo mode used when calculating the modulus: a mod n.\r\n // The quotient (q = a / n) is calculated according to the corresponding rounding mode.\r\n // The remainder (r) is calculated as: r = a - n * q.\r\n //\r\n // UP 0 The remainder is positive if the dividend is negative, else is negative.\r\n // DOWN 1 The remainder has the same sign as the dividend (JavaScript %).\r\n // FLOOR 3 The remainder has the same sign as the divisor (Python %).\r\n // HALF_EVEN 6 The IEEE 754 remainder function.\r\n // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). Always positive.\r\n //\r\n // Truncated division (1), floored division (3), the IEEE 754 remainder (6), and Euclidian\r\n // division (9) are commonly used for the modulus operation. The other rounding modes can also\r\n // be used, but they may not give useful results.\r\n modulo: 1, // 0 to 9\r\n\r\n // The exponent value at and beneath which `toString` returns exponential notation.\r\n // JavaScript numbers: -7\r\n toExpNeg: -7, // 0 to -EXP_LIMIT\r\n\r\n // The exponent value at and above which `toString` returns exponential notation.\r\n // JavaScript numbers: 21\r\n toExpPos: 21, // 0 to EXP_LIMIT\r\n\r\n // The minimum exponent value, beneath which underflow to zero occurs.\r\n // JavaScript numbers: -324 (5e-324)\r\n minE: -EXP_LIMIT, // -1 to -EXP_LIMIT\r\n\r\n // The maximum exponent value, above which overflow to Infinity occurs.\r\n // JavaScript numbers: 308 (1.7976931348623157e+308)\r\n maxE: EXP_LIMIT, // 1 to EXP_LIMIT\r\n\r\n // Whether to use cryptographically-secure random number generation, if available.\r\n crypto: false // true/false\r\n },\r\n\r\n\r\n// ----------------------------------- END OF EDITABLE DEFAULTS ------------------------------- //\r\n\r\n\r\n inexact, quadrant,\r\n external = true,\r\n\r\n decimalError = '[DecimalError] ',\r\n invalidArgument = decimalError + 'Invalid argument: ',\r\n precisionLimitExceeded = decimalError + 'Precision limit exceeded',\r\n cryptoUnavailable = decimalError + 'crypto unavailable',\r\n\r\n mathfloor = Math.floor,\r\n mathpow = Math.pow,\r\n\r\n isBinary = /^0b([01]+(\\.[01]*)?|\\.[01]+)(p[+-]?\\d+)?$/i,\r\n isHex = /^0x([0-9a-f]+(\\.[0-9a-f]*)?|\\.[0-9a-f]+)(p[+-]?\\d+)?$/i,\r\n isOctal = /^0o([0-7]+(\\.[0-7]*)?|\\.[0-7]+)(p[+-]?\\d+)?$/i,\r\n isDecimal = /^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,\r\n\r\n BASE = 1e7,\r\n LOG_BASE = 7,\r\n MAX_SAFE_INTEGER = 9007199254740991,\r\n\r\n LN10_PRECISION = LN10.length - 1,\r\n PI_PRECISION = PI.length - 1,\r\n\r\n // Decimal.prototype object\r\n P = { name: '[object Decimal]' };\r\n\r\n\r\n// Decimal prototype methods\r\n\r\n\r\n/*\r\n * absoluteValue abs\r\n * ceil\r\n * comparedTo cmp\r\n * cosine cos\r\n * cubeRoot cbrt\r\n * decimalPlaces dp\r\n * dividedBy div\r\n * dividedToIntegerBy divToInt\r\n * equals eq\r\n * floor\r\n * greaterThan gt\r\n * greaterThanOrEqualTo gte\r\n * hyperbolicCosine cosh\r\n * hyperbolicSine sinh\r\n * hyperbolicTangent tanh\r\n * inverseCosine acos\r\n * inverseHyperbolicCosine acosh\r\n * inverseHyperbolicSine asinh\r\n * inverseHyperbolicTangent atanh\r\n * inverseSine asin\r\n * inverseTangent atan\r\n * isFinite\r\n * isInteger isInt\r\n * isNaN\r\n * isNegative isNeg\r\n * isPositive isPos\r\n * isZero\r\n * lessThan lt\r\n * lessThanOrEqualTo lte\r\n * logarithm log\r\n * [maximum] [max]\r\n * [minimum] [min]\r\n * minus sub\r\n * modulo mod\r\n * naturalExponential exp\r\n * naturalLogarithm ln\r\n * negated neg\r\n * plus add\r\n * precision sd\r\n * round\r\n * sine sin\r\n * squareRoot sqrt\r\n * tangent tan\r\n * times mul\r\n * toBinary\r\n * toDecimalPlaces toDP\r\n * toExponential\r\n * toFixed\r\n * toFraction\r\n * toHexadecimal toHex\r\n * toNearest\r\n * toNumber\r\n * toOctal\r\n * toPower pow\r\n * toPrecision\r\n * toSignificantDigits toSD\r\n * toString\r\n * truncated trunc\r\n * valueOf toJSON\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the absolute value of this Decimal.\r\n *\r\n */\r\nP.absoluteValue = P.abs = function () {\r\n var x = new this.constructor(this);\r\n if (x.s < 0) x.s = 1;\r\n return finalise(x);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the\r\n * direction of positive Infinity.\r\n *\r\n */\r\nP.ceil = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 2);\r\n};\r\n\r\n\r\n/*\r\n * Return\r\n * 1 if the value of this Decimal is greater than the value of `y`,\r\n * -1 if the value of this Decimal is less than the value of `y`,\r\n * 0 if they have the same value,\r\n * NaN if the value of either Decimal is NaN.\r\n *\r\n */\r\nP.comparedTo = P.cmp = function (y) {\r\n var i, j, xdL, ydL,\r\n x = this,\r\n xd = x.d,\r\n yd = (y = new x.constructor(y)).d,\r\n xs = x.s,\r\n ys = y.s;\r\n\r\n // Either NaN or ±Infinity?\r\n if (!xd || !yd) {\r\n return !xs || !ys ? NaN : xs !== ys ? xs : xd === yd ? 0 : !xd ^ xs < 0 ? 1 : -1;\r\n }\r\n\r\n // Either zero?\r\n if (!xd[0] || !yd[0]) return xd[0] ? xs : yd[0] ? -ys : 0;\r\n\r\n // Signs differ?\r\n if (xs !== ys) return xs;\r\n\r\n // Compare exponents.\r\n if (x.e !== y.e) return x.e > y.e ^ xs < 0 ? 1 : -1;\r\n\r\n xdL = xd.length;\r\n ydL = yd.length;\r\n\r\n // Compare digit by digit.\r\n for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) {\r\n if (xd[i] !== yd[i]) return xd[i] > yd[i] ^ xs < 0 ? 1 : -1;\r\n }\r\n\r\n // Compare lengths.\r\n return xdL === ydL ? 0 : xdL > ydL ^ xs < 0 ? 1 : -1;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cosine of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * cos(0) = 1\r\n * cos(-0) = 1\r\n * cos(Infinity) = NaN\r\n * cos(-Infinity) = NaN\r\n * cos(NaN) = NaN\r\n *\r\n */\r\nP.cosine = P.cos = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.d) return new Ctor(NaN);\r\n\r\n // cos(0) = cos(-0) = 1\r\n if (!x.d[0]) return new Ctor(1);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;\r\n Ctor.rounding = 1;\r\n\r\n x = cosine(Ctor, toLessThanHalfPi(Ctor, x));\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant == 2 || quadrant == 3 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n *\r\n * Return a new Decimal whose value is the cube root of the value of this Decimal, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * cbrt(0) = 0\r\n * cbrt(-0) = -0\r\n * cbrt(1) = 1\r\n * cbrt(-1) = -1\r\n * cbrt(N) = N\r\n * cbrt(-I) = -I\r\n * cbrt(I) = I\r\n *\r\n * Math.cbrt(x) = (x < 0 ? -Math.pow(-x, 1/3) : Math.pow(x, 1/3))\r\n *\r\n */\r\nP.cubeRoot = P.cbrt = function () {\r\n var e, m, n, r, rep, s, sd, t, t3, t3plusx,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n external = false;\r\n\r\n // Initial estimate.\r\n s = x.s * mathpow(x.s * x, 1 / 3);\r\n\r\n // Math.cbrt underflow/overflow?\r\n // Pass x to Math.pow as integer, then adjust the exponent of the result.\r\n if (!s || Math.abs(s) == 1 / 0) {\r\n n = digitsToString(x.d);\r\n e = x.e;\r\n\r\n // Adjust n exponent so it is a multiple of 3 away from x exponent.\r\n if (s = (e - n.length + 1) % 3) n += (s == 1 || s == -2 ? '0' : '00');\r\n s = mathpow(n, 1 / 3);\r\n\r\n // Rarely, e may be one less than the result exponent value.\r\n e = mathfloor((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2));\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new Ctor(n);\r\n r.s = x.s;\r\n } else {\r\n r = new Ctor(s.toString());\r\n }\r\n\r\n sd = (e = Ctor.precision) + 3;\r\n\r\n // Halley's method.\r\n // TODO? Compare Newton's method.\r\n for (;;) {\r\n t = r;\r\n t3 = t.times(t).times(t);\r\n t3plusx = t3.plus(x);\r\n r = divide(t3plusx.plus(x).times(t), t3plusx.plus(t3), sd + 2, 1);\r\n\r\n // TODO? Replace with for-loop and checkRoundingDigits.\r\n if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {\r\n n = n.slice(sd - 3, sd + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or 4999\r\n // , i.e. approaching a rounding boundary, continue the iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the exact result as the\r\n // nines may infinitely repeat.\r\n if (!rep) {\r\n finalise(t, e + 1, 0);\r\n\r\n if (t.times(t).times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n sd += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.\r\n // If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n finalise(r, e + 1, 1);\r\n m = !r.times(r).times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, e, Ctor.rounding, m);\r\n};\r\n\r\n\r\n/*\r\n * Return the number of decimal places of the value of this Decimal.\r\n *\r\n */\r\nP.decimalPlaces = P.dp = function () {\r\n var w,\r\n d = this.d,\r\n n = NaN;\r\n\r\n if (d) {\r\n w = d.length - 1;\r\n n = (w - mathfloor(this.e / LOG_BASE)) * LOG_BASE;\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n w = d[w];\r\n if (w) for (; w % 10 == 0; w /= 10) n--;\r\n if (n < 0) n = 0;\r\n }\r\n\r\n return n;\r\n};\r\n\r\n\r\n/*\r\n * n / 0 = I\r\n * n / N = N\r\n * n / I = 0\r\n * 0 / n = 0\r\n * 0 / 0 = N\r\n * 0 / N = N\r\n * 0 / I = 0\r\n * N / n = N\r\n * N / 0 = N\r\n * N / N = N\r\n * N / I = N\r\n * I / n = I\r\n * I / 0 = I\r\n * I / N = N\r\n * I / I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal divided by `y`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.dividedBy = P.div = function (y) {\r\n return divide(this, new this.constructor(y));\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the integer part of dividing the value of this Decimal\r\n * by the value of `y`, rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.dividedToIntegerBy = P.divToInt = function (y) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n return finalise(divide(x, new Ctor(y), 0, 1, 1), Ctor.precision, Ctor.rounding);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is equal to the value of `y`, otherwise return false.\r\n *\r\n */\r\nP.equals = P.eq = function (y) {\r\n return this.cmp(y) === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the\r\n * direction of negative Infinity.\r\n *\r\n */\r\nP.floor = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 3);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is greater than the value of `y`, otherwise return\r\n * false.\r\n *\r\n */\r\nP.greaterThan = P.gt = function (y) {\r\n return this.cmp(y) > 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is greater than or equal to the value of `y`,\r\n * otherwise return false.\r\n *\r\n */\r\nP.greaterThanOrEqualTo = P.gte = function (y) {\r\n var k = this.cmp(y);\r\n return k == 1 || k === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic cosine of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [1, Infinity]\r\n *\r\n * cosh(x) = 1 + x^2/2! + x^4/4! + x^6/6! + ...\r\n *\r\n * cosh(0) = 1\r\n * cosh(-0) = 1\r\n * cosh(Infinity) = Infinity\r\n * cosh(-Infinity) = Infinity\r\n * cosh(NaN) = NaN\r\n *\r\n * x time taken (ms) result\r\n * 1000 9 9.8503555700852349694e+433\r\n * 10000 25 4.4034091128314607936e+4342\r\n * 100000 171 1.4033316802130615897e+43429\r\n * 1000000 3817 1.5166076984010437725e+434294\r\n * 10000000 abandoned after 2 minute wait\r\n *\r\n * TODO? Compare performance of cosh(x) = 0.5 * (exp(x) + exp(-x))\r\n *\r\n */\r\nP.hyperbolicCosine = P.cosh = function () {\r\n var k, n, pr, rm, len,\r\n x = this,\r\n Ctor = x.constructor,\r\n one = new Ctor(1);\r\n\r\n if (!x.isFinite()) return new Ctor(x.s ? 1 / 0 : NaN);\r\n if (x.isZero()) return one;\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n len = x.d.length;\r\n\r\n // Argument reduction: cos(4x) = 1 - 8cos^2(x) + 8cos^4(x) + 1\r\n // i.e. cos(x) = 1 - cos^2(x/4)(8 - 8cos^2(x/4))\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n // TODO? Estimation reused from cosine() and may not be optimal here.\r\n if (len < 32) {\r\n k = Math.ceil(len / 3);\r\n n = (1 / tinyPow(4, k)).toString();\r\n } else {\r\n k = 16;\r\n n = '2.3283064365386962890625e-10';\r\n }\r\n\r\n x = taylorSeries(Ctor, 1, x.times(n), new Ctor(1), true);\r\n\r\n // Reverse argument reduction\r\n var cosh2_x,\r\n i = k,\r\n d8 = new Ctor(8);\r\n for (; i--;) {\r\n cosh2_x = x.times(x);\r\n x = one.minus(cosh2_x.times(d8.minus(cosh2_x.times(d8))));\r\n }\r\n\r\n return finalise(x, Ctor.precision = pr, Ctor.rounding = rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic sine of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * sinh(x) = x + x^3/3! + x^5/5! + x^7/7! + ...\r\n *\r\n * sinh(0) = 0\r\n * sinh(-0) = -0\r\n * sinh(Infinity) = Infinity\r\n * sinh(-Infinity) = -Infinity\r\n * sinh(NaN) = NaN\r\n *\r\n * x time taken (ms)\r\n * 10 2 ms\r\n * 100 5 ms\r\n * 1000 14 ms\r\n * 10000 82 ms\r\n * 100000 886 ms 1.4033316802130615897e+43429\r\n * 200000 2613 ms\r\n * 300000 5407 ms\r\n * 400000 8824 ms\r\n * 500000 13026 ms 8.7080643612718084129e+217146\r\n * 1000000 48543 ms\r\n *\r\n * TODO? Compare performance of sinh(x) = 0.5 * (exp(x) - exp(-x))\r\n *\r\n */\r\nP.hyperbolicSine = P.sinh = function () {\r\n var k, pr, rm, len,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n len = x.d.length;\r\n\r\n if (len < 3) {\r\n x = taylorSeries(Ctor, 2, x, x, true);\r\n } else {\r\n\r\n // Alternative argument reduction: sinh(3x) = sinh(x)(3 + 4sinh^2(x))\r\n // i.e. sinh(x) = sinh(x/3)(3 + 4sinh^2(x/3))\r\n // 3 multiplications and 1 addition\r\n\r\n // Argument reduction: sinh(5x) = sinh(x)(5 + sinh^2(x)(20 + 16sinh^2(x)))\r\n // i.e. sinh(x) = sinh(x/5)(5 + sinh^2(x/5)(20 + 16sinh^2(x/5)))\r\n // 4 multiplications and 2 additions\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n k = 1.4 * Math.sqrt(len);\r\n k = k > 16 ? 16 : k | 0;\r\n\r\n x = x.times(1 / tinyPow(5, k));\r\n x = taylorSeries(Ctor, 2, x, x, true);\r\n\r\n // Reverse argument reduction\r\n var sinh2_x,\r\n d5 = new Ctor(5),\r\n d16 = new Ctor(16),\r\n d20 = new Ctor(20);\r\n for (; k--;) {\r\n sinh2_x = x.times(x);\r\n x = x.times(d5.plus(sinh2_x.times(d16.times(sinh2_x).plus(d20))));\r\n }\r\n }\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic tangent of the value in radians of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * tanh(x) = sinh(x) / cosh(x)\r\n *\r\n * tanh(0) = 0\r\n * tanh(-0) = -0\r\n * tanh(Infinity) = 1\r\n * tanh(-Infinity) = -1\r\n * tanh(NaN) = NaN\r\n *\r\n */\r\nP.hyperbolicTangent = P.tanh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(x.s);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 7;\r\n Ctor.rounding = 1;\r\n\r\n return divide(x.sinh(), x.cosh(), Ctor.precision = pr, Ctor.rounding = rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arccosine (inverse cosine) in radians of the value of\r\n * this Decimal.\r\n *\r\n * Domain: [-1, 1]\r\n * Range: [0, pi]\r\n *\r\n * acos(x) = pi/2 - asin(x)\r\n *\r\n * acos(0) = pi/2\r\n * acos(-0) = pi/2\r\n * acos(1) = 0\r\n * acos(-1) = pi\r\n * acos(1/2) = pi/3\r\n * acos(-1/2) = 2*pi/3\r\n * acos(|x| > 1) = NaN\r\n * acos(NaN) = NaN\r\n *\r\n */\r\nP.inverseCosine = P.acos = function () {\r\n var halfPi,\r\n x = this,\r\n Ctor = x.constructor,\r\n k = x.abs().cmp(1),\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding;\r\n\r\n if (k !== -1) {\r\n return k === 0\r\n // |x| is 1\r\n ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0)\r\n // |x| > 1 or x is NaN\r\n : new Ctor(NaN);\r\n }\r\n\r\n if (x.isZero()) return getPi(Ctor, pr + 4, rm).times(0.5);\r\n\r\n // TODO? Special case acos(0.5) = pi/3 and acos(-0.5) = 2*pi/3\r\n\r\n Ctor.precision = pr + 6;\r\n Ctor.rounding = 1;\r\n\r\n x = x.asin();\r\n halfPi = getPi(Ctor, pr + 4, rm).times(0.5);\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return halfPi.minus(x);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic cosine in radians of the\r\n * value of this Decimal.\r\n *\r\n * Domain: [1, Infinity]\r\n * Range: [0, Infinity]\r\n *\r\n * acosh(x) = ln(x + sqrt(x^2 - 1))\r\n *\r\n * acosh(x < 1) = NaN\r\n * acosh(NaN) = NaN\r\n * acosh(Infinity) = Infinity\r\n * acosh(-Infinity) = NaN\r\n * acosh(0) = NaN\r\n * acosh(-0) = NaN\r\n * acosh(1) = 0\r\n * acosh(-1) = NaN\r\n *\r\n */\r\nP.inverseHyperbolicCosine = P.acosh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (x.lte(1)) return new Ctor(x.eq(1) ? 0 : NaN);\r\n if (!x.isFinite()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4;\r\n Ctor.rounding = 1;\r\n external = false;\r\n\r\n x = x.times(x).minus(1).sqrt().plus(x);\r\n\r\n external = true;\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.ln();\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic sine in radians of the value\r\n * of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * asinh(x) = ln(x + sqrt(x^2 + 1))\r\n *\r\n * asinh(NaN) = NaN\r\n * asinh(Infinity) = Infinity\r\n * asinh(-Infinity) = -Infinity\r\n * asinh(0) = 0\r\n * asinh(-0) = -0\r\n *\r\n */\r\nP.inverseHyperbolicSine = P.asinh = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite() || x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6;\r\n Ctor.rounding = 1;\r\n external = false;\r\n\r\n x = x.times(x).plus(1).sqrt().plus(x);\r\n\r\n external = true;\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.ln();\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic tangent in radians of the\r\n * value of this Decimal.\r\n *\r\n * Domain: [-1, 1]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * atanh(x) = 0.5 * ln((1 + x) / (1 - x))\r\n *\r\n * atanh(|x| > 1) = NaN\r\n * atanh(NaN) = NaN\r\n * atanh(Infinity) = NaN\r\n * atanh(-Infinity) = NaN\r\n * atanh(0) = 0\r\n * atanh(-0) = -0\r\n * atanh(1) = Infinity\r\n * atanh(-1) = -Infinity\r\n *\r\n */\r\nP.inverseHyperbolicTangent = P.atanh = function () {\r\n var pr, rm, wpr, xsd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.e >= 0) return new Ctor(x.abs().eq(1) ? x.s / 0 : x.isZero() ? x : NaN);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n xsd = x.sd();\r\n\r\n if (Math.max(xsd, pr) < 2 * -x.e - 1) return finalise(new Ctor(x), pr, rm, true);\r\n\r\n Ctor.precision = wpr = xsd - x.e;\r\n\r\n x = divide(x.plus(1), new Ctor(1).minus(x), wpr + pr, 1);\r\n\r\n Ctor.precision = pr + 4;\r\n Ctor.rounding = 1;\r\n\r\n x = x.ln();\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.times(0.5);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arcsine (inverse sine) in radians of the value of this\r\n * Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi/2, pi/2]\r\n *\r\n * asin(x) = 2*atan(x/(1 + sqrt(1 - x^2)))\r\n *\r\n * asin(0) = 0\r\n * asin(-0) = -0\r\n * asin(1/2) = pi/6\r\n * asin(-1/2) = -pi/6\r\n * asin(1) = pi/2\r\n * asin(-1) = -pi/2\r\n * asin(|x| > 1) = NaN\r\n * asin(NaN) = NaN\r\n *\r\n * TODO? Compare performance of Taylor series.\r\n *\r\n */\r\nP.inverseSine = P.asin = function () {\r\n var halfPi, k,\r\n pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n k = x.abs().cmp(1);\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n if (k !== -1) {\r\n\r\n // |x| is 1\r\n if (k === 0) {\r\n halfPi = getPi(Ctor, pr + 4, rm).times(0.5);\r\n halfPi.s = x.s;\r\n return halfPi;\r\n }\r\n\r\n // |x| > 1 or x is NaN\r\n return new Ctor(NaN);\r\n }\r\n\r\n // TODO? Special case asin(1/2) = pi/6 and asin(-1/2) = -pi/6\r\n\r\n Ctor.precision = pr + 6;\r\n Ctor.rounding = 1;\r\n\r\n x = x.div(new Ctor(1).minus(x.times(x)).sqrt().plus(1)).atan();\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return x.times(2);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent (inverse tangent) in radians of the value\r\n * of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi/2, pi/2]\r\n *\r\n * atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...\r\n *\r\n * atan(0) = 0\r\n * atan(-0) = -0\r\n * atan(1) = pi/4\r\n * atan(-1) = -pi/4\r\n * atan(Infinity) = pi/2\r\n * atan(-Infinity) = -pi/2\r\n * atan(NaN) = NaN\r\n *\r\n */\r\nP.inverseTangent = P.atan = function () {\r\n var i, j, k, n, px, t, r, wpr, x2,\r\n x = this,\r\n Ctor = x.constructor,\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding;\r\n\r\n if (!x.isFinite()) {\r\n if (!x.s) return new Ctor(NaN);\r\n if (pr + 4 <= PI_PRECISION) {\r\n r = getPi(Ctor, pr + 4, rm).times(0.5);\r\n r.s = x.s;\r\n return r;\r\n }\r\n } else if (x.isZero()) {\r\n return new Ctor(x);\r\n } else if (x.abs().eq(1) && pr + 4 <= PI_PRECISION) {\r\n r = getPi(Ctor, pr + 4, rm).times(0.25);\r\n r.s = x.s;\r\n return r;\r\n }\r\n\r\n Ctor.precision = wpr = pr + 10;\r\n Ctor.rounding = 1;\r\n\r\n // TODO? if (x >= 1 && pr <= PI_PRECISION) atan(x) = halfPi * x.s - atan(1 / x);\r\n\r\n // Argument reduction\r\n // Ensure |x| < 0.42\r\n // atan(x) = 2 * atan(x / (1 + sqrt(1 + x^2)))\r\n\r\n k = Math.min(28, wpr / LOG_BASE + 2 | 0);\r\n\r\n for (i = k; i; --i) x = x.div(x.times(x).plus(1).sqrt().plus(1));\r\n\r\n external = false;\r\n\r\n j = Math.ceil(wpr / LOG_BASE);\r\n n = 1;\r\n x2 = x.times(x);\r\n r = new Ctor(x);\r\n px = x;\r\n\r\n // atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...\r\n for (; i !== -1;) {\r\n px = px.times(x2);\r\n t = r.minus(px.div(n += 2));\r\n\r\n px = px.times(x2);\r\n r = t.plus(px.div(n += 2));\r\n\r\n if (r.d[j] !== void 0) for (i = j; r.d[i] === t.d[i] && i--;);\r\n }\r\n\r\n if (k) r = r.times(2 << (k - 1));\r\n\r\n external = true;\r\n\r\n return finalise(r, Ctor.precision = pr, Ctor.rounding = rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is a finite number, otherwise return false.\r\n *\r\n */\r\nP.isFinite = function () {\r\n return !!this.d;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is an integer, otherwise return false.\r\n *\r\n */\r\nP.isInteger = P.isInt = function () {\r\n return !!this.d && mathfloor(this.e / LOG_BASE) > this.d.length - 2;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is NaN, otherwise return false.\r\n *\r\n */\r\nP.isNaN = function () {\r\n return !this.s;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is negative, otherwise return false.\r\n *\r\n */\r\nP.isNegative = P.isNeg = function () {\r\n return this.s < 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is positive, otherwise return false.\r\n *\r\n */\r\nP.isPositive = P.isPos = function () {\r\n return this.s > 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is 0 or -0, otherwise return false.\r\n *\r\n */\r\nP.isZero = function () {\r\n return !!this.d && this.d[0] === 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is less than `y`, otherwise return false.\r\n *\r\n */\r\nP.lessThan = P.lt = function (y) {\r\n return this.cmp(y) < 0;\r\n};\r\n\r\n\r\n/*\r\n * Return true if the value of this Decimal is less than or equal to `y`, otherwise return false.\r\n *\r\n */\r\nP.lessThanOrEqualTo = P.lte = function (y) {\r\n return this.cmp(y) < 1;\r\n};\r\n\r\n\r\n/*\r\n * Return the logarithm of the value of this Decimal to the specified base, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * If no base is specified, return log[10](arg).\r\n *\r\n * log[base](arg) = ln(arg) / ln(base)\r\n *\r\n * The result will always be correctly rounded if the base of the log is 10, and 'almost always'\r\n * otherwise:\r\n *\r\n * Depending on the rounding mode, the result may be incorrectly rounded if the first fifteen\r\n * rounding digits are [49]99999999999999 or [50]00000000000000. In that case, the maximum error\r\n * between the result and the correctly rounded result will be one ulp (unit in the last place).\r\n *\r\n * log[-b](a) = NaN\r\n * log[0](a) = NaN\r\n * log[1](a) = NaN\r\n * log[NaN](a) = NaN\r\n * log[Infinity](a) = NaN\r\n * log[b](0) = -Infinity\r\n * log[b](-0) = -Infinity\r\n * log[b](-a) = NaN\r\n * log[b](1) = 0\r\n * log[b](Infinity) = Infinity\r\n * log[b](NaN) = NaN\r\n *\r\n * [base] {number|string|Decimal} The base of the logarithm.\r\n *\r\n */\r\nP.logarithm = P.log = function (base) {\r\n var isBase10, d, denominator, k, inf, num, sd, r,\r\n arg = this,\r\n Ctor = arg.constructor,\r\n pr = Ctor.precision,\r\n rm = Ctor.rounding,\r\n guard = 5;\r\n\r\n // Default base is 10.\r\n if (base == null) {\r\n base = new Ctor(10);\r\n isBase10 = true;\r\n } else {\r\n base = new Ctor(base);\r\n d = base.d;\r\n\r\n // Return NaN if base is negative, or non-finite, or is 0 or 1.\r\n if (base.s < 0 || !d || !d[0] || base.eq(1)) return new Ctor(NaN);\r\n\r\n isBase10 = base.eq(10);\r\n }\r\n\r\n d = arg.d;\r\n\r\n // Is arg negative, non-finite, 0 or 1?\r\n if (arg.s < 0 || !d || !d[0] || arg.eq(1)) {\r\n return new Ctor(d && !d[0] ? -1 / 0 : arg.s != 1 ? NaN : d ? 0 : 1 / 0);\r\n }\r\n\r\n // The result will have a non-terminating decimal expansion if base is 10 and arg is not an\r\n // integer power of 10.\r\n if (isBase10) {\r\n if (d.length > 1) {\r\n inf = true;\r\n } else {\r\n for (k = d[0]; k % 10 === 0;) k /= 10;\r\n inf = k !== 1;\r\n }\r\n }\r\n\r\n external = false;\r\n sd = pr + guard;\r\n num = naturalLogarithm(arg, sd);\r\n denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);\r\n\r\n // The result will have 5 rounding digits.\r\n r = divide(num, denominator, sd, 1);\r\n\r\n // If at a rounding boundary, i.e. the result's rounding digits are [49]9999 or [50]0000,\r\n // calculate 10 further digits.\r\n //\r\n // If the result is known to have an infinite decimal expansion, repeat this until it is clear\r\n // that the result is above or below the boundary. Otherwise, if after calculating the 10\r\n // further digits, the last 14 are nines, round up and assume the result is exact.\r\n // Also assume the result is exact if the last 14 are zero.\r\n //\r\n // Example of a result that will be incorrectly rounded:\r\n // log[1048576](4503599627370502) = 2.60000000000000009610279511444746...\r\n // The above result correctly rounded using ROUND_CEIL to 1 decimal place should be 2.7, but it\r\n // will be given as 2.6 as there are 15 zeros immediately after the requested decimal place, so\r\n // the exact result would be assumed to be 2.6, which rounded using ROUND_CEIL to 1 decimal\r\n // place is still 2.6.\r\n if (checkRoundingDigits(r.d, k = pr, rm)) {\r\n\r\n do {\r\n sd += 10;\r\n num = naturalLogarithm(arg, sd);\r\n denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);\r\n r = divide(num, denominator, sd, 1);\r\n\r\n if (!inf) {\r\n\r\n // Check for 14 nines from the 2nd rounding digit, as the first may be 4.\r\n if (+digitsToString(r.d).slice(k + 1, k + 15) + 1 == 1e14) {\r\n r = finalise(r, pr + 1, 0);\r\n }\r\n\r\n break;\r\n }\r\n } while (checkRoundingDigits(r.d, k += 10, rm));\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, pr, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the maximum of the arguments and the value of this Decimal.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\nP.max = function () {\r\n Array.prototype.push.call(arguments, this);\r\n return maxOrMin(this.constructor, arguments, 'lt');\r\n};\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the minimum of the arguments and the value of this Decimal.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\nP.min = function () {\r\n Array.prototype.push.call(arguments, this);\r\n return maxOrMin(this.constructor, arguments, 'gt');\r\n};\r\n */\r\n\r\n\r\n/*\r\n * n - 0 = n\r\n * n - N = N\r\n * n - I = -I\r\n * 0 - n = -n\r\n * 0 - 0 = 0\r\n * 0 - N = N\r\n * 0 - I = -I\r\n * N - n = N\r\n * N - 0 = N\r\n * N - N = N\r\n * N - I = N\r\n * I - n = I\r\n * I - 0 = I\r\n * I - N = N\r\n * I - I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal minus `y`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.minus = P.sub = function (y) {\r\n var d, e, i, j, k, len, pr, rm, xd, xe, xLTy, yd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // If either is not finite...\r\n if (!x.d || !y.d) {\r\n\r\n // Return NaN if either is NaN.\r\n if (!x.s || !y.s) y = new Ctor(NaN);\r\n\r\n // Return y negated if x is finite and y is ±Infinity.\r\n else if (x.d) y.s = -y.s;\r\n\r\n // Return x if y is finite and x is ±Infinity.\r\n // Return x if both are ±Infinity with different signs.\r\n // Return NaN if both are ±Infinity with the same sign.\r\n else y = new Ctor(y.d || x.s !== y.s ? x : NaN);\r\n\r\n return y;\r\n }\r\n\r\n // If signs differ...\r\n if (x.s != y.s) {\r\n y.s = -y.s;\r\n return x.plus(y);\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n // If either is zero...\r\n if (!xd[0] || !yd[0]) {\r\n\r\n // Return y negated if x is zero and y is non-zero.\r\n if (yd[0]) y.s = -y.s;\r\n\r\n // Return x if y is zero and x is non-zero.\r\n else if (xd[0]) y = new Ctor(x);\r\n\r\n // Return zero if both are zero.\r\n // From IEEE 754 (2008) 6.3: 0 - 0 = -0 - -0 = -0 when rounding to -Infinity.\r\n else return new Ctor(rm === 3 ? -0 : 0);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n }\r\n\r\n // x and y are finite, non-zero numbers with the same sign.\r\n\r\n // Calculate base 1e7 exponents.\r\n e = mathfloor(y.e / LOG_BASE);\r\n xe = mathfloor(x.e / LOG_BASE);\r\n\r\n xd = xd.slice();\r\n k = xe - e;\r\n\r\n // If base 1e7 exponents differ...\r\n if (k) {\r\n xLTy = k < 0;\r\n\r\n if (xLTy) {\r\n d = xd;\r\n k = -k;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = xe;\r\n len = xd.length;\r\n }\r\n\r\n // Numbers with massively different exponents would result in a very high number of\r\n // zeros needing to be prepended, but this can be avoided while still ensuring correct\r\n // rounding by limiting the number of zeros to `Math.ceil(pr / LOG_BASE) + 2`.\r\n i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2;\r\n\r\n if (k > i) {\r\n k = i;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents.\r\n d.reverse();\r\n for (i = k; i--;) d.push(0);\r\n d.reverse();\r\n\r\n // Base 1e7 exponents equal.\r\n } else {\r\n\r\n // Check digits to determine which is the bigger number.\r\n\r\n i = xd.length;\r\n len = yd.length;\r\n xLTy = i < len;\r\n if (xLTy) len = i;\r\n\r\n for (i = 0; i < len; i++) {\r\n if (xd[i] != yd[i]) {\r\n xLTy = xd[i] < yd[i];\r\n break;\r\n }\r\n }\r\n\r\n k = 0;\r\n }\r\n\r\n if (xLTy) {\r\n d = xd;\r\n xd = yd;\r\n yd = d;\r\n y.s = -y.s;\r\n }\r\n\r\n len = xd.length;\r\n\r\n // Append zeros to `xd` if shorter.\r\n // Don't add zeros to `yd` if shorter as subtraction only needs to start at `yd` length.\r\n for (i = yd.length - len; i > 0; --i) xd[len++] = 0;\r\n\r\n // Subtract yd from xd.\r\n for (i = yd.length; i > k;) {\r\n\r\n if (xd[--i] < yd[i]) {\r\n for (j = i; j && xd[--j] === 0;) xd[j] = BASE - 1;\r\n --xd[j];\r\n xd[i] += BASE;\r\n }\r\n\r\n xd[i] -= yd[i];\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; xd[--len] === 0;) xd.pop();\r\n\r\n // Remove leading zeros and adjust exponent accordingly.\r\n for (; xd[0] === 0; xd.shift()) --e;\r\n\r\n // Zero?\r\n if (!xd[0]) return new Ctor(rm === 3 ? -0 : 0);\r\n\r\n y.d = xd;\r\n y.e = getBase10Exponent(xd, e);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n};\r\n\r\n\r\n/*\r\n * n % 0 = N\r\n * n % N = N\r\n * n % I = n\r\n * 0 % n = 0\r\n * -0 % n = -0\r\n * 0 % 0 = N\r\n * 0 % N = N\r\n * 0 % I = 0\r\n * N % n = N\r\n * N % 0 = N\r\n * N % N = N\r\n * N % I = N\r\n * I % n = N\r\n * I % 0 = N\r\n * I % N = N\r\n * I % I = N\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal modulo `y`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * The result depends on the modulo mode.\r\n *\r\n */\r\nP.modulo = P.mod = function (y) {\r\n var q,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // Return NaN if x is ±Infinity or NaN, or y is NaN or ±0.\r\n if (!x.d || !y.s || y.d && !y.d[0]) return new Ctor(NaN);\r\n\r\n // Return x if y is ±Infinity or x is ±0.\r\n if (!y.d || x.d && !x.d[0]) {\r\n return finalise(new Ctor(x), Ctor.precision, Ctor.rounding);\r\n }\r\n\r\n // Prevent rounding of intermediate calculations.\r\n external = false;\r\n\r\n if (Ctor.modulo == 9) {\r\n\r\n // Euclidian division: q = sign(y) * floor(x / abs(y))\r\n // result = x - q * y where 0 <= result < abs(y)\r\n q = divide(x, y.abs(), 0, 3, 1);\r\n q.s *= y.s;\r\n } else {\r\n q = divide(x, y, 0, Ctor.modulo, 1);\r\n }\r\n\r\n q = q.times(y);\r\n\r\n external = true;\r\n\r\n return x.minus(q);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of the value of this Decimal,\r\n * i.e. the base e raised to the power the value of this Decimal, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.naturalExponential = P.exp = function () {\r\n return naturalExponential(this);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of the value of this Decimal,\r\n * rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.naturalLogarithm = P.ln = function () {\r\n return naturalLogarithm(this);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by\r\n * -1.\r\n *\r\n */\r\nP.negated = P.neg = function () {\r\n var x = new this.constructor(this);\r\n x.s = -x.s;\r\n return finalise(x);\r\n};\r\n\r\n\r\n/*\r\n * n + 0 = n\r\n * n + N = N\r\n * n + I = I\r\n * 0 + n = n\r\n * 0 + 0 = 0\r\n * 0 + N = N\r\n * 0 + I = I\r\n * N + n = N\r\n * N + 0 = N\r\n * N + N = N\r\n * N + I = N\r\n * I + n = I\r\n * I + 0 = I\r\n * I + N = N\r\n * I + I = I\r\n *\r\n * Return a new Decimal whose value is the value of this Decimal plus `y`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.plus = P.add = function (y) {\r\n var carry, d, e, i, k, len, pr, rm, xd, yd,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n y = new Ctor(y);\r\n\r\n // If either is not finite...\r\n if (!x.d || !y.d) {\r\n\r\n // Return NaN if either is NaN.\r\n if (!x.s || !y.s) y = new Ctor(NaN);\r\n\r\n // Return x if y is finite and x is ±Infinity.\r\n // Return x if both are ±Infinity with the same sign.\r\n // Return NaN if both are ±Infinity with different signs.\r\n // Return y if x is finite and y is ±Infinity.\r\n else if (!x.d) y = new Ctor(y.d || x.s === y.s ? x : NaN);\r\n\r\n return y;\r\n }\r\n\r\n // If signs differ...\r\n if (x.s != y.s) {\r\n y.s = -y.s;\r\n return x.minus(y);\r\n }\r\n\r\n xd = x.d;\r\n yd = y.d;\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n // If either is zero...\r\n if (!xd[0] || !yd[0]) {\r\n\r\n // Return x if y is zero.\r\n // Return y if y is non-zero.\r\n if (!yd[0]) y = new Ctor(x);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n }\r\n\r\n // x and y are finite, non-zero numbers with the same sign.\r\n\r\n // Calculate base 1e7 exponents.\r\n k = mathfloor(x.e / LOG_BASE);\r\n e = mathfloor(y.e / LOG_BASE);\r\n\r\n xd = xd.slice();\r\n i = k - e;\r\n\r\n // If base 1e7 exponents differ...\r\n if (i) {\r\n\r\n if (i < 0) {\r\n d = xd;\r\n i = -i;\r\n len = yd.length;\r\n } else {\r\n d = yd;\r\n e = k;\r\n len = xd.length;\r\n }\r\n\r\n // Limit number of zeros prepended to max(ceil(pr / LOG_BASE), len) + 1.\r\n k = Math.ceil(pr / LOG_BASE);\r\n len = k > len ? k + 1 : len + 1;\r\n\r\n if (i > len) {\r\n i = len;\r\n d.length = 1;\r\n }\r\n\r\n // Prepend zeros to equalise exponents. Note: Faster to use reverse then do unshifts.\r\n d.reverse();\r\n for (; i--;) d.push(0);\r\n d.reverse();\r\n }\r\n\r\n len = xd.length;\r\n i = yd.length;\r\n\r\n // If yd is longer than xd, swap xd and yd so xd points to the longer array.\r\n if (len - i < 0) {\r\n i = len;\r\n d = yd;\r\n yd = xd;\r\n xd = d;\r\n }\r\n\r\n // Only start adding at yd.length - 1 as the further digits of xd can be left as they are.\r\n for (carry = 0; i;) {\r\n carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0;\r\n xd[i] %= BASE;\r\n }\r\n\r\n if (carry) {\r\n xd.unshift(carry);\r\n ++e;\r\n }\r\n\r\n // Remove trailing zeros.\r\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n for (len = xd.length; xd[--len] == 0;) xd.pop();\r\n\r\n y.d = xd;\r\n y.e = getBase10Exponent(xd, e);\r\n\r\n return external ? finalise(y, pr, rm) : y;\r\n};\r\n\r\n\r\n/*\r\n * Return the number of significant digits of the value of this Decimal.\r\n *\r\n * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0.\r\n *\r\n */\r\nP.precision = P.sd = function (z) {\r\n var k,\r\n x = this;\r\n\r\n if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z);\r\n\r\n if (x.d) {\r\n k = getPrecision(x.d);\r\n if (z && x.e + 1 > k) k = x.e + 1;\r\n } else {\r\n k = NaN;\r\n }\r\n\r\n return k;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a whole number using\r\n * rounding mode `rounding`.\r\n *\r\n */\r\nP.round = function () {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n return finalise(new Ctor(x), x.e + 1, Ctor.rounding);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sine of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-1, 1]\r\n *\r\n * sin(x) = x - x^3/3! + x^5/5! - ...\r\n *\r\n * sin(0) = 0\r\n * sin(-0) = -0\r\n * sin(Infinity) = NaN\r\n * sin(-Infinity) = NaN\r\n * sin(NaN) = NaN\r\n *\r\n */\r\nP.sine = P.sin = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;\r\n Ctor.rounding = 1;\r\n\r\n x = sine(Ctor, toLessThanHalfPi(Ctor, x));\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant > 2 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of this Decimal, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * sqrt(-n) = N\r\n * sqrt(N) = N\r\n * sqrt(-I) = N\r\n * sqrt(I) = I\r\n * sqrt(0) = 0\r\n * sqrt(-0) = -0\r\n *\r\n */\r\nP.squareRoot = P.sqrt = function () {\r\n var m, n, sd, r, rep, t,\r\n x = this,\r\n d = x.d,\r\n e = x.e,\r\n s = x.s,\r\n Ctor = x.constructor;\r\n\r\n // Negative/NaN/Infinity/zero?\r\n if (s !== 1 || !d || !d[0]) {\r\n return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : 1 / 0);\r\n }\r\n\r\n external = false;\r\n\r\n // Initial estimate.\r\n s = Math.sqrt(+x);\r\n\r\n // Math.sqrt underflow/overflow?\r\n // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\r\n if (s == 0 || s == 1 / 0) {\r\n n = digitsToString(d);\r\n\r\n if ((n.length + e) % 2 == 0) n += '0';\r\n s = Math.sqrt(n);\r\n e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);\r\n\r\n if (s == 1 / 0) {\r\n n = '5e' + e;\r\n } else {\r\n n = s.toExponential();\r\n n = n.slice(0, n.indexOf('e') + 1) + e;\r\n }\r\n\r\n r = new Ctor(n);\r\n } else {\r\n r = new Ctor(s.toString());\r\n }\r\n\r\n sd = (e = Ctor.precision) + 3;\r\n\r\n // Newton-Raphson iteration.\r\n for (;;) {\r\n t = r;\r\n r = t.plus(divide(x, t, sd + 2, 1)).times(0.5);\r\n\r\n // TODO? Replace with for-loop and checkRoundingDigits.\r\n if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {\r\n n = n.slice(sd - 3, sd + 1);\r\n\r\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or\r\n // 4999, i.e. approaching a rounding boundary, continue the iteration.\r\n if (n == '9999' || !rep && n == '4999') {\r\n\r\n // On the first iteration only, check to see if rounding up gives the exact result as the\r\n // nines may infinitely repeat.\r\n if (!rep) {\r\n finalise(t, e + 1, 0);\r\n\r\n if (t.times(t).eq(x)) {\r\n r = t;\r\n break;\r\n }\r\n }\r\n\r\n sd += 4;\r\n rep = 1;\r\n } else {\r\n\r\n // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.\r\n // If not, then there are further digits and m will be truthy.\r\n if (!+n || !+n.slice(1) && n.charAt(0) == '5') {\r\n\r\n // Truncate to the first rounding digit.\r\n finalise(r, e + 1, 1);\r\n m = !r.times(r).eq(x);\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return finalise(r, e, Ctor.rounding, m);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the tangent of the value in radians of this Decimal.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-Infinity, Infinity]\r\n *\r\n * tan(0) = 0\r\n * tan(-0) = -0\r\n * tan(Infinity) = NaN\r\n * tan(-Infinity) = NaN\r\n * tan(NaN) = NaN\r\n *\r\n */\r\nP.tangent = P.tan = function () {\r\n var pr, rm,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (!x.isFinite()) return new Ctor(NaN);\r\n if (x.isZero()) return new Ctor(x);\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n Ctor.precision = pr + 10;\r\n Ctor.rounding = 1;\r\n\r\n x = x.sin();\r\n x.s = 1;\r\n x = divide(x, new Ctor(1).minus(x.times(x)).sqrt(), pr + 10, 0);\r\n\r\n Ctor.precision = pr;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(quadrant == 2 || quadrant == 4 ? x.neg() : x, pr, rm, true);\r\n};\r\n\r\n\r\n/*\r\n * n * 0 = 0\r\n * n * N = N\r\n * n * I = I\r\n * 0 * n = 0\r\n * 0 * 0 = 0\r\n * 0 * N = N\r\n * 0 * I = N\r\n * N * n = N\r\n * N * 0 = N\r\n * N * N = N\r\n * N * I = N\r\n * I * n = I\r\n * I * 0 = N\r\n * I * N = N\r\n * I * I = I\r\n *\r\n * Return a new Decimal whose value is this Decimal times `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n */\r\nP.times = P.mul = function (y) {\r\n var carry, e, i, k, r, rL, t, xdL, ydL,\r\n x = this,\r\n Ctor = x.constructor,\r\n xd = x.d,\r\n yd = (y = new Ctor(y)).d;\r\n\r\n y.s *= x.s;\r\n\r\n // If either is NaN, ±Infinity or ±0...\r\n if (!xd || !xd[0] || !yd || !yd[0]) {\r\n\r\n return new Ctor(!y.s || xd && !xd[0] && !yd || yd && !yd[0] && !xd\r\n\r\n // Return NaN if either is NaN.\r\n // Return NaN if x is ±0 and y is ±Infinity, or y is ±0 and x is ±Infinity.\r\n ? NaN\r\n\r\n // Return ±Infinity if either is ±Infinity.\r\n // Return ±0 if either is ±0.\r\n : !xd || !yd ? y.s / 0 : y.s * 0);\r\n }\r\n\r\n e = mathfloor(x.e / LOG_BASE) + mathfloor(y.e / LOG_BASE);\r\n xdL = xd.length;\r\n ydL = yd.length;\r\n\r\n // Ensure xd points to the longer array.\r\n if (xdL < ydL) {\r\n r = xd;\r\n xd = yd;\r\n yd = r;\r\n rL = xdL;\r\n xdL = ydL;\r\n ydL = rL;\r\n }\r\n\r\n // Initialise the result array with zeros.\r\n r = [];\r\n rL = xdL + ydL;\r\n for (i = rL; i--;) r.push(0);\r\n\r\n // Multiply!\r\n for (i = ydL; --i >= 0;) {\r\n carry = 0;\r\n for (k = xdL + i; k > i;) {\r\n t = r[k] + yd[i] * xd[k - i - 1] + carry;\r\n r[k--] = t % BASE | 0;\r\n carry = t / BASE | 0;\r\n }\r\n\r\n r[k] = (r[k] + carry) % BASE | 0;\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (; !r[--rL];) r.pop();\r\n\r\n if (carry) ++e;\r\n else r.shift();\r\n\r\n y.d = r;\r\n y.e = getBase10Exponent(r, e);\r\n\r\n return external ? finalise(y, Ctor.precision, Ctor.rounding) : y;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 2, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toBinary = function (sd, rm) {\r\n return toStringBinary(this, 2, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `dp`\r\n * decimal places using rounding mode `rm` or `rounding` if `rm` is omitted.\r\n *\r\n * If `dp` is omitted, return a new Decimal whose value is the value of this Decimal.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toDecimalPlaces = P.toDP = function (dp, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n x = new Ctor(x);\r\n if (dp === void 0) return x;\r\n\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n return finalise(x, dp + x.e + 1, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in exponential notation rounded to\r\n * `dp` fixed decimal places using rounding mode `rounding`.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toExponential = function (dp, rm) {\r\n var str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) {\r\n str = finiteToString(x, true);\r\n } else {\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = finalise(new Ctor(x), dp + 1, rm);\r\n str = finiteToString(x, true, dp + 1);\r\n }\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in normal (fixed-point) notation to\r\n * `dp` fixed decimal places and rounded using rounding mode `rm` or `rounding` if `rm` is\r\n * omitted.\r\n *\r\n * As with JavaScript numbers, (-0).toFixed(0) is '0', but e.g. (-0.00001).toFixed(0) is '-0'.\r\n *\r\n * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.\r\n * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.\r\n * (-0).toFixed(3) is '0.000'.\r\n * (-0.5).toFixed(0) is '-0'.\r\n *\r\n */\r\nP.toFixed = function (dp, rm) {\r\n var str, y,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (dp === void 0) {\r\n str = finiteToString(x);\r\n } else {\r\n checkInt32(dp, 0, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n y = finalise(new Ctor(x), dp + x.e + 1, rm);\r\n str = finiteToString(y, false, dp + y.e + 1);\r\n }\r\n\r\n // To determine whether to add the minus sign look at the value before it was rounded,\r\n // i.e. look at `x` rather than `y`.\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return an array representing the value of this Decimal as a simple fraction with an integer\r\n * numerator and an integer denominator.\r\n *\r\n * The denominator will be a positive non-zero value less than or equal to the specified maximum\r\n * denominator. If a maximum denominator is not specified, the denominator will be the lowest\r\n * value necessary to represent the number exactly.\r\n *\r\n * [maxD] {number|string|Decimal} Maximum denominator. Integer >= 1 and < Infinity.\r\n *\r\n */\r\nP.toFraction = function (maxD) {\r\n var d, d0, d1, d2, e, k, n, n0, n1, pr, q, r,\r\n x = this,\r\n xd = x.d,\r\n Ctor = x.constructor;\r\n\r\n if (!xd) return new Ctor(x);\r\n\r\n n1 = d0 = new Ctor(1);\r\n d1 = n0 = new Ctor(0);\r\n\r\n d = new Ctor(d1);\r\n e = d.e = getPrecision(xd) - x.e - 1;\r\n k = e % LOG_BASE;\r\n d.d[0] = mathpow(10, k < 0 ? LOG_BASE + k : k);\r\n\r\n if (maxD == null) {\r\n\r\n // d is 10**e, the minimum max-denominator needed.\r\n maxD = e > 0 ? d : n1;\r\n } else {\r\n n = new Ctor(maxD);\r\n if (!n.isInt() || n.lt(n1)) throw Error(invalidArgument + n);\r\n maxD = n.gt(d) ? (e > 0 ? d : n1) : n;\r\n }\r\n\r\n external = false;\r\n n = new Ctor(digitsToString(xd));\r\n pr = Ctor.precision;\r\n Ctor.precision = e = xd.length * LOG_BASE * 2;\r\n\r\n for (;;) {\r\n q = divide(n, d, 0, 1, 1);\r\n d2 = d0.plus(q.times(d1));\r\n if (d2.cmp(maxD) == 1) break;\r\n d0 = d1;\r\n d1 = d2;\r\n d2 = n1;\r\n n1 = n0.plus(q.times(d2));\r\n n0 = d2;\r\n d2 = d;\r\n d = n.minus(q.times(d2));\r\n n = d2;\r\n }\r\n\r\n d2 = divide(maxD.minus(d0), d1, 0, 1, 1);\r\n n0 = n0.plus(d2.times(n1));\r\n d0 = d0.plus(d2.times(d1));\r\n n0.s = n1.s = x.s;\r\n\r\n // Determine which fraction is closer to x, n0/d0 or n1/d1?\r\n r = divide(n1, d1, e, 1).minus(x).abs().cmp(divide(n0, d0, e, 1).minus(x).abs()) < 1\r\n ? [n1, d1] : [n0, d0];\r\n\r\n Ctor.precision = pr;\r\n external = true;\r\n\r\n return r;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 16, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toHexadecimal = P.toHex = function (sd, rm) {\r\n return toStringBinary(this, 16, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Returns a new Decimal whose value is the nearest multiple of `y` in the direction of rounding\r\n * mode `rm`, or `Decimal.rounding` if `rm` is omitted, to the value of this Decimal.\r\n *\r\n * The return value will always have the same sign as this Decimal, unless either this Decimal\r\n * or `y` is NaN, in which case the return value will be also be NaN.\r\n *\r\n * The return value is not affected by the value of `precision`.\r\n *\r\n * y {number|string|Decimal} The magnitude to round to a multiple of.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * 'toNearest() rounding mode not an integer: {rm}'\r\n * 'toNearest() rounding mode out of range: {rm}'\r\n *\r\n */\r\nP.toNearest = function (y, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n x = new Ctor(x);\r\n\r\n if (y == null) {\r\n\r\n // If x is not finite, return x.\r\n if (!x.d) return x;\r\n\r\n y = new Ctor(1);\r\n rm = Ctor.rounding;\r\n } else {\r\n y = new Ctor(y);\r\n if (rm === void 0) {\r\n rm = Ctor.rounding;\r\n } else {\r\n checkInt32(rm, 0, 8);\r\n }\r\n\r\n // If x is not finite, return x if y is not NaN, else NaN.\r\n if (!x.d) return y.s ? x : y;\r\n\r\n // If y is not finite, return Infinity with the sign of x if y is Infinity, else NaN.\r\n if (!y.d) {\r\n if (y.s) y.s = x.s;\r\n return y;\r\n }\r\n }\r\n\r\n // If y is not zero, calculate the nearest multiple of y to x.\r\n if (y.d[0]) {\r\n external = false;\r\n x = divide(x, y, 0, rm, 1).times(y);\r\n external = true;\r\n finalise(x);\r\n\r\n // If y is zero, return zero with the sign of x.\r\n } else {\r\n y.s = x.s;\r\n x = y;\r\n }\r\n\r\n return x;\r\n};\r\n\r\n\r\n/*\r\n * Return the value of this Decimal converted to a number primitive.\r\n * Zero keeps its sign.\r\n *\r\n */\r\nP.toNumber = function () {\r\n return +this;\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal in base 8, round to `sd` significant\r\n * digits using rounding mode `rm`.\r\n *\r\n * If the optional `sd` argument is present then return binary exponential notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toOctal = function (sd, rm) {\r\n return toStringBinary(this, 8, sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal raised to the power `y`, rounded\r\n * to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * ECMAScript compliant.\r\n *\r\n * pow(x, NaN) = NaN\r\n * pow(x, ±0) = 1\r\n\r\n * pow(NaN, non-zero) = NaN\r\n * pow(abs(x) > 1, +Infinity) = +Infinity\r\n * pow(abs(x) > 1, -Infinity) = +0\r\n * pow(abs(x) == 1, ±Infinity) = NaN\r\n * pow(abs(x) < 1, +Infinity) = +0\r\n * pow(abs(x) < 1, -Infinity) = +Infinity\r\n * pow(+Infinity, y > 0) = +Infinity\r\n * pow(+Infinity, y < 0) = +0\r\n * pow(-Infinity, odd integer > 0) = -Infinity\r\n * pow(-Infinity, even integer > 0) = +Infinity\r\n * pow(-Infinity, odd integer < 0) = -0\r\n * pow(-Infinity, even integer < 0) = +0\r\n * pow(+0, y > 0) = +0\r\n * pow(+0, y < 0) = +Infinity\r\n * pow(-0, odd integer > 0) = -0\r\n * pow(-0, even integer > 0) = +0\r\n * pow(-0, odd integer < 0) = -Infinity\r\n * pow(-0, even integer < 0) = +Infinity\r\n * pow(finite x < 0, finite non-integer) = NaN\r\n *\r\n * For non-integer or very large exponents pow(x, y) is calculated using\r\n *\r\n * x^y = exp(y*ln(x))\r\n *\r\n * Assuming the first 15 rounding digits are each equally likely to be any digit 0-9, the\r\n * probability of an incorrectly rounded result\r\n * P([49]9{14} | [50]0{14}) = 2 * 0.2 * 10^-14 = 4e-15 = 1/2.5e+14\r\n * i.e. 1 in 250,000,000,000,000\r\n *\r\n * If a result is incorrectly rounded the maximum error will be 1 ulp (unit in last place).\r\n *\r\n * y {number|string|Decimal} The power to which to raise this Decimal.\r\n *\r\n */\r\nP.toPower = P.pow = function (y) {\r\n var e, k, pr, r, rm, s,\r\n x = this,\r\n Ctor = x.constructor,\r\n yn = +(y = new Ctor(y));\r\n\r\n // Either ±Infinity, NaN or ±0?\r\n if (!x.d || !y.d || !x.d[0] || !y.d[0]) return new Ctor(mathpow(+x, yn));\r\n\r\n x = new Ctor(x);\r\n\r\n if (x.eq(1)) return x;\r\n\r\n pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n\r\n if (y.eq(1)) return finalise(x, pr, rm);\r\n\r\n // y exponent\r\n e = mathfloor(y.e / LOG_BASE);\r\n\r\n // If y is a small integer use the 'exponentiation by squaring' algorithm.\r\n if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {\r\n r = intPow(Ctor, x, k, pr);\r\n return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm);\r\n }\r\n\r\n s = x.s;\r\n\r\n // if x is negative\r\n if (s < 0) {\r\n\r\n // if y is not an integer\r\n if (e < y.d.length - 1) return new Ctor(NaN);\r\n\r\n // Result is positive if x is negative and the last digit of integer y is even.\r\n if ((y.d[e] & 1) == 0) s = 1;\r\n\r\n // if x.eq(-1)\r\n if (x.e == 0 && x.d[0] == 1 && x.d.length == 1) {\r\n x.s = s;\r\n return x;\r\n }\r\n }\r\n\r\n // Estimate result exponent.\r\n // x^y = 10^e, where e = y * log10(x)\r\n // log10(x) = log10(x_significand) + x_exponent\r\n // log10(x_significand) = ln(x_significand) / ln(10)\r\n k = mathpow(+x, yn);\r\n e = k == 0 || !isFinite(k)\r\n ? mathfloor(yn * (Math.log('0.' + digitsToString(x.d)) / Math.LN10 + x.e + 1))\r\n : new Ctor(k + '').e;\r\n\r\n // Exponent estimate may be incorrect e.g. x: 0.999999999999999999, y: 2.29, e: 0, r.e: -1.\r\n\r\n // Overflow/underflow?\r\n if (e > Ctor.maxE + 1 || e < Ctor.minE - 1) return new Ctor(e > 0 ? s / 0 : 0);\r\n\r\n external = false;\r\n Ctor.rounding = x.s = 1;\r\n\r\n // Estimate the extra guard digits needed to ensure five correct rounding digits from\r\n // naturalLogarithm(x). Example of failure without these extra digits (precision: 10):\r\n // new Decimal(2.32456).pow('2087987436534566.46411')\r\n // should be 1.162377823e+764914905173815, but is 1.162355823e+764914905173815\r\n k = Math.min(12, (e + '').length);\r\n\r\n // r = x^y = exp(y*ln(x))\r\n r = naturalExponential(y.times(naturalLogarithm(x, pr + k)), pr);\r\n\r\n // r may be Infinity, e.g. (0.9999999999999999).pow(-1e+40)\r\n if (r.d) {\r\n\r\n // Truncate to the required precision plus five rounding digits.\r\n r = finalise(r, pr + 5, 1);\r\n\r\n // If the rounding digits are [49]9999 or [50]0000 increase the precision by 10 and recalculate\r\n // the result.\r\n if (checkRoundingDigits(r.d, pr, rm)) {\r\n e = pr + 10;\r\n\r\n // Truncate to the increased precision plus five rounding digits.\r\n r = finalise(naturalExponential(y.times(naturalLogarithm(x, e + k)), e), e + 5, 1);\r\n\r\n // Check for 14 nines from the 2nd rounding digit (the first rounding digit may be 4 or 9).\r\n if (+digitsToString(r.d).slice(pr + 1, pr + 15) + 1 == 1e14) {\r\n r = finalise(r, pr + 1, 0);\r\n }\r\n }\r\n }\r\n\r\n r.s = s;\r\n external = true;\r\n Ctor.rounding = rm;\r\n\r\n return finalise(r, pr, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal rounded to `sd` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * Return exponential notation if `sd` is less than the number of digits necessary to represent\r\n * the integer part of the value in normal notation.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n */\r\nP.toPrecision = function (sd, rm) {\r\n var str,\r\n x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n\r\n x = finalise(new Ctor(x), sd, rm);\r\n str = finiteToString(x, sd <= x.e || x.e <= Ctor.toExpNeg, sd);\r\n }\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `sd`\r\n * significant digits using rounding mode `rm`, or to `precision` and `rounding` respectively if\r\n * omitted.\r\n *\r\n * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.\r\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n *\r\n * 'toSD() digits out of range: {sd}'\r\n * 'toSD() digits not an integer: {sd}'\r\n * 'toSD() rounding mode not an integer: {rm}'\r\n * 'toSD() rounding mode out of range: {rm}'\r\n *\r\n */\r\nP.toSignificantDigits = P.toSD = function (sd, rm) {\r\n var x = this,\r\n Ctor = x.constructor;\r\n\r\n if (sd === void 0) {\r\n sd = Ctor.precision;\r\n rm = Ctor.rounding;\r\n } else {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n }\r\n\r\n return finalise(new Ctor(x), sd, rm);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal.\r\n *\r\n * Return exponential notation if this Decimal has a positive exponent equal to or greater than\r\n * `toExpPos`, or a negative exponent equal to or less than `toExpNeg`.\r\n *\r\n */\r\nP.toString = function () {\r\n var x = this,\r\n Ctor = x.constructor,\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n\r\n return x.isNeg() && !x.isZero() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of this Decimal truncated to a whole number.\r\n *\r\n */\r\nP.truncated = P.trunc = function () {\r\n return finalise(new this.constructor(this), this.e + 1, 1);\r\n};\r\n\r\n\r\n/*\r\n * Return a string representing the value of this Decimal.\r\n * Unlike `toString`, negative zero will include the minus sign.\r\n *\r\n */\r\nP.valueOf = P.toJSON = function () {\r\n var x = this,\r\n Ctor = x.constructor,\r\n str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);\r\n\r\n return x.isNeg() ? '-' + str : str;\r\n};\r\n\r\n\r\n/*\r\n// Add aliases to match BigDecimal method names.\r\n// P.add = P.plus;\r\nP.subtract = P.minus;\r\nP.multiply = P.times;\r\nP.divide = P.div;\r\nP.remainder = P.mod;\r\nP.compareTo = P.cmp;\r\nP.negate = P.neg;\r\n */\r\n\r\n\r\n// Helper functions for Decimal.prototype (P) and/or Decimal methods, and their callers.\r\n\r\n\r\n/*\r\n * digitsToString P.cubeRoot, P.logarithm, P.squareRoot, P.toFraction, P.toPower,\r\n * finiteToString, naturalExponential, naturalLogarithm\r\n * checkInt32 P.toDecimalPlaces, P.toExponential, P.toFixed, P.toNearest,\r\n * P.toPrecision, P.toSignificantDigits, toStringBinary, random\r\n * checkRoundingDigits P.logarithm, P.toPower, naturalExponential, naturalLogarithm\r\n * convertBase toStringBinary, parseOther\r\n * cos P.cos\r\n * divide P.atanh, P.cubeRoot, P.dividedBy, P.dividedToIntegerBy,\r\n * P.logarithm, P.modulo, P.squareRoot, P.tan, P.tanh, P.toFraction,\r\n * P.toNearest, toStringBinary, naturalExponential, naturalLogarithm,\r\n * taylorSeries, atan2, parseOther\r\n * finalise P.absoluteValue, P.atan, P.atanh, P.ceil, P.cos, P.cosh,\r\n * P.cubeRoot, P.dividedToIntegerBy, P.floor, P.logarithm, P.minus,\r\n * P.modulo, P.negated, P.plus, P.round, P.sin, P.sinh, P.squareRoot,\r\n * P.tan, P.times, P.toDecimalPlaces, P.toExponential, P.toFixed,\r\n * P.toNearest, P.toPower, P.toPrecision, P.toSignificantDigits,\r\n * P.truncated, divide, getLn10, getPi, naturalExponential,\r\n * naturalLogarithm, ceil, floor, round, trunc\r\n * finiteToString P.toExponential, P.toFixed, P.toPrecision, P.toString, P.valueOf,\r\n * toStringBinary\r\n * getBase10Exponent P.minus, P.plus, P.times, parseOther\r\n * getLn10 P.logarithm, naturalLogarithm\r\n * getPi P.acos, P.asin, P.atan, toLessThanHalfPi, atan2\r\n * getPrecision P.precision, P.toFraction\r\n * getZeroString digitsToString, finiteToString\r\n * intPow P.toPower, parseOther\r\n * isOdd toLessThanHalfPi\r\n * maxOrMin max, min\r\n * naturalExponential P.naturalExponential, P.toPower\r\n * naturalLogarithm P.acosh, P.asinh, P.atanh, P.logarithm, P.naturalLogarithm,\r\n * P.toPower, naturalExponential\r\n * nonFiniteToString finiteToString, toStringBinary\r\n * parseDecimal Decimal\r\n * parseOther Decimal\r\n * sin P.sin\r\n * taylorSeries P.cosh, P.sinh, cos, sin\r\n * toLessThanHalfPi P.cos, P.sin\r\n * toStringBinary P.toBinary, P.toHexadecimal, P.toOctal\r\n * truncate intPow\r\n *\r\n * Throws: P.logarithm, P.precision, P.toFraction, checkInt32, getLn10, getPi,\r\n * naturalLogarithm, config, parseOther, random, Decimal\r\n */\r\n\r\n\r\nfunction digitsToString(d) {\r\n var i, k, ws,\r\n indexOfLastWord = d.length - 1,\r\n str = '',\r\n w = d[0];\r\n\r\n if (indexOfLastWord > 0) {\r\n str += w;\r\n for (i = 1; i < indexOfLastWord; i++) {\r\n ws = d[i] + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n str += ws;\r\n }\r\n\r\n w = d[i];\r\n ws = w + '';\r\n k = LOG_BASE - ws.length;\r\n if (k) str += getZeroString(k);\r\n } else if (w === 0) {\r\n return '0';\r\n }\r\n\r\n // Remove trailing zeros of last w.\r\n for (; w % 10 === 0;) w /= 10;\r\n\r\n return str + w;\r\n}\r\n\r\n\r\nfunction checkInt32(i, min, max) {\r\n if (i !== ~~i || i < min || i > max) {\r\n throw Error(invalidArgument + i);\r\n }\r\n}\r\n\r\n\r\n/*\r\n * Check 5 rounding digits if `repeating` is null, 4 otherwise.\r\n * `repeating == null` if caller is `log` or `pow`,\r\n * `repeating != null` if caller is `naturalLogarithm` or `naturalExponential`.\r\n */\r\nfunction checkRoundingDigits(d, i, rm, repeating) {\r\n var di, k, r, rd;\r\n\r\n // Get the length of the first word of the array d.\r\n for (k = d[0]; k >= 10; k /= 10) --i;\r\n\r\n // Is the rounding digit in the first word of d?\r\n if (--i < 0) {\r\n i += LOG_BASE;\r\n di = 0;\r\n } else {\r\n di = Math.ceil((i + 1) / LOG_BASE);\r\n i %= LOG_BASE;\r\n }\r\n\r\n // i is the index (0 - 6) of the rounding digit.\r\n // E.g. if within the word 3487563 the first rounding digit is 5,\r\n // then i = 4, k = 1000, rd = 3487563 % 1000 = 563\r\n k = mathpow(10, LOG_BASE - i);\r\n rd = d[di] % k | 0;\r\n\r\n if (repeating == null) {\r\n if (i < 3) {\r\n if (i == 0) rd = rd / 100 | 0;\r\n else if (i == 1) rd = rd / 10 | 0;\r\n r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;\r\n } else {\r\n r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 ||\r\n (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;\r\n }\r\n } else {\r\n if (i < 4) {\r\n if (i == 0) rd = rd / 1000 | 0;\r\n else if (i == 1) rd = rd / 100 | 0;\r\n else if (i == 2) rd = rd / 10 | 0;\r\n r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;\r\n } else {\r\n r = ((repeating || rm < 4) && rd + 1 == k ||\r\n (!repeating && rm > 3) && rd + 1 == k / 2) &&\r\n (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;\r\n }\r\n }\r\n\r\n return r;\r\n}\r\n\r\n\r\n// Convert string of `baseIn` to an array of numbers of `baseOut`.\r\n// Eg. convertBase('255', 10, 16) returns [15, 15].\r\n// Eg. convertBase('ff', 16, 10) returns [2, 5, 5].\r\nfunction convertBase(str, baseIn, baseOut) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for (; i < strL;) {\r\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n arr[0] += NUMERALS.indexOf(str.charAt(i++));\r\n for (j = 0; j < arr.length; j++) {\r\n if (arr[j] > baseOut - 1) {\r\n if (arr[j + 1] === void 0) arr[j + 1] = 0;\r\n arr[j + 1] += arr[j] / baseOut | 0;\r\n arr[j] %= baseOut;\r\n }\r\n }\r\n }\r\n\r\n return arr.reverse();\r\n}\r\n\r\n\r\n/*\r\n * cos(x) = 1 - x^2/2! + x^4/4! - ...\r\n * |x| < pi/2\r\n *\r\n */\r\nfunction cosine(Ctor, x) {\r\n var k, y,\r\n len = x.d.length;\r\n\r\n // Argument reduction: cos(4x) = 8*(cos^4(x) - cos^2(x)) + 1\r\n // i.e. cos(x) = 8*(cos^4(x/4) - cos^2(x/4)) + 1\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n if (len < 32) {\r\n k = Math.ceil(len / 3);\r\n y = (1 / tinyPow(4, k)).toString();\r\n } else {\r\n k = 16;\r\n y = '2.3283064365386962890625e-10';\r\n }\r\n\r\n Ctor.precision += k;\r\n\r\n x = taylorSeries(Ctor, 1, x.times(y), new Ctor(1));\r\n\r\n // Reverse argument reduction\r\n for (var i = k; i--;) {\r\n var cos2x = x.times(x);\r\n x = cos2x.times(cos2x).minus(cos2x).times(8).plus(1);\r\n }\r\n\r\n Ctor.precision -= k;\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Perform division in the specified base.\r\n */\r\nvar divide = (function () {\r\n\r\n // Assumes non-zero x and k, and hence non-zero result.\r\n function multiplyInteger(x, k, base) {\r\n var temp,\r\n carry = 0,\r\n i = x.length;\r\n\r\n for (x = x.slice(); i--;) {\r\n temp = x[i] * k + carry;\r\n x[i] = temp % base | 0;\r\n carry = temp / base | 0;\r\n }\r\n\r\n if (carry) x.unshift(carry);\r\n\r\n return x;\r\n }\r\n\r\n function compare(a, b, aL, bL) {\r\n var i, r;\r\n\r\n if (aL != bL) {\r\n r = aL > bL ? 1 : -1;\r\n } else {\r\n for (i = r = 0; i < aL; i++) {\r\n if (a[i] != b[i]) {\r\n r = a[i] > b[i] ? 1 : -1;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return r;\r\n }\r\n\r\n function subtract(a, b, aL, base) {\r\n var i = 0;\r\n\r\n // Subtract b from a.\r\n for (; aL--;) {\r\n a[aL] -= i;\r\n i = a[aL] < b[aL] ? 1 : 0;\r\n a[aL] = i * base + a[aL] - b[aL];\r\n }\r\n\r\n // Remove leading zeros.\r\n for (; !a[0] && a.length > 1;) a.shift();\r\n }\r\n\r\n return function (x, y, pr, rm, dp, base) {\r\n var cmp, e, i, k, logBase, more, prod, prodL, q, qd, rem, remL, rem0, sd, t, xi, xL, yd0,\r\n yL, yz,\r\n Ctor = x.constructor,\r\n sign = x.s == y.s ? 1 : -1,\r\n xd = x.d,\r\n yd = y.d;\r\n\r\n // Either NaN, Infinity or 0?\r\n if (!xd || !xd[0] || !yd || !yd[0]) {\r\n\r\n return new Ctor(// Return NaN if either NaN, or both Infinity or 0.\r\n !x.s || !y.s || (xd ? yd && xd[0] == yd[0] : !yd) ? NaN :\r\n\r\n // Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.\r\n xd && xd[0] == 0 || !yd ? sign * 0 : sign / 0);\r\n }\r\n\r\n if (base) {\r\n logBase = 1;\r\n e = x.e - y.e;\r\n } else {\r\n base = BASE;\r\n logBase = LOG_BASE;\r\n e = mathfloor(x.e / logBase) - mathfloor(y.e / logBase);\r\n }\r\n\r\n yL = yd.length;\r\n xL = xd.length;\r\n q = new Ctor(sign);\r\n qd = q.d = [];\r\n\r\n // Result exponent may be one less than e.\r\n // The digit array of a Decimal from toStringBinary may have trailing zeros.\r\n for (i = 0; yd[i] == (xd[i] || 0); i++);\r\n\r\n if (yd[i] > (xd[i] || 0)) e--;\r\n\r\n if (pr == null) {\r\n sd = pr = Ctor.precision;\r\n rm = Ctor.rounding;\r\n } else if (dp) {\r\n sd = pr + (x.e - y.e) + 1;\r\n } else {\r\n sd = pr;\r\n }\r\n\r\n if (sd < 0) {\r\n qd.push(1);\r\n more = true;\r\n } else {\r\n\r\n // Convert precision in number of base 10 digits to base 1e7 digits.\r\n sd = sd / logBase + 2 | 0;\r\n i = 0;\r\n\r\n // divisor < 1e7\r\n if (yL == 1) {\r\n k = 0;\r\n yd = yd[0];\r\n sd++;\r\n\r\n // k is the carry.\r\n for (; (i < xL || k) && sd--; i++) {\r\n t = k * base + (xd[i] || 0);\r\n qd[i] = t / yd | 0;\r\n k = t % yd | 0;\r\n }\r\n\r\n more = k || i < xL;\r\n\r\n // divisor >= 1e7\r\n } else {\r\n\r\n // Normalise xd and yd so highest order digit of yd is >= base/2\r\n k = base / (yd[0] + 1) | 0;\r\n\r\n if (k > 1) {\r\n yd = multiplyInteger(yd, k, base);\r\n xd = multiplyInteger(xd, k, base);\r\n yL = yd.length;\r\n xL = xd.length;\r\n }\r\n\r\n xi = yL;\r\n rem = xd.slice(0, yL);\r\n remL = rem.length;\r\n\r\n // Add zeros to make remainder as long as divisor.\r\n for (; remL < yL;) rem[remL++] = 0;\r\n\r\n yz = yd.slice();\r\n yz.unshift(0);\r\n yd0 = yd[0];\r\n\r\n if (yd[1] >= base / 2) ++yd0;\r\n\r\n do {\r\n k = 0;\r\n\r\n // Compare divisor and remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < remainder.\r\n if (cmp < 0) {\r\n\r\n // Calculate trial digit, k.\r\n rem0 = rem[0];\r\n if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);\r\n\r\n // k will be how many times the divisor goes into the current remainder.\r\n k = rem0 / yd0 | 0;\r\n\r\n // Algorithm:\r\n // 1. product = divisor * trial digit (k)\r\n // 2. if product > remainder: product -= divisor, k--\r\n // 3. remainder -= product\r\n // 4. if product was < remainder at 2:\r\n // 5. compare new remainder and divisor\r\n // 6. If remainder > divisor: remainder -= divisor, k++\r\n\r\n if (k > 1) {\r\n if (k >= base) k = base - 1;\r\n\r\n // product = divisor * trial digit.\r\n prod = multiplyInteger(yd, k, base);\r\n prodL = prod.length;\r\n remL = rem.length;\r\n\r\n // Compare product and remainder.\r\n cmp = compare(prod, rem, prodL, remL);\r\n\r\n // product > remainder.\r\n if (cmp == 1) {\r\n k--;\r\n\r\n // Subtract divisor from product.\r\n subtract(prod, yL < prodL ? yz : yd, prodL, base);\r\n }\r\n } else {\r\n\r\n // cmp is -1.\r\n // If k is 0, there is no need to compare yd and rem again below, so change cmp to 1\r\n // to avoid it. If k is 1 there is a need to compare yd and rem again below.\r\n if (k == 0) cmp = k = 1;\r\n prod = yd.slice();\r\n }\r\n\r\n prodL = prod.length;\r\n if (prodL < remL) prod.unshift(0);\r\n\r\n // Subtract product from remainder.\r\n subtract(rem, prod, remL, base);\r\n\r\n // If product was < previous remainder.\r\n if (cmp == -1) {\r\n remL = rem.length;\r\n\r\n // Compare divisor and new remainder.\r\n cmp = compare(yd, rem, yL, remL);\r\n\r\n // If divisor < new remainder, subtract divisor from remainder.\r\n if (cmp < 1) {\r\n k++;\r\n\r\n // Subtract divisor from remainder.\r\n subtract(rem, yL < remL ? yz : yd, remL, base);\r\n }\r\n }\r\n\r\n remL = rem.length;\r\n } else if (cmp === 0) {\r\n k++;\r\n rem = [0];\r\n } // if cmp === 1, k will be 0\r\n\r\n // Add the next digit, k, to the result array.\r\n qd[i++] = k;\r\n\r\n // Update the remainder.\r\n if (cmp && rem[0]) {\r\n rem[remL++] = xd[xi] || 0;\r\n } else {\r\n rem = [xd[xi]];\r\n remL = 1;\r\n }\r\n\r\n } while ((xi++ < xL || rem[0] !== void 0) && sd--);\r\n\r\n more = rem[0] !== void 0;\r\n }\r\n\r\n // Leading zero?\r\n if (!qd[0]) qd.shift();\r\n }\r\n\r\n // logBase is 1 when divide is being used for base conversion.\r\n if (logBase == 1) {\r\n q.e = e;\r\n inexact = more;\r\n } else {\r\n\r\n // To calculate q.e, first get the number of digits of qd[0].\r\n for (i = 1, k = qd[0]; k >= 10; k /= 10) i++;\r\n q.e = i + e * logBase - 1;\r\n\r\n finalise(q, dp ? pr + q.e + 1 : pr, rm, more);\r\n }\r\n\r\n return q;\r\n };\r\n})();\r\n\r\n\r\n/*\r\n * Round `x` to `sd` significant digits using rounding mode `rm`.\r\n * Check for over/under-flow.\r\n */\r\n function finalise(x, sd, rm, isTruncated) {\r\n var digits, i, j, k, rd, roundUp, w, xd, xdi,\r\n Ctor = x.constructor;\r\n\r\n // Don't round if sd is null or undefined.\r\n out: if (sd != null) {\r\n xd = x.d;\r\n\r\n // Infinity/NaN.\r\n if (!xd) return x;\r\n\r\n // rd: the rounding digit, i.e. the digit after the digit that may be rounded up.\r\n // w: the word of xd containing rd, a base 1e7 number.\r\n // xdi: the index of w within xd.\r\n // digits: the number of digits of w.\r\n // i: what would be the index of rd within w if all the numbers were 7 digits long (i.e. if\r\n // they had leading zeros)\r\n // j: if > 0, the actual index of rd within w (if < 0, rd is a leading zero).\r\n\r\n // Get the length of the first word of the digits array xd.\r\n for (digits = 1, k = xd[0]; k >= 10; k /= 10) digits++;\r\n i = sd - digits;\r\n\r\n // Is the rounding digit in the first word of xd?\r\n if (i < 0) {\r\n i += LOG_BASE;\r\n j = sd;\r\n w = xd[xdi = 0];\r\n\r\n // Get the rounding digit at index j of w.\r\n rd = w / mathpow(10, digits - j - 1) % 10 | 0;\r\n } else {\r\n xdi = Math.ceil((i + 1) / LOG_BASE);\r\n k = xd.length;\r\n if (xdi >= k) {\r\n if (isTruncated) {\r\n\r\n // Needed by `naturalExponential`, `naturalLogarithm` and `squareRoot`.\r\n for (; k++ <= xdi;) xd.push(0);\r\n w = rd = 0;\r\n digits = 1;\r\n i %= LOG_BASE;\r\n j = i - LOG_BASE + 1;\r\n } else {\r\n break out;\r\n }\r\n } else {\r\n w = k = xd[xdi];\r\n\r\n // Get the number of digits of w.\r\n for (digits = 1; k >= 10; k /= 10) digits++;\r\n\r\n // Get the index of rd within w.\r\n i %= LOG_BASE;\r\n\r\n // Get the index of rd within w, adjusted for leading zeros.\r\n // The number of leading zeros of w is given by LOG_BASE - digits.\r\n j = i - LOG_BASE + digits;\r\n\r\n // Get the rounding digit at index j of w.\r\n rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0;\r\n }\r\n }\r\n\r\n // Are there any non-zero digits after the rounding digit?\r\n isTruncated = isTruncated || sd < 0 ||\r\n xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1));\r\n\r\n // The expression `w % mathpow(10, digits - j - 1)` returns all the digits of w to the right\r\n // of the digit at (left-to-right) index j, e.g. if w is 908714 and j is 2, the expression\r\n // will give 714.\r\n\r\n roundUp = rm < 4\r\n ? (rd || isTruncated) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))\r\n : rd > 5 || rd == 5 && (rm == 4 || isTruncated || rm == 6 &&\r\n\r\n // Check whether the digit to the left of the rounding digit is odd.\r\n ((i > 0 ? j > 0 ? w / mathpow(10, digits - j) : 0 : xd[xdi - 1]) % 10) & 1 ||\r\n rm == (x.s < 0 ? 8 : 7));\r\n\r\n if (sd < 1 || !xd[0]) {\r\n xd.length = 0;\r\n if (roundUp) {\r\n\r\n // Convert sd to decimal places.\r\n sd -= x.e + 1;\r\n\r\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE);\r\n x.e = -sd || 0;\r\n } else {\r\n\r\n // Zero.\r\n xd[0] = x.e = 0;\r\n }\r\n\r\n return x;\r\n }\r\n\r\n // Remove excess digits.\r\n if (i == 0) {\r\n xd.length = xdi;\r\n k = 1;\r\n xdi--;\r\n } else {\r\n xd.length = xdi + 1;\r\n k = mathpow(10, LOG_BASE - i);\r\n\r\n // E.g. 56700 becomes 56000 if 7 is the rounding digit.\r\n // j > 0 means i > number of leading zeros of w.\r\n xd[xdi] = j > 0 ? (w / mathpow(10, digits - j) % mathpow(10, j) | 0) * k : 0;\r\n }\r\n\r\n if (roundUp) {\r\n for (;;) {\r\n\r\n // Is the digit to be rounded up in the first word of xd?\r\n if (xdi == 0) {\r\n\r\n // i will be the length of xd[0] before k is added.\r\n for (i = 1, j = xd[0]; j >= 10; j /= 10) i++;\r\n j = xd[0] += k;\r\n for (k = 1; j >= 10; j /= 10) k++;\r\n\r\n // if i != k the length has increased.\r\n if (i != k) {\r\n x.e++;\r\n if (xd[0] == BASE) xd[0] = 1;\r\n }\r\n\r\n break;\r\n } else {\r\n xd[xdi] += k;\r\n if (xd[xdi] != BASE) break;\r\n xd[xdi--] = 0;\r\n k = 1;\r\n }\r\n }\r\n }\r\n\r\n // Remove trailing zeros.\r\n for (i = xd.length; xd[--i] === 0;) xd.pop();\r\n }\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > Ctor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < Ctor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // Ctor.underflow = true;\r\n } // else Ctor.underflow = false;\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\nfunction finiteToString(x, isExp, sd) {\r\n if (!x.isFinite()) return nonFiniteToString(x);\r\n var k,\r\n e = x.e,\r\n str = digitsToString(x.d),\r\n len = str.length;\r\n\r\n if (isExp) {\r\n if (sd && (k = sd - len) > 0) {\r\n str = str.charAt(0) + '.' + str.slice(1) + getZeroString(k);\r\n } else if (len > 1) {\r\n str = str.charAt(0) + '.' + str.slice(1);\r\n }\r\n\r\n str = str + (x.e < 0 ? 'e' : 'e+') + x.e;\r\n } else if (e < 0) {\r\n str = '0.' + getZeroString(-e - 1) + str;\r\n if (sd && (k = sd - len) > 0) str += getZeroString(k);\r\n } else if (e >= len) {\r\n str += getZeroString(e + 1 - len);\r\n if (sd && (k = sd - e - 1) > 0) str = str + '.' + getZeroString(k);\r\n } else {\r\n if ((k = e + 1) < len) str = str.slice(0, k) + '.' + str.slice(k);\r\n if (sd && (k = sd - len) > 0) {\r\n if (e + 1 === len) str += '.';\r\n str += getZeroString(k);\r\n }\r\n }\r\n\r\n return str;\r\n}\r\n\r\n\r\n// Calculate the base 10 exponent from the base 1e7 exponent.\r\nfunction getBase10Exponent(digits, e) {\r\n var w = digits[0];\r\n\r\n // Add the number of digits of the first word of the digits array.\r\n for ( e *= LOG_BASE; w >= 10; w /= 10) e++;\r\n return e;\r\n}\r\n\r\n\r\nfunction getLn10(Ctor, sd, pr) {\r\n if (sd > LN10_PRECISION) {\r\n\r\n // Reset global state in case the exception is caught.\r\n external = true;\r\n if (pr) Ctor.precision = pr;\r\n throw Error(precisionLimitExceeded);\r\n }\r\n return finalise(new Ctor(LN10), sd, 1, true);\r\n}\r\n\r\n\r\nfunction getPi(Ctor, sd, rm) {\r\n if (sd > PI_PRECISION) throw Error(precisionLimitExceeded);\r\n return finalise(new Ctor(PI), sd, rm, true);\r\n}\r\n\r\n\r\nfunction getPrecision(digits) {\r\n var w = digits.length - 1,\r\n len = w * LOG_BASE + 1;\r\n\r\n w = digits[w];\r\n\r\n // If non-zero...\r\n if (w) {\r\n\r\n // Subtract the number of trailing zeros of the last word.\r\n for (; w % 10 == 0; w /= 10) len--;\r\n\r\n // Add the number of digits of the first word.\r\n for (w = digits[0]; w >= 10; w /= 10) len++;\r\n }\r\n\r\n return len;\r\n}\r\n\r\n\r\nfunction getZeroString(k) {\r\n var zs = '';\r\n for (; k--;) zs += '0';\r\n return zs;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the value of Decimal `x` to the power `n`, where `n` is an\r\n * integer of type number.\r\n *\r\n * Implements 'exponentiation by squaring'. Called by `pow` and `parseOther`.\r\n *\r\n */\r\nfunction intPow(Ctor, x, n, pr) {\r\n var isTruncated,\r\n r = new Ctor(1),\r\n\r\n // Max n of 9007199254740991 takes 53 loop iterations.\r\n // Maximum digits array length; leaves [28, 34] guard digits.\r\n k = Math.ceil(pr / LOG_BASE + 4);\r\n\r\n external = false;\r\n\r\n for (;;) {\r\n if (n % 2) {\r\n r = r.times(x);\r\n if (truncate(r.d, k)) isTruncated = true;\r\n }\r\n\r\n n = mathfloor(n / 2);\r\n if (n === 0) {\r\n\r\n // To ensure correct rounding when r.d is truncated, increment the last word if it is zero.\r\n n = r.d.length - 1;\r\n if (isTruncated && r.d[n] === 0) ++r.d[n];\r\n break;\r\n }\r\n\r\n x = x.times(x);\r\n truncate(x.d, k);\r\n }\r\n\r\n external = true;\r\n\r\n return r;\r\n}\r\n\r\n\r\nfunction isOdd(n) {\r\n return n.d[n.d.length - 1] & 1;\r\n}\r\n\r\n\r\n/*\r\n * Handle `max` and `min`. `ltgt` is 'lt' or 'gt'.\r\n */\r\nfunction maxOrMin(Ctor, args, ltgt) {\r\n var y,\r\n x = new Ctor(args[0]),\r\n i = 0;\r\n\r\n for (; ++i < args.length;) {\r\n y = new Ctor(args[i]);\r\n if (!y.s) {\r\n x = y;\r\n break;\r\n } else if (x[ltgt](y)) {\r\n x = y;\r\n }\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of `x` rounded to `sd` significant\r\n * digits.\r\n *\r\n * Taylor/Maclaurin series.\r\n *\r\n * exp(x) = x^0/0! + x^1/1! + x^2/2! + x^3/3! + ...\r\n *\r\n * Argument reduction:\r\n * Repeat x = x / 32, k += 5, until |x| < 0.1\r\n * exp(x) = exp(x / 2^k)^(2^k)\r\n *\r\n * Previously, the argument was initially reduced by\r\n * exp(x) = exp(r) * 10^k where r = x - k * ln10, k = floor(x / ln10)\r\n * to first put r in the range [0, ln10], before dividing by 32 until |x| < 0.1, but this was\r\n * found to be slower than just dividing repeatedly by 32 as above.\r\n *\r\n * Max integer argument: exp('20723265836946413') = 6.3e+9000000000000000\r\n * Min integer argument: exp('-20723265836946411') = 1.2e-9000000000000000\r\n * (Math object integer min/max: Math.exp(709) = 8.2e+307, Math.exp(-745) = 5e-324)\r\n *\r\n * exp(Infinity) = Infinity\r\n * exp(-Infinity) = 0\r\n * exp(NaN) = NaN\r\n * exp(±0) = 1\r\n *\r\n * exp(x) is non-terminating for any finite, non-zero x.\r\n *\r\n * The result will always be correctly rounded.\r\n *\r\n */\r\nfunction naturalExponential(x, sd) {\r\n var denominator, guard, j, pow, sum, t, wpr,\r\n rep = 0,\r\n i = 0,\r\n k = 0,\r\n Ctor = x.constructor,\r\n rm = Ctor.rounding,\r\n pr = Ctor.precision;\r\n\r\n // 0/NaN/Infinity?\r\n if (!x.d || !x.d[0] || x.e > 17) {\r\n\r\n return new Ctor(x.d\r\n ? !x.d[0] ? 1 : x.s < 0 ? 0 : 1 / 0\r\n : x.s ? x.s < 0 ? 0 : x : 0 / 0);\r\n }\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n t = new Ctor(0.03125);\r\n\r\n // while abs(x) >= 0.1\r\n while (x.e > -2) {\r\n\r\n // x = x / 2^5\r\n x = x.times(t);\r\n k += 5;\r\n }\r\n\r\n // Use 2 * log10(2^k) + 5 (empirically derived) to estimate the increase in precision\r\n // necessary to ensure the first 4 rounding digits are correct.\r\n guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0;\r\n wpr += guard;\r\n denominator = pow = sum = new Ctor(1);\r\n Ctor.precision = wpr;\r\n\r\n for (;;) {\r\n pow = finalise(pow.times(x), wpr, 1);\r\n denominator = denominator.times(++i);\r\n t = sum.plus(divide(pow, denominator, wpr, 1));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n j = k;\r\n while (j--) sum = finalise(sum.times(sum), wpr, 1);\r\n\r\n // Check to see if the first 4 rounding digits are [49]999.\r\n // If so, repeat the summation with a higher precision, otherwise\r\n // e.g. with precision: 18, rounding: 1\r\n // exp(18.404272462595034083567793919843761) = 98372560.1229999999 (should be 98372560.123)\r\n // `wpr - guard` is the index of first rounding digit.\r\n if (sd == null) {\r\n\r\n if (rep < 3 && checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {\r\n Ctor.precision = wpr += 10;\r\n denominator = pow = t = new Ctor(1);\r\n i = 0;\r\n rep++;\r\n } else {\r\n return finalise(sum, Ctor.precision = pr, rm, external = true);\r\n }\r\n } else {\r\n Ctor.precision = pr;\r\n return sum;\r\n }\r\n }\r\n\r\n sum = t;\r\n }\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of `x` rounded to `sd` significant\r\n * digits.\r\n *\r\n * ln(-n) = NaN\r\n * ln(0) = -Infinity\r\n * ln(-0) = -Infinity\r\n * ln(1) = 0\r\n * ln(Infinity) = Infinity\r\n * ln(-Infinity) = NaN\r\n * ln(NaN) = NaN\r\n *\r\n * ln(n) (n != 1) is non-terminating.\r\n *\r\n */\r\nfunction naturalLogarithm(y, sd) {\r\n var c, c0, denominator, e, numerator, rep, sum, t, wpr, x1, x2,\r\n n = 1,\r\n guard = 10,\r\n x = y,\r\n xd = x.d,\r\n Ctor = x.constructor,\r\n rm = Ctor.rounding,\r\n pr = Ctor.precision;\r\n\r\n // Is x negative or Infinity, NaN, 0 or 1?\r\n if (x.s < 0 || !xd || !xd[0] || !x.e && xd[0] == 1 && xd.length == 1) {\r\n return new Ctor(xd && !xd[0] ? -1 / 0 : x.s != 1 ? NaN : xd ? 0 : x);\r\n }\r\n\r\n if (sd == null) {\r\n external = false;\r\n wpr = pr;\r\n } else {\r\n wpr = sd;\r\n }\r\n\r\n Ctor.precision = wpr += guard;\r\n c = digitsToString(xd);\r\n c0 = c.charAt(0);\r\n\r\n if (Math.abs(e = x.e) < 1.5e15) {\r\n\r\n // Argument reduction.\r\n // The series converges faster the closer the argument is to 1, so using\r\n // ln(a^b) = b * ln(a), ln(a) = ln(a^b) / b\r\n // multiply the argument by itself until the leading digits of the significand are 7, 8, 9,\r\n // 10, 11, 12 or 13, recording the number of multiplications so the sum of the series can\r\n // later be divided by this number, then separate out the power of 10 using\r\n // ln(a*10^b) = ln(a) + b*ln(10).\r\n\r\n // max n is 21 (gives 0.9, 1.0 or 1.1) (9e15 / 21 = 4.2e14).\r\n //while (c0 < 9 && c0 != 1 || c0 == 1 && c.charAt(1) > 1) {\r\n // max n is 6 (gives 0.7 - 1.3)\r\n while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) {\r\n x = x.times(y);\r\n c = digitsToString(x.d);\r\n c0 = c.charAt(0);\r\n n++;\r\n }\r\n\r\n e = x.e;\r\n\r\n if (c0 > 1) {\r\n x = new Ctor('0.' + c);\r\n e++;\r\n } else {\r\n x = new Ctor(c0 + '.' + c.slice(1));\r\n }\r\n } else {\r\n\r\n // The argument reduction method above may result in overflow if the argument y is a massive\r\n // number with exponent >= 1500000000000000 (9e15 / 6 = 1.5e15), so instead recall this\r\n // function using ln(x*10^e) = ln(x) + e*ln(10).\r\n t = getLn10(Ctor, wpr + 2, pr).times(e + '');\r\n x = naturalLogarithm(new Ctor(c0 + '.' + c.slice(1)), wpr - guard).plus(t);\r\n Ctor.precision = pr;\r\n\r\n return sd == null ? finalise(x, pr, rm, external = true) : x;\r\n }\r\n\r\n // x1 is x reduced to a value near 1.\r\n x1 = x;\r\n\r\n // Taylor series.\r\n // ln(y) = ln((1 + x)/(1 - x)) = 2(x + x^3/3 + x^5/5 + x^7/7 + ...)\r\n // where x = (y - 1)/(y + 1) (|x| < 1)\r\n sum = numerator = x = divide(x.minus(1), x.plus(1), wpr, 1);\r\n x2 = finalise(x.times(x), wpr, 1);\r\n denominator = 3;\r\n\r\n for (;;) {\r\n numerator = finalise(numerator.times(x2), wpr, 1);\r\n t = sum.plus(divide(numerator, new Ctor(denominator), wpr, 1));\r\n\r\n if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {\r\n sum = sum.times(2);\r\n\r\n // Reverse the argument reduction. Check that e is not 0 because, besides preventing an\r\n // unnecessary calculation, -0 + 0 = +0 and to ensure correct rounding -0 needs to stay -0.\r\n if (e !== 0) sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + ''));\r\n sum = divide(sum, new Ctor(n), wpr, 1);\r\n\r\n // Is rm > 3 and the first 4 rounding digits 4999, or rm < 4 (or the summation has\r\n // been repeated previously) and the first 4 rounding digits 9999?\r\n // If so, restart the summation with a higher precision, otherwise\r\n // e.g. with precision: 12, rounding: 1\r\n // ln(135520028.6126091714265381533) = 18.7246299999 when it should be 18.72463.\r\n // `wpr - guard` is the index of first rounding digit.\r\n if (sd == null) {\r\n if (checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {\r\n Ctor.precision = wpr += guard;\r\n t = numerator = x = divide(x1.minus(1), x1.plus(1), wpr, 1);\r\n x2 = finalise(x.times(x), wpr, 1);\r\n denominator = rep = 1;\r\n } else {\r\n return finalise(sum, Ctor.precision = pr, rm, external = true);\r\n }\r\n } else {\r\n Ctor.precision = pr;\r\n return sum;\r\n }\r\n }\r\n\r\n sum = t;\r\n denominator += 2;\r\n }\r\n}\r\n\r\n\r\n// ±Infinity, NaN.\r\nfunction nonFiniteToString(x) {\r\n // Unsigned.\r\n return String(x.s * x.s / 0);\r\n}\r\n\r\n\r\n/*\r\n * Parse the value of a new Decimal `x` from string `str`.\r\n */\r\nfunction parseDecimal(x, str) {\r\n var e, i, len;\r\n\r\n // Decimal point?\r\n if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');\r\n\r\n // Exponential form?\r\n if ((i = str.search(/e/i)) > 0) {\r\n\r\n // Determine exponent.\r\n if (e < 0) e = i;\r\n e += +str.slice(i + 1);\r\n str = str.substring(0, i);\r\n } else if (e < 0) {\r\n\r\n // Integer.\r\n e = str.length;\r\n }\r\n\r\n // Determine leading zeros.\r\n for (i = 0; str.charCodeAt(i) === 48; i++);\r\n\r\n // Determine trailing zeros.\r\n for (len = str.length; str.charCodeAt(len - 1) === 48; --len);\r\n str = str.slice(i, len);\r\n\r\n if (str) {\r\n len -= i;\r\n x.e = e = e - i - 1;\r\n x.d = [];\r\n\r\n // Transform base\r\n\r\n // e is the base 10 exponent.\r\n // i is where to slice str to get the first word of the digits array.\r\n i = (e + 1) % LOG_BASE;\r\n if (e < 0) i += LOG_BASE;\r\n\r\n if (i < len) {\r\n if (i) x.d.push(+str.slice(0, i));\r\n for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));\r\n str = str.slice(i);\r\n i = LOG_BASE - str.length;\r\n } else {\r\n i -= len;\r\n }\r\n\r\n for (; i--;) str += '0';\r\n x.d.push(+str);\r\n\r\n if (external) {\r\n\r\n // Overflow?\r\n if (x.e > x.constructor.maxE) {\r\n\r\n // Infinity.\r\n x.d = null;\r\n x.e = NaN;\r\n\r\n // Underflow?\r\n } else if (x.e < x.constructor.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n // x.constructor.underflow = true;\r\n } // else x.constructor.underflow = false;\r\n }\r\n } else {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * Parse the value of a new Decimal `x` from a string `str`, which is not a decimal value.\r\n */\r\nfunction parseOther(x, str) {\r\n var base, Ctor, divisor, i, isFloat, len, p, xd, xe;\r\n\r\n if (str === 'Infinity' || str === 'NaN') {\r\n if (!+str) x.s = NaN;\r\n x.e = NaN;\r\n x.d = null;\r\n return x;\r\n }\r\n\r\n if (isHex.test(str)) {\r\n base = 16;\r\n str = str.toLowerCase();\r\n } else if (isBinary.test(str)) {\r\n base = 2;\r\n } else if (isOctal.test(str)) {\r\n base = 8;\r\n } else {\r\n throw Error(invalidArgument + str);\r\n }\r\n\r\n // Is there a binary exponent part?\r\n i = str.search(/p/i);\r\n\r\n if (i > 0) {\r\n p = +str.slice(i + 1);\r\n str = str.substring(2, i);\r\n } else {\r\n str = str.slice(2);\r\n }\r\n\r\n // Convert `str` as an integer then divide the result by `base` raised to a power such that the\r\n // fraction part will be restored.\r\n i = str.indexOf('.');\r\n isFloat = i >= 0;\r\n Ctor = x.constructor;\r\n\r\n if (isFloat) {\r\n str = str.replace('.', '');\r\n len = str.length;\r\n i = len - i;\r\n\r\n // log[10](16) = 1.2041... , log[10](88) = 1.9444....\r\n divisor = intPow(Ctor, new Ctor(base), i, i * 2);\r\n }\r\n\r\n xd = convertBase(str, base, BASE);\r\n xe = xd.length - 1;\r\n\r\n // Remove trailing zeros.\r\n for (i = xe; xd[i] === 0; --i) xd.pop();\r\n if (i < 0) return new Ctor(x.s * 0);\r\n x.e = getBase10Exponent(xd, xe);\r\n x.d = xd;\r\n external = false;\r\n\r\n // At what precision to perform the division to ensure exact conversion?\r\n // maxDecimalIntegerPartDigitCount = ceil(log[10](b) * otherBaseIntegerPartDigitCount)\r\n // log[10](2) = 0.30103, log[10](8) = 0.90309, log[10](16) = 1.20412\r\n // E.g. ceil(1.2 * 3) = 4, so up to 4 decimal digits are needed to represent 3 hex int digits.\r\n // maxDecimalFractionPartDigitCount = {Hex:4|Oct:3|Bin:1} * otherBaseFractionPartDigitCount\r\n // Therefore using 4 * the number of digits of str will always be enough.\r\n if (isFloat) x = divide(x, divisor, len * 4);\r\n\r\n // Multiply by the binary exponent part if present.\r\n if (p) x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p));\r\n external = true;\r\n\r\n return x;\r\n}\r\n\r\n\r\n/*\r\n * sin(x) = x - x^3/3! + x^5/5! - ...\r\n * |x| < pi/2\r\n *\r\n */\r\nfunction sine(Ctor, x) {\r\n var k,\r\n len = x.d.length;\r\n\r\n if (len < 3) return taylorSeries(Ctor, 2, x, x);\r\n\r\n // Argument reduction: sin(5x) = 16*sin^5(x) - 20*sin^3(x) + 5*sin(x)\r\n // i.e. sin(x) = 16*sin^5(x/5) - 20*sin^3(x/5) + 5*sin(x/5)\r\n // and sin(x) = sin(x/5)(5 + sin^2(x/5)(16sin^2(x/5) - 20))\r\n\r\n // Estimate the optimum number of times to use the argument reduction.\r\n k = 1.4 * Math.sqrt(len);\r\n k = k > 16 ? 16 : k | 0;\r\n\r\n x = x.times(1 / tinyPow(5, k));\r\n x = taylorSeries(Ctor, 2, x, x);\r\n\r\n // Reverse argument reduction\r\n var sin2_x,\r\n d5 = new Ctor(5),\r\n d16 = new Ctor(16),\r\n d20 = new Ctor(20);\r\n for (; k--;) {\r\n sin2_x = x.times(x);\r\n x = x.times(d5.plus(sin2_x.times(d16.times(sin2_x).minus(d20))));\r\n }\r\n\r\n return x;\r\n}\r\n\r\n\r\n// Calculate Taylor series for `cos`, `cosh`, `sin` and `sinh`.\r\nfunction taylorSeries(Ctor, n, x, y, isHyperbolic) {\r\n var j, t, u, x2,\r\n i = 1,\r\n pr = Ctor.precision,\r\n k = Math.ceil(pr / LOG_BASE);\r\n\r\n external = false;\r\n x2 = x.times(x);\r\n u = new Ctor(y);\r\n\r\n for (;;) {\r\n t = divide(u.times(x2), new Ctor(n++ * n++), pr, 1);\r\n u = isHyperbolic ? y.plus(t) : y.minus(t);\r\n y = divide(t.times(x2), new Ctor(n++ * n++), pr, 1);\r\n t = u.plus(y);\r\n\r\n if (t.d[k] !== void 0) {\r\n for (j = k; t.d[j] === u.d[j] && j--;);\r\n if (j == -1) break;\r\n }\r\n\r\n j = u;\r\n u = y;\r\n y = t;\r\n t = j;\r\n i++;\r\n }\r\n\r\n external = true;\r\n t.d.length = k + 1;\r\n\r\n return t;\r\n}\r\n\r\n\r\n// Exponent e must be positive and non-zero.\r\nfunction tinyPow(b, e) {\r\n var n = b;\r\n while (--e) n *= b;\r\n return n;\r\n}\r\n\r\n\r\n// Return the absolute value of `x` reduced to less than or equal to half pi.\r\nfunction toLessThanHalfPi(Ctor, x) {\r\n var t,\r\n isNeg = x.s < 0,\r\n pi = getPi(Ctor, Ctor.precision, 1),\r\n halfPi = pi.times(0.5);\r\n\r\n x = x.abs();\r\n\r\n if (x.lte(halfPi)) {\r\n quadrant = isNeg ? 4 : 1;\r\n return x;\r\n }\r\n\r\n t = x.divToInt(pi);\r\n\r\n if (t.isZero()) {\r\n quadrant = isNeg ? 3 : 2;\r\n } else {\r\n x = x.minus(t.times(pi));\r\n\r\n // 0 <= x < pi\r\n if (x.lte(halfPi)) {\r\n quadrant = isOdd(t) ? (isNeg ? 2 : 3) : (isNeg ? 4 : 1);\r\n return x;\r\n }\r\n\r\n quadrant = isOdd(t) ? (isNeg ? 1 : 4) : (isNeg ? 3 : 2);\r\n }\r\n\r\n return x.minus(pi).abs();\r\n}\r\n\r\n\r\n/*\r\n * Return the value of Decimal `x` as a string in base `baseOut`.\r\n *\r\n * If the optional `sd` argument is present include a binary exponent suffix.\r\n */\r\nfunction toStringBinary(x, baseOut, sd, rm) {\r\n var base, e, i, k, len, roundUp, str, xd, y,\r\n Ctor = x.constructor,\r\n isExp = sd !== void 0;\r\n\r\n if (isExp) {\r\n checkInt32(sd, 1, MAX_DIGITS);\r\n if (rm === void 0) rm = Ctor.rounding;\r\n else checkInt32(rm, 0, 8);\r\n } else {\r\n sd = Ctor.precision;\r\n rm = Ctor.rounding;\r\n }\r\n\r\n if (!x.isFinite()) {\r\n str = nonFiniteToString(x);\r\n } else {\r\n str = finiteToString(x);\r\n i = str.indexOf('.');\r\n\r\n // Use exponential notation according to `toExpPos` and `toExpNeg`? No, but if required:\r\n // maxBinaryExponent = floor((decimalExponent + 1) * log[2](10))\r\n // minBinaryExponent = floor(decimalExponent * log[2](10))\r\n // log[2](10) = 3.321928094887362347870319429489390175864\r\n\r\n if (isExp) {\r\n base = 2;\r\n if (baseOut == 16) {\r\n sd = sd * 4 - 3;\r\n } else if (baseOut == 8) {\r\n sd = sd * 3 - 2;\r\n }\r\n } else {\r\n base = baseOut;\r\n }\r\n\r\n // Convert the number as an integer then divide the result by its base raised to a power such\r\n // that the fraction part will be restored.\r\n\r\n // Non-integer.\r\n if (i >= 0) {\r\n str = str.replace('.', '');\r\n y = new Ctor(1);\r\n y.e = str.length - i;\r\n y.d = convertBase(finiteToString(y), 10, base);\r\n y.e = y.d.length;\r\n }\r\n\r\n xd = convertBase(str, 10, base);\r\n e = len = xd.length;\r\n\r\n // Remove trailing zeros.\r\n for (; xd[--len] == 0;) xd.pop();\r\n\r\n if (!xd[0]) {\r\n str = isExp ? '0p+0' : '0';\r\n } else {\r\n if (i < 0) {\r\n e--;\r\n } else {\r\n x = new Ctor(x);\r\n x.d = xd;\r\n x.e = e;\r\n x = divide(x, y, sd, rm, 0, base);\r\n xd = x.d;\r\n e = x.e;\r\n roundUp = inexact;\r\n }\r\n\r\n // The rounding digit, i.e. the digit after the digit that may be rounded up.\r\n i = xd[sd];\r\n k = base / 2;\r\n roundUp = roundUp || xd[sd + 1] !== void 0;\r\n\r\n roundUp = rm < 4\r\n ? (i !== void 0 || roundUp) && (rm === 0 || rm === (x.s < 0 ? 3 : 2))\r\n : i > k || i === k && (rm === 4 || roundUp || rm === 6 && xd[sd - 1] & 1 ||\r\n rm === (x.s < 0 ? 8 : 7));\r\n\r\n xd.length = sd;\r\n\r\n if (roundUp) {\r\n\r\n // Rounding up may mean the previous digit has to be rounded up and so on.\r\n for (; ++xd[--sd] > base - 1;) {\r\n xd[sd] = 0;\r\n if (!sd) {\r\n ++e;\r\n xd.unshift(1);\r\n }\r\n }\r\n }\r\n\r\n // Determine trailing zeros.\r\n for (len = xd.length; !xd[len - 1]; --len);\r\n\r\n // E.g. [4, 11, 15] becomes 4bf.\r\n for (i = 0, str = ''; i < len; i++) str += NUMERALS.charAt(xd[i]);\r\n\r\n // Add binary exponent suffix?\r\n if (isExp) {\r\n if (len > 1) {\r\n if (baseOut == 16 || baseOut == 8) {\r\n i = baseOut == 16 ? 4 : 3;\r\n for (--len; len % i; len++) str += '0';\r\n xd = convertBase(str, base, baseOut);\r\n for (len = xd.length; !xd[len - 1]; --len);\r\n\r\n // xd[0] will always be be 1\r\n for (i = 1, str = '1.'; i < len; i++) str += NUMERALS.charAt(xd[i]);\r\n } else {\r\n str = str.charAt(0) + '.' + str.slice(1);\r\n }\r\n }\r\n\r\n str = str + (e < 0 ? 'p' : 'p+') + e;\r\n } else if (e < 0) {\r\n for (; ++e;) str = '0' + str;\r\n str = '0.' + str;\r\n } else {\r\n if (++e > len) for (e -= len; e-- ;) str += '0';\r\n else if (e < len) str = str.slice(0, e) + '.' + str.slice(e);\r\n }\r\n }\r\n\r\n str = (baseOut == 16 ? '0x' : baseOut == 2 ? '0b' : baseOut == 8 ? '0o' : '') + str;\r\n }\r\n\r\n return x.s < 0 ? '-' + str : str;\r\n}\r\n\r\n\r\n// Does not strip trailing zeros.\r\nfunction truncate(arr, len) {\r\n if (arr.length > len) {\r\n arr.length = len;\r\n return true;\r\n }\r\n}\r\n\r\n\r\n// Decimal methods\r\n\r\n\r\n/*\r\n * abs\r\n * acos\r\n * acosh\r\n * add\r\n * asin\r\n * asinh\r\n * atan\r\n * atanh\r\n * atan2\r\n * cbrt\r\n * ceil\r\n * clone\r\n * config\r\n * cos\r\n * cosh\r\n * div\r\n * exp\r\n * floor\r\n * hypot\r\n * ln\r\n * log\r\n * log2\r\n * log10\r\n * max\r\n * min\r\n * mod\r\n * mul\r\n * pow\r\n * random\r\n * round\r\n * set\r\n * sign\r\n * sin\r\n * sinh\r\n * sqrt\r\n * sub\r\n * tan\r\n * tanh\r\n * trunc\r\n */\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the absolute value of `x`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction abs(x) {\r\n return new this(x).abs();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arccosine in radians of `x`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction acos(x) {\r\n return new this(x).acos();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic cosine of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction acosh(x) {\r\n return new this(x).acosh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sum of `x` and `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction add(x, y) {\r\n return new this(x).plus(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arcsine in radians of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction asin(x) {\r\n return new this(x).asin();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic sine of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction asinh(x) {\r\n return new this(x).asinh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent in radians of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction atan(x) {\r\n return new this(x).atan();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the inverse of the hyperbolic tangent of `x`, rounded to\r\n * `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction atanh(x) {\r\n return new this(x).atanh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the arctangent in radians of `y/x` in the range -pi to pi\r\n * (inclusive), rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * Domain: [-Infinity, Infinity]\r\n * Range: [-pi, pi]\r\n *\r\n * y {number|string|Decimal} The y-coordinate.\r\n * x {number|string|Decimal} The x-coordinate.\r\n *\r\n * atan2(±0, -0) = ±pi\r\n * atan2(±0, +0) = ±0\r\n * atan2(±0, -x) = ±pi for x > 0\r\n * atan2(±0, x) = ±0 for x > 0\r\n * atan2(-y, ±0) = -pi/2 for y > 0\r\n * atan2(y, ±0) = pi/2 for y > 0\r\n * atan2(±y, -Infinity) = ±pi for finite y > 0\r\n * atan2(±y, +Infinity) = ±0 for finite y > 0\r\n * atan2(±Infinity, x) = ±pi/2 for finite x\r\n * atan2(±Infinity, -Infinity) = ±3*pi/4\r\n * atan2(±Infinity, +Infinity) = ±pi/4\r\n * atan2(NaN, x) = NaN\r\n * atan2(y, NaN) = NaN\r\n *\r\n */\r\nfunction atan2(y, x) {\r\n y = new this(y);\r\n x = new this(x);\r\n var r,\r\n pr = this.precision,\r\n rm = this.rounding,\r\n wpr = pr + 4;\r\n\r\n // Either NaN\r\n if (!y.s || !x.s) {\r\n r = new this(NaN);\r\n\r\n // Both ±Infinity\r\n } else if (!y.d && !x.d) {\r\n r = getPi(this, wpr, 1).times(x.s > 0 ? 0.25 : 0.75);\r\n r.s = y.s;\r\n\r\n // x is ±Infinity or y is ±0\r\n } else if (!x.d || y.isZero()) {\r\n r = x.s < 0 ? getPi(this, pr, rm) : new this(0);\r\n r.s = y.s;\r\n\r\n // y is ±Infinity or x is ±0\r\n } else if (!y.d || x.isZero()) {\r\n r = getPi(this, wpr, 1).times(0.5);\r\n r.s = y.s;\r\n\r\n // Both non-zero and finite\r\n } else if (x.s < 0) {\r\n this.precision = wpr;\r\n this.rounding = 1;\r\n r = this.atan(divide(y, x, wpr, 1));\r\n x = getPi(this, wpr, 1);\r\n this.precision = pr;\r\n this.rounding = rm;\r\n r = y.s < 0 ? r.minus(x) : r.plus(x);\r\n } else {\r\n r = this.atan(divide(y, x, wpr, 1));\r\n }\r\n\r\n return r;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cube root of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction cbrt(x) {\r\n return new this(x).cbrt();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` rounded to an integer using `ROUND_CEIL`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction ceil(x) {\r\n return finalise(x = new this(x), x.e + 1, 2);\r\n}\r\n\r\n\r\n/*\r\n * Configure global settings for a Decimal constructor.\r\n *\r\n * `obj` is an object with one or more of the following properties,\r\n *\r\n * precision {number}\r\n * rounding {number}\r\n * toExpNeg {number}\r\n * toExpPos {number}\r\n * maxE {number}\r\n * minE {number}\r\n * modulo {number}\r\n * crypto {boolean|number}\r\n * defaults {true}\r\n *\r\n * E.g. Decimal.config({ precision: 20, rounding: 4 })\r\n *\r\n */\r\nfunction config(obj) {\r\n if (!obj || typeof obj !== 'object') throw Error(decimalError + 'Object expected');\r\n var i, p, v,\r\n useDefaults = obj.defaults === true,\r\n ps = [\r\n 'precision', 1, MAX_DIGITS,\r\n 'rounding', 0, 8,\r\n 'toExpNeg', -EXP_LIMIT, 0,\r\n 'toExpPos', 0, EXP_LIMIT,\r\n 'maxE', 0, EXP_LIMIT,\r\n 'minE', -EXP_LIMIT, 0,\r\n 'modulo', 0, 9\r\n ];\r\n\r\n for (i = 0; i < ps.length; i += 3) {\r\n if (p = ps[i], useDefaults) this[p] = DEFAULTS[p];\r\n if ((v = obj[p]) !== void 0) {\r\n if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v;\r\n else throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n }\r\n\r\n if (p = 'crypto', useDefaults) this[p] = DEFAULTS[p];\r\n if ((v = obj[p]) !== void 0) {\r\n if (v === true || v === false || v === 0 || v === 1) {\r\n if (v) {\r\n if (typeof crypto != 'undefined' && crypto &&\r\n (crypto.getRandomValues || crypto.randomBytes)) {\r\n this[p] = true;\r\n } else {\r\n throw Error(cryptoUnavailable);\r\n }\r\n } else {\r\n this[p] = false;\r\n }\r\n } else {\r\n throw Error(invalidArgument + p + ': ' + v);\r\n }\r\n }\r\n\r\n return this;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the cosine of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction cos(x) {\r\n return new this(x).cos();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic cosine of `x`, rounded to precision\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction cosh(x) {\r\n return new this(x).cosh();\r\n}\r\n\r\n\r\n/*\r\n * Create and return a Decimal constructor with the same configuration properties as this Decimal\r\n * constructor.\r\n *\r\n */\r\nfunction clone(obj) {\r\n var i, p, ps;\r\n\r\n /*\r\n * The Decimal constructor and exported function.\r\n * Return a new Decimal instance.\r\n *\r\n * v {number|string|Decimal} A numeric value.\r\n *\r\n */\r\n function Decimal(v) {\r\n var e, i, t,\r\n x = this;\r\n\r\n // Decimal called without new.\r\n if (!(x instanceof Decimal)) return new Decimal(v);\r\n\r\n // Retain a reference to this Decimal constructor, and shadow Decimal.prototype.constructor\r\n // which points to Object.\r\n x.constructor = Decimal;\r\n\r\n // Duplicate.\r\n if (v instanceof Decimal) {\r\n x.s = v.s;\r\n\r\n if (external) {\r\n if (!v.d || v.e > Decimal.maxE) {\r\n\r\n // Infinity.\r\n x.e = NaN;\r\n x.d = null;\r\n } else if (v.e < Decimal.minE) {\r\n\r\n // Zero.\r\n x.e = 0;\r\n x.d = [0];\r\n } else {\r\n x.e = v.e;\r\n x.d = v.d.slice();\r\n }\r\n } else {\r\n x.e = v.e;\r\n x.d = v.d ? v.d.slice() : v.d;\r\n }\r\n\r\n return;\r\n }\r\n\r\n t = typeof v;\r\n\r\n if (t === 'number') {\r\n if (v === 0) {\r\n x.s = 1 / v < 0 ? -1 : 1;\r\n x.e = 0;\r\n x.d = [0];\r\n return;\r\n }\r\n\r\n if (v < 0) {\r\n v = -v;\r\n x.s = -1;\r\n } else {\r\n x.s = 1;\r\n }\r\n\r\n // Fast path for small integers.\r\n if (v === ~~v && v < 1e7) {\r\n for (e = 0, i = v; i >= 10; i /= 10) e++;\r\n\r\n if (external) {\r\n if (e > Decimal.maxE) {\r\n x.e = NaN;\r\n x.d = null;\r\n } else if (e < Decimal.minE) {\r\n x.e = 0;\r\n x.d = [0];\r\n } else {\r\n x.e = e;\r\n x.d = [v];\r\n }\r\n } else {\r\n x.e = e;\r\n x.d = [v];\r\n }\r\n\r\n return;\r\n\r\n // Infinity, NaN.\r\n } else if (v * 0 !== 0) {\r\n if (!v) x.s = NaN;\r\n x.e = NaN;\r\n x.d = null;\r\n return;\r\n }\r\n\r\n return parseDecimal(x, v.toString());\r\n\r\n } else if (t !== 'string') {\r\n throw Error(invalidArgument + v);\r\n }\r\n\r\n // Minus sign?\r\n if ((i = v.charCodeAt(0)) === 45) {\r\n v = v.slice(1);\r\n x.s = -1;\r\n } else {\r\n // Plus sign?\r\n if (i === 43) v = v.slice(1);\r\n x.s = 1;\r\n }\r\n\r\n return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v);\r\n }\r\n\r\n Decimal.prototype = P;\r\n\r\n Decimal.ROUND_UP = 0;\r\n Decimal.ROUND_DOWN = 1;\r\n Decimal.ROUND_CEIL = 2;\r\n Decimal.ROUND_FLOOR = 3;\r\n Decimal.ROUND_HALF_UP = 4;\r\n Decimal.ROUND_HALF_DOWN = 5;\r\n Decimal.ROUND_HALF_EVEN = 6;\r\n Decimal.ROUND_HALF_CEIL = 7;\r\n Decimal.ROUND_HALF_FLOOR = 8;\r\n Decimal.EUCLID = 9;\r\n\r\n Decimal.config = Decimal.set = config;\r\n Decimal.clone = clone;\r\n Decimal.isDecimal = isDecimalInstance;\r\n\r\n Decimal.abs = abs;\r\n Decimal.acos = acos;\r\n Decimal.acosh = acosh; // ES6\r\n Decimal.add = add;\r\n Decimal.asin = asin;\r\n Decimal.asinh = asinh; // ES6\r\n Decimal.atan = atan;\r\n Decimal.atanh = atanh; // ES6\r\n Decimal.atan2 = atan2;\r\n Decimal.cbrt = cbrt; // ES6\r\n Decimal.ceil = ceil;\r\n Decimal.cos = cos;\r\n Decimal.cosh = cosh; // ES6\r\n Decimal.div = div;\r\n Decimal.exp = exp;\r\n Decimal.floor = floor;\r\n Decimal.hypot = hypot; // ES6\r\n Decimal.ln = ln;\r\n Decimal.log = log;\r\n Decimal.log10 = log10; // ES6\r\n Decimal.log2 = log2; // ES6\r\n Decimal.max = max;\r\n Decimal.min = min;\r\n Decimal.mod = mod;\r\n Decimal.mul = mul;\r\n Decimal.pow = pow;\r\n Decimal.random = random;\r\n Decimal.round = round;\r\n Decimal.sign = sign; // ES6\r\n Decimal.sin = sin;\r\n Decimal.sinh = sinh; // ES6\r\n Decimal.sqrt = sqrt;\r\n Decimal.sub = sub;\r\n Decimal.tan = tan;\r\n Decimal.tanh = tanh; // ES6\r\n Decimal.trunc = trunc; // ES6\r\n\r\n if (obj === void 0) obj = {};\r\n if (obj) {\r\n if (obj.defaults !== true) {\r\n ps = ['precision', 'rounding', 'toExpNeg', 'toExpPos', 'maxE', 'minE', 'modulo', 'crypto'];\r\n for (i = 0; i < ps.length;) if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p];\r\n }\r\n }\r\n\r\n Decimal.config(obj);\r\n\r\n return Decimal;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` divided by `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction div(x, y) {\r\n return new this(x).div(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural exponential of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} The power to which to raise the base of the natural log.\r\n *\r\n */\r\nfunction exp(x) {\r\n return new this(x).exp();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` round to an integer using `ROUND_FLOOR`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction floor(x) {\r\n return finalise(x = new this(x), x.e + 1, 3);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of the sum of the squares of the arguments,\r\n * rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * hypot(a, b, ...) = sqrt(a^2 + b^2 + ...)\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\nfunction hypot() {\r\n var i, n,\r\n t = new this(0);\r\n\r\n external = false;\r\n\r\n for (i = 0; i < arguments.length;) {\r\n n = new this(arguments[i++]);\r\n if (!n.d) {\r\n if (n.s) {\r\n external = true;\r\n return new this(1 / 0);\r\n }\r\n t = n;\r\n } else if (t.d) {\r\n t = t.plus(n.times(n));\r\n }\r\n }\r\n\r\n external = true;\r\n\r\n return t.sqrt();\r\n}\r\n\r\n\r\n/*\r\n * Return true if object is a Decimal instance (where Decimal is any Decimal constructor),\r\n * otherwise return false.\r\n *\r\n */\r\nfunction isDecimalInstance(obj) {\r\n return obj instanceof Decimal || obj && obj.name === '[object Decimal]' || false;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the natural logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction ln(x) {\r\n return new this(x).ln();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the log of `x` to the base `y`, or to base 10 if no base\r\n * is specified, rounded to `precision` significant digits using rounding mode `rounding`.\r\n *\r\n * log[y](x)\r\n *\r\n * x {number|string|Decimal} The argument of the logarithm.\r\n * y {number|string|Decimal} The base of the logarithm.\r\n *\r\n */\r\nfunction log(x, y) {\r\n return new this(x).log(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the base 2 logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction log2(x) {\r\n return new this(x).log(2);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the base 10 logarithm of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction log10(x) {\r\n return new this(x).log(10);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the maximum of the arguments.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\nfunction max() {\r\n return maxOrMin(this, arguments, 'lt');\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the minimum of the arguments.\r\n *\r\n * arguments {number|string|Decimal}\r\n *\r\n */\r\nfunction min() {\r\n return maxOrMin(this, arguments, 'gt');\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` modulo `y`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction mod(x, y) {\r\n return new this(x).mod(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` multiplied by `y`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction mul(x, y) {\r\n return new this(x).mul(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` raised to the power `y`, rounded to precision\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} The base.\r\n * y {number|string|Decimal} The exponent.\r\n *\r\n */\r\nfunction pow(x, y) {\r\n return new this(x).pow(y);\r\n}\r\n\r\n\r\n/*\r\n * Returns a new Decimal with a random value equal to or greater than 0 and less than 1, and with\r\n * `sd`, or `Decimal.precision` if `sd` is omitted, significant digits (or less if trailing zeros\r\n * are produced).\r\n *\r\n * [sd] {number} Significant digits. Integer, 0 to MAX_DIGITS inclusive.\r\n *\r\n */\r\nfunction random(sd) {\r\n var d, e, k, n,\r\n i = 0,\r\n r = new this(1),\r\n rd = [];\r\n\r\n if (sd === void 0) sd = this.precision;\r\n else checkInt32(sd, 1, MAX_DIGITS);\r\n\r\n k = Math.ceil(sd / LOG_BASE);\r\n\r\n if (!this.crypto) {\r\n for (; i < k;) rd[i++] = Math.random() * 1e7 | 0;\r\n\r\n // Browsers supporting crypto.getRandomValues.\r\n } else if (crypto.getRandomValues) {\r\n d = crypto.getRandomValues(new Uint32Array(k));\r\n\r\n for (; i < k;) {\r\n n = d[i];\r\n\r\n // 0 <= n < 4294967296\r\n // Probability n >= 4.29e9, is 4967296 / 4294967296 = 0.00116 (1 in 865).\r\n if (n >= 4.29e9) {\r\n d[i] = crypto.getRandomValues(new Uint32Array(1))[0];\r\n } else {\r\n\r\n // 0 <= n <= 4289999999\r\n // 0 <= (n % 1e7) <= 9999999\r\n rd[i++] = n % 1e7;\r\n }\r\n }\r\n\r\n // Node.js supporting crypto.randomBytes.\r\n } else if (crypto.randomBytes) {\r\n\r\n // buffer\r\n d = crypto.randomBytes(k *= 4);\r\n\r\n for (; i < k;) {\r\n\r\n // 0 <= n < 2147483648\r\n n = d[i] + (d[i + 1] << 8) + (d[i + 2] << 16) + ((d[i + 3] & 0x7f) << 24);\r\n\r\n // Probability n >= 2.14e9, is 7483648 / 2147483648 = 0.0035 (1 in 286).\r\n if (n >= 2.14e9) {\r\n crypto.randomBytes(4).copy(d, i);\r\n } else {\r\n\r\n // 0 <= n <= 2139999999\r\n // 0 <= (n % 1e7) <= 9999999\r\n rd.push(n % 1e7);\r\n i += 4;\r\n }\r\n }\r\n\r\n i = k / 4;\r\n } else {\r\n throw Error(cryptoUnavailable);\r\n }\r\n\r\n k = rd[--i];\r\n sd %= LOG_BASE;\r\n\r\n // Convert trailing digits to zeros according to sd.\r\n if (k && sd) {\r\n n = mathpow(10, LOG_BASE - sd);\r\n rd[i] = (k / n | 0) * n;\r\n }\r\n\r\n // Remove trailing words which are zero.\r\n for (; rd[i] === 0; i--) rd.pop();\r\n\r\n // Zero?\r\n if (i < 0) {\r\n e = 0;\r\n rd = [0];\r\n } else {\r\n e = -1;\r\n\r\n // Remove leading words which are zero and adjust exponent accordingly.\r\n for (; rd[0] === 0; e -= LOG_BASE) rd.shift();\r\n\r\n // Count the digits of the first word of rd to determine leading zeros.\r\n for (k = 1, n = rd[0]; n >= 10; n /= 10) k++;\r\n\r\n // Adjust the exponent for leading zeros of the first word of rd.\r\n if (k < LOG_BASE) e -= LOG_BASE - k;\r\n }\r\n\r\n r.e = e;\r\n r.d = rd;\r\n\r\n return r;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` rounded to an integer using rounding mode `rounding`.\r\n *\r\n * To emulate `Math.round`, set rounding to 7 (ROUND_HALF_CEIL).\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction round(x) {\r\n return finalise(x = new this(x), x.e + 1, this.rounding);\r\n}\r\n\r\n\r\n/*\r\n * Return\r\n * 1 if x > 0,\r\n * -1 if x < 0,\r\n * 0 if x is 0,\r\n * -0 if x is -0,\r\n * NaN otherwise\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction sign(x) {\r\n x = new this(x);\r\n return x.d ? (x.d[0] ? x.s : 0 * x.s) : x.s || NaN;\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the sine of `x`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction sin(x) {\r\n return new this(x).sin();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic sine of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction sinh(x) {\r\n return new this(x).sinh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the square root of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction sqrt(x) {\r\n return new this(x).sqrt();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` minus `y`, rounded to `precision` significant digits\r\n * using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal}\r\n * y {number|string|Decimal}\r\n *\r\n */\r\nfunction sub(x, y) {\r\n return new this(x).sub(y);\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the tangent of `x`, rounded to `precision` significant\r\n * digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction tan(x) {\r\n return new this(x).tan();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is the hyperbolic tangent of `x`, rounded to `precision`\r\n * significant digits using rounding mode `rounding`.\r\n *\r\n * x {number|string|Decimal} A value in radians.\r\n *\r\n */\r\nfunction tanh(x) {\r\n return new this(x).tanh();\r\n}\r\n\r\n\r\n/*\r\n * Return a new Decimal whose value is `x` truncated to an integer.\r\n *\r\n * x {number|string|Decimal}\r\n *\r\n */\r\nfunction trunc(x) {\r\n return finalise(x = new this(x), x.e + 1, 1);\r\n}\r\n\r\n\r\nP[Symbol.for('nodejs.util.inspect.custom')] = P.toString;\r\nP[Symbol.toStringTag] = 'Decimal';\r\n\r\n// Create and configure initial Decimal constructor.\r\nexport var Decimal = clone(DEFAULTS);\r\n\r\n// Create the internal constants from their string values.\r\nLN10 = new Decimal(LN10);\r\nPI = new Decimal(PI);\r\n\r\nexport default Decimal;\r\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgSend = void 0;\nvar Coins_1 = require(\"../../Coins\");\nvar json_1 = require(\"../../../util/json\");\n/**\n * A basic message for sending [[Coins]] between Terra accounts.\n */\nvar MsgSend = /** @class */ (function (_super) {\n __extends(MsgSend, _super);\n /**\n * @param from_address sender's address\n * @param to_address recipient's address\n * @param amount value of the transaction\n */\n function MsgSend(from_address, to_address, amount) {\n var _this = _super.call(this) || this;\n _this.from_address = from_address;\n _this.to_address = to_address;\n _this.amount = new Coins_1.Coins(amount);\n return _this;\n }\n MsgSend.fromData = function (data) {\n var _a = data.value, from_address = _a.from_address, to_address = _a.to_address, amount = _a.amount;\n return new MsgSend(from_address, to_address, Coins_1.Coins.fromData(amount));\n };\n MsgSend.prototype.toData = function () {\n var _a = this, from_address = _a.from_address, to_address = _a.to_address, amount = _a.amount;\n return {\n type: 'bank/MsgSend',\n value: {\n from_address: from_address,\n to_address: to_address,\n amount: amount.toData(),\n },\n };\n };\n return MsgSend;\n}(json_1.JSONSerializable));\nexports.MsgSend = MsgSend;\n//# sourceMappingURL=MsgSend.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgMultiSend = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar Coins_1 = require(\"../../Coins\");\n/**\n * If you have multiple senders and/or multiple recipients, you can use MsgMultiSend,\n * which can batch together the senders and recipients in one message to save on gas\n * fees.\n *\n * Specify the senders and recipients and their corresponding deposit contribution /\n * receiving amounts with [[MsgMultiSend.Input]] or [[MsgMultiSend.Output]].\n *\n * Example:\n *\n * ```ts\n * import { MsgMultiSend } from \"@terra-money/terra.js\";\n *\n * const inputs: MsgMultiSend.Input[] = [\n * new MsgMultiSend.Input(\n * 'terra105rz2q5a4w7nv7239tl9c4px5cjy7axx3axf6p',\n * {\n * ukrw: 123123,\n * })\n * ),\n * new MsgMultiSend.Input('terra105rz2q5a4w7nv7239tl9c4px5cjy7axx3axfad', [\n * new Coin('uluna', 123123),\n * ]),\n * ];\n * const outputs: MsgMultiSend.Output[] = [\n * new MsgMultiSend.Output(\n * 'terra105rz2q5a4w7nv7239tl9c4px5cjy7axx3axfad',\n * {\n * ukrw: 123123,\n * }\n * ),\n * new MsgMultiSend.Output('terra105rz2q5a4w7nv7239tl9c4px5cjy7axx3axfga',\n * {\n * uluna: 123123,\n * }\n * ),\n * ];\n * const multisend = new MsgMultiSend(inputs, outputs);\n * ```\n */\nvar MsgMultiSend = /** @class */ (function (_super) {\n __extends(MsgMultiSend, _super);\n /**\n * @param inputs inputs\n * @param outputs outputs\n */\n function MsgMultiSend(inputs, outputs) {\n var _this = _super.call(this) || this;\n _this.inputs = inputs;\n _this.outputs = outputs;\n return _this;\n }\n MsgMultiSend.fromData = function (data) {\n var _a = data.value, inputs = _a.inputs, outputs = _a.outputs;\n return new MsgMultiSend(inputs.map(function (i) { return MsgMultiSend.Input.fromData(i); }), outputs.map(function (o) { return MsgMultiSend.Output.fromData(o); }));\n };\n MsgMultiSend.prototype.toData = function () {\n var _a = this, inputs = _a.inputs, outputs = _a.outputs;\n return {\n type: 'bank/MsgMultiSend',\n value: {\n inputs: inputs.map(function (i) { return i.toData(); }),\n outputs: outputs.map(function (o) { return o.toData(); }),\n },\n };\n };\n return MsgMultiSend;\n}(json_1.JSONSerializable));\nexports.MsgMultiSend = MsgMultiSend;\n(function (MsgMultiSend) {\n var IO = /** @class */ (function (_super) {\n __extends(IO, _super);\n /**\n * @param address address\n * @param coinsInput coins-compatible input\n */\n function IO(address, coinsInput) {\n var _this = _super.call(this) || this;\n _this.address = address;\n _this.coins = new Coins_1.Coins(coinsInput);\n return _this;\n }\n IO.prototype.toData = function () {\n var _a = this, address = _a.address, coins = _a.coins;\n return {\n address: address,\n coins: coins.toData(),\n };\n };\n IO.fromData = function (data) {\n var address = data.address, coins = data.coins;\n return new IO(address, Coins_1.Coins.fromData(coins));\n };\n return IO;\n }(json_1.JSONSerializable));\n MsgMultiSend.IO = IO;\n MsgMultiSend.Input = IO;\n MsgMultiSend.Output = IO;\n})(MsgMultiSend = exports.MsgMultiSend || (exports.MsgMultiSend = {}));\nexports.MsgMultiSend = MsgMultiSend;\n//# sourceMappingURL=MsgMultiSend.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgModifyWithdrawAddress = void 0;\nvar json_1 = require(\"../../../util/json\");\n/**\n * A validator can withdraw their outstanding commission rewards accrued from all\n * delegations (not including its self-delegation) into their associated account's\n * withdraw address.\n */\nvar MsgModifyWithdrawAddress = /** @class */ (function (_super) {\n __extends(MsgModifyWithdrawAddress, _super);\n /**\n * @param delegator_address delegator's account address\n * @param withdraw_address desired new withdraw address\n */\n function MsgModifyWithdrawAddress(delegator_address, withdraw_address) {\n var _this = _super.call(this) || this;\n _this.delegator_address = delegator_address;\n _this.withdraw_address = withdraw_address;\n return _this;\n }\n MsgModifyWithdrawAddress.fromData = function (data) {\n var _a = data.value, delegator_address = _a.delegator_address, withdraw_address = _a.withdraw_address;\n return new MsgModifyWithdrawAddress(delegator_address, withdraw_address);\n };\n MsgModifyWithdrawAddress.prototype.toData = function () {\n var _a = this, delegator_address = _a.delegator_address, withdraw_address = _a.withdraw_address;\n return {\n type: 'distribution/MsgModifyWithdrawAddress',\n value: {\n delegator_address: delegator_address,\n withdraw_address: withdraw_address,\n },\n };\n };\n return MsgModifyWithdrawAddress;\n}(json_1.JSONSerializable));\nexports.MsgModifyWithdrawAddress = MsgModifyWithdrawAddress;\n//# sourceMappingURL=MsgModifyWithdrawAddress.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgWithdrawDelegationReward = void 0;\nvar json_1 = require(\"../../../util/json\");\n/**\n * A delegator can withdraw currently outstanding rewards accrued from their delegation\n * toward a validator by submitting the following message.\n *\n * The rewards will be deposited to their Withdraw Address.\n */\nvar MsgWithdrawDelegationReward = /** @class */ (function (_super) {\n __extends(MsgWithdrawDelegationReward, _super);\n /**\n *\n * @param delegator_address delegator's account address\n * @param validator_address validator's operator address\n */\n function MsgWithdrawDelegationReward(delegator_address, validator_address) {\n var _this = _super.call(this) || this;\n _this.delegator_address = delegator_address;\n _this.validator_address = validator_address;\n return _this;\n }\n MsgWithdrawDelegationReward.fromData = function (data) {\n var _a = data.value, delegator_address = _a.delegator_address, validator_address = _a.validator_address;\n return new MsgWithdrawDelegationReward(delegator_address, validator_address);\n };\n MsgWithdrawDelegationReward.prototype.toData = function () {\n var _a = this, delegator_address = _a.delegator_address, validator_address = _a.validator_address;\n return {\n type: 'distribution/MsgWithdrawDelegationReward',\n value: {\n delegator_address: delegator_address,\n validator_address: validator_address,\n },\n };\n };\n return MsgWithdrawDelegationReward;\n}(json_1.JSONSerializable));\nexports.MsgWithdrawDelegationReward = MsgWithdrawDelegationReward;\n//# sourceMappingURL=MsgWithdrawDelegationReward.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgWithdrawValidatorCommission = void 0;\nvar json_1 = require(\"../../../util/json\");\n/**\n * A validator can withdraw their outstanding commission rewards accrued from all\n * delegations (not including its self-delegation) into their associated account's\n * withdraw address.\n */\nvar MsgWithdrawValidatorCommission = /** @class */ (function (_super) {\n __extends(MsgWithdrawValidatorCommission, _super);\n /**\n * @param validator_address validator's operator address\n */\n function MsgWithdrawValidatorCommission(validator_address) {\n var _this = _super.call(this) || this;\n _this.validator_address = validator_address;\n return _this;\n }\n MsgWithdrawValidatorCommission.fromData = function (data) {\n var validator_address = data.value.validator_address;\n return new MsgWithdrawValidatorCommission(validator_address);\n };\n MsgWithdrawValidatorCommission.prototype.toData = function () {\n var validator_address = this.validator_address;\n return {\n type: 'distribution/MsgWithdrawValidatorCommission',\n value: {\n validator_address: validator_address,\n },\n };\n };\n return MsgWithdrawValidatorCommission;\n}(json_1.JSONSerializable));\nexports.MsgWithdrawValidatorCommission = MsgWithdrawValidatorCommission;\n//# sourceMappingURL=MsgWithdrawValidatorCommission.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgFundCommunityPool = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar Coins_1 = require(\"../../Coins\");\nvar MsgFundCommunityPool = /** @class */ (function (_super) {\n __extends(MsgFundCommunityPool, _super);\n /**\n * @param depositor depositor's account address\n * @param amount coins to fund the community pool\n */\n function MsgFundCommunityPool(depositor, amount) {\n var _this = _super.call(this) || this;\n _this.depositor = depositor;\n _this.amount = new Coins_1.Coins(amount);\n return _this;\n }\n MsgFundCommunityPool.fromData = function (data) {\n var _a = data.value, depositor = _a.depositor, amount = _a.amount;\n return new MsgFundCommunityPool(depositor, Coins_1.Coins.fromData(amount));\n };\n MsgFundCommunityPool.prototype.toData = function () {\n var _a = this, depositor = _a.depositor, amount = _a.amount;\n return {\n type: 'distribution/MsgFundCommunityPool',\n value: {\n depositor: depositor,\n amount: amount.toData(),\n },\n };\n };\n return MsgFundCommunityPool;\n}(json_1.JSONSerializable));\nexports.MsgFundCommunityPool = MsgFundCommunityPool;\n//# sourceMappingURL=MsgFundCommunityPool.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgDeposit = void 0;\nvar Coins_1 = require(\"../../Coins\");\nvar json_1 = require(\"../../../util/json\");\n/**\n * Add a deposit for a proposal\n */\nvar MsgDeposit = /** @class */ (function (_super) {\n __extends(MsgDeposit, _super);\n /**\n * @param proposal_id Id of porposal to deposit to\n * @param depositor depositor's account address\n * @param amount amount to deposit\n */\n function MsgDeposit(proposal_id, depositor, amount) {\n var _this = _super.call(this) || this;\n _this.proposal_id = proposal_id;\n _this.depositor = depositor;\n _this.amount = new Coins_1.Coins(amount);\n return _this;\n }\n MsgDeposit.fromData = function (data) {\n var _a = data.value, proposal_id = _a.proposal_id, depositor = _a.depositor, amount = _a.amount;\n return new MsgDeposit(Number.parseInt(proposal_id), depositor, Coins_1.Coins.fromData(amount));\n };\n MsgDeposit.prototype.toData = function () {\n var _a = this, proposal_id = _a.proposal_id, depositor = _a.depositor, amount = _a.amount;\n return {\n type: 'gov/MsgDeposit',\n value: {\n proposal_id: proposal_id.toString(),\n depositor: depositor,\n amount: amount.toData(),\n },\n };\n };\n return MsgDeposit;\n}(json_1.JSONSerializable));\nexports.MsgDeposit = MsgDeposit;\n//# sourceMappingURL=MsgDeposit.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgSubmitProposal = void 0;\nvar Coins_1 = require(\"../../Coins\");\nvar Proposal_1 = require(\"../../Proposal\");\nvar json_1 = require(\"../../../util/json\");\n/**\n * Submit a proposal alongside an initial deposit.\n */\nvar MsgSubmitProposal = /** @class */ (function (_super) {\n __extends(MsgSubmitProposal, _super);\n /**\n * @param content proposal content to submit\n * @param initial_deposit deposit provided\n * @param proposer proposer's account address\n */\n function MsgSubmitProposal(content, initial_deposit, proposer) {\n var _this = _super.call(this) || this;\n _this.content = content;\n _this.proposer = proposer;\n _this.initial_deposit = new Coins_1.Coins(initial_deposit);\n return _this;\n }\n MsgSubmitProposal.fromData = function (data) {\n var _a = data.value, content = _a.content, initial_deposit = _a.initial_deposit, proposer = _a.proposer;\n return new MsgSubmitProposal(Proposal_1.Proposal.Content.fromData(content), Coins_1.Coins.fromData(initial_deposit), proposer);\n };\n MsgSubmitProposal.prototype.toData = function () {\n var _a = this, content = _a.content, initial_deposit = _a.initial_deposit, proposer = _a.proposer;\n return {\n type: 'gov/MsgSubmitProposal',\n value: {\n content: content.toData(),\n initial_deposit: initial_deposit.toData(),\n proposer: proposer,\n },\n };\n };\n return MsgSubmitProposal;\n}(json_1.JSONSerializable));\nexports.MsgSubmitProposal = MsgSubmitProposal;\n//# sourceMappingURL=MsgSubmitProposal.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CommunityPoolSpendProposal = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar Coins_1 = require(\"../../Coins\");\n/**\n * Proposal that disburses funds from the Distribution module's community pool to the\n * specified recipient if passed.\n */\nvar CommunityPoolSpendProposal = /** @class */ (function (_super) {\n __extends(CommunityPoolSpendProposal, _super);\n /**\n * @param title proposal's title\n * @param description proposal's description\n * @param recipient recipient address\n * @param amount amount to give recipient\n */\n function CommunityPoolSpendProposal(title, description, recipient, amount) {\n var _this = _super.call(this) || this;\n _this.title = title;\n _this.description = description;\n _this.recipient = recipient;\n _this.amount = new Coins_1.Coins(amount);\n return _this;\n }\n CommunityPoolSpendProposal.fromData = function (data) {\n var _a = data.value, title = _a.title, description = _a.description, recipient = _a.recipient, amount = _a.amount;\n return new CommunityPoolSpendProposal(title, description, recipient, Coins_1.Coins.fromData(amount));\n };\n CommunityPoolSpendProposal.prototype.toData = function () {\n var _a = this, title = _a.title, description = _a.description, recipient = _a.recipient, amount = _a.amount;\n return {\n type: 'distribution/CommunityPoolSpendProposal',\n value: {\n title: title,\n description: description,\n recipient: recipient,\n amount: amount.toData(),\n },\n };\n };\n return CommunityPoolSpendProposal;\n}(json_1.JSONSerializable));\nexports.CommunityPoolSpendProposal = CommunityPoolSpendProposal;\n//# sourceMappingURL=CommunityPoolSpendProposal.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TextProposal = void 0;\nvar json_1 = require(\"../../../util/json\");\n/**\n * Basic proposal which describes the candidate proposition that must be put into effect\n * manually if passed. Used as a general-purpose way of discovering community's\n * sentiment / interest for an arbitrary change.\n */\nvar TextProposal = /** @class */ (function (_super) {\n __extends(TextProposal, _super);\n /**\n * @param title proposal's title\n * @param description proposal's description\n */\n function TextProposal(title, description) {\n var _this = _super.call(this) || this;\n _this.title = title;\n _this.description = description;\n return _this;\n }\n TextProposal.fromData = function (data) {\n var _a = data.value, title = _a.title, description = _a.description;\n return new TextProposal(title, description);\n };\n TextProposal.prototype.toData = function () {\n var _a = this, title = _a.title, description = _a.description;\n return {\n type: 'gov/TextProposal',\n value: {\n title: title,\n description: description,\n },\n };\n };\n return TextProposal;\n}(json_1.JSONSerializable));\nexports.TextProposal = TextProposal;\n//# sourceMappingURL=TextProposal.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RewardWeightUpdateProposal = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar numeric_1 = require(\"../../numeric\");\n/**\n * A proposal for a direct and immediate change to the treasury's reward weight state,\n * which governs staking and validator returns. If passed, the new reward weight is put\n * into effect immediately, after clamping.\n */\nvar RewardWeightUpdateProposal = /** @class */ (function (_super) {\n __extends(RewardWeightUpdateProposal, _super);\n /**\n *\n * @param title proposal's title\n * @param description proposal's description\n * @param reward_weight new proposed value for reward weight\n */\n function RewardWeightUpdateProposal(title, description, reward_weight) {\n var _this = _super.call(this) || this;\n _this.title = title;\n _this.description = description;\n _this.reward_weight = reward_weight;\n return _this;\n }\n RewardWeightUpdateProposal.fromData = function (data) {\n var _a = data.value, title = _a.title, description = _a.description, reward_weight = _a.reward_weight;\n return new RewardWeightUpdateProposal(title, description, new numeric_1.Dec(reward_weight));\n };\n RewardWeightUpdateProposal.prototype.toData = function () {\n var _a = this, title = _a.title, description = _a.description, reward_weight = _a.reward_weight;\n return {\n type: 'treasury/RewardWeightUpdateProposal',\n value: {\n title: title,\n description: description,\n reward_weight: reward_weight.toString(),\n },\n };\n };\n return RewardWeightUpdateProposal;\n}(json_1.JSONSerializable));\nexports.RewardWeightUpdateProposal = RewardWeightUpdateProposal;\n//# sourceMappingURL=RewardWeightUpdateProposal.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TaxRateUpdateProposal = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar numeric_1 = require(\"../../numeric\");\n/**\n * A proposal for a direct and immediate change to the treasury's tax rate state, which\n * governs transaction fees. If passed, the new tax rate is put into effect immediately,\n * after clamping.\n */\nvar TaxRateUpdateProposal = /** @class */ (function (_super) {\n __extends(TaxRateUpdateProposal, _super);\n /**\n * @param title proposal's title\n * @param description proposal's description\n * @param tax_rate new proposed value for tax rate.\n */\n function TaxRateUpdateProposal(title, description, tax_rate) {\n var _this = _super.call(this) || this;\n _this.title = title;\n _this.description = description;\n _this.tax_rate = tax_rate;\n return _this;\n }\n TaxRateUpdateProposal.fromData = function (data) {\n var _a = data.value, title = _a.title, description = _a.description, tax_rate = _a.tax_rate;\n return new TaxRateUpdateProposal(title, description, new numeric_1.Dec(tax_rate));\n };\n TaxRateUpdateProposal.prototype.toData = function () {\n var _a = this, title = _a.title, description = _a.description, tax_rate = _a.tax_rate;\n return {\n type: 'treasury/TaxRateUpdateProposal',\n value: {\n title: title,\n description: description,\n tax_rate: tax_rate.toString(),\n },\n };\n };\n return TaxRateUpdateProposal;\n}(json_1.JSONSerializable));\nexports.TaxRateUpdateProposal = TaxRateUpdateProposal;\n//# sourceMappingURL=TaxRateUpdateProposal.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ParameterChangeProposal = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar ParamChange_1 = require(\"../ParamChange\");\n/**\n * Describes a proposal for directly altering the value of the module parameters.\n * If you want to select a couple parameters to change for your proposal, you'll first\n * include the subspace (module it belongs to, such as \"oracle\" or \"distribution\"), and\n * then just the specific keys that you want to include in your changes as items in a\n * JavaScript object.\n *\n * ```ts\n * import {\n * Dec,\n * MsgSubmitProposal,\n * ParameterChangeProposal\n * } from \"@terra-money/terra.js\";\n *\n * const proposal = new ParameterChangeProposal(\"title\", \"description\", {\n * market: {\n * minspread: new Dec(0.25),\n * basepool: new Dec(10000000)\n * },\n * staking: {\n * UnbondingTime: 15000000\n * }\n * });\n *\n * const msg = new MsgSubmitProposal();\n * ```\n */\nvar ParameterChangeProposal = /** @class */ (function (_super) {\n __extends(ParameterChangeProposal, _super);\n /**\n * @param title proposal's title\n * @param description proposal's description\n * @param changes an object whose keys are subspace names, and whose values are objects\n * with objects having for keys and values, the desired parameter changes.\n */\n function ParameterChangeProposal(title, description, changes) {\n var _this = _super.call(this) || this;\n _this.title = title;\n _this.description = description;\n if (changes instanceof Array) {\n _this.changes = ParamChange_1.ParamChanges.fromData(changes);\n }\n else {\n _this.changes = changes;\n }\n return _this;\n }\n ParameterChangeProposal.fromData = function (data) {\n var _a = data.value, title = _a.title, description = _a.description, changes = _a.changes;\n return new ParameterChangeProposal(title, description, ParamChange_1.ParamChanges.fromData(changes));\n };\n ParameterChangeProposal.prototype.toData = function () {\n var _a = this, title = _a.title, description = _a.description, changes = _a.changes;\n return {\n type: 'params/ParameterChangeProposal',\n value: {\n title: title,\n description: description,\n changes: ParamChange_1.ParamChanges.toData(changes),\n },\n };\n };\n return ParameterChangeProposal;\n}(json_1.JSONSerializable));\nexports.ParameterChangeProposal = ParameterChangeProposal;\n//# sourceMappingURL=ParameterChangeProposal.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DistributionParamChanges = void 0;\nvar convert_1 = require(\"../../util/convert\");\nvar DistributionParamChanges;\n(function (DistributionParamChanges) {\n DistributionParamChanges.ConversionTable = {\n distribution: {\n communitytax: [convert_1.Convert.toDec, convert_1.Convert.toString],\n baseproposerreward: [convert_1.Convert.toDec, convert_1.Convert.toString],\n bonusproposerreward: [convert_1.Convert.toDec, convert_1.Convert.toString],\n withdrawaddrenabled: [convert_1.Convert.id, convert_1.Convert.id],\n },\n };\n})(DistributionParamChanges = exports.DistributionParamChanges || (exports.DistributionParamChanges = {}));\n//# sourceMappingURL=params.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GovParamChanges = void 0;\nvar convert_1 = require(\"../../util/convert\");\nvar GovParamChanges;\n(function (GovParamChanges) {\n GovParamChanges.ConversionTable = {\n gov: {\n depositparams: [convert_1.Convert.toDepositParams, convert_1.Convert.serializeDepositParams],\n votingparams: [convert_1.Convert.toVotingParams, convert_1.Convert.serializeVotingParams],\n tallyparams: [convert_1.Convert.toTallyParams, convert_1.Convert.serializeTallyParams],\n },\n };\n})(GovParamChanges = exports.GovParamChanges || (exports.GovParamChanges = {}));\n//# sourceMappingURL=params.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MarketParamChanges = void 0;\nvar convert_1 = require(\"../../util/convert\");\nvar MarketParamChanges;\n(function (MarketParamChanges) {\n MarketParamChanges.ConversionTable = {\n market: {\n poolrecoveryperiod: [convert_1.Convert.toNumber, convert_1.Convert.toFixed],\n basepool: [convert_1.Convert.toDec, convert_1.Convert.toString],\n minspread: [convert_1.Convert.toDec, convert_1.Convert.toString],\n },\n };\n})(MarketParamChanges = exports.MarketParamChanges || (exports.MarketParamChanges = {}));\n//# sourceMappingURL=params.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OracleParamChanges = void 0;\nvar convert_1 = require(\"../../util/convert\");\nvar OracleParamChanges;\n(function (OracleParamChanges) {\n OracleParamChanges.ConversionTable = {\n oracle: {\n voteperiod: [convert_1.Convert.toNumber, convert_1.Convert.toFixed],\n votethreshold: [convert_1.Convert.toDec, convert_1.Convert.toString],\n rewardband: [convert_1.Convert.toDec, convert_1.Convert.toString],\n rewarddistributionwindow: [convert_1.Convert.toNumber, convert_1.Convert.toFixed],\n whitelist: [convert_1.Convert.toOracleWhitelist, convert_1.Convert.serializeOracleWhitelist],\n slashfraction: [convert_1.Convert.toDec, convert_1.Convert.toString],\n slashwindow: [convert_1.Convert.toNumber, convert_1.Convert.toFixed],\n minvalidperwindow: [convert_1.Convert.toDec, convert_1.Convert.toString],\n },\n };\n})(OracleParamChanges = exports.OracleParamChanges || (exports.OracleParamChanges = {}));\n//# sourceMappingURL=params.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SlashingParamChanges = void 0;\nvar convert_1 = require(\"../../util/convert\");\nvar SlashingParamChanges;\n(function (SlashingParamChanges) {\n SlashingParamChanges.ConversionTable = {\n slashing: {\n MaxEvidenceAge: [convert_1.Convert.toNumber, convert_1.Convert.toFixed],\n SignedBlocksWindow: [convert_1.Convert.toNumber, convert_1.Convert.toFixed],\n MinSignedPerWindow: [convert_1.Convert.toDec, convert_1.Convert.toString],\n DowntimeJailDuration: [convert_1.Convert.toNumber, convert_1.Convert.toString],\n SlashFractionDoubleSign: [convert_1.Convert.toDec, convert_1.Convert.toString],\n SlashFractionDowntime: [convert_1.Convert.toDec, convert_1.Convert.toString],\n },\n };\n})(SlashingParamChanges = exports.SlashingParamChanges || (exports.SlashingParamChanges = {}));\n//# sourceMappingURL=params.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StakingParamChanges = void 0;\nvar convert_1 = require(\"../../util/convert\");\nvar StakingParamChanges;\n(function (StakingParamChanges) {\n StakingParamChanges.ConversionTable = {\n staking: {\n UnbondingTime: [convert_1.Convert.toNumber, convert_1.Convert.toFixed],\n MaxValidators: [convert_1.Convert.toNumber, convert_1.Convert.toNumber],\n KeyMaxEntries: [convert_1.Convert.toNumber, convert_1.Convert.toNumber],\n BondDenom: [convert_1.Convert.id, convert_1.Convert.id],\n },\n };\n})(StakingParamChanges = exports.StakingParamChanges || (exports.StakingParamChanges = {}));\n//# sourceMappingURL=params.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TreasuryParamChanges = void 0;\nvar convert_1 = require(\"../../util/convert\");\nvar TreasuryParamChanges;\n(function (TreasuryParamChanges) {\n TreasuryParamChanges.ConversionTable = {\n treasury: {\n taxpolicy: [convert_1.Convert.toPolicyConstraints, convert_1.Convert.toData],\n rewardpolicy: [convert_1.Convert.toPolicyConstraints, convert_1.Convert.toData],\n seigniorageburdentarget: [convert_1.Convert.toDec, convert_1.Convert.toString],\n miningincrement: [convert_1.Convert.toDec, convert_1.Convert.toString],\n windowshort: [convert_1.Convert.toNumber, convert_1.Convert.toFixed],\n windowlong: [convert_1.Convert.toNumber, convert_1.Convert.toFixed],\n windowprobation: [convert_1.Convert.toNumber, convert_1.Convert.toFixed],\n },\n };\n})(TreasuryParamChanges = exports.TreasuryParamChanges || (exports.TreasuryParamChanges = {}));\n//# sourceMappingURL=params.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WasmParamChanges = void 0;\nvar convert_1 = require(\"../../util/convert\");\nvar WasmParamChanges;\n(function (WasmParamChanges) {\n WasmParamChanges.ConversionTable = {\n wasm: {\n maxcontractsize: [convert_1.Convert.toNumber, convert_1.Convert.toFixed],\n maxcontractgas: [convert_1.Convert.toNumber, convert_1.Convert.toFixed],\n maxcontractmsgsize: [convert_1.Convert.toNumber, convert_1.Convert.toFixed],\n },\n };\n})(WasmParamChanges = exports.WasmParamChanges || (exports.WasmParamChanges = {}));\n//# sourceMappingURL=params.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MintParamChanges = void 0;\nvar convert_1 = require(\"../../util/convert\");\nvar MintParamChanges;\n(function (MintParamChanges) {\n MintParamChanges.ConversionTable = {\n mint: {\n MintDenom: [convert_1.Convert.id, convert_1.Convert.id],\n InflationRateChange: [convert_1.Convert.toDec, convert_1.Convert.toString],\n InflationMax: [convert_1.Convert.toDec, convert_1.Convert.toString],\n InflationMin: [convert_1.Convert.toDec, convert_1.Convert.toString],\n GoalBonded: [convert_1.Convert.toDec, convert_1.Convert.toString],\n BlocksPerYear: [convert_1.Convert.toNumber, convert_1.Convert.toFixed],\n },\n };\n})(MintParamChanges = exports.MintParamChanges || (exports.MintParamChanges = {}));\n//# sourceMappingURL=params.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgVote = void 0;\nvar json_1 = require(\"../../../util/json\");\n/**\n * Vote for a proposal\n */\nvar MsgVote = /** @class */ (function (_super) {\n __extends(MsgVote, _super);\n /**\n * @param proposal_id ID of proposal to vote on\n * @param voter voter's account address\n * @param option one of voting options\n */\n function MsgVote(proposal_id, voter, option) {\n var _this = _super.call(this) || this;\n _this.proposal_id = proposal_id;\n _this.voter = voter;\n _this.option = option;\n return _this;\n }\n MsgVote.fromData = function (data) {\n var _a = data.value, proposal_id = _a.proposal_id, voter = _a.voter, option = _a.option;\n return new MsgVote(Number.parseInt(proposal_id), voter, option);\n };\n MsgVote.prototype.toData = function () {\n var _a = this, proposal_id = _a.proposal_id, voter = _a.voter, option = _a.option;\n return {\n type: 'gov/MsgVote',\n value: {\n proposal_id: proposal_id.toFixed(),\n voter: voter,\n option: option,\n },\n };\n };\n return MsgVote;\n}(json_1.JSONSerializable));\nexports.MsgVote = MsgVote;\n(function (MsgVote) {\n /** Voting options */\n var Option;\n (function (Option) {\n /** - */\n Option[\"EMPTY\"] = \"Empty\";\n /** Vote yes */\n Option[\"YES\"] = \"Yes\";\n /** Do not vote */\n Option[\"ABSTAIN\"] = \"Abstain\";\n /** Vote no */\n Option[\"NO\"] = \"No\";\n /** Vote No with the option to veto if passed */\n Option[\"NO_WITH_VETO\"] = \"NoWithVeto\";\n })(Option = MsgVote.Option || (MsgVote.Option = {}));\n})(MsgVote = exports.MsgVote || (exports.MsgVote = {}));\nexports.MsgVote = MsgVote;\n//# sourceMappingURL=MsgVote.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgSwap = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar Coin_1 = require(\"../../Coin\");\n/**\n * Executes a market swap between 2 denominations at the exchange rate registered by the\n * Oracle module. The account will lose the amount of coins offered, and receive funds\n * in the requested denomination after a swap fee has been applied.\n */\nvar MsgSwap = /** @class */ (function (_super) {\n __extends(MsgSwap, _super);\n /**\n * @param trader trader's account address\n * @param offer_coin coin to be swapped (from)\n * @param ask_denom desired denomination (to)\n */\n function MsgSwap(trader, offer_coin, ask_denom) {\n var _this = _super.call(this) || this;\n _this.trader = trader;\n _this.offer_coin = offer_coin;\n _this.ask_denom = ask_denom;\n return _this;\n }\n MsgSwap.fromData = function (data) {\n var _a = data.value, trader = _a.trader, offer_coin = _a.offer_coin, ask_denom = _a.ask_denom;\n return new MsgSwap(trader, Coin_1.Coin.fromData(offer_coin), ask_denom);\n };\n MsgSwap.prototype.toData = function () {\n var _a = this, trader = _a.trader, offer_coin = _a.offer_coin, ask_denom = _a.ask_denom;\n return {\n type: 'market/MsgSwap',\n value: {\n trader: trader,\n offer_coin: offer_coin.toData(),\n ask_denom: ask_denom,\n },\n };\n };\n return MsgSwap;\n}(json_1.JSONSerializable));\nexports.MsgSwap = MsgSwap;\n//# sourceMappingURL=MsgSwap.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgSwapSend = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar Coin_1 = require(\"../../Coin\");\n/**\n * Executes a market swap send between 2 denominations at the exchange rate registered by the\n * Oracle module. The sender account will lose the amount of coins offered, and receiver will receive funds\n * in the requested denomination after a swap and send fee has been applied.\n */\nvar MsgSwapSend = /** @class */ (function (_super) {\n __extends(MsgSwapSend, _super);\n /**\n * @param from_address sender's account address\n * @param to_address receiver's account address\n * @param offer_coin coin to be swapped (from)\n * @param ask_denom desired denomination (to)\n */\n function MsgSwapSend(from_address, to_address, offer_coin, ask_denom) {\n var _this = _super.call(this) || this;\n _this.from_address = from_address;\n _this.to_address = to_address;\n _this.offer_coin = offer_coin;\n _this.ask_denom = ask_denom;\n return _this;\n }\n MsgSwapSend.fromData = function (data) {\n var _a = data.value, from_address = _a.from_address, to_address = _a.to_address, offer_coin = _a.offer_coin, ask_denom = _a.ask_denom;\n return new MsgSwapSend(from_address, to_address, Coin_1.Coin.fromData(offer_coin), ask_denom);\n };\n MsgSwapSend.prototype.toData = function () {\n var _a = this, from_address = _a.from_address, to_address = _a.to_address, offer_coin = _a.offer_coin, ask_denom = _a.ask_denom;\n return {\n type: 'market/MsgSwapSend',\n value: {\n from_address: from_address,\n to_address: to_address,\n offer_coin: offer_coin.toData(),\n ask_denom: ask_denom,\n },\n };\n };\n return MsgSwapSend;\n}(json_1.JSONSerializable));\nexports.MsgSwapSend = MsgSwapSend;\n//# sourceMappingURL=MsgSwapSend.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgGrantAuthorization = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar numeric_1 = require(\"../../numeric\");\nvar Authorization_1 = require(\"../Authorization\");\nvar MsgGrantAuthorization = /** @class */ (function (_super) {\n __extends(MsgGrantAuthorization, _super);\n /**\n * @param depositor depositor's account address\n * @param amount coins to fund the community pool\n */\n function MsgGrantAuthorization(granter, grantee, authorization, period) {\n var _this = _super.call(this) || this;\n _this.granter = granter;\n _this.grantee = grantee;\n _this.authorization = authorization;\n _this.period = period;\n return _this;\n }\n MsgGrantAuthorization.fromData = function (data) {\n var _a = data.value, granter = _a.granter, grantee = _a.grantee, authorization = _a.authorization, period = _a.period;\n return new MsgGrantAuthorization(granter, grantee, Authorization_1.Authorization.fromData(authorization), new numeric_1.Int(period));\n };\n MsgGrantAuthorization.prototype.toData = function () {\n var _a = this, granter = _a.granter, grantee = _a.grantee, authorization = _a.authorization, period = _a.period;\n return {\n type: 'msgauth/MsgGrantAuthorization',\n value: {\n granter: granter,\n grantee: grantee,\n authorization: authorization.toData(),\n period: period.toFixed(),\n },\n };\n };\n return MsgGrantAuthorization;\n}(json_1.JSONSerializable));\nexports.MsgGrantAuthorization = MsgGrantAuthorization;\n//# sourceMappingURL=MsgGrantAuthorization.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgRevokeAuthorization = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar MsgRevokeAuthorization = /** @class */ (function (_super) {\n __extends(MsgRevokeAuthorization, _super);\n /**\n * @param granter authorization granter\n * @param grantee authorization grantee\n * @param authorization_msg_type type of message to revoke\n */\n function MsgRevokeAuthorization(granter, grantee, authorization_msg_type) {\n var _this = _super.call(this) || this;\n _this.granter = granter;\n _this.grantee = grantee;\n _this.authorization_msg_type = authorization_msg_type;\n return _this;\n }\n MsgRevokeAuthorization.fromData = function (data) {\n var _a = data.value, granter = _a.granter, grantee = _a.grantee, authorization_msg_type = _a.authorization_msg_type;\n return new MsgRevokeAuthorization(granter, grantee, authorization_msg_type);\n };\n MsgRevokeAuthorization.prototype.toData = function () {\n var _a = this, granter = _a.granter, grantee = _a.grantee, authorization_msg_type = _a.authorization_msg_type;\n return {\n type: 'msgauth/MsgRevokeAuthorization',\n value: {\n granter: granter,\n grantee: grantee,\n authorization_msg_type: authorization_msg_type,\n },\n };\n };\n return MsgRevokeAuthorization;\n}(json_1.JSONSerializable));\nexports.MsgRevokeAuthorization = MsgRevokeAuthorization;\n//# sourceMappingURL=MsgRevokeAuthorization.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgExecAuthorized = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar Msg_1 = require(\"../../Msg\");\nvar MsgExecAuthorized = /** @class */ (function (_super) {\n __extends(MsgExecAuthorized, _super);\n /**\n * @param grantee authorization grantee\n * @param msgs list of messages to execute\n */\n function MsgExecAuthorized(grantee, msgs) {\n var _this = _super.call(this) || this;\n _this.grantee = grantee;\n _this.msgs = msgs;\n return _this;\n }\n MsgExecAuthorized.fromData = function (data) {\n var _a = data.value, grantee = _a.grantee, msgs = _a.msgs;\n return new MsgExecAuthorized(grantee, msgs.map(function (x) { return Msg_1.Msg.fromData(x); }));\n };\n MsgExecAuthorized.prototype.toData = function () {\n var _a = this, grantee = _a.grantee, msgs = _a.msgs;\n return {\n type: 'msgauth/MsgExecAuthorized',\n value: {\n grantee: grantee,\n msgs: msgs.map(function (msg) { return msg.toData(); }),\n },\n };\n };\n return MsgExecAuthorized;\n}(json_1.JSONSerializable));\nexports.MsgExecAuthorized = MsgExecAuthorized;\n//# sourceMappingURL=MsgExecAuthorized.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgDelegateFeedConsent = void 0;\nvar json_1 = require(\"../../../util/json\");\n/**\n * A **feeeder** is an account which is responsible for signing transactions with Oracle vote\n * and prevote messages on behalf of the validator. The blockchain will reject\n * [[MsgExchangeRateVote]] and [[MsgExchangeRatePrevote]] messages in transactions\n * signed by an\n * account different than the registered feeder.\n *\n * The following message registers a validator's feeder address.\n */\nvar MsgDelegateFeedConsent = /** @class */ (function (_super) {\n __extends(MsgDelegateFeedConsent, _super);\n /**\n * @param operator validator's operator address\n * @param delegate account address to set to feeder\n */\n function MsgDelegateFeedConsent(operator, delegate) {\n var _this = _super.call(this) || this;\n _this.operator = operator;\n _this.delegate = delegate;\n return _this;\n }\n MsgDelegateFeedConsent.fromData = function (data) {\n var _a = data.value, operator = _a.operator, delegate = _a.delegate;\n return new MsgDelegateFeedConsent(operator, delegate);\n };\n MsgDelegateFeedConsent.prototype.toData = function () {\n var _a = this, operator = _a.operator, delegate = _a.delegate;\n return {\n type: 'oracle/MsgDelegateFeedConsent',\n value: {\n operator: operator,\n delegate: delegate,\n },\n };\n };\n return MsgDelegateFeedConsent;\n}(json_1.JSONSerializable));\nexports.MsgDelegateFeedConsent = MsgDelegateFeedConsent;\n//# sourceMappingURL=MsgDelegateFeedConsent.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgExchangeRateVote = exports.voteHash = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar numeric_1 = require(\"../../numeric\");\nvar MsgExchangeRatePrevote_1 = require(\"./MsgExchangeRatePrevote\");\nvar sha256_1 = __importDefault(require(\"crypto-js/sha256\"));\n/**\n * Calculates the vote hash\n * @param exchangeRate exchange rate\n * @param denom denomination\n * @param salt salt\n * @param validator validator operator address\n */\nfunction voteHash(exchangeRate, denom, salt, validator) {\n var payload = salt + \":\" + exchangeRate + \":\" + denom + \":\" + validator;\n return sha256_1.default(payload).toString().substring(0, 40);\n}\nexports.voteHash = voteHash;\n/**\n * Every validator in the validating set (top 100 in total bonded Luna) is required to\n * submit a vote for the current exchange rate of LUNA for every active denomination\n * once per vote period.\n *\n * Votes are registered through submitting a [[MsgExchangeRateVote]] message, which must\n * correspond to a [[MsgExchangeRatePrevote]] submitted in the previous vote period.\n */\nvar MsgExchangeRateVote = /** @class */ (function (_super) {\n __extends(MsgExchangeRateVote, _super);\n /**\n * @param exchange_rate exchange rate\n * @param denom denomination\n * @param salt salt\n * @param feeder feeder address\n * @param validator validator operator address\n */\n function MsgExchangeRateVote(exchange_rate, denom, salt, feeder, validator) {\n var _this = _super.call(this) || this;\n _this.denom = denom;\n _this.salt = salt;\n _this.feeder = feeder;\n _this.validator = validator;\n _this.exchange_rate = new numeric_1.Dec(exchange_rate);\n return _this;\n }\n MsgExchangeRateVote.fromData = function (data) {\n var _a = data.value, exchange_rate = _a.exchange_rate, salt = _a.salt, denom = _a.denom, feeder = _a.feeder, validator = _a.validator;\n return new MsgExchangeRateVote(exchange_rate, denom, salt, feeder, validator);\n };\n MsgExchangeRateVote.prototype.toData = function () {\n var _a = this, exchange_rate = _a.exchange_rate, salt = _a.salt, denom = _a.denom, feeder = _a.feeder, validator = _a.validator;\n return {\n type: 'oracle/MsgExchangeRateVote',\n value: {\n exchange_rate: exchange_rate.toString(),\n denom: denom,\n salt: salt,\n feeder: feeder,\n validator: validator,\n },\n };\n };\n /**\n * Gets the vote hash for the MsgExchangeRateVote, for the creation of the corresponding\n * prevote message.\n */\n MsgExchangeRateVote.prototype.getVoteHash = function () {\n return voteHash(this.exchange_rate.toString(), this.denom, this.salt, this.validator);\n };\n /**\n * You can generate the corresponding prevote message through the prevote property.\n * This will return a [[MsgExchangeRatePrevote]] with the proper vote hash and values,\n * determined by the current attributes of the object.\n *\n * @returns the corresponding prevote message to send\n */\n MsgExchangeRateVote.prototype.getPrevote = function () {\n return new MsgExchangeRatePrevote_1.MsgExchangeRatePrevote(this.getVoteHash(), this.denom, this.feeder, this.validator);\n };\n return MsgExchangeRateVote;\n}(json_1.JSONSerializable));\nexports.MsgExchangeRateVote = MsgExchangeRateVote;\n//# sourceMappingURL=MsgExchangeRateVote.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgAggregateExchangeRateVote = exports.aggregateVoteHash = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar MsgAggregateExchangeRatePrevote_1 = require(\"./MsgAggregateExchangeRatePrevote\");\nvar Coins_1 = require(\"../../Coins\");\nvar sha256_1 = __importDefault(require(\"crypto-js/sha256\"));\n/**\n * Calculates the aggregate vote hash\n * @param exchangeRates exchange rates\n * @param salt salt\n * @param validator validator operator address\n */\nfunction aggregateVoteHash(exchangeRates, salt, validator) {\n var payload = salt + \":\" + exchangeRates\n .toDecCoins()\n .toString() + \":\" + validator;\n return sha256_1.default(payload).toString().substring(0, 40);\n}\nexports.aggregateVoteHash = aggregateVoteHash;\n/**\n * Aggregate analog of MsgExchangeRateVote: submits an oracle vote for multiple denominations\n * through a single message rather than multiple messages.\n */\nvar MsgAggregateExchangeRateVote = /** @class */ (function (_super) {\n __extends(MsgAggregateExchangeRateVote, _super);\n /**\n * @param exchange_rate exchange rates\n * @param salt salt\n * @param feeder feeder address\n * @param validator validator operator address\n */\n function MsgAggregateExchangeRateVote(exchange_rates, salt, feeder, validator) {\n var _this = _super.call(this) || this;\n _this.salt = salt;\n _this.feeder = feeder;\n _this.validator = validator;\n _this.exchange_rates = new Coins_1.Coins(exchange_rates).toDecCoins();\n return _this;\n }\n MsgAggregateExchangeRateVote.fromData = function (data) {\n var _a = data.value, exchange_rates = _a.exchange_rates, salt = _a.salt, feeder = _a.feeder, validator = _a.validator;\n var xrs = Coins_1.Coins.fromString(exchange_rates);\n return new MsgAggregateExchangeRateVote(xrs, salt, feeder, validator);\n };\n MsgAggregateExchangeRateVote.prototype.toData = function () {\n var _a = this, exchange_rates = _a.exchange_rates, salt = _a.salt, feeder = _a.feeder, validator = _a.validator;\n return {\n type: 'oracle/MsgAggregateExchangeRateVote',\n value: {\n exchange_rates: exchange_rates.toDecCoins().toString(),\n salt: salt,\n feeder: feeder,\n validator: validator,\n },\n };\n };\n /**\n * Gets the aggregate vote hash for the MsgAggregateExchangeRateVote, for the creation of\n * the corresponding prevote message.\n */\n MsgAggregateExchangeRateVote.prototype.getAggregateVoteHash = function () {\n return aggregateVoteHash(this.exchange_rates, this.salt, this.validator);\n };\n /**\n * You can generate the corresponding aggregate prevote message.\n * This will return a [[MsgAggregateExchangeRatePrevote]] with the proper vote hash and values,\n * determined by the current attributes of the object.\n *\n * @returns the corresponding prevote message to send\n */\n MsgAggregateExchangeRateVote.prototype.getPrevote = function () {\n return new MsgAggregateExchangeRatePrevote_1.MsgAggregateExchangeRatePrevote(this.getAggregateVoteHash(), this.feeder, this.validator);\n };\n return MsgAggregateExchangeRateVote;\n}(json_1.JSONSerializable));\nexports.MsgAggregateExchangeRateVote = MsgAggregateExchangeRateVote;\n//# sourceMappingURL=MsgAggregateExchangeRateVote.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgUnjail = void 0;\nvar json_1 = require(\"../../../util/json\");\n/**\n * A validator can be jailed by the blockchain if misbehavior is detected, such as\n * double-signing or having missed too many vote periods in the Oracle ballot.\n *\n * This is done to protect delegators' funds from getting slashed further, until the\n * validator's issues have been addressed. A jailed validator cannot participate in\n * block rewards, and must be manually unjailed by submitting this message.\n */\nvar MsgUnjail = /** @class */ (function (_super) {\n __extends(MsgUnjail, _super);\n /**\n * @param address validator's operator address\n */\n function MsgUnjail(address) {\n var _this = _super.call(this) || this;\n _this.address = address;\n return _this;\n }\n MsgUnjail.fromData = function (data) {\n var address = data.value.address;\n return new MsgUnjail(address);\n };\n MsgUnjail.prototype.toData = function () {\n var address = this.address;\n return {\n type: 'cosmos/MsgUnjail',\n value: {\n address: address,\n },\n };\n };\n return MsgUnjail;\n}(json_1.JSONSerializable));\nexports.MsgUnjail = MsgUnjail;\n//# sourceMappingURL=MsgUnjail.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgDelegate = void 0;\nvar Coin_1 = require(\"../../Coin\");\nvar json_1 = require(\"../../../util/json\");\n/**\n * A delegator can submit this message to send more Luna to be staked through a\n * validator delegate.\n */\nvar MsgDelegate = /** @class */ (function (_super) {\n __extends(MsgDelegate, _super);\n /**\n *\n * @param delegator_address delegator's account address\n * @param validator_address validator's operator address\n * @param amount amount of LUNA to be sent for delegation\n */\n function MsgDelegate(delegator_address, validator_address, amount) {\n var _this = _super.call(this) || this;\n _this.delegator_address = delegator_address;\n _this.validator_address = validator_address;\n _this.amount = amount;\n return _this;\n }\n MsgDelegate.fromData = function (data) {\n var _a = data.value, delegator_address = _a.delegator_address, validator_address = _a.validator_address, amount = _a.amount;\n return new MsgDelegate(delegator_address, validator_address, Coin_1.Coin.fromData(amount));\n };\n MsgDelegate.prototype.toData = function () {\n var _a = this, delegator_address = _a.delegator_address, validator_address = _a.validator_address, amount = _a.amount;\n return {\n type: 'staking/MsgDelegate',\n value: {\n delegator_address: delegator_address,\n validator_address: validator_address,\n amount: amount.toData(),\n },\n };\n };\n return MsgDelegate;\n}(json_1.JSONSerializable));\nexports.MsgDelegate = MsgDelegate;\n//# sourceMappingURL=MsgDelegate.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgUndelegate = void 0;\nvar Coin_1 = require(\"../../Coin\");\nvar json_1 = require(\"../../../util/json\");\n/**\n * A delegator can undelegate an amount of bonded Luna, and will begin the unbonding\n * process for those funds. The unbonding process takes 21 days to complete, during\n * which the Luna cannot be transacted or swapped.\n */\nvar MsgUndelegate = /** @class */ (function (_super) {\n __extends(MsgUndelegate, _super);\n /**\n * @param delegator_address delegator's account address\n * @param validator_address validator's operator address\n * @param amount Luna to be undelegated\n */\n function MsgUndelegate(delegator_address, validator_address, amount) {\n var _this = _super.call(this) || this;\n _this.delegator_address = delegator_address;\n _this.validator_address = validator_address;\n _this.amount = amount;\n return _this;\n }\n MsgUndelegate.fromData = function (data) {\n var _a = data.value, delegator_address = _a.delegator_address, validator_address = _a.validator_address, amount = _a.amount;\n return new MsgUndelegate(delegator_address, validator_address, Coin_1.Coin.fromData(amount));\n };\n MsgUndelegate.prototype.toData = function () {\n var _a = this, delegator_address = _a.delegator_address, validator_address = _a.validator_address, amount = _a.amount;\n return {\n type: 'staking/MsgUndelegate',\n value: {\n delegator_address: delegator_address,\n validator_address: validator_address,\n amount: amount.toData(),\n },\n };\n };\n return MsgUndelegate;\n}(json_1.JSONSerializable));\nexports.MsgUndelegate = MsgUndelegate;\n//# sourceMappingURL=MsgUndelegate.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgBeginRedelegate = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar Coin_1 = require(\"../../Coin\");\n/**\n * A delegator can choose to redelegate their bonded Luna and transfer a delegation\n * amount from one validator to another. Unlike undelegating, redelegations do not incur\n * a 21-day unbonding period and happen immediately.\n */\nvar MsgBeginRedelegate = /** @class */ (function (_super) {\n __extends(MsgBeginRedelegate, _super);\n /**\n *\n * @param delegator_address delegator's account address\n * @param validator_src_address validator to undelegate from\n * @param validator_dst_address validator to delegate to\n * @param amount LUNA to be redelegated\n */\n function MsgBeginRedelegate(delegator_address, validator_src_address, validator_dst_address, amount) {\n var _this = _super.call(this) || this;\n _this.delegator_address = delegator_address;\n _this.validator_src_address = validator_src_address;\n _this.validator_dst_address = validator_dst_address;\n _this.amount = amount;\n return _this;\n }\n MsgBeginRedelegate.fromData = function (data) {\n var _a = data.value, delegator_address = _a.delegator_address, validator_src_address = _a.validator_src_address, validator_dst_address = _a.validator_dst_address, amount = _a.amount;\n return new MsgBeginRedelegate(delegator_address, validator_src_address, validator_dst_address, Coin_1.Coin.fromData(amount));\n };\n MsgBeginRedelegate.prototype.toData = function () {\n var _a = this, delegator_address = _a.delegator_address, validator_src_address = _a.validator_src_address, validator_dst_address = _a.validator_dst_address, amount = _a.amount;\n return {\n type: 'staking/MsgBeginRedelegate',\n value: {\n delegator_address: delegator_address,\n validator_src_address: validator_src_address,\n validator_dst_address: validator_dst_address,\n amount: amount.toData(),\n },\n };\n };\n return MsgBeginRedelegate;\n}(json_1.JSONSerializable));\nexports.MsgBeginRedelegate = MsgBeginRedelegate;\n//# sourceMappingURL=MsgBeginRedelegate.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgCreateValidator = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar Coin_1 = require(\"../../Coin\");\nvar numeric_1 = require(\"../../numeric\");\nvar Validator_1 = require(\"../Validator\");\n/**\n * For new validators, this message registers a validator address to be a delegate on\n * the blockchain.\n */\nvar MsgCreateValidator = /** @class */ (function (_super) {\n __extends(MsgCreateValidator, _super);\n /**\n *\n * @param description validator's delegate information\n * @param commission validator's commission policy\n * @param min_self_delegation minimum self delegation\n * @param delegator_address validator's account address\n * @param validator_address validator's operator address\n * @param pubkey validator's consensus public key\n * @param value amount to use for self-delegation\n */\n function MsgCreateValidator(description, commission, min_self_delegation, delegator_address, validator_address, pubkey, value) {\n var _this = _super.call(this) || this;\n _this.description = description;\n _this.commission = commission;\n _this.min_self_delegation = min_self_delegation;\n _this.delegator_address = delegator_address;\n _this.validator_address = validator_address;\n _this.pubkey = pubkey;\n _this.value = value;\n return _this;\n }\n MsgCreateValidator.fromData = function (data) {\n var _a = data.value, description = _a.description, commission = _a.commission, min_self_delegation = _a.min_self_delegation, delegator_address = _a.delegator_address, validator_address = _a.validator_address, pubkey = _a.pubkey, value = _a.value;\n return new MsgCreateValidator(description, Validator_1.Validator.CommissionRates.fromData(commission), new numeric_1.Int(min_self_delegation), delegator_address, validator_address, pubkey, Coin_1.Coin.fromData(value));\n };\n MsgCreateValidator.prototype.toData = function () {\n var _a = this, description = _a.description, commission = _a.commission, min_self_delegation = _a.min_self_delegation, delegator_address = _a.delegator_address, validator_address = _a.validator_address, pubkey = _a.pubkey, value = _a.value;\n return {\n type: 'staking/MsgCreateValidator',\n value: {\n description: description,\n commission: commission.toData(),\n min_self_delegation: min_self_delegation.toString(),\n delegator_address: delegator_address,\n validator_address: validator_address,\n pubkey: pubkey,\n value: value.toData(),\n },\n };\n };\n return MsgCreateValidator;\n}(json_1.JSONSerializable));\nexports.MsgCreateValidator = MsgCreateValidator;\n//# sourceMappingURL=MsgCreateValidator.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgEditValidator = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar numeric_1 = require(\"../../numeric\");\n/**\n * A validator can edit its delegate information, such as moniker, website, commission\n * rate, etc.\n *\n * You must use special or sentinel values to inform that you want to leave the current\n * field untouched. For `Description`,` you should start with [[MsgEditValidator.DESC_DO_NOT_MODIFY]] and\n * change each field you wish to modify individually.\n */\nvar MsgEditValidator = /** @class */ (function (_super) {\n __extends(MsgEditValidator, _super);\n /**\n * @param Description new description to apply\n * @param address new address to apply\n * @param commission_rate new commission rates to apply\n * @param min_self_delegation new min self delegation\n */\n function MsgEditValidator(Description, address, commission_rate, min_self_delegation) {\n var _this = _super.call(this) || this;\n _this.Description = Description;\n _this.address = address;\n _this.commission_rate = commission_rate;\n _this.min_self_delegation = min_self_delegation;\n return _this;\n }\n MsgEditValidator.fromData = function (data) {\n var _a = data.value, Description = _a.Description, address = _a.address, commission_rate = _a.commission_rate, min_self_delegation = _a.min_self_delegation;\n return new MsgEditValidator(Description, address, commission_rate ? new numeric_1.Dec(commission_rate) : undefined, min_self_delegation ? new numeric_1.Int(min_self_delegation) : undefined);\n };\n MsgEditValidator.prototype.toData = function () {\n var _a = this, Description = _a.Description, address = _a.address, commission_rate = _a.commission_rate, min_self_delegation = _a.min_self_delegation;\n return {\n type: 'staking/MsgEditValidator',\n value: {\n Description: Description,\n address: address,\n commission_rate: commission_rate ? commission_rate.toString() : null,\n min_self_delegation: min_self_delegation\n ? min_self_delegation.toString()\n : null,\n },\n };\n };\n return MsgEditValidator;\n}(json_1.JSONSerializable));\nexports.MsgEditValidator = MsgEditValidator;\n(function (MsgEditValidator) {\n MsgEditValidator.DESC_DO_NOT_MODIFY = {\n moniker: '[do-not-modify]',\n website: '[do-not-modify]',\n identity: '[do-not-modify]',\n details: '[do-not-modify]',\n };\n})(MsgEditValidator = exports.MsgEditValidator || (exports.MsgEditValidator = {}));\nexports.MsgEditValidator = MsgEditValidator;\n//# sourceMappingURL=MsgEditValidator.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgStoreCode = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar MsgStoreCode = /** @class */ (function (_super) {\n __extends(MsgStoreCode, _super);\n /**\n * @param sender contract creator\n * @param wasm_byte_code base64-encoded bytecode contents\n */\n function MsgStoreCode(sender, wasm_byte_code) {\n var _this = _super.call(this) || this;\n _this.sender = sender;\n _this.wasm_byte_code = wasm_byte_code;\n return _this;\n }\n MsgStoreCode.fromData = function (data) {\n var _a = data.value, sender = _a.sender, wasm_byte_code = _a.wasm_byte_code;\n return new MsgStoreCode(sender, wasm_byte_code);\n };\n MsgStoreCode.prototype.toData = function () {\n var _a = this, sender = _a.sender, wasm_byte_code = _a.wasm_byte_code;\n return {\n type: 'wasm/MsgStoreCode',\n value: {\n sender: sender,\n wasm_byte_code: wasm_byte_code,\n },\n };\n };\n return MsgStoreCode;\n}(json_1.JSONSerializable));\nexports.MsgStoreCode = MsgStoreCode;\n//# sourceMappingURL=MsgStoreCode.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgInstantiateContract = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar Coins_1 = require(\"../../Coins\");\nvar MsgInstantiateContract = /** @class */ (function (_super) {\n __extends(MsgInstantiateContract, _super);\n /**\n * @param owner contract owner\n * @param code_id reference to the code on the blockchain\n * @param init_msg message to configure the initial state of the contract\n * @param init_coins initial amount of coins to be sent to the contract's address\n * @param migratable defines to be migratable or not\n */\n function MsgInstantiateContract(owner, code_id, init_msg, init_coins, migratable) {\n if (init_coins === void 0) { init_coins = {}; }\n if (migratable === void 0) { migratable = false; }\n var _this = _super.call(this) || this;\n _this.owner = owner;\n _this.code_id = code_id;\n _this.init_msg = init_msg;\n _this.migratable = migratable;\n _this.init_coins = new Coins_1.Coins(init_coins);\n return _this;\n }\n MsgInstantiateContract.fromData = function (data) {\n var _a = data.value, owner = _a.owner, code_id = _a.code_id, init_msg = _a.init_msg, init_coins = _a.init_coins, migratable = _a.migratable;\n return new MsgInstantiateContract(owner, Number.parseInt(code_id), JSON.parse(Buffer.from(init_msg, 'base64').toString()), Coins_1.Coins.fromData(init_coins), migratable);\n };\n MsgInstantiateContract.prototype.toData = function () {\n var _a = this, owner = _a.owner, code_id = _a.code_id, init_msg = _a.init_msg, init_coins = _a.init_coins, migratable = _a.migratable;\n return {\n type: 'wasm/MsgInstantiateContract',\n value: {\n owner: owner,\n code_id: code_id.toFixed(),\n init_msg: Buffer.from(JSON.stringify(init_msg)).toString('base64'),\n init_coins: init_coins.toData(),\n migratable: migratable,\n },\n };\n };\n return MsgInstantiateContract;\n}(json_1.JSONSerializable));\nexports.MsgInstantiateContract = MsgInstantiateContract;\n//# sourceMappingURL=MsgInstantiateContract.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgExecuteContract = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar Coins_1 = require(\"../../Coins\");\nvar MsgExecuteContract = /** @class */ (function (_super) {\n __extends(MsgExecuteContract, _super);\n /**\n * @param sender contract user\n * @param contract contract address\n * @param msg HandleMsg to pass as arguments for contract invocation\n * @param coins coins to be sent to contract\n */\n function MsgExecuteContract(sender, contract, execute_msg, coins) {\n if (coins === void 0) { coins = {}; }\n var _this = _super.call(this) || this;\n _this.sender = sender;\n _this.contract = contract;\n _this.execute_msg = execute_msg;\n _this.coins = new Coins_1.Coins(coins);\n return _this;\n }\n MsgExecuteContract.fromData = function (data) {\n var _a = data.value, sender = _a.sender, contract = _a.contract, execute_msg = _a.execute_msg, coins = _a.coins;\n return new MsgExecuteContract(sender, contract, JSON.parse(Buffer.from(execute_msg, 'base64').toString()), Coins_1.Coins.fromData(coins));\n };\n MsgExecuteContract.prototype.toData = function () {\n var _a = this, sender = _a.sender, contract = _a.contract, execute_msg = _a.execute_msg, coins = _a.coins;\n return {\n type: 'wasm/MsgExecuteContract',\n value: {\n sender: sender,\n contract: contract,\n execute_msg: Buffer.from(JSON.stringify(execute_msg)).toString('base64'),\n coins: coins.toData(),\n },\n };\n };\n return MsgExecuteContract;\n}(json_1.JSONSerializable));\nexports.MsgExecuteContract = MsgExecuteContract;\n//# sourceMappingURL=MsgExecuteContract.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgMigrateContract = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar MsgMigrateContract = /** @class */ (function (_super) {\n __extends(MsgMigrateContract, _super);\n /**\n * @param owner contract owner\n * @param contract contract address to be migrated from\n * @param new_code_id reference to the new code on the blockchain\n * @param migrate_msg JSON message to configure the migrate state of the contract\n */\n function MsgMigrateContract(owner, contract, new_code_id, migrate_msg // json object\n ) {\n var _this = _super.call(this) || this;\n _this.owner = owner;\n _this.contract = contract;\n _this.new_code_id = new_code_id;\n _this.migrate_msg = migrate_msg;\n return _this;\n }\n MsgMigrateContract.fromData = function (data) {\n var _a = data.value, owner = _a.owner, contract = _a.contract, new_code_id = _a.new_code_id, migrate_msg = _a.migrate_msg;\n return new MsgMigrateContract(owner, contract, Number.parseInt(new_code_id), JSON.parse(Buffer.from(migrate_msg, 'base64').toString()));\n };\n MsgMigrateContract.prototype.toData = function () {\n var _a = this, owner = _a.owner, contract = _a.contract, new_code_id = _a.new_code_id, migrate_msg = _a.migrate_msg;\n return {\n type: 'wasm/MsgMigrateContract',\n value: {\n owner: owner,\n contract: contract,\n new_code_id: new_code_id.toFixed(),\n migrate_msg: Buffer.from(JSON.stringify(migrate_msg)).toString('base64'),\n },\n };\n };\n return MsgMigrateContract;\n}(json_1.JSONSerializable));\nexports.MsgMigrateContract = MsgMigrateContract;\n//# sourceMappingURL=MsgMigrateContract.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgUpdateContractOwner = void 0;\nvar json_1 = require(\"../../../util/json\");\nvar MsgUpdateContractOwner = /** @class */ (function (_super) {\n __extends(MsgUpdateContractOwner, _super);\n /**\n * @param owner contract owner\n * @param new_owner new owner\n * @param contract contract address\n */\n function MsgUpdateContractOwner(owner, new_owner, contract) {\n var _this = _super.call(this) || this;\n _this.owner = owner;\n _this.new_owner = new_owner;\n _this.contract = contract;\n return _this;\n }\n MsgUpdateContractOwner.fromData = function (data) {\n var _a = data.value, owner = _a.owner, new_owner = _a.new_owner, contract = _a.contract;\n return new MsgUpdateContractOwner(owner, new_owner, contract);\n };\n MsgUpdateContractOwner.prototype.toData = function () {\n var _a = this, owner = _a.owner, new_owner = _a.new_owner, contract = _a.contract;\n return {\n type: 'wasm/MsgUpdateContractOwner',\n value: {\n owner: owner,\n new_owner: new_owner,\n contract: contract,\n },\n };\n };\n return MsgUpdateContractOwner;\n}(json_1.JSONSerializable));\nexports.MsgUpdateContractOwner = MsgUpdateContractOwner;\n//# sourceMappingURL=MsgUpdateContractOwner.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StdSignMsg = void 0;\nvar StdFee_1 = require(\"./StdFee\");\nvar Msg_1 = require(\"./Msg\");\nvar json_1 = require(\"../util/json\");\nvar StdTx_1 = require(\"./StdTx\");\n/**\n * A sign message is a data structure that is used to create a [[StdSignature]] to be later\n * appended to the list of signatures in an [[StdTx]]. Essentially, it contains all the\n * information needed to sign and build a transaction, and can be described as an\n * \"unsigned transaction.\"\n */\nvar StdSignMsg = /** @class */ (function (_super) {\n __extends(StdSignMsg, _super);\n /**\n *\n * @param chain_id ID of blockchain to submit transaction to\n * @param account_number account number on blockchain\n * @param sequence Sequence number (nonce), number of signed previous transactions by\n * account included on the blockchain at time of broadcast.\n * @param fee transaction fee\n * @param msgs list of messages to include\n * @param memo optional note\n */\n function StdSignMsg(chain_id, account_number, sequence, fee, msgs, memo) {\n if (memo === void 0) { memo = ''; }\n var _this = _super.call(this) || this;\n _this.chain_id = chain_id;\n _this.account_number = account_number;\n _this.sequence = sequence;\n _this.fee = fee;\n _this.msgs = msgs;\n _this.memo = memo;\n return _this;\n }\n StdSignMsg.prototype.toData = function () {\n var _a = this, chain_id = _a.chain_id, account_number = _a.account_number, sequence = _a.sequence, fee = _a.fee, msgs = _a.msgs, memo = _a.memo;\n return {\n chain_id: chain_id,\n account_number: account_number.toString(),\n sequence: sequence.toString(),\n fee: fee.toData(),\n msgs: msgs.map(function (m) { return m.toData(); }),\n memo: memo,\n };\n };\n StdSignMsg.fromData = function (data) {\n var chain_id = data.chain_id, account_number = data.account_number, sequence = data.sequence, fee = data.fee, msgs = data.msgs, memo = data.memo;\n return new StdSignMsg(chain_id, Number.parseInt(account_number), Number.parseInt(sequence), StdFee_1.StdFee.fromData(fee), msgs.map(function (m) { return Msg_1.Msg.fromData(m); }), memo);\n };\n /**\n * You get get the [[StdTx]] value from a `StdSignMsg` (without the signature).\n */\n StdSignMsg.prototype.toStdTx = function () {\n var _a = this, fee = _a.fee, msgs = _a.msgs, memo = _a.memo;\n return new StdTx_1.StdTx(msgs, fee, [], memo);\n };\n return StdSignMsg;\n}(json_1.JSONSerializable));\nexports.StdSignMsg = StdSignMsg;\n//# sourceMappingURL=StdSignMsg.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TxLog = exports.EventsByType = exports.TxInfo = void 0;\nvar json_1 = require(\"../util/json\");\nvar StdTx_1 = require(\"./StdTx\");\n/**\n * A TxInfo data structure is used to capture information from a transaction lookup for\n * a transaction already included in a block\n */\nvar TxInfo = /** @class */ (function (_super) {\n __extends(TxInfo, _super);\n /**\n *\n * @param height height of the block in which the transaction was included.\n * @param txhash transaction's hash.\n * @param raw_log raw log information, as a string.\n * @param logs log information\n * @param gas_wanted gas limited submitted in fee\n * @param gas_used actual gas consumption\n * @param tx transaction content\n * @param timestamp time of inclusion\n * @param code error code\n */\n function TxInfo(height, txhash, raw_log, logs, gas_wanted, gas_used, tx, timestamp, code, codespace) {\n var _this = _super.call(this) || this;\n _this.height = height;\n _this.txhash = txhash;\n _this.raw_log = raw_log;\n _this.logs = logs;\n _this.gas_wanted = gas_wanted;\n _this.gas_used = gas_used;\n _this.tx = tx;\n _this.timestamp = timestamp;\n _this.code = code;\n _this.codespace = codespace;\n return _this;\n }\n TxInfo.fromData = function (data) {\n return new TxInfo(Number.parseInt(data.height), data.txhash, data.raw_log, data.logs && data.logs.map(function (log) { return TxLog.fromData(log); }), Number.parseInt(data.gas_wanted), Number.parseInt(data.gas_used), StdTx_1.StdTx.fromData(data.tx), data.timestamp, data.code, data.codespace);\n };\n TxInfo.prototype.toData = function () {\n var data = {\n height: this.height.toFixed(),\n txhash: this.txhash,\n raw_log: this.raw_log,\n gas_wanted: this.gas_wanted.toFixed(),\n gas_used: this.gas_used.toFixed(),\n tx: this.tx.toData(),\n timestamp: this.timestamp,\n };\n if (this.logs) {\n data.logs = this.logs.map(function (log) { return log.toData(); });\n }\n if (this.code) {\n data.code = this.code;\n }\n if (this.codespace) {\n data.codespace = this.codespace;\n }\n return data;\n };\n return TxInfo;\n}(json_1.JSONSerializable));\nexports.TxInfo = TxInfo;\nvar EventsByType;\n(function (EventsByType) {\n function parse(eventData) {\n var events = {};\n eventData.forEach(function (ev) {\n ev.attributes.forEach(function (attr) {\n if (!(ev.type in events)) {\n events[ev.type] = {};\n }\n if (!(attr.key in events[ev.type])) {\n events[ev.type][attr.key] = [];\n }\n events[ev.type][attr.key].push(attr.value);\n });\n });\n return events;\n }\n EventsByType.parse = parse;\n})(EventsByType = exports.EventsByType || (exports.EventsByType = {}));\nvar TxLog = /** @class */ (function (_super) {\n __extends(TxLog, _super);\n function TxLog(msg_index, log, events) {\n var _this = _super.call(this) || this;\n _this.msg_index = msg_index;\n _this.log = log;\n _this.events = events;\n _this.eventsByType = EventsByType.parse(_this.events);\n return _this;\n }\n TxLog.fromData = function (data) {\n var msg_index = data.msg_index, log = data.log, events = data.events;\n return new TxLog(msg_index, log, events);\n };\n TxLog.prototype.toData = function () {\n var _a = this, msg_index = _a.msg_index, log = _a.log, events = _a.events;\n return {\n msg_index: msg_index,\n log: log,\n events: events,\n };\n };\n return TxLog;\n}(json_1.JSONSerializable));\nexports.TxLog = TxLog;\n//# sourceMappingURL=TxInfo.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=ValidatorSet.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Account = void 0;\nvar Coins_1 = require(\"../Coins\");\nvar PublicKey_1 = require(\"../PublicKey\");\nvar json_1 = require(\"../../util/json\");\n/**\n * Stores information about an account fetched from the blockchain.\n */\nvar Account = /** @class */ (function (_super) {\n __extends(Account, _super);\n /**\n * Creates a new Account object, holding information about a basic account.\n *\n * @param address account address\n * @param coins account's balance\n * @param public_key account's public key information\n * @param account_number account number on the blockchain\n * @param sequence sequence number, or number of transactions that have been posted\n */\n function Account(address, coins, public_key, account_number, sequence) {\n var _this = _super.call(this) || this;\n _this.address = address;\n _this.coins = coins;\n _this.public_key = public_key;\n _this.account_number = account_number;\n _this.sequence = sequence;\n return _this;\n }\n Account.prototype.toData = function () {\n var _a = this, address = _a.address, coins = _a.coins, public_key = _a.public_key, account_number = _a.account_number, sequence = _a.sequence;\n return {\n type: 'core/Account',\n value: {\n address: address,\n coins: coins.toData(),\n public_key: public_key ? public_key.toData() : null,\n account_number: account_number.toFixed(),\n sequence: sequence.toFixed(),\n },\n };\n };\n Account.fromData = function (data) {\n var _a = data.value, address = _a.address, coins = _a.coins, public_key = _a.public_key, account_number = _a.account_number, sequence = _a.sequence;\n return new Account(address, Coins_1.Coins.fromData(coins), public_key ? PublicKey_1.PublicKey.fromData(public_key) : null, Number.parseInt(account_number), Number.parseInt(sequence));\n };\n return Account;\n}(json_1.JSONSerializable));\nexports.Account = Account;\n//# sourceMappingURL=Account.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LazyGradedVestingAccount = void 0;\nvar Coins_1 = require(\"../Coins\");\nvar json_1 = require(\"../../util/json\");\nvar numeric_1 = require(\"../numeric\");\nvar PublicKey_1 = require(\"../PublicKey\");\n/**\n * Holds information about a Account which has vesting information.\n */\nvar LazyGradedVestingAccount = /** @class */ (function (_super) {\n __extends(LazyGradedVestingAccount, _super);\n /**\n *\n * @param BaseAccount account information\n * @param original_vesting initial vesting amount\n * @param delegated_free\n * @param delegated_vesting\n * @param end_time -not used-\n * @param vesting_schedules Entries that make up vesting\n */\n function LazyGradedVestingAccount(address, coins, public_key, account_number, sequence, original_vesting, delegated_free, delegated_vesting, end_time, vesting_schedules) {\n var _this = _super.call(this) || this;\n _this.address = address;\n _this.coins = coins;\n _this.public_key = public_key;\n _this.account_number = account_number;\n _this.sequence = sequence;\n _this.original_vesting = original_vesting;\n _this.delegated_free = delegated_free;\n _this.delegated_vesting = delegated_vesting;\n _this.end_time = end_time;\n _this.vesting_schedules = vesting_schedules;\n return _this;\n }\n LazyGradedVestingAccount.prototype.toData = function () {\n var _a = this, address = _a.address, coins = _a.coins, public_key = _a.public_key, account_number = _a.account_number, sequence = _a.sequence, original_vesting = _a.original_vesting, delegated_free = _a.delegated_free, delegated_vesting = _a.delegated_vesting, end_time = _a.end_time, vesting_schedules = _a.vesting_schedules;\n return {\n type: 'core/LazyGradedVestingAccount',\n value: {\n address: address,\n coins: coins.toData(),\n public_key: public_key && public_key.toData(),\n account_number: account_number.toFixed(),\n sequence: sequence.toFixed(),\n original_vesting: original_vesting.toData(),\n delegated_free: delegated_free.toData(),\n delegated_vesting: delegated_vesting.toData(),\n end_time: end_time.toFixed(),\n vesting_schedules: vesting_schedules.map(function (vs) { return vs.toData(); }),\n },\n };\n };\n LazyGradedVestingAccount.fromData = function (data) {\n var _a = data.value, address = _a.address, coins = _a.coins, public_key = _a.public_key, account_number = _a.account_number, sequence = _a.sequence, original_vesting = _a.original_vesting, delegated_free = _a.delegated_free, delegated_vesting = _a.delegated_vesting, end_time = _a.end_time, vesting_schedules = _a.vesting_schedules;\n return new LazyGradedVestingAccount(address, Coins_1.Coins.fromData(coins), public_key && PublicKey_1.PublicKey.fromData(public_key), Number.parseInt(account_number), Number.parseInt(sequence), Coins_1.Coins.fromData(original_vesting), Coins_1.Coins.fromData(delegated_free), Coins_1.Coins.fromData(delegated_vesting), Number.parseInt(end_time), vesting_schedules.map(function (vs) {\n return LazyGradedVestingAccount.VestingSchedule.fromData(vs);\n }));\n };\n return LazyGradedVestingAccount;\n}(json_1.JSONSerializable));\nexports.LazyGradedVestingAccount = LazyGradedVestingAccount;\n(function (LazyGradedVestingAccount) {\n var VestingSchedule = /** @class */ (function (_super) {\n __extends(VestingSchedule, _super);\n function VestingSchedule(denom, schedules) {\n var _this = _super.call(this) || this;\n _this.denom = denom;\n _this.schedules = schedules;\n return _this;\n }\n VestingSchedule.prototype.toData = function () {\n var _a = this, denom = _a.denom, schedules = _a.schedules;\n return {\n denom: denom,\n schedules: schedules.map(function (s) { return s.toData(); }),\n };\n };\n VestingSchedule.fromData = function (data) {\n var denom = data.denom, schedules = data.schedules;\n return new VestingSchedule(denom, schedules.map(function (s) { return VestingSchedule.Entry.fromData(s); }));\n };\n return VestingSchedule;\n }(json_1.JSONSerializable));\n LazyGradedVestingAccount.VestingSchedule = VestingSchedule;\n (function (VestingSchedule) {\n var Entry = /** @class */ (function (_super) {\n __extends(Entry, _super);\n /**\n *\n * @param start_time Starting time (block height)\n * @param end_time Ending time (block height)\n * @param ratio Ratio (percentage of vested funds that should be released)\n */\n function Entry(start_time, end_time, ratio) {\n var _this = _super.call(this) || this;\n _this.start_time = start_time;\n _this.end_time = end_time;\n _this.ratio = ratio;\n return _this;\n }\n Entry.fromData = function (data) {\n var start_time = data.start_time, end_time = data.end_time, ratio = data.ratio;\n return new Entry(Number.parseInt(start_time), Number.parseInt(end_time), new numeric_1.Dec(ratio));\n };\n Entry.prototype.toData = function () {\n return {\n start_time: this.start_time.toFixed(),\n end_time: this.end_time.toFixed(),\n ratio: this.ratio.toString(),\n };\n };\n return Entry;\n }(json_1.JSONSerializable));\n VestingSchedule.Entry = Entry;\n })(VestingSchedule = LazyGradedVestingAccount.VestingSchedule || (LazyGradedVestingAccount.VestingSchedule = {}));\n})(LazyGradedVestingAccount = exports.LazyGradedVestingAccount || (exports.LazyGradedVestingAccount = {}));\nexports.LazyGradedVestingAccount = LazyGradedVestingAccount;\n//# sourceMappingURL=LazyGradedVestingAccount.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ExchangeRatePrevote = void 0;\nvar json_1 = require(\"../../util/json\");\n/**\n * Stores information about data about Oracle prevotes fetched from the blockchain.\n */\nvar ExchangeRatePrevote = /** @class */ (function (_super) {\n __extends(ExchangeRatePrevote, _super);\n /**\n *\n * @param hash vote hash.\n * @param denom denomination against LUNA reported\n * @param voter voting validator's operator address\n * @param submit_block height of block during which prevote was submitted\n */\n function ExchangeRatePrevote(hash, denom, voter, submit_block) {\n var _this = _super.call(this) || this;\n _this.hash = hash;\n _this.denom = denom;\n _this.voter = voter;\n _this.submit_block = submit_block;\n return _this;\n }\n ExchangeRatePrevote.fromData = function (data) {\n var hash = data.hash, denom = data.denom, voter = data.voter, submit_block = data.submit_block;\n return new ExchangeRatePrevote(hash, denom, voter, Number.parseInt(submit_block));\n };\n ExchangeRatePrevote.prototype.toData = function () {\n var _a = this, hash = _a.hash, denom = _a.denom, voter = _a.voter;\n return {\n hash: hash,\n denom: denom,\n voter: voter,\n submit_block: this.submit_block.toFixed(),\n };\n };\n return ExchangeRatePrevote;\n}(json_1.JSONSerializable));\nexports.ExchangeRatePrevote = ExchangeRatePrevote;\n//# sourceMappingURL=ExchangeRatePrevote.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ExchangeRateVote = void 0;\nvar json_1 = require(\"../../util/json\");\nvar numeric_1 = require(\"../numeric\");\n/**\n * The following objects capture information from the Oracle API. To submit exchange\n * rate votes or prevotes, you'll need to create a transaction with [[MsgExchangeRateVote]]\n * or [[MsgExchangeRatePrevote]] and broadcast it.\n *\n *\n */\n/**\n * Stores information about data about Oracle votes fetched from the blockchain.\n */\nvar ExchangeRateVote = /** @class */ (function (_super) {\n __extends(ExchangeRateVote, _super);\n /**\n *\n * @param exchange_rate Exchange rate reported.\n * @param denom Denomination against LUNA reported.\n * @param voter Voting validator's operator address.\n */\n function ExchangeRateVote(exchange_rate, denom, voter) {\n var _this = _super.call(this) || this;\n _this.exchange_rate = exchange_rate;\n _this.denom = denom;\n _this.voter = voter;\n return _this;\n }\n ExchangeRateVote.fromData = function (data) {\n var exchange_rate = data.exchange_rate, denom = data.denom, voter = data.voter;\n return new ExchangeRateVote(new numeric_1.Dec(exchange_rate), denom, voter);\n };\n ExchangeRateVote.prototype.toData = function () {\n var _a = this, exchange_rate = _a.exchange_rate, denom = _a.denom, voter = _a.voter;\n return {\n exchange_rate: exchange_rate.toString(),\n denom: denom,\n voter: voter,\n };\n };\n return ExchangeRateVote;\n}(json_1.JSONSerializable));\nexports.ExchangeRateVote = ExchangeRateVote;\n//# sourceMappingURL=ExchangeRateVote.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AggregateExchangeRatePrevote = void 0;\nvar json_1 = require(\"../../util/json\");\n/**\n * Stores information about data about Oracle aggregate prevotes fetched from the blockchain.\n */\nvar AggregateExchangeRatePrevote = /** @class */ (function (_super) {\n __extends(AggregateExchangeRatePrevote, _super);\n /**\n * @param hash aggregate vote hash\n * @param voter validator\n * @param submit_block block during which aggregate prevote was submitted\n */\n function AggregateExchangeRatePrevote(hash, voter, submit_block) {\n var _this = _super.call(this) || this;\n _this.hash = hash;\n _this.voter = voter;\n _this.submit_block = submit_block;\n return _this;\n }\n AggregateExchangeRatePrevote.fromData = function (data) {\n var hash = data.hash, voter = data.voter, submit_block = data.submit_block;\n return new AggregateExchangeRatePrevote(hash, voter, Number.parseInt(submit_block));\n };\n AggregateExchangeRatePrevote.prototype.toData = function () {\n var _a = this, hash = _a.hash, voter = _a.voter, submit_block = _a.submit_block;\n return {\n hash: hash,\n voter: voter,\n submit_block: submit_block.toFixed(),\n };\n };\n return AggregateExchangeRatePrevote;\n}(json_1.JSONSerializable));\nexports.AggregateExchangeRatePrevote = AggregateExchangeRatePrevote;\n//# sourceMappingURL=AggregateExchangeRatePrevote.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AggregateExchangeRateVote = void 0;\nvar json_1 = require(\"../../util/json\");\nvar Coin_1 = require(\"../Coin\");\nvar Coins_1 = require(\"../Coins\");\n/**\n * Stores information about data about Oracle aggregate vote fetched from the blockchain.\n */\nvar AggregateExchangeRateVote = /** @class */ (function (_super) {\n __extends(AggregateExchangeRateVote, _super);\n /**\n * @param exchange_rate_tuples exchange rates for LUNA\n * @param voter validator\n */\n function AggregateExchangeRateVote(exchange_rate_tuples, voter) {\n var _this = _super.call(this) || this;\n _this.exchange_rate_tuples = exchange_rate_tuples;\n _this.voter = voter;\n return _this;\n }\n AggregateExchangeRateVote.fromData = function (data) {\n var exchange_rate_tuples = data.exchange_rate_tuples, voter = data.voter;\n var xr_coins = new Coins_1.Coins(exchange_rate_tuples.map(function (t) { return new Coin_1.Coin(t.denom, t.exchange_rate); })).toDecCoins();\n return new AggregateExchangeRateVote(xr_coins, voter);\n };\n AggregateExchangeRateVote.prototype.toData = function () {\n var _a = this, exchange_rate_tuples = _a.exchange_rate_tuples, voter = _a.voter;\n return {\n exchange_rate_tuples: exchange_rate_tuples.map(function (c) { return ({\n denom: c.denom,\n exchange_rate: c.amount.toString(),\n }); }),\n voter: voter,\n };\n };\n return AggregateExchangeRateVote;\n}(json_1.JSONSerializable));\nexports.AggregateExchangeRateVote = AggregateExchangeRateVote;\n//# sourceMappingURL=AggregateExchangeRateVote.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UnbondingDelegation = void 0;\nvar json_1 = require(\"../../util/json\");\nvar numeric_1 = require(\"../numeric\");\n/**\n * When a delegator decides to take out their funds from the staking pool, they must\n * unbond their tokens which takes an amount of time specified by `unbonding_time`\n * parameter in the staking module.\n *\n * An unbonding delegation is implemented through creating [[UnbondingDelegation.Entry]]\n * objects, limited by the max_entry parameter in the staking module params. You cannot\n * initiate unbonds more times than the amount of entries permitted. Entries are cleared\n * when their unbonding periods are completed and the funds are returned to the\n * delegator's account balance to be spent freely.\n */\nvar UnbondingDelegation = /** @class */ (function (_super) {\n __extends(UnbondingDelegation, _super);\n function UnbondingDelegation(delegator_address, validator_address, entries) {\n var _this = _super.call(this) || this;\n _this.delegator_address = delegator_address;\n _this.validator_address = validator_address;\n _this.entries = entries;\n return _this;\n }\n UnbondingDelegation.fromData = function (data) {\n var delegator_address = data.delegator_address, validator_address = data.validator_address, entries = data.entries;\n return new UnbondingDelegation(delegator_address, validator_address, entries.map(function (e) { return UnbondingDelegation.Entry.fromData(e); }));\n };\n UnbondingDelegation.prototype.toData = function () {\n var _a = this, delegator_address = _a.delegator_address, validator_address = _a.validator_address, entries = _a.entries;\n return {\n delegator_address: delegator_address,\n validator_address: validator_address,\n entries: entries.map(function (e) { return e.toData(); }),\n };\n };\n return UnbondingDelegation;\n}(json_1.JSONSerializable));\nexports.UnbondingDelegation = UnbondingDelegation;\n(function (UnbondingDelegation) {\n var Entry = /** @class */ (function (_super) {\n __extends(Entry, _super);\n /**\n * Note that the size of the undelegation is `initial_balance - balance`\n * @param initial_balance balance of delegation prior to initiating unbond\n * @param balance balance of delegation after initiating unbond\n * @param creation_height height of blockchain when entry was created\n * @param completion_time time when unbonding will be completed\n */\n function Entry(initial_balance, balance, creation_height, completion_time) {\n var _this = _super.call(this) || this;\n _this.initial_balance = initial_balance;\n _this.balance = balance;\n _this.creation_height = creation_height;\n _this.completion_time = completion_time;\n return _this;\n }\n Entry.prototype.toData = function () {\n return {\n initial_balance: this.initial_balance.toString(),\n balance: this.balance.toString(),\n creation_height: this.creation_height.toFixed(),\n completion_time: this.completion_time.toISOString(),\n };\n };\n Entry.fromData = function (data) {\n var initial_balance = data.initial_balance, balance = data.balance, creation_height = data.creation_height, completion_time = data.completion_time;\n return new Entry(new numeric_1.Int(initial_balance), new numeric_1.Int(balance), Number.parseInt(creation_height), new Date(completion_time));\n };\n return Entry;\n }(json_1.JSONSerializable));\n UnbondingDelegation.Entry = Entry;\n})(UnbondingDelegation = exports.UnbondingDelegation || (exports.UnbondingDelegation = {}));\nexports.UnbondingDelegation = UnbondingDelegation;\n//# sourceMappingURL=UnbondingDelegation.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ValConsPubKey = exports.ValPubKey = exports.AccPubKey = exports.ValConsAddress = exports.ValAddress = exports.AccAddress = void 0;\nvar bech32 = __importStar(require(\"bech32\"));\nfunction checkPrefixAndLength(prefix, data, length) {\n try {\n var vals = bech32.decode(data);\n return vals.prefix === prefix && data.length == length;\n }\n catch (e) {\n return false;\n }\n}\nvar AccAddress;\n(function (AccAddress) {\n /**\n * Checks if a string is a valid Terra account address.\n *\n * @param data string to check\n */\n function validate(data) {\n return checkPrefixAndLength('terra', data, 44);\n }\n AccAddress.validate = validate;\n /**\n * Converts a validator address into an account address\n *\n * @param address validator address\n */\n function fromValAddress(address) {\n var vals = bech32.decode(address);\n return bech32.encode('terra', vals.words);\n }\n AccAddress.fromValAddress = fromValAddress;\n})(AccAddress = exports.AccAddress || (exports.AccAddress = {}));\nvar ValAddress;\n(function (ValAddress) {\n /**\n * Checks if a string is a Terra validator address.\n *\n * @param data string to check\n */\n function validate(data) {\n return checkPrefixAndLength('terravaloper', data, 51);\n }\n ValAddress.validate = validate;\n /**\n * Converts a Terra account address to a validator address.\n * @param address account address to convert\n */\n function fromAccAddress(address) {\n var vals = bech32.decode(address);\n return bech32.encode('terravaloper', vals.words);\n }\n ValAddress.fromAccAddress = fromAccAddress;\n})(ValAddress = exports.ValAddress || (exports.ValAddress = {}));\nvar ValConsAddress;\n(function (ValConsAddress) {\n /**\n * Checks if a string is a Terra validator consensus address\n * @param data string to check\n */\n function validate(data) {\n return checkPrefixAndLength('terravalcons', data, 51);\n }\n ValConsAddress.validate = validate;\n})(ValConsAddress = exports.ValConsAddress || (exports.ValConsAddress = {}));\nvar AccPubKey;\n(function (AccPubKey) {\n /**\n * Checks if a string is a Terra validator consensus address\n * @param data string to check\n */\n function validate(data) {\n return checkPrefixAndLength('terrapub', data, 76);\n }\n AccPubKey.validate = validate;\n /**\n * Converts a Terra validator pubkey to an account pubkey.\n * @param address validator pubkey to convert\n */\n function fromValPubKey(pubkey) {\n var vals = bech32.decode(pubkey);\n return bech32.encode('terrapub', vals.words);\n }\n AccPubKey.fromValPubKey = fromValPubKey;\n})(AccPubKey = exports.AccPubKey || (exports.AccPubKey = {}));\nvar ValPubKey;\n(function (ValPubKey) {\n /**\n * Checks if a string is a Terra validator pubkey\n * @param data string to check\n */\n function validate(data) {\n return checkPrefixAndLength('terravaloperpub', data, 83);\n }\n ValPubKey.validate = validate;\n /**\n * Converts a Terra account pubkey to a validator pubkey.\n * @param pubkey account pubkey\n */\n function fromAccPubKey(pubkey) {\n var vals = bech32.decode(pubkey);\n return bech32.encode('terravaloperpub', vals.words);\n }\n ValPubKey.fromAccPubKey = fromAccPubKey;\n})(ValPubKey = exports.ValPubKey || (exports.ValPubKey = {}));\nvar ValConsPubKey;\n(function (ValConsPubKey) {\n /**\n * Checks if string is a valid Terra consensus (node) pubkey.\n * @param data string to check\n */\n function validate(data) {\n return checkPrefixAndLength('terravalconspub', data, 83);\n }\n ValConsPubKey.validate = validate;\n})(ValConsPubKey = exports.ValConsPubKey || (exports.ValConsPubKey = {}));\n//# sourceMappingURL=strings.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./Key\"), exports);\n__exportStar(require(\"./MnemonicKey\"), exports);\n__exportStar(require(\"./RawKey\"), exports);\n//# sourceMappingURL=index.js.map",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\treturn CryptoJS.enc.Hex;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/** @preserve\n\t(c) 2012 by Cédric Mesnil. All rights reserved.\n\n\tRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n\t - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\t - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\n\tTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\t*/\n\n\t(function (Math) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var Hasher = C_lib.Hasher;\n\t var C_algo = C.algo;\n\n\t // Constants table\n\t var _zl = WordArray.create([\n\t 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n\t 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n\t 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,\n\t 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,\n\t 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]);\n\t var _zr = WordArray.create([\n\t 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,\n\t 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,\n\t 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,\n\t 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,\n\t 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]);\n\t var _sl = WordArray.create([\n\t 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,\n\t 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,\n\t 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,\n\t 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,\n\t 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]);\n\t var _sr = WordArray.create([\n\t 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,\n\t 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,\n\t 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,\n\t 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,\n\t 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]);\n\n\t var _hl = WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]);\n\t var _hr = WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]);\n\n\t /**\n\t * RIPEMD160 hash algorithm.\n\t */\n\t var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({\n\t _doReset: function () {\n\t this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]);\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\n\t // Swap endian\n\t for (var i = 0; i < 16; i++) {\n\t // Shortcuts\n\t var offset_i = offset + i;\n\t var M_offset_i = M[offset_i];\n\n\t // Swap\n\t M[offset_i] = (\n\t (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |\n\t (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)\n\t );\n\t }\n\t // Shortcut\n\t var H = this._hash.words;\n\t var hl = _hl.words;\n\t var hr = _hr.words;\n\t var zl = _zl.words;\n\t var zr = _zr.words;\n\t var sl = _sl.words;\n\t var sr = _sr.words;\n\n\t // Working variables\n\t var al, bl, cl, dl, el;\n\t var ar, br, cr, dr, er;\n\n\t ar = al = H[0];\n\t br = bl = H[1];\n\t cr = cl = H[2];\n\t dr = dl = H[3];\n\t er = el = H[4];\n\t // Computation\n\t var t;\n\t for (var i = 0; i < 80; i += 1) {\n\t t = (al + M[offset+zl[i]])|0;\n\t if (i<16){\n\t\t t += f1(bl,cl,dl) + hl[0];\n\t } else if (i<32) {\n\t\t t += f2(bl,cl,dl) + hl[1];\n\t } else if (i<48) {\n\t\t t += f3(bl,cl,dl) + hl[2];\n\t } else if (i<64) {\n\t\t t += f4(bl,cl,dl) + hl[3];\n\t } else {// if (i<80) {\n\t\t t += f5(bl,cl,dl) + hl[4];\n\t }\n\t t = t|0;\n\t t = rotl(t,sl[i]);\n\t t = (t+el)|0;\n\t al = el;\n\t el = dl;\n\t dl = rotl(cl, 10);\n\t cl = bl;\n\t bl = t;\n\n\t t = (ar + M[offset+zr[i]])|0;\n\t if (i<16){\n\t\t t += f5(br,cr,dr) + hr[0];\n\t } else if (i<32) {\n\t\t t += f4(br,cr,dr) + hr[1];\n\t } else if (i<48) {\n\t\t t += f3(br,cr,dr) + hr[2];\n\t } else if (i<64) {\n\t\t t += f2(br,cr,dr) + hr[3];\n\t } else {// if (i<80) {\n\t\t t += f1(br,cr,dr) + hr[4];\n\t }\n\t t = t|0;\n\t t = rotl(t,sr[i]) ;\n\t t = (t+er)|0;\n\t ar = er;\n\t er = dr;\n\t dr = rotl(cr, 10);\n\t cr = br;\n\t br = t;\n\t }\n\t // Intermediate hash value\n\t t = (H[1] + cl + dr)|0;\n\t H[1] = (H[2] + dl + er)|0;\n\t H[2] = (H[3] + el + ar)|0;\n\t H[3] = (H[4] + al + br)|0;\n\t H[4] = (H[0] + bl + cr)|0;\n\t H[0] = t;\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (\n\t (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) |\n\t (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00)\n\t );\n\t data.sigBytes = (dataWords.length + 1) * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Shortcuts\n\t var hash = this._hash;\n\t var H = hash.words;\n\n\t // Swap endian\n\t for (var i = 0; i < 5; i++) {\n\t // Shortcut\n\t var H_i = H[i];\n\n\t // Swap\n\t H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |\n\t (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);\n\t }\n\n\t // Return final computed hash\n\t return hash;\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\t clone._hash = this._hash.clone();\n\n\t return clone;\n\t }\n\t });\n\n\n\t function f1(x, y, z) {\n\t return ((x) ^ (y) ^ (z));\n\n\t }\n\n\t function f2(x, y, z) {\n\t return (((x)&(y)) | ((~x)&(z)));\n\t }\n\n\t function f3(x, y, z) {\n\t return (((x) | (~(y))) ^ (z));\n\t }\n\n\t function f4(x, y, z) {\n\t return (((x) & (z)) | ((y)&(~(z))));\n\t }\n\n\t function f5(x, y, z) {\n\t return ((x) ^ ((y) |(~(z))));\n\n\t }\n\n\t function rotl(x,n) {\n\t return (x<>>(32-n));\n\t }\n\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.RIPEMD160('message');\n\t * var hash = CryptoJS.RIPEMD160(wordArray);\n\t */\n\t C.RIPEMD160 = Hasher._createHelper(RIPEMD160);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacRIPEMD160(message, key);\n\t */\n\t C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160);\n\t}(Math));\n\n\n\treturn CryptoJS.RIPEMD160;\n\n}));","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar bip32_1 = require(\"./bip32\");\nexports.fromSeed = bip32_1.fromSeed;\nexports.fromBase58 = bip32_1.fromBase58;\nexports.fromPublicKey = bip32_1.fromPublicKey;\nexports.fromPrivateKey = bip32_1.fromPrivateKey;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst crypto = require(\"./crypto\");\nconst bs58check = require('bs58check');\nconst ecc = require('tiny-secp256k1');\nconst typeforce = require('typeforce');\nconst wif = require('wif');\nconst UINT256_TYPE = typeforce.BufferN(32);\nconst NETWORK_TYPE = typeforce.compile({\n wif: typeforce.UInt8,\n bip32: {\n public: typeforce.UInt32,\n private: typeforce.UInt32,\n },\n});\nconst BITCOIN = {\n messagePrefix: '\\x18Bitcoin Signed Message:\\n',\n bech32: 'bc',\n bip32: {\n public: 0x0488b21e,\n private: 0x0488ade4,\n },\n pubKeyHash: 0x00,\n scriptHash: 0x05,\n wif: 0x80,\n};\nconst HIGHEST_BIT = 0x80000000;\nconst UINT31_MAX = Math.pow(2, 31) - 1;\nfunction BIP32Path(value) {\n return (typeforce.String(value) && value.match(/^(m\\/)?(\\d+'?\\/)*\\d+'?$/) !== null);\n}\nfunction UInt31(value) {\n return typeforce.UInt32(value) && value <= UINT31_MAX;\n}\nclass BIP32 {\n constructor(__D, __Q, chainCode, network, __DEPTH = 0, __INDEX = 0, __PARENT_FINGERPRINT = 0x00000000) {\n this.__D = __D;\n this.__Q = __Q;\n this.chainCode = chainCode;\n this.network = network;\n this.__DEPTH = __DEPTH;\n this.__INDEX = __INDEX;\n this.__PARENT_FINGERPRINT = __PARENT_FINGERPRINT;\n typeforce(NETWORK_TYPE, network);\n this.lowR = false;\n }\n get depth() {\n return this.__DEPTH;\n }\n get index() {\n return this.__INDEX;\n }\n get parentFingerprint() {\n return this.__PARENT_FINGERPRINT;\n }\n get publicKey() {\n if (this.__Q === undefined)\n this.__Q = ecc.pointFromScalar(this.__D, true);\n return this.__Q;\n }\n get privateKey() {\n return this.__D;\n }\n get identifier() {\n return crypto.hash160(this.publicKey);\n }\n get fingerprint() {\n return this.identifier.slice(0, 4);\n }\n get compressed() {\n return true;\n }\n // Private === not neutered\n // Public === neutered\n isNeutered() {\n return this.__D === undefined;\n }\n neutered() {\n return fromPublicKeyLocal(this.publicKey, this.chainCode, this.network, this.depth, this.index, this.parentFingerprint);\n }\n toBase58() {\n const network = this.network;\n const version = !this.isNeutered()\n ? network.bip32.private\n : network.bip32.public;\n const buffer = Buffer.allocUnsafe(78);\n // 4 bytes: version bytes\n buffer.writeUInt32BE(version, 0);\n // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, ....\n buffer.writeUInt8(this.depth, 4);\n // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key)\n buffer.writeUInt32BE(this.parentFingerprint, 5);\n // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized.\n // This is encoded in big endian. (0x00000000 if master key)\n buffer.writeUInt32BE(this.index, 9);\n // 32 bytes: the chain code\n this.chainCode.copy(buffer, 13);\n // 33 bytes: the public key or private key data\n if (!this.isNeutered()) {\n // 0x00 + k for private keys\n buffer.writeUInt8(0, 45);\n this.privateKey.copy(buffer, 46);\n // 33 bytes: the public key\n }\n else {\n // X9.62 encoding for public keys\n this.publicKey.copy(buffer, 45);\n }\n return bs58check.encode(buffer);\n }\n toWIF() {\n if (!this.privateKey)\n throw new TypeError('Missing private key');\n return wif.encode(this.network.wif, this.privateKey, true);\n }\n // https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#child-key-derivation-ckd-functions\n derive(index) {\n typeforce(typeforce.UInt32, index);\n const isHardened = index >= HIGHEST_BIT;\n const data = Buffer.allocUnsafe(37);\n // Hardened child\n if (isHardened) {\n if (this.isNeutered())\n throw new TypeError('Missing private key for hardened child key');\n // data = 0x00 || ser256(kpar) || ser32(index)\n data[0] = 0x00;\n this.privateKey.copy(data, 1);\n data.writeUInt32BE(index, 33);\n // Normal child\n }\n else {\n // data = serP(point(kpar)) || ser32(index)\n // = serP(Kpar) || ser32(index)\n this.publicKey.copy(data, 0);\n data.writeUInt32BE(index, 33);\n }\n const I = crypto.hmacSHA512(this.chainCode, data);\n const IL = I.slice(0, 32);\n const IR = I.slice(32);\n // if parse256(IL) >= n, proceed with the next value for i\n if (!ecc.isPrivate(IL))\n return this.derive(index + 1);\n // Private parent key -> private child key\n let hd;\n if (!this.isNeutered()) {\n // ki = parse256(IL) + kpar (mod n)\n const ki = ecc.privateAdd(this.privateKey, IL);\n // In case ki == 0, proceed with the next value for i\n if (ki == null)\n return this.derive(index + 1);\n hd = fromPrivateKeyLocal(ki, IR, this.network, this.depth + 1, index, this.fingerprint.readUInt32BE(0));\n // Public parent key -> public child key\n }\n else {\n // Ki = point(parse256(IL)) + Kpar\n // = G*IL + Kpar\n const Ki = ecc.pointAddScalar(this.publicKey, IL, true);\n // In case Ki is the point at infinity, proceed with the next value for i\n if (Ki === null)\n return this.derive(index + 1);\n hd = fromPublicKeyLocal(Ki, IR, this.network, this.depth + 1, index, this.fingerprint.readUInt32BE(0));\n }\n return hd;\n }\n deriveHardened(index) {\n typeforce(UInt31, index);\n // Only derives hardened private keys by default\n return this.derive(index + HIGHEST_BIT);\n }\n derivePath(path) {\n typeforce(BIP32Path, path);\n let splitPath = path.split('/');\n if (splitPath[0] === 'm') {\n if (this.parentFingerprint)\n throw new TypeError('Expected master, got child');\n splitPath = splitPath.slice(1);\n }\n return splitPath.reduce((prevHd, indexStr) => {\n let index;\n if (indexStr.slice(-1) === `'`) {\n index = parseInt(indexStr.slice(0, -1), 10);\n return prevHd.deriveHardened(index);\n }\n else {\n index = parseInt(indexStr, 10);\n return prevHd.derive(index);\n }\n }, this);\n }\n sign(hash, lowR) {\n if (!this.privateKey)\n throw new Error('Missing private key');\n if (lowR === undefined)\n lowR = this.lowR;\n if (lowR === false) {\n return ecc.sign(hash, this.privateKey);\n }\n else {\n let sig = ecc.sign(hash, this.privateKey);\n const extraData = Buffer.alloc(32, 0);\n let counter = 0;\n // if first try is lowR, skip the loop\n // for second try and on, add extra entropy counting up\n while (sig[0] > 0x7f) {\n counter++;\n extraData.writeUIntLE(counter, 0, 6);\n sig = ecc.signWithEntropy(hash, this.privateKey, extraData);\n }\n return sig;\n }\n }\n verify(hash, signature) {\n return ecc.verify(hash, this.publicKey, signature);\n }\n}\nfunction fromBase58(inString, network) {\n const buffer = bs58check.decode(inString);\n if (buffer.length !== 78)\n throw new TypeError('Invalid buffer length');\n network = network || BITCOIN;\n // 4 bytes: version bytes\n const version = buffer.readUInt32BE(0);\n if (version !== network.bip32.private && version !== network.bip32.public)\n throw new TypeError('Invalid network version');\n // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, ...\n const depth = buffer[4];\n // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key)\n const parentFingerprint = buffer.readUInt32BE(5);\n if (depth === 0) {\n if (parentFingerprint !== 0x00000000)\n throw new TypeError('Invalid parent fingerprint');\n }\n // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized.\n // This is encoded in MSB order. (0x00000000 if master key)\n const index = buffer.readUInt32BE(9);\n if (depth === 0 && index !== 0)\n throw new TypeError('Invalid index');\n // 32 bytes: the chain code\n const chainCode = buffer.slice(13, 45);\n let hd;\n // 33 bytes: private key data (0x00 + k)\n if (version === network.bip32.private) {\n if (buffer.readUInt8(45) !== 0x00)\n throw new TypeError('Invalid private key');\n const k = buffer.slice(46, 78);\n hd = fromPrivateKeyLocal(k, chainCode, network, depth, index, parentFingerprint);\n // 33 bytes: public key data (0x02 + X or 0x03 + X)\n }\n else {\n const X = buffer.slice(45, 78);\n hd = fromPublicKeyLocal(X, chainCode, network, depth, index, parentFingerprint);\n }\n return hd;\n}\nexports.fromBase58 = fromBase58;\nfunction fromPrivateKey(privateKey, chainCode, network) {\n return fromPrivateKeyLocal(privateKey, chainCode, network);\n}\nexports.fromPrivateKey = fromPrivateKey;\nfunction fromPrivateKeyLocal(privateKey, chainCode, network, depth, index, parentFingerprint) {\n typeforce({\n privateKey: UINT256_TYPE,\n chainCode: UINT256_TYPE,\n }, { privateKey, chainCode });\n network = network || BITCOIN;\n if (!ecc.isPrivate(privateKey))\n throw new TypeError('Private key not in range [1, n)');\n return new BIP32(privateKey, undefined, chainCode, network, depth, index, parentFingerprint);\n}\nfunction fromPublicKey(publicKey, chainCode, network) {\n return fromPublicKeyLocal(publicKey, chainCode, network);\n}\nexports.fromPublicKey = fromPublicKey;\nfunction fromPublicKeyLocal(publicKey, chainCode, network, depth, index, parentFingerprint) {\n typeforce({\n publicKey: typeforce.BufferN(33),\n chainCode: UINT256_TYPE,\n }, { publicKey, chainCode });\n network = network || BITCOIN;\n // verify the X coordinate is a point on the curve\n if (!ecc.isPoint(publicKey))\n throw new TypeError('Point is not on the curve');\n return new BIP32(undefined, publicKey, chainCode, network, depth, index, parentFingerprint);\n}\nfunction fromSeed(seed, network) {\n typeforce(typeforce.Buffer, seed);\n if (seed.length < 16)\n throw new TypeError('Seed should be at least 128 bits');\n if (seed.length > 64)\n throw new TypeError('Seed should be at most 512 bits');\n network = network || BITCOIN;\n const I = crypto.hmacSHA512(Buffer.from('Bitcoin seed', 'utf8'), seed);\n const IL = I.slice(0, 32);\n const IR = I.slice(32);\n return fromPrivateKey(IL, IR, network);\n}\nexports.fromSeed = fromSeed;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst createHash = require('create-hash');\nconst createHmac = require('create-hmac');\nfunction hash160(buffer) {\n const sha256Hash = createHash('sha256')\n .update(buffer)\n .digest();\n try {\n return createHash('rmd160')\n .update(sha256Hash)\n .digest();\n }\n catch (err) {\n return createHash('ripemd160')\n .update(sha256Hash)\n .digest();\n }\n}\nexports.hash160 = hash160;\nfunction hmacSHA512(key, data) {\n return createHmac('sha512', key)\n .update(data)\n .digest();\n}\nexports.hmacSHA512 = hmacSHA512;\n","'use strict'\n\nvar base58 = require('bs58')\nvar Buffer = require('safe-buffer').Buffer\n\nmodule.exports = function (checksumFn) {\n // Encode a buffer as a base58-check encoded string\n function encode (payload) {\n var checksum = checksumFn(payload)\n\n return base58.encode(Buffer.concat([\n payload,\n checksum\n ], payload.length + 4))\n }\n\n function decodeRaw (buffer) {\n var payload = buffer.slice(0, -4)\n var checksum = buffer.slice(-4)\n var newChecksum = checksumFn(payload)\n\n if (checksum[0] ^ newChecksum[0] |\n checksum[1] ^ newChecksum[1] |\n checksum[2] ^ newChecksum[2] |\n checksum[3] ^ newChecksum[3]) return\n\n return payload\n }\n\n // Decode a base58-check encoded string to a buffer, no result if checksum is wrong\n function decodeUnsafe (string) {\n var buffer = base58.decodeUnsafe(string)\n if (!buffer) return\n\n return decodeRaw(buffer)\n }\n\n function decode (string) {\n var buffer = base58.decode(string)\n var payload = decodeRaw(buffer, checksumFn)\n if (!payload) throw new Error('Invalid checksum')\n return payload\n }\n\n return {\n encode: encode,\n decode: decode,\n decodeUnsafe: decodeUnsafe\n }\n}\n","var basex = require('base-x')\nvar ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\n\nmodule.exports = basex(ALPHABET)\n","'use strict'\n// base-x encoding / decoding\n// Copyright (c) 2018 base-x contributors\n// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)\n// Distributed under the MIT software license, see the accompanying\n// file LICENSE or http://www.opensource.org/licenses/mit-license.php.\n// @ts-ignore\nvar _Buffer = require('safe-buffer').Buffer\nfunction base (ALPHABET) {\n if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }\n var BASE_MAP = new Uint8Array(256)\n for (var j = 0; j < BASE_MAP.length; j++) {\n BASE_MAP[j] = 255\n }\n for (var i = 0; i < ALPHABET.length; i++) {\n var x = ALPHABET.charAt(i)\n var xc = x.charCodeAt(0)\n if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }\n BASE_MAP[xc] = i\n }\n var BASE = ALPHABET.length\n var LEADER = ALPHABET.charAt(0)\n var FACTOR = Math.log(BASE) / Math.log(256) // log(BASE) / log(256), rounded up\n var iFACTOR = Math.log(256) / Math.log(BASE) // log(256) / log(BASE), rounded up\n function encode (source) {\n if (Array.isArray(source) || source instanceof Uint8Array) { source = _Buffer.from(source) }\n if (!_Buffer.isBuffer(source)) { throw new TypeError('Expected Buffer') }\n if (source.length === 0) { return '' }\n // Skip & count leading zeroes.\n var zeroes = 0\n var length = 0\n var pbegin = 0\n var pend = source.length\n while (pbegin !== pend && source[pbegin] === 0) {\n pbegin++\n zeroes++\n }\n // Allocate enough space in big-endian base58 representation.\n var size = ((pend - pbegin) * iFACTOR + 1) >>> 0\n var b58 = new Uint8Array(size)\n // Process the bytes.\n while (pbegin !== pend) {\n var carry = source[pbegin]\n // Apply \"b58 = b58 * 256 + ch\".\n var i = 0\n for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {\n carry += (256 * b58[it1]) >>> 0\n b58[it1] = (carry % BASE) >>> 0\n carry = (carry / BASE) >>> 0\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i\n pbegin++\n }\n // Skip leading zeroes in base58 result.\n var it2 = size - length\n while (it2 !== size && b58[it2] === 0) {\n it2++\n }\n // Translate the result into a string.\n var str = LEADER.repeat(zeroes)\n for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]) }\n return str\n }\n function decodeUnsafe (source) {\n if (typeof source !== 'string') { throw new TypeError('Expected String') }\n if (source.length === 0) { return _Buffer.alloc(0) }\n var psz = 0\n // Skip leading spaces.\n if (source[psz] === ' ') { return }\n // Skip and count leading '1's.\n var zeroes = 0\n var length = 0\n while (source[psz] === LEADER) {\n zeroes++\n psz++\n }\n // Allocate enough space in big-endian base256 representation.\n var size = (((source.length - psz) * FACTOR) + 1) >>> 0 // log(58) / log(256), rounded up.\n var b256 = new Uint8Array(size)\n // Process the characters.\n while (source[psz]) {\n // Decode character\n var carry = BASE_MAP[source.charCodeAt(psz)]\n // Invalid character\n if (carry === 255) { return }\n var i = 0\n for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {\n carry += (BASE * b256[it3]) >>> 0\n b256[it3] = (carry % 256) >>> 0\n carry = (carry / 256) >>> 0\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i\n psz++\n }\n // Skip trailing spaces.\n if (source[psz] === ' ') { return }\n // Skip leading zeroes in b256.\n var it4 = size - length\n while (it4 !== size && b256[it4] === 0) {\n it4++\n }\n var vch = _Buffer.allocUnsafe(zeroes + (size - it4))\n vch.fill(0x00, 0, zeroes)\n var j = zeroes\n while (it4 !== size) {\n vch[j++] = b256[it4++]\n }\n return vch\n }\n function decode (string) {\n var buffer = decodeUnsafe(string)\n if (buffer) { return buffer }\n throw new Error('Non-base' + BASE + ' character')\n }\n return {\n encode: encode,\n decodeUnsafe: decodeUnsafe,\n decode: decode\n }\n}\nmodule.exports = base\n","'use strict'\n\ntry {\n module.exports = require('./native')\n} catch (err) {\n module.exports = require('./js')\n}\n","'use strict'\n\nlet binding = require('bindings')('secp256k1')\ndelete binding.path\n\n// NaN drops function names, add them for is* (via toJSON)\nfor (let key in binding) {\n if (key.indexOf('is') !== 0) continue\n\n binding[key].toJSON = function () { return key }\n}\n\nmodule.exports = binding\n","/**\n * Module dependencies.\n */\n\nvar fs = require('fs'),\n path = require('path'),\n fileURLToPath = require('file-uri-to-path'),\n join = path.join,\n dirname = path.dirname,\n exists =\n (fs.accessSync &&\n function(path) {\n try {\n fs.accessSync(path);\n } catch (e) {\n return false;\n }\n return true;\n }) ||\n fs.existsSync ||\n path.existsSync,\n defaults = {\n arrow: process.env.NODE_BINDINGS_ARROW || ' → ',\n compiled: process.env.NODE_BINDINGS_COMPILED_DIR || 'compiled',\n platform: process.platform,\n arch: process.arch,\n nodePreGyp:\n 'node-v' +\n process.versions.modules +\n '-' +\n process.platform +\n '-' +\n process.arch,\n version: process.versions.node,\n bindings: 'bindings.node',\n try: [\n // node-gyp's linked version in the \"build\" dir\n ['module_root', 'build', 'bindings'],\n // node-waf and gyp_addon (a.k.a node-gyp)\n ['module_root', 'build', 'Debug', 'bindings'],\n ['module_root', 'build', 'Release', 'bindings'],\n // Debug files, for development (legacy behavior, remove for node v0.9)\n ['module_root', 'out', 'Debug', 'bindings'],\n ['module_root', 'Debug', 'bindings'],\n // Release files, but manually compiled (legacy behavior, remove for node v0.9)\n ['module_root', 'out', 'Release', 'bindings'],\n ['module_root', 'Release', 'bindings'],\n // Legacy from node-waf, node <= 0.4.x\n ['module_root', 'build', 'default', 'bindings'],\n // Production \"Release\" buildtype binary (meh...)\n ['module_root', 'compiled', 'version', 'platform', 'arch', 'bindings'],\n // node-qbs builds\n ['module_root', 'addon-build', 'release', 'install-root', 'bindings'],\n ['module_root', 'addon-build', 'debug', 'install-root', 'bindings'],\n ['module_root', 'addon-build', 'default', 'install-root', 'bindings'],\n // node-pre-gyp path ./lib/binding/{node_abi}-{platform}-{arch}\n ['module_root', 'lib', 'binding', 'nodePreGyp', 'bindings']\n ]\n };\n\n/**\n * The main `bindings()` function loads the compiled bindings for a given module.\n * It uses V8's Error API to determine the parent filename that this function is\n * being invoked from, which is then used to find the root directory.\n */\n\nfunction bindings(opts) {\n // Argument surgery\n if (typeof opts == 'string') {\n opts = { bindings: opts };\n } else if (!opts) {\n opts = {};\n }\n\n // maps `defaults` onto `opts` object\n Object.keys(defaults).map(function(i) {\n if (!(i in opts)) opts[i] = defaults[i];\n });\n\n // Get the module root\n if (!opts.module_root) {\n opts.module_root = exports.getRoot(exports.getFileName());\n }\n\n // Ensure the given bindings name ends with .node\n if (path.extname(opts.bindings) != '.node') {\n opts.bindings += '.node';\n }\n\n // https://github.com/webpack/webpack/issues/4175#issuecomment-342931035\n var requireFunc =\n typeof __webpack_require__ === 'function'\n ? __non_webpack_require__\n : require;\n\n var tries = [],\n i = 0,\n l = opts.try.length,\n n,\n b,\n err;\n\n for (; i < l; i++) {\n n = join.apply(\n null,\n opts.try[i].map(function(p) {\n return opts[p] || p;\n })\n );\n tries.push(n);\n try {\n b = opts.path ? requireFunc.resolve(n) : requireFunc(n);\n if (!opts.path) {\n b.path = n;\n }\n return b;\n } catch (e) {\n if (e.code !== 'MODULE_NOT_FOUND' &&\n e.code !== 'QUALIFIED_PATH_RESOLUTION_FAILED' &&\n !/not find/i.test(e.message)) {\n throw e;\n }\n }\n }\n\n err = new Error(\n 'Could not locate the bindings file. Tried:\\n' +\n tries\n .map(function(a) {\n return opts.arrow + a;\n })\n .join('\\n')\n );\n err.tries = tries;\n throw err;\n}\nmodule.exports = exports = bindings;\n\n/**\n * Gets the filename of the JavaScript file that invokes this function.\n * Used to help find the root directory of a module.\n * Optionally accepts an filename argument to skip when searching for the invoking filename\n */\n\nexports.getFileName = function getFileName(calling_file) {\n var origPST = Error.prepareStackTrace,\n origSTL = Error.stackTraceLimit,\n dummy = {},\n fileName;\n\n Error.stackTraceLimit = 10;\n\n Error.prepareStackTrace = function(e, st) {\n for (var i = 0, l = st.length; i < l; i++) {\n fileName = st[i].getFileName();\n if (fileName !== __filename) {\n if (calling_file) {\n if (fileName !== calling_file) {\n return;\n }\n } else {\n return;\n }\n }\n }\n };\n\n // run the 'prepareStackTrace' function above\n Error.captureStackTrace(dummy);\n dummy.stack;\n\n // cleanup\n Error.prepareStackTrace = origPST;\n Error.stackTraceLimit = origSTL;\n\n // handle filename that starts with \"file://\"\n var fileSchema = 'file://';\n if (fileName.indexOf(fileSchema) === 0) {\n fileName = fileURLToPath(fileName);\n }\n\n return fileName;\n};\n\n/**\n * Gets the root directory of a module, given an arbitrary filename\n * somewhere in the module tree. The \"root directory\" is the directory\n * containing the `package.json` file.\n *\n * In: /home/nate/node-native-module/lib/index.js\n * Out: /home/nate/node-native-module\n */\n\nexports.getRoot = function getRoot(file) {\n var dir = dirname(file),\n prev;\n while (true) {\n if (dir === '.') {\n // Avoids an infinite loop in rare cases, like the REPL\n dir = process.cwd();\n }\n if (\n exists(join(dir, 'package.json')) ||\n exists(join(dir, 'node_modules'))\n ) {\n // Found the 'package.json' file or 'node_modules' dir; we're done\n return dir;\n }\n if (prev === dir) {\n // Got to the top\n throw new Error(\n 'Could not find module root given file: \"' +\n file +\n '\". Do you have a `package.json` file? '\n );\n }\n // Try the parent dir next\n prev = dir;\n dir = join(dir, '..');\n }\n};\n","\n/**\n * Module dependencies.\n */\n\nvar sep = require('path').sep || '/';\n\n/**\n * Module exports.\n */\n\nmodule.exports = fileUriToPath;\n\n/**\n * File URI to Path function.\n *\n * @param {String} uri\n * @return {String} path\n * @api public\n */\n\nfunction fileUriToPath (uri) {\n if ('string' != typeof uri ||\n uri.length <= 7 ||\n 'file://' != uri.substring(0, 7)) {\n throw new TypeError('must pass in a file:// URI to convert to a file path');\n }\n\n var rest = decodeURI(uri.substring(7));\n var firstSlash = rest.indexOf('/');\n var host = rest.substring(0, firstSlash);\n var path = rest.substring(firstSlash + 1);\n\n // 2. Scheme Definition\n // As a special case, can be the string \"localhost\" or the empty\n // string; this is interpreted as \"the machine from which the URL is\n // being interpreted\".\n if ('localhost' == host) host = '';\n\n if (host) {\n host = sep + sep + host;\n }\n\n // 3.2 Drives, drive letters, mount points, file system root\n // Drive letters are mapped into the top of a file URI in various ways,\n // depending on the implementation; some applications substitute\n // vertical bar (\"|\") for the colon after the drive letter, yielding\n // \"file:///c|/tmp/test.txt\". In some cases, the colon is left\n // unchanged, as in \"file:///c:/tmp/test.txt\". In other cases, the\n // colon is simply omitted, as in \"file:///c/tmp/test.txt\".\n path = path.replace(/^(.+)\\|/, '$1:');\n\n // for Windows, we need to invert the path separators from what a URI uses\n if (sep == '\\\\') {\n path = path.replace(/\\//g, '\\\\');\n }\n\n if (/^.+\\:/.test(path)) {\n // has Windows drive at beginning of path\n } else {\n // unix path…\n path = sep + path;\n }\n\n return host + path;\n}\n","const BN = require('bn.js')\nconst EC = require('elliptic').ec\nconst secp256k1 = new EC('secp256k1')\nconst deterministicGenerateK = require('./rfc6979')\n\nconst ZERO32 = Buffer.alloc(32, 0)\nconst EC_GROUP_ORDER = Buffer.from('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141', 'hex')\nconst EC_P = Buffer.from('fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f', 'hex')\n\nconst n = secp256k1.curve.n\nconst nDiv2 = n.shrn(1)\nconst G = secp256k1.curve.g\n\nconst THROW_BAD_PRIVATE = 'Expected Private'\nconst THROW_BAD_POINT = 'Expected Point'\nconst THROW_BAD_TWEAK = 'Expected Tweak'\nconst THROW_BAD_HASH = 'Expected Hash'\nconst THROW_BAD_SIGNATURE = 'Expected Signature'\nconst THROW_BAD_EXTRA_DATA = 'Expected Extra Data (32 bytes)'\n\nfunction isScalar (x) {\n return Buffer.isBuffer(x) && x.length === 32\n}\n\nfunction isOrderScalar (x) {\n if (!isScalar(x)) return false\n return x.compare(EC_GROUP_ORDER) < 0 // < G\n}\n\nfunction isPoint (p) {\n if (!Buffer.isBuffer(p)) return false\n if (p.length < 33) return false\n\n const t = p[0]\n const x = p.slice(1, 33)\n if (x.compare(ZERO32) === 0) return false\n if (x.compare(EC_P) >= 0) return false\n if ((t === 0x02 || t === 0x03) && p.length === 33) {\n try { decodeFrom(p) } catch (e) { return false } // TODO: temporary\n return true\n }\n\n const y = p.slice(33)\n if (y.compare(ZERO32) === 0) return false\n if (y.compare(EC_P) >= 0) return false\n if (t === 0x04 && p.length === 65) return true\n return false\n}\n\nfunction __isPointCompressed (p) {\n return p[0] !== 0x04\n}\n\nfunction isPointCompressed (p) {\n if (!isPoint(p)) return false\n return __isPointCompressed(p)\n}\n\nfunction isPrivate (x) {\n if (!isScalar(x)) return false\n return x.compare(ZERO32) > 0 && // > 0\n x.compare(EC_GROUP_ORDER) < 0 // < G\n}\n\nfunction isSignature (value) {\n const r = value.slice(0, 32)\n const s = value.slice(32, 64)\n return Buffer.isBuffer(value) && value.length === 64 &&\n r.compare(EC_GROUP_ORDER) < 0 &&\n s.compare(EC_GROUP_ORDER) < 0\n}\n\nfunction assumeCompression (value, pubkey) {\n if (value === undefined && pubkey !== undefined) return __isPointCompressed(pubkey)\n if (value === undefined) return true\n return value\n}\n\nfunction fromBuffer (d) { return new BN(d) }\nfunction toBuffer (d) { return d.toArrayLike(Buffer, 'be', 32) }\nfunction decodeFrom (P) { return secp256k1.curve.decodePoint(P) }\nfunction getEncoded (P, compressed) { return Buffer.from(P._encode(compressed)) }\n\nfunction pointAdd (pA, pB, __compressed) {\n if (!isPoint(pA)) throw new TypeError(THROW_BAD_POINT)\n if (!isPoint(pB)) throw new TypeError(THROW_BAD_POINT)\n\n const a = decodeFrom(pA)\n const b = decodeFrom(pB)\n const pp = a.add(b)\n if (pp.isInfinity()) return null\n\n const compressed = assumeCompression(__compressed, pA)\n return getEncoded(pp, compressed)\n}\n\nfunction pointAddScalar (p, tweak, __compressed) {\n if (!isPoint(p)) throw new TypeError(THROW_BAD_POINT)\n if (!isOrderScalar(tweak)) throw new TypeError(THROW_BAD_TWEAK)\n\n const compressed = assumeCompression(__compressed, p)\n const pp = decodeFrom(p)\n if (tweak.compare(ZERO32) === 0) return getEncoded(pp, compressed)\n\n const tt = fromBuffer(tweak)\n const qq = G.mul(tt)\n const uu = pp.add(qq)\n if (uu.isInfinity()) return null\n\n return getEncoded(uu, compressed)\n}\n\nfunction pointCompress (p, __compressed) {\n if (!isPoint(p)) throw new TypeError(THROW_BAD_POINT)\n\n const pp = decodeFrom(p)\n if (pp.isInfinity()) throw new TypeError(THROW_BAD_POINT)\n\n const compressed = assumeCompression(__compressed, p)\n\n return getEncoded(pp, compressed)\n}\n\nfunction pointFromScalar (d, __compressed) {\n if (!isPrivate(d)) throw new TypeError(THROW_BAD_PRIVATE)\n\n const dd = fromBuffer(d)\n const pp = G.mul(dd)\n if (pp.isInfinity()) return null\n\n const compressed = assumeCompression(__compressed)\n return getEncoded(pp, compressed)\n}\n\nfunction pointMultiply (p, tweak, __compressed) {\n if (!isPoint(p)) throw new TypeError(THROW_BAD_POINT)\n if (!isOrderScalar(tweak)) throw new TypeError(THROW_BAD_TWEAK)\n\n const compressed = assumeCompression(__compressed, p)\n const pp = decodeFrom(p)\n const tt = fromBuffer(tweak)\n const qq = pp.mul(tt)\n if (qq.isInfinity()) return null\n\n return getEncoded(qq, compressed)\n}\n\nfunction privateAdd (d, tweak) {\n if (!isPrivate(d)) throw new TypeError(THROW_BAD_PRIVATE)\n if (!isOrderScalar(tweak)) throw new TypeError(THROW_BAD_TWEAK)\n\n const dd = fromBuffer(d)\n const tt = fromBuffer(tweak)\n const dt = toBuffer(dd.add(tt).umod(n))\n if (!isPrivate(dt)) return null\n\n return dt\n}\n\nfunction privateSub (d, tweak) {\n if (!isPrivate(d)) throw new TypeError(THROW_BAD_PRIVATE)\n if (!isOrderScalar(tweak)) throw new TypeError(THROW_BAD_TWEAK)\n\n const dd = fromBuffer(d)\n const tt = fromBuffer(tweak)\n const dt = toBuffer(dd.sub(tt).umod(n))\n if (!isPrivate(dt)) return null\n\n return dt\n}\n\nfunction sign (hash, x) {\n return __sign(hash, x)\n}\n\nfunction signWithEntropy (hash, x, addData) {\n return __sign(hash, x, addData)\n}\n\nfunction __sign (hash, x, addData) {\n if (!isScalar(hash)) throw new TypeError(THROW_BAD_HASH)\n if (!isPrivate(x)) throw new TypeError(THROW_BAD_PRIVATE)\n if (addData !== undefined && !isScalar(addData)) throw new TypeError(THROW_BAD_EXTRA_DATA)\n\n const d = fromBuffer(x)\n const e = fromBuffer(hash)\n\n let r, s\n const checkSig = function (k) {\n const kI = fromBuffer(k)\n const Q = G.mul(kI)\n\n if (Q.isInfinity()) return false\n\n r = Q.x.umod(n)\n if (r.isZero() === 0) return false\n\n s = kI\n .invm(n)\n .mul(e.add(d.mul(r)))\n .umod(n)\n if (s.isZero() === 0) return false\n\n return true\n }\n\n deterministicGenerateK(hash, x, checkSig, isPrivate, addData)\n\n // enforce low S values, see bip62: 'low s values in signatures'\n if (s.cmp(nDiv2) > 0) {\n s = n.sub(s)\n }\n\n const buffer = Buffer.allocUnsafe(64)\n toBuffer(r).copy(buffer, 0)\n toBuffer(s).copy(buffer, 32)\n return buffer\n}\n\nfunction verify (hash, q, signature, strict) {\n if (!isScalar(hash)) throw new TypeError(THROW_BAD_HASH)\n if (!isPoint(q)) throw new TypeError(THROW_BAD_POINT)\n\n // 1.4.1 Enforce r and s are both integers in the interval [1, n − 1] (1, isSignature enforces '< n - 1')\n if (!isSignature(signature)) throw new TypeError(THROW_BAD_SIGNATURE)\n\n const Q = decodeFrom(q)\n const r = fromBuffer(signature.slice(0, 32))\n const s = fromBuffer(signature.slice(32, 64))\n\n if (strict && s.cmp(nDiv2) > 0) {\n return false\n }\n\n // 1.4.1 Enforce r and s are both integers in the interval [1, n − 1] (2, enforces '> 0')\n if (r.gtn(0) <= 0 /* || r.compareTo(n) >= 0 */) return false\n if (s.gtn(0) <= 0 /* || s.compareTo(n) >= 0 */) return false\n\n // 1.4.2 H = Hash(M), already done by the user\n // 1.4.3 e = H\n const e = fromBuffer(hash)\n\n // Compute s^-1\n const sInv = s.invm(n)\n\n // 1.4.4 Compute u1 = es^−1 mod n\n // u2 = rs^−1 mod n\n const u1 = e.mul(sInv).umod(n)\n const u2 = r.mul(sInv).umod(n)\n\n // 1.4.5 Compute R = (xR, yR)\n // R = u1G + u2Q\n const R = G.mulAdd(u1, Q, u2)\n\n // 1.4.5 (cont.) Enforce R is not at infinity\n if (R.isInfinity()) return false\n\n // 1.4.6 Convert the field element R.x to an integer\n const xR = R.x\n\n // 1.4.7 Set v = xR mod n\n const v = xR.umod(n)\n\n // 1.4.8 If v = r, output \"valid\", and if v != r, output \"invalid\"\n return v.eq(r)\n}\n\nmodule.exports = {\n isPoint,\n isPointCompressed,\n isPrivate,\n pointAdd,\n pointAddScalar,\n pointCompress,\n pointFromScalar,\n pointMultiply,\n privateAdd,\n privateSub,\n sign,\n signWithEntropy,\n verify\n}\n","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar BN = require('bn.js');\nvar inherits = require('inherits');\nvar Base = require('./base');\n\nvar assert = utils.assert;\n\nfunction ShortCurve(conf) {\n Base.call(this, 'short', conf);\n\n this.a = new BN(conf.a, 16).toRed(this.red);\n this.b = new BN(conf.b, 16).toRed(this.red);\n this.tinv = this.two.redInvm();\n\n this.zeroA = this.a.fromRed().cmpn(0) === 0;\n this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0;\n\n // If the curve is endomorphic, precalculate beta and lambda\n this.endo = this._getEndomorphism(conf);\n this._endoWnafT1 = new Array(4);\n this._endoWnafT2 = new Array(4);\n}\ninherits(ShortCurve, Base);\nmodule.exports = ShortCurve;\n\nShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {\n // No efficient endomorphism\n if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)\n return;\n\n // Compute beta and lambda, that lambda * P = (beta * Px; Py)\n var beta;\n var lambda;\n if (conf.beta) {\n beta = new BN(conf.beta, 16).toRed(this.red);\n } else {\n var betas = this._getEndoRoots(this.p);\n // Choose the smallest beta\n beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1];\n beta = beta.toRed(this.red);\n }\n if (conf.lambda) {\n lambda = new BN(conf.lambda, 16);\n } else {\n // Choose the lambda that is matching selected beta\n var lambdas = this._getEndoRoots(this.n);\n if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) {\n lambda = lambdas[0];\n } else {\n lambda = lambdas[1];\n assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0);\n }\n }\n\n // Get basis vectors, used for balanced length-two representation\n var basis;\n if (conf.basis) {\n basis = conf.basis.map(function(vec) {\n return {\n a: new BN(vec.a, 16),\n b: new BN(vec.b, 16)\n };\n });\n } else {\n basis = this._getEndoBasis(lambda);\n }\n\n return {\n beta: beta,\n lambda: lambda,\n basis: basis\n };\n};\n\nShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) {\n // Find roots of for x^2 + x + 1 in F\n // Root = (-1 +- Sqrt(-3)) / 2\n //\n var red = num === this.p ? this.red : BN.mont(num);\n var tinv = new BN(2).toRed(red).redInvm();\n var ntinv = tinv.redNeg();\n\n var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);\n\n var l1 = ntinv.redAdd(s).fromRed();\n var l2 = ntinv.redSub(s).fromRed();\n return [ l1, l2 ];\n};\n\nShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) {\n // aprxSqrt >= sqrt(this.n)\n var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2));\n\n // 3.74\n // Run EGCD, until r(L + 1) < aprxSqrt\n var u = lambda;\n var v = this.n.clone();\n var x1 = new BN(1);\n var y1 = new BN(0);\n var x2 = new BN(0);\n var y2 = new BN(1);\n\n // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n)\n var a0;\n var b0;\n // First vector\n var a1;\n var b1;\n // Second vector\n var a2;\n var b2;\n\n var prevR;\n var i = 0;\n var r;\n var x;\n while (u.cmpn(0) !== 0) {\n var q = v.div(u);\n r = v.sub(q.mul(u));\n x = x2.sub(q.mul(x1));\n var y = y2.sub(q.mul(y1));\n\n if (!a1 && r.cmp(aprxSqrt) < 0) {\n a0 = prevR.neg();\n b0 = x1;\n a1 = r.neg();\n b1 = x;\n } else if (a1 && ++i === 2) {\n break;\n }\n prevR = r;\n\n v = u;\n u = r;\n x2 = x1;\n x1 = x;\n y2 = y1;\n y1 = y;\n }\n a2 = r.neg();\n b2 = x;\n\n var len1 = a1.sqr().add(b1.sqr());\n var len2 = a2.sqr().add(b2.sqr());\n if (len2.cmp(len1) >= 0) {\n a2 = a0;\n b2 = b0;\n }\n\n // Normalize signs\n if (a1.negative) {\n a1 = a1.neg();\n b1 = b1.neg();\n }\n if (a2.negative) {\n a2 = a2.neg();\n b2 = b2.neg();\n }\n\n return [\n { a: a1, b: b1 },\n { a: a2, b: b2 }\n ];\n};\n\nShortCurve.prototype._endoSplit = function _endoSplit(k) {\n var basis = this.endo.basis;\n var v1 = basis[0];\n var v2 = basis[1];\n\n var c1 = v2.b.mul(k).divRound(this.n);\n var c2 = v1.b.neg().mul(k).divRound(this.n);\n\n var p1 = c1.mul(v1.a);\n var p2 = c2.mul(v2.a);\n var q1 = c1.mul(v1.b);\n var q2 = c2.mul(v2.b);\n\n // Calculate answer\n var k1 = k.sub(p1).sub(p2);\n var k2 = q1.add(q2).neg();\n return { k1: k1, k2: k2 };\n};\n\nShortCurve.prototype.pointFromX = function pointFromX(x, odd) {\n x = new BN(x, 16);\n if (!x.red)\n x = x.toRed(this.red);\n\n var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);\n var y = y2.redSqrt();\n if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n throw new Error('invalid point');\n\n // XXX Is there any way to tell if the number is odd without converting it\n // to non-red form?\n var isOdd = y.fromRed().isOdd();\n if (odd && !isOdd || !odd && isOdd)\n y = y.redNeg();\n\n return this.point(x, y);\n};\n\nShortCurve.prototype.validate = function validate(point) {\n if (point.inf)\n return true;\n\n var x = point.x;\n var y = point.y;\n\n var ax = this.a.redMul(x);\n var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);\n return y.redSqr().redISub(rhs).cmpn(0) === 0;\n};\n\nShortCurve.prototype._endoWnafMulAdd =\n function _endoWnafMulAdd(points, coeffs, jacobianResult) {\n var npoints = this._endoWnafT1;\n var ncoeffs = this._endoWnafT2;\n for (var i = 0; i < points.length; i++) {\n var split = this._endoSplit(coeffs[i]);\n var p = points[i];\n var beta = p._getBeta();\n\n if (split.k1.negative) {\n split.k1.ineg();\n p = p.neg(true);\n }\n if (split.k2.negative) {\n split.k2.ineg();\n beta = beta.neg(true);\n }\n\n npoints[i * 2] = p;\n npoints[i * 2 + 1] = beta;\n ncoeffs[i * 2] = split.k1;\n ncoeffs[i * 2 + 1] = split.k2;\n }\n var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult);\n\n // Clean-up references to points and coefficients\n for (var j = 0; j < i * 2; j++) {\n npoints[j] = null;\n ncoeffs[j] = null;\n }\n return res;\n};\n\nfunction Point(curve, x, y, isRed) {\n Base.BasePoint.call(this, curve, 'affine');\n if (x === null && y === null) {\n this.x = null;\n this.y = null;\n this.inf = true;\n } else {\n this.x = new BN(x, 16);\n this.y = new BN(y, 16);\n // Force redgomery representation when loading from JSON\n if (isRed) {\n this.x.forceRed(this.curve.red);\n this.y.forceRed(this.curve.red);\n }\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n this.inf = false;\n }\n}\ninherits(Point, Base.BasePoint);\n\nShortCurve.prototype.point = function point(x, y, isRed) {\n return new Point(this, x, y, isRed);\n};\n\nShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) {\n return Point.fromJSON(this, obj, red);\n};\n\nPoint.prototype._getBeta = function _getBeta() {\n if (!this.curve.endo)\n return;\n\n var pre = this.precomputed;\n if (pre && pre.beta)\n return pre.beta;\n\n var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);\n if (pre) {\n var curve = this.curve;\n var endoMul = function(p) {\n return curve.point(p.x.redMul(curve.endo.beta), p.y);\n };\n pre.beta = beta;\n beta.precomputed = {\n beta: null,\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(endoMul)\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(endoMul)\n }\n };\n }\n return beta;\n};\n\nPoint.prototype.toJSON = function toJSON() {\n if (!this.precomputed)\n return [ this.x, this.y ];\n\n return [ this.x, this.y, this.precomputed && {\n doubles: this.precomputed.doubles && {\n step: this.precomputed.doubles.step,\n points: this.precomputed.doubles.points.slice(1)\n },\n naf: this.precomputed.naf && {\n wnd: this.precomputed.naf.wnd,\n points: this.precomputed.naf.points.slice(1)\n }\n } ];\n};\n\nPoint.fromJSON = function fromJSON(curve, obj, red) {\n if (typeof obj === 'string')\n obj = JSON.parse(obj);\n var res = curve.point(obj[0], obj[1], red);\n if (!obj[2])\n return res;\n\n function obj2point(obj) {\n return curve.point(obj[0], obj[1], red);\n }\n\n var pre = obj[2];\n res.precomputed = {\n beta: null,\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: [ res ].concat(pre.doubles.points.map(obj2point))\n },\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: [ res ].concat(pre.naf.points.map(obj2point))\n }\n };\n return res;\n};\n\nPoint.prototype.inspect = function inspect() {\n if (this.isInfinity())\n return '';\n return '';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n return this.inf;\n};\n\nPoint.prototype.add = function add(p) {\n // O + P = P\n if (this.inf)\n return p;\n\n // P + O = P\n if (p.inf)\n return this;\n\n // P + P = 2P\n if (this.eq(p))\n return this.dbl();\n\n // P + (-P) = O\n if (this.neg().eq(p))\n return this.curve.point(null, null);\n\n // P + Q = O\n if (this.x.cmp(p.x) === 0)\n return this.curve.point(null, null);\n\n var c = this.y.redSub(p.y);\n if (c.cmpn(0) !== 0)\n c = c.redMul(this.x.redSub(p.x).redInvm());\n var nx = c.redSqr().redISub(this.x).redISub(p.x);\n var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n};\n\nPoint.prototype.dbl = function dbl() {\n if (this.inf)\n return this;\n\n // 2P = O\n var ys1 = this.y.redAdd(this.y);\n if (ys1.cmpn(0) === 0)\n return this.curve.point(null, null);\n\n var a = this.curve.a;\n\n var x2 = this.x.redSqr();\n var dyinv = ys1.redInvm();\n var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);\n\n var nx = c.redSqr().redISub(this.x.redAdd(this.x));\n var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n};\n\nPoint.prototype.getX = function getX() {\n return this.x.fromRed();\n};\n\nPoint.prototype.getY = function getY() {\n return this.y.fromRed();\n};\n\nPoint.prototype.mul = function mul(k) {\n k = new BN(k, 16);\n if (this.isInfinity())\n return this;\n else if (this._hasDoubles(k))\n return this.curve._fixedNafMul(this, k);\n else if (this.curve.endo)\n return this.curve._endoWnafMulAdd([ this ], [ k ]);\n else\n return this.curve._wnafMul(this, k);\n};\n\nPoint.prototype.mulAdd = function mulAdd(k1, p2, k2) {\n var points = [ this, p2 ];\n var coeffs = [ k1, k2 ];\n if (this.curve.endo)\n return this.curve._endoWnafMulAdd(points, coeffs);\n else\n return this.curve._wnafMulAdd(1, points, coeffs, 2);\n};\n\nPoint.prototype.jmulAdd = function jmulAdd(k1, p2, k2) {\n var points = [ this, p2 ];\n var coeffs = [ k1, k2 ];\n if (this.curve.endo)\n return this.curve._endoWnafMulAdd(points, coeffs, true);\n else\n return this.curve._wnafMulAdd(1, points, coeffs, 2, true);\n};\n\nPoint.prototype.eq = function eq(p) {\n return this === p ||\n this.inf === p.inf &&\n (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);\n};\n\nPoint.prototype.neg = function neg(_precompute) {\n if (this.inf)\n return this;\n\n var res = this.curve.point(this.x, this.y.redNeg());\n if (_precompute && this.precomputed) {\n var pre = this.precomputed;\n var negate = function(p) {\n return p.neg();\n };\n res.precomputed = {\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(negate)\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(negate)\n }\n };\n }\n return res;\n};\n\nPoint.prototype.toJ = function toJ() {\n if (this.inf)\n return this.curve.jpoint(null, null, null);\n\n var res = this.curve.jpoint(this.x, this.y, this.curve.one);\n return res;\n};\n\nfunction JPoint(curve, x, y, z) {\n Base.BasePoint.call(this, curve, 'jacobian');\n if (x === null && y === null && z === null) {\n this.x = this.curve.one;\n this.y = this.curve.one;\n this.z = new BN(0);\n } else {\n this.x = new BN(x, 16);\n this.y = new BN(y, 16);\n this.z = new BN(z, 16);\n }\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n\n this.zOne = this.z === this.curve.one;\n}\ninherits(JPoint, Base.BasePoint);\n\nShortCurve.prototype.jpoint = function jpoint(x, y, z) {\n return new JPoint(this, x, y, z);\n};\n\nJPoint.prototype.toP = function toP() {\n if (this.isInfinity())\n return this.curve.point(null, null);\n\n var zinv = this.z.redInvm();\n var zinv2 = zinv.redSqr();\n var ax = this.x.redMul(zinv2);\n var ay = this.y.redMul(zinv2).redMul(zinv);\n\n return this.curve.point(ax, ay);\n};\n\nJPoint.prototype.neg = function neg() {\n return this.curve.jpoint(this.x, this.y.redNeg(), this.z);\n};\n\nJPoint.prototype.add = function add(p) {\n // O + P = P\n if (this.isInfinity())\n return p;\n\n // P + O = P\n if (p.isInfinity())\n return this;\n\n // 12M + 4S + 7A\n var pz2 = p.z.redSqr();\n var z2 = this.z.redSqr();\n var u1 = this.x.redMul(pz2);\n var u2 = p.x.redMul(z2);\n var s1 = this.y.redMul(pz2.redMul(p.z));\n var s2 = p.y.redMul(z2.redMul(this.z));\n\n var h = u1.redSub(u2);\n var r = s1.redSub(s2);\n if (h.cmpn(0) === 0) {\n if (r.cmpn(0) !== 0)\n return this.curve.jpoint(null, null, null);\n else\n return this.dbl();\n }\n\n var h2 = h.redSqr();\n var h3 = h2.redMul(h);\n var v = u1.redMul(h2);\n\n var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\n var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\n var nz = this.z.redMul(p.z).redMul(h);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.mixedAdd = function mixedAdd(p) {\n // O + P = P\n if (this.isInfinity())\n return p.toJ();\n\n // P + O = P\n if (p.isInfinity())\n return this;\n\n // 8M + 3S + 7A\n var z2 = this.z.redSqr();\n var u1 = this.x;\n var u2 = p.x.redMul(z2);\n var s1 = this.y;\n var s2 = p.y.redMul(z2).redMul(this.z);\n\n var h = u1.redSub(u2);\n var r = s1.redSub(s2);\n if (h.cmpn(0) === 0) {\n if (r.cmpn(0) !== 0)\n return this.curve.jpoint(null, null, null);\n else\n return this.dbl();\n }\n\n var h2 = h.redSqr();\n var h3 = h2.redMul(h);\n var v = u1.redMul(h2);\n\n var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\n var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\n var nz = this.z.redMul(h);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.dblp = function dblp(pow) {\n if (pow === 0)\n return this;\n if (this.isInfinity())\n return this;\n if (!pow)\n return this.dbl();\n\n if (this.curve.zeroA || this.curve.threeA) {\n var r = this;\n for (var i = 0; i < pow; i++)\n r = r.dbl();\n return r;\n }\n\n // 1M + 2S + 1A + N * (4S + 5M + 8A)\n // N = 1 => 6M + 6S + 9A\n var a = this.curve.a;\n var tinv = this.curve.tinv;\n\n var jx = this.x;\n var jy = this.y;\n var jz = this.z;\n var jz4 = jz.redSqr().redSqr();\n\n // Reuse results\n var jyd = jy.redAdd(jy);\n for (var i = 0; i < pow; i++) {\n var jx2 = jx.redSqr();\n var jyd2 = jyd.redSqr();\n var jyd4 = jyd2.redSqr();\n var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\n\n var t1 = jx.redMul(jyd2);\n var nx = c.redSqr().redISub(t1.redAdd(t1));\n var t2 = t1.redISub(nx);\n var dny = c.redMul(t2);\n dny = dny.redIAdd(dny).redISub(jyd4);\n var nz = jyd.redMul(jz);\n if (i + 1 < pow)\n jz4 = jz4.redMul(jyd4);\n\n jx = nx;\n jz = nz;\n jyd = dny;\n }\n\n return this.curve.jpoint(jx, jyd.redMul(tinv), jz);\n};\n\nJPoint.prototype.dbl = function dbl() {\n if (this.isInfinity())\n return this;\n\n if (this.curve.zeroA)\n return this._zeroDbl();\n else if (this.curve.threeA)\n return this._threeDbl();\n else\n return this._dbl();\n};\n\nJPoint.prototype._zeroDbl = function _zeroDbl() {\n var nx;\n var ny;\n var nz;\n // Z = 1\n if (this.zOne) {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html\n // #doubling-mdbl-2007-bl\n // 1M + 5S + 14A\n\n // XX = X1^2\n var xx = this.x.redSqr();\n // YY = Y1^2\n var yy = this.y.redSqr();\n // YYYY = YY^2\n var yyyy = yy.redSqr();\n // S = 2 * ((X1 + YY)^2 - XX - YYYY)\n var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n // M = 3 * XX + a; a = 0\n var m = xx.redAdd(xx).redIAdd(xx);\n // T = M ^ 2 - 2*S\n var t = m.redSqr().redISub(s).redISub(s);\n\n // 8 * YYYY\n var yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n\n // X3 = T\n nx = t;\n // Y3 = M * (S - T) - 8 * YYYY\n ny = m.redMul(s.redISub(t)).redISub(yyyy8);\n // Z3 = 2*Y1\n nz = this.y.redAdd(this.y);\n } else {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html\n // #doubling-dbl-2009-l\n // 2M + 5S + 13A\n\n // A = X1^2\n var a = this.x.redSqr();\n // B = Y1^2\n var b = this.y.redSqr();\n // C = B^2\n var c = b.redSqr();\n // D = 2 * ((X1 + B)^2 - A - C)\n var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);\n d = d.redIAdd(d);\n // E = 3 * A\n var e = a.redAdd(a).redIAdd(a);\n // F = E^2\n var f = e.redSqr();\n\n // 8 * C\n var c8 = c.redIAdd(c);\n c8 = c8.redIAdd(c8);\n c8 = c8.redIAdd(c8);\n\n // X3 = F - 2 * D\n nx = f.redISub(d).redISub(d);\n // Y3 = E * (D - X3) - 8 * C\n ny = e.redMul(d.redISub(nx)).redISub(c8);\n // Z3 = 2 * Y1 * Z1\n nz = this.y.redMul(this.z);\n nz = nz.redIAdd(nz);\n }\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype._threeDbl = function _threeDbl() {\n var nx;\n var ny;\n var nz;\n // Z = 1\n if (this.zOne) {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html\n // #doubling-mdbl-2007-bl\n // 1M + 5S + 15A\n\n // XX = X1^2\n var xx = this.x.redSqr();\n // YY = Y1^2\n var yy = this.y.redSqr();\n // YYYY = YY^2\n var yyyy = yy.redSqr();\n // S = 2 * ((X1 + YY)^2 - XX - YYYY)\n var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n // M = 3 * XX + a\n var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a);\n // T = M^2 - 2 * S\n var t = m.redSqr().redISub(s).redISub(s);\n // X3 = T\n nx = t;\n // Y3 = M * (S - T) - 8 * YYYY\n var yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n ny = m.redMul(s.redISub(t)).redISub(yyyy8);\n // Z3 = 2 * Y1\n nz = this.y.redAdd(this.y);\n } else {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b\n // 3M + 5S\n\n // delta = Z1^2\n var delta = this.z.redSqr();\n // gamma = Y1^2\n var gamma = this.y.redSqr();\n // beta = X1 * gamma\n var beta = this.x.redMul(gamma);\n // alpha = 3 * (X1 - delta) * (X1 + delta)\n var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));\n alpha = alpha.redAdd(alpha).redIAdd(alpha);\n // X3 = alpha^2 - 8 * beta\n var beta4 = beta.redIAdd(beta);\n beta4 = beta4.redIAdd(beta4);\n var beta8 = beta4.redAdd(beta4);\n nx = alpha.redSqr().redISub(beta8);\n // Z3 = (Y1 + Z1)^2 - gamma - delta\n nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);\n // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2\n var ggamma8 = gamma.redSqr();\n ggamma8 = ggamma8.redIAdd(ggamma8);\n ggamma8 = ggamma8.redIAdd(ggamma8);\n ggamma8 = ggamma8.redIAdd(ggamma8);\n ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);\n }\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype._dbl = function _dbl() {\n var a = this.curve.a;\n\n // 4M + 6S + 10A\n var jx = this.x;\n var jy = this.y;\n var jz = this.z;\n var jz4 = jz.redSqr().redSqr();\n\n var jx2 = jx.redSqr();\n var jy2 = jy.redSqr();\n\n var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\n\n var jxd4 = jx.redAdd(jx);\n jxd4 = jxd4.redIAdd(jxd4);\n var t1 = jxd4.redMul(jy2);\n var nx = c.redSqr().redISub(t1.redAdd(t1));\n var t2 = t1.redISub(nx);\n\n var jyd8 = jy2.redSqr();\n jyd8 = jyd8.redIAdd(jyd8);\n jyd8 = jyd8.redIAdd(jyd8);\n jyd8 = jyd8.redIAdd(jyd8);\n var ny = c.redMul(t2).redISub(jyd8);\n var nz = jy.redAdd(jy).redMul(jz);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.trpl = function trpl() {\n if (!this.curve.zeroA)\n return this.dbl().add(this);\n\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl\n // 5M + 10S + ...\n\n // XX = X1^2\n var xx = this.x.redSqr();\n // YY = Y1^2\n var yy = this.y.redSqr();\n // ZZ = Z1^2\n var zz = this.z.redSqr();\n // YYYY = YY^2\n var yyyy = yy.redSqr();\n // M = 3 * XX + a * ZZ2; a = 0\n var m = xx.redAdd(xx).redIAdd(xx);\n // MM = M^2\n var mm = m.redSqr();\n // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM\n var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n e = e.redIAdd(e);\n e = e.redAdd(e).redIAdd(e);\n e = e.redISub(mm);\n // EE = E^2\n var ee = e.redSqr();\n // T = 16*YYYY\n var t = yyyy.redIAdd(yyyy);\n t = t.redIAdd(t);\n t = t.redIAdd(t);\n t = t.redIAdd(t);\n // U = (M + E)^2 - MM - EE - T\n var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t);\n // X3 = 4 * (X1 * EE - 4 * YY * U)\n var yyu4 = yy.redMul(u);\n yyu4 = yyu4.redIAdd(yyu4);\n yyu4 = yyu4.redIAdd(yyu4);\n var nx = this.x.redMul(ee).redISub(yyu4);\n nx = nx.redIAdd(nx);\n nx = nx.redIAdd(nx);\n // Y3 = 8 * Y1 * (U * (T - U) - E * EE)\n var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));\n ny = ny.redIAdd(ny);\n ny = ny.redIAdd(ny);\n ny = ny.redIAdd(ny);\n // Z3 = (Z1 + E)^2 - ZZ - EE\n var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.mul = function mul(k, kbase) {\n k = new BN(k, kbase);\n\n return this.curve._wnafMul(this, k);\n};\n\nJPoint.prototype.eq = function eq(p) {\n if (p.type === 'affine')\n return this.eq(p.toJ());\n\n if (this === p)\n return true;\n\n // x1 * z2^2 == x2 * z1^2\n var z2 = this.z.redSqr();\n var pz2 = p.z.redSqr();\n if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)\n return false;\n\n // y1 * z2^3 == y2 * z1^3\n var z3 = z2.redMul(this.z);\n var pz3 = pz2.redMul(p.z);\n return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;\n};\n\nJPoint.prototype.eqXToP = function eqXToP(x) {\n var zs = this.z.redSqr();\n var rx = x.toRed(this.curve.red).redMul(zs);\n if (this.x.cmp(rx) === 0)\n return true;\n\n var xc = x.clone();\n var t = this.curve.redN.redMul(zs);\n for (;;) {\n xc.iadd(this.curve.n);\n if (xc.cmp(this.curve.p) >= 0)\n return false;\n\n rx.redIAdd(t);\n if (this.x.cmp(rx) === 0)\n return true;\n }\n};\n\nJPoint.prototype.inspect = function inspect() {\n if (this.isInfinity())\n return '';\n return '';\n};\n\nJPoint.prototype.isInfinity = function isInfinity() {\n // XXX This code assumes that zero is always zero in red\n return this.z.cmpn(0) === 0;\n};\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","'use strict';\n\nvar BN = require('bn.js');\nvar inherits = require('inherits');\nvar Base = require('./base');\n\nvar utils = require('../utils');\n\nfunction MontCurve(conf) {\n Base.call(this, 'mont', conf);\n\n this.a = new BN(conf.a, 16).toRed(this.red);\n this.b = new BN(conf.b, 16).toRed(this.red);\n this.i4 = new BN(4).toRed(this.red).redInvm();\n this.two = new BN(2).toRed(this.red);\n this.a24 = this.i4.redMul(this.a.redAdd(this.two));\n}\ninherits(MontCurve, Base);\nmodule.exports = MontCurve;\n\nMontCurve.prototype.validate = function validate(point) {\n var x = point.normalize().x;\n var x2 = x.redSqr();\n var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);\n var y = rhs.redSqrt();\n\n return y.redSqr().cmp(rhs) === 0;\n};\n\nfunction Point(curve, x, z) {\n Base.BasePoint.call(this, curve, 'projective');\n if (x === null && z === null) {\n this.x = this.curve.one;\n this.z = this.curve.zero;\n } else {\n this.x = new BN(x, 16);\n this.z = new BN(z, 16);\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n }\n}\ninherits(Point, Base.BasePoint);\n\nMontCurve.prototype.decodePoint = function decodePoint(bytes, enc) {\n return this.point(utils.toArray(bytes, enc), 1);\n};\n\nMontCurve.prototype.point = function point(x, z) {\n return new Point(this, x, z);\n};\n\nMontCurve.prototype.pointFromJSON = function pointFromJSON(obj) {\n return Point.fromJSON(this, obj);\n};\n\nPoint.prototype.precompute = function precompute() {\n // No-op\n};\n\nPoint.prototype._encode = function _encode() {\n return this.getX().toArray('be', this.curve.p.byteLength());\n};\n\nPoint.fromJSON = function fromJSON(curve, obj) {\n return new Point(curve, obj[0], obj[1] || curve.one);\n};\n\nPoint.prototype.inspect = function inspect() {\n if (this.isInfinity())\n return '';\n return '';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n // XXX This code assumes that zero is always zero in red\n return this.z.cmpn(0) === 0;\n};\n\nPoint.prototype.dbl = function dbl() {\n // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3\n // 2M + 2S + 4A\n\n // A = X1 + Z1\n var a = this.x.redAdd(this.z);\n // AA = A^2\n var aa = a.redSqr();\n // B = X1 - Z1\n var b = this.x.redSub(this.z);\n // BB = B^2\n var bb = b.redSqr();\n // C = AA - BB\n var c = aa.redSub(bb);\n // X3 = AA * BB\n var nx = aa.redMul(bb);\n // Z3 = C * (BB + A24 * C)\n var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));\n return this.curve.point(nx, nz);\n};\n\nPoint.prototype.add = function add() {\n throw new Error('Not supported on Montgomery curve');\n};\n\nPoint.prototype.diffAdd = function diffAdd(p, diff) {\n // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3\n // 4M + 2S + 6A\n\n // A = X2 + Z2\n var a = this.x.redAdd(this.z);\n // B = X2 - Z2\n var b = this.x.redSub(this.z);\n // C = X3 + Z3\n var c = p.x.redAdd(p.z);\n // D = X3 - Z3\n var d = p.x.redSub(p.z);\n // DA = D * A\n var da = d.redMul(a);\n // CB = C * B\n var cb = c.redMul(b);\n // X5 = Z1 * (DA + CB)^2\n var nx = diff.z.redMul(da.redAdd(cb).redSqr());\n // Z5 = X1 * (DA - CB)^2\n var nz = diff.x.redMul(da.redISub(cb).redSqr());\n return this.curve.point(nx, nz);\n};\n\nPoint.prototype.mul = function mul(k) {\n var t = k.clone();\n var a = this; // (N / 2) * Q + Q\n var b = this.curve.point(null, null); // (N / 2) * Q\n var c = this; // Q\n\n for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1))\n bits.push(t.andln(1));\n\n for (var i = bits.length - 1; i >= 0; i--) {\n if (bits[i] === 0) {\n // N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q\n a = a.diffAdd(b, c);\n // N * Q = 2 * ((N / 2) * Q + Q))\n b = b.dbl();\n } else {\n // N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q)\n b = a.diffAdd(b, c);\n // N * Q + Q = 2 * ((N / 2) * Q + Q)\n a = a.dbl();\n }\n }\n return b;\n};\n\nPoint.prototype.mulAdd = function mulAdd() {\n throw new Error('Not supported on Montgomery curve');\n};\n\nPoint.prototype.jumlAdd = function jumlAdd() {\n throw new Error('Not supported on Montgomery curve');\n};\n\nPoint.prototype.eq = function eq(other) {\n return this.getX().cmp(other.getX()) === 0;\n};\n\nPoint.prototype.normalize = function normalize() {\n this.x = this.x.redMul(this.z.redInvm());\n this.z = this.curve.one;\n return this;\n};\n\nPoint.prototype.getX = function getX() {\n // Normalize coordinates\n this.normalize();\n\n return this.x.fromRed();\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar BN = require('bn.js');\nvar inherits = require('inherits');\nvar Base = require('./base');\n\nvar assert = utils.assert;\n\nfunction EdwardsCurve(conf) {\n // NOTE: Important as we are creating point in Base.call()\n this.twisted = (conf.a | 0) !== 1;\n this.mOneA = this.twisted && (conf.a | 0) === -1;\n this.extended = this.mOneA;\n\n Base.call(this, 'edwards', conf);\n\n this.a = new BN(conf.a, 16).umod(this.red.m);\n this.a = this.a.toRed(this.red);\n this.c = new BN(conf.c, 16).toRed(this.red);\n this.c2 = this.c.redSqr();\n this.d = new BN(conf.d, 16).toRed(this.red);\n this.dd = this.d.redAdd(this.d);\n\n assert(!this.twisted || this.c.fromRed().cmpn(1) === 0);\n this.oneC = (conf.c | 0) === 1;\n}\ninherits(EdwardsCurve, Base);\nmodule.exports = EdwardsCurve;\n\nEdwardsCurve.prototype._mulA = function _mulA(num) {\n if (this.mOneA)\n return num.redNeg();\n else\n return this.a.redMul(num);\n};\n\nEdwardsCurve.prototype._mulC = function _mulC(num) {\n if (this.oneC)\n return num;\n else\n return this.c.redMul(num);\n};\n\n// Just for compatibility with Short curve\nEdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) {\n return this.point(x, y, z, t);\n};\n\nEdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) {\n x = new BN(x, 16);\n if (!x.red)\n x = x.toRed(this.red);\n\n var x2 = x.redSqr();\n var rhs = this.c2.redSub(this.a.redMul(x2));\n var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2));\n\n var y2 = rhs.redMul(lhs.redInvm());\n var y = y2.redSqrt();\n if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n throw new Error('invalid point');\n\n var isOdd = y.fromRed().isOdd();\n if (odd && !isOdd || !odd && isOdd)\n y = y.redNeg();\n\n return this.point(x, y);\n};\n\nEdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) {\n y = new BN(y, 16);\n if (!y.red)\n y = y.toRed(this.red);\n\n // x^2 = (y^2 - c^2) / (c^2 d y^2 - a)\n var y2 = y.redSqr();\n var lhs = y2.redSub(this.c2);\n var rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a);\n var x2 = lhs.redMul(rhs.redInvm());\n\n if (x2.cmp(this.zero) === 0) {\n if (odd)\n throw new Error('invalid point');\n else\n return this.point(this.zero, y);\n }\n\n var x = x2.redSqrt();\n if (x.redSqr().redSub(x2).cmp(this.zero) !== 0)\n throw new Error('invalid point');\n\n if (x.fromRed().isOdd() !== odd)\n x = x.redNeg();\n\n return this.point(x, y);\n};\n\nEdwardsCurve.prototype.validate = function validate(point) {\n if (point.isInfinity())\n return true;\n\n // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2)\n point.normalize();\n\n var x2 = point.x.redSqr();\n var y2 = point.y.redSqr();\n var lhs = x2.redMul(this.a).redAdd(y2);\n var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));\n\n return lhs.cmp(rhs) === 0;\n};\n\nfunction Point(curve, x, y, z, t) {\n Base.BasePoint.call(this, curve, 'projective');\n if (x === null && y === null && z === null) {\n this.x = this.curve.zero;\n this.y = this.curve.one;\n this.z = this.curve.one;\n this.t = this.curve.zero;\n this.zOne = true;\n } else {\n this.x = new BN(x, 16);\n this.y = new BN(y, 16);\n this.z = z ? new BN(z, 16) : this.curve.one;\n this.t = t && new BN(t, 16);\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n if (this.t && !this.t.red)\n this.t = this.t.toRed(this.curve.red);\n this.zOne = this.z === this.curve.one;\n\n // Use extended coordinates\n if (this.curve.extended && !this.t) {\n this.t = this.x.redMul(this.y);\n if (!this.zOne)\n this.t = this.t.redMul(this.z.redInvm());\n }\n }\n}\ninherits(Point, Base.BasePoint);\n\nEdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) {\n return Point.fromJSON(this, obj);\n};\n\nEdwardsCurve.prototype.point = function point(x, y, z, t) {\n return new Point(this, x, y, z, t);\n};\n\nPoint.fromJSON = function fromJSON(curve, obj) {\n return new Point(curve, obj[0], obj[1], obj[2]);\n};\n\nPoint.prototype.inspect = function inspect() {\n if (this.isInfinity())\n return '';\n return '';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n // XXX This code assumes that zero is always zero in red\n return this.x.cmpn(0) === 0 &&\n (this.y.cmp(this.z) === 0 ||\n (this.zOne && this.y.cmp(this.curve.c) === 0));\n};\n\nPoint.prototype._extDbl = function _extDbl() {\n // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html\n // #doubling-dbl-2008-hwcd\n // 4M + 4S\n\n // A = X1^2\n var a = this.x.redSqr();\n // B = Y1^2\n var b = this.y.redSqr();\n // C = 2 * Z1^2\n var c = this.z.redSqr();\n c = c.redIAdd(c);\n // D = a * A\n var d = this.curve._mulA(a);\n // E = (X1 + Y1)^2 - A - B\n var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);\n // G = D + B\n var g = d.redAdd(b);\n // F = G - C\n var f = g.redSub(c);\n // H = D - B\n var h = d.redSub(b);\n // X3 = E * F\n var nx = e.redMul(f);\n // Y3 = G * H\n var ny = g.redMul(h);\n // T3 = E * H\n var nt = e.redMul(h);\n // Z3 = F * G\n var nz = f.redMul(g);\n return this.curve.point(nx, ny, nz, nt);\n};\n\nPoint.prototype._projDbl = function _projDbl() {\n // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html\n // #doubling-dbl-2008-bbjlp\n // #doubling-dbl-2007-bl\n // and others\n // Generally 3M + 4S or 2M + 4S\n\n // B = (X1 + Y1)^2\n var b = this.x.redAdd(this.y).redSqr();\n // C = X1^2\n var c = this.x.redSqr();\n // D = Y1^2\n var d = this.y.redSqr();\n\n var nx;\n var ny;\n var nz;\n if (this.curve.twisted) {\n // E = a * C\n var e = this.curve._mulA(c);\n // F = E + D\n var f = e.redAdd(d);\n if (this.zOne) {\n // X3 = (B - C - D) * (F - 2)\n nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two));\n // Y3 = F * (E - D)\n ny = f.redMul(e.redSub(d));\n // Z3 = F^2 - 2 * F\n nz = f.redSqr().redSub(f).redSub(f);\n } else {\n // H = Z1^2\n var h = this.z.redSqr();\n // J = F - 2 * H\n var j = f.redSub(h).redISub(h);\n // X3 = (B-C-D)*J\n nx = b.redSub(c).redISub(d).redMul(j);\n // Y3 = F * (E - D)\n ny = f.redMul(e.redSub(d));\n // Z3 = F * J\n nz = f.redMul(j);\n }\n } else {\n // E = C + D\n var e = c.redAdd(d);\n // H = (c * Z1)^2\n var h = this.curve._mulC(this.z).redSqr();\n // J = E - 2 * H\n var j = e.redSub(h).redSub(h);\n // X3 = c * (B - E) * J\n nx = this.curve._mulC(b.redISub(e)).redMul(j);\n // Y3 = c * E * (C - D)\n ny = this.curve._mulC(e).redMul(c.redISub(d));\n // Z3 = E * J\n nz = e.redMul(j);\n }\n return this.curve.point(nx, ny, nz);\n};\n\nPoint.prototype.dbl = function dbl() {\n if (this.isInfinity())\n return this;\n\n // Double in extended coordinates\n if (this.curve.extended)\n return this._extDbl();\n else\n return this._projDbl();\n};\n\nPoint.prototype._extAdd = function _extAdd(p) {\n // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html\n // #addition-add-2008-hwcd-3\n // 8M\n\n // A = (Y1 - X1) * (Y2 - X2)\n var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x));\n // B = (Y1 + X1) * (Y2 + X2)\n var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x));\n // C = T1 * k * T2\n var c = this.t.redMul(this.curve.dd).redMul(p.t);\n // D = Z1 * 2 * Z2\n var d = this.z.redMul(p.z.redAdd(p.z));\n // E = B - A\n var e = b.redSub(a);\n // F = D - C\n var f = d.redSub(c);\n // G = D + C\n var g = d.redAdd(c);\n // H = B + A\n var h = b.redAdd(a);\n // X3 = E * F\n var nx = e.redMul(f);\n // Y3 = G * H\n var ny = g.redMul(h);\n // T3 = E * H\n var nt = e.redMul(h);\n // Z3 = F * G\n var nz = f.redMul(g);\n return this.curve.point(nx, ny, nz, nt);\n};\n\nPoint.prototype._projAdd = function _projAdd(p) {\n // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html\n // #addition-add-2008-bbjlp\n // #addition-add-2007-bl\n // 10M + 1S\n\n // A = Z1 * Z2\n var a = this.z.redMul(p.z);\n // B = A^2\n var b = a.redSqr();\n // C = X1 * X2\n var c = this.x.redMul(p.x);\n // D = Y1 * Y2\n var d = this.y.redMul(p.y);\n // E = d * C * D\n var e = this.curve.d.redMul(c).redMul(d);\n // F = B - E\n var f = b.redSub(e);\n // G = B + E\n var g = b.redAdd(e);\n // X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D)\n var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d);\n var nx = a.redMul(f).redMul(tmp);\n var ny;\n var nz;\n if (this.curve.twisted) {\n // Y3 = A * G * (D - a * C)\n ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c)));\n // Z3 = F * G\n nz = f.redMul(g);\n } else {\n // Y3 = A * G * (D - C)\n ny = a.redMul(g).redMul(d.redSub(c));\n // Z3 = c * F * G\n nz = this.curve._mulC(f).redMul(g);\n }\n return this.curve.point(nx, ny, nz);\n};\n\nPoint.prototype.add = function add(p) {\n if (this.isInfinity())\n return p;\n if (p.isInfinity())\n return this;\n\n if (this.curve.extended)\n return this._extAdd(p);\n else\n return this._projAdd(p);\n};\n\nPoint.prototype.mul = function mul(k) {\n if (this._hasDoubles(k))\n return this.curve._fixedNafMul(this, k);\n else\n return this.curve._wnafMul(this, k);\n};\n\nPoint.prototype.mulAdd = function mulAdd(k1, p, k2) {\n return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, false);\n};\n\nPoint.prototype.jmulAdd = function jmulAdd(k1, p, k2) {\n return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, true);\n};\n\nPoint.prototype.normalize = function normalize() {\n if (this.zOne)\n return this;\n\n // Normalize coordinates\n var zi = this.z.redInvm();\n this.x = this.x.redMul(zi);\n this.y = this.y.redMul(zi);\n if (this.t)\n this.t = this.t.redMul(zi);\n this.z = this.curve.one;\n this.zOne = true;\n return this;\n};\n\nPoint.prototype.neg = function neg() {\n return this.curve.point(this.x.redNeg(),\n this.y,\n this.z,\n this.t && this.t.redNeg());\n};\n\nPoint.prototype.getX = function getX() {\n this.normalize();\n return this.x.fromRed();\n};\n\nPoint.prototype.getY = function getY() {\n this.normalize();\n return this.y.fromRed();\n};\n\nPoint.prototype.eq = function eq(other) {\n return this === other ||\n this.getX().cmp(other.getX()) === 0 &&\n this.getY().cmp(other.getY()) === 0;\n};\n\nPoint.prototype.eqXToP = function eqXToP(x) {\n var rx = x.toRed(this.curve.red).redMul(this.z);\n if (this.x.cmp(rx) === 0)\n return true;\n\n var xc = x.clone();\n var t = this.curve.redN.redMul(this.z);\n for (;;) {\n xc.iadd(this.curve.n);\n if (xc.cmp(this.curve.p) >= 0)\n return false;\n\n rx.redIAdd(t);\n if (this.x.cmp(rx) === 0)\n return true;\n }\n};\n\n// Compatibility with BaseCurve\nPoint.prototype.toP = Point.prototype.normalize;\nPoint.prototype.mixedAdd = Point.prototype.add;\n","'use strict';\n\nexports.sha1 = require('./sha/1');\nexports.sha224 = require('./sha/224');\nexports.sha256 = require('./sha/256');\nexports.sha384 = require('./sha/384');\nexports.sha512 = require('./sha/512');\n","'use strict';\n\nvar utils = require('../utils');\nvar common = require('../common');\nvar shaCommon = require('./common');\n\nvar rotl32 = utils.rotl32;\nvar sum32 = utils.sum32;\nvar sum32_5 = utils.sum32_5;\nvar ft_1 = shaCommon.ft_1;\nvar BlockHash = common.BlockHash;\n\nvar sha1_K = [\n 0x5A827999, 0x6ED9EBA1,\n 0x8F1BBCDC, 0xCA62C1D6\n];\n\nfunction SHA1() {\n if (!(this instanceof SHA1))\n return new SHA1();\n\n BlockHash.call(this);\n this.h = [\n 0x67452301, 0xefcdab89, 0x98badcfe,\n 0x10325476, 0xc3d2e1f0 ];\n this.W = new Array(80);\n}\n\nutils.inherits(SHA1, BlockHash);\nmodule.exports = SHA1;\n\nSHA1.blockSize = 512;\nSHA1.outSize = 160;\nSHA1.hmacStrength = 80;\nSHA1.padLength = 64;\n\nSHA1.prototype._update = function _update(msg, start) {\n var W = this.W;\n\n for (var i = 0; i < 16; i++)\n W[i] = msg[start + i];\n\n for(; i < W.length; i++)\n W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);\n\n var a = this.h[0];\n var b = this.h[1];\n var c = this.h[2];\n var d = this.h[3];\n var e = this.h[4];\n\n for (i = 0; i < W.length; i++) {\n var s = ~~(i / 20);\n var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);\n e = d;\n d = c;\n c = rotl32(b, 30);\n b = a;\n a = t;\n }\n\n this.h[0] = sum32(this.h[0], a);\n this.h[1] = sum32(this.h[1], b);\n this.h[2] = sum32(this.h[2], c);\n this.h[3] = sum32(this.h[3], d);\n this.h[4] = sum32(this.h[4], e);\n};\n\nSHA1.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'big');\n else\n return utils.split32(this.h, 'big');\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar SHA256 = require('./256');\n\nfunction SHA224() {\n if (!(this instanceof SHA224))\n return new SHA224();\n\n SHA256.call(this);\n this.h = [\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,\n 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ];\n}\nutils.inherits(SHA224, SHA256);\nmodule.exports = SHA224;\n\nSHA224.blockSize = 512;\nSHA224.outSize = 224;\nSHA224.hmacStrength = 192;\nSHA224.padLength = 64;\n\nSHA224.prototype._digest = function digest(enc) {\n // Just truncate output\n if (enc === 'hex')\n return utils.toHex32(this.h.slice(0, 7), 'big');\n else\n return utils.split32(this.h.slice(0, 7), 'big');\n};\n\n","'use strict';\n\nvar utils = require('../utils');\n\nvar SHA512 = require('./512');\n\nfunction SHA384() {\n if (!(this instanceof SHA384))\n return new SHA384();\n\n SHA512.call(this);\n this.h = [\n 0xcbbb9d5d, 0xc1059ed8,\n 0x629a292a, 0x367cd507,\n 0x9159015a, 0x3070dd17,\n 0x152fecd8, 0xf70e5939,\n 0x67332667, 0xffc00b31,\n 0x8eb44a87, 0x68581511,\n 0xdb0c2e0d, 0x64f98fa7,\n 0x47b5481d, 0xbefa4fa4 ];\n}\nutils.inherits(SHA384, SHA512);\nmodule.exports = SHA384;\n\nSHA384.blockSize = 1024;\nSHA384.outSize = 384;\nSHA384.hmacStrength = 192;\nSHA384.padLength = 128;\n\nSHA384.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h.slice(0, 12), 'big');\n else\n return utils.split32(this.h.slice(0, 12), 'big');\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar common = require('./common');\n\nvar rotl32 = utils.rotl32;\nvar sum32 = utils.sum32;\nvar sum32_3 = utils.sum32_3;\nvar sum32_4 = utils.sum32_4;\nvar BlockHash = common.BlockHash;\n\nfunction RIPEMD160() {\n if (!(this instanceof RIPEMD160))\n return new RIPEMD160();\n\n BlockHash.call(this);\n\n this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];\n this.endian = 'little';\n}\nutils.inherits(RIPEMD160, BlockHash);\nexports.ripemd160 = RIPEMD160;\n\nRIPEMD160.blockSize = 512;\nRIPEMD160.outSize = 160;\nRIPEMD160.hmacStrength = 192;\nRIPEMD160.padLength = 64;\n\nRIPEMD160.prototype._update = function update(msg, start) {\n var A = this.h[0];\n var B = this.h[1];\n var C = this.h[2];\n var D = this.h[3];\n var E = this.h[4];\n var Ah = A;\n var Bh = B;\n var Ch = C;\n var Dh = D;\n var Eh = E;\n for (var j = 0; j < 80; j++) {\n var T = sum32(\n rotl32(\n sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)),\n s[j]),\n E);\n A = E;\n E = D;\n D = rotl32(C, 10);\n C = B;\n B = T;\n T = sum32(\n rotl32(\n sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)),\n sh[j]),\n Eh);\n Ah = Eh;\n Eh = Dh;\n Dh = rotl32(Ch, 10);\n Ch = Bh;\n Bh = T;\n }\n T = sum32_3(this.h[1], C, Dh);\n this.h[1] = sum32_3(this.h[2], D, Eh);\n this.h[2] = sum32_3(this.h[3], E, Ah);\n this.h[3] = sum32_3(this.h[4], A, Bh);\n this.h[4] = sum32_3(this.h[0], B, Ch);\n this.h[0] = T;\n};\n\nRIPEMD160.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'little');\n else\n return utils.split32(this.h, 'little');\n};\n\nfunction f(j, x, y, z) {\n if (j <= 15)\n return x ^ y ^ z;\n else if (j <= 31)\n return (x & y) | ((~x) & z);\n else if (j <= 47)\n return (x | (~y)) ^ z;\n else if (j <= 63)\n return (x & z) | (y & (~z));\n else\n return x ^ (y | (~z));\n}\n\nfunction K(j) {\n if (j <= 15)\n return 0x00000000;\n else if (j <= 31)\n return 0x5a827999;\n else if (j <= 47)\n return 0x6ed9eba1;\n else if (j <= 63)\n return 0x8f1bbcdc;\n else\n return 0xa953fd4e;\n}\n\nfunction Kh(j) {\n if (j <= 15)\n return 0x50a28be6;\n else if (j <= 31)\n return 0x5c4dd124;\n else if (j <= 47)\n return 0x6d703ef3;\n else if (j <= 63)\n return 0x7a6d76e9;\n else\n return 0x00000000;\n}\n\nvar r = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,\n 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,\n 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13\n];\n\nvar rh = [\n 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,\n 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,\n 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,\n 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,\n 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11\n];\n\nvar s = [\n 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,\n 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,\n 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,\n 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,\n 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6\n];\n\nvar sh = [\n 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,\n 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,\n 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,\n 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,\n 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11\n];\n","'use strict';\n\nvar utils = require('./utils');\nvar assert = require('minimalistic-assert');\n\nfunction Hmac(hash, key, enc) {\n if (!(this instanceof Hmac))\n return new Hmac(hash, key, enc);\n this.Hash = hash;\n this.blockSize = hash.blockSize / 8;\n this.outSize = hash.outSize / 8;\n this.inner = null;\n this.outer = null;\n\n this._init(utils.toArray(key, enc));\n}\nmodule.exports = Hmac;\n\nHmac.prototype._init = function init(key) {\n // Shorten key, if needed\n if (key.length > this.blockSize)\n key = new this.Hash().update(key).digest();\n assert(key.length <= this.blockSize);\n\n // Add padding to key\n for (var i = key.length; i < this.blockSize; i++)\n key.push(0);\n\n for (i = 0; i < key.length; i++)\n key[i] ^= 0x36;\n this.inner = new this.Hash().update(key);\n\n // 0x36 ^ 0x5c = 0x6a\n for (i = 0; i < key.length; i++)\n key[i] ^= 0x6a;\n this.outer = new this.Hash().update(key);\n};\n\nHmac.prototype.update = function update(msg, enc) {\n this.inner.update(msg, enc);\n return this;\n};\n\nHmac.prototype.digest = function digest(enc) {\n this.outer.update(this.inner.digest());\n return this.outer.digest(enc);\n};\n","module.exports = {\n doubles: {\n step: 4,\n points: [\n [\n 'e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a',\n 'f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821'\n ],\n [\n '8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508',\n '11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf'\n ],\n [\n '175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739',\n 'd3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695'\n ],\n [\n '363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640',\n '4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9'\n ],\n [\n '8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c',\n '4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36'\n ],\n [\n '723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda',\n '96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f'\n ],\n [\n 'eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa',\n '5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999'\n ],\n [\n '100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0',\n 'cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09'\n ],\n [\n 'e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d',\n '9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d'\n ],\n [\n 'feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d',\n 'e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088'\n ],\n [\n 'da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1',\n '9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d'\n ],\n [\n '53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0',\n '5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8'\n ],\n [\n '8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047',\n '10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a'\n ],\n [\n '385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862',\n '283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453'\n ],\n [\n '6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7',\n '7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160'\n ],\n [\n '3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd',\n '56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0'\n ],\n [\n '85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83',\n '7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6'\n ],\n [\n '948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a',\n '53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589'\n ],\n [\n '6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8',\n 'bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17'\n ],\n [\n 'e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d',\n '4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda'\n ],\n [\n 'e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725',\n '7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd'\n ],\n [\n '213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754',\n '4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2'\n ],\n [\n '4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c',\n '17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6'\n ],\n [\n 'fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6',\n '6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f'\n ],\n [\n '76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39',\n 'c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01'\n ],\n [\n 'c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891',\n '893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3'\n ],\n [\n 'd895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b',\n 'febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f'\n ],\n [\n 'b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03',\n '2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7'\n ],\n [\n 'e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d',\n 'eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78'\n ],\n [\n 'a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070',\n '7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1'\n ],\n [\n '90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4',\n 'e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150'\n ],\n [\n '8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da',\n '662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82'\n ],\n [\n 'e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11',\n '1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc'\n ],\n [\n '8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e',\n 'efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b'\n ],\n [\n 'e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41',\n '2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51'\n ],\n [\n 'b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef',\n '67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45'\n ],\n [\n 'd68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8',\n 'db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120'\n ],\n [\n '324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d',\n '648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84'\n ],\n [\n '4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96',\n '35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d'\n ],\n [\n '9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd',\n 'ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d'\n ],\n [\n '6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5',\n '9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8'\n ],\n [\n 'a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266',\n '40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8'\n ],\n [\n '7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71',\n '34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac'\n ],\n [\n '928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac',\n 'c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f'\n ],\n [\n '85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751',\n '1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962'\n ],\n [\n 'ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e',\n '493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907'\n ],\n [\n '827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241',\n 'c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec'\n ],\n [\n 'eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3',\n 'be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d'\n ],\n [\n 'e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f',\n '4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414'\n ],\n [\n '1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19',\n 'aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd'\n ],\n [\n '146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be',\n 'b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0'\n ],\n [\n 'fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9',\n '6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811'\n ],\n [\n 'da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2',\n '8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1'\n ],\n [\n 'a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13',\n '7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c'\n ],\n [\n '174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c',\n 'ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73'\n ],\n [\n '959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba',\n '2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd'\n ],\n [\n 'd2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151',\n 'e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405'\n ],\n [\n '64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073',\n 'd99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589'\n ],\n [\n '8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458',\n '38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e'\n ],\n [\n '13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b',\n '69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27'\n ],\n [\n 'bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366',\n 'd3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1'\n ],\n [\n '8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa',\n '40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482'\n ],\n [\n '8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0',\n '620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945'\n ],\n [\n 'dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787',\n '7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573'\n ],\n [\n 'f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e',\n 'ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82'\n ]\n ]\n },\n naf: {\n wnd: 7,\n points: [\n [\n 'f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9',\n '388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672'\n ],\n [\n '2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4',\n 'd8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6'\n ],\n [\n '5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc',\n '6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da'\n ],\n [\n 'acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe',\n 'cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37'\n ],\n [\n '774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb',\n 'd984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b'\n ],\n [\n 'f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8',\n 'ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81'\n ],\n [\n 'd7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e',\n '581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58'\n ],\n [\n 'defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34',\n '4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77'\n ],\n [\n '2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c',\n '85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a'\n ],\n [\n '352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5',\n '321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c'\n ],\n [\n '2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f',\n '2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67'\n ],\n [\n '9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714',\n '73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402'\n ],\n [\n 'daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729',\n 'a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55'\n ],\n [\n 'c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db',\n '2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482'\n ],\n [\n '6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4',\n 'e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82'\n ],\n [\n '1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5',\n 'b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396'\n ],\n [\n '605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479',\n '2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49'\n ],\n [\n '62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d',\n '80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf'\n ],\n [\n '80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f',\n '1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a'\n ],\n [\n '7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb',\n 'd0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7'\n ],\n [\n 'd528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9',\n 'eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933'\n ],\n [\n '49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963',\n '758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a'\n ],\n [\n '77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74',\n '958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6'\n ],\n [\n 'f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530',\n 'e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37'\n ],\n [\n '463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b',\n '5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e'\n ],\n [\n 'f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247',\n 'cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6'\n ],\n [\n 'caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1',\n 'cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476'\n ],\n [\n '2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120',\n '4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40'\n ],\n [\n '7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435',\n '91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61'\n ],\n [\n '754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18',\n '673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683'\n ],\n [\n 'e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8',\n '59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5'\n ],\n [\n '186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb',\n '3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b'\n ],\n [\n 'df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f',\n '55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417'\n ],\n [\n '5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143',\n 'efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868'\n ],\n [\n '290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba',\n 'e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a'\n ],\n [\n 'af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45',\n 'f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6'\n ],\n [\n '766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a',\n '744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996'\n ],\n [\n '59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e',\n 'c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e'\n ],\n [\n 'f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8',\n 'e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d'\n ],\n [\n '7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c',\n '30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2'\n ],\n [\n '948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519',\n 'e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e'\n ],\n [\n '7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab',\n '100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437'\n ],\n [\n '3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca',\n 'ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311'\n ],\n [\n 'd3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf',\n '8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4'\n ],\n [\n '1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610',\n '68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575'\n ],\n [\n '733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4',\n 'f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d'\n ],\n [\n '15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c',\n 'd56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d'\n ],\n [\n 'a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940',\n 'edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629'\n ],\n [\n 'e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980',\n 'a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06'\n ],\n [\n '311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3',\n '66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374'\n ],\n [\n '34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf',\n '9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee'\n ],\n [\n 'f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63',\n '4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1'\n ],\n [\n 'd7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448',\n 'fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b'\n ],\n [\n '32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf',\n '5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661'\n ],\n [\n '7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5',\n '8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6'\n ],\n [\n 'ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6',\n '8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e'\n ],\n [\n '16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5',\n '5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d'\n ],\n [\n 'eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99',\n 'f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc'\n ],\n [\n '78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51',\n 'f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4'\n ],\n [\n '494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5',\n '42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c'\n ],\n [\n 'a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5',\n '204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b'\n ],\n [\n 'c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997',\n '4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913'\n ],\n [\n '841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881',\n '73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154'\n ],\n [\n '5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5',\n '39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865'\n ],\n [\n '36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66',\n 'd2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc'\n ],\n [\n '336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726',\n 'ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224'\n ],\n [\n '8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede',\n '6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e'\n ],\n [\n '1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94',\n '60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6'\n ],\n [\n '85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31',\n '3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511'\n ],\n [\n '29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51',\n 'b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b'\n ],\n [\n 'a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252',\n 'ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2'\n ],\n [\n '4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5',\n 'cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c'\n ],\n [\n 'd24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b',\n '6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3'\n ],\n [\n 'ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4',\n '322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d'\n ],\n [\n 'af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f',\n '6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700'\n ],\n [\n 'e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889',\n '2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4'\n ],\n [\n '591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246',\n 'b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196'\n ],\n [\n '11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984',\n '998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4'\n ],\n [\n '3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a',\n 'b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257'\n ],\n [\n 'cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030',\n 'bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13'\n ],\n [\n 'c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197',\n '6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096'\n ],\n [\n 'c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593',\n 'c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38'\n ],\n [\n 'a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef',\n '21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f'\n ],\n [\n '347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38',\n '60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448'\n ],\n [\n 'da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a',\n '49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a'\n ],\n [\n 'c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111',\n '5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4'\n ],\n [\n '4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502',\n '7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437'\n ],\n [\n '3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea',\n 'be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7'\n ],\n [\n 'cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26',\n '8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d'\n ],\n [\n 'b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986',\n '39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a'\n ],\n [\n 'd4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e',\n '62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54'\n ],\n [\n '48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4',\n '25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77'\n ],\n [\n 'dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda',\n 'ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517'\n ],\n [\n '6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859',\n 'cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10'\n ],\n [\n 'e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f',\n 'f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125'\n ],\n [\n 'eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c',\n '6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e'\n ],\n [\n '13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942',\n 'fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1'\n ],\n [\n 'ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a',\n '1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2'\n ],\n [\n 'b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80',\n '5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423'\n ],\n [\n 'ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d',\n '438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8'\n ],\n [\n '8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1',\n 'cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758'\n ],\n [\n '52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63',\n 'c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375'\n ],\n [\n 'e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352',\n '6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d'\n ],\n [\n '7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193',\n 'ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec'\n ],\n [\n '5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00',\n '9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0'\n ],\n [\n '32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58',\n 'ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c'\n ],\n [\n 'e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7',\n 'd3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4'\n ],\n [\n '8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8',\n 'c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f'\n ],\n [\n '4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e',\n '67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649'\n ],\n [\n '3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d',\n 'cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826'\n ],\n [\n '674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b',\n '299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5'\n ],\n [\n 'd32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f',\n 'f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87'\n ],\n [\n '30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6',\n '462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b'\n ],\n [\n 'be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297',\n '62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc'\n ],\n [\n '93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a',\n '7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c'\n ],\n [\n 'b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c',\n 'ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f'\n ],\n [\n 'd5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52',\n '4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a'\n ],\n [\n 'd3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb',\n 'bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46'\n ],\n [\n '463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065',\n 'bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f'\n ],\n [\n '7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917',\n '603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03'\n ],\n [\n '74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9',\n 'cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08'\n ],\n [\n '30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3',\n '553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8'\n ],\n [\n '9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57',\n '712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373'\n ],\n [\n '176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66',\n 'ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3'\n ],\n [\n '75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8',\n '9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8'\n ],\n [\n '809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721',\n '9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1'\n ],\n [\n '1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180',\n '4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9'\n ]\n ]\n }\n};\n","'use strict';\n\nvar BN = require('bn.js');\nvar HmacDRBG = require('hmac-drbg');\nvar utils = require('../utils');\nvar curves = require('../curves');\nvar rand = require('brorand');\nvar assert = utils.assert;\n\nvar KeyPair = require('./key');\nvar Signature = require('./signature');\n\nfunction EC(options) {\n if (!(this instanceof EC))\n return new EC(options);\n\n // Shortcut `elliptic.ec(curve-name)`\n if (typeof options === 'string') {\n assert(curves.hasOwnProperty(options), 'Unknown curve ' + options);\n\n options = curves[options];\n }\n\n // Shortcut for `elliptic.ec(elliptic.curves.curveName)`\n if (options instanceof curves.PresetCurve)\n options = { curve: options };\n\n this.curve = options.curve.curve;\n this.n = this.curve.n;\n this.nh = this.n.ushrn(1);\n this.g = this.curve.g;\n\n // Point on curve\n this.g = options.curve.g;\n this.g.precompute(options.curve.n.bitLength() + 1);\n\n // Hash for function for DRBG\n this.hash = options.hash || options.curve.hash;\n}\nmodule.exports = EC;\n\nEC.prototype.keyPair = function keyPair(options) {\n return new KeyPair(this, options);\n};\n\nEC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {\n return KeyPair.fromPrivate(this, priv, enc);\n};\n\nEC.prototype.keyFromPublic = function keyFromPublic(pub, enc) {\n return KeyPair.fromPublic(this, pub, enc);\n};\n\nEC.prototype.genKeyPair = function genKeyPair(options) {\n if (!options)\n options = {};\n\n // Instantiate Hmac_DRBG\n var drbg = new HmacDRBG({\n hash: this.hash,\n pers: options.pers,\n persEnc: options.persEnc || 'utf8',\n entropy: options.entropy || rand(this.hash.hmacStrength),\n entropyEnc: options.entropy && options.entropyEnc || 'utf8',\n nonce: this.n.toArray()\n });\n\n var bytes = this.n.byteLength();\n var ns2 = this.n.sub(new BN(2));\n do {\n var priv = new BN(drbg.generate(bytes));\n if (priv.cmp(ns2) > 0)\n continue;\n\n priv.iaddn(1);\n return this.keyFromPrivate(priv);\n } while (true);\n};\n\nEC.prototype._truncateToN = function truncateToN(msg, truncOnly) {\n var delta = msg.byteLength() * 8 - this.n.bitLength();\n if (delta > 0)\n msg = msg.ushrn(delta);\n if (!truncOnly && msg.cmp(this.n) >= 0)\n return msg.sub(this.n);\n else\n return msg;\n};\n\nEC.prototype.sign = function sign(msg, key, enc, options) {\n if (typeof enc === 'object') {\n options = enc;\n enc = null;\n }\n if (!options)\n options = {};\n\n key = this.keyFromPrivate(key, enc);\n msg = this._truncateToN(new BN(msg, 16));\n\n // Zero-extend key to provide enough entropy\n var bytes = this.n.byteLength();\n var bkey = key.getPrivate().toArray('be', bytes);\n\n // Zero-extend nonce to have the same byte size as N\n var nonce = msg.toArray('be', bytes);\n\n // Instantiate Hmac_DRBG\n var drbg = new HmacDRBG({\n hash: this.hash,\n entropy: bkey,\n nonce: nonce,\n pers: options.pers,\n persEnc: options.persEnc || 'utf8'\n });\n\n // Number of bytes to generate\n var ns1 = this.n.sub(new BN(1));\n\n for (var iter = 0; true; iter++) {\n var k = options.k ?\n options.k(iter) :\n new BN(drbg.generate(this.n.byteLength()));\n k = this._truncateToN(k, true);\n if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)\n continue;\n\n var kp = this.g.mul(k);\n if (kp.isInfinity())\n continue;\n\n var kpX = kp.getX();\n var r = kpX.umod(this.n);\n if (r.cmpn(0) === 0)\n continue;\n\n var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));\n s = s.umod(this.n);\n if (s.cmpn(0) === 0)\n continue;\n\n var recoveryParam = (kp.getY().isOdd() ? 1 : 0) |\n (kpX.cmp(r) !== 0 ? 2 : 0);\n\n // Use complement of `s`, if it is > `n / 2`\n if (options.canonical && s.cmp(this.nh) > 0) {\n s = this.n.sub(s);\n recoveryParam ^= 1;\n }\n\n return new Signature({ r: r, s: s, recoveryParam: recoveryParam });\n }\n};\n\nEC.prototype.verify = function verify(msg, signature, key, enc) {\n msg = this._truncateToN(new BN(msg, 16));\n key = this.keyFromPublic(key, enc);\n signature = new Signature(signature, 'hex');\n\n // Perform primitive values validation\n var r = signature.r;\n var s = signature.s;\n if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0)\n return false;\n if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0)\n return false;\n\n // Validate signature\n var sinv = s.invm(this.n);\n var u1 = sinv.mul(msg).umod(this.n);\n var u2 = sinv.mul(r).umod(this.n);\n\n if (!this.curve._maxwellTrick) {\n var p = this.g.mulAdd(u1, key.getPublic(), u2);\n if (p.isInfinity())\n return false;\n\n return p.getX().umod(this.n).cmp(r) === 0;\n }\n\n // NOTE: Greg Maxwell's trick, inspired by:\n // https://git.io/vad3K\n\n var p = this.g.jmulAdd(u1, key.getPublic(), u2);\n if (p.isInfinity())\n return false;\n\n // Compare `p.x` of Jacobian point with `r`,\n // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the\n // inverse of `p.z^2`\n return p.eqXToP(r);\n};\n\nEC.prototype.recoverPubKey = function(msg, signature, j, enc) {\n assert((3 & j) === j, 'The recovery param is more than two bits');\n signature = new Signature(signature, enc);\n\n var n = this.n;\n var e = new BN(msg);\n var r = signature.r;\n var s = signature.s;\n\n // A set LSB signifies that the y-coordinate is odd\n var isYOdd = j & 1;\n var isSecondKey = j >> 1;\n if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)\n throw new Error('Unable to find sencond key candinate');\n\n // 1.1. Let x = r + jn.\n if (isSecondKey)\n r = this.curve.pointFromX(r.add(this.curve.n), isYOdd);\n else\n r = this.curve.pointFromX(r, isYOdd);\n\n var rInv = signature.r.invm(n);\n var s1 = n.sub(e).mul(rInv).umod(n);\n var s2 = s.mul(rInv).umod(n);\n\n // 1.6.1 Compute Q = r^-1 (sR - eG)\n // Q = r^-1 (sR + -eG)\n return this.g.mulAdd(s1, r, s2);\n};\n\nEC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {\n signature = new Signature(signature, enc);\n if (signature.recoveryParam !== null)\n return signature.recoveryParam;\n\n for (var i = 0; i < 4; i++) {\n var Qprime;\n try {\n Qprime = this.recoverPubKey(e, signature, i);\n } catch (e) {\n continue;\n }\n\n if (Qprime.eq(Q))\n return i;\n }\n throw new Error('Unable to find valid recovery factor');\n};\n","'use strict';\n\nvar hash = require('hash.js');\nvar utils = require('minimalistic-crypto-utils');\nvar assert = require('minimalistic-assert');\n\nfunction HmacDRBG(options) {\n if (!(this instanceof HmacDRBG))\n return new HmacDRBG(options);\n this.hash = options.hash;\n this.predResist = !!options.predResist;\n\n this.outLen = this.hash.outSize;\n this.minEntropy = options.minEntropy || this.hash.hmacStrength;\n\n this._reseed = null;\n this.reseedInterval = null;\n this.K = null;\n this.V = null;\n\n var entropy = utils.toArray(options.entropy, options.entropyEnc || 'hex');\n var nonce = utils.toArray(options.nonce, options.nonceEnc || 'hex');\n var pers = utils.toArray(options.pers, options.persEnc || 'hex');\n assert(entropy.length >= (this.minEntropy / 8),\n 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');\n this._init(entropy, nonce, pers);\n}\nmodule.exports = HmacDRBG;\n\nHmacDRBG.prototype._init = function init(entropy, nonce, pers) {\n var seed = entropy.concat(nonce).concat(pers);\n\n this.K = new Array(this.outLen / 8);\n this.V = new Array(this.outLen / 8);\n for (var i = 0; i < this.V.length; i++) {\n this.K[i] = 0x00;\n this.V[i] = 0x01;\n }\n\n this._update(seed);\n this._reseed = 1;\n this.reseedInterval = 0x1000000000000; // 2^48\n};\n\nHmacDRBG.prototype._hmac = function hmac() {\n return new hash.hmac(this.hash, this.K);\n};\n\nHmacDRBG.prototype._update = function update(seed) {\n var kmac = this._hmac()\n .update(this.V)\n .update([ 0x00 ]);\n if (seed)\n kmac = kmac.update(seed);\n this.K = kmac.digest();\n this.V = this._hmac().update(this.V).digest();\n if (!seed)\n return;\n\n this.K = this._hmac()\n .update(this.V)\n .update([ 0x01 ])\n .update(seed)\n .digest();\n this.V = this._hmac().update(this.V).digest();\n};\n\nHmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {\n // Optional entropy enc\n if (typeof entropyEnc !== 'string') {\n addEnc = add;\n add = entropyEnc;\n entropyEnc = null;\n }\n\n entropy = utils.toArray(entropy, entropyEnc);\n add = utils.toArray(add, addEnc);\n\n assert(entropy.length >= (this.minEntropy / 8),\n 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');\n\n this._update(entropy.concat(add || []));\n this._reseed = 1;\n};\n\nHmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {\n if (this._reseed > this.reseedInterval)\n throw new Error('Reseed is required');\n\n // Optional encoding\n if (typeof enc !== 'string') {\n addEnc = add;\n add = enc;\n enc = null;\n }\n\n // Optional additional data\n if (add) {\n add = utils.toArray(add, addEnc || 'hex');\n this._update(add);\n }\n\n var temp = [];\n while (temp.length < len) {\n this.V = this._hmac().update(this.V).digest();\n temp = temp.concat(this.V);\n }\n\n var res = temp.slice(0, len);\n this._update(add);\n this._reseed++;\n return utils.encode(res, enc);\n};\n","'use strict';\n\nvar BN = require('bn.js');\nvar utils = require('../utils');\nvar assert = utils.assert;\n\nfunction KeyPair(ec, options) {\n this.ec = ec;\n this.priv = null;\n this.pub = null;\n\n // KeyPair(ec, { priv: ..., pub: ... })\n if (options.priv)\n this._importPrivate(options.priv, options.privEnc);\n if (options.pub)\n this._importPublic(options.pub, options.pubEnc);\n}\nmodule.exports = KeyPair;\n\nKeyPair.fromPublic = function fromPublic(ec, pub, enc) {\n if (pub instanceof KeyPair)\n return pub;\n\n return new KeyPair(ec, {\n pub: pub,\n pubEnc: enc\n });\n};\n\nKeyPair.fromPrivate = function fromPrivate(ec, priv, enc) {\n if (priv instanceof KeyPair)\n return priv;\n\n return new KeyPair(ec, {\n priv: priv,\n privEnc: enc\n });\n};\n\nKeyPair.prototype.validate = function validate() {\n var pub = this.getPublic();\n\n if (pub.isInfinity())\n return { result: false, reason: 'Invalid public key' };\n if (!pub.validate())\n return { result: false, reason: 'Public key is not a point' };\n if (!pub.mul(this.ec.curve.n).isInfinity())\n return { result: false, reason: 'Public key * N != O' };\n\n return { result: true, reason: null };\n};\n\nKeyPair.prototype.getPublic = function getPublic(compact, enc) {\n // compact is optional argument\n if (typeof compact === 'string') {\n enc = compact;\n compact = null;\n }\n\n if (!this.pub)\n this.pub = this.ec.g.mul(this.priv);\n\n if (!enc)\n return this.pub;\n\n return this.pub.encode(enc, compact);\n};\n\nKeyPair.prototype.getPrivate = function getPrivate(enc) {\n if (enc === 'hex')\n return this.priv.toString(16, 2);\n else\n return this.priv;\n};\n\nKeyPair.prototype._importPrivate = function _importPrivate(key, enc) {\n this.priv = new BN(key, enc || 16);\n\n // Ensure that the priv won't be bigger than n, otherwise we may fail\n // in fixed multiplication method\n this.priv = this.priv.umod(this.ec.curve.n);\n};\n\nKeyPair.prototype._importPublic = function _importPublic(key, enc) {\n if (key.x || key.y) {\n // Montgomery points only have an `x` coordinate.\n // Weierstrass/Edwards points on the other hand have both `x` and\n // `y` coordinates.\n if (this.ec.curve.type === 'mont') {\n assert(key.x, 'Need x coordinate');\n } else if (this.ec.curve.type === 'short' ||\n this.ec.curve.type === 'edwards') {\n assert(key.x && key.y, 'Need both x and y coordinate');\n }\n this.pub = this.ec.curve.point(key.x, key.y);\n return;\n }\n this.pub = this.ec.curve.decodePoint(key, enc);\n};\n\n// ECDH\nKeyPair.prototype.derive = function derive(pub) {\n return pub.mul(this.priv).getX();\n};\n\n// ECDSA\nKeyPair.prototype.sign = function sign(msg, enc, options) {\n return this.ec.sign(msg, this, enc, options);\n};\n\nKeyPair.prototype.verify = function verify(msg, signature) {\n return this.ec.verify(msg, signature, this);\n};\n\nKeyPair.prototype.inspect = function inspect() {\n return '';\n};\n","'use strict';\n\nvar BN = require('bn.js');\n\nvar utils = require('../utils');\nvar assert = utils.assert;\n\nfunction Signature(options, enc) {\n if (options instanceof Signature)\n return options;\n\n if (this._importDER(options, enc))\n return;\n\n assert(options.r && options.s, 'Signature without r or s');\n this.r = new BN(options.r, 16);\n this.s = new BN(options.s, 16);\n if (options.recoveryParam === undefined)\n this.recoveryParam = null;\n else\n this.recoveryParam = options.recoveryParam;\n}\nmodule.exports = Signature;\n\nfunction Position() {\n this.place = 0;\n}\n\nfunction getLength(buf, p) {\n var initial = buf[p.place++];\n if (!(initial & 0x80)) {\n return initial;\n }\n var octetLen = initial & 0xf;\n\n // Indefinite length or overflow\n if (octetLen === 0 || octetLen > 4) {\n return false;\n }\n\n var val = 0;\n for (var i = 0, off = p.place; i < octetLen; i++, off++) {\n val <<= 8;\n val |= buf[off];\n val >>>= 0;\n }\n\n // Leading zeroes\n if (val <= 0x7f) {\n return false;\n }\n\n p.place = off;\n return val;\n}\n\nfunction rmPadding(buf) {\n var i = 0;\n var len = buf.length - 1;\n while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) {\n i++;\n }\n if (i === 0) {\n return buf;\n }\n return buf.slice(i);\n}\n\nSignature.prototype._importDER = function _importDER(data, enc) {\n data = utils.toArray(data, enc);\n var p = new Position();\n if (data[p.place++] !== 0x30) {\n return false;\n }\n var len = getLength(data, p);\n if (len === false) {\n return false;\n }\n if ((len + p.place) !== data.length) {\n return false;\n }\n if (data[p.place++] !== 0x02) {\n return false;\n }\n var rlen = getLength(data, p);\n if (rlen === false) {\n return false;\n }\n var r = data.slice(p.place, rlen + p.place);\n p.place += rlen;\n if (data[p.place++] !== 0x02) {\n return false;\n }\n var slen = getLength(data, p);\n if (slen === false) {\n return false;\n }\n if (data.length !== slen + p.place) {\n return false;\n }\n var s = data.slice(p.place, slen + p.place);\n if (r[0] === 0) {\n if (r[1] & 0x80) {\n r = r.slice(1);\n } else {\n // Leading zeroes\n return false;\n }\n }\n if (s[0] === 0) {\n if (s[1] & 0x80) {\n s = s.slice(1);\n } else {\n // Leading zeroes\n return false;\n }\n }\n\n this.r = new BN(r);\n this.s = new BN(s);\n this.recoveryParam = null;\n\n return true;\n};\n\nfunction constructLength(arr, len) {\n if (len < 0x80) {\n arr.push(len);\n return;\n }\n var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);\n arr.push(octets | 0x80);\n while (--octets) {\n arr.push((len >>> (octets << 3)) & 0xff);\n }\n arr.push(len);\n}\n\nSignature.prototype.toDER = function toDER(enc) {\n var r = this.r.toArray();\n var s = this.s.toArray();\n\n // Pad values\n if (r[0] & 0x80)\n r = [ 0 ].concat(r);\n // Pad values\n if (s[0] & 0x80)\n s = [ 0 ].concat(s);\n\n r = rmPadding(r);\n s = rmPadding(s);\n\n while (!s[0] && !(s[1] & 0x80)) {\n s = s.slice(1);\n }\n var arr = [ 0x02 ];\n constructLength(arr, r.length);\n arr = arr.concat(r);\n arr.push(0x02);\n constructLength(arr, s.length);\n var backHalf = arr.concat(s);\n var res = [ 0x30 ];\n constructLength(res, backHalf.length);\n res = res.concat(backHalf);\n return utils.encode(res, enc);\n};\n","'use strict';\n\nvar hash = require('hash.js');\nvar curves = require('../curves');\nvar utils = require('../utils');\nvar assert = utils.assert;\nvar parseBytes = utils.parseBytes;\nvar KeyPair = require('./key');\nvar Signature = require('./signature');\n\nfunction EDDSA(curve) {\n assert(curve === 'ed25519', 'only tested with ed25519 so far');\n\n if (!(this instanceof EDDSA))\n return new EDDSA(curve);\n\n var curve = curves[curve].curve;\n this.curve = curve;\n this.g = curve.g;\n this.g.precompute(curve.n.bitLength() + 1);\n\n this.pointClass = curve.point().constructor;\n this.encodingLength = Math.ceil(curve.n.bitLength() / 8);\n this.hash = hash.sha512;\n}\n\nmodule.exports = EDDSA;\n\n/**\n* @param {Array|String} message - message bytes\n* @param {Array|String|KeyPair} secret - secret bytes or a keypair\n* @returns {Signature} - signature\n*/\nEDDSA.prototype.sign = function sign(message, secret) {\n message = parseBytes(message);\n var key = this.keyFromSecret(secret);\n var r = this.hashInt(key.messagePrefix(), message);\n var R = this.g.mul(r);\n var Rencoded = this.encodePoint(R);\n var s_ = this.hashInt(Rencoded, key.pubBytes(), message)\n .mul(key.priv());\n var S = r.add(s_).umod(this.curve.n);\n return this.makeSignature({ R: R, S: S, Rencoded: Rencoded });\n};\n\n/**\n* @param {Array} message - message bytes\n* @param {Array|String|Signature} sig - sig bytes\n* @param {Array|String|Point|KeyPair} pub - public key\n* @returns {Boolean} - true if public key matches sig of message\n*/\nEDDSA.prototype.verify = function verify(message, sig, pub) {\n message = parseBytes(message);\n sig = this.makeSignature(sig);\n var key = this.keyFromPublic(pub);\n var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message);\n var SG = this.g.mul(sig.S());\n var RplusAh = sig.R().add(key.pub().mul(h));\n return RplusAh.eq(SG);\n};\n\nEDDSA.prototype.hashInt = function hashInt() {\n var hash = this.hash();\n for (var i = 0; i < arguments.length; i++)\n hash.update(arguments[i]);\n return utils.intFromLE(hash.digest()).umod(this.curve.n);\n};\n\nEDDSA.prototype.keyFromPublic = function keyFromPublic(pub) {\n return KeyPair.fromPublic(this, pub);\n};\n\nEDDSA.prototype.keyFromSecret = function keyFromSecret(secret) {\n return KeyPair.fromSecret(this, secret);\n};\n\nEDDSA.prototype.makeSignature = function makeSignature(sig) {\n if (sig instanceof Signature)\n return sig;\n return new Signature(this, sig);\n};\n\n/**\n* * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2\n*\n* EDDSA defines methods for encoding and decoding points and integers. These are\n* helper convenience methods, that pass along to utility functions implied\n* parameters.\n*\n*/\nEDDSA.prototype.encodePoint = function encodePoint(point) {\n var enc = point.getY().toArray('le', this.encodingLength);\n enc[this.encodingLength - 1] |= point.getX().isOdd() ? 0x80 : 0;\n return enc;\n};\n\nEDDSA.prototype.decodePoint = function decodePoint(bytes) {\n bytes = utils.parseBytes(bytes);\n\n var lastIx = bytes.length - 1;\n var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~0x80);\n var xIsOdd = (bytes[lastIx] & 0x80) !== 0;\n\n var y = utils.intFromLE(normed);\n return this.curve.pointFromY(y, xIsOdd);\n};\n\nEDDSA.prototype.encodeInt = function encodeInt(num) {\n return num.toArray('le', this.encodingLength);\n};\n\nEDDSA.prototype.decodeInt = function decodeInt(bytes) {\n return utils.intFromLE(bytes);\n};\n\nEDDSA.prototype.isPoint = function isPoint(val) {\n return val instanceof this.pointClass;\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar assert = utils.assert;\nvar parseBytes = utils.parseBytes;\nvar cachedProperty = utils.cachedProperty;\n\n/**\n* @param {EDDSA} eddsa - instance\n* @param {Object} params - public/private key parameters\n*\n* @param {Array} [params.secret] - secret seed bytes\n* @param {Point} [params.pub] - public key point (aka `A` in eddsa terms)\n* @param {Array} [params.pub] - public key point encoded as bytes\n*\n*/\nfunction KeyPair(eddsa, params) {\n this.eddsa = eddsa;\n this._secret = parseBytes(params.secret);\n if (eddsa.isPoint(params.pub))\n this._pub = params.pub;\n else\n this._pubBytes = parseBytes(params.pub);\n}\n\nKeyPair.fromPublic = function fromPublic(eddsa, pub) {\n if (pub instanceof KeyPair)\n return pub;\n return new KeyPair(eddsa, { pub: pub });\n};\n\nKeyPair.fromSecret = function fromSecret(eddsa, secret) {\n if (secret instanceof KeyPair)\n return secret;\n return new KeyPair(eddsa, { secret: secret });\n};\n\nKeyPair.prototype.secret = function secret() {\n return this._secret;\n};\n\ncachedProperty(KeyPair, 'pubBytes', function pubBytes() {\n return this.eddsa.encodePoint(this.pub());\n});\n\ncachedProperty(KeyPair, 'pub', function pub() {\n if (this._pubBytes)\n return this.eddsa.decodePoint(this._pubBytes);\n return this.eddsa.g.mul(this.priv());\n});\n\ncachedProperty(KeyPair, 'privBytes', function privBytes() {\n var eddsa = this.eddsa;\n var hash = this.hash();\n var lastIx = eddsa.encodingLength - 1;\n\n var a = hash.slice(0, eddsa.encodingLength);\n a[0] &= 248;\n a[lastIx] &= 127;\n a[lastIx] |= 64;\n\n return a;\n});\n\ncachedProperty(KeyPair, 'priv', function priv() {\n return this.eddsa.decodeInt(this.privBytes());\n});\n\ncachedProperty(KeyPair, 'hash', function hash() {\n return this.eddsa.hash().update(this.secret()).digest();\n});\n\ncachedProperty(KeyPair, 'messagePrefix', function messagePrefix() {\n return this.hash().slice(this.eddsa.encodingLength);\n});\n\nKeyPair.prototype.sign = function sign(message) {\n assert(this._secret, 'KeyPair can only verify');\n return this.eddsa.sign(message, this);\n};\n\nKeyPair.prototype.verify = function verify(message, sig) {\n return this.eddsa.verify(message, sig, this);\n};\n\nKeyPair.prototype.getSecret = function getSecret(enc) {\n assert(this._secret, 'KeyPair is public only');\n return utils.encode(this.secret(), enc);\n};\n\nKeyPair.prototype.getPublic = function getPublic(enc) {\n return utils.encode(this.pubBytes(), enc);\n};\n\nmodule.exports = KeyPair;\n","'use strict';\n\nvar BN = require('bn.js');\nvar utils = require('../utils');\nvar assert = utils.assert;\nvar cachedProperty = utils.cachedProperty;\nvar parseBytes = utils.parseBytes;\n\n/**\n* @param {EDDSA} eddsa - eddsa instance\n* @param {Array|Object} sig -\n* @param {Array|Point} [sig.R] - R point as Point or bytes\n* @param {Array|bn} [sig.S] - S scalar as bn or bytes\n* @param {Array} [sig.Rencoded] - R point encoded\n* @param {Array} [sig.Sencoded] - S scalar encoded\n*/\nfunction Signature(eddsa, sig) {\n this.eddsa = eddsa;\n\n if (typeof sig !== 'object')\n sig = parseBytes(sig);\n\n if (Array.isArray(sig)) {\n sig = {\n R: sig.slice(0, eddsa.encodingLength),\n S: sig.slice(eddsa.encodingLength)\n };\n }\n\n assert(sig.R && sig.S, 'Signature without R or S');\n\n if (eddsa.isPoint(sig.R))\n this._R = sig.R;\n if (sig.S instanceof BN)\n this._S = sig.S;\n\n this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded;\n this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded;\n}\n\ncachedProperty(Signature, 'S', function S() {\n return this.eddsa.decodeInt(this.Sencoded());\n});\n\ncachedProperty(Signature, 'R', function R() {\n return this.eddsa.decodePoint(this.Rencoded());\n});\n\ncachedProperty(Signature, 'Rencoded', function Rencoded() {\n return this.eddsa.encodePoint(this.R());\n});\n\ncachedProperty(Signature, 'Sencoded', function Sencoded() {\n return this.eddsa.encodeInt(this.S());\n});\n\nSignature.prototype.toBytes = function toBytes() {\n return this.Rencoded().concat(this.Sencoded());\n};\n\nSignature.prototype.toHex = function toHex() {\n return utils.encode(this.toBytes(), 'hex').toUpperCase();\n};\n\nmodule.exports = Signature;\n","const createHmac = require('create-hmac')\n\nconst ONE1 = Buffer.alloc(1, 1)\nconst ZERO1 = Buffer.alloc(1, 0)\n\n// https://tools.ietf.org/html/rfc6979#section-3.2\nfunction deterministicGenerateK (hash, x, checkSig, isPrivate, extraEntropy) {\n // Step A, ignored as hash already provided\n // Step B\n // Step C\n let k = Buffer.alloc(32, 0)\n let v = Buffer.alloc(32, 1)\n\n // Step D\n k = createHmac('sha256', k)\n .update(v)\n .update(ZERO1)\n .update(x)\n .update(hash)\n .update(extraEntropy || '')\n .digest()\n\n // Step E\n v = createHmac('sha256', k).update(v).digest()\n\n // Step F\n k = createHmac('sha256', k)\n .update(v)\n .update(ONE1)\n .update(x)\n .update(hash)\n .update(extraEntropy || '')\n .digest()\n\n // Step G\n v = createHmac('sha256', k).update(v).digest()\n\n // Step H1/H2a, ignored as tlen === qlen (256 bit)\n // Step H2b\n v = createHmac('sha256', k).update(v).digest()\n\n let T = v\n\n // Step H3, repeat until T is within the interval [1, n - 1] and is suitable for ECDSA\n while (!isPrivate(T) || !checkSig(T)) {\n k = createHmac('sha256', k)\n .update(v)\n .update(ZERO1)\n .digest()\n\n v = createHmac('sha256', k).update(v).digest()\n\n // Step H1/H2a, again, ignored as tlen === qlen (256 bit)\n // Step H2b again\n v = createHmac('sha256', k).update(v).digest()\n T = v\n }\n\n return T\n}\n\nmodule.exports = deterministicGenerateK\n","var ERRORS = require('./errors')\nvar NATIVE = require('./native')\n\n// short-hand\nvar tfJSON = ERRORS.tfJSON\nvar TfTypeError = ERRORS.TfTypeError\nvar TfPropertyTypeError = ERRORS.TfPropertyTypeError\nvar tfSubError = ERRORS.tfSubError\nvar getValueTypeName = ERRORS.getValueTypeName\n\nvar TYPES = {\n arrayOf: function arrayOf (type, options) {\n type = compile(type)\n options = options || {}\n\n function _arrayOf (array, strict) {\n if (!NATIVE.Array(array)) return false\n if (NATIVE.Nil(array)) return false\n if (options.minLength !== undefined && array.length < options.minLength) return false\n if (options.maxLength !== undefined && array.length > options.maxLength) return false\n if (options.length !== undefined && array.length !== options.length) return false\n\n return array.every(function (value, i) {\n try {\n return typeforce(type, value, strict)\n } catch (e) {\n throw tfSubError(e, i)\n }\n })\n }\n _arrayOf.toJSON = function () {\n var str = '[' + tfJSON(type) + ']'\n if (options.length !== undefined) {\n str += '{' + options.length + '}'\n } else if (options.minLength !== undefined || options.maxLength !== undefined) {\n str += '{' +\n (options.minLength === undefined ? 0 : options.minLength) + ',' +\n (options.maxLength === undefined ? Infinity : options.maxLength) + '}'\n }\n return str\n }\n\n return _arrayOf\n },\n\n maybe: function maybe (type) {\n type = compile(type)\n\n function _maybe (value, strict) {\n return NATIVE.Nil(value) || type(value, strict, maybe)\n }\n _maybe.toJSON = function () { return '?' + tfJSON(type) }\n\n return _maybe\n },\n\n map: function map (propertyType, propertyKeyType) {\n propertyType = compile(propertyType)\n if (propertyKeyType) propertyKeyType = compile(propertyKeyType)\n\n function _map (value, strict) {\n if (!NATIVE.Object(value)) return false\n if (NATIVE.Nil(value)) return false\n\n for (var propertyName in value) {\n try {\n if (propertyKeyType) {\n typeforce(propertyKeyType, propertyName, strict)\n }\n } catch (e) {\n throw tfSubError(e, propertyName, 'key')\n }\n\n try {\n var propertyValue = value[propertyName]\n typeforce(propertyType, propertyValue, strict)\n } catch (e) {\n throw tfSubError(e, propertyName)\n }\n }\n\n return true\n }\n\n if (propertyKeyType) {\n _map.toJSON = function () {\n return '{' + tfJSON(propertyKeyType) + ': ' + tfJSON(propertyType) + '}'\n }\n } else {\n _map.toJSON = function () { return '{' + tfJSON(propertyType) + '}' }\n }\n\n return _map\n },\n\n object: function object (uncompiled) {\n var type = {}\n\n for (var typePropertyName in uncompiled) {\n type[typePropertyName] = compile(uncompiled[typePropertyName])\n }\n\n function _object (value, strict) {\n if (!NATIVE.Object(value)) return false\n if (NATIVE.Nil(value)) return false\n\n var propertyName\n\n try {\n for (propertyName in type) {\n var propertyType = type[propertyName]\n var propertyValue = value[propertyName]\n\n typeforce(propertyType, propertyValue, strict)\n }\n } catch (e) {\n throw tfSubError(e, propertyName)\n }\n\n if (strict) {\n for (propertyName in value) {\n if (type[propertyName]) continue\n\n throw new TfPropertyTypeError(undefined, propertyName)\n }\n }\n\n return true\n }\n _object.toJSON = function () { return tfJSON(type) }\n\n return _object\n },\n\n anyOf: function anyOf () {\n var types = [].slice.call(arguments).map(compile)\n\n function _anyOf (value, strict) {\n return types.some(function (type) {\n try {\n return typeforce(type, value, strict)\n } catch (e) {\n return false\n }\n })\n }\n _anyOf.toJSON = function () { return types.map(tfJSON).join('|') }\n\n return _anyOf\n },\n\n allOf: function allOf () {\n var types = [].slice.call(arguments).map(compile)\n\n function _allOf (value, strict) {\n return types.every(function (type) {\n try {\n return typeforce(type, value, strict)\n } catch (e) {\n return false\n }\n })\n }\n _allOf.toJSON = function () { return types.map(tfJSON).join(' & ') }\n\n return _allOf\n },\n\n quacksLike: function quacksLike (type) {\n function _quacksLike (value) {\n return type === getValueTypeName(value)\n }\n _quacksLike.toJSON = function () { return type }\n\n return _quacksLike\n },\n\n tuple: function tuple () {\n var types = [].slice.call(arguments).map(compile)\n\n function _tuple (values, strict) {\n if (NATIVE.Nil(values)) return false\n if (NATIVE.Nil(values.length)) return false\n if (strict && (values.length !== types.length)) return false\n\n return types.every(function (type, i) {\n try {\n return typeforce(type, values[i], strict)\n } catch (e) {\n throw tfSubError(e, i)\n }\n })\n }\n _tuple.toJSON = function () { return '(' + types.map(tfJSON).join(', ') + ')' }\n\n return _tuple\n },\n\n value: function value (expected) {\n function _value (actual) {\n return actual === expected\n }\n _value.toJSON = function () { return expected }\n\n return _value\n }\n}\n\n// TODO: deprecate\nTYPES.oneOf = TYPES.anyOf\n\nfunction compile (type) {\n if (NATIVE.String(type)) {\n if (type[0] === '?') return TYPES.maybe(type.slice(1))\n\n return NATIVE[type] || TYPES.quacksLike(type)\n } else if (type && NATIVE.Object(type)) {\n if (NATIVE.Array(type)) {\n if (type.length !== 1) throw new TypeError('Expected compile() parameter of type Array of length 1')\n return TYPES.arrayOf(type[0])\n }\n\n return TYPES.object(type)\n } else if (NATIVE.Function(type)) {\n return type\n }\n\n return TYPES.value(type)\n}\n\nfunction typeforce (type, value, strict, surrogate) {\n if (NATIVE.Function(type)) {\n if (type(value, strict)) return true\n\n throw new TfTypeError(surrogate || type, value)\n }\n\n // JIT\n return typeforce(compile(type), value, strict)\n}\n\n// assign types to typeforce function\nfor (var typeName in NATIVE) {\n typeforce[typeName] = NATIVE[typeName]\n}\n\nfor (typeName in TYPES) {\n typeforce[typeName] = TYPES[typeName]\n}\n\nvar EXTRA = require('./extra')\nfor (typeName in EXTRA) {\n typeforce[typeName] = EXTRA[typeName]\n}\n\ntypeforce.compile = compile\ntypeforce.TfTypeError = TfTypeError\ntypeforce.TfPropertyTypeError = TfPropertyTypeError\n\nmodule.exports = typeforce\n","var NATIVE = require('./native')\nvar ERRORS = require('./errors')\n\nfunction _Buffer (value) {\n return Buffer.isBuffer(value)\n}\n\nfunction Hex (value) {\n return typeof value === 'string' && /^([0-9a-f]{2})+$/i.test(value)\n}\n\nfunction _LengthN (type, length) {\n var name = type.toJSON()\n\n function Length (value) {\n if (!type(value)) return false\n if (value.length === length) return true\n\n throw ERRORS.tfCustomError(name + '(Length: ' + length + ')', name + '(Length: ' + value.length + ')')\n }\n Length.toJSON = function () { return name }\n\n return Length\n}\n\nvar _ArrayN = _LengthN.bind(null, NATIVE.Array)\nvar _BufferN = _LengthN.bind(null, _Buffer)\nvar _HexN = _LengthN.bind(null, Hex)\nvar _StringN = _LengthN.bind(null, NATIVE.String)\n\nfunction Range (a, b, f) {\n f = f || NATIVE.Number\n function _range (value, strict) {\n return f(value, strict) && (value > a) && (value < b)\n }\n _range.toJSON = function () {\n return `${f.toJSON()} between [${a}, ${b}]`\n }\n return _range\n}\n\nvar INT53_MAX = Math.pow(2, 53) - 1\n\nfunction Finite (value) {\n return typeof value === 'number' && isFinite(value)\n}\nfunction Int8 (value) { return ((value << 24) >> 24) === value }\nfunction Int16 (value) { return ((value << 16) >> 16) === value }\nfunction Int32 (value) { return (value | 0) === value }\nfunction Int53 (value) {\n return typeof value === 'number' &&\n value >= -INT53_MAX &&\n value <= INT53_MAX &&\n Math.floor(value) === value\n}\nfunction UInt8 (value) { return (value & 0xff) === value }\nfunction UInt16 (value) { return (value & 0xffff) === value }\nfunction UInt32 (value) { return (value >>> 0) === value }\nfunction UInt53 (value) {\n return typeof value === 'number' &&\n value >= 0 &&\n value <= INT53_MAX &&\n Math.floor(value) === value\n}\n\nvar types = {\n ArrayN: _ArrayN,\n Buffer: _Buffer,\n BufferN: _BufferN,\n Finite: Finite,\n Hex: Hex,\n HexN: _HexN,\n Int8: Int8,\n Int16: Int16,\n Int32: Int32,\n Int53: Int53,\n Range: Range,\n StringN: _StringN,\n UInt8: UInt8,\n UInt16: UInt16,\n UInt32: UInt32,\n UInt53: UInt53\n}\n\nfor (var typeName in types) {\n types[typeName].toJSON = function (t) {\n return t\n }.bind(null, typeName)\n}\n\nmodule.exports = types\n","var bs58check = require('bs58check')\n\nfunction decodeRaw (buffer, version) {\n // check version only if defined\n if (version !== undefined && buffer[0] !== version) throw new Error('Invalid network version')\n\n // uncompressed\n if (buffer.length === 33) {\n return {\n version: buffer[0],\n privateKey: buffer.slice(1, 33),\n compressed: false\n }\n }\n\n // invalid length\n if (buffer.length !== 34) throw new Error('Invalid WIF length')\n\n // invalid compression flag\n if (buffer[33] !== 0x01) throw new Error('Invalid compression flag')\n\n return {\n version: buffer[0],\n privateKey: buffer.slice(1, 33),\n compressed: true\n }\n}\n\nfunction encodeRaw (version, privateKey, compressed) {\n var result = new Buffer(compressed ? 34 : 33)\n\n result.writeUInt8(version, 0)\n privateKey.copy(result, 1)\n\n if (compressed) {\n result[33] = 0x01\n }\n\n return result\n}\n\nfunction decode (string, version) {\n return decodeRaw(bs58check.decode(string), version)\n}\n\nfunction encode (version, privateKey, compressed) {\n if (typeof version === 'number') return bs58check.encode(encodeRaw(version, privateKey, compressed))\n\n return bs58check.encode(\n encodeRaw(\n version.version,\n version.privateKey,\n version.compressed\n )\n )\n}\n\nmodule.exports = {\n decode: decode,\n decodeRaw: decodeRaw,\n encode: encode,\n encodeRaw: encodeRaw\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst createHash = require(\"create-hash\");\nconst pbkdf2_1 = require(\"pbkdf2\");\nconst randomBytes = require(\"randombytes\");\nconst _wordlists_1 = require(\"./_wordlists\");\nlet DEFAULT_WORDLIST = _wordlists_1._default;\nconst INVALID_MNEMONIC = 'Invalid mnemonic';\nconst INVALID_ENTROPY = 'Invalid entropy';\nconst INVALID_CHECKSUM = 'Invalid mnemonic checksum';\nconst WORDLIST_REQUIRED = 'A wordlist is required but a default could not be found.\\n' +\n 'Please explicitly pass a 2048 word array explicitly.';\nfunction lpad(str, padString, length) {\n while (str.length < length)\n str = padString + str;\n return str;\n}\nfunction binaryToByte(bin) {\n return parseInt(bin, 2);\n}\nfunction bytesToBinary(bytes) {\n return bytes.map(x => lpad(x.toString(2), '0', 8)).join('');\n}\nfunction deriveChecksumBits(entropyBuffer) {\n const ENT = entropyBuffer.length * 8;\n const CS = ENT / 32;\n const hash = createHash('sha256')\n .update(entropyBuffer)\n .digest();\n return bytesToBinary([...hash]).slice(0, CS);\n}\nfunction salt(password) {\n return 'mnemonic' + (password || '');\n}\nfunction mnemonicToSeedSync(mnemonic, password) {\n const mnemonicBuffer = Buffer.from((mnemonic || '').normalize('NFKD'), 'utf8');\n const saltBuffer = Buffer.from(salt((password || '').normalize('NFKD')), 'utf8');\n return pbkdf2_1.pbkdf2Sync(mnemonicBuffer, saltBuffer, 2048, 64, 'sha512');\n}\nexports.mnemonicToSeedSync = mnemonicToSeedSync;\nfunction mnemonicToSeed(mnemonic, password) {\n return new Promise((resolve, reject) => {\n try {\n const mnemonicBuffer = Buffer.from((mnemonic || '').normalize('NFKD'), 'utf8');\n const saltBuffer = Buffer.from(salt((password || '').normalize('NFKD')), 'utf8');\n pbkdf2_1.pbkdf2(mnemonicBuffer, saltBuffer, 2048, 64, 'sha512', (err, data) => {\n if (err)\n return reject(err);\n else\n return resolve(data);\n });\n }\n catch (error) {\n return reject(error);\n }\n });\n}\nexports.mnemonicToSeed = mnemonicToSeed;\nfunction mnemonicToEntropy(mnemonic, wordlist) {\n wordlist = wordlist || DEFAULT_WORDLIST;\n if (!wordlist) {\n throw new Error(WORDLIST_REQUIRED);\n }\n const words = (mnemonic || '').normalize('NFKD').split(' ');\n if (words.length % 3 !== 0)\n throw new Error(INVALID_MNEMONIC);\n // convert word indices to 11 bit binary strings\n const bits = words\n .map(word => {\n const index = wordlist.indexOf(word);\n if (index === -1)\n throw new Error(INVALID_MNEMONIC);\n return lpad(index.toString(2), '0', 11);\n })\n .join('');\n // split the binary string into ENT/CS\n const dividerIndex = Math.floor(bits.length / 33) * 32;\n const entropyBits = bits.slice(0, dividerIndex);\n const checksumBits = bits.slice(dividerIndex);\n // calculate the checksum and compare\n const entropyBytes = entropyBits.match(/(.{1,8})/g).map(binaryToByte);\n if (entropyBytes.length < 16)\n throw new Error(INVALID_ENTROPY);\n if (entropyBytes.length > 32)\n throw new Error(INVALID_ENTROPY);\n if (entropyBytes.length % 4 !== 0)\n throw new Error(INVALID_ENTROPY);\n const entropy = Buffer.from(entropyBytes);\n const newChecksum = deriveChecksumBits(entropy);\n if (newChecksum !== checksumBits)\n throw new Error(INVALID_CHECKSUM);\n return entropy.toString('hex');\n}\nexports.mnemonicToEntropy = mnemonicToEntropy;\nfunction entropyToMnemonic(entropy, wordlist) {\n if (!Buffer.isBuffer(entropy))\n entropy = Buffer.from(entropy, 'hex');\n wordlist = wordlist || DEFAULT_WORDLIST;\n if (!wordlist) {\n throw new Error(WORDLIST_REQUIRED);\n }\n // 128 <= ENT <= 256\n if (entropy.length < 16)\n throw new TypeError(INVALID_ENTROPY);\n if (entropy.length > 32)\n throw new TypeError(INVALID_ENTROPY);\n if (entropy.length % 4 !== 0)\n throw new TypeError(INVALID_ENTROPY);\n const entropyBits = bytesToBinary([...entropy]);\n const checksumBits = deriveChecksumBits(entropy);\n const bits = entropyBits + checksumBits;\n const chunks = bits.match(/(.{1,11})/g);\n const words = chunks.map(binary => {\n const index = binaryToByte(binary);\n return wordlist[index];\n });\n return wordlist[0] === '\\u3042\\u3044\\u3053\\u304f\\u3057\\u3093' // Japanese wordlist\n ? words.join('\\u3000')\n : words.join(' ');\n}\nexports.entropyToMnemonic = entropyToMnemonic;\nfunction generateMnemonic(strength, rng, wordlist) {\n strength = strength || 128;\n if (strength % 32 !== 0)\n throw new TypeError(INVALID_ENTROPY);\n rng = rng || randomBytes;\n return entropyToMnemonic(rng(strength / 8), wordlist);\n}\nexports.generateMnemonic = generateMnemonic;\nfunction validateMnemonic(mnemonic, wordlist) {\n try {\n mnemonicToEntropy(mnemonic, wordlist);\n }\n catch (e) {\n return false;\n }\n return true;\n}\nexports.validateMnemonic = validateMnemonic;\nfunction setDefaultWordlist(language) {\n const result = _wordlists_1.wordlists[language];\n if (result)\n DEFAULT_WORDLIST = result;\n else\n throw new Error('Could not find wordlist for language \"' + language + '\"');\n}\nexports.setDefaultWordlist = setDefaultWordlist;\nfunction getDefaultWordlist() {\n if (!DEFAULT_WORDLIST)\n throw new Error('No Default Wordlist set');\n return Object.keys(_wordlists_1.wordlists).filter(lang => {\n if (lang === 'JA' || lang === 'EN')\n return false;\n return _wordlists_1.wordlists[lang].every((word, index) => word === DEFAULT_WORDLIST[index]);\n })[0];\n}\nexports.getDefaultWordlist = getDefaultWordlist;\nvar _wordlists_2 = require(\"./_wordlists\");\nexports.wordlists = _wordlists_2.wordlists;\n","var native = require('crypto')\n\nvar checkParameters = require('./lib/precondition')\nvar defaultEncoding = require('./lib/default-encoding')\nvar toBuffer = require('./lib/to-buffer')\n\nfunction nativePBKDF2 (password, salt, iterations, keylen, digest, callback) {\n checkParameters(iterations, keylen)\n password = toBuffer(password, defaultEncoding, 'Password')\n salt = toBuffer(salt, defaultEncoding, 'Salt')\n\n if (typeof digest === 'function') {\n callback = digest\n digest = 'sha1'\n }\n if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2')\n\n return native.pbkdf2(password, salt, iterations, keylen, digest, callback)\n}\n\nfunction nativePBKDF2Sync (password, salt, iterations, keylen, digest) {\n checkParameters(iterations, keylen)\n password = toBuffer(password, defaultEncoding, 'Password')\n salt = toBuffer(salt, defaultEncoding, 'Salt')\n digest = digest || 'sha1'\n return native.pbkdf2Sync(password, salt, iterations, keylen, digest)\n}\n\n/* istanbul ignore next */\nif (!native.pbkdf2Sync || native.pbkdf2Sync.toString().indexOf('keylen, digest') === -1) {\n exports.pbkdf2Sync = require('./lib/sync')\n exports.pbkdf2 = require('./lib/async')\n\n// native\n} else {\n exports.pbkdf2Sync = nativePBKDF2Sync\n exports.pbkdf2 = nativePBKDF2\n}\n","var Buffer = require('safe-buffer').Buffer\n\nvar checkParameters = require('./precondition')\nvar defaultEncoding = require('./default-encoding')\nvar sync = require('./sync')\nvar toBuffer = require('./to-buffer')\n\nvar ZERO_BUF\nvar subtle = global.crypto && global.crypto.subtle\nvar toBrowser = {\n sha: 'SHA-1',\n 'sha-1': 'SHA-1',\n sha1: 'SHA-1',\n sha256: 'SHA-256',\n 'sha-256': 'SHA-256',\n sha384: 'SHA-384',\n 'sha-384': 'SHA-384',\n 'sha-512': 'SHA-512',\n sha512: 'SHA-512'\n}\nvar checks = []\nfunction checkNative (algo) {\n if (global.process && !global.process.browser) {\n return Promise.resolve(false)\n }\n if (!subtle || !subtle.importKey || !subtle.deriveBits) {\n return Promise.resolve(false)\n }\n if (checks[algo] !== undefined) {\n return checks[algo]\n }\n ZERO_BUF = ZERO_BUF || Buffer.alloc(8)\n var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo)\n .then(function () {\n return true\n }).catch(function () {\n return false\n })\n checks[algo] = prom\n return prom\n}\n\nfunction browserPbkdf2 (password, salt, iterations, length, algo) {\n return subtle.importKey(\n 'raw', password, { name: 'PBKDF2' }, false, ['deriveBits']\n ).then(function (key) {\n return subtle.deriveBits({\n name: 'PBKDF2',\n salt: salt,\n iterations: iterations,\n hash: {\n name: algo\n }\n }, key, length << 3)\n }).then(function (res) {\n return Buffer.from(res)\n })\n}\n\nfunction resolvePromise (promise, callback) {\n promise.then(function (out) {\n process.nextTick(function () {\n callback(null, out)\n })\n }, function (e) {\n process.nextTick(function () {\n callback(e)\n })\n })\n}\nmodule.exports = function (password, salt, iterations, keylen, digest, callback) {\n if (typeof digest === 'function') {\n callback = digest\n digest = undefined\n }\n\n digest = digest || 'sha1'\n var algo = toBrowser[digest.toLowerCase()]\n\n if (!algo || typeof global.Promise !== 'function') {\n return process.nextTick(function () {\n var out\n try {\n out = sync(password, salt, iterations, keylen, digest)\n } catch (e) {\n return callback(e)\n }\n callback(null, out)\n })\n }\n\n checkParameters(iterations, keylen)\n password = toBuffer(password, defaultEncoding, 'Password')\n salt = toBuffer(salt, defaultEncoding, 'Salt')\n if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2')\n\n resolvePromise(checkNative(algo).then(function (resp) {\n if (resp) return browserPbkdf2(password, salt, iterations, keylen, algo)\n\n return sync(password, salt, iterations, keylen, digest)\n }), callback)\n}\n","module.exports = require('crypto').randomBytes\n","const addon = require('node-gyp-build')(__dirname)\nmodule.exports = require('./lib')(new addon.Secp256k1())\n","var fs = require('fs')\nvar path = require('path')\nvar os = require('os')\n\n// Workaround to fix webpack's build warnings: 'the request of a dependency is an expression'\nvar runtimeRequire = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : require // eslint-disable-line\n\nvar vars = (process.config && process.config.variables) || {}\nvar prebuildsOnly = !!process.env.PREBUILDS_ONLY\nvar abi = process.versions.modules // TODO: support old node where this is undef\nvar runtime = isElectron() ? 'electron' : 'node'\nvar arch = os.arch()\nvar platform = os.platform()\nvar libc = process.env.LIBC || (isAlpine(platform) ? 'musl' : 'glibc')\nvar armv = process.env.ARM_VERSION || (arch === 'arm64' ? '8' : vars.arm_version) || ''\nvar uv = (process.versions.uv || '').split('.')[0]\n\nmodule.exports = load\n\nfunction load (dir) {\n return runtimeRequire(load.path(dir))\n}\n\nload.path = function (dir) {\n dir = path.resolve(dir || '.')\n\n try {\n var name = runtimeRequire(path.join(dir, 'package.json')).name.toUpperCase().replace(/-/g, '_')\n if (process.env[name + '_PREBUILD']) dir = process.env[name + '_PREBUILD']\n } catch (err) {}\n\n if (!prebuildsOnly) {\n var release = getFirst(path.join(dir, 'build/Release'), matchBuild)\n if (release) return release\n\n var debug = getFirst(path.join(dir, 'build/Debug'), matchBuild)\n if (debug) return debug\n }\n\n var prebuild = resolve(dir)\n if (prebuild) return prebuild\n\n var nearby = resolve(path.dirname(process.execPath))\n if (nearby) return nearby\n\n var target = [\n 'platform=' + platform,\n 'arch=' + arch,\n 'runtime=' + runtime,\n 'abi=' + abi,\n 'uv=' + uv,\n armv ? 'armv=' + armv : '',\n 'libc=' + libc,\n 'node=' + process.versions.node,\n (process.versions && process.versions.electron) ? 'electron=' + process.versions.electron : '',\n typeof __webpack_require__ === 'function' ? 'webpack=true' : '' // eslint-disable-line\n ].filter(Boolean).join(' ')\n\n throw new Error('No native build was found for ' + target + '\\n loaded from: ' + dir + '\\n')\n\n function resolve (dir) {\n // Find most specific flavor first\n var prebuilds = path.join(dir, 'prebuilds', platform + '-' + arch)\n var parsed = readdirSync(prebuilds).map(parseTags)\n var candidates = parsed.filter(matchTags(runtime, abi))\n var winner = candidates.sort(compareTags(runtime))[0]\n if (winner) return path.join(prebuilds, winner.file)\n }\n}\n\nfunction readdirSync (dir) {\n try {\n return fs.readdirSync(dir)\n } catch (err) {\n return []\n }\n}\n\nfunction getFirst (dir, filter) {\n var files = readdirSync(dir).filter(filter)\n return files[0] && path.join(dir, files[0])\n}\n\nfunction matchBuild (name) {\n return /\\.node$/.test(name)\n}\n\nfunction parseTags (file) {\n var arr = file.split('.')\n var extension = arr.pop()\n var tags = { file: file, specificity: 0 }\n\n if (extension !== 'node') return\n\n for (var i = 0; i < arr.length; i++) {\n var tag = arr[i]\n\n if (tag === 'node' || tag === 'electron' || tag === 'node-webkit') {\n tags.runtime = tag\n } else if (tag === 'napi') {\n tags.napi = true\n } else if (tag.slice(0, 3) === 'abi') {\n tags.abi = tag.slice(3)\n } else if (tag.slice(0, 2) === 'uv') {\n tags.uv = tag.slice(2)\n } else if (tag.slice(0, 4) === 'armv') {\n tags.armv = tag.slice(4)\n } else if (tag === 'glibc' || tag === 'musl') {\n tags.libc = tag\n } else {\n continue\n }\n\n tags.specificity++\n }\n\n return tags\n}\n\nfunction matchTags (runtime, abi) {\n return function (tags) {\n if (tags == null) return false\n if (tags.runtime !== runtime && !runtimeAgnostic(tags)) return false\n if (tags.abi !== abi && !tags.napi) return false\n if (tags.uv && tags.uv !== uv) return false\n if (tags.armv && tags.armv !== armv) return false\n if (tags.libc && tags.libc !== libc) return false\n\n return true\n }\n}\n\nfunction runtimeAgnostic (tags) {\n return tags.runtime === 'node' && tags.napi\n}\n\nfunction compareTags (runtime) {\n // Precedence: non-agnostic runtime, abi over napi, then by specificity.\n return function (a, b) {\n if (a.runtime !== b.runtime) {\n return a.runtime === runtime ? -1 : 1\n } else if (a.abi !== b.abi) {\n return a.abi ? -1 : 1\n } else if (a.specificity !== b.specificity) {\n return a.specificity > b.specificity ? -1 : 1\n } else {\n return 0\n }\n }\n}\n\nfunction isElectron () {\n if (process.versions && process.versions.electron) return true\n if (process.env.ELECTRON_RUN_AS_NODE) return true\n return typeof window !== 'undefined' && window.process && window.process.type === 'renderer'\n}\n\nfunction isAlpine (platform) {\n return platform === 'linux' && fs.existsSync('/etc/alpine-release')\n}\n\n// Exposed for unit tests\n// TODO: move to lib\nload.parseTags = parseTags\nload.matchTags = matchTags\nload.compareTags = compareTags\n","module.exports = require(\"os\");","module.exports = require('./lib')(require('./lib/elliptic'))\n","const EC = require('elliptic').ec\n\nconst ec = new EC('secp256k1')\nconst ecparams = ec.curve\n\n// Hack, we can not use bn.js@5, while elliptic uses bn.js@4\n// See https://github.com/indutny/elliptic/issues/191#issuecomment-569888758\nconst BN = ecparams.n.constructor\n\nfunction loadCompressedPublicKey (first, xbuf) {\n let x = new BN(xbuf)\n\n // overflow\n if (x.cmp(ecparams.p) >= 0) return null\n x = x.toRed(ecparams.red)\n\n // compute corresponding Y\n let y = x.redSqr().redIMul(x).redIAdd(ecparams.b).redSqrt()\n if ((first === 0x03) !== y.isOdd()) y = y.redNeg()\n\n return ec.keyPair({ pub: { x: x, y: y } })\n}\n\nfunction loadUncompressedPublicKey (first, xbuf, ybuf) {\n let x = new BN(xbuf)\n let y = new BN(ybuf)\n\n // overflow\n if (x.cmp(ecparams.p) >= 0 || y.cmp(ecparams.p) >= 0) return null\n\n x = x.toRed(ecparams.red)\n y = y.toRed(ecparams.red)\n\n // is odd flag\n if ((first === 0x06 || first === 0x07) && y.isOdd() !== (first === 0x07)) return null\n\n // x*x*x + b = y*y\n const x3 = x.redSqr().redIMul(x)\n if (!y.redSqr().redISub(x3.redIAdd(ecparams.b)).isZero()) return null\n\n return ec.keyPair({ pub: { x: x, y: y } })\n}\n\nfunction loadPublicKey (pubkey) {\n // length should be validated in interface\n const first = pubkey[0]\n switch (first) {\n case 0x02:\n case 0x03:\n if (pubkey.length !== 33) return null\n return loadCompressedPublicKey(first, pubkey.subarray(1, 33))\n case 0x04:\n case 0x06:\n case 0x07:\n if (pubkey.length !== 65) return null\n return loadUncompressedPublicKey(first, pubkey.subarray(1, 33), pubkey.subarray(33, 65))\n default:\n return null\n }\n}\n\nfunction savePublicKey (output, point) {\n const pubkey = point.encode(null, output.length === 33)\n // Loop should be faster because we do not need create extra Uint8Array\n // output.set(new Uint8Array(pubkey))\n for (let i = 0; i < output.length; ++i) output[i] = pubkey[i]\n}\n\nmodule.exports = {\n contextRandomize () {\n return 0\n },\n\n privateKeyVerify (seckey) {\n const bn = new BN(seckey)\n return bn.cmp(ecparams.n) < 0 && !bn.isZero() ? 0 : 1\n },\n\n privateKeyNegate (seckey) {\n const bn = new BN(seckey)\n const negate = ecparams.n.sub(bn).umod(ecparams.n).toArrayLike(Uint8Array, 'be', 32)\n seckey.set(negate)\n return 0\n },\n\n privateKeyTweakAdd (seckey, tweak) {\n const bn = new BN(tweak)\n if (bn.cmp(ecparams.n) >= 0) return 1\n\n bn.iadd(new BN(seckey))\n if (bn.cmp(ecparams.n) >= 0) bn.isub(ecparams.n)\n if (bn.isZero()) return 1\n\n const tweaked = bn.toArrayLike(Uint8Array, 'be', 32)\n seckey.set(tweaked)\n\n return 0\n },\n\n privateKeyTweakMul (seckey, tweak) {\n let bn = new BN(tweak)\n if (bn.cmp(ecparams.n) >= 0 || bn.isZero()) return 1\n\n bn.imul(new BN(seckey))\n if (bn.cmp(ecparams.n) >= 0) bn = bn.umod(ecparams.n)\n\n const tweaked = bn.toArrayLike(Uint8Array, 'be', 32)\n seckey.set(tweaked)\n\n return 0\n },\n\n publicKeyVerify (pubkey) {\n const pair = loadPublicKey(pubkey)\n return pair === null ? 1 : 0\n },\n\n publicKeyCreate (output, seckey) {\n const bn = new BN(seckey)\n if (bn.cmp(ecparams.n) >= 0 || bn.isZero()) return 1\n\n const point = ec.keyFromPrivate(seckey).getPublic()\n savePublicKey(output, point)\n\n return 0\n },\n\n publicKeyConvert (output, pubkey) {\n const pair = loadPublicKey(pubkey)\n if (pair === null) return 1\n\n const point = pair.getPublic()\n savePublicKey(output, point)\n\n return 0\n },\n\n publicKeyNegate (output, pubkey) {\n const pair = loadPublicKey(pubkey)\n if (pair === null) return 1\n\n const point = pair.getPublic()\n point.y = point.y.redNeg()\n savePublicKey(output, point)\n\n return 0\n },\n\n publicKeyCombine (output, pubkeys) {\n const pairs = new Array(pubkeys.length)\n for (let i = 0; i < pubkeys.length; ++i) {\n pairs[i] = loadPublicKey(pubkeys[i])\n if (pairs[i] === null) return 1\n }\n\n let point = pairs[0].getPublic()\n for (let i = 1; i < pairs.length; ++i) point = point.add(pairs[i].pub)\n if (point.isInfinity()) return 2\n\n savePublicKey(output, point)\n\n return 0\n },\n\n publicKeyTweakAdd (output, pubkey, tweak) {\n const pair = loadPublicKey(pubkey)\n if (pair === null) return 1\n\n tweak = new BN(tweak)\n if (tweak.cmp(ecparams.n) >= 0) return 2\n\n const point = pair.getPublic().add(ecparams.g.mul(tweak))\n if (point.isInfinity()) return 2\n\n savePublicKey(output, point)\n\n return 0\n },\n\n publicKeyTweakMul (output, pubkey, tweak) {\n const pair = loadPublicKey(pubkey)\n if (pair === null) return 1\n\n tweak = new BN(tweak)\n if (tweak.cmp(ecparams.n) >= 0 || tweak.isZero()) return 2\n\n const point = pair.getPublic().mul(tweak)\n savePublicKey(output, point)\n\n return 0\n },\n\n signatureNormalize (sig) {\n const r = new BN(sig.subarray(0, 32))\n const s = new BN(sig.subarray(32, 64))\n if (r.cmp(ecparams.n) >= 0 || s.cmp(ecparams.n) >= 0) return 1\n\n if (s.cmp(ec.nh) === 1) {\n sig.set(ecparams.n.sub(s).toArrayLike(Uint8Array, 'be', 32), 32)\n }\n\n return 0\n },\n\n // Copied 1-to-1 from https://github.com/bitcoinjs/bip66/blob/master/index.js\n // Adapted for Uint8Array instead Buffer\n signatureExport (obj, sig) {\n const sigR = sig.subarray(0, 32)\n const sigS = sig.subarray(32, 64)\n if (new BN(sigR).cmp(ecparams.n) >= 0) return 1\n if (new BN(sigS).cmp(ecparams.n) >= 0) return 1\n\n const { output } = obj\n\n // Prepare R\n let r = output.subarray(4, 4 + 33)\n r[0] = 0x00\n r.set(sigR, 1)\n\n let lenR = 33\n let posR = 0\n for (; lenR > 1 && r[posR] === 0x00 && !(r[posR + 1] & 0x80); --lenR, ++posR);\n\n r = r.subarray(posR)\n if (r[0] & 0x80) return 1\n if (lenR > 1 && (r[0] === 0x00) && !(r[1] & 0x80)) return 1\n\n // Prepare S\n let s = output.subarray(6 + 33, 6 + 33 + 33)\n s[0] = 0x00\n s.set(sigS, 1)\n\n let lenS = 33\n let posS = 0\n for (; lenS > 1 && s[posS] === 0x00 && !(s[posS + 1] & 0x80); --lenS, ++posS);\n\n s = s.subarray(posS)\n if (s[0] & 0x80) return 1\n if (lenS > 1 && (s[0] === 0x00) && !(s[1] & 0x80)) return 1\n\n // Set output length for return\n obj.outputlen = 6 + lenR + lenS\n\n // Output in specified format\n // 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]\n output[0] = 0x30\n output[1] = obj.outputlen - 2\n output[2] = 0x02\n output[3] = r.length\n output.set(r, 4)\n output[4 + lenR] = 0x02\n output[5 + lenR] = s.length\n output.set(s, 6 + lenR)\n\n return 0\n },\n\n // Copied 1-to-1 from https://github.com/bitcoinjs/bip66/blob/master/index.js\n // Adapted for Uint8Array instead Buffer\n signatureImport (output, sig) {\n if (sig.length < 8) return 1\n if (sig.length > 72) return 1\n if (sig[0] !== 0x30) return 1\n if (sig[1] !== sig.length - 2) return 1\n if (sig[2] !== 0x02) return 1\n\n const lenR = sig[3]\n if (lenR === 0) return 1\n if (5 + lenR >= sig.length) return 1\n if (sig[4 + lenR] !== 0x02) return 1\n\n const lenS = sig[5 + lenR]\n if (lenS === 0) return 1\n if ((6 + lenR + lenS) !== sig.length) return 1\n\n if (sig[4] & 0x80) return 1\n if (lenR > 1 && (sig[4] === 0x00) && !(sig[5] & 0x80)) return 1\n\n if (sig[lenR + 6] & 0x80) return 1\n if (lenS > 1 && (sig[lenR + 6] === 0x00) && !(sig[lenR + 7] & 0x80)) return 1\n\n let sigR = sig.subarray(4, 4 + lenR)\n if (sigR.length === 33 && sigR[0] === 0x00) sigR = sigR.subarray(1)\n if (sigR.length > 32) return 1\n\n let sigS = sig.subarray(6 + lenR)\n if (sigS.length === 33 && sigS[0] === 0x00) sigS = sigS.slice(1)\n if (sigS.length > 32) throw new Error('S length is too long')\n\n let r = new BN(sigR)\n if (r.cmp(ecparams.n) >= 0) r = new BN(0)\n\n let s = new BN(sig.subarray(6 + lenR))\n if (s.cmp(ecparams.n) >= 0) s = new BN(0)\n\n output.set(r.toArrayLike(Uint8Array, 'be', 32), 0)\n output.set(s.toArrayLike(Uint8Array, 'be', 32), 32)\n\n return 0\n },\n\n ecdsaSign (obj, message, seckey, data, noncefn) {\n if (noncefn) {\n const _noncefn = noncefn\n noncefn = (counter) => {\n const nonce = _noncefn(message, seckey, null, data, counter)\n\n const isValid = nonce instanceof Uint8Array && nonce.length === 32\n if (!isValid) throw new Error('This is the way')\n\n return new BN(nonce)\n }\n }\n\n const d = new BN(seckey)\n if (d.cmp(ecparams.n) >= 0 || d.isZero()) return 1\n\n let sig\n try {\n sig = ec.sign(message, seckey, { canonical: true, k: noncefn, pers: data })\n } catch (err) {\n return 1\n }\n\n obj.signature.set(sig.r.toArrayLike(Uint8Array, 'be', 32), 0)\n obj.signature.set(sig.s.toArrayLike(Uint8Array, 'be', 32), 32)\n obj.recid = sig.recoveryParam\n\n return 0\n },\n\n ecdsaVerify (sig, msg32, pubkey) {\n const sigObj = { r: sig.subarray(0, 32), s: sig.subarray(32, 64) }\n\n const sigr = new BN(sigObj.r)\n const sigs = new BN(sigObj.s)\n if (sigr.cmp(ecparams.n) >= 0 || sigs.cmp(ecparams.n) >= 0) return 1\n if (sigs.cmp(ec.nh) === 1 || sigr.isZero() || sigs.isZero()) return 3\n\n const pair = loadPublicKey(pubkey)\n if (pair === null) return 2\n\n const point = pair.getPublic()\n const isValid = ec.verify(msg32, sigObj, point)\n return isValid ? 0 : 3\n },\n\n ecdsaRecover (output, sig, recid, msg32) {\n const sigObj = { r: sig.slice(0, 32), s: sig.slice(32, 64) }\n\n const sigr = new BN(sigObj.r)\n const sigs = new BN(sigObj.s)\n if (sigr.cmp(ecparams.n) >= 0 || sigs.cmp(ecparams.n) >= 0) return 1\n\n if (sigr.isZero() || sigs.isZero()) return 2\n\n // Can throw `throw new Error('Unable to find sencond key candinate');`\n let point\n try {\n point = ec.recoverPubKey(msg32, sigObj, recid)\n } catch (err) {\n return 2\n }\n\n savePublicKey(output, point)\n\n return 0\n },\n\n ecdh (output, pubkey, seckey, data, hashfn, xbuf, ybuf) {\n const pair = loadPublicKey(pubkey)\n if (pair === null) return 1\n\n const scalar = new BN(seckey)\n if (scalar.cmp(ecparams.n) >= 0 || scalar.isZero()) return 2\n\n const point = pair.getPublic().mul(scalar)\n\n if (hashfn === undefined) {\n const data = point.encode(null, true)\n const sha256 = ec.hash().update(data).digest()\n for (let i = 0; i < 32; ++i) output[i] = sha256[i]\n } else {\n if (!xbuf) xbuf = new Uint8Array(32)\n const x = point.getX().toArray('be', 32)\n for (let i = 0; i < 32; ++i) xbuf[i] = x[i]\n\n if (!ybuf) ybuf = new Uint8Array(32)\n const y = point.getY().toArray('be', 32)\n for (let i = 0; i < 32; ++i) ybuf[i] = y[i]\n\n const hash = hashfn(xbuf, ybuf, data)\n\n const isValid = hash instanceof Uint8Array && hash.length === output.length\n if (!isValid) return 2\n\n output.set(hash)\n }\n\n return 0\n }\n}\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RawKey = void 0;\nvar sha256_1 = __importDefault(require(\"crypto-js/sha256\"));\nvar secp256k1 = __importStar(require(\"secp256k1\"));\nvar Key_1 = require(\"./Key\");\n/**\n * An implementation of the Key interfaces that uses a raw private key.\n */\nvar RawKey = /** @class */ (function (_super) {\n __extends(RawKey, _super);\n function RawKey(privateKey) {\n var _this = this;\n var publicKey = secp256k1.publicKeyCreate(new Uint8Array(privateKey), true);\n _this = _super.call(this, Buffer.from(publicKey)) || this;\n _this.privateKey = privateKey;\n return _this;\n }\n RawKey.prototype.ecdsaSign = function (payload) {\n var hash = Buffer.from(sha256_1.default(payload.toString()).toString(), 'hex');\n return secp256k1.ecdsaSign(Uint8Array.from(hash), Uint8Array.from(this.privateKey));\n };\n RawKey.prototype.sign = function (payload) {\n return __awaiter(this, void 0, void 0, function () {\n var signature;\n return __generator(this, function (_a) {\n signature = this.ecdsaSign(payload).signature;\n return [2 /*return*/, Buffer.from(signature)];\n });\n });\n };\n return RawKey;\n}(Key_1.Key));\nexports.RawKey = RawKey;\n//# sourceMappingURL=RawKey.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./lcd/LCDClient\"), exports);\n__exportStar(require(\"./lcd/Wallet\"), exports);\n__exportStar(require(\"./lcd/api\"), exports);\n__exportStar(require(\"./LocalTerra\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.APIRequester = void 0;\nvar axios_1 = __importDefault(require(\"axios\"));\nvar APIRequester = /** @class */ (function () {\n function APIRequester(baseURL) {\n this.axios = axios_1.default.create({\n baseURL: baseURL,\n headers: {\n Accept: 'application/json',\n },\n });\n }\n APIRequester.prototype.getRaw = function (endpoint, params) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.axios.get(endpoint, { params: params }).then(function (d) { return d.data; })];\n });\n });\n };\n APIRequester.prototype.get = function (endpoint, params) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.axios.get(endpoint, { params: params }).then(function (d) { return d.data; })];\n });\n });\n };\n APIRequester.prototype.postRaw = function (endpoint, data) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.axios.post(endpoint, data).then(function (d) { return d.data; })];\n });\n });\n };\n APIRequester.prototype.post = function (endpoint, data) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.axios.post(endpoint, data).then(function (d) { return d.data; })];\n });\n });\n };\n return APIRequester;\n}());\nexports.APIRequester = APIRequester;\n//# sourceMappingURL=APIRequester.js.map","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n if (\n (utils.isBlob(requestData) || utils.isFile(requestData)) &&\n requestData.type\n ) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = unescape(encodeURIComponent(config.auth.password)) || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildFullPath = require('../core/buildFullPath');\nvar buildURL = require('./../helpers/buildURL');\nvar http = require('http');\nvar https = require('https');\nvar httpFollow = require('follow-redirects').http;\nvar httpsFollow = require('follow-redirects').https;\nvar url = require('url');\nvar zlib = require('zlib');\nvar pkg = require('./../../package.json');\nvar createError = require('../core/createError');\nvar enhanceError = require('../core/enhanceError');\n\nvar isHttps = /https:?/;\n\n/*eslint consistent-return:0*/\nmodule.exports = function httpAdapter(config) {\n return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {\n var resolve = function resolve(value) {\n resolvePromise(value);\n };\n var reject = function reject(value) {\n rejectPromise(value);\n };\n var data = config.data;\n var headers = config.headers;\n\n // Set User-Agent (required by some servers)\n // Only set header if it hasn't been set in config\n // See https://github.com/axios/axios/issues/69\n if (!headers['User-Agent'] && !headers['user-agent']) {\n headers['User-Agent'] = 'axios/' + pkg.version;\n }\n\n if (data && !utils.isStream(data)) {\n if (Buffer.isBuffer(data)) {\n // Nothing to do...\n } else if (utils.isArrayBuffer(data)) {\n data = Buffer.from(new Uint8Array(data));\n } else if (utils.isString(data)) {\n data = Buffer.from(data, 'utf-8');\n } else {\n return reject(createError(\n 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',\n config\n ));\n }\n\n // Add Content-Length header if data exists\n headers['Content-Length'] = data.length;\n }\n\n // HTTP basic authentication\n var auth = undefined;\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n auth = username + ':' + password;\n }\n\n // Parse url\n var fullPath = buildFullPath(config.baseURL, config.url);\n var parsed = url.parse(fullPath);\n var protocol = parsed.protocol || 'http:';\n\n if (!auth && parsed.auth) {\n var urlAuth = parsed.auth.split(':');\n var urlUsername = urlAuth[0] || '';\n var urlPassword = urlAuth[1] || '';\n auth = urlUsername + ':' + urlPassword;\n }\n\n if (auth) {\n delete headers.Authorization;\n }\n\n var isHttpsRequest = isHttps.test(protocol);\n var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;\n\n var options = {\n path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\\?/, ''),\n method: config.method.toUpperCase(),\n headers: headers,\n agent: agent,\n agents: { http: config.httpAgent, https: config.httpsAgent },\n auth: auth\n };\n\n if (config.socketPath) {\n options.socketPath = config.socketPath;\n } else {\n options.hostname = parsed.hostname;\n options.port = parsed.port;\n }\n\n var proxy = config.proxy;\n if (!proxy && proxy !== false) {\n var proxyEnv = protocol.slice(0, -1) + '_proxy';\n var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()];\n if (proxyUrl) {\n var parsedProxyUrl = url.parse(proxyUrl);\n var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY;\n var shouldProxy = true;\n\n if (noProxyEnv) {\n var noProxy = noProxyEnv.split(',').map(function trim(s) {\n return s.trim();\n });\n\n shouldProxy = !noProxy.some(function proxyMatch(proxyElement) {\n if (!proxyElement) {\n return false;\n }\n if (proxyElement === '*') {\n return true;\n }\n if (proxyElement[0] === '.' &&\n parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) {\n return true;\n }\n\n return parsed.hostname === proxyElement;\n });\n }\n\n\n if (shouldProxy) {\n proxy = {\n host: parsedProxyUrl.hostname,\n port: parsedProxyUrl.port\n };\n\n if (parsedProxyUrl.auth) {\n var proxyUrlAuth = parsedProxyUrl.auth.split(':');\n proxy.auth = {\n username: proxyUrlAuth[0],\n password: proxyUrlAuth[1]\n };\n }\n }\n }\n }\n\n if (proxy) {\n options.hostname = proxy.host;\n options.host = proxy.host;\n options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : '');\n options.port = proxy.port;\n options.path = protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path;\n\n // Basic proxy authorization\n if (proxy.auth) {\n var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64');\n options.headers['Proxy-Authorization'] = 'Basic ' + base64;\n }\n }\n\n var transport;\n var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true);\n if (config.transport) {\n transport = config.transport;\n } else if (config.maxRedirects === 0) {\n transport = isHttpsProxy ? https : http;\n } else {\n if (config.maxRedirects) {\n options.maxRedirects = config.maxRedirects;\n }\n transport = isHttpsProxy ? httpsFollow : httpFollow;\n }\n\n if (config.maxBodyLength > -1) {\n options.maxBodyLength = config.maxBodyLength;\n }\n\n // Create the request\n var req = transport.request(options, function handleResponse(res) {\n if (req.aborted) return;\n\n // uncompress the response body transparently if required\n var stream = res;\n\n // return the last request in case of redirects\n var lastRequest = res.req || req;\n\n\n // if no content, is HEAD request or decompress disabled we should not decompress\n if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) {\n switch (res.headers['content-encoding']) {\n /*eslint default-case:0*/\n case 'gzip':\n case 'compress':\n case 'deflate':\n // add the unzipper to the body stream processing pipeline\n stream = stream.pipe(zlib.createUnzip());\n\n // remove the content-encoding in order to not confuse downstream operations\n delete res.headers['content-encoding'];\n break;\n }\n }\n\n var response = {\n status: res.statusCode,\n statusText: res.statusMessage,\n headers: res.headers,\n config: config,\n request: lastRequest\n };\n\n if (config.responseType === 'stream') {\n response.data = stream;\n settle(resolve, reject, response);\n } else {\n var responseBuffer = [];\n stream.on('data', function handleStreamData(chunk) {\n responseBuffer.push(chunk);\n\n // make sure the content length is not over the maxContentLength if specified\n if (config.maxContentLength > -1 && Buffer.concat(responseBuffer).length > config.maxContentLength) {\n stream.destroy();\n reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded',\n config, null, lastRequest));\n }\n });\n\n stream.on('error', function handleStreamError(err) {\n if (req.aborted) return;\n reject(enhanceError(err, config, null, lastRequest));\n });\n\n stream.on('end', function handleStreamEnd() {\n var responseData = Buffer.concat(responseBuffer);\n if (config.responseType !== 'arraybuffer') {\n responseData = responseData.toString(config.responseEncoding);\n if (!config.responseEncoding || config.responseEncoding === 'utf8') {\n responseData = utils.stripBOM(responseData);\n }\n }\n\n response.data = responseData;\n settle(resolve, reject, response);\n });\n }\n });\n\n // Handle errors\n req.on('error', function handleRequestError(err) {\n if (req.aborted && err.code !== 'ERR_FR_TOO_MANY_REDIRECTS') return;\n reject(enhanceError(err, config, null, req));\n });\n\n // Handle request timeout\n if (config.timeout) {\n // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.\n // And timer callback will be fired, and abort() will be invoked before connection, then get \"socket hang up\" and code ECONNRESET.\n // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.\n // And then these socket which be hang up will devoring CPU little by little.\n // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.\n req.setTimeout(config.timeout, function handleRequestTimeout() {\n req.abort();\n reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', req));\n });\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (req.aborted) return;\n\n req.abort();\n reject(cancel);\n });\n }\n\n // Send the request\n if (utils.isStream(data)) {\n data.on('error', function handleStreamError(err) {\n reject(enhanceError(err, config, null, req));\n }).pipe(req);\n } else {\n req.end(data);\n }\n });\n};\n","module.exports = require(\"assert\");","var debug;\ntry {\n /* eslint global-require: off */\n debug = require(\"debug\")(\"follow-redirects\");\n}\ncatch (error) {\n debug = function () { /* */ };\n}\nmodule.exports = debug;\n","/**\n * Detect Electron renderer process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process !== 'undefined' && process.type === 'renderer') {\n module.exports = require('./browser.js');\n} else {\n module.exports = require('./node.js');\n}\n","/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n","/**\n * Module dependencies.\n */\n\nvar tty = require('tty');\nvar util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(function (key) {\n return /^debug_/i.test(key);\n}).reduce(function (obj, key) {\n // camel-case\n var prop = key\n .substring(6)\n .toLowerCase()\n .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });\n\n // coerce string value into JS value\n var val = process.env[key];\n if (/^(yes|on|true|enabled)$/i.test(val)) val = true;\n else if (/^(no|off|false|disabled)$/i.test(val)) val = false;\n else if (val === 'null') val = null;\n else val = Number(val);\n\n obj[prop] = val;\n return obj;\n}, {});\n\n/**\n * The file descriptor to write the `debug()` calls to.\n * Set the `DEBUG_FD` env variable to override with another value. i.e.:\n *\n * $ DEBUG_FD=3 node script.js 3>debug.log\n */\n\nvar fd = parseInt(process.env.DEBUG_FD, 10) || 2;\n\nif (1 !== fd && 2 !== fd) {\n util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()\n}\n\nvar stream = 1 === fd ? process.stdout :\n 2 === fd ? process.stderr :\n createWritableStdioStream(fd);\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nexports.formatters.o = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts)\n .split('\\n').map(function(str) {\n return str.trim()\n }).join(' ');\n};\n\n/**\n * Map %o to `util.inspect()`, allowing multiple lines if needed.\n */\n\nexports.formatters.O = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts);\n};\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var name = this.namespace;\n var useColors = this.useColors;\n\n if (useColors) {\n var c = this.color;\n var prefix = ' \\u001b[3' + c + ';1m' + name + ' ' + '\\u001b[0m';\n\n args[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n args.push('\\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\\u001b[0m');\n } else {\n args[0] = new Date().toUTCString()\n + ' ' + name + ' ' + args[0];\n }\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to `stream`.\n */\n\nfunction log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n if (null == namespaces) {\n // If you set a process.env field to null or undefined, it gets cast to the\n // string 'null' or 'undefined'. Just delete instead.\n delete process.env.DEBUG;\n } else {\n process.env.DEBUG = namespaces;\n }\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n return process.env.DEBUG;\n}\n\n/**\n * Copied from `node/src/node.js`.\n *\n * XXX: It's lame that node doesn't expose this API out-of-the-box. It also\n * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.\n */\n\nfunction createWritableStdioStream (fd) {\n var stream;\n var tty_wrap = process.binding('tty_wrap');\n\n // Note stream._type is used for test-module-load-list.js\n\n switch (tty_wrap.guessHandleType(fd)) {\n case 'TTY':\n stream = new tty.WriteStream(fd);\n stream._type = 'tty';\n\n // Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n case 'FILE':\n var fs = require('fs');\n stream = new fs.SyncWriteStream(fd, { autoClose: false });\n stream._type = 'fs';\n break;\n\n case 'PIPE':\n case 'TCP':\n var net = require('net');\n stream = new net.Socket({\n fd: fd,\n readable: false,\n writable: true\n });\n\n // FIXME Should probably have an option in net.Socket to create a\n // stream from an existing fd which is writable only. But for now\n // we'll just add this hack and set the `readable` member to false.\n // Test: ./node test/fixtures/echo.js < /etc/passwd\n stream.readable = false;\n stream.read = null;\n stream._type = 'pipe';\n\n // FIXME Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n default:\n // Probably an error on in uv_guess_handle()\n throw new Error('Implement me. Unknown stream file type!');\n }\n\n // For supporting legacy API we put the FD here.\n stream.fd = fd;\n\n stream._isStdio = true;\n\n return stream;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init (debug) {\n debug.inspectOpts = {};\n\n var keys = Object.keys(exports.inspectOpts);\n for (var i = 0; i < keys.length; i++) {\n debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n }\n}\n\n/**\n * Enable namespaces listed in `process.env.DEBUG` initially.\n */\n\nexports.enable(load());\n","module.exports = require(\"tty\");","module.exports = require(\"net\");","module.exports = require(\"zlib\");","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AuthAPI = void 0;\nvar core_1 = require(\"../../../core\");\nvar BaseAPI_1 = require(\"./BaseAPI\");\nvar AuthAPI = /** @class */ (function (_super) {\n __extends(AuthAPI, _super);\n function AuthAPI() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Looks up the account information using its Terra account address. If the account has\n * vesting, it will be a [[LazyGradedVestingAccount]].\n *\n * @param address address of account to look up\n */\n AuthAPI.prototype.accountInfo = function (address) {\n return __awaiter(this, void 0, void 0, function () {\n var result;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.c.get(\"/auth/accounts/\" + address)];\n case 1:\n result = (_a.sent()).result;\n if (result.type === 'core/Account') {\n return [2 /*return*/, core_1.Account.fromData(result)];\n }\n else {\n return [2 /*return*/, core_1.LazyGradedVestingAccount.fromData(result)];\n }\n return [2 /*return*/];\n }\n });\n });\n };\n return AuthAPI;\n}(BaseAPI_1.BaseAPI));\nexports.AuthAPI = AuthAPI;\n//# sourceMappingURL=AuthAPI.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BankAPI = void 0;\nvar BaseAPI_1 = require(\"./BaseAPI\");\nvar core_1 = require(\"../../../core\");\nvar BankAPI = /** @class */ (function (_super) {\n __extends(BankAPI, _super);\n function BankAPI() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Look up the balance of an account by its address.\n * @param address address of account to look up.\n */\n BankAPI.prototype.balance = function (address) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/bank/balances/\" + address)\n .then(function (d) { return core_1.Coins.fromData(d.result); })];\n });\n });\n };\n return BankAPI;\n}(BaseAPI_1.BaseAPI));\nexports.BankAPI = BankAPI;\n//# sourceMappingURL=BankAPI.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DistributionAPI = void 0;\nvar BaseAPI_1 = require(\"./BaseAPI\");\nvar core_1 = require(\"../../../core\");\nvar DistributionAPI = /** @class */ (function (_super) {\n __extends(DistributionAPI, _super);\n function DistributionAPI() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets a delegator's rewards.\n * @param delegator delegator's account address\n */\n DistributionAPI.prototype.rewards = function (delegator) {\n return __awaiter(this, void 0, void 0, function () {\n var rewardsData, rewards, _i, _a, reward;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0: return [4 /*yield*/, this.c\n .get(\"/distribution/delegators/\" + delegator + \"/rewards\")\n .then(function (d) { return d.result; })];\n case 1:\n rewardsData = _b.sent();\n rewards = {};\n for (_i = 0, _a = rewardsData.rewards; _i < _a.length; _i++) {\n reward = _a[_i];\n rewards[reward.validator_address] = core_1.Coins.fromData(reward.reward);\n }\n return [2 /*return*/, {\n rewards: rewards,\n total: core_1.Coins.fromData(rewardsData.total),\n }];\n }\n });\n });\n };\n /**\n * Gets a validator's rewards.\n * @param validator validator's operator address\n */\n DistributionAPI.prototype.validatorRewards = function (validator) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/distribution/validators/\" + validator)\n .then(function (d) { return d.result; })\n .then(function (d) { return ({\n self_bond_rewards: core_1.Coins.fromData(d.self_bond_rewards),\n val_commission: core_1.Coins.fromData(d.val_commission),\n }); })];\n });\n });\n };\n /**\n * Gets the withdraw address of a delegator, the address to which rewards are withdrawn.\n * @param delegator\n */\n DistributionAPI.prototype.withdrawAddress = function (delegator) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/distribution/delegators/\" + delegator + \"/withdraw_address\")\n .then(function (d) { return d.result; })];\n });\n });\n };\n /**\n * Gets the current value of the community pool.\n */\n DistributionAPI.prototype.communityPool = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/distribution/community_pool\")\n .then(function (d) { return core_1.Coins.fromData(d.result); })];\n });\n });\n };\n /**\n * Gets the current distribution parameters.\n */\n DistributionAPI.prototype.parameters = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/distribution/parameters\")\n .then(function (_a) {\n var d = _a.result;\n return ({\n base_proposer_reward: new core_1.Dec(d.base_proposer_reward),\n community_tax: new core_1.Dec(d.community_tax),\n bonus_proposer_reward: new core_1.Dec(d.bonus_proposer_reward),\n withdraw_addr_enabled: d.withdraw_addr_enabled,\n });\n })];\n });\n });\n };\n return DistributionAPI;\n}(BaseAPI_1.BaseAPI));\nexports.DistributionAPI = DistributionAPI;\n//# sourceMappingURL=DistributionAPI.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GovAPI = void 0;\nvar BaseAPI_1 = require(\"./BaseAPI\");\nvar core_1 = require(\"../../../core\");\nvar GovAPI = /** @class */ (function (_super) {\n __extends(GovAPI, _super);\n function GovAPI() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets all proposals.\n */\n GovAPI.prototype.proposals = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/gov/proposals\")\n .then(function (d) { return d.result.map(core_1.Proposal.fromData); })];\n });\n });\n };\n /**\n * Get a specific proposal by its ID\n * @param proposalId proposal's ID\n */\n GovAPI.prototype.proposal = function (proposalId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/gov/proposals/\" + proposalId)\n .then(function (d) { return core_1.Proposal.fromData(d.result); })];\n });\n });\n };\n /**\n * Get the proposal's proposer\n * @param proposalId proposal's ID\n */\n GovAPI.prototype.proposer = function (proposalId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/gov/proposals/\" + proposalId + \"/proposer\")\n .then(function (d) { return d.result.proposer; })];\n });\n });\n };\n /**\n * Get the deposits for a proposal\n * @param proposalId proposal's ID\n */\n GovAPI.prototype.deposits = function (proposalId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/gov/proposals/\" + proposalId + \"/deposits\")\n .then(function (d) { return d.result; })];\n });\n });\n };\n /**\n * Get the current votes for a proposal\n * @param proposalId proposal's ID\n */\n GovAPI.prototype.votes = function (proposalId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/gov/proposals/\" + proposalId + \"/deposits\")\n .then(function (d) { return d.result; })];\n });\n });\n };\n /**\n * Gets the current tally for a proposal.\n * @param proposalId proposal's ID\n */\n GovAPI.prototype.tally = function (proposalId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/gov/proposals/\" + proposalId + \"/tally\")\n .then(function (_a) {\n var d = _a.result;\n return ({\n yes: new core_1.Int(d.yes),\n no: new core_1.Int(d.no),\n no_with_veto: new core_1.Int(d.no_with_veto),\n abstain: new core_1.Int(d.abstain),\n });\n })];\n });\n });\n };\n /** Gets the Gov module's deposit parameters */\n GovAPI.prototype.depositParameters = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/gov/parameters/deposit\")\n .then(function (_a) {\n var d = _a.result;\n return ({\n max_deposit_period: Number.parseInt(d.max_deposit_period),\n min_deposit: core_1.Coins.fromData(d.min_deposit),\n });\n })];\n });\n });\n };\n /** Gets the Gov module's voting parameters */\n GovAPI.prototype.votingParameters = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/gov/parameters/voting\")\n .then(function (_a) {\n var d = _a.result;\n return ({\n voting_period: Number.parseInt(d.voting_period),\n });\n })];\n });\n });\n };\n /** Gets teh Gov module's tally parameters */\n GovAPI.prototype.tallyParameters = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/gov/parameters/tallying\")\n .then(function (_a) {\n var d = _a.result;\n return ({\n quorum: new core_1.Dec(d.quorum),\n veto: new core_1.Dec(d.veto),\n threshold: new core_1.Dec(d.threshold),\n });\n })];\n });\n });\n };\n /** Gets the Gov module's current parameters */\n GovAPI.prototype.parameters = function () {\n return __awaiter(this, void 0, void 0, function () {\n var _a, deposit_params, voting_params, tally_params;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0: return [4 /*yield*/, Promise.all([\n this.depositParameters(),\n this.votingParameters(),\n this.tallyParameters(),\n ])];\n case 1:\n _a = _b.sent(), deposit_params = _a[0], voting_params = _a[1], tally_params = _a[2];\n return [2 /*return*/, {\n deposit_params: deposit_params,\n voting_params: voting_params,\n tally_params: tally_params,\n }];\n }\n });\n });\n };\n return GovAPI;\n}(BaseAPI_1.BaseAPI));\nexports.GovAPI = GovAPI;\n//# sourceMappingURL=GovAPI.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MarketAPI = void 0;\nvar core_1 = require(\"../../../core\");\nvar BaseAPI_1 = require(\"./BaseAPI\");\nvar MarketAPI = /** @class */ (function (_super) {\n __extends(MarketAPI, _super);\n function MarketAPI() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets the Market's swap rate for a given coin to a requested denomination.\n * @param offerCoin coin to convert\n * @param askDenom denomination to swap into\n */\n MarketAPI.prototype.swapRate = function (offerCoin, askDenom) {\n return __awaiter(this, void 0, void 0, function () {\n var params;\n return __generator(this, function (_a) {\n params = {\n offer_coin: offerCoin.toString(),\n ask_denom: askDenom,\n };\n return [2 /*return*/, this.c\n .get(\"/market/swap\", params)\n .then(function (d) { return core_1.Coin.fromData(d.result); })];\n });\n });\n };\n /**\n * Gets current value of the pool delta, which is used to determine Terra<>Luna swap rates.\n */\n MarketAPI.prototype.terraPoolDelta = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/market/terra_pool_delta\")\n .then(function (d) { return new core_1.Dec(d.result); })];\n });\n });\n };\n /**\n * Gets the current Market module's parameters.\n */\n MarketAPI.prototype.parameters = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/market/parameters\")\n .then(function (_a) {\n var d = _a.result;\n return ({\n pool_recovery_period: Number.parseInt(d.pool_recovery_period),\n base_pool: new core_1.Dec(d.base_pool),\n min_spread: new core_1.Dec(d.min_spread),\n });\n })];\n });\n });\n };\n return MarketAPI;\n}(BaseAPI_1.BaseAPI));\nexports.MarketAPI = MarketAPI;\n//# sourceMappingURL=MarketAPI.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MsgAuthAPI = void 0;\nvar BaseAPI_1 = require(\"./BaseAPI\");\nvar Authorization_1 = require(\"../../../core/msgauth/Authorization\");\nvar MsgAuthAPI = /** @class */ (function (_super) {\n __extends(MsgAuthAPI, _super);\n function MsgAuthAPI() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get the message authorization grants for a specific granter and grantee\n */\n MsgAuthAPI.prototype.grants = function (granter, grantee, msgType) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (msgType === undefined) {\n return [2 /*return*/, this.c\n .get(\"/msgauth/granters/\" + granter + \"/grantees/\" + grantee + \"/grants\")\n .then(function (d) { return d.result.map(Authorization_1.AuthorizationGrant.fromData); })];\n }\n else {\n return [2 /*return*/, this.c\n .get(\"/msgauth/granters/\" + granter + \"/grantees/\" + grantee + \"/grants/\" + msgType)\n .then(function (d) {\n if (d.result === null) {\n return [];\n }\n return [Authorization_1.AuthorizationGrant.fromData(d.result)];\n })];\n }\n return [2 /*return*/];\n });\n });\n };\n return MsgAuthAPI;\n}(BaseAPI_1.BaseAPI));\nexports.MsgAuthAPI = MsgAuthAPI;\n//# sourceMappingURL=MsgAuthAPI.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OracleAPI = void 0;\nvar BaseAPI_1 = require(\"./BaseAPI\");\nvar core_1 = require(\"../../../core\");\nvar OracleAPI = /** @class */ (function (_super) {\n __extends(OracleAPI, _super);\n function OracleAPI() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Query the currently casted votes for the exchange rate of LUNA, filterable by validator or denom.\n *\n * At least one of the parameters **must** be provided.\n * @param denom denomination to query votes for\n * @param validator validator operator address to query votes for\n */\n OracleAPI.prototype.votes = function (denom, validator) {\n return __awaiter(this, void 0, void 0, function () {\n var vote, votes, votes;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!(validator !== undefined && denom !== undefined)) return [3 /*break*/, 2];\n return [4 /*yield*/, this.c.get(\"/oracle/denoms/\" + denom + \"/votes/\" + validator)];\n case 1:\n vote = _a.sent();\n return [2 /*return*/, [core_1.ExchangeRateVote.fromData(vote.result)]];\n case 2:\n if (!(validator !== undefined)) return [3 /*break*/, 4];\n return [4 /*yield*/, this.c.get(\"/oracle/voters/\" + validator + \"/votes\")];\n case 3:\n votes = _a.sent();\n return [2 /*return*/, votes.result.map(core_1.ExchangeRateVote.fromData)];\n case 4:\n if (!(denom !== undefined)) return [3 /*break*/, 6];\n return [4 /*yield*/, this.c.get(\"/oracle/denoms/\" + denom + \"/votes\")];\n case 5:\n votes = _a.sent();\n return [2 /*return*/, votes.result.map(core_1.ExchangeRateVote.fromData)];\n case 6: throw new Error('both denom and validator cannot both be undefined');\n }\n });\n });\n };\n /**\n * Query the currently casted vprevotes, filterable by validator or denom.\n *\n * At least one of the parameters **must** be provided.\n * @param denom denomination to query prevotes for\n * @param validator validator operator address to query prevotes for\n */\n OracleAPI.prototype.prevotes = function (denom, validator) {\n return __awaiter(this, void 0, void 0, function () {\n var prevote, prevotes, prevotes;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!(validator !== undefined && denom !== undefined)) return [3 /*break*/, 2];\n return [4 /*yield*/, this.c.get(\"/oracle/denoms/\" + denom + \"/prevotes/\" + validator)];\n case 1:\n prevote = _a.sent();\n return [2 /*return*/, [core_1.ExchangeRatePrevote.fromData(prevote.result)]];\n case 2:\n if (!(validator !== undefined)) return [3 /*break*/, 4];\n return [4 /*yield*/, this.c.get(\"/oracle/voters/\" + validator + \"/prevotes\")];\n case 3:\n prevotes = _a.sent();\n return [2 /*return*/, prevotes.result.map(core_1.ExchangeRatePrevote.fromData)];\n case 4:\n if (!(denom !== undefined)) return [3 /*break*/, 6];\n return [4 /*yield*/, this.c.get(\"/oracle/denoms/\" + denom + \"/prevotes\")];\n case 5:\n prevotes = _a.sent();\n return [2 /*return*/, prevotes.result.map(core_1.ExchangeRatePrevote.fromData)];\n case 6: throw new Error('both denom and validator cannot both be undefined');\n }\n });\n });\n };\n /**\n * Gets the Oracle module's currently registered exchange rate for LUNA in all available denominations.\n */\n OracleAPI.prototype.exchangeRates = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/oracle/denoms/exchange_rates\")\n .then(function (d) { return core_1.Coins.fromData(d.result); })];\n });\n });\n };\n /**\n * Gets the Oracle module's currently registered exchange rate for the specific denomination.\n * @param denom denomination in which to get the exchange rate of LUNA\n */\n OracleAPI.prototype.exchangeRate = function (denom) {\n return __awaiter(this, void 0, void 0, function () {\n var rates;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.exchangeRates()];\n case 1:\n rates = _a.sent();\n return [2 /*return*/, rates.get(denom)];\n }\n });\n });\n };\n /**\n * Gets the current list of active denominations.\n */\n OracleAPI.prototype.activeDenoms = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c.get(\"/oracle/denoms/actives\").then(function (d) { return d.result; })];\n });\n });\n };\n /**\n * Gets the registered feeder address associated with the validator. The feeder address is the\n * Terra account that is permitted to sign Oracle vote messages in the validator's name.\n * @param validator validator's operator address\n */\n OracleAPI.prototype.feederAddress = function (validator) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/oracle/voters/\" + validator + \"/feeder\")\n .then(function (d) { return d.result; })];\n });\n });\n };\n /**\n * Gets the number of missed oracle votes for the validator over the current slash window.\n * @param validator validator's operator address\n */\n OracleAPI.prototype.misses = function (validator) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/oracle/voters/\" + validator + \"/miss\")\n .then(function (d) { return Number.parseInt(d.result); })];\n });\n });\n };\n /**\n * Gets the validator's current submitted aggregate prevote\n * @param validator validator's operator address\n */\n OracleAPI.prototype.aggregatePrevote = function (validator) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/oracle/voters/\" + validator + \"/aggregate_prevote\")\n .then(function (d) { return core_1.AggregateExchangeRatePrevote.fromData(d.result); })];\n });\n });\n };\n /**\n * Gets the validator's current submitted aggregate vote\n * @param validator validator's operator address\n */\n OracleAPI.prototype.aggregateVote = function (validator) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/oracle/voters/\" + validator + \"/aggregate_vote\")\n .then(function (d) { return core_1.AggregateExchangeRateVote.fromData(d.result); })];\n });\n });\n };\n /**\n * Gets the current Oracle module's parameters.\n */\n OracleAPI.prototype.parameters = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/oracle/parameters\")\n .then(function (_a) {\n var d = _a.result;\n return ({\n vote_period: Number.parseInt(d.vote_period),\n vote_threshold: new core_1.Dec(d.vote_threshold),\n reward_band: new core_1.Dec(d.reward_band),\n reward_distribution_window: Number.parseInt(d.reward_distribution_window),\n whitelist: d.whitelist.map(function (x) { return ({\n name: x.name,\n tobin_tax: new core_1.Dec(x.tobin_tax),\n }); }),\n slash_fraction: new core_1.Dec(d.slash_fraction),\n slash_window: Number.parseInt(d.slash_window),\n min_valid_per_window: new core_1.Dec(d.min_valid_per_window),\n });\n })];\n });\n });\n };\n return OracleAPI;\n}(BaseAPI_1.BaseAPI));\nexports.OracleAPI = OracleAPI;\n//# sourceMappingURL=OracleAPI.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SlashingAPI = void 0;\nvar BaseAPI_1 = require(\"./BaseAPI\");\nvar core_1 = require(\"../../../core\");\nvar SlashingAPI = /** @class */ (function (_super) {\n __extends(SlashingAPI, _super);\n function SlashingAPI() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets all signing info, or just the signing info of a particular validator.\n *\n * @param valConsPubKey validator's consensus public key\n */\n SlashingAPI.prototype.signingInfos = function (valConsPubKey) {\n return __awaiter(this, void 0, void 0, function () {\n var url;\n return __generator(this, function (_a) {\n if (valConsPubKey !== undefined) {\n url = \"/slashing/validators/\" + valConsPubKey + \"/signing_info\";\n }\n else {\n url = \"/slashing/signing_infos\";\n }\n return [2 /*return*/, this.c.get(url).then(function (d) {\n return d.result.map(function (x) { return ({\n address: x.address,\n start_height: Number.parseInt(x.start_height),\n index_offset: Number.parseInt(x.index_offset),\n jailed_until: new Date(x.jailed_until),\n tombstoned: x.tombstoned,\n missed_blocks_counter: Number.parseInt(x.missed_blocks_counter),\n }); });\n })];\n });\n });\n };\n /**\n * Gets the current Slashing module's parameters.\n */\n SlashingAPI.prototype.parameters = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/slashing/parameters\")\n .then(function (_a) {\n var d = _a.result;\n return ({\n max_evidence_age: Number.parseInt(d.max_evidence_age),\n signed_blocks_window: Number.parseInt(d.signed_blocks_window),\n min_signed_per_window: new core_1.Dec(d.min_signed_per_window),\n downtime_jail_duration: Number.parseInt(d.downtime_jail_duration),\n slash_fraction_double_sign: new core_1.Dec(d.slash_fraction_double_sign),\n slash_fraction_downtime: new core_1.Dec(d.slash_fraction_downtime),\n });\n })];\n });\n });\n };\n return SlashingAPI;\n}(BaseAPI_1.BaseAPI));\nexports.SlashingAPI = SlashingAPI;\n//# sourceMappingURL=SlashingAPI.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StakingAPI = void 0;\nvar core_1 = require(\"../../../core\");\nvar BaseAPI_1 = require(\"./BaseAPI\");\nvar Delegation_1 = require(\"../../../core/staking/Delegation\");\nvar Validator_1 = require(\"../../../core/staking/Validator\");\nvar Redelegation_1 = require(\"../../../core/staking/Redelegation\");\nvar Denom_1 = require(\"../../../core/Denom\");\nvar StakingAPI = /** @class */ (function (_super) {\n __extends(StakingAPI, _super);\n function StakingAPI() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Queries all delegations, filtering by delegator, validator, or both.\n *\n * At least one of the parameters must be defined.\n * @param delegator delegator's account address\n * @param validator validator's operator address\n */\n StakingAPI.prototype.delegations = function (delegator, validator) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (delegator !== undefined && validator !== undefined) {\n return [2 /*return*/, this.c\n .get(\"/staking/delegators/\" + delegator + \"/delegations/\" + validator)\n .then(function (data) { return [Delegation_1.Delegation.fromData(data.result)]; })];\n }\n else if (delegator !== undefined) {\n return [2 /*return*/, this.c\n .get(\"/staking/delegators/\" + delegator + \"/delegations\")\n .then(function (data) { return data.result.map(Delegation_1.Delegation.fromData); })];\n }\n else if (validator !== undefined) {\n return [2 /*return*/, this.c\n .get(\"/staking/validators/\" + validator + \"/delegations\")\n .then(function (data) { return data.result.map(Delegation_1.Delegation.fromData); })];\n }\n else {\n throw new TypeError('arguments delegator and validator cannot both be empty');\n }\n return [2 /*return*/];\n });\n });\n };\n /**\n * Gets the delegation between a delegator and validator, if it exists.\n * @param delegator delegator's account address\n * @param validator validator's operator address\n */\n StakingAPI.prototype.delegation = function (delegator, validator) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.delegations(delegator, validator).then(function (delgs) { return delgs[0]; })];\n });\n });\n };\n /**\n * Queries all unbonding delegations, filtering by delegator, validator, or both.\n *\n * At least one of the parameters must be defined.\n * @param delegator delegator's account address\n * @param validator validator's operator address\n */\n StakingAPI.prototype.unbondingDelegations = function (delegator, validator) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (delegator !== undefined && validator !== undefined) {\n return [2 /*return*/, this.c\n .get(\"/staking/delegators/\" + delegator + \"/unbonding_delegations/\" + validator)\n .then(function (data) { return [core_1.UnbondingDelegation.fromData(data.result)]; })];\n }\n else if (delegator !== undefined) {\n return [2 /*return*/, this.c\n .get(\"/staking/delegators/\" + delegator + \"/unbonding_delegations\")\n .then(function (data) { return data.result.map(core_1.UnbondingDelegation.fromData); })];\n }\n else if (validator !== undefined) {\n return [2 /*return*/, this.c\n .get(\"/staking/validators/\" + validator + \"/unbonding_delegations\")\n .then(function (data) { return data.result.map(core_1.UnbondingDelegation.fromData); })];\n }\n else {\n throw new TypeError('arguments delegator and validator cannot both be empty');\n }\n return [2 /*return*/];\n });\n });\n };\n /**\n * Gets the unbonding delegation between a delegator and validator, if it exists.\n * @param delegator delegator's account address\n * @param validator validator's operator address\n */\n StakingAPI.prototype.unbondingDelegation = function (delegator, validator) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.unbondingDelegations(delegator, validator).then(function (udelgs) { return udelgs[0]; })];\n });\n });\n };\n /**\n * Queries all redelegations, filterable by delegator, source validator, and target validator.\n * @param delegator delegator's account address\n * @param validatorSrc source validator's operator address (from).\n * @param validatorDst destination validator's operator address (to).\n */\n StakingAPI.prototype.redelegations = function (delegator, validatorSrc, validatorDst) {\n return __awaiter(this, void 0, void 0, function () {\n var params;\n return __generator(this, function (_a) {\n params = {\n delegator: delegator,\n validator_from: validatorSrc,\n validator_to: validatorDst,\n };\n return [2 /*return*/, this.c\n .get(\"/staking/redelegations\", params)\n .then(function (d) { return d.result.map(Redelegation_1.Redelegation.fromData); })];\n });\n });\n };\n /**\n * Gets all bonded validators for a delegator given its address.\n * @param delegator delegator's account address\n */\n StakingAPI.prototype.bondedValidators = function (delegator) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/staking/delegators/\" + delegator + \"/validators\")\n .then(function (d) { return d.result.map(Validator_1.Validator.fromData); })];\n });\n });\n };\n /**\n * Get all current registered validators, including validators that are not currently in the validating set.\n */\n StakingAPI.prototype.validators = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/staking/validators\")\n .then(function (d) { return d.result.map(Validator_1.Validator.fromData); })];\n });\n });\n };\n /**\n * Gets the validator information for a specific validator.\n * @param validator validator's operator address\n */\n StakingAPI.prototype.validator = function (validator) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/staking/validators/\" + validator)\n .then(function (d) { return Validator_1.Validator.fromData(d.result); })];\n });\n });\n };\n /**\n * Gets the current staking pool.\n */\n StakingAPI.prototype.pool = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/staking/pool\")\n .then(function (_a) {\n var d = _a.result;\n return ({\n bonded_tokens: new core_1.Coin(Denom_1.Denom.LUNA, d.bonded_tokens),\n not_bonded_tokens: new core_1.Coin(Denom_1.Denom.LUNA, d.not_bonded_tokens),\n });\n })];\n });\n });\n };\n /**\n * Gets the current Staking module's parameters.\n */\n StakingAPI.prototype.parameters = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/staking/parameters\")\n .then(function (_a) {\n var d = _a.result;\n return ({\n unbonding_time: Number.parseInt(d.unbonding_time),\n max_validators: d.max_validators,\n max_entries: d.max_entries,\n historical_entries: d.historical_entries,\n bond_denom: d.bond_denom,\n });\n })];\n });\n });\n };\n return StakingAPI;\n}(BaseAPI_1.BaseAPI));\nexports.StakingAPI = StakingAPI;\n//# sourceMappingURL=StakingAPI.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SupplyAPI = void 0;\nvar core_1 = require(\"../../../core\");\nvar BaseAPI_1 = require(\"./BaseAPI\");\nvar SupplyAPI = /** @class */ (function (_super) {\n __extends(SupplyAPI, _super);\n function SupplyAPI() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Get the total supply of tokens in circulation for all denominations.\n */\n SupplyAPI.prototype.total = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/supply/total\")\n .then(function (d) { return core_1.Coins.fromData(d.result); })];\n });\n });\n };\n return SupplyAPI;\n}(BaseAPI_1.BaseAPI));\nexports.SupplyAPI = SupplyAPI;\n//# sourceMappingURL=SupplyAPI.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TendermintAPI = void 0;\nvar BaseAPI_1 = require(\"./BaseAPI\");\nvar TendermintAPI = /** @class */ (function (_super) {\n __extends(TendermintAPI, _super);\n function TendermintAPI() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets the node's information.\n */\n TendermintAPI.prototype.nodeInfo = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c.getRaw(\"/node_info\")];\n });\n });\n };\n /**\n * Gets whether the node is currently in syncing mode to catch up with blocks.\n */\n TendermintAPI.prototype.syncing = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c.getRaw(\"/syncing\").then(function (d) { return d.syncing; })];\n });\n });\n };\n /**\n * Gets the validator (delegates) set at the specific height. If no height is given, the current set is returned.\n * @param height block height\n */\n TendermintAPI.prototype.validatorSet = function (height) {\n return __awaiter(this, void 0, void 0, function () {\n var url;\n return __generator(this, function (_a) {\n url = height !== undefined\n ? \"/validatorsets/\" + height\n : \"/validatorsets/latest\";\n return [2 /*return*/, this.c.get(url).then(function (d) { return d.result; })];\n });\n });\n };\n /**\n * Gets the block information at the specified height. If no height is given, the latest block is returned.\n * @param height block height.\n */\n TendermintAPI.prototype.blockInfo = function (height) {\n return __awaiter(this, void 0, void 0, function () {\n var url;\n return __generator(this, function (_a) {\n url = height !== undefined ? \"/blocks/\" + height : \"/blocks/latest\";\n return [2 /*return*/, this.c.getRaw(url)];\n });\n });\n };\n return TendermintAPI;\n}(BaseAPI_1.BaseAPI));\nexports.TendermintAPI = TendermintAPI;\n//# sourceMappingURL=TendermintAPI.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TreasuryAPI = void 0;\nvar BaseAPI_1 = require(\"./BaseAPI\");\nvar core_1 = require(\"../../../core\");\nvar TreasuryAPI = /** @class */ (function (_super) {\n __extends(TreasuryAPI, _super);\n function TreasuryAPI() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets the current registered Tax Cap for a specified denomation.\n * @param denom denomination desired for Tax Cap query.\n */\n TreasuryAPI.prototype.taxCap = function (denom) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/treasury/tax_cap/\" + denom)\n .then(function (d) { return new core_1.Coin(denom, d.result); })];\n });\n });\n };\n /**\n * Gets the current registered Tax Rate.\n */\n TreasuryAPI.prototype.taxRate = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/treasury/tax_rate\")\n .then(function (d) { return new core_1.Dec(d.result); })];\n });\n });\n };\n /**\n * Gets the current registered Reward Weight monetary policy lever.\n */\n TreasuryAPI.prototype.rewardWeight = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/treasury/reward_weight\")\n .then(function (d) { return new core_1.Dec(d.result); })];\n });\n });\n };\n /**\n * Gets the tax proceeds for the epoch.\n */\n TreasuryAPI.prototype.taxProceeds = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/treasury/tax_proceeds\")\n .then(function (d) { return core_1.Coins.fromData(d.result); })];\n });\n });\n };\n /**\n * Gets the seigniorage proceeds for the epoch.\n */\n TreasuryAPI.prototype.seigniorageProceeds = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/treasury/seigniorage_proceeds\")\n .then(function (d) { return new core_1.Coin(core_1.Denom.LUNA, d.result); })];\n });\n });\n };\n /**\n * Gets the current Treasury module's parameters.\n */\n TreasuryAPI.prototype.parameters = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/treasury/parameters\")\n .then(function (_a) {\n var d = _a.result;\n return ({\n tax_policy: core_1.PolicyConstraints.fromData(d.tax_policy),\n reward_policy: core_1.PolicyConstraints.fromData(d.reward_policy),\n mining_increment: new core_1.Dec(d.mining_increment),\n seigniorage_burden_target: new core_1.Dec(d.seigniorage_burden_target),\n window_long: Number.parseInt(d.window_long),\n window_short: Number.parseInt(d.window_short),\n window_probation: Number.parseInt(d.window_probation),\n });\n })];\n });\n });\n };\n return TreasuryAPI;\n}(BaseAPI_1.BaseAPI));\nexports.TreasuryAPI = TreasuryAPI;\n//# sourceMappingURL=TreasuryAPI.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TxAPI = exports.isTxError = exports.Broadcast = void 0;\nvar BaseAPI_1 = require(\"./BaseAPI\");\nvar core_1 = require(\"../../../core\");\nvar hash_1 = require(\"../../../util/hash\");\nvar core_2 = require(\"../../../core\");\n/** Transaction broadcasting modes */\nvar Broadcast;\n(function (Broadcast) {\n /** Wait until the transaction has been included in the block */\n Broadcast[\"BLOCK\"] = \"block\";\n /** Return after DeliverTx() */\n Broadcast[\"SYNC\"] = \"sync\";\n /** Return after CheckTx() */\n Broadcast[\"ASYNC\"] = \"async\";\n})(Broadcast = exports.Broadcast || (exports.Broadcast = {}));\nfunction isTxError(x) {\n return x.code !== undefined;\n}\nexports.isTxError = isTxError;\nvar TxAPI = /** @class */ (function (_super) {\n __extends(TxAPI, _super);\n function TxAPI(lcd) {\n var _this = _super.call(this, lcd.apiRequester) || this;\n _this.lcd = lcd;\n return _this;\n }\n /**\n * Looks up a transaction on the blockchain, addressed by its hash\n * @param txHash transaction's hash\n */\n TxAPI.prototype.txInfo = function (txHash) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c.getRaw(\"/txs/\" + txHash).then(core_1.TxInfo.fromData)];\n });\n });\n };\n /**\n * Builds a [[StdSignMsg]] that is ready to be signed by a [[Key]]. The appropriate\n * account number and sequence will be fetched live from the blockchain and added to\n * the resultant [[StdSignMsg]]. If no fee is provided, fee will be automatically\n * estimated using the parameters, simulated using a \"dummy fee\" with sourceAddress's\n * nonzero denominations in its balance.\n *\n * @param sourceAddress account address of signer\n * @param options TX generation options\n */\n TxAPI.prototype.create = function (sourceAddress, options) {\n return __awaiter(this, void 0, void 0, function () {\n var fee, memo, msgs, estimateFeeOptions, balance, balanceOne, stdTx, accountNumber, sequence, account;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n fee = options.fee, memo = options.memo;\n msgs = options.msgs;\n memo = memo || '';\n estimateFeeOptions = {\n gasPrices: options.gasPrices || this.lcd.config.gasPrices,\n gasAdjustment: options.gasAdjustment || this.lcd.config.gasAdjustment,\n };\n return [4 /*yield*/, this.lcd.bank.balance(sourceAddress)];\n case 1:\n balance = _a.sent();\n balanceOne = balance.map(function (c) { return new core_1.Coin(c.denom, 1); });\n if (!(fee === undefined)) return [3 /*break*/, 3];\n stdTx = new core_1.StdTx(msgs, new core_1.StdFee(0, balanceOne), [], memo);\n return [4 /*yield*/, this.lcd.tx.estimateFee(stdTx, estimateFeeOptions)];\n case 2:\n fee = _a.sent();\n _a.label = 3;\n case 3:\n accountNumber = options.account_number;\n sequence = options.sequence;\n if (!(!accountNumber || !sequence)) return [3 /*break*/, 5];\n return [4 /*yield*/, this.lcd.auth.accountInfo(sourceAddress)];\n case 4:\n account = _a.sent();\n if (!accountNumber) {\n accountNumber = account.account_number;\n }\n if (!sequence) {\n sequence = account.sequence;\n }\n _a.label = 5;\n case 5: return [2 /*return*/, new core_1.StdSignMsg(this.lcd.config.chainID, accountNumber, sequence, fee, msgs, memo)];\n }\n });\n });\n };\n /**\n * Looks up transactions on the blockchain for the block height. If height is undefined,\n * gets the transactions for the latest block.\n * @param height block height\n */\n TxAPI.prototype.txInfosByHeight = function (height) {\n return __awaiter(this, void 0, void 0, function () {\n var blockInfo, txs, txhashes;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.lcd.tendermint.blockInfo(height)];\n case 1:\n blockInfo = _a.sent();\n txs = blockInfo.block.data.txs;\n if (!txs) {\n return [2 /*return*/, []];\n }\n else {\n txhashes = txs.map(function (txdata) { return hash_1.hashAmino(txdata); });\n return [2 /*return*/, Promise.all(txhashes.map(function (txhash) { return _this.txInfo(txhash); }))];\n }\n return [2 /*return*/];\n }\n });\n });\n };\n /**\n * Estimates the transaction's fee by simulating it within the node\n * @param tx transaction for which to estimate fee\n * @param options options for fee estimation\n */\n TxAPI.prototype.estimateFee = function (tx, options) {\n return __awaiter(this, void 0, void 0, function () {\n var gasPrices, gasAdjustment, txValue, data;\n return __generator(this, function (_a) {\n gasPrices = (options === null || options === void 0 ? void 0 : options.gasPrices) || this.lcd.config.gasPrices;\n gasAdjustment = (options === null || options === void 0 ? void 0 : options.gasAdjustment) || this.lcd.config.gasAdjustment;\n txValue = __assign({}, (tx instanceof core_1.StdSignMsg\n ? tx.toStdTx().toData().value\n : tx.toData().value));\n txValue.fee.gas = '0';\n data = {\n tx: txValue,\n gas_prices: gasPrices && new core_1.Coins(gasPrices).toData(),\n gas_adjustment: gasAdjustment && gasAdjustment.toString(),\n };\n return [2 /*return*/, this.c\n .post(\"/txs/estimate_fee\", data)\n .then(function (_a) {\n var d = _a.result;\n return new core_1.StdFee(Number.parseInt(d.gas), core_1.Coins.fromData(d.fees));\n })];\n });\n });\n };\n /**\n * Encode a transaction to Amino-encoding\n * @param tx transaction to encode\n */\n TxAPI.prototype.encode = function (tx) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .postRaw(\"/txs/encode\", tx.toData())\n .then(function (d) { return d.tx; })];\n });\n });\n };\n /**\n * Get the transaction's hash\n * @param tx transaction to hash\n */\n TxAPI.prototype.hash = function (tx) {\n return __awaiter(this, void 0, void 0, function () {\n var amino;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.encode(tx)];\n case 1:\n amino = _a.sent();\n return [2 /*return*/, hash_1.hashAmino(amino)];\n }\n });\n });\n };\n TxAPI.prototype._broadcast = function (tx, mode) {\n return __awaiter(this, void 0, void 0, function () {\n var data;\n return __generator(this, function (_a) {\n data = {\n tx: tx.toData().value,\n mode: mode,\n };\n return [2 /*return*/, this.c.postRaw(\"/txs\", data)];\n });\n });\n };\n /**\n * Broadcast the transaction using the \"block\" mode, waiting for its inclusion in the blockchain.\n * @param tx tranasaction to broadcast\n */\n TxAPI.prototype.broadcast = function (tx) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this._broadcast(tx, Broadcast.BLOCK).then(function (d) {\n var blockResult = {\n height: Number.parseInt(d.height),\n txhash: d.txhash,\n raw_log: d.raw_log,\n gas_wanted: Number.parseInt(d.gas_wanted),\n gas_used: Number.parseInt(d.gas_used),\n };\n if (d.logs) {\n blockResult.logs = d.logs.map(function (l) { return core_2.TxLog.fromData(l); });\n }\n if (d.code) {\n blockResult.code = d.code;\n }\n if (d.codespace) {\n blockResult.codespace = d.codespace;\n }\n return blockResult;\n })];\n });\n });\n };\n /**\n * NOTE: This is not a synchronous function and is unconventionally named. This function\n * can be await as it returns a `Promise`.\n *\n * Broadcast the transaction using the \"sync\" mode, returning after DeliverTx() is performed.\n * @param tx transaction to broadcast\n */\n TxAPI.prototype.broadcastSync = function (tx) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this._broadcast(tx, Broadcast.SYNC).then(function (d) {\n var blockResult = {\n height: Number.parseInt(d.height),\n txhash: d.txhash,\n raw_log: d.raw_log,\n };\n if (d.code) {\n blockResult.code = d.code;\n }\n if (d.codespace) {\n blockResult.codespace = d.codespace;\n }\n return blockResult;\n })];\n });\n });\n };\n /**\n * Broadcast the transaction using the \"async\" mode, returning after CheckTx() is performed.\n * @param tx transaction to broadcast\n */\n TxAPI.prototype.broadcastAsync = function (tx) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this._broadcast(tx, Broadcast.ASYNC).then(function (d) { return ({\n height: Number.parseInt(d.height),\n txhash: d.txhash,\n }); })];\n });\n });\n };\n /**\n * Search for transactions based on event attributes.\n * @param options\n */\n TxAPI.prototype.search = function (options) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c.getRaw(\"/txs\", options).then(function (d) { return ({\n total_count: Number.parseInt(d.total_count),\n count: Number.parseInt(d.count),\n page_number: Number.parseInt(d.page_number),\n page_total: Number.parseInt(d.page_total),\n limit: Number.parseInt(d.limit),\n txs: d.txs.map(function (txdata) { return core_1.TxInfo.fromData(txdata); }),\n }); })];\n });\n });\n };\n return TxAPI;\n}(BaseAPI_1.BaseAPI));\nexports.TxAPI = TxAPI;\n//# sourceMappingURL=TxAPI.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hashAmino = void 0;\nvar sha256_1 = __importDefault(require(\"crypto-js/sha256\"));\nvar enc_base64_1 = __importDefault(require(\"crypto-js/enc-base64\"));\n/*\nDEPRECATED (was used by crypto-js)\nfunction byteArrayToWordArray(ba: Uint8Array): CryptoJS.LibWordArray {\n const wa: number[] = [];\n for (let i = 0; i < ba.length; i += 1) {\n wa[(i / 4) | 0] |= ba[i] << (24 - 8 * i);\n }\n return crypto.lib.WordArray.create(wa);\n}*/\n/**\n * Calculates the transaction hash from Amino-encoded string.\n * @param txData Amino-encoded string (base64)\n */\nfunction hashAmino(txData) {\n return sha256_1.default(enc_base64_1.default.parse(txData)).toString().toUpperCase();\n}\nexports.hashAmino = hashAmino;\n//# sourceMappingURL=hash.js.map",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var C_enc = C.enc;\n\n\t /**\n\t * Base64 encoding strategy.\n\t */\n\t var Base64 = C_enc.Base64 = {\n\t /**\n\t * Converts a word array to a Base64 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The Base64 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var base64String = CryptoJS.enc.Base64.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\t var map = this._map;\n\n\t // Clamp excess bits\n\t wordArray.clamp();\n\n\t // Convert\n\t var base64Chars = [];\n\t for (var i = 0; i < sigBytes; i += 3) {\n\t var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;\n\t var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;\n\n\t var triplet = (byte1 << 16) | (byte2 << 8) | byte3;\n\n\t for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {\n\t base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));\n\t }\n\t }\n\n\t // Add padding\n\t var paddingChar = map.charAt(64);\n\t if (paddingChar) {\n\t while (base64Chars.length % 4) {\n\t base64Chars.push(paddingChar);\n\t }\n\t }\n\n\t return base64Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Base64 string to a word array.\n\t *\n\t * @param {string} base64Str The Base64 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Base64.parse(base64String);\n\t */\n\t parse: function (base64Str) {\n\t // Shortcuts\n\t var base64StrLength = base64Str.length;\n\t var map = this._map;\n\t var reverseMap = this._reverseMap;\n\n\t if (!reverseMap) {\n\t reverseMap = this._reverseMap = [];\n\t for (var j = 0; j < map.length; j++) {\n\t reverseMap[map.charCodeAt(j)] = j;\n\t }\n\t }\n\n\t // Ignore padding\n\t var paddingChar = map.charAt(64);\n\t if (paddingChar) {\n\t var paddingIndex = base64Str.indexOf(paddingChar);\n\t if (paddingIndex !== -1) {\n\t base64StrLength = paddingIndex;\n\t }\n\t }\n\n\t // Convert\n\t return parseLoop(base64Str, base64StrLength, reverseMap);\n\n\t },\n\n\t _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='\n\t };\n\n\t function parseLoop(base64Str, base64StrLength, reverseMap) {\n\t var words = [];\n\t var nBytes = 0;\n\t for (var i = 0; i < base64StrLength; i++) {\n\t if (i % 4) {\n\t var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2);\n\t var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2);\n\t words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8);\n\t nBytes++;\n\t }\n\t }\n\t return WordArray.create(words, nBytes);\n\t }\n\t}());\n\n\n\treturn CryptoJS.enc.Base64;\n\n}));","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WasmAPI = void 0;\nvar BaseAPI_1 = require(\"./BaseAPI\");\nvar WasmAPI = /** @class */ (function (_super) {\n __extends(WasmAPI, _super);\n function WasmAPI() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n WasmAPI.prototype.codeInfo = function (codeID) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c.get(\"/wasm/codes/\" + codeID).then(function (d) { return d.result; })];\n });\n });\n };\n WasmAPI.prototype.contractInfo = function (contractAddress) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/wasm/contracts/\" + contractAddress)\n .then(function (_a) {\n var d = _a.result;\n return ({\n code_id: Number.parseInt(d.code_id),\n address: d.address,\n owner: d.owner,\n init_msg: JSON.parse(Buffer.from(d.init_msg, 'base64').toString()),\n migratable: d.migratable,\n });\n })];\n });\n });\n };\n WasmAPI.prototype.contractQuery = function (contractAddress, query) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/wasm/contracts/\" + contractAddress + \"/store\", {\n query_msg: JSON.stringify(query),\n })\n .then(function (d) { return d.result; })];\n });\n });\n };\n WasmAPI.prototype.parameters = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.c\n .get(\"/wasm/parameters\")\n .then(function (_a) {\n var d = _a.result;\n return ({\n max_contract_size: Number.parseInt(d.max_contract_size),\n max_contract_gas: Number.parseInt(d.max_contract_gas),\n max_contract_msg_size: Number.parseInt(d.max_contract_msg_size),\n });\n })];\n });\n });\n };\n return WasmAPI;\n}(BaseAPI_1.BaseAPI));\nexports.WasmAPI = WasmAPI;\n//# sourceMappingURL=WasmAPI.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LocalTerra = void 0;\nvar LCDClient_1 = require(\"./lcd/LCDClient\");\nvar MnemonicKey_1 = require(\"../key/MnemonicKey\");\nvar LOCALTERRA_MNEMONICS = {\n validator: 'satisfy adjust timber high purchase tuition stool faith fine install that you unaware feed domain license impose boss human eager hat rent enjoy dawn',\n test1: 'notice oak worry limit wrap speak medal online prefer cluster roof addict wrist behave treat actual wasp year salad speed social layer crew genius',\n test2: 'quality vacuum heart guard buzz spike sight swarm shove special gym robust assume sudden deposit grid alcohol choice devote leader tilt noodle tide penalty',\n test3: 'symbol force gallery make bulk round subway violin worry mixture penalty kingdom boring survey tool fringe patrol sausage hard admit remember broken alien absorb',\n test4: 'bounce success option birth apple portion aunt rural episode solution hockey pencil lend session cause hedgehog slender journey system canvas decorate razor catch empty',\n test5: 'second render cat sing soup reward cluster island bench diet lumber grocery repeat balcony perfect diesel stumble piano distance caught occur example ozone loyal',\n test6: 'spatial forest elevator battle also spoon fun skirt flight initial nasty transfer glory palm drama gossip remove fan joke shove label dune debate quick',\n test7: 'noble width taxi input there patrol clown public spell aunt wish punch moment will misery eight excess arena pen turtle minimum grain vague inmate',\n test8: 'cream sport mango believe inhale text fish rely elegant below earth april wall rug ritual blossom cherry detail length blind digital proof identify ride',\n test9: 'index light average senior silent limit usual local involve delay update rack cause inmate wall render magnet common feature laundry exact casual resource hundred',\n test10: 'prefer forget visit mistake mixture feel eyebrow autumn shop pair address airport diesel street pass vague innocent poem method awful require hurry unhappy shoulder',\n};\nvar LocalTerra = /** @class */ (function (_super) {\n __extends(LocalTerra, _super);\n function LocalTerra() {\n var _this = _super.call(this, {\n URL: 'http://localhost:1317',\n chainID: 'localterra',\n }) || this;\n _this.wallets = {\n validator: _this.wallet(new MnemonicKey_1.MnemonicKey({ mnemonic: LOCALTERRA_MNEMONICS.validator })),\n test1: _this.wallet(new MnemonicKey_1.MnemonicKey({ mnemonic: LOCALTERRA_MNEMONICS.test1 })),\n test2: _this.wallet(new MnemonicKey_1.MnemonicKey({ mnemonic: LOCALTERRA_MNEMONICS.test2 })),\n test3: _this.wallet(new MnemonicKey_1.MnemonicKey({ mnemonic: LOCALTERRA_MNEMONICS.test3 })),\n test4: _this.wallet(new MnemonicKey_1.MnemonicKey({ mnemonic: LOCALTERRA_MNEMONICS.test4 })),\n test5: _this.wallet(new MnemonicKey_1.MnemonicKey({ mnemonic: LOCALTERRA_MNEMONICS.test5 })),\n test6: _this.wallet(new MnemonicKey_1.MnemonicKey({ mnemonic: LOCALTERRA_MNEMONICS.test6 })),\n test7: _this.wallet(new MnemonicKey_1.MnemonicKey({ mnemonic: LOCALTERRA_MNEMONICS.test7 })),\n test8: _this.wallet(new MnemonicKey_1.MnemonicKey({ mnemonic: LOCALTERRA_MNEMONICS.test8 })),\n test9: _this.wallet(new MnemonicKey_1.MnemonicKey({ mnemonic: LOCALTERRA_MNEMONICS.test9 })),\n test10: _this.wallet(new MnemonicKey_1.MnemonicKey({ mnemonic: LOCALTERRA_MNEMONICS.test10 })),\n };\n return _this;\n }\n return LocalTerra;\n}(LCDClient_1.LCDClient));\nexports.LocalTerra = LocalTerra;\n//# sourceMappingURL=LocalTerra.js.map","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Extension = void 0;\n/**\n * Extension class is for communicating between page and extension\n */\nvar Extension = /** @class */ (function () {\n /**\n * Using singleton pattern, hence every instanciation will return same value\n */\n function Extension() {\n if (Extension.instance) {\n return Extension.instance;\n }\n Extension.instance = this;\n var LocalMessageDuplexStream = require('post-message-stream');\n this.inpageStream = new LocalMessageDuplexStream({\n name: 'station:inpage',\n target: 'station:content',\n });\n }\n Extension.prototype.generateId = function () {\n return Date.now();\n };\n Object.defineProperty(Extension.prototype, \"isAvailable\", {\n /**\n * Indicates the Station Extension is installed and availble (requires extension v1.1 or later)\n */\n get: function () {\n var _a;\n return (_a = window === null || window === void 0 ? void 0 : window.Terra) === null || _a === void 0 ? void 0 : _a.isAvailable;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * low level function for sending message to extension.\n * Do not use this function unless you know what you are doing.\n */\n Extension.prototype.send = function (data) {\n this.inpageStream.write(data);\n };\n /**\n * Listen to events from the Extension.\n * You will receive an event after calling connect, sign, or post.\n * payload structures are described on each function in @return section.\n *\n * @param name name of event\n * @param callback will be called when `name` event emits\n */\n Extension.prototype.on = function (name, callback) {\n this.inpageStream.on('data', function (data) {\n data.name === name && callback(data.payload);\n });\n };\n /**\n * Request to Station Extension for connecting a wallet\n *\n * @return {string} name 'onConnect'\n * @return {AccAddress} payload Terra account address\n */\n Extension.prototype.connect = function () {\n var id = this.generateId();\n this.send({\n id: id,\n type: 'connect',\n });\n return id;\n };\n /**\n * Request to Station Extension for signing tx\n *\n * @return {string} name 'onSign'\n * @return {object} payload\n * @return {number} payload.id identifier\n * @return {string} payload.origin origin address\n * @return {Msg[]} payload.msgs requested msgs\n * @return {boolean} payload.success\n * @return {string} payload.result.public_key Base64 encoded public key\n * @return {string} payload.result.signature Base64 encoded signature\n * @return {number} payload.result.recid Recovery id\n * @return {StdSignMsg.Data} payload.result.stdSignMsgData\n *\n * @example of broadcasting\n *\n * const { signature, public_key, recid, stdSignMsg } = payload.result;\n *\n * const sig = StdSignature.fromData({\n * signature,\n * pub_key: {\n * type: 'tendermint/PubKeySecp256k1',\n * value: public_key,\n * },\n * });\n *\n * const stdSignMsg = StdSignMsg.fromData(payload.result.stdSignMsgData);\n * terra.tx.broadcast(new StdTx(stdSignMsg.msgs, stdSignMsg.fee, [sig], stdSignMsg.memo));\n */\n Extension.prototype.sign = function (options) {\n var _a, _b, _c;\n var id = this.generateId();\n this.send(__assign(__assign({}, options), { id: id, type: 'sign', msgs: options.msgs.map(function (msg) { return msg.toJSON(); }), fee: (_a = options.fee) === null || _a === void 0 ? void 0 : _a.toJSON(), memo: options.memo, gasPrices: (_b = options.gasPrices) === null || _b === void 0 ? void 0 : _b.toString(), gasAdjustment: (_c = options.gasAdjustment) === null || _c === void 0 ? void 0 : _c.toString(), account_number: options.account_number, sequence: options.sequence, lcdClientConfig: options.lcdClientConfig, waitForConfirmation: options.waitForConfirmation, purgeQueue: options.purgeQueue }));\n return id;\n };\n /**\n * Request to Station Extension for sign and post to LCD server\n *\n * @return {string} name 'onPost'\n * @return {object} payload\n * @return {number} payload.id identifier\n * @return {string} payload.origin origin address\n * @return {Msg[]} payload.msgs requested msgs\n * @return {LCDClientConfig} payload.lcdClientConfig\n * requested lcdClientConfig\n * @return {boolean} payload.success\n * @return {number|undefined} payload.result.code\n * error code. undefined with successful tx\n * @return {string} payload.result.raw_log raw log\n * @return {string} payload.result.txhash transaction hash\n */\n Extension.prototype.post = function (options) {\n var _a, _b, _c;\n var id = this.generateId();\n this.send({\n id: id,\n type: 'post',\n msgs: options.msgs.map(function (msg) { return msg.toJSON(); }),\n fee: (_a = options.fee) === null || _a === void 0 ? void 0 : _a.toJSON(),\n memo: options.memo,\n gasPrices: (_b = options.gasPrices) === null || _b === void 0 ? void 0 : _b.toString(),\n gasAdjustment: (_c = options.gasAdjustment) === null || _c === void 0 ? void 0 : _c.toString(),\n account_number: options.account_number,\n sequence: options.sequence,\n lcdClientConfig: options.lcdClientConfig,\n waitForConfirmation: options.waitForConfirmation,\n purgeQueue: options.purgeQueue,\n });\n return id;\n };\n return Extension;\n}());\nexports.Extension = Extension;\n//# sourceMappingURL=index.js.map","const DuplexStream = require('readable-stream').Duplex\nconst inherits = require('util').inherits\n\nmodule.exports = PostMessageStream\n\ninherits(PostMessageStream, DuplexStream)\n\nfunction PostMessageStream (opts) {\n DuplexStream.call(this, {\n objectMode: true,\n })\n\n this._name = opts.name\n this._target = opts.target\n this._targetWindow = opts.targetWindow || window\n this._origin = (opts.targetWindow ? '*' : location.origin)\n\n // initialization flags\n this._init = false\n this._haveSyn = false\n\n window.addEventListener('message', this._onMessage.bind(this), false)\n // send syncorization message\n this._write('SYN', null, noop)\n this.cork()\n}\n\n// private\nPostMessageStream.prototype._onMessage = function (event) {\n var msg = event.data\n\n // validate message\n if (this._origin !== '*' && event.origin !== this._origin) return\n if (event.source !== this._targetWindow) return\n if (typeof msg !== 'object') return\n if (msg.target !== this._name) return\n if (!msg.data) return\n\n if (!this._init) {\n if (msg.data === 'SYN') {\n this._haveSyn = true\n this._write('ACK', null, noop)\n } else if (msg.data === 'ACK') {\n this._init = true\n if (!this._haveSyn) {\n this._write('ACK', null, noop)\n }\n this.uncork()\n }\n } else {\n // forward message\n try {\n this.push(msg.data)\n } catch (err) {\n this.emit('error', err)\n }\n }\n}\n\n// stream plumbing\nPostMessageStream.prototype._read = noop\n\nPostMessageStream.prototype._write = function (data, encoding, cb) {\n var message = {\n target: this._target,\n data: data,\n }\n this._targetWindow.postMessage(message, this._origin)\n cb()\n}\n\n// util\n\nfunction noop () {}\n","var Stream = require('stream');\nif (process.env.READABLE_STREAM === 'disable' && Stream) {\n module.exports = Stream;\n exports = module.exports = Stream.Readable;\n exports.Readable = Stream.Readable;\n exports.Writable = Stream.Writable;\n exports.Duplex = Stream.Duplex;\n exports.Transform = Stream.Transform;\n exports.PassThrough = Stream.PassThrough;\n exports.Stream = Stream;\n} else {\n exports = module.exports = require('./lib/_stream_readable.js');\n exports.Stream = Stream || exports;\n exports.Readable = exports;\n exports.Writable = require('./lib/_stream_writable.js');\n exports.Duplex = require('./lib/_stream_duplex.js');\n exports.Transform = require('./lib/_stream_transform.js');\n exports.PassThrough = require('./lib/_stream_passthrough.js');\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","module.exports = require(\"events\");","'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Buffer = require('safe-buffer').Buffer;\nvar util = require('util');\n\nfunction copyBuffer(src, target, offset) {\n src.copy(target, offset);\n}\n\nmodule.exports = function () {\n function BufferList() {\n _classCallCheck(this, BufferList);\n\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n BufferList.prototype.push = function push(v) {\n var entry = { data: v, next: null };\n if (this.length > 0) this.tail.next = entry;else this.head = entry;\n this.tail = entry;\n ++this.length;\n };\n\n BufferList.prototype.unshift = function unshift(v) {\n var entry = { data: v, next: this.head };\n if (this.length === 0) this.tail = entry;\n this.head = entry;\n ++this.length;\n };\n\n BufferList.prototype.shift = function shift() {\n if (this.length === 0) return;\n var ret = this.head.data;\n if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n --this.length;\n return ret;\n };\n\n BufferList.prototype.clear = function clear() {\n this.head = this.tail = null;\n this.length = 0;\n };\n\n BufferList.prototype.join = function join(s) {\n if (this.length === 0) return '';\n var p = this.head;\n var ret = '' + p.data;\n while (p = p.next) {\n ret += s + p.data;\n }return ret;\n };\n\n BufferList.prototype.concat = function concat(n) {\n if (this.length === 0) return Buffer.alloc(0);\n if (this.length === 1) return this.head.data;\n var ret = Buffer.allocUnsafe(n >>> 0);\n var p = this.head;\n var i = 0;\n while (p) {\n copyBuffer(p.data, ret, i);\n i += p.data.length;\n p = p.next;\n }\n return ret;\n };\n\n return BufferList;\n}();\n\nif (util && util.inspect && util.inspect.custom) {\n module.exports.prototype[util.inspect.custom] = function () {\n var obj = util.inspect({ length: this.length });\n return this.constructor.name + ' ' + obj;\n };\n}","\n/**\n * For Node.js, simply re-export the core `util.deprecate` function.\n */\n\nmodule.exports = require('util').deprecate;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n'use strict';\n\nmodule.exports = PassThrough;\n\nvar Transform = require('./_stream_transform');\n\n/**/\nvar util = Object.create(require('core-util-is'));\nutil.inherits = require('inherits');\n/**/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough)) return new PassThrough(options);\n\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n cb(null, chunk);\n};","import {\n AccAddress,\n Coins,\n MsgExecuteContract,\n MsgInstantiateContract\n} from '@terra-money/terra.js';\nimport { EmptyObject } from '../utils/EmptyObject';\nimport { ContractClient } from './ContractClient';\n\nexport namespace MirrorCollector {\n export interface InitMsg {\n distribution_contract: AccAddress;\n terraswap_factory: AccAddress;\n mirror_token: AccAddress;\n base_denom: string;\n }\n\n export interface HandleConvert {\n convert: {\n asset_token: AccAddress;\n };\n }\n\n export interface HandleSend {\n send: EmptyObject;\n }\n\n export interface QueryConfig {\n config: EmptyObject;\n }\n\n export interface ConfigResponse {\n distribution_contract: AccAddress;\n terraswap_factory: AccAddress;\n mirror_token: AccAddress;\n base_denom: string;\n }\n\n export type HandleMsg = HandleConvert | HandleSend;\n export type QueryMsg = QueryConfig;\n}\n\nexport class MirrorCollector extends ContractClient {\n public init(\n init_msg: MirrorCollector.InitMsg,\n migratable: boolean\n ): MsgInstantiateContract {\n return this.createInstantiateMsg(init_msg, {}, migratable);\n }\n\n public convert(asset_token: AccAddress): MsgExecuteContract {\n return this.createExecuteMsg({\n convert: {\n asset_token\n }\n });\n }\n\n public send(): MsgExecuteContract {\n return this.createExecuteMsg({\n send: {}\n });\n }\n\n public async getConfig(): Promise {\n return this.query({\n config: {}\n });\n }\n\n // Typed overloads\n\n protected async query(query_msg: MirrorCollector.QueryMsg): Promise {\n return super.query(query_msg);\n }\n\n protected createExecuteMsg(\n executeMsg: MirrorCollector.HandleMsg,\n coins: Coins.Input = {}\n ): MsgExecuteContract {\n return super.createExecuteMsg(executeMsg, coins);\n }\n}\n","import {\n AccAddress,\n Coins,\n Dec,\n Numeric,\n MsgExecuteContract,\n MsgInstantiateContract\n} from '@terra-money/terra.js';\nimport { EmptyObject } from '../utils/EmptyObject';\nimport { ContractClient } from './ContractClient';\n\nexport namespace MirrorFactory {\n export interface InitMsg {\n mint_per_block: string;\n token_code_id: number;\n base_denom: string;\n }\n\n export interface Params {\n weight: string;\n lp_commission: string;\n owner_commission: string;\n auction_discount: string;\n min_collateral_ratio: string;\n }\n\n export interface HandlePostInitialize {\n post_initialize: {\n owner: AccAddress;\n terraswap_factory: AccAddress;\n mirror_token: AccAddress;\n staking_contract: AccAddress;\n oracle_contract: AccAddress;\n mint_contract: AccAddress;\n commission_collector: AccAddress;\n };\n }\n\n export interface HandleUpdateConfig {\n update_config: {\n owner?: AccAddress;\n mint_per_block?: string;\n token_code_id?: number;\n };\n }\n\n export interface HandleUpdateWeight {\n update_weight: {\n asset_token: AccAddress;\n weight: string;\n };\n }\n\n export interface HandleTerraswapCreationHook {\n terraswap_creation_hook: {\n asset_token: AccAddress;\n };\n }\n\n export interface HandleWhitelist {\n whitelist: {\n name: string;\n symbol: string;\n oracle_feeder: AccAddress;\n params: Params;\n };\n }\n\n export interface HandlePassCommand {\n pass_command: {\n contract_addr: AccAddress;\n msg: string;\n };\n }\n\n export interface HandleMint {\n mint: {\n asset_token: AccAddress;\n };\n }\n\n export interface HandleMigrateAsset {\n migrate_asset: {\n name: string;\n symbol: string;\n from_token: AccAddress;\n end_price: string;\n };\n }\n\n export interface QueryConfig {\n config: EmptyObject;\n }\n\n export interface QueryDistributionInfo {\n distribution_info: { asset_token: AccAddress };\n }\n\n export interface ConfigResponse {\n owner: AccAddress;\n mirror_token: AccAddress;\n mint_contract: AccAddress;\n staking_contract: AccAddress;\n commission_collector: AccAddress;\n oracle_contract: AccAddress;\n terraswap_factory: AccAddress;\n mint_per_block: string;\n token_code_id: number;\n base_denom: string;\n }\n\n export interface DistributionInfoResponse {\n weight: string;\n last_height: number;\n }\n\n export type HandleMsg =\n | HandlePostInitialize\n | HandleUpdateWeight\n | HandleUpdateConfig\n | HandleTerraswapCreationHook\n | HandleWhitelist\n | HandlePassCommand\n | HandleMint\n | HandleMigrateAsset;\n\n export type QueryMsg = QueryConfig | QueryDistributionInfo;\n}\n\nexport class MirrorFactory extends ContractClient {\n public init(\n init_msg: MirrorFactory.InitMsg,\n migratable: boolean\n ): MsgInstantiateContract {\n return this.createInstantiateMsg(init_msg, {}, migratable);\n }\n\n public postInitialize(\n owner: AccAddress,\n terraswap_factory: AccAddress,\n mirror_token: AccAddress,\n staking_contract: AccAddress,\n oracle_contract: AccAddress,\n mint_contract: AccAddress,\n commission_collector: AccAddress\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n post_initialize: {\n owner,\n terraswap_factory,\n mirror_token,\n staking_contract,\n oracle_contract,\n mint_contract,\n commission_collector\n }\n });\n }\n\n public updateWeight(\n asset_token: AccAddress,\n weight: Dec\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n update_weight: {\n asset_token,\n weight: weight.toFixed()\n }\n });\n }\n\n public updateConfig(\n config: MirrorFactory.HandleUpdateConfig['update_config']\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n update_config: config\n });\n }\n\n public terraswapCreationHook(asset_token: AccAddress): MsgExecuteContract {\n return this.createExecuteMsg({\n terraswap_creation_hook: {\n asset_token\n }\n });\n }\n\n public whitelist(\n name: string,\n symbol: string,\n oracle_feeder: AccAddress,\n params: {\n weight: Numeric.Input;\n lp_commission: Numeric.Input;\n owner_commission: Numeric.Input;\n auction_discount: Numeric.Input;\n min_collateral_ratio: Numeric.Input;\n }\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n whitelist: {\n name,\n symbol,\n oracle_feeder,\n params: {\n weight: new Dec(params.weight).toFixed(),\n lp_commission: new Dec(params.lp_commission).toFixed(),\n owner_commission: new Dec(params.owner_commission).toFixed(),\n auction_discount: new Dec(params.auction_discount).toFixed(),\n min_collateral_ratio: new Dec(params.min_collateral_ratio).toFixed()\n }\n }\n });\n }\n\n public migrateAsset(\n name: string,\n symbol: string,\n from_token: AccAddress,\n end_price: Numeric.Input\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n migrate_asset: {\n name,\n symbol,\n from_token,\n end_price: new Dec(end_price).toString()\n }\n });\n }\n\n public passCommand(contract_addr: AccAddress, msg: any): MsgExecuteContract {\n return this.createExecuteMsg({\n pass_command: {\n contract_addr,\n msg: Buffer.from(JSON.stringify(msg)).toString('base64')\n }\n });\n }\n\n public mint(asset_token: AccAddress): MsgExecuteContract {\n return this.createExecuteMsg({\n mint: {\n asset_token\n }\n });\n }\n\n public async getConfig(): Promise {\n return this.query({\n config: {}\n });\n }\n\n public async getDistributionInfo(\n asset_token: AccAddress\n ): Promise {\n return this.query({\n distribution_info: { asset_token }\n });\n }\n\n // Typed overloads\n\n protected async query(query_msg: MirrorFactory.QueryMsg): Promise {\n return super.query(query_msg);\n }\n\n protected createExecuteMsg(\n executeMsg: MirrorFactory.HandleMsg,\n coins: Coins.Input = {}\n ): MsgExecuteContract {\n return super.createExecuteMsg(executeMsg, coins);\n }\n}\n","import {\n AccAddress,\n Coins,\n Numeric,\n MsgExecuteContract,\n MsgInstantiateContract,\n Int\n} from '@terra-money/terra.js';\nimport { EmptyObject } from '../utils/EmptyObject';\nimport { ContractClient } from './ContractClient';\nimport { TerraswapToken } from './TerraswapToken';\n\nexport namespace MirrorGov {\n export interface InitMsg {\n mirror_token: AccAddress;\n quorum: string;\n threshold: string;\n voting_period: number;\n effective_delay: number;\n proposal_deposit: string;\n }\n\n export interface HandleUpdateConfig {\n update_config: {\n owner?: AccAddress;\n quorum?: string;\n threshold?: string;\n voting_period?: number;\n effective_delay?: number;\n proposal_deposit?: string;\n };\n }\n\n export type VoteOption = 'yes' | 'no';\n export interface HandleCastVote {\n cast_vote: {\n poll_id: number;\n vote: VoteOption;\n amount: string;\n };\n }\n\n export interface HandleWithdrawVotingTokens {\n withdraw_voting_tokens: {\n amount?: string;\n };\n }\n\n export interface HandleEndPoll {\n end_poll: {\n poll_id: number;\n };\n }\n\n export interface HandleExecutePoll {\n execute_poll: {\n poll_id: number;\n };\n }\n\n export interface HookStakeVotingTokens {\n stake_voting_tokens: EmptyObject;\n }\n\n export interface ExecuteMsg {\n contract: AccAddress;\n msg: string;\n }\n\n export interface HookCreatePoll {\n create_poll: {\n title: string;\n description: string;\n link?: string;\n execute_msg?: ExecuteMsg;\n };\n }\n\n export interface QueryConfig {\n config: EmptyObject;\n }\n\n export interface QueryState {\n state: EmptyObject;\n }\n\n export interface QueryStaker {\n staker: {\n address: AccAddress;\n };\n }\n\n export interface QueryPoll {\n poll: {\n poll_id: number;\n };\n }\n\n export type PollStatus = 'in_progress' | 'passed' | 'rejected' | 'executed';\n\n export interface QueryPolls {\n polls: {\n filter?: PollStatus;\n start_after?: number;\n limit?: number;\n };\n }\n\n export interface QueryVoters {\n voters: {\n poll_id: number;\n start_after?: AccAddress;\n limit?: number;\n };\n }\n\n export interface ConfigResponse {\n owner: AccAddress;\n mirror_token: AccAddress;\n quorum: string;\n threshold: string;\n voting_period: number;\n effective_delay: number;\n proposal_deposit: string;\n }\n\n export interface StateResponse {\n poll_count: number;\n total_share: string;\n total_deposit: string;\n }\n\n export interface PollResponse {\n id: number;\n creator: AccAddress;\n status: PollStatus;\n end_height: number;\n title: string;\n description: string;\n link?: string;\n deposit_amount: string;\n execute_data?: ExecuteMsg;\n yes_votes: string;\n no_votes: string;\n }\n\n export interface PollsResponse {\n polls: Array;\n }\n\n export interface PollCountResponse {\n poll_count: number;\n }\n\n export interface VoterInfo {\n vote: VoteOption;\n share: string;\n }\n\n export interface StakerResponse {\n balance: string;\n share: string;\n locked_share: Array<[number, VoterInfo]>;\n }\n\n export interface VotersResponseItem {\n voter: AccAddress;\n vote: VoteOption;\n share: string;\n balance: string;\n }\n\n export interface VotersResponse {\n voters: Array;\n }\n\n export type HandleMsg =\n | HandleUpdateConfig\n | HandleCastVote\n | HandleWithdrawVotingTokens\n | HandleEndPoll\n | HandleExecutePoll;\n\n export type HookMsg = HookStakeVotingTokens | HookCreatePoll;\n\n export type QueryMsg =\n | QueryConfig\n | QueryState\n | QueryStaker\n | QueryPoll\n | QueryPolls\n | QueryVoters;\n}\n\nfunction createHookMsg(msg: MirrorGov.HookMsg): string {\n return Buffer.from(JSON.stringify(msg)).toString('base64');\n}\n\nexport class MirrorGov extends ContractClient {\n public init(\n init_msg: MirrorGov.InitMsg,\n migratable: boolean\n ): MsgInstantiateContract {\n return this.createInstantiateMsg(init_msg, {}, migratable);\n }\n\n public updateConfig(\n config: MirrorGov.HandleUpdateConfig['update_config']\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n update_config: config\n });\n }\n\n public castVote(\n poll_id: number,\n vote: MirrorGov.VoteOption,\n amount: Numeric.Input\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n cast_vote: {\n poll_id,\n vote,\n amount: new Int(amount).toString()\n }\n });\n }\n\n public withdrawVotingTokens(amount?: Numeric.Input): MsgExecuteContract {\n return this.createExecuteMsg({\n withdraw_voting_tokens: {\n amount: amount ? new Int(amount).toString() : undefined\n }\n });\n }\n\n public endPoll(poll_id: number): MsgExecuteContract {\n return this.createExecuteMsg({\n end_poll: {\n poll_id\n }\n });\n }\n\n public executePoll(poll_id: number): MsgExecuteContract {\n return this.createExecuteMsg({\n execute_poll: {\n poll_id\n }\n });\n }\n\n public stakeVotingTokens(\n terraswap_token: TerraswapToken,\n amount: Numeric.Input\n ): MsgExecuteContract {\n if (!this.contractAddress) {\n throw new Error(\n 'contractAddress not provided - unable to execute message'\n );\n }\n\n return terraswap_token.send(\n this.contractAddress,\n amount,\n createHookMsg({\n stake_voting_tokens: {}\n })\n );\n }\n\n public createPoll(\n terraswap_token: TerraswapToken,\n deposit_amount: Numeric.Input,\n title: string,\n description: string,\n link?: string,\n execute_msg?: MirrorGov.ExecuteMsg\n ): MsgExecuteContract {\n if (!this.contractAddress) {\n throw new Error(\n 'contractAddress not provided - unable to execute message'\n );\n }\n\n return terraswap_token.send(\n this.contractAddress,\n deposit_amount,\n createHookMsg({\n create_poll: {\n title,\n description,\n link,\n execute_msg\n }\n })\n );\n }\n\n public async getConfig(): Promise {\n return this.query({\n config: {}\n });\n }\n\n public async getState(): Promise {\n return this.query({\n state: {}\n });\n }\n\n public async getStaker(\n address: AccAddress\n ): Promise {\n return this.query({\n staker: {\n address\n }\n });\n }\n\n public async getPoll(poll_id: number): Promise {\n return this.query({\n poll: {\n poll_id\n }\n });\n }\n\n public async getPolls(\n filter?: MirrorGov.PollStatus,\n start_after?: number,\n limit?: number\n ): Promise {\n return this.query({\n polls: {\n filter,\n start_after,\n limit\n }\n });\n }\n\n public async getVoters(\n poll_id: number,\n start_after?: AccAddress,\n limit?: number\n ): Promise {\n return this.query({\n voters: {\n poll_id,\n start_after,\n limit\n }\n });\n }\n\n protected async query(query_msg: MirrorGov.QueryMsg): Promise {\n return super.query(query_msg);\n }\n\n protected createExecuteMsg(\n execute_msg: MirrorGov.HandleMsg,\n coins: Coins.Input = {}\n ): MsgExecuteContract {\n return super.createExecuteMsg(execute_msg, coins);\n }\n}\n","import {\n AccAddress,\n MsgExecuteContract,\n Coins,\n Numeric,\n Int,\n MsgInstantiateContract,\n Dec,\n Coin\n} from '@terra-money/terra.js';\nimport { EmptyObject } from '../utils/EmptyObject';\nimport { AssetInfo, Asset, isNativeToken } from '../utils/Asset';\nimport { ContractClient } from './ContractClient';\nimport { TerraswapToken } from './TerraswapToken';\n\nexport namespace MirrorMint {\n export interface InitMsg {\n owner: AccAddress;\n oracle: AccAddress;\n base_asset_info: AssetInfo;\n token_code_id: number;\n }\n\n export interface HandleUpdateConfig {\n update_config: {\n owner?: AccAddress;\n token_code_id?: number;\n };\n }\n\n export interface HandleUpdateAsset {\n udpate_asset: {\n asset_token: AccAddress;\n auction_discount?: string;\n min_collateral_ratio?: string;\n };\n }\n\n export interface HandleRegisterAsset {\n register_asset: {\n asset_token: AccAddress;\n auction_discount: string;\n min_collateral_ratio: string;\n };\n }\n\n export interface HandleRegisterMigration {\n register_migration: {\n asset_token: AccAddress;\n end_price: string;\n };\n }\n\n export interface HandleOpenPosition {\n open_position: {\n collateral: Asset;\n asset_info: AssetInfo;\n collateral_ratio: string;\n };\n }\n\n export interface HandleDeposit {\n deposit: {\n position_idx: string;\n collateral: Asset;\n };\n }\n\n export interface HandleWithdraw {\n withdraw: {\n position_idx: string;\n collateral: Asset;\n };\n }\n\n export interface HandleMint {\n mint: {\n position_idx: string;\n asset: Asset;\n };\n }\n\n export interface HookOpenPosition {\n open_position: {\n asset_info: AssetInfo;\n collateral_ratio: string;\n };\n }\n\n export interface HookDeposit {\n deposit: {\n position_idx: string;\n };\n }\n\n export interface HookBurn {\n burn: {\n position_idx: string;\n };\n }\n\n export interface HookAuction {\n auction: {\n position_idx: string;\n };\n }\n\n export interface QueryConfig {\n config: EmptyObject;\n }\n\n export interface QueryAssetConfig {\n asset_config: {\n asset_token: AccAddress;\n };\n }\n\n export interface QueryPosition {\n position: {\n position_idx: string;\n };\n }\n\n export interface QueryPositions {\n positions: {\n owner_addr: AccAddress;\n start_after?: string;\n limit?: number;\n };\n }\n\n export interface ConfigResponse {\n owner: AccAddress;\n oracle: AccAddress;\n base_asset_info: AssetInfo;\n token_code_id: number;\n }\n\n export interface AssetConfigResponse {\n token: AccAddress;\n auction_discount: string;\n min_collateral_ratio: string;\n end_price?: string;\n }\n\n export interface PositionResponse {\n idx: string;\n owner: AccAddress;\n collateral: Asset;\n asset: Asset;\n }\n\n export interface PositionsResponse {\n positions: Array;\n }\n\n export type HandleMsg =\n | HandleUpdateConfig\n | HandleUpdateAsset\n | HandleRegisterAsset\n | HandleRegisterMigration\n | HandleOpenPosition\n | HandleDeposit\n | HandleWithdraw\n | HandleMint;\n\n export type HookMsg = HookAuction | HookBurn | HookDeposit | HookOpenPosition;\n\n export type QueryMsg =\n | QueryConfig\n | QueryAssetConfig\n | QueryPosition\n | QueryPositions;\n}\n\nfunction createHookMsg(msg: MirrorMint.HookMsg): string {\n return Buffer.from(JSON.stringify(msg)).toString('base64');\n}\n\nexport class MirrorMint extends ContractClient {\n public init(\n init_msg: MirrorMint.InitMsg,\n migratable: boolean\n ): MsgInstantiateContract {\n return this.createInstantiateMsg(init_msg, {}, migratable);\n }\n\n public updateConfig(\n config: MirrorMint.HandleUpdateConfig['update_config']\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n update_config: config\n });\n }\n\n public updateAsset(\n asset_token: AccAddress,\n auction_discount?: Numeric.Input,\n min_collateral_ratio?: Numeric.Input\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n udpate_asset: {\n asset_token,\n auction_discount: auction_discount\n ? new Dec(auction_discount).toFixed()\n : undefined,\n min_collateral_ratio: min_collateral_ratio\n ? new Dec(min_collateral_ratio).toFixed()\n : undefined\n }\n });\n }\n\n public registerAsset(\n asset_token: AccAddress,\n auction_discount: Numeric.Input,\n min_collateral_ratio: Numeric.Input\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n register_asset: {\n asset_token,\n auction_discount: new Dec(auction_discount).toFixed(),\n min_collateral_ratio: new Dec(min_collateral_ratio).toFixed()\n }\n });\n }\n\n public registerMigration(\n asset_token: AccAddress,\n end_price: Numeric.Input\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n register_migration: {\n asset_token,\n end_price: new Dec(end_price).toFixed()\n }\n });\n }\n\n public openPosition(\n collateral: Asset,\n asset_info: AssetInfo,\n collateral_ratio: Numeric.Input,\n collateral_token?: TerraswapToken\n ): MsgExecuteContract {\n if (!collateral_token) {\n if (!isNativeToken(collateral.info)) {\n throw new Error(\n 'CollateralToken must be provided - unable to open position'\n );\n }\n\n return this.createExecuteMsg(\n {\n open_position: {\n collateral,\n asset_info,\n collateral_ratio: new Dec(collateral_ratio).toFixed()\n }\n },\n [new Coin(collateral.info.native_token.denom, collateral.amount)]\n );\n }\n\n if (!this.contractAddress) {\n throw new Error(\n 'contractAddress not provided - unable to execute message'\n );\n }\n\n return collateral_token.send.call(\n this,\n this.contractAddress,\n collateral.amount,\n createHookMsg({\n open_position: {\n asset_info,\n collateral_ratio: new Dec(collateral_ratio).toFixed()\n }\n })\n );\n }\n\n public deposit(\n position_idx: Numeric.Input,\n collateral: Asset,\n collateral_token?: TerraswapToken\n ): MsgExecuteContract {\n if (!collateral_token) {\n if (!isNativeToken(collateral.info)) {\n throw new Error(\n 'CollateralToken must be provided - unable to open position'\n );\n }\n\n return this.createExecuteMsg(\n {\n deposit: {\n position_idx: new Int(position_idx).toString(),\n collateral\n }\n },\n [new Coin(collateral.info.native_token.denom, collateral.amount)]\n );\n }\n\n if (!this.contractAddress) {\n throw new Error(\n 'contractAddress not provided - unable to execute message'\n );\n }\n\n return collateral_token.send.call(\n this,\n this.contractAddress,\n collateral.amount,\n createHookMsg({\n deposit: {\n position_idx: new Int(position_idx).toString()\n }\n })\n );\n }\n\n public withdraw(\n position_idx: Numeric.Input,\n collateral: Asset\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n withdraw: {\n position_idx: new Int(position_idx).toString(),\n collateral\n }\n });\n }\n\n public mint(position_idx: Numeric.Input, asset: Asset): MsgExecuteContract {\n return this.createExecuteMsg({\n mint: {\n position_idx: new Int(position_idx).toString(),\n asset\n }\n });\n }\n\n public burn(\n position_idx: Numeric.Input,\n asset: Asset,\n asset_token: TerraswapToken\n ): MsgExecuteContract {\n if (!this.contractAddress) {\n throw new Error(\n 'contractAddress not provided - unable to execute message'\n );\n }\n\n return asset_token.send.call(\n this,\n this.contractAddress,\n asset.amount,\n createHookMsg({\n burn: {\n position_idx: new Int(position_idx).toString()\n }\n })\n );\n }\n\n public auction(\n position_idx: Numeric.Input,\n asset: Asset,\n asset_token: TerraswapToken\n ): MsgExecuteContract {\n if (!this.contractAddress) {\n throw new Error(\n 'contractAddress not provided - unable to execute message'\n );\n }\n\n return asset_token.send(\n this.contractAddress,\n asset.amount,\n createHookMsg({\n auction: {\n position_idx: new Int(position_idx).toString()\n }\n })\n );\n }\n\n public async getConfig(): Promise {\n return this.query({\n config: {}\n });\n }\n\n public async getAssetConfig(\n asset_token: AccAddress\n ): Promise {\n return this.query({\n asset_config: {\n asset_token\n }\n });\n }\n\n public async getPosition(\n position_idx: Numeric.Input\n ): Promise {\n return this.query({\n position: {\n position_idx: new Int(position_idx).toString()\n }\n });\n }\n\n public async getPositions(\n owner_addr?: AccAddress,\n start_after?: Numeric.Input,\n limit?: number\n ): Promise {\n return this.query({\n positions: {\n owner_addr: owner_addr ? owner_addr : this.wallet.key.accAddress,\n start_after: start_after ? new Int(start_after).toString() : undefined,\n limit\n }\n });\n }\n\n // Typed overloads\n\n protected async query(query_msg: MirrorMint.QueryMsg): Promise {\n return super.query(query_msg);\n }\n\n protected createExecuteMsg(\n execute_msg: MirrorMint.HandleMsg,\n coins: Coins.Input = {}\n ): MsgExecuteContract {\n return super.createExecuteMsg(execute_msg, coins);\n }\n}\n","import {\n AccAddress,\n Coins,\n Dec,\n Numeric,\n MsgInstantiateContract,\n MsgExecuteContract\n} from '@terra-money/terra.js';\nimport { AssetInfo } from '../utils/Asset';\nimport { ContractClient } from './ContractClient';\nimport { EmptyObject } from '../utils/EmptyObject';\n\nexport namespace MirrorOracle {\n export interface InitMsg {\n owner: AccAddress;\n base_asset_info: AssetInfo;\n }\n\n export interface HandleUpdateConfig {\n update_config: {\n owner?: AccAddress;\n };\n }\n\n export interface HandleRegisterAsset {\n register_asset: {\n asset_token: AccAddress;\n feeder: AccAddress;\n };\n }\n\n export interface PriceInfo {\n asset_token: AccAddress;\n price: string;\n }\n\n export interface HandleFeedPrice {\n feed_price: {\n price_infos: Array;\n };\n }\n\n export interface QueryConfig {\n config: EmptyObject;\n }\n\n export interface QueryAsset {\n asset: { asset_token: AccAddress };\n }\n\n export interface QueryPrice {\n price: { asset_token: AccAddress };\n }\n\n export interface QueryPrices {\n prices: EmptyObject;\n }\n\n export interface ConfigResponse {\n owner: AccAddress;\n base_asset_info: AssetInfo;\n }\n\n export interface AssetResponse {\n asset_token: AccAddress;\n feeder: AccAddress;\n }\n\n export interface PriceResponse {\n price: string;\n last_update_time: number;\n asset_token: AccAddress;\n }\n\n export interface PricesResponse {\n prices: Array;\n }\n\n export type HandleMsg =\n | HandleUpdateConfig\n | HandleRegisterAsset\n | HandleFeedPrice;\n\n export type QueryMsg = QueryConfig | QueryAsset | QueryPrice | QueryPrices;\n}\n\nexport class MirrorOracle extends ContractClient {\n public init(\n init_msg: MirrorOracle.InitMsg,\n migratable: boolean\n ): MsgInstantiateContract {\n return this.createInstantiateMsg(init_msg, {}, migratable);\n }\n\n public updateConfig(\n config: MirrorOracle.HandleUpdateConfig['update_config']\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n update_config: config\n });\n }\n\n public registerAsset(\n asset_token: AccAddress,\n feeder: AccAddress\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n register_asset: {\n asset_token,\n feeder\n }\n });\n }\n\n public feedPrice(\n price_infos: Array<{\n asset_token: AccAddress;\n price: Numeric.Input;\n }>\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n feed_price: {\n price_infos: price_infos.map((pi) => ({\n asset_token: pi.asset_token,\n price: new Dec(pi.price).toFixed()\n }))\n }\n });\n }\n\n public async getConfig(): Promise {\n return this.query({\n config: {}\n });\n }\n\n public async getAsset(\n asset_token: AccAddress\n ): Promise {\n return this.query({\n asset: { asset_token }\n });\n }\n\n public async getPrice(\n asset_token: AccAddress\n ): Promise {\n return this.query({\n price: { asset_token }\n });\n }\n\n public async getPrices(): Promise {\n return this.query({\n prices: {}\n });\n }\n\n // Typed overloads\n\n protected async query(query_msg: MirrorOracle.QueryMsg): Promise {\n return super.query(query_msg);\n }\n\n protected createExecuteMsg(\n execute_msg: MirrorOracle.HandleMsg,\n coins: Coins.Input = {}\n ): MsgExecuteContract {\n return super.createExecuteMsg(execute_msg, coins);\n }\n}\n","/* eslint-disable camelcase */\nimport {\n AccAddress,\n Coins,\n Numeric,\n MsgInstantiateContract,\n MsgExecuteContract,\n Int\n} from '@terra-money/terra.js';\nimport { ContractClient } from './ContractClient';\nimport { EmptyObject } from '../utils/EmptyObject';\nimport { TerraswapToken } from './TerraswapToken';\n\nexport namespace MirrorStaking {\n export interface InitMsg {\n owner: AccAddress;\n mirror_token: AccAddress;\n }\n\n export interface HandleUpdateConfig {\n update_config: {\n asset_token?: AccAddress;\n staking_token?: AccAddress;\n };\n }\n\n export interface HandleRegisterAsset {\n register_asset: {\n asset_token: AccAddress;\n staking_token: AccAddress;\n };\n }\n\n export interface HandleUnbond {\n unbond: {\n asset_token: AccAddress;\n amount: string;\n };\n }\n\n export interface HandleWithdraw {\n withdraw: {\n asset_token?: AccAddress;\n };\n }\n\n export interface HookBond {\n bond: {\n asset_token: AccAddress;\n };\n }\n\n export interface HookDepositReward {\n deposit_reward: {\n asset_token: AccAddress;\n };\n }\n\n export interface QueryConfig {\n config: EmptyObject;\n }\n\n export interface QueryPoolInfo {\n pool_info: {\n asset_token: AccAddress;\n };\n }\n\n export interface QueryRewardInfo {\n reward_info: {\n staker: AccAddress;\n asset_token?: AccAddress;\n };\n }\n\n export interface ConfigResponse {\n owner: AccAddress;\n mirror_token: AccAddress;\n }\n\n export interface PoolInfoResponse {\n asset_token: AccAddress;\n staking_token: AccAddress;\n total_bond_amount: string;\n reward_index: string;\n }\n\n export interface RewardInfoResponseItem {\n asset_token: AccAddress;\n index: string;\n bond_amount: string;\n pending_reward: string;\n }\n\n export interface RewardInfoResponse {\n staker: AccAddress;\n reward_infos: Array;\n }\n\n export type HandleMsg =\n | HandleUpdateConfig\n | HandleRegisterAsset\n | HandleUnbond\n | HandleWithdraw;\n\n export type HookMsg = HookBond | HookDepositReward;\n\n export type QueryMsg = QueryConfig | QueryPoolInfo | QueryRewardInfo;\n}\n\nfunction createHookMsg(msg: MirrorStaking.HookMsg): string {\n return Buffer.from(JSON.stringify(msg)).toString('base64');\n}\n\nexport class MirrorStaking extends ContractClient {\n public init(\n init_msg: MirrorStaking.InitMsg,\n migratable: boolean\n ): MsgInstantiateContract {\n return this.createInstantiateMsg(init_msg, {}, migratable);\n }\n\n public updateConfig(\n config: MirrorStaking.HandleUpdateConfig['update_config']\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n update_config: config\n });\n }\n\n public registerAsset(\n asset_token: AccAddress,\n staking_token: AccAddress\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n register_asset: {\n asset_token,\n staking_token\n }\n });\n }\n\n public unbond(\n asset_token: AccAddress,\n amount: Numeric.Input\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n unbond: {\n asset_token,\n amount: new Int(amount).toString()\n }\n });\n }\n\n public withdraw(asset_token?: AccAddress): MsgExecuteContract {\n return this.createExecuteMsg({\n withdraw: {\n asset_token\n }\n });\n }\n\n public bond(\n asset_token: AccAddress,\n amount: Numeric.Input,\n lp_token: TerraswapToken\n ): MsgExecuteContract {\n if (!this.contractAddress) {\n throw new Error(\n 'contractAddress not provided - unable to execute message'\n );\n }\n\n if (this.wallet.key.accAddress !== lp_token.wallet.key.accAddress) {\n throw new Error('two contract instance is not from the same key');\n }\n\n return lp_token.send(\n this.contractAddress,\n amount,\n createHookMsg({\n bond: {\n asset_token\n }\n })\n );\n }\n\n public depositReward(\n asset_token: AccAddress,\n amount: Numeric.Input,\n mirror_token: TerraswapToken\n ): MsgExecuteContract {\n if (!this.contractAddress) {\n throw new Error(\n 'contractAddress not provided - unable to execute message'\n );\n }\n\n return mirror_token.send(\n this.contractAddress,\n amount,\n createHookMsg({\n deposit_reward: {\n asset_token\n }\n })\n );\n }\n\n public async getConfig(): Promise {\n return this.query({\n config: {}\n });\n }\n\n public async getPoolInfo(\n asset_token: AccAddress\n ): Promise {\n return this.query({\n pool_info: {\n asset_token\n }\n });\n }\n\n public async getRewardInfo(\n staker: AccAddress,\n asset_token?: AccAddress\n ): Promise {\n return this.query({\n reward_info: {\n staker,\n asset_token\n }\n });\n }\n\n protected async query(query_msg: MirrorStaking.QueryMsg): Promise {\n return super.query(query_msg);\n }\n\n protected createExecuteMsg(\n execute_msg: MirrorStaking.HandleMsg,\n coins: Coins.Input = {}\n ): MsgExecuteContract {\n return super.createExecuteMsg(execute_msg, coins);\n }\n}\n","import {\n AccAddress,\n MsgExecuteContract,\n Coins,\n MsgInstantiateContract,\n Numeric,\n Dec\n} from '@terra-money/terra.js';\nimport { EmptyObject } from '../utils/EmptyObject';\nimport { AssetInfo } from '../utils/Asset';\nimport { ContractClient } from './ContractClient';\n\nexport namespace TerraswapFactory {\n export interface InitHook {\n msg: string;\n contract_addr: AccAddress;\n }\n\n export interface InitMsg {\n pair_code_id: number;\n token_code_id: number;\n init_hook?: InitHook;\n }\n\n export interface HandleUpdateConfig {\n update_config: {\n owner?: AccAddress;\n token_code_id?: number;\n pair_code_id?: number;\n };\n }\n\n export interface HandleCreatePair {\n create_pair: {\n pair_owner: AccAddress;\n commission_collector: AccAddress;\n lp_commission: string;\n owner_commission: string;\n asset_infos: [AssetInfo, AssetInfo];\n init_hook?: InitHook;\n };\n }\n\n export interface QueryConfig {\n config: EmptyObject;\n }\n\n export interface QueryPair {\n pair: {\n asset_infos: [AssetInfo, AssetInfo];\n };\n }\n\n export interface ConfigResponse {\n owner: AccAddress;\n pair_code_id: number;\n token_code_id: number;\n }\n\n export interface PairResponse {\n owner: AccAddress;\n contract_addr: AccAddress;\n asset_infos: [AssetInfo, AssetInfo];\n }\n\n export type HandleMsg = HandleUpdateConfig | HandleCreatePair;\n\n export type QueryMsg = QueryConfig | QueryPair;\n}\n\nexport class TerraswapFactory extends ContractClient {\n public init(\n init_msg: TerraswapFactory.InitMsg,\n migratable: boolean\n ): MsgInstantiateContract {\n return this.createInstantiateMsg(init_msg, {}, migratable);\n }\n\n public updateConfig(\n config: TerraswapFactory.HandleUpdateConfig['update_config']\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n update_config: config\n });\n }\n\n public createPair(\n pair_owner: AccAddress,\n commission_collector: AccAddress,\n lp_commission: Numeric.Input,\n owner_commission: Numeric.Input,\n asset_infos: [AssetInfo, AssetInfo],\n init_hook?: TerraswapFactory.InitHook\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n create_pair: {\n pair_owner,\n commission_collector,\n lp_commission: new Dec(lp_commission).toString(),\n owner_commission: new Dec(owner_commission).toString(),\n asset_infos,\n init_hook\n }\n });\n }\n\n public async getConfig(): Promise {\n return this.query({\n config: {}\n });\n }\n\n public async getPair(\n asset_infos: [AssetInfo, AssetInfo]\n ): Promise {\n return this.query({\n pair: { asset_infos }\n });\n }\n\n protected async query(query_msg: TerraswapFactory.QueryMsg): Promise {\n return super.query(query_msg);\n }\n\n protected createExecuteMsg(\n execute_msg: TerraswapFactory.HandleMsg,\n coins: Coins.Input = {}\n ): MsgExecuteContract {\n return super.createExecuteMsg(execute_msg, coins);\n }\n}\n","import {\n AccAddress,\n MsgExecuteContract,\n Coins,\n MsgInstantiateContract,\n Coin,\n Numeric,\n Dec\n} from '@terra-money/terra.js';\nimport { EmptyObject } from '../utils/EmptyObject';\nimport { AssetInfo, Asset, isNativeToken } from '../utils/Asset';\nimport { ContractClient } from './ContractClient';\nimport { TerraswapToken } from './TerraswapToken';\n\nexport namespace TerraswapPair {\n export interface InitHook {\n msg: string;\n contract_addr: AccAddress;\n }\n\n export interface InitMsg {\n owner: AccAddress;\n commission_collector: AccAddress;\n asset_infos: [AssetInfo, AssetInfo];\n lp_commission: string;\n owner_commission: string;\n token_code_id: number;\n init_hook?: InitHook;\n }\n\n export interface HandleUpdateConfig {\n update_config: {\n owner?: AccAddress;\n lp_commission?: string;\n owner_commission?: string;\n };\n }\n\n export interface HandleProvideLiquidity {\n provide_liquidity: {\n assets: [Asset, Asset];\n };\n }\n\n export interface HandleSwap {\n swap: {\n offer_asset: Asset;\n belief_price?: string;\n max_spread?: string;\n to?: AccAddress;\n };\n }\n\n export interface HookSwap {\n swap: {\n belief_price?: string;\n max_spread?: string;\n to?: AccAddress;\n };\n }\n\n export interface HookWithdrawLiquidity {\n withdraw_liquidity: EmptyObject;\n }\n\n export interface QueryConfigGeneral {\n config_general: EmptyObject;\n }\n\n export interface QueryConfigAsset {\n config_asset: EmptyObject;\n }\n\n export interface QueryConfigSwap {\n config_swap: EmptyObject;\n }\n\n export interface QueryPool {\n pool: EmptyObject;\n }\n\n export interface QuerySimulation {\n simulation: {\n offer_asset: Asset;\n };\n }\n\n export interface QueryReverseSimulation {\n reverse_simulation: {\n ask_asset: Asset;\n };\n }\n\n export interface ConfigGeneralResponse {\n owner: AccAddress;\n liquidity_token: AccAddress;\n commission_collector: AccAddress;\n }\n\n export interface ConfigSwapResponse {\n lp_commission: string;\n owner_commission: string;\n }\n\n export interface ConfigAssetResponse {\n infos: [AssetInfo, AssetInfo];\n }\n\n export interface PoolResponse {\n assets: [Asset, Asset];\n total_share: string;\n }\n\n export interface SimulationResponse {\n return_amount: string;\n spread_amount: string;\n commission_amount: string;\n }\n\n export interface ReverseSimulationResponse {\n offer_amount: string;\n spread_amount: string;\n commission_amount: string;\n }\n\n export type HandleMsg =\n | HandleUpdateConfig\n | HandleProvideLiquidity\n | HandleSwap;\n\n export type HookMsg = HookSwap | HookWithdrawLiquidity;\n\n export type QueryMsg =\n | QueryConfigGeneral\n | QueryConfigAsset\n | QueryConfigSwap\n | QueryPool\n | QuerySimulation\n | QueryReverseSimulation;\n}\n\nfunction createHookMsg(msg: TerraswapPair.HookMsg): string {\n return Buffer.from(JSON.stringify(msg)).toString('base64');\n}\n\nexport class TerraswapPair extends ContractClient {\n public init(\n init_msg: TerraswapPair.InitMsg,\n migratable: boolean\n ): MsgInstantiateContract {\n return this.createInstantiateMsg(init_msg, {}, migratable);\n }\n\n public updateConfig(\n config: TerraswapPair.HandleUpdateConfig['update_config']\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n update_config: config\n });\n }\n\n /// CONTRACT - If providing asset is not native token,\n /// must increase allowance first before using it\n public provideLiquidity(assets: [Asset, Asset]): MsgExecuteContract {\n let coins: Coins = new Coins([]);\n assets.forEach((asset) => {\n if (isNativeToken(asset.info)) {\n coins = coins.add(\n new Coin(asset.info.native_token.denom, asset.amount)\n );\n }\n });\n\n return this.createExecuteMsg(\n {\n provide_liquidity: {\n assets\n }\n },\n coins\n );\n }\n\n public swap(\n offer_asset: Asset,\n params: {\n belief_price?: Numeric.Input;\n max_spread?: Numeric.Input;\n offer_token?: TerraswapToken;\n to?: AccAddress;\n }\n ): MsgExecuteContract {\n if (!params.offer_token) {\n if (!isNativeToken(offer_asset.info)) {\n throw new Error('OfferToken must be provided - unable to swap');\n }\n\n return this.createExecuteMsg(\n {\n swap: {\n offer_asset,\n belief_price: params.belief_price\n ? new Dec(params.belief_price).toString()\n : undefined,\n max_spread: params.max_spread\n ? new Dec(params.max_spread).toString()\n : undefined,\n to: params.to\n }\n },\n [new Coin(offer_asset.info.native_token.denom, offer_asset.amount)]\n );\n }\n\n if (!this.contractAddress) {\n throw new Error(\n 'contractAddress not provided - unable to execute message'\n );\n }\n\n return params.offer_token.send(\n this.contractAddress,\n offer_asset.amount,\n createHookMsg({\n swap: {\n belief_price: params.belief_price\n ? new Dec(params.belief_price).toString()\n : undefined,\n max_spread: params.max_spread\n ? new Dec(params.max_spread).toString()\n : undefined,\n to: params.to\n }\n })\n );\n }\n\n public withdrawLiquidity(\n amount: Numeric.Input,\n lp_token: TerraswapToken\n ): MsgExecuteContract {\n if (!this.contractAddress) {\n throw new Error(\n 'contractAddress not provided - unable to execute message'\n );\n }\n\n return lp_token.send.call(\n this,\n this.contractAddress,\n amount,\n createHookMsg({\n withdraw_liquidity: {}\n })\n );\n }\n\n public async getConfigGeneral(): Promise<\n TerraswapPair.ConfigGeneralResponse\n > {\n return this.query({\n config_general: {}\n });\n }\n\n public async getConfigAsset(): Promise {\n return this.query({\n config_asset: {}\n });\n }\n\n public async getConfigSwap(): Promise {\n return this.query({\n config_swap: {}\n });\n }\n\n public async getPool(): Promise {\n return this.query({\n pool: {}\n });\n }\n\n public async getSimulation(\n offer_asset: Asset\n ): Promise {\n return this.query({\n simulation: {\n offer_asset\n }\n });\n }\n\n public async getReverseSimulation(\n ask_asset: Asset\n ): Promise {\n return this.query({\n reverse_simulation: {\n ask_asset\n }\n });\n }\n\n protected async query(query_msg: TerraswapPair.QueryMsg): Promise {\n return super.query(query_msg);\n }\n\n protected createExecuteMsg(\n execute_msg: TerraswapPair.HandleMsg,\n coins: Coins.Input = {}\n ): MsgExecuteContract {\n return super.createExecuteMsg(execute_msg, coins);\n }\n}\n","import {\n AccAddress,\n Coins,\n Numeric,\n MsgExecuteContract,\n MsgInstantiateContract,\n Int\n} from '@terra-money/terra.js';\nimport { ContractClient } from './ContractClient';\nimport { EmptyObject } from '../utils/EmptyObject';\n\nexport namespace TerraswapToken {\n export interface InitHook {\n msg: string;\n contract_addr: AccAddress;\n }\n\n export interface MinterResponse {\n minter: AccAddress;\n cap?: string;\n }\n\n export interface TokenCoin {\n address: AccAddress;\n amount: string;\n }\n\n export interface InitMsg {\n name: string;\n symbol: string;\n decimals: number;\n initial_balances: Array;\n mint?: MinterResponse;\n init_hook?: InitHook;\n }\n\n export interface Cw20ReceiveMsg {\n sender: AccAddress;\n amount: string;\n msg?: string;\n }\n\n export interface Receive {\n receive: Cw20ReceiveMsg;\n }\n\n export interface Transfer {\n transfer: {\n recipient: AccAddress;\n amount: string;\n };\n }\n\n export interface Burn {\n burn: {\n amount: string;\n };\n }\n\n export interface Send {\n send: {\n contract: AccAddress;\n amount: string;\n msg?: string;\n };\n }\n\n export interface Mint {\n mint: {\n recipient: AccAddress;\n amount: string;\n };\n }\n\n export interface ExpirationAtHeight {\n at_height: number;\n }\n\n export interface ExpirationAtTime {\n at_time: number;\n }\n\n export interface ExpirationNever {\n never: EmptyObject;\n }\n\n export type Expiration =\n | ExpirationAtHeight\n | ExpirationAtTime\n | ExpirationNever;\n\n export interface IncreaseAllowance {\n increase_allowance: {\n spender: AccAddress;\n amount: string;\n expires?: Expiration;\n };\n }\n\n export interface DecreaseAllowance {\n decrease_allowance: {\n spender: AccAddress;\n amount: string;\n expires?: Expiration;\n };\n }\n\n export interface TransferFrom {\n transfer_from: {\n owner: AccAddress;\n recipient: AccAddress;\n amount: string;\n };\n }\n\n export interface SendFrom {\n send_from: {\n owner: AccAddress;\n contract: AccAddress;\n amount: string;\n msg?: string;\n };\n }\n\n export interface BurnFrom {\n burn_from: {\n owner: AccAddress;\n amount: string;\n };\n }\n\n export interface Balance {\n balance: {\n address: AccAddress;\n };\n }\n\n export interface TokenInfo {\n token_info: EmptyObject;\n }\n\n export interface Minter {\n minter: EmptyObject;\n }\n\n export interface Allownace {\n allowance: {\n owner: AccAddress;\n spender: AccAddress;\n };\n }\n\n export interface AllAllowances {\n all_allowances: {\n owner: AccAddress;\n start_after?: AccAddress;\n limit?: number;\n };\n }\n\n export interface AllAccounts {\n all_accounts: {\n start_after?: AccAddress;\n limit?: number;\n };\n }\n\n export interface BalanceResponse {\n balance: string;\n }\n\n export interface TokenInfoResponse {\n name: string;\n symbol: string;\n decimals: number;\n total_supply: string;\n }\n\n export interface AllowanceResponse {\n allowance: string;\n expires: Expiration;\n }\n\n export interface AllowanceInfo {\n spender: AccAddress;\n allowance: string;\n expires: Expiration;\n }\n\n export interface AllAllowancesResponse {\n allowances: Array;\n }\n\n export interface AllAccountsResponse {\n accounts: Array;\n }\n\n export type HandleMsg =\n | Receive\n | Transfer\n | TransferFrom\n | Burn\n | BurnFrom\n | Send\n | SendFrom\n | Mint\n | IncreaseAllowance\n | DecreaseAllowance;\n\n export type QueryMsg =\n | Balance\n | TokenInfo\n | Minter\n | Allownace\n | AllAllowances\n | AllAccounts;\n}\n\nexport class TerraswapToken extends ContractClient {\n public init(\n init_msg: TerraswapToken.InitMsg,\n migratable: boolean\n ): MsgInstantiateContract {\n return this.createInstantiateMsg(init_msg, {}, migratable);\n }\n\n public transfer(\n recipient: AccAddress,\n amount: Numeric.Input\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n transfer: {\n recipient,\n amount: new Int(amount).toString()\n }\n });\n }\n\n public transferFrom(\n owner: AccAddress,\n recipient: AccAddress,\n amount: Numeric.Input\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n transfer_from: {\n owner,\n recipient,\n amount: new Int(amount).toString()\n }\n });\n }\n\n public send(\n contract: AccAddress,\n amount: Numeric.Input,\n msg?: string\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n send: {\n contract,\n amount: new Int(amount).toString(),\n msg\n }\n });\n }\n\n public sendFrom(\n owner: AccAddress,\n contract: AccAddress,\n amount: Numeric.Input,\n msg?: any\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n send_from: {\n owner,\n contract,\n amount: new Int(amount).toString(),\n msg: msg\n ? Buffer.from(JSON.stringify(msg)).toString('base64')\n : undefined\n }\n });\n }\n\n public mint(\n recipient: AccAddress,\n amount: Numeric.Input\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n mint: {\n recipient,\n amount: new Int(amount).toString()\n }\n });\n }\n\n public burn(amount: Numeric.Input): MsgExecuteContract {\n return this.createExecuteMsg({\n burn: {\n amount: new Int(amount).toString()\n }\n });\n }\n\n public burnFrom(\n owner: AccAddress,\n amount: Numeric.Input\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n burn_from: {\n owner,\n amount: new Int(amount).toString()\n }\n });\n }\n\n public increaseAllowance(\n spender: AccAddress,\n amount: Numeric.Input,\n expires?: TerraswapToken.Expiration\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n increase_allowance: {\n spender,\n amount: new Int(amount).toString(),\n expires\n }\n });\n }\n\n public decreaseAllowance(\n spender: AccAddress,\n amount: Numeric.Input,\n expires?: TerraswapToken.Expiration\n ): MsgExecuteContract {\n return this.createExecuteMsg({\n decrease_allowance: {\n spender,\n amount: new Int(amount).toString(),\n expires\n }\n });\n }\n\n public async getBalance(\n address?: AccAddress\n ): Promise {\n return this.query({\n balance: {\n address: address ? address : this.wallet.key.accAddress\n }\n });\n }\n\n public async getTokenInfo(): Promise {\n return this.query({\n token_info: {}\n });\n }\n\n public async getMinter(): Promise {\n return this.query({\n minter: {}\n });\n }\n\n public async getAllowance(\n owner: AccAddress,\n spender: AccAddress\n ): Promise {\n return this.query({\n allowance: {\n owner,\n spender\n }\n });\n }\n\n public async getAllAllowances(\n owner: AccAddress,\n start_after?: AccAddress,\n limit?: number\n ): Promise {\n return this.query({\n all_allowances: {\n owner,\n start_after,\n limit\n }\n });\n }\n\n public async getAllAccounts(\n start_after?: AccAddress,\n limit?: number\n ): Promise {\n return this.query({\n all_accounts: {\n start_after,\n limit\n }\n });\n }\n\n protected createExecuteMsg(\n executeMsg: TerraswapToken.HandleMsg,\n coins: Coins.Input = {}\n ): MsgExecuteContract {\n return super.createExecuteMsg(executeMsg, coins);\n }\n\n protected async query(query_msg: TerraswapToken.QueryMsg): Promise {\n return super.query(query_msg);\n }\n}\n","export * from './Asset';\nexport * from './EmptyKey';\nexport * from './EmptyObject';\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/client/Mirror.d.ts b/dist/client/Mirror.d.ts deleted file mode 100644 index 8fe03b3e..00000000 --- a/dist/client/Mirror.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { AccAddress, Key, LCDClient } from '@terra-money/terra.js'; -import { MirrorCollector, MirrorFactory, MirrorGov, MirrorMint, MirrorOracle, MirrorStaking, TerraswapFactory, TerraswapPair, TerraswapToken } from '../contracts/index'; -export interface AssetOptions { - symbol: string; - name: string; - token: AccAddress; - pair: AccAddress; - lpToken: AccAddress; -} -export interface MirrorOptions { - lcd: LCDClient; - key: Key; - collector: AccAddress; - factory: AccAddress; - gov: AccAddress; - mint: AccAddress; - oracle: AccAddress; - staking: AccAddress; - mirrorToken: AccAddress; - terraswapFactory: AccAddress; - assets: Array; -} -export declare const DEFAULT_MIRROR_OPTIONS: MirrorOptions; -export declare class Mirror { - collector: MirrorCollector; - factory: MirrorFactory; - gov: MirrorGov; - mint: MirrorMint; - oracle: MirrorOracle; - staking: MirrorStaking; - mirrorToken: TerraswapToken; - terraswapFactory: TerraswapFactory; - assets: Array<{ - name: string; - symbol: string; - token: TerraswapToken; - lpToken: TerraswapToken; - pair: TerraswapPair; - }>; - constructor(options?: Partial); -} diff --git a/dist/client/Mirror.js b/dist/client/Mirror.js deleted file mode 100644 index 67141101..00000000 --- a/dist/client/Mirror.js +++ /dev/null @@ -1,193 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Mirror = exports.DEFAULT_MIRROR_OPTIONS = void 0; -var terra_js_1 = require("@terra-money/terra.js"); -var EmptyKey_1 = require("../utils/EmptyKey"); -var index_1 = require("../contracts/index"); -exports.DEFAULT_MIRROR_OPTIONS = { - lcd: new terra_js_1.LCDClient({ - URL: 'https://moonshine-lcd.terra.dev', - chainID: 'localterra', - gasPrices: [new terra_js_1.Coin('ukrw', '1.8')], - gasAdjustment: '1.2' - }), - key: new EmptyKey_1.EmptyKey(), - collector: 'terra1jmj39n0tfg6qu852fx0kr46gn4sewq6uyqyu8t', - factory: 'terra1ndzjhjszw4pp8dkkt864drgmwhc59padjfccxg', - gov: 'terra12pf2c9k7m2ag2893aa6sv75nmytr9uuxzv8vgx', - mint: 'terra1ycsd7mlffq2ksmqdr20y4drtf6ctw3n8fmup5g', - oracle: 'terra14nh9jzg6gx3qp2jnlg5lvkmky40uxu7w9mgevz', - staking: 'terra1xxqqw7vysmh2wnq3y6hgh7d2ytmgazw62f28hh', - mirrorToken: 'terra16y2ew6rmnehu9fn45jj55w4g37d62xgjz8zsx9', - terraswapFactory: 'terra10w3rtrs8fmgwy6rsh2xwq6x27ym4kpz3698dr4', - assets: [ - { - symbol: 'MIR', - name: 'Mirror', - token: 'terra16y2ew6rmnehu9fn45jj55w4g37d62xgjz8zsx9', - pair: 'terra1ck0ky4ad0ecmz7sksacejxf3rek8922n2302lh', - lpToken: 'terra1xfm4k6qj3ryhpef4t4p9zgww6e3zuw6c0eqd05' - }, - { - symbol: 'mAAPL', - name: 'Apple', - token: 'terra17c3tsywm5h95j3z7hy62mvmyjct4euly4gj3kp', - pair: 'terra1d6548cmpmugndjg650k0k66fhnvkeqxavv0z07', - lpToken: 'terra1msdk05534hqupfed4v5q04f5y883ezqm0uukn7' - }, - { - symbol: 'mGOOGL', - name: 'Google', - token: 'terra1tz0c9uy0wwaaq4p57v8qzfx0g08l3zr3zcdtgl', - pair: 'terra1t8m4cs4f32zqgsktu4pucwnlkz47dgql8crywn', - lpToken: 'terra1wxh3lw9u3k7psmvqzraxpmscmpgp329kzg834m' - }, - { - symbol: 'mTSLA', - name: 'Tesla', - token: 'terra13fkuw7gh8r0mjswj8ckyt87m84azq43q3qldmj', - pair: 'terra1uf29lrmpsmww4k3c9jcxdzet75c2pt353mx4tq', - lpToken: 'terra1zccwcq7shh4yj8j2ynecd7pyyftxlhdd77fpu3' - }, - { - symbol: 'mNFLX', - name: 'Netflix', - token: 'terra1f9pk063a99g27l5nu83pd55x6rs649s3ax7pw3', - pair: 'terra1t033f2r5phvuvysu50x2lj5ctshakcf45szn49', - lpToken: 'terra1ch6d5kdenshk2zktap2s05arytpn8xhdffarvc' - }, - { - symbol: 'mQQQ', - name: 'Invesco QQQ Trust', - token: 'terra1hu7u866jla3vgckf4sd6vjdfxzuqvzvu0ekpc9', - pair: 'terra19ujpfl5djdrp6w4w30vtx9cremz25gkg9nzcfa', - lpToken: 'terra1cj8rcff3djz86rarg3uw3nzgdy2trgvj5egvdl' - }, - { - symbol: 'mTWTR', - name: 'Twitter', - token: 'terra1ua295n83qqm7kncn6g704d2a3hpmtjyx7f07u7', - pair: 'terra14q8szcr0gy5pzksve5sp7e94kqqa0xlc3g2y9u', - lpToken: 'terra1wunltsvvl2gfsnpwc4hf9pdxt6tnp7rt877ny8' - }, - { - symbol: 'mBABA', - name: 'Alibaba Group Holdings Ltd ADR', - token: 'terra1vekqnp3tgukt90lqfumu5467jw9jy4eewzn2fu', - pair: 'terra1q5gyld4cjr59fdk2rjuuzs200ks28lp08fudnt', - lpToken: 'terra1vrkjzhs26qlg6863s7rcnkqlmp3ftsxfdc6l5r' - }, - { - symbol: 'mIAU', - name: 'iShares Gold Trust', - token: 'terra1cyrhd8m2hhvvrn3mrn29d4h6unzyp6deay6g2y', - pair: 'terra1ygeltj9hg4tsshhx2m4et4nmhn2sqpmu2cv8qk', - lpToken: 'terra1whql3f3vukrtu3qs363vj5a67xccydjz9lpg6t' - }, - { - symbol: 'mSLV', - name: 'iShares Silver Trust', - token: 'terra17szfxhpttyp6w5p8llpqcr72yegxtaqy6uarye', - pair: 'terra1vh4e69jq20tdzldc49wwuz22qe4pdr0zlwpvsg', - lpToken: 'terra1d2ujj007l2tp5r6mgp78hr0ecrtq4q9afvmlwh' - }, - { - symbol: 'mUSO', - name: 'United States Oil Fund, LP', - token: 'terra19sf42kkwn85dj8hzffcytvw6jx4g8g3nxfnrdu', - pair: 'terra1yde9tsacetgrdzdm56s5dng2uc53wpnyf9dyds', - lpToken: 'terra1pkv2skq9pqzpfe483dn6q2dskadrhyrqg2f5ya' - }, - { - symbol: 'mVIXY', - name: 'ProShares VIX', - token: 'terra1kmt8vekwu4aq6l9y50n8hg9zcdzd3tqdp8lgdr', - pair: 'terra195fcntnznx4f676gf383g02yguhync2fsuk03x', - lpToken: 'terra1svhet09r7ulhyr4vs4fl6j6lnam94q6natumck' - } - ] -}; -var Mirror = /** @class */ (function () { - function Mirror(options) { - var _this = this; - if (options === void 0) { options = exports.DEFAULT_MIRROR_OPTIONS; } - var mirrorOptions = __assign(__assign({}, exports.DEFAULT_MIRROR_OPTIONS), options); - var lcd = mirrorOptions.lcd, key = mirrorOptions.key, collector = mirrorOptions.collector, factory = mirrorOptions.factory, gov = mirrorOptions.gov, mint = mirrorOptions.mint, oracle = mirrorOptions.oracle, staking = mirrorOptions.staking, mirrorToken = mirrorOptions.mirrorToken, terraswapFactory = mirrorOptions.terraswapFactory, assets = mirrorOptions.assets; - this.collector = new index_1.MirrorCollector({ - contractAddress: collector, - lcd: lcd, - key: key - }); - this.factory = new index_1.MirrorFactory({ - contractAddress: factory, - lcd: lcd, - key: key - }); - this.gov = new index_1.MirrorGov({ - contractAddress: gov, - lcd: lcd, - key: key - }); - this.mint = new index_1.MirrorMint({ - contractAddress: mint, - lcd: lcd, - key: key - }); - this.oracle = new index_1.MirrorOracle({ - contractAddress: oracle, - lcd: lcd, - key: key - }); - this.staking = new index_1.MirrorStaking({ - contractAddress: staking, - lcd: lcd, - key: key - }); - this.mirrorToken = new index_1.TerraswapToken({ - contractAddress: mirrorToken, - lcd: lcd, - key: key - }); - this.terraswapFactory = new index_1.TerraswapFactory({ - contractAddress: terraswapFactory, - lcd: lcd, - key: key - }); - this.assets = []; - assets.forEach(function (asset) { - _this.assets.push({ - name: asset.name, - symbol: asset.symbol, - token: new index_1.TerraswapToken({ - contractAddress: asset.token, - lcd: lcd, - key: key - }), - lpToken: new index_1.TerraswapToken({ - contractAddress: asset.lpToken, - lcd: lcd, - key: key - }), - pair: new index_1.TerraswapPair({ - contractAddress: asset.pair, - lcd: lcd, - key: key - }) - }); - }); - } - return Mirror; -}()); -exports.Mirror = Mirror; -//# sourceMappingURL=Mirror.js.map \ No newline at end of file diff --git a/dist/client/Mirror.js.map b/dist/client/Mirror.js.map deleted file mode 100644 index 4f988438..00000000 --- a/dist/client/Mirror.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Mirror.js","sourceRoot":"","sources":["../../src/client/Mirror.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kDAAyE;AACzE,8CAA6C;AAC7C,4CAU4B;AAwBf,QAAA,sBAAsB,GAAkB;IACnD,GAAG,EAAE,IAAI,oBAAS,CAAC;QACjB,GAAG,EAAE,iCAAiC;QACtC,OAAO,EAAE,YAAY;QACrB,SAAS,EAAE,CAAC,IAAI,eAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACpC,aAAa,EAAE,KAAK;KACrB,CAAC;IACF,GAAG,EAAE,IAAI,mBAAQ,EAAE;IACnB,SAAS,EAAE,8CAA8C;IACzD,OAAO,EAAE,8CAA8C;IACvD,GAAG,EAAE,8CAA8C;IACnD,IAAI,EAAE,8CAA8C;IACpD,MAAM,EAAE,8CAA8C;IACtD,OAAO,EAAE,8CAA8C;IACvD,WAAW,EAAE,8CAA8C;IAC3D,gBAAgB,EAAE,8CAA8C;IAChE,MAAM,EAAE;QACN;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,8CAA8C;YACrD,IAAI,EAAE,8CAA8C;YACpD,OAAO,EAAE,8CAA8C;SACxD;QACD;YACE,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,8CAA8C;YACrD,IAAI,EAAE,8CAA8C;YACpD,OAAO,EAAE,8CAA8C;SACxD;QACD;YACE,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,8CAA8C;YACrD,IAAI,EAAE,8CAA8C;YACpD,OAAO,EAAE,8CAA8C;SACxD;QACD;YACE,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,8CAA8C;YACrD,IAAI,EAAE,8CAA8C;YACpD,OAAO,EAAE,8CAA8C;SACxD;QACD;YACE,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,8CAA8C;YACrD,IAAI,EAAE,8CAA8C;YACpD,OAAO,EAAE,8CAA8C;SACxD;QACD;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,mBAAmB;YACzB,KAAK,EAAE,8CAA8C;YACrD,IAAI,EAAE,8CAA8C;YACpD,OAAO,EAAE,8CAA8C;SACxD;QACD;YACE,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,8CAA8C;YACrD,IAAI,EAAE,8CAA8C;YACpD,OAAO,EAAE,8CAA8C;SACxD;QACD;YACE,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,gCAAgC;YACtC,KAAK,EAAE,8CAA8C;YACrD,IAAI,EAAE,8CAA8C;YACpD,OAAO,EAAE,8CAA8C;SACxD;QACD;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,oBAAoB;YAC1B,KAAK,EAAE,8CAA8C;YACrD,IAAI,EAAE,8CAA8C;YACpD,OAAO,EAAE,8CAA8C;SACxD;QACD;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,sBAAsB;YAC5B,KAAK,EAAE,8CAA8C;YACrD,IAAI,EAAE,8CAA8C;YACpD,OAAO,EAAE,8CAA8C;SACxD;QACD;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,4BAA4B;YAClC,KAAK,EAAE,8CAA8C;YACrD,IAAI,EAAE,8CAA8C;YACpD,OAAO,EAAE,8CAA8C;SACxD;QACD;YACE,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,8CAA8C;YACrD,IAAI,EAAE,8CAA8C;YACpD,OAAO,EAAE,8CAA8C;SACxD;KACF;CACF,CAAC;AAEF;IAyBE,gBAAY,OAAwD;QAApE,iBAiFC;QAjFW,wBAAA,EAAA,UAAkC,8BAAsB;QAClE,IAAM,aAAa,yBAAQ,8BAAsB,GAAK,OAAO,CAAE,CAAC;QAE9D,IAAA,GAAG,GAWD,aAAa,IAXZ,EACH,GAAG,GAUD,aAAa,IAVZ,EACH,SAAS,GASP,aAAa,UATN,EACT,OAAO,GAQL,aAAa,QARR,EACP,GAAG,GAOD,aAAa,IAPZ,EACH,IAAI,GAMF,aAAa,KANX,EACJ,MAAM,GAKJ,aAAa,OALT,EACN,OAAO,GAIL,aAAa,QAJR,EACP,WAAW,GAGT,aAAa,YAHJ,EACX,gBAAgB,GAEd,aAAa,iBAFC,EAChB,MAAM,GACJ,aAAa,OADT,CACU;QAElB,IAAI,CAAC,SAAS,GAAG,IAAI,uBAAe,CAAC;YACnC,eAAe,EAAE,SAAS;YAC1B,GAAG,KAAA;YACH,GAAG,KAAA;SACJ,CAAC,CAAC;QACH,IAAI,CAAC,OAAO,GAAG,IAAI,qBAAa,CAAC;YAC/B,eAAe,EAAE,OAAO;YACxB,GAAG,KAAA;YACH,GAAG,KAAA;SACJ,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,GAAG,IAAI,iBAAS,CAAC;YACvB,eAAe,EAAE,GAAG;YACpB,GAAG,KAAA;YACH,GAAG,KAAA;SACJ,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,GAAG,IAAI,kBAAU,CAAC;YACzB,eAAe,EAAE,IAAI;YACrB,GAAG,KAAA;YACH,GAAG,KAAA;SACJ,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,GAAG,IAAI,oBAAY,CAAC;YAC7B,eAAe,EAAE,MAAM;YACvB,GAAG,KAAA;YACH,GAAG,KAAA;SACJ,CAAC,CAAC;QACH,IAAI,CAAC,OAAO,GAAG,IAAI,qBAAa,CAAC;YAC/B,eAAe,EAAE,OAAO;YACxB,GAAG,KAAA;YACH,GAAG,KAAA;SACJ,CAAC,CAAC;QACH,IAAI,CAAC,WAAW,GAAG,IAAI,sBAAc,CAAC;YACpC,eAAe,EAAE,WAAW;YAC5B,GAAG,KAAA;YACH,GAAG,KAAA;SACJ,CAAC,CAAC;QAEH,IAAI,CAAC,gBAAgB,GAAG,IAAI,wBAAgB,CAAC;YAC3C,eAAe,EAAE,gBAAgB;YACjC,GAAG,KAAA;YACH,GAAG,KAAA;SACJ,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QAEjB,MAAM,CAAC,OAAO,CAAC,UAAC,KAAK;YACnB,KAAI,CAAC,MAAM,CAAC,IAAI,CAAC;gBACf,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,KAAK,EAAE,IAAI,sBAAc,CAAC;oBACxB,eAAe,EAAE,KAAK,CAAC,KAAK;oBAC5B,GAAG,KAAA;oBACH,GAAG,KAAA;iBACJ,CAAC;gBACF,OAAO,EAAE,IAAI,sBAAc,CAAC;oBAC1B,eAAe,EAAE,KAAK,CAAC,OAAO;oBAC9B,GAAG,KAAA;oBACH,GAAG,KAAA;iBACJ,CAAC;gBACF,IAAI,EAAE,IAAI,qBAAa,CAAC;oBACtB,eAAe,EAAE,KAAK,CAAC,IAAI;oBAC3B,GAAG,KAAA;oBACH,GAAG,KAAA;iBACJ,CAAC;aACH,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IACH,aAAC;AAAD,CAAC,AA3GD,IA2GC;AA3GY,wBAAM"} \ No newline at end of file diff --git a/dist/client/index.d.ts b/dist/client/index.d.ts deleted file mode 100644 index c47a83db..00000000 --- a/dist/client/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './Mirror'; diff --git a/dist/client/index.js b/dist/client/index.js deleted file mode 100644 index 1f27b9e9..00000000 --- a/dist/client/index.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./Mirror"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/client/index.js.map b/dist/client/index.js.map deleted file mode 100644 index 496b9358..00000000 --- a/dist/client/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyB"} \ No newline at end of file diff --git a/dist/contracts/ContractClient.d.ts b/dist/contracts/ContractClient.d.ts deleted file mode 100644 index efa9b27c..00000000 --- a/dist/contracts/ContractClient.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { AccAddress, Coins, Key, LCDClient, MsgExecuteContract, Wallet, MsgInstantiateContract } from '@terra-money/terra.js'; -export declare class ContractClient { - contractAddress?: AccAddress; - codeID?: number; - lcd?: LCDClient; - key: Key; - constructor(options: Partial<{ - contractAddress: AccAddress; - codeID: number; - lcd: LCDClient; - key: Key; - }>); - get wallet(): Wallet; - protected query(queryMmsg: any): Promise; - protected createExecuteMsg(executeMsg: any, coins?: Coins.Input): MsgExecuteContract; - protected createInstantiateMsg(initMsg: any, initCoins: string | Coins.DataDict | import("@terra-money/terra.js").Coin[] | Coins | undefined, migratable: boolean): MsgInstantiateContract; -} diff --git a/dist/contracts/ContractClient.js b/dist/contracts/ContractClient.js deleted file mode 100644 index e1c99208..00000000 --- a/dist/contracts/ContractClient.js +++ /dev/null @@ -1,86 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ContractClient = void 0; -var terra_js_1 = require("@terra-money/terra.js"); -var EmptyKey_1 = require("../utils/EmptyKey"); -var ContractClient = /** @class */ (function () { - function ContractClient(options) { - this.contractAddress = options.contractAddress; - this.codeID = options.codeID; - this.lcd = options.lcd; - this.key = options.key ? options.key : new EmptyKey_1.EmptyKey(); - } - Object.defineProperty(ContractClient.prototype, "wallet", { - get: function () { - if (this.lcd === undefined) { - throw new Error('LCDClient not provided - unable to create wallet'); - } - return this.lcd.wallet(this.key); - }, - enumerable: false, - configurable: true - }); - ContractClient.prototype.query = function (queryMmsg) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - if (!this.contractAddress) { - throw new Error('contractAddress not provided - unable to query'); - } - return [2 /*return*/, this.wallet.lcd.wasm.contractQuery(this.contractAddress, queryMmsg)]; - }); - }); - }; - ContractClient.prototype.createExecuteMsg = function (executeMsg, coins) { - if (coins === void 0) { coins = {}; } - if (!this.contractAddress) { - throw new Error('contractAddress not provided - unable to execute message'); - } - return new terra_js_1.MsgExecuteContract(this.key.accAddress, this.contractAddress, executeMsg, coins); - }; - ContractClient.prototype.createInstantiateMsg = function (initMsg, initCoins, migratable) { - if (initCoins === void 0) { initCoins = {}; } - if (!this.codeID) { - throw new Error('codeID not provided - unable to instantiate contract'); - } - return new terra_js_1.MsgInstantiateContract(this.key.accAddress, this.codeID, initMsg, initCoins, migratable); - }; - return ContractClient; -}()); -exports.ContractClient = ContractClient; -//# sourceMappingURL=ContractClient.js.map \ No newline at end of file diff --git a/dist/contracts/ContractClient.js.map b/dist/contracts/ContractClient.js.map deleted file mode 100644 index 7dd3a309..00000000 --- a/dist/contracts/ContractClient.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ContractClient.js","sourceRoot":"","sources":["../../src/contracts/ContractClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAQ+B;AAE/B,8CAA6C;AAE7C;IASE,wBACE,OAKE;QAEF,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;QAC/C,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;QAEvB,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,mBAAQ,EAAE,CAAC;IACxD,CAAC;IAED,sBAAW,kCAAM;aAAjB;YACE,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS,EAAE;gBAC1B,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;aACrE;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACnC,CAAC;;;OAAA;IAEe,8BAAK,GAArB,UAAyB,SAAc;;;gBACrC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;oBACzB,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;iBACnE;gBAED,sBAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CACvC,IAAI,CAAC,eAAe,EACpB,SAAS,CACV,EAAC;;;KACH;IAES,yCAAgB,GAA1B,UACE,UAAe,EACf,KAAuB;QAAvB,sBAAA,EAAA,UAAuB;QAEvB,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;YACzB,MAAM,IAAI,KAAK,CACb,0DAA0D,CAC3D,CAAC;SACH;QAED,OAAO,IAAI,6BAAkB,CAC3B,IAAI,CAAC,GAAG,CAAC,UAAU,EACnB,IAAI,CAAC,eAAe,EACpB,UAAU,EACV,KAAK,CACN,CAAC;IACJ,CAAC;IAES,6CAAoB,GAA9B,UACE,OAAY,EACZ,SAA2B,EAC3B,UAAmB;QADnB,0BAAA,EAAA,cAA2B;QAG3B,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAChB,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;SACzE;QAED,OAAO,IAAI,iCAAsB,CAC/B,IAAI,CAAC,GAAG,CAAC,UAAU,EACnB,IAAI,CAAC,MAAM,EACX,OAAO,EACP,SAAS,EACT,UAAU,CACX,CAAC;IACJ,CAAC;IACH,qBAAC;AAAD,CAAC,AA9ED,IA8EC;AA9EY,wCAAc"} \ No newline at end of file diff --git a/dist/contracts/MirrorCollector.d.ts b/dist/contracts/MirrorCollector.d.ts deleted file mode 100644 index 4d9f87ae..00000000 --- a/dist/contracts/MirrorCollector.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { AccAddress, Coins, MsgExecuteContract, MsgInstantiateContract } from '@terra-money/terra.js'; -import { EmptyObject } from '../utils/EmptyObject'; -import { ContractClient } from './ContractClient'; -export declare namespace MirrorCollector { - interface InitMsg { - distribution_contract: AccAddress; - terraswap_factory: AccAddress; - mirror_token: AccAddress; - base_denom: string; - } - interface HandleConvert { - convert: { - asset_token: AccAddress; - }; - } - interface HandleSend { - send: EmptyObject; - } - interface QueryConfig { - config: EmptyObject; - } - interface ConfigResponse { - distribution_contract: AccAddress; - terraswap_factory: AccAddress; - mirror_token: AccAddress; - base_denom: string; - } - type HandleMsg = HandleConvert | HandleSend; - type QueryMsg = QueryConfig; -} -export declare class MirrorCollector extends ContractClient { - init(init_msg: MirrorCollector.InitMsg, migratable: boolean): MsgInstantiateContract; - convert(asset_token: AccAddress): MsgExecuteContract; - send(): MsgExecuteContract; - getConfig(): Promise; - protected query(query_msg: MirrorCollector.QueryMsg): Promise; - protected createExecuteMsg(executeMsg: MirrorCollector.HandleMsg, coins?: Coins.Input): MsgExecuteContract; -} diff --git a/dist/contracts/MirrorCollector.js b/dist/contracts/MirrorCollector.js deleted file mode 100644 index 731b03a8..00000000 --- a/dist/contracts/MirrorCollector.js +++ /dev/null @@ -1,98 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MirrorCollector = void 0; -var ContractClient_1 = require("./ContractClient"); -var MirrorCollector = /** @class */ (function (_super) { - __extends(MirrorCollector, _super); - function MirrorCollector() { - return _super !== null && _super.apply(this, arguments) || this; - } - MirrorCollector.prototype.init = function (init_msg, migratable) { - return this.createInstantiateMsg(init_msg, {}, migratable); - }; - MirrorCollector.prototype.convert = function (asset_token) { - return this.createExecuteMsg({ - convert: { - asset_token: asset_token - } - }); - }; - MirrorCollector.prototype.send = function () { - return this.createExecuteMsg({ - send: {} - }); - }; - MirrorCollector.prototype.getConfig = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - config: {} - })]; - }); - }); - }; - // Typed overloads - MirrorCollector.prototype.query = function (query_msg) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, _super.prototype.query.call(this, query_msg)]; - }); - }); - }; - MirrorCollector.prototype.createExecuteMsg = function (executeMsg, coins) { - if (coins === void 0) { coins = {}; } - return _super.prototype.createExecuteMsg.call(this, executeMsg, coins); - }; - return MirrorCollector; -}(ContractClient_1.ContractClient)); -exports.MirrorCollector = MirrorCollector; -//# sourceMappingURL=MirrorCollector.js.map \ No newline at end of file diff --git a/dist/contracts/MirrorCollector.js.map b/dist/contracts/MirrorCollector.js.map deleted file mode 100644 index 1aefa317..00000000 --- a/dist/contracts/MirrorCollector.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MirrorCollector.js","sourceRoot":"","sources":["../../src/contracts/MirrorCollector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,mDAAkD;AAmClD;IAAqC,mCAAc;IAAnD;;IAwCA,CAAC;IAvCQ,8BAAI,GAAX,UACE,QAAiC,EACjC,UAAmB;QAEnB,OAAO,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;IAC7D,CAAC;IAEM,iCAAO,GAAd,UAAe,WAAuB;QACpC,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,OAAO,EAAE;gBACP,WAAW,aAAA;aACZ;SACF,CAAC,CAAC;IACL,CAAC;IAEM,8BAAI,GAAX;QACE,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,IAAI,EAAE,EAAE;SACT,CAAC,CAAC;IACL,CAAC;IAEY,mCAAS,GAAtB;;;gBACE,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,MAAM,EAAE,EAAE;qBACX,CAAC,EAAC;;;KACJ;IAED,kBAAkB;IAEF,+BAAK,GAArB,UAAyB,SAAmC;;;gBAC1D,sBAAO,iBAAM,KAAK,YAAC,SAAS,CAAC,EAAC;;;KAC/B;IAES,0CAAgB,GAA1B,UACE,UAAqC,EACrC,KAAuB;QAAvB,sBAAA,EAAA,UAAuB;QAEvB,OAAO,iBAAM,gBAAgB,YAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IACnD,CAAC;IACH,sBAAC;AAAD,CAAC,AAxCD,CAAqC,+BAAc,GAwClD;AAxCY,0CAAe"} \ No newline at end of file diff --git a/dist/contracts/MirrorFactory.d.ts b/dist/contracts/MirrorFactory.d.ts deleted file mode 100644 index 3632a12d..00000000 --- a/dist/contracts/MirrorFactory.d.ts +++ /dev/null @@ -1,120 +0,0 @@ -import { AccAddress, Coins, Dec, Numeric, MsgExecuteContract, MsgInstantiateContract } from '@terra-money/terra.js'; -import { EmptyObject } from '../utils/EmptyObject'; -import { ContractClient } from './ContractClient'; -export declare namespace MirrorFactory { - interface InitMsg { - mint_per_block: string; - token_code_id: number; - base_denom: string; - } - interface Params { - weight: string; - lp_commission: string; - owner_commission: string; - auction_discount: string; - min_collateral_ratio: string; - } - interface HandlePostInitialize { - post_initialize: { - owner: AccAddress; - terraswap_factory: AccAddress; - mirror_token: AccAddress; - staking_contract: AccAddress; - oracle_contract: AccAddress; - mint_contract: AccAddress; - commission_collector: AccAddress; - }; - } - interface HandleUpdateConfig { - update_config: { - owner?: AccAddress; - mint_per_block?: string; - token_code_id?: number; - }; - } - interface HandleUpdateWeight { - update_weight: { - asset_token: AccAddress; - weight: string; - }; - } - interface HandleTerraswapCreationHook { - terraswap_creation_hook: { - asset_token: AccAddress; - }; - } - interface HandleWhitelist { - whitelist: { - name: string; - symbol: string; - oracle_feeder: AccAddress; - params: Params; - }; - } - interface HandlePassCommand { - pass_command: { - contract_addr: AccAddress; - msg: string; - }; - } - interface HandleMint { - mint: { - asset_token: AccAddress; - }; - } - interface HandleMigrateAsset { - migrate_asset: { - name: string; - symbol: string; - from_token: AccAddress; - end_price: string; - }; - } - interface QueryConfig { - config: EmptyObject; - } - interface QueryDistributionInfo { - distribution_info: { - asset_token: AccAddress; - }; - } - interface ConfigResponse { - owner: AccAddress; - mirror_token: AccAddress; - mint_contract: AccAddress; - staking_contract: AccAddress; - commission_collector: AccAddress; - oracle_contract: AccAddress; - terraswap_factory: AccAddress; - mint_per_block: string; - token_code_id: number; - base_denom: string; - } - interface DistributionInfoResponse { - weight: string; - last_height: number; - } - type HandleMsg = HandlePostInitialize | HandleUpdateWeight | HandleUpdateConfig | HandleTerraswapCreationHook | HandleWhitelist | HandlePassCommand | HandleMint | HandleMigrateAsset; - type QueryMsg = QueryConfig | QueryDistributionInfo; -} -export declare class MirrorFactory extends ContractClient { - init(init_msg: MirrorFactory.InitMsg, migratable: boolean): MsgInstantiateContract; - postInitialize(owner: AccAddress, terraswap_factory: AccAddress, mirror_token: AccAddress, staking_contract: AccAddress, oracle_contract: AccAddress, mint_contract: AccAddress, commission_collector: AccAddress): MsgExecuteContract; - updateWeight(asset_token: AccAddress, weight: Dec): MsgExecuteContract; - updateConfig(config: MirrorFactory.HandleUpdateConfig['update_config']): MsgExecuteContract; - terraswapCreationHook(asset_token: AccAddress): MsgExecuteContract; - whitelist(name: string, symbol: string, oracle_feeder: AccAddress, params: { - weight: Numeric.Input; - lp_commission: Numeric.Input; - owner_commission: Numeric.Input; - auction_discount: Numeric.Input; - min_collateral_ratio: Numeric.Input; - }): MsgExecuteContract; - migrateAsset(name: string, symbol: string, from_token: AccAddress, end_price: Numeric.Input): MsgExecuteContract; - passCommand(contract_addr: AccAddress, msg: any): MsgExecuteContract; - mint(asset_token: AccAddress): MsgExecuteContract; - getConfig(): Promise; - getDistributionInfo(asset_token: AccAddress): Promise; - protected query(query_msg: MirrorFactory.QueryMsg): Promise; - protected createExecuteMsg(executeMsg: MirrorFactory.HandleMsg, coins?: Coins.Input): MsgExecuteContract; -} diff --git a/dist/contracts/MirrorFactory.js b/dist/contracts/MirrorFactory.js deleted file mode 100644 index f81baf1a..00000000 --- a/dist/contracts/MirrorFactory.js +++ /dev/null @@ -1,170 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MirrorFactory = void 0; -var terra_js_1 = require("@terra-money/terra.js"); -var ContractClient_1 = require("./ContractClient"); -var MirrorFactory = /** @class */ (function (_super) { - __extends(MirrorFactory, _super); - function MirrorFactory() { - return _super !== null && _super.apply(this, arguments) || this; - } - MirrorFactory.prototype.init = function (init_msg, migratable) { - return this.createInstantiateMsg(init_msg, {}, migratable); - }; - MirrorFactory.prototype.postInitialize = function (owner, terraswap_factory, mirror_token, staking_contract, oracle_contract, mint_contract, commission_collector) { - return this.createExecuteMsg({ - post_initialize: { - owner: owner, - terraswap_factory: terraswap_factory, - mirror_token: mirror_token, - staking_contract: staking_contract, - oracle_contract: oracle_contract, - mint_contract: mint_contract, - commission_collector: commission_collector - } - }); - }; - MirrorFactory.prototype.updateWeight = function (asset_token, weight) { - return this.createExecuteMsg({ - update_weight: { - asset_token: asset_token, - weight: weight.toFixed() - } - }); - }; - MirrorFactory.prototype.updateConfig = function (config) { - return this.createExecuteMsg({ - update_config: config - }); - }; - MirrorFactory.prototype.terraswapCreationHook = function (asset_token) { - return this.createExecuteMsg({ - terraswap_creation_hook: { - asset_token: asset_token - } - }); - }; - MirrorFactory.prototype.whitelist = function (name, symbol, oracle_feeder, params) { - return this.createExecuteMsg({ - whitelist: { - name: name, - symbol: symbol, - oracle_feeder: oracle_feeder, - params: { - weight: new terra_js_1.Dec(params.weight).toFixed(), - lp_commission: new terra_js_1.Dec(params.lp_commission).toFixed(), - owner_commission: new terra_js_1.Dec(params.owner_commission).toFixed(), - auction_discount: new terra_js_1.Dec(params.auction_discount).toFixed(), - min_collateral_ratio: new terra_js_1.Dec(params.min_collateral_ratio).toFixed() - } - } - }); - }; - MirrorFactory.prototype.migrateAsset = function (name, symbol, from_token, end_price) { - return this.createExecuteMsg({ - migrate_asset: { - name: name, - symbol: symbol, - from_token: from_token, - end_price: new terra_js_1.Dec(end_price).toString() - } - }); - }; - MirrorFactory.prototype.passCommand = function (contract_addr, msg) { - return this.createExecuteMsg({ - pass_command: { - contract_addr: contract_addr, - msg: Buffer.from(JSON.stringify(msg)).toString('base64') - } - }); - }; - MirrorFactory.prototype.mint = function (asset_token) { - return this.createExecuteMsg({ - mint: { - asset_token: asset_token - } - }); - }; - MirrorFactory.prototype.getConfig = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - config: {} - })]; - }); - }); - }; - MirrorFactory.prototype.getDistributionInfo = function (asset_token) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - distribution_info: { asset_token: asset_token } - })]; - }); - }); - }; - // Typed overloads - MirrorFactory.prototype.query = function (query_msg) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, _super.prototype.query.call(this, query_msg)]; - }); - }); - }; - MirrorFactory.prototype.createExecuteMsg = function (executeMsg, coins) { - if (coins === void 0) { coins = {}; } - return _super.prototype.createExecuteMsg.call(this, executeMsg, coins); - }; - return MirrorFactory; -}(ContractClient_1.ContractClient)); -exports.MirrorFactory = MirrorFactory; -//# sourceMappingURL=MirrorFactory.js.map \ No newline at end of file diff --git a/dist/contracts/MirrorFactory.js.map b/dist/contracts/MirrorFactory.js.map deleted file mode 100644 index a638e781..00000000 --- a/dist/contracts/MirrorFactory.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MirrorFactory.js","sourceRoot":"","sources":["../../src/contracts/MirrorFactory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAO+B;AAE/B,mDAAkD;AAwHlD;IAAmC,iCAAc;IAAjD;;IAiJA,CAAC;IAhJQ,4BAAI,GAAX,UACE,QAA+B,EAC/B,UAAmB;QAEnB,OAAO,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;IAC7D,CAAC;IAEM,sCAAc,GAArB,UACE,KAAiB,EACjB,iBAA6B,EAC7B,YAAwB,EACxB,gBAA4B,EAC5B,eAA2B,EAC3B,aAAyB,EACzB,oBAAgC;QAEhC,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,eAAe,EAAE;gBACf,KAAK,OAAA;gBACL,iBAAiB,mBAAA;gBACjB,YAAY,cAAA;gBACZ,gBAAgB,kBAAA;gBAChB,eAAe,iBAAA;gBACf,aAAa,eAAA;gBACb,oBAAoB,sBAAA;aACrB;SACF,CAAC,CAAC;IACL,CAAC;IAEM,oCAAY,GAAnB,UACE,WAAuB,EACvB,MAAW;QAEX,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,aAAa,EAAE;gBACb,WAAW,aAAA;gBACX,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE;aACzB;SACF,CAAC,CAAC;IACL,CAAC;IAEM,oCAAY,GAAnB,UACE,MAAyD;QAEzD,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,aAAa,EAAE,MAAM;SACtB,CAAC,CAAC;IACL,CAAC;IAEM,6CAAqB,GAA5B,UAA6B,WAAuB;QAClD,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,uBAAuB,EAAE;gBACvB,WAAW,aAAA;aACZ;SACF,CAAC,CAAC;IACL,CAAC;IAEM,iCAAS,GAAhB,UACE,IAAY,EACZ,MAAc,EACd,aAAyB,EACzB,MAMC;QAED,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,SAAS,EAAE;gBACT,IAAI,MAAA;gBACJ,MAAM,QAAA;gBACN,aAAa,eAAA;gBACb,MAAM,EAAE;oBACN,MAAM,EAAE,IAAI,cAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE;oBACxC,aAAa,EAAE,IAAI,cAAG,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE;oBACtD,gBAAgB,EAAE,IAAI,cAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,OAAO,EAAE;oBAC5D,gBAAgB,EAAE,IAAI,cAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,OAAO,EAAE;oBAC5D,oBAAoB,EAAE,IAAI,cAAG,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,OAAO,EAAE;iBACrE;aACF;SACF,CAAC,CAAC;IACL,CAAC;IAEM,oCAAY,GAAnB,UACE,IAAY,EACZ,MAAc,EACd,UAAsB,EACtB,SAAwB;QAExB,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,aAAa,EAAE;gBACb,IAAI,MAAA;gBACJ,MAAM,QAAA;gBACN,UAAU,YAAA;gBACV,SAAS,EAAE,IAAI,cAAG,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE;aACzC;SACF,CAAC,CAAC;IACL,CAAC;IAEM,mCAAW,GAAlB,UAAmB,aAAyB,EAAE,GAAQ;QACpD,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,YAAY,EAAE;gBACZ,aAAa,eAAA;gBACb,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;aACzD;SACF,CAAC,CAAC;IACL,CAAC;IAEM,4BAAI,GAAX,UAAY,WAAuB;QACjC,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,IAAI,EAAE;gBACJ,WAAW,aAAA;aACZ;SACF,CAAC,CAAC;IACL,CAAC;IAEY,iCAAS,GAAtB;;;gBACE,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,MAAM,EAAE,EAAE;qBACX,CAAC,EAAC;;;KACJ;IAEY,2CAAmB,GAAhC,UACE,WAAuB;;;gBAEvB,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,iBAAiB,EAAE,EAAE,WAAW,aAAA,EAAE;qBACnC,CAAC,EAAC;;;KACJ;IAED,kBAAkB;IAEF,6BAAK,GAArB,UAAyB,SAAiC;;;gBACxD,sBAAO,iBAAM,KAAK,YAAC,SAAS,CAAC,EAAC;;;KAC/B;IAES,wCAAgB,GAA1B,UACE,UAAmC,EACnC,KAAuB;QAAvB,sBAAA,EAAA,UAAuB;QAEvB,OAAO,iBAAM,gBAAgB,YAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IACnD,CAAC;IACH,oBAAC;AAAD,CAAC,AAjJD,CAAmC,+BAAc,GAiJhD;AAjJY,sCAAa"} \ No newline at end of file diff --git a/dist/contracts/MirrorGov.d.ts b/dist/contracts/MirrorGov.d.ts deleted file mode 100644 index 7cc70543..00000000 --- a/dist/contracts/MirrorGov.d.ts +++ /dev/null @@ -1,165 +0,0 @@ -import { AccAddress, Coins, Numeric, MsgExecuteContract, MsgInstantiateContract } from '@terra-money/terra.js'; -import { EmptyObject } from '../utils/EmptyObject'; -import { ContractClient } from './ContractClient'; -import { TerraswapToken } from './TerraswapToken'; -export declare namespace MirrorGov { - interface InitMsg { - mirror_token: AccAddress; - quorum: string; - threshold: string; - voting_period: number; - effective_delay: number; - proposal_deposit: string; - } - interface HandleUpdateConfig { - update_config: { - owner?: AccAddress; - quorum?: string; - threshold?: string; - voting_period?: number; - effective_delay?: number; - proposal_deposit?: string; - }; - } - type VoteOption = 'yes' | 'no'; - interface HandleCastVote { - cast_vote: { - poll_id: number; - vote: VoteOption; - amount: string; - }; - } - interface HandleWithdrawVotingTokens { - withdraw_voting_tokens: { - amount?: string; - }; - } - interface HandleEndPoll { - end_poll: { - poll_id: number; - }; - } - interface HandleExecutePoll { - execute_poll: { - poll_id: number; - }; - } - interface HookStakeVotingTokens { - stake_voting_tokens: EmptyObject; - } - interface ExecuteMsg { - contract: AccAddress; - msg: string; - } - interface HookCreatePoll { - create_poll: { - title: string; - description: string; - link?: string; - execute_msg?: ExecuteMsg; - }; - } - interface QueryConfig { - config: EmptyObject; - } - interface QueryState { - state: EmptyObject; - } - interface QueryStaker { - staker: { - address: AccAddress; - }; - } - interface QueryPoll { - poll: { - poll_id: number; - }; - } - type PollStatus = 'in_progress' | 'passed' | 'rejected' | 'executed'; - interface QueryPolls { - polls: { - filter?: PollStatus; - start_after?: number; - limit?: number; - }; - } - interface QueryVoters { - voters: { - poll_id: number; - start_after?: AccAddress; - limit?: number; - }; - } - interface ConfigResponse { - owner: AccAddress; - mirror_token: AccAddress; - quorum: string; - threshold: string; - voting_period: number; - effective_delay: number; - proposal_deposit: string; - } - interface StateResponse { - poll_count: number; - total_share: string; - total_deposit: string; - } - interface PollResponse { - id: number; - creator: AccAddress; - status: PollStatus; - end_height: number; - title: string; - description: string; - link?: string; - deposit_amount: string; - execute_data?: ExecuteMsg; - yes_votes: string; - no_votes: string; - } - interface PollsResponse { - polls: Array; - } - interface PollCountResponse { - poll_count: number; - } - interface VoterInfo { - vote: VoteOption; - share: string; - } - interface StakerResponse { - balance: string; - share: string; - locked_share: Array<[number, VoterInfo]>; - } - interface VotersResponseItem { - voter: AccAddress; - vote: VoteOption; - share: string; - balance: string; - } - interface VotersResponse { - voters: Array; - } - type HandleMsg = HandleUpdateConfig | HandleCastVote | HandleWithdrawVotingTokens | HandleEndPoll | HandleExecutePoll; - type HookMsg = HookStakeVotingTokens | HookCreatePoll; - type QueryMsg = QueryConfig | QueryState | QueryStaker | QueryPoll | QueryPolls | QueryVoters; -} -export declare class MirrorGov extends ContractClient { - init(init_msg: MirrorGov.InitMsg, migratable: boolean): MsgInstantiateContract; - updateConfig(config: MirrorGov.HandleUpdateConfig['update_config']): MsgExecuteContract; - castVote(poll_id: number, vote: MirrorGov.VoteOption, amount: Numeric.Input): MsgExecuteContract; - withdrawVotingTokens(amount?: Numeric.Input): MsgExecuteContract; - endPoll(poll_id: number): MsgExecuteContract; - executePoll(poll_id: number): MsgExecuteContract; - stakeVotingTokens(terraswap_token: TerraswapToken, amount: Numeric.Input): MsgExecuteContract; - createPoll(terraswap_token: TerraswapToken, deposit_amount: Numeric.Input, title: string, description: string, link?: string, execute_msg?: MirrorGov.ExecuteMsg): MsgExecuteContract; - getConfig(): Promise; - getState(): Promise; - getStaker(address: AccAddress): Promise; - getPoll(poll_id: number): Promise; - getPolls(filter?: MirrorGov.PollStatus, start_after?: number, limit?: number): Promise; - getVoters(poll_id: number, start_after?: AccAddress, limit?: number): Promise; - protected query(query_msg: MirrorGov.QueryMsg): Promise; - protected createExecuteMsg(execute_msg: MirrorGov.HandleMsg, coins?: Coins.Input): MsgExecuteContract; -} diff --git a/dist/contracts/MirrorGov.js b/dist/contracts/MirrorGov.js deleted file mode 100644 index d3746bb7..00000000 --- a/dist/contracts/MirrorGov.js +++ /dev/null @@ -1,202 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MirrorGov = void 0; -var terra_js_1 = require("@terra-money/terra.js"); -var ContractClient_1 = require("./ContractClient"); -function createHookMsg(msg) { - return Buffer.from(JSON.stringify(msg)).toString('base64'); -} -var MirrorGov = /** @class */ (function (_super) { - __extends(MirrorGov, _super); - function MirrorGov() { - return _super !== null && _super.apply(this, arguments) || this; - } - MirrorGov.prototype.init = function (init_msg, migratable) { - return this.createInstantiateMsg(init_msg, {}, migratable); - }; - MirrorGov.prototype.updateConfig = function (config) { - return this.createExecuteMsg({ - update_config: config - }); - }; - MirrorGov.prototype.castVote = function (poll_id, vote, amount) { - return this.createExecuteMsg({ - cast_vote: { - poll_id: poll_id, - vote: vote, - amount: new terra_js_1.Int(amount).toString() - } - }); - }; - MirrorGov.prototype.withdrawVotingTokens = function (amount) { - return this.createExecuteMsg({ - withdraw_voting_tokens: { - amount: amount ? new terra_js_1.Int(amount).toString() : undefined - } - }); - }; - MirrorGov.prototype.endPoll = function (poll_id) { - return this.createExecuteMsg({ - end_poll: { - poll_id: poll_id - } - }); - }; - MirrorGov.prototype.executePoll = function (poll_id) { - return this.createExecuteMsg({ - execute_poll: { - poll_id: poll_id - } - }); - }; - MirrorGov.prototype.stakeVotingTokens = function (terraswap_token, amount) { - if (!this.contractAddress) { - throw new Error('contractAddress not provided - unable to execute message'); - } - return terraswap_token.send(this.contractAddress, amount, createHookMsg({ - stake_voting_tokens: {} - })); - }; - MirrorGov.prototype.createPoll = function (terraswap_token, deposit_amount, title, description, link, execute_msg) { - if (!this.contractAddress) { - throw new Error('contractAddress not provided - unable to execute message'); - } - return terraswap_token.send(this.contractAddress, deposit_amount, createHookMsg({ - create_poll: { - title: title, - description: description, - link: link, - execute_msg: execute_msg - } - })); - }; - MirrorGov.prototype.getConfig = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - config: {} - })]; - }); - }); - }; - MirrorGov.prototype.getState = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - state: {} - })]; - }); - }); - }; - MirrorGov.prototype.getStaker = function (address) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - staker: { - address: address - } - })]; - }); - }); - }; - MirrorGov.prototype.getPoll = function (poll_id) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - poll: { - poll_id: poll_id - } - })]; - }); - }); - }; - MirrorGov.prototype.getPolls = function (filter, start_after, limit) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - polls: { - filter: filter, - start_after: start_after, - limit: limit - } - })]; - }); - }); - }; - MirrorGov.prototype.getVoters = function (poll_id, start_after, limit) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - voters: { - poll_id: poll_id, - start_after: start_after, - limit: limit - } - })]; - }); - }); - }; - MirrorGov.prototype.query = function (query_msg) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, _super.prototype.query.call(this, query_msg)]; - }); - }); - }; - MirrorGov.prototype.createExecuteMsg = function (execute_msg, coins) { - if (coins === void 0) { coins = {}; } - return _super.prototype.createExecuteMsg.call(this, execute_msg, coins); - }; - return MirrorGov; -}(ContractClient_1.ContractClient)); -exports.MirrorGov = MirrorGov; -//# sourceMappingURL=MirrorGov.js.map \ No newline at end of file diff --git a/dist/contracts/MirrorGov.js.map b/dist/contracts/MirrorGov.js.map deleted file mode 100644 index 8b8dabcd..00000000 --- a/dist/contracts/MirrorGov.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MirrorGov.js","sourceRoot":"","sources":["../../src/contracts/MirrorGov.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAO+B;AAE/B,mDAAkD;AAyLlD,SAAS,aAAa,CAAC,GAAsB;IAC3C,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC7D,CAAC;AAED;IAA+B,6BAAc;IAA7C;;IAyKA,CAAC;IAxKQ,wBAAI,GAAX,UACE,QAA2B,EAC3B,UAAmB;QAEnB,OAAO,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;IAC7D,CAAC;IAEM,gCAAY,GAAnB,UACE,MAAqD;QAErD,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,aAAa,EAAE,MAAM;SACtB,CAAC,CAAC;IACL,CAAC;IAEM,4BAAQ,GAAf,UACE,OAAe,EACf,IAA0B,EAC1B,MAAqB;QAErB,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,SAAS,EAAE;gBACT,OAAO,SAAA;gBACP,IAAI,MAAA;gBACJ,MAAM,EAAE,IAAI,cAAG,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;aACnC;SACF,CAAC,CAAC;IACL,CAAC;IAEM,wCAAoB,GAA3B,UAA4B,MAAsB;QAChD,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,sBAAsB,EAAE;gBACtB,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,cAAG,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS;aACxD;SACF,CAAC,CAAC;IACL,CAAC;IAEM,2BAAO,GAAd,UAAe,OAAe;QAC5B,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,QAAQ,EAAE;gBACR,OAAO,SAAA;aACR;SACF,CAAC,CAAC;IACL,CAAC;IAEM,+BAAW,GAAlB,UAAmB,OAAe;QAChC,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,YAAY,EAAE;gBACZ,OAAO,SAAA;aACR;SACF,CAAC,CAAC;IACL,CAAC;IAEM,qCAAiB,GAAxB,UACE,eAA+B,EAC/B,MAAqB;QAErB,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;YACzB,MAAM,IAAI,KAAK,CACb,0DAA0D,CAC3D,CAAC;SACH;QAED,OAAO,eAAe,CAAC,IAAI,CACzB,IAAI,CAAC,eAAe,EACpB,MAAM,EACN,aAAa,CAAC;YACZ,mBAAmB,EAAE,EAAE;SACxB,CAAC,CACH,CAAC;IACJ,CAAC;IAEM,8BAAU,GAAjB,UACE,eAA+B,EAC/B,cAA6B,EAC7B,KAAa,EACb,WAAmB,EACnB,IAAa,EACb,WAAkC;QAElC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;YACzB,MAAM,IAAI,KAAK,CACb,0DAA0D,CAC3D,CAAC;SACH;QAED,OAAO,eAAe,CAAC,IAAI,CACzB,IAAI,CAAC,eAAe,EACpB,cAAc,EACd,aAAa,CAAC;YACZ,WAAW,EAAE;gBACX,KAAK,OAAA;gBACL,WAAW,aAAA;gBACX,IAAI,MAAA;gBACJ,WAAW,aAAA;aACZ;SACF,CAAC,CACH,CAAC;IACJ,CAAC;IAEY,6BAAS,GAAtB;;;gBACE,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,MAAM,EAAE,EAAE;qBACX,CAAC,EAAC;;;KACJ;IAEY,4BAAQ,GAArB;;;gBACE,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,KAAK,EAAE,EAAE;qBACV,CAAC,EAAC;;;KACJ;IAEY,6BAAS,GAAtB,UACE,OAAmB;;;gBAEnB,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,MAAM,EAAE;4BACN,OAAO,SAAA;yBACR;qBACF,CAAC,EAAC;;;KACJ;IAEY,2BAAO,GAApB,UAAqB,OAAe;;;gBAClC,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,IAAI,EAAE;4BACJ,OAAO,SAAA;yBACR;qBACF,CAAC,EAAC;;;KACJ;IAEY,4BAAQ,GAArB,UACE,MAA6B,EAC7B,WAAoB,EACpB,KAAc;;;gBAEd,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,KAAK,EAAE;4BACL,MAAM,QAAA;4BACN,WAAW,aAAA;4BACX,KAAK,OAAA;yBACN;qBACF,CAAC,EAAC;;;KACJ;IAEY,6BAAS,GAAtB,UACE,OAAe,EACf,WAAwB,EACxB,KAAc;;;gBAEd,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,MAAM,EAAE;4BACN,OAAO,SAAA;4BACP,WAAW,aAAA;4BACX,KAAK,OAAA;yBACN;qBACF,CAAC,EAAC;;;KACJ;IAEe,yBAAK,GAArB,UAAyB,SAA6B;;;gBACpD,sBAAO,iBAAM,KAAK,YAAC,SAAS,CAAC,EAAC;;;KAC/B;IAES,oCAAgB,GAA1B,UACE,WAAgC,EAChC,KAAuB;QAAvB,sBAAA,EAAA,UAAuB;QAEvB,OAAO,iBAAM,gBAAgB,YAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IACpD,CAAC;IACH,gBAAC;AAAD,CAAC,AAzKD,CAA+B,+BAAc,GAyK5C;AAzKY,8BAAS"} \ No newline at end of file diff --git a/dist/contracts/MirrorMint.d.ts b/dist/contracts/MirrorMint.d.ts deleted file mode 100644 index 6181506e..00000000 --- a/dist/contracts/MirrorMint.d.ts +++ /dev/null @@ -1,148 +0,0 @@ -import { AccAddress, MsgExecuteContract, Coins, Numeric, MsgInstantiateContract } from '@terra-money/terra.js'; -import { EmptyObject } from '../utils/EmptyObject'; -import { AssetInfo, Asset } from '../utils/Asset'; -import { ContractClient } from './ContractClient'; -import { TerraswapToken } from './TerraswapToken'; -export declare namespace MirrorMint { - interface InitMsg { - owner: AccAddress; - oracle: AccAddress; - base_asset_info: AssetInfo; - token_code_id: number; - } - interface HandleUpdateConfig { - update_config: { - owner?: AccAddress; - token_code_id?: number; - }; - } - interface HandleUpdateAsset { - udpate_asset: { - asset_token: AccAddress; - auction_discount?: string; - min_collateral_ratio?: string; - }; - } - interface HandleRegisterAsset { - register_asset: { - asset_token: AccAddress; - auction_discount: string; - min_collateral_ratio: string; - }; - } - interface HandleRegisterMigration { - register_migration: { - asset_token: AccAddress; - end_price: string; - }; - } - interface HandleOpenPosition { - open_position: { - collateral: Asset; - asset_info: AssetInfo; - collateral_ratio: string; - }; - } - interface HandleDeposit { - deposit: { - position_idx: string; - collateral: Asset; - }; - } - interface HandleWithdraw { - withdraw: { - position_idx: string; - collateral: Asset; - }; - } - interface HandleMint { - mint: { - position_idx: string; - asset: Asset; - }; - } - interface HookOpenPosition { - open_position: { - asset_info: AssetInfo; - collateral_ratio: string; - }; - } - interface HookDeposit { - deposit: { - position_idx: string; - }; - } - interface HookBurn { - burn: { - position_idx: string; - }; - } - interface HookAuction { - auction: { - position_idx: string; - }; - } - interface QueryConfig { - config: EmptyObject; - } - interface QueryAssetConfig { - asset_config: { - asset_token: AccAddress; - }; - } - interface QueryPosition { - position: { - position_idx: string; - }; - } - interface QueryPositions { - positions: { - owner_addr: AccAddress; - start_after?: string; - limit?: number; - }; - } - interface ConfigResponse { - owner: AccAddress; - oracle: AccAddress; - base_asset_info: AssetInfo; - token_code_id: number; - } - interface AssetConfigResponse { - token: AccAddress; - auction_discount: string; - min_collateral_ratio: string; - end_price?: string; - } - interface PositionResponse { - idx: string; - owner: AccAddress; - collateral: Asset; - asset: Asset; - } - interface PositionsResponse { - positions: Array; - } - type HandleMsg = HandleUpdateConfig | HandleUpdateAsset | HandleRegisterAsset | HandleRegisterMigration | HandleOpenPosition | HandleDeposit | HandleWithdraw | HandleMint; - type HookMsg = HookAuction | HookBurn | HookDeposit | HookOpenPosition; - type QueryMsg = QueryConfig | QueryAssetConfig | QueryPosition | QueryPositions; -} -export declare class MirrorMint extends ContractClient { - init(init_msg: MirrorMint.InitMsg, migratable: boolean): MsgInstantiateContract; - updateConfig(config: MirrorMint.HandleUpdateConfig['update_config']): MsgExecuteContract; - updateAsset(asset_token: AccAddress, auction_discount?: Numeric.Input, min_collateral_ratio?: Numeric.Input): MsgExecuteContract; - registerAsset(asset_token: AccAddress, auction_discount: Numeric.Input, min_collateral_ratio: Numeric.Input): MsgExecuteContract; - registerMigration(asset_token: AccAddress, end_price: Numeric.Input): MsgExecuteContract; - openPosition(collateral: Asset, asset_info: AssetInfo, collateral_ratio: Numeric.Input, collateral_token?: TerraswapToken): MsgExecuteContract; - deposit(position_idx: Numeric.Input, collateral: Asset, collateral_token?: TerraswapToken): MsgExecuteContract; - withdraw(position_idx: Numeric.Input, collateral: Asset): MsgExecuteContract; - mint(position_idx: Numeric.Input, asset: Asset): MsgExecuteContract; - burn(position_idx: Numeric.Input, asset: Asset, asset_token: TerraswapToken): MsgExecuteContract; - auction(position_idx: Numeric.Input, asset: Asset, asset_token: TerraswapToken): MsgExecuteContract; - getConfig(): Promise; - getAssetConfig(asset_token: AccAddress): Promise; - getPosition(position_idx: Numeric.Input): Promise; - getPositions(owner_addr?: AccAddress, start_after?: Numeric.Input, limit?: number): Promise; - protected query(query_msg: MirrorMint.QueryMsg): Promise; - protected createExecuteMsg(execute_msg: MirrorMint.HandleMsg, coins?: Coins.Input): MsgExecuteContract; -} diff --git a/dist/contracts/MirrorMint.js b/dist/contracts/MirrorMint.js deleted file mode 100644 index 06434cc2..00000000 --- a/dist/contracts/MirrorMint.js +++ /dev/null @@ -1,241 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MirrorMint = void 0; -var terra_js_1 = require("@terra-money/terra.js"); -var Asset_1 = require("../utils/Asset"); -var ContractClient_1 = require("./ContractClient"); -function createHookMsg(msg) { - return Buffer.from(JSON.stringify(msg)).toString('base64'); -} -var MirrorMint = /** @class */ (function (_super) { - __extends(MirrorMint, _super); - function MirrorMint() { - return _super !== null && _super.apply(this, arguments) || this; - } - MirrorMint.prototype.init = function (init_msg, migratable) { - return this.createInstantiateMsg(init_msg, {}, migratable); - }; - MirrorMint.prototype.updateConfig = function (config) { - return this.createExecuteMsg({ - update_config: config - }); - }; - MirrorMint.prototype.updateAsset = function (asset_token, auction_discount, min_collateral_ratio) { - return this.createExecuteMsg({ - udpate_asset: { - asset_token: asset_token, - auction_discount: auction_discount - ? new terra_js_1.Dec(auction_discount).toFixed() - : undefined, - min_collateral_ratio: min_collateral_ratio - ? new terra_js_1.Dec(min_collateral_ratio).toFixed() - : undefined - } - }); - }; - MirrorMint.prototype.registerAsset = function (asset_token, auction_discount, min_collateral_ratio) { - return this.createExecuteMsg({ - register_asset: { - asset_token: asset_token, - auction_discount: new terra_js_1.Dec(auction_discount).toFixed(), - min_collateral_ratio: new terra_js_1.Dec(min_collateral_ratio).toFixed() - } - }); - }; - MirrorMint.prototype.registerMigration = function (asset_token, end_price) { - return this.createExecuteMsg({ - register_migration: { - asset_token: asset_token, - end_price: new terra_js_1.Dec(end_price).toFixed() - } - }); - }; - MirrorMint.prototype.openPosition = function (collateral, asset_info, collateral_ratio, collateral_token) { - if (!collateral_token) { - if (!Asset_1.isNativeToken(collateral.info)) { - throw new Error('CollateralToken must be provided - unable to open position'); - } - return this.createExecuteMsg({ - open_position: { - collateral: collateral, - asset_info: asset_info, - collateral_ratio: new terra_js_1.Dec(collateral_ratio).toFixed() - } - }, [new terra_js_1.Coin(collateral.info.native_token.denom, collateral.amount)]); - } - if (!this.contractAddress) { - throw new Error('contractAddress not provided - unable to execute message'); - } - return collateral_token.send.call(this, this.contractAddress, collateral.amount, createHookMsg({ - open_position: { - asset_info: asset_info, - collateral_ratio: new terra_js_1.Dec(collateral_ratio).toFixed() - } - })); - }; - MirrorMint.prototype.deposit = function (position_idx, collateral, collateral_token) { - if (!collateral_token) { - if (!Asset_1.isNativeToken(collateral.info)) { - throw new Error('CollateralToken must be provided - unable to open position'); - } - return this.createExecuteMsg({ - deposit: { - position_idx: new terra_js_1.Int(position_idx).toString(), - collateral: collateral - } - }, [new terra_js_1.Coin(collateral.info.native_token.denom, collateral.amount)]); - } - if (!this.contractAddress) { - throw new Error('contractAddress not provided - unable to execute message'); - } - return collateral_token.send.call(this, this.contractAddress, collateral.amount, createHookMsg({ - deposit: { - position_idx: new terra_js_1.Int(position_idx).toString() - } - })); - }; - MirrorMint.prototype.withdraw = function (position_idx, collateral) { - return this.createExecuteMsg({ - withdraw: { - position_idx: new terra_js_1.Int(position_idx).toString(), - collateral: collateral - } - }); - }; - MirrorMint.prototype.mint = function (position_idx, asset) { - return this.createExecuteMsg({ - mint: { - position_idx: new terra_js_1.Int(position_idx).toString(), - asset: asset - } - }); - }; - MirrorMint.prototype.burn = function (position_idx, asset, asset_token) { - if (!this.contractAddress) { - throw new Error('contractAddress not provided - unable to execute message'); - } - return asset_token.send.call(this, this.contractAddress, asset.amount, createHookMsg({ - burn: { - position_idx: new terra_js_1.Int(position_idx).toString() - } - })); - }; - MirrorMint.prototype.auction = function (position_idx, asset, asset_token) { - if (!this.contractAddress) { - throw new Error('contractAddress not provided - unable to execute message'); - } - return asset_token.send(this.contractAddress, asset.amount, createHookMsg({ - auction: { - position_idx: new terra_js_1.Int(position_idx).toString() - } - })); - }; - MirrorMint.prototype.getConfig = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - config: {} - })]; - }); - }); - }; - MirrorMint.prototype.getAssetConfig = function (asset_token) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - asset_config: { - asset_token: asset_token - } - })]; - }); - }); - }; - MirrorMint.prototype.getPosition = function (position_idx) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - position: { - position_idx: new terra_js_1.Int(position_idx).toString() - } - })]; - }); - }); - }; - MirrorMint.prototype.getPositions = function (owner_addr, start_after, limit) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - positions: { - owner_addr: owner_addr ? owner_addr : this.wallet.key.accAddress, - start_after: start_after ? new terra_js_1.Int(start_after).toString() : undefined, - limit: limit - } - })]; - }); - }); - }; - // Typed overloads - MirrorMint.prototype.query = function (query_msg) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, _super.prototype.query.call(this, query_msg)]; - }); - }); - }; - MirrorMint.prototype.createExecuteMsg = function (execute_msg, coins) { - if (coins === void 0) { coins = {}; } - return _super.prototype.createExecuteMsg.call(this, execute_msg, coins); - }; - return MirrorMint; -}(ContractClient_1.ContractClient)); -exports.MirrorMint = MirrorMint; -//# sourceMappingURL=MirrorMint.js.map \ No newline at end of file diff --git a/dist/contracts/MirrorMint.js.map b/dist/contracts/MirrorMint.js.map deleted file mode 100644 index 00e608a5..00000000 --- a/dist/contracts/MirrorMint.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MirrorMint.js","sourceRoot":"","sources":["../../src/contracts/MirrorMint.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAS+B;AAE/B,wCAAiE;AACjE,mDAAkD;AAmKlD,SAAS,aAAa,CAAC,GAAuB;IAC5C,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC7D,CAAC;AAED;IAAgC,8BAAc;IAA9C;;IAuQA,CAAC;IAtQQ,yBAAI,GAAX,UACE,QAA4B,EAC5B,UAAmB;QAEnB,OAAO,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;IAC7D,CAAC;IAEM,iCAAY,GAAnB,UACE,MAAsD;QAEtD,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,aAAa,EAAE,MAAM;SACtB,CAAC,CAAC;IACL,CAAC;IAEM,gCAAW,GAAlB,UACE,WAAuB,EACvB,gBAAgC,EAChC,oBAAoC;QAEpC,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,YAAY,EAAE;gBACZ,WAAW,aAAA;gBACX,gBAAgB,EAAE,gBAAgB;oBAChC,CAAC,CAAC,IAAI,cAAG,CAAC,gBAAgB,CAAC,CAAC,OAAO,EAAE;oBACrC,CAAC,CAAC,SAAS;gBACb,oBAAoB,EAAE,oBAAoB;oBACxC,CAAC,CAAC,IAAI,cAAG,CAAC,oBAAoB,CAAC,CAAC,OAAO,EAAE;oBACzC,CAAC,CAAC,SAAS;aACd;SACF,CAAC,CAAC;IACL,CAAC;IAEM,kCAAa,GAApB,UACE,WAAuB,EACvB,gBAA+B,EAC/B,oBAAmC;QAEnC,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,cAAc,EAAE;gBACd,WAAW,aAAA;gBACX,gBAAgB,EAAE,IAAI,cAAG,CAAC,gBAAgB,CAAC,CAAC,OAAO,EAAE;gBACrD,oBAAoB,EAAE,IAAI,cAAG,CAAC,oBAAoB,CAAC,CAAC,OAAO,EAAE;aAC9D;SACF,CAAC,CAAC;IACL,CAAC;IAEM,sCAAiB,GAAxB,UACE,WAAuB,EACvB,SAAwB;QAExB,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,kBAAkB,EAAE;gBAClB,WAAW,aAAA;gBACX,SAAS,EAAE,IAAI,cAAG,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE;aACxC;SACF,CAAC,CAAC;IACL,CAAC;IAEM,iCAAY,GAAnB,UACE,UAAiB,EACjB,UAAqB,EACrB,gBAA+B,EAC/B,gBAAiC;QAEjC,IAAI,CAAC,gBAAgB,EAAE;YACrB,IAAI,CAAC,qBAAa,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;gBACnC,MAAM,IAAI,KAAK,CACb,4DAA4D,CAC7D,CAAC;aACH;YAED,OAAO,IAAI,CAAC,gBAAgB,CAC1B;gBACE,aAAa,EAAE;oBACb,UAAU,YAAA;oBACV,UAAU,YAAA;oBACV,gBAAgB,EAAE,IAAI,cAAG,CAAC,gBAAgB,CAAC,CAAC,OAAO,EAAE;iBACtD;aACF,EACD,CAAC,IAAI,eAAI,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAClE,CAAC;SACH;QAED,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;YACzB,MAAM,IAAI,KAAK,CACb,0DAA0D,CAC3D,CAAC;SACH;QAED,OAAO,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAC/B,IAAI,EACJ,IAAI,CAAC,eAAe,EACpB,UAAU,CAAC,MAAM,EACjB,aAAa,CAAC;YACZ,aAAa,EAAE;gBACb,UAAU,YAAA;gBACV,gBAAgB,EAAE,IAAI,cAAG,CAAC,gBAAgB,CAAC,CAAC,OAAO,EAAE;aACtD;SACF,CAAC,CACH,CAAC;IACJ,CAAC;IAEM,4BAAO,GAAd,UACE,YAA2B,EAC3B,UAAiB,EACjB,gBAAiC;QAEjC,IAAI,CAAC,gBAAgB,EAAE;YACrB,IAAI,CAAC,qBAAa,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;gBACnC,MAAM,IAAI,KAAK,CACb,4DAA4D,CAC7D,CAAC;aACH;YAED,OAAO,IAAI,CAAC,gBAAgB,CAC1B;gBACE,OAAO,EAAE;oBACP,YAAY,EAAE,IAAI,cAAG,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;oBAC9C,UAAU,YAAA;iBACX;aACF,EACD,CAAC,IAAI,eAAI,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAClE,CAAC;SACH;QAED,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;YACzB,MAAM,IAAI,KAAK,CACb,0DAA0D,CAC3D,CAAC;SACH;QAED,OAAO,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAC/B,IAAI,EACJ,IAAI,CAAC,eAAe,EACpB,UAAU,CAAC,MAAM,EACjB,aAAa,CAAC;YACZ,OAAO,EAAE;gBACP,YAAY,EAAE,IAAI,cAAG,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;aAC/C;SACF,CAAC,CACH,CAAC;IACJ,CAAC;IAEM,6BAAQ,GAAf,UACE,YAA2B,EAC3B,UAAiB;QAEjB,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,QAAQ,EAAE;gBACR,YAAY,EAAE,IAAI,cAAG,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;gBAC9C,UAAU,YAAA;aACX;SACF,CAAC,CAAC;IACL,CAAC;IAEM,yBAAI,GAAX,UAAY,YAA2B,EAAE,KAAY;QACnD,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,IAAI,EAAE;gBACJ,YAAY,EAAE,IAAI,cAAG,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;gBAC9C,KAAK,OAAA;aACN;SACF,CAAC,CAAC;IACL,CAAC;IAEM,yBAAI,GAAX,UACE,YAA2B,EAC3B,KAAY,EACZ,WAA2B;QAE3B,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;YACzB,MAAM,IAAI,KAAK,CACb,0DAA0D,CAC3D,CAAC;SACH;QAED,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAC1B,IAAI,EACJ,IAAI,CAAC,eAAe,EACpB,KAAK,CAAC,MAAM,EACZ,aAAa,CAAC;YACZ,IAAI,EAAE;gBACJ,YAAY,EAAE,IAAI,cAAG,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;aAC/C;SACF,CAAC,CACH,CAAC;IACJ,CAAC;IAEM,4BAAO,GAAd,UACE,YAA2B,EAC3B,KAAY,EACZ,WAA2B;QAE3B,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;YACzB,MAAM,IAAI,KAAK,CACb,0DAA0D,CAC3D,CAAC;SACH;QAED,OAAO,WAAW,CAAC,IAAI,CACrB,IAAI,CAAC,eAAe,EACpB,KAAK,CAAC,MAAM,EACZ,aAAa,CAAC;YACZ,OAAO,EAAE;gBACP,YAAY,EAAE,IAAI,cAAG,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;aAC/C;SACF,CAAC,CACH,CAAC;IACJ,CAAC;IAEY,8BAAS,GAAtB;;;gBACE,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,MAAM,EAAE,EAAE;qBACX,CAAC,EAAC;;;KACJ;IAEY,mCAAc,GAA3B,UACE,WAAuB;;;gBAEvB,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,YAAY,EAAE;4BACZ,WAAW,aAAA;yBACZ;qBACF,CAAC,EAAC;;;KACJ;IAEY,gCAAW,GAAxB,UACE,YAA2B;;;gBAE3B,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,QAAQ,EAAE;4BACR,YAAY,EAAE,IAAI,cAAG,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;yBAC/C;qBACF,CAAC,EAAC;;;KACJ;IAEY,iCAAY,GAAzB,UACE,UAAuB,EACvB,WAA2B,EAC3B,KAAc;;;gBAEd,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,SAAS,EAAE;4BACT,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU;4BAChE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,IAAI,cAAG,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS;4BACtE,KAAK,OAAA;yBACN;qBACF,CAAC,EAAC;;;KACJ;IAED,kBAAkB;IAEF,0BAAK,GAArB,UAAyB,SAA8B;;;gBACrD,sBAAO,iBAAM,KAAK,YAAC,SAAS,CAAC,EAAC;;;KAC/B;IAES,qCAAgB,GAA1B,UACE,WAAiC,EACjC,KAAuB;QAAvB,sBAAA,EAAA,UAAuB;QAEvB,OAAO,iBAAM,gBAAgB,YAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IACpD,CAAC;IACH,iBAAC;AAAD,CAAC,AAvQD,CAAgC,+BAAc,GAuQ7C;AAvQY,gCAAU"} \ No newline at end of file diff --git a/dist/contracts/MirrorOracle.d.ts b/dist/contracts/MirrorOracle.d.ts deleted file mode 100644 index fe621586..00000000 --- a/dist/contracts/MirrorOracle.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { AccAddress, Coins, Numeric, MsgInstantiateContract, MsgExecuteContract } from '@terra-money/terra.js'; -import { AssetInfo } from '../utils/Asset'; -import { ContractClient } from './ContractClient'; -import { EmptyObject } from '../utils/EmptyObject'; -export declare namespace MirrorOracle { - interface InitMsg { - owner: AccAddress; - base_asset_info: AssetInfo; - } - interface HandleUpdateConfig { - update_config: { - owner?: AccAddress; - }; - } - interface HandleRegisterAsset { - register_asset: { - asset_token: AccAddress; - feeder: AccAddress; - }; - } - interface PriceInfo { - asset_token: AccAddress; - price: string; - } - interface HandleFeedPrice { - feed_price: { - price_infos: Array; - }; - } - interface QueryConfig { - config: EmptyObject; - } - interface QueryAsset { - asset: { - asset_token: AccAddress; - }; - } - interface QueryPrice { - price: { - asset_token: AccAddress; - }; - } - interface QueryPrices { - prices: EmptyObject; - } - interface ConfigResponse { - owner: AccAddress; - base_asset_info: AssetInfo; - } - interface AssetResponse { - asset_token: AccAddress; - feeder: AccAddress; - } - interface PriceResponse { - price: string; - last_update_time: number; - asset_token: AccAddress; - } - interface PricesResponse { - prices: Array; - } - type HandleMsg = HandleUpdateConfig | HandleRegisterAsset | HandleFeedPrice; - type QueryMsg = QueryConfig | QueryAsset | QueryPrice | QueryPrices; -} -export declare class MirrorOracle extends ContractClient { - init(init_msg: MirrorOracle.InitMsg, migratable: boolean): MsgInstantiateContract; - updateConfig(config: MirrorOracle.HandleUpdateConfig['update_config']): MsgExecuteContract; - registerAsset(asset_token: AccAddress, feeder: AccAddress): MsgExecuteContract; - feedPrice(price_infos: Array<{ - asset_token: AccAddress; - price: Numeric.Input; - }>): MsgExecuteContract; - getConfig(): Promise; - getAsset(asset_token: AccAddress): Promise; - getPrice(asset_token: AccAddress): Promise; - getPrices(): Promise; - protected query(query_msg: MirrorOracle.QueryMsg): Promise; - protected createExecuteMsg(execute_msg: MirrorOracle.HandleMsg, coins?: Coins.Input): MsgExecuteContract; -} diff --git a/dist/contracts/MirrorOracle.js b/dist/contracts/MirrorOracle.js deleted file mode 100644 index 4a7a8c4f..00000000 --- a/dist/contracts/MirrorOracle.js +++ /dev/null @@ -1,137 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MirrorOracle = void 0; -var terra_js_1 = require("@terra-money/terra.js"); -var ContractClient_1 = require("./ContractClient"); -var MirrorOracle = /** @class */ (function (_super) { - __extends(MirrorOracle, _super); - function MirrorOracle() { - return _super !== null && _super.apply(this, arguments) || this; - } - MirrorOracle.prototype.init = function (init_msg, migratable) { - return this.createInstantiateMsg(init_msg, {}, migratable); - }; - MirrorOracle.prototype.updateConfig = function (config) { - return this.createExecuteMsg({ - update_config: config - }); - }; - MirrorOracle.prototype.registerAsset = function (asset_token, feeder) { - return this.createExecuteMsg({ - register_asset: { - asset_token: asset_token, - feeder: feeder - } - }); - }; - MirrorOracle.prototype.feedPrice = function (price_infos) { - return this.createExecuteMsg({ - feed_price: { - price_infos: price_infos.map(function (pi) { return ({ - asset_token: pi.asset_token, - price: new terra_js_1.Dec(pi.price).toFixed() - }); }) - } - }); - }; - MirrorOracle.prototype.getConfig = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - config: {} - })]; - }); - }); - }; - MirrorOracle.prototype.getAsset = function (asset_token) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - asset: { asset_token: asset_token } - })]; - }); - }); - }; - MirrorOracle.prototype.getPrice = function (asset_token) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - price: { asset_token: asset_token } - })]; - }); - }); - }; - MirrorOracle.prototype.getPrices = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - prices: {} - })]; - }); - }); - }; - // Typed overloads - MirrorOracle.prototype.query = function (query_msg) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, _super.prototype.query.call(this, query_msg)]; - }); - }); - }; - MirrorOracle.prototype.createExecuteMsg = function (execute_msg, coins) { - if (coins === void 0) { coins = {}; } - return _super.prototype.createExecuteMsg.call(this, execute_msg, coins); - }; - return MirrorOracle; -}(ContractClient_1.ContractClient)); -exports.MirrorOracle = MirrorOracle; -//# sourceMappingURL=MirrorOracle.js.map \ No newline at end of file diff --git a/dist/contracts/MirrorOracle.js.map b/dist/contracts/MirrorOracle.js.map deleted file mode 100644 index ddeb8682..00000000 --- a/dist/contracts/MirrorOracle.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MirrorOracle.js","sourceRoot":"","sources":["../../src/contracts/MirrorOracle.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAO+B;AAE/B,mDAAkD;AA6ElD;IAAkC,gCAAc;IAAhD;;IAoFA,CAAC;IAnFQ,2BAAI,GAAX,UACE,QAA8B,EAC9B,UAAmB;QAEnB,OAAO,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;IAC7D,CAAC;IAEM,mCAAY,GAAnB,UACE,MAAwD;QAExD,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,aAAa,EAAE,MAAM;SACtB,CAAC,CAAC;IACL,CAAC;IAEM,oCAAa,GAApB,UACE,WAAuB,EACvB,MAAkB;QAElB,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,cAAc,EAAE;gBACd,WAAW,aAAA;gBACX,MAAM,QAAA;aACP;SACF,CAAC,CAAC;IACL,CAAC;IAEM,gCAAS,GAAhB,UACE,WAGE;QAEF,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,UAAU,EAAE;gBACV,WAAW,EAAE,WAAW,CAAC,GAAG,CAAC,UAAC,EAAE,IAAK,OAAA,CAAC;oBACpC,WAAW,EAAE,EAAE,CAAC,WAAW;oBAC3B,KAAK,EAAE,IAAI,cAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE;iBACnC,CAAC,EAHmC,CAGnC,CAAC;aACJ;SACF,CAAC,CAAC;IACL,CAAC;IAEY,gCAAS,GAAtB;;;gBACE,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,MAAM,EAAE,EAAE;qBACX,CAAC,EAAC;;;KACJ;IAEY,+BAAQ,GAArB,UACE,WAAuB;;;gBAEvB,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,KAAK,EAAE,EAAE,WAAW,aAAA,EAAE;qBACvB,CAAC,EAAC;;;KACJ;IAEY,+BAAQ,GAArB,UACE,WAAuB;;;gBAEvB,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,KAAK,EAAE,EAAE,WAAW,aAAA,EAAE;qBACvB,CAAC,EAAC;;;KACJ;IAEY,gCAAS,GAAtB;;;gBACE,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,MAAM,EAAE,EAAE;qBACX,CAAC,EAAC;;;KACJ;IAED,kBAAkB;IAEF,4BAAK,GAArB,UAAyB,SAAgC;;;gBACvD,sBAAO,iBAAM,KAAK,YAAC,SAAS,CAAC,EAAC;;;KAC/B;IAES,uCAAgB,GAA1B,UACE,WAAmC,EACnC,KAAuB;QAAvB,sBAAA,EAAA,UAAuB;QAEvB,OAAO,iBAAM,gBAAgB,YAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IACpD,CAAC;IACH,mBAAC;AAAD,CAAC,AApFD,CAAkC,+BAAc,GAoF/C;AApFY,oCAAY"} \ No newline at end of file diff --git a/dist/contracts/MirrorStaking.d.ts b/dist/contracts/MirrorStaking.d.ts deleted file mode 100644 index 28a69c83..00000000 --- a/dist/contracts/MirrorStaking.d.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { AccAddress, Coins, Numeric, MsgInstantiateContract, MsgExecuteContract } from '@terra-money/terra.js'; -import { ContractClient } from './ContractClient'; -import { EmptyObject } from '../utils/EmptyObject'; -import { TerraswapToken } from './TerraswapToken'; -export declare namespace MirrorStaking { - interface InitMsg { - owner: AccAddress; - mirror_token: AccAddress; - } - interface HandleUpdateConfig { - update_config: { - asset_token?: AccAddress; - staking_token?: AccAddress; - }; - } - interface HandleRegisterAsset { - register_asset: { - asset_token: AccAddress; - staking_token: AccAddress; - }; - } - interface HandleUnbond { - unbond: { - asset_token: AccAddress; - amount: string; - }; - } - interface HandleWithdraw { - withdraw: { - asset_token?: AccAddress; - }; - } - interface HookBond { - bond: { - asset_token: AccAddress; - }; - } - interface HookDepositReward { - deposit_reward: { - asset_token: AccAddress; - }; - } - interface QueryConfig { - config: EmptyObject; - } - interface QueryPoolInfo { - pool_info: { - asset_token: AccAddress; - }; - } - interface QueryRewardInfo { - reward_info: { - staker: AccAddress; - asset_token?: AccAddress; - }; - } - interface ConfigResponse { - owner: AccAddress; - mirror_token: AccAddress; - } - interface PoolInfoResponse { - asset_token: AccAddress; - staking_token: AccAddress; - total_bond_amount: string; - reward_index: string; - } - interface RewardInfoResponseItem { - asset_token: AccAddress; - index: string; - bond_amount: string; - pending_reward: string; - } - interface RewardInfoResponse { - staker: AccAddress; - reward_infos: Array; - } - type HandleMsg = HandleUpdateConfig | HandleRegisterAsset | HandleUnbond | HandleWithdraw; - type HookMsg = HookBond | HookDepositReward; - type QueryMsg = QueryConfig | QueryPoolInfo | QueryRewardInfo; -} -export declare class MirrorStaking extends ContractClient { - init(init_msg: MirrorStaking.InitMsg, migratable: boolean): MsgInstantiateContract; - updateConfig(config: MirrorStaking.HandleUpdateConfig['update_config']): MsgExecuteContract; - registerAsset(asset_token: AccAddress, staking_token: AccAddress): MsgExecuteContract; - unbond(asset_token: AccAddress, amount: Numeric.Input): MsgExecuteContract; - withdraw(asset_token?: AccAddress): MsgExecuteContract; - bond(asset_token: AccAddress, amount: Numeric.Input, lp_token: TerraswapToken): MsgExecuteContract; - depositReward(asset_token: AccAddress, amount: Numeric.Input, mirror_token: TerraswapToken): MsgExecuteContract; - getConfig(): Promise; - getPoolInfo(asset_token: AccAddress): Promise; - getRewardInfo(staker: AccAddress, asset_token?: AccAddress): Promise; - protected query(query_msg: MirrorStaking.QueryMsg): Promise; - protected createExecuteMsg(execute_msg: MirrorStaking.HandleMsg, coins?: Coins.Input): MsgExecuteContract; -} diff --git a/dist/contracts/MirrorStaking.js b/dist/contracts/MirrorStaking.js deleted file mode 100644 index 3227ff44..00000000 --- a/dist/contracts/MirrorStaking.js +++ /dev/null @@ -1,164 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MirrorStaking = void 0; -/* eslint-disable camelcase */ -var terra_js_1 = require("@terra-money/terra.js"); -var ContractClient_1 = require("./ContractClient"); -function createHookMsg(msg) { - return Buffer.from(JSON.stringify(msg)).toString('base64'); -} -var MirrorStaking = /** @class */ (function (_super) { - __extends(MirrorStaking, _super); - function MirrorStaking() { - return _super !== null && _super.apply(this, arguments) || this; - } - MirrorStaking.prototype.init = function (init_msg, migratable) { - return this.createInstantiateMsg(init_msg, {}, migratable); - }; - MirrorStaking.prototype.updateConfig = function (config) { - return this.createExecuteMsg({ - update_config: config - }); - }; - MirrorStaking.prototype.registerAsset = function (asset_token, staking_token) { - return this.createExecuteMsg({ - register_asset: { - asset_token: asset_token, - staking_token: staking_token - } - }); - }; - MirrorStaking.prototype.unbond = function (asset_token, amount) { - return this.createExecuteMsg({ - unbond: { - asset_token: asset_token, - amount: new terra_js_1.Int(amount).toString() - } - }); - }; - MirrorStaking.prototype.withdraw = function (asset_token) { - return this.createExecuteMsg({ - withdraw: { - asset_token: asset_token - } - }); - }; - MirrorStaking.prototype.bond = function (asset_token, amount, lp_token) { - if (!this.contractAddress) { - throw new Error('contractAddress not provided - unable to execute message'); - } - if (this.wallet.key.accAddress !== lp_token.wallet.key.accAddress) { - throw new Error('two contract instance is not from the same key'); - } - return lp_token.send(this.contractAddress, amount, createHookMsg({ - bond: { - asset_token: asset_token - } - })); - }; - MirrorStaking.prototype.depositReward = function (asset_token, amount, mirror_token) { - if (!this.contractAddress) { - throw new Error('contractAddress not provided - unable to execute message'); - } - return mirror_token.send(this.contractAddress, amount, createHookMsg({ - deposit_reward: { - asset_token: asset_token - } - })); - }; - MirrorStaking.prototype.getConfig = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - config: {} - })]; - }); - }); - }; - MirrorStaking.prototype.getPoolInfo = function (asset_token) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - pool_info: { - asset_token: asset_token - } - })]; - }); - }); - }; - MirrorStaking.prototype.getRewardInfo = function (staker, asset_token) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - reward_info: { - staker: staker, - asset_token: asset_token - } - })]; - }); - }); - }; - MirrorStaking.prototype.query = function (query_msg) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, _super.prototype.query.call(this, query_msg)]; - }); - }); - }; - MirrorStaking.prototype.createExecuteMsg = function (execute_msg, coins) { - if (coins === void 0) { coins = {}; } - return _super.prototype.createExecuteMsg.call(this, execute_msg, coins); - }; - return MirrorStaking; -}(ContractClient_1.ContractClient)); -exports.MirrorStaking = MirrorStaking; -//# sourceMappingURL=MirrorStaking.js.map \ No newline at end of file diff --git a/dist/contracts/MirrorStaking.js.map b/dist/contracts/MirrorStaking.js.map deleted file mode 100644 index 9137e267..00000000 --- a/dist/contracts/MirrorStaking.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MirrorStaking.js","sourceRoot":"","sources":["../../src/contracts/MirrorStaking.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8BAA8B;AAC9B,kDAO+B;AAC/B,mDAAkD;AAqGlD,SAAS,aAAa,CAAC,GAA0B;IAC/C,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC7D,CAAC;AAED;IAAmC,iCAAc;IAAjD;;IAsIA,CAAC;IArIQ,4BAAI,GAAX,UACE,QAA+B,EAC/B,UAAmB;QAEnB,OAAO,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;IAC7D,CAAC;IAEM,oCAAY,GAAnB,UACE,MAAyD;QAEzD,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,aAAa,EAAE,MAAM;SACtB,CAAC,CAAC;IACL,CAAC;IAEM,qCAAa,GAApB,UACE,WAAuB,EACvB,aAAyB;QAEzB,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,cAAc,EAAE;gBACd,WAAW,aAAA;gBACX,aAAa,eAAA;aACd;SACF,CAAC,CAAC;IACL,CAAC;IAEM,8BAAM,GAAb,UACE,WAAuB,EACvB,MAAqB;QAErB,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,MAAM,EAAE;gBACN,WAAW,aAAA;gBACX,MAAM,EAAE,IAAI,cAAG,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;aACnC;SACF,CAAC,CAAC;IACL,CAAC;IAEM,gCAAQ,GAAf,UAAgB,WAAwB;QACtC,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,QAAQ,EAAE;gBACR,WAAW,aAAA;aACZ;SACF,CAAC,CAAC;IACL,CAAC;IAEM,4BAAI,GAAX,UACE,WAAuB,EACvB,MAAqB,EACrB,QAAwB;QAExB,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;YACzB,MAAM,IAAI,KAAK,CACb,0DAA0D,CAC3D,CAAC;SACH;QAED,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,KAAK,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE;YACjE,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;SACnE;QAED,OAAO,QAAQ,CAAC,IAAI,CAClB,IAAI,CAAC,eAAe,EACpB,MAAM,EACN,aAAa,CAAC;YACZ,IAAI,EAAE;gBACJ,WAAW,aAAA;aACZ;SACF,CAAC,CACH,CAAC;IACJ,CAAC;IAEM,qCAAa,GAApB,UACE,WAAuB,EACvB,MAAqB,EACrB,YAA4B;QAE5B,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;YACzB,MAAM,IAAI,KAAK,CACb,0DAA0D,CAC3D,CAAC;SACH;QAED,OAAO,YAAY,CAAC,IAAI,CACtB,IAAI,CAAC,eAAe,EACpB,MAAM,EACN,aAAa,CAAC;YACZ,cAAc,EAAE;gBACd,WAAW,aAAA;aACZ;SACF,CAAC,CACH,CAAC;IACJ,CAAC;IAEY,iCAAS,GAAtB;;;gBACE,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,MAAM,EAAE,EAAE;qBACX,CAAC,EAAC;;;KACJ;IAEY,mCAAW,GAAxB,UACE,WAAuB;;;gBAEvB,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,SAAS,EAAE;4BACT,WAAW,aAAA;yBACZ;qBACF,CAAC,EAAC;;;KACJ;IAEY,qCAAa,GAA1B,UACE,MAAkB,EAClB,WAAwB;;;gBAExB,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,WAAW,EAAE;4BACX,MAAM,QAAA;4BACN,WAAW,aAAA;yBACZ;qBACF,CAAC,EAAC;;;KACJ;IAEe,6BAAK,GAArB,UAAyB,SAAiC;;;gBACxD,sBAAO,iBAAM,KAAK,YAAC,SAAS,CAAC,EAAC;;;KAC/B;IAES,wCAAgB,GAA1B,UACE,WAAoC,EACpC,KAAuB;QAAvB,sBAAA,EAAA,UAAuB;QAEvB,OAAO,iBAAM,gBAAgB,YAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IACpD,CAAC;IACH,oBAAC;AAAD,CAAC,AAtID,CAAmC,+BAAc,GAsIhD;AAtIY,sCAAa"} \ No newline at end of file diff --git a/dist/contracts/TerraswapFactory.d.ts b/dist/contracts/TerraswapFactory.d.ts deleted file mode 100644 index f60ece1c..00000000 --- a/dist/contracts/TerraswapFactory.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { AccAddress, MsgExecuteContract, Coins, MsgInstantiateContract, Numeric } from '@terra-money/terra.js'; -import { EmptyObject } from '../utils/EmptyObject'; -import { AssetInfo } from '../utils/Asset'; -import { ContractClient } from './ContractClient'; -export declare namespace TerraswapFactory { - interface InitHook { - msg: string; - contract_addr: AccAddress; - } - interface InitMsg { - pair_code_id: number; - token_code_id: number; - init_hook?: InitHook; - } - interface HandleUpdateConfig { - update_config: { - owner?: AccAddress; - token_code_id?: number; - pair_code_id?: number; - }; - } - interface HandleCreatePair { - create_pair: { - pair_owner: AccAddress; - commission_collector: AccAddress; - lp_commission: string; - owner_commission: string; - asset_infos: [AssetInfo, AssetInfo]; - init_hook?: InitHook; - }; - } - interface QueryConfig { - config: EmptyObject; - } - interface QueryPair { - pair: { - asset_infos: [AssetInfo, AssetInfo]; - }; - } - interface ConfigResponse { - owner: AccAddress; - pair_code_id: number; - token_code_id: number; - } - interface PairResponse { - owner: AccAddress; - contract_addr: AccAddress; - asset_infos: [AssetInfo, AssetInfo]; - } - type HandleMsg = HandleUpdateConfig | HandleCreatePair; - type QueryMsg = QueryConfig | QueryPair; -} -export declare class TerraswapFactory extends ContractClient { - init(init_msg: TerraswapFactory.InitMsg, migratable: boolean): MsgInstantiateContract; - updateConfig(config: TerraswapFactory.HandleUpdateConfig['update_config']): MsgExecuteContract; - createPair(pair_owner: AccAddress, commission_collector: AccAddress, lp_commission: Numeric.Input, owner_commission: Numeric.Input, asset_infos: [AssetInfo, AssetInfo], init_hook?: TerraswapFactory.InitHook): MsgExecuteContract; - getConfig(): Promise; - getPair(asset_infos: [AssetInfo, AssetInfo]): Promise; - protected query(query_msg: TerraswapFactory.QueryMsg): Promise; - protected createExecuteMsg(execute_msg: TerraswapFactory.HandleMsg, coins?: Coins.Input): MsgExecuteContract; -} diff --git a/dist/contracts/TerraswapFactory.js b/dist/contracts/TerraswapFactory.js deleted file mode 100644 index b1f12c07..00000000 --- a/dist/contracts/TerraswapFactory.js +++ /dev/null @@ -1,112 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.TerraswapFactory = void 0; -var terra_js_1 = require("@terra-money/terra.js"); -var ContractClient_1 = require("./ContractClient"); -var TerraswapFactory = /** @class */ (function (_super) { - __extends(TerraswapFactory, _super); - function TerraswapFactory() { - return _super !== null && _super.apply(this, arguments) || this; - } - TerraswapFactory.prototype.init = function (init_msg, migratable) { - return this.createInstantiateMsg(init_msg, {}, migratable); - }; - TerraswapFactory.prototype.updateConfig = function (config) { - return this.createExecuteMsg({ - update_config: config - }); - }; - TerraswapFactory.prototype.createPair = function (pair_owner, commission_collector, lp_commission, owner_commission, asset_infos, init_hook) { - return this.createExecuteMsg({ - create_pair: { - pair_owner: pair_owner, - commission_collector: commission_collector, - lp_commission: new terra_js_1.Dec(lp_commission).toString(), - owner_commission: new terra_js_1.Dec(owner_commission).toString(), - asset_infos: asset_infos, - init_hook: init_hook - } - }); - }; - TerraswapFactory.prototype.getConfig = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - config: {} - })]; - }); - }); - }; - TerraswapFactory.prototype.getPair = function (asset_infos) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - pair: { asset_infos: asset_infos } - })]; - }); - }); - }; - TerraswapFactory.prototype.query = function (query_msg) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, _super.prototype.query.call(this, query_msg)]; - }); - }); - }; - TerraswapFactory.prototype.createExecuteMsg = function (execute_msg, coins) { - if (coins === void 0) { coins = {}; } - return _super.prototype.createExecuteMsg.call(this, execute_msg, coins); - }; - return TerraswapFactory; -}(ContractClient_1.ContractClient)); -exports.TerraswapFactory = TerraswapFactory; -//# sourceMappingURL=TerraswapFactory.js.map \ No newline at end of file diff --git a/dist/contracts/TerraswapFactory.js.map b/dist/contracts/TerraswapFactory.js.map deleted file mode 100644 index ba66c13c..00000000 --- a/dist/contracts/TerraswapFactory.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"TerraswapFactory.js","sourceRoot":"","sources":["../../src/contracts/TerraswapFactory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAO+B;AAG/B,mDAAkD;AA4DlD;IAAsC,oCAAc;IAApD;;IA4DA,CAAC;IA3DQ,+BAAI,GAAX,UACE,QAAkC,EAClC,UAAmB;QAEnB,OAAO,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;IAC7D,CAAC;IAEM,uCAAY,GAAnB,UACE,MAA4D;QAE5D,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,aAAa,EAAE,MAAM;SACtB,CAAC,CAAC;IACL,CAAC;IAEM,qCAAU,GAAjB,UACE,UAAsB,EACtB,oBAAgC,EAChC,aAA4B,EAC5B,gBAA+B,EAC/B,WAAmC,EACnC,SAAqC;QAErC,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,WAAW,EAAE;gBACX,UAAU,YAAA;gBACV,oBAAoB,sBAAA;gBACpB,aAAa,EAAE,IAAI,cAAG,CAAC,aAAa,CAAC,CAAC,QAAQ,EAAE;gBAChD,gBAAgB,EAAE,IAAI,cAAG,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE;gBACtD,WAAW,aAAA;gBACX,SAAS,WAAA;aACV;SACF,CAAC,CAAC;IACL,CAAC;IAEY,oCAAS,GAAtB;;;gBACE,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,MAAM,EAAE,EAAE;qBACX,CAAC,EAAC;;;KACJ;IAEY,kCAAO,GAApB,UACE,WAAmC;;;gBAEnC,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,IAAI,EAAE,EAAE,WAAW,aAAA,EAAE;qBACtB,CAAC,EAAC;;;KACJ;IAEe,gCAAK,GAArB,UAAyB,SAAoC;;;gBAC3D,sBAAO,iBAAM,KAAK,YAAC,SAAS,CAAC,EAAC;;;KAC/B;IAES,2CAAgB,GAA1B,UACE,WAAuC,EACvC,KAAuB;QAAvB,sBAAA,EAAA,UAAuB;QAEvB,OAAO,iBAAM,gBAAgB,YAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IACpD,CAAC;IACH,uBAAC;AAAD,CAAC,AA5DD,CAAsC,+BAAc,GA4DnD;AA5DY,4CAAgB"} \ No newline at end of file diff --git a/dist/contracts/TerraswapPair.d.ts b/dist/contracts/TerraswapPair.d.ts deleted file mode 100644 index 512e7888..00000000 --- a/dist/contracts/TerraswapPair.d.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { AccAddress, MsgExecuteContract, Coins, MsgInstantiateContract, Numeric } from '@terra-money/terra.js'; -import { EmptyObject } from '../utils/EmptyObject'; -import { AssetInfo, Asset } from '../utils/Asset'; -import { ContractClient } from './ContractClient'; -import { TerraswapToken } from './TerraswapToken'; -export declare namespace TerraswapPair { - interface InitHook { - msg: string; - contract_addr: AccAddress; - } - interface InitMsg { - owner: AccAddress; - commission_collector: AccAddress; - asset_infos: [AssetInfo, AssetInfo]; - lp_commission: string; - owner_commission: string; - token_code_id: number; - init_hook?: InitHook; - } - interface HandleUpdateConfig { - update_config: { - owner?: AccAddress; - lp_commission?: string; - owner_commission?: string; - }; - } - interface HandleProvideLiquidity { - provide_liquidity: { - assets: [Asset, Asset]; - }; - } - interface HandleSwap { - swap: { - offer_asset: Asset; - belief_price?: string; - max_spread?: string; - to?: AccAddress; - }; - } - interface HookSwap { - swap: { - belief_price?: string; - max_spread?: string; - to?: AccAddress; - }; - } - interface HookWithdrawLiquidity { - withdraw_liquidity: EmptyObject; - } - interface QueryConfigGeneral { - config_general: EmptyObject; - } - interface QueryConfigAsset { - config_asset: EmptyObject; - } - interface QueryConfigSwap { - config_swap: EmptyObject; - } - interface QueryPool { - pool: EmptyObject; - } - interface QuerySimulation { - simulation: { - offer_asset: Asset; - }; - } - interface QueryReverseSimulation { - reverse_simulation: { - ask_asset: Asset; - }; - } - interface ConfigGeneralResponse { - owner: AccAddress; - liquidity_token: AccAddress; - commission_collector: AccAddress; - } - interface ConfigSwapResponse { - lp_commission: string; - owner_commission: string; - } - interface ConfigAssetResponse { - infos: [AssetInfo, AssetInfo]; - } - interface PoolResponse { - assets: [Asset, Asset]; - total_share: string; - } - interface SimulationResponse { - return_amount: string; - spread_amount: string; - commission_amount: string; - } - interface ReverseSimulationResponse { - offer_amount: string; - spread_amount: string; - commission_amount: string; - } - type HandleMsg = HandleUpdateConfig | HandleProvideLiquidity | HandleSwap; - type HookMsg = HookSwap | HookWithdrawLiquidity; - type QueryMsg = QueryConfigGeneral | QueryConfigAsset | QueryConfigSwap | QueryPool | QuerySimulation | QueryReverseSimulation; -} -export declare class TerraswapPair extends ContractClient { - init(init_msg: TerraswapPair.InitMsg, migratable: boolean): MsgInstantiateContract; - updateConfig(config: TerraswapPair.HandleUpdateConfig['update_config']): MsgExecuteContract; - provideLiquidity(assets: [Asset, Asset]): MsgExecuteContract; - swap(offer_asset: Asset, params: { - belief_price?: Numeric.Input; - max_spread?: Numeric.Input; - offer_token?: TerraswapToken; - to?: AccAddress; - }): MsgExecuteContract; - withdrawLiquidity(amount: Numeric.Input, lp_token: TerraswapToken): MsgExecuteContract; - getConfigGeneral(): Promise; - getConfigAsset(): Promise; - getConfigSwap(): Promise; - getPool(): Promise; - getSimulation(offer_asset: Asset): Promise; - getReverseSimulation(ask_asset: Asset): Promise; - protected query(query_msg: TerraswapPair.QueryMsg): Promise; - protected createExecuteMsg(execute_msg: TerraswapPair.HandleMsg, coins?: Coins.Input): MsgExecuteContract; -} diff --git a/dist/contracts/TerraswapPair.js b/dist/contracts/TerraswapPair.js deleted file mode 100644 index 6e37a34f..00000000 --- a/dist/contracts/TerraswapPair.js +++ /dev/null @@ -1,200 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.TerraswapPair = void 0; -var terra_js_1 = require("@terra-money/terra.js"); -var Asset_1 = require("../utils/Asset"); -var ContractClient_1 = require("./ContractClient"); -function createHookMsg(msg) { - return Buffer.from(JSON.stringify(msg)).toString('base64'); -} -var TerraswapPair = /** @class */ (function (_super) { - __extends(TerraswapPair, _super); - function TerraswapPair() { - return _super !== null && _super.apply(this, arguments) || this; - } - TerraswapPair.prototype.init = function (init_msg, migratable) { - return this.createInstantiateMsg(init_msg, {}, migratable); - }; - TerraswapPair.prototype.updateConfig = function (config) { - return this.createExecuteMsg({ - update_config: config - }); - }; - /// CONTRACT - If providing asset is not native token, - /// must increase allowance first before using it - TerraswapPair.prototype.provideLiquidity = function (assets) { - var coins = new terra_js_1.Coins([]); - assets.forEach(function (asset) { - if (Asset_1.isNativeToken(asset.info)) { - coins = coins.add(new terra_js_1.Coin(asset.info.native_token.denom, asset.amount)); - } - }); - return this.createExecuteMsg({ - provide_liquidity: { - assets: assets - } - }, coins); - }; - TerraswapPair.prototype.swap = function (offer_asset, params) { - if (!params.offer_token) { - if (!Asset_1.isNativeToken(offer_asset.info)) { - throw new Error('OfferToken must be provided - unable to swap'); - } - return this.createExecuteMsg({ - swap: { - offer_asset: offer_asset, - belief_price: params.belief_price - ? new terra_js_1.Dec(params.belief_price).toString() - : undefined, - max_spread: params.max_spread - ? new terra_js_1.Dec(params.max_spread).toString() - : undefined, - to: params.to - } - }, [new terra_js_1.Coin(offer_asset.info.native_token.denom, offer_asset.amount)]); - } - if (!this.contractAddress) { - throw new Error('contractAddress not provided - unable to execute message'); - } - return params.offer_token.send(this.contractAddress, offer_asset.amount, createHookMsg({ - swap: { - belief_price: params.belief_price - ? new terra_js_1.Dec(params.belief_price).toString() - : undefined, - max_spread: params.max_spread - ? new terra_js_1.Dec(params.max_spread).toString() - : undefined, - to: params.to - } - })); - }; - TerraswapPair.prototype.withdrawLiquidity = function (amount, lp_token) { - if (!this.contractAddress) { - throw new Error('contractAddress not provided - unable to execute message'); - } - return lp_token.send.call(this, this.contractAddress, amount, createHookMsg({ - withdraw_liquidity: {} - })); - }; - TerraswapPair.prototype.getConfigGeneral = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - config_general: {} - })]; - }); - }); - }; - TerraswapPair.prototype.getConfigAsset = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - config_asset: {} - })]; - }); - }); - }; - TerraswapPair.prototype.getConfigSwap = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - config_swap: {} - })]; - }); - }); - }; - TerraswapPair.prototype.getPool = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - pool: {} - })]; - }); - }); - }; - TerraswapPair.prototype.getSimulation = function (offer_asset) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - simulation: { - offer_asset: offer_asset - } - })]; - }); - }); - }; - TerraswapPair.prototype.getReverseSimulation = function (ask_asset) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - reverse_simulation: { - ask_asset: ask_asset - } - })]; - }); - }); - }; - TerraswapPair.prototype.query = function (query_msg) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, _super.prototype.query.call(this, query_msg)]; - }); - }); - }; - TerraswapPair.prototype.createExecuteMsg = function (execute_msg, coins) { - if (coins === void 0) { coins = {}; } - return _super.prototype.createExecuteMsg.call(this, execute_msg, coins); - }; - return TerraswapPair; -}(ContractClient_1.ContractClient)); -exports.TerraswapPair = TerraswapPair; -//# sourceMappingURL=TerraswapPair.js.map \ No newline at end of file diff --git a/dist/contracts/TerraswapPair.js.map b/dist/contracts/TerraswapPair.js.map deleted file mode 100644 index 524dd712..00000000 --- a/dist/contracts/TerraswapPair.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"TerraswapPair.js","sourceRoot":"","sources":["../../src/contracts/TerraswapPair.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAQ+B;AAE/B,wCAAiE;AACjE,mDAAkD;AAkIlD,SAAS,aAAa,CAAC,GAA0B;IAC/C,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC7D,CAAC;AAED;IAAmC,iCAAc;IAAjD;;IAwKA,CAAC;IAvKQ,4BAAI,GAAX,UACE,QAA+B,EAC/B,UAAmB;QAEnB,OAAO,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;IAC7D,CAAC;IAEM,oCAAY,GAAnB,UACE,MAAyD;QAEzD,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,aAAa,EAAE,MAAM;SACtB,CAAC,CAAC;IACL,CAAC;IAED,sDAAsD;IACtD,iDAAiD;IAC1C,wCAAgB,GAAvB,UAAwB,MAAsB;QAC5C,IAAI,KAAK,GAAU,IAAI,gBAAK,CAAC,EAAE,CAAC,CAAC;QACjC,MAAM,CAAC,OAAO,CAAC,UAAC,KAAK;YACnB,IAAI,qBAAa,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;gBAC7B,KAAK,GAAG,KAAK,CAAC,GAAG,CACf,IAAI,eAAI,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CACtD,CAAC;aACH;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,gBAAgB,CAC1B;YACE,iBAAiB,EAAE;gBACjB,MAAM,QAAA;aACP;SACF,EACD,KAAK,CACN,CAAC;IACJ,CAAC;IAEM,4BAAI,GAAX,UACE,WAAkB,EAClB,MAKC;QAED,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE;YACvB,IAAI,CAAC,qBAAa,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE;gBACpC,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;aACjE;YAED,OAAO,IAAI,CAAC,gBAAgB,CAC1B;gBACE,IAAI,EAAE;oBACJ,WAAW,aAAA;oBACX,YAAY,EAAE,MAAM,CAAC,YAAY;wBAC/B,CAAC,CAAC,IAAI,cAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;wBACzC,CAAC,CAAC,SAAS;oBACb,UAAU,EAAE,MAAM,CAAC,UAAU;wBAC3B,CAAC,CAAC,IAAI,cAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE;wBACvC,CAAC,CAAC,SAAS;oBACb,EAAE,EAAE,MAAM,CAAC,EAAE;iBACd;aACF,EACD,CAAC,IAAI,eAAI,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CACpE,CAAC;SACH;QAED,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;YACzB,MAAM,IAAI,KAAK,CACb,0DAA0D,CAC3D,CAAC;SACH;QAED,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAC5B,IAAI,CAAC,eAAe,EACpB,WAAW,CAAC,MAAM,EAClB,aAAa,CAAC;YACZ,IAAI,EAAE;gBACJ,YAAY,EAAE,MAAM,CAAC,YAAY;oBAC/B,CAAC,CAAC,IAAI,cAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE;oBACzC,CAAC,CAAC,SAAS;gBACb,UAAU,EAAE,MAAM,CAAC,UAAU;oBAC3B,CAAC,CAAC,IAAI,cAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE;oBACvC,CAAC,CAAC,SAAS;gBACb,EAAE,EAAE,MAAM,CAAC,EAAE;aACd;SACF,CAAC,CACH,CAAC;IACJ,CAAC;IAEM,yCAAiB,GAAxB,UACE,MAAqB,EACrB,QAAwB;QAExB,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;YACzB,MAAM,IAAI,KAAK,CACb,0DAA0D,CAC3D,CAAC;SACH;QAED,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CACvB,IAAI,EACJ,IAAI,CAAC,eAAe,EACpB,MAAM,EACN,aAAa,CAAC;YACZ,kBAAkB,EAAE,EAAE;SACvB,CAAC,CACH,CAAC;IACJ,CAAC;IAEY,wCAAgB,GAA7B;;;gBAGE,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,cAAc,EAAE,EAAE;qBACnB,CAAC,EAAC;;;KACJ;IAEY,sCAAc,GAA3B;;;gBACE,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,YAAY,EAAE,EAAE;qBACjB,CAAC,EAAC;;;KACJ;IAEY,qCAAa,GAA1B;;;gBACE,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,WAAW,EAAE,EAAE;qBAChB,CAAC,EAAC;;;KACJ;IAEY,+BAAO,GAApB;;;gBACE,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,IAAI,EAAE,EAAE;qBACT,CAAC,EAAC;;;KACJ;IAEY,qCAAa,GAA1B,UACE,WAAkB;;;gBAElB,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,UAAU,EAAE;4BACV,WAAW,aAAA;yBACZ;qBACF,CAAC,EAAC;;;KACJ;IAEY,4CAAoB,GAAjC,UACE,SAAgB;;;gBAEhB,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,kBAAkB,EAAE;4BAClB,SAAS,WAAA;yBACV;qBACF,CAAC,EAAC;;;KACJ;IAEe,6BAAK,GAArB,UAAyB,SAAiC;;;gBACxD,sBAAO,iBAAM,KAAK,YAAC,SAAS,CAAC,EAAC;;;KAC/B;IAES,wCAAgB,GAA1B,UACE,WAAoC,EACpC,KAAuB;QAAvB,sBAAA,EAAA,UAAuB;QAEvB,OAAO,iBAAM,gBAAgB,YAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IACpD,CAAC;IACH,oBAAC;AAAD,CAAC,AAxKD,CAAmC,+BAAc,GAwKhD;AAxKY,sCAAa"} \ No newline at end of file diff --git a/dist/contracts/TerraswapToken.d.ts b/dist/contracts/TerraswapToken.d.ts deleted file mode 100644 index 8ca8b6ae..00000000 --- a/dist/contracts/TerraswapToken.d.ts +++ /dev/null @@ -1,178 +0,0 @@ -import { AccAddress, Coins, Numeric, MsgExecuteContract, MsgInstantiateContract } from '@terra-money/terra.js'; -import { ContractClient } from './ContractClient'; -import { EmptyObject } from '../utils/EmptyObject'; -export declare namespace TerraswapToken { - interface InitHook { - msg: string; - contract_addr: AccAddress; - } - interface MinterResponse { - minter: AccAddress; - cap?: string; - } - interface TokenCoin { - address: AccAddress; - amount: string; - } - interface InitMsg { - name: string; - symbol: string; - decimals: number; - initial_balances: Array; - mint?: MinterResponse; - init_hook?: InitHook; - } - interface Cw20ReceiveMsg { - sender: AccAddress; - amount: string; - msg?: string; - } - interface Receive { - receive: Cw20ReceiveMsg; - } - interface Transfer { - transfer: { - recipient: AccAddress; - amount: string; - }; - } - interface Burn { - burn: { - amount: string; - }; - } - interface Send { - send: { - contract: AccAddress; - amount: string; - msg?: string; - }; - } - interface Mint { - mint: { - recipient: AccAddress; - amount: string; - }; - } - interface ExpirationAtHeight { - at_height: number; - } - interface ExpirationAtTime { - at_time: number; - } - interface ExpirationNever { - never: EmptyObject; - } - type Expiration = ExpirationAtHeight | ExpirationAtTime | ExpirationNever; - interface IncreaseAllowance { - increase_allowance: { - spender: AccAddress; - amount: string; - expires?: Expiration; - }; - } - interface DecreaseAllowance { - decrease_allowance: { - spender: AccAddress; - amount: string; - expires?: Expiration; - }; - } - interface TransferFrom { - transfer_from: { - owner: AccAddress; - recipient: AccAddress; - amount: string; - }; - } - interface SendFrom { - send_from: { - owner: AccAddress; - contract: AccAddress; - amount: string; - msg?: string; - }; - } - interface BurnFrom { - burn_from: { - owner: AccAddress; - amount: string; - }; - } - interface Balance { - balance: { - address: AccAddress; - }; - } - interface TokenInfo { - token_info: EmptyObject; - } - interface Minter { - minter: EmptyObject; - } - interface Allownace { - allowance: { - owner: AccAddress; - spender: AccAddress; - }; - } - interface AllAllowances { - all_allowances: { - owner: AccAddress; - start_after?: AccAddress; - limit?: number; - }; - } - interface AllAccounts { - all_accounts: { - start_after?: AccAddress; - limit?: number; - }; - } - interface BalanceResponse { - balance: string; - } - interface TokenInfoResponse { - name: string; - symbol: string; - decimals: number; - total_supply: string; - } - interface AllowanceResponse { - allowance: string; - expires: Expiration; - } - interface AllowanceInfo { - spender: AccAddress; - allowance: string; - expires: Expiration; - } - interface AllAllowancesResponse { - allowances: Array; - } - interface AllAccountsResponse { - accounts: Array; - } - type HandleMsg = Receive | Transfer | TransferFrom | Burn | BurnFrom | Send | SendFrom | Mint | IncreaseAllowance | DecreaseAllowance; - type QueryMsg = Balance | TokenInfo | Minter | Allownace | AllAllowances | AllAccounts; -} -export declare class TerraswapToken extends ContractClient { - init(init_msg: TerraswapToken.InitMsg, migratable: boolean): MsgInstantiateContract; - transfer(recipient: AccAddress, amount: Numeric.Input): MsgExecuteContract; - transferFrom(owner: AccAddress, recipient: AccAddress, amount: Numeric.Input): MsgExecuteContract; - send(contract: AccAddress, amount: Numeric.Input, msg?: string): MsgExecuteContract; - sendFrom(owner: AccAddress, contract: AccAddress, amount: Numeric.Input, msg?: any): MsgExecuteContract; - mint(recipient: AccAddress, amount: Numeric.Input): MsgExecuteContract; - burn(amount: Numeric.Input): MsgExecuteContract; - burnFrom(owner: AccAddress, amount: Numeric.Input): MsgExecuteContract; - increaseAllowance(spender: AccAddress, amount: Numeric.Input, expires?: TerraswapToken.Expiration): MsgExecuteContract; - decreaseAllowance(spender: AccAddress, amount: Numeric.Input, expires?: TerraswapToken.Expiration): MsgExecuteContract; - getBalance(address?: AccAddress): Promise; - getTokenInfo(): Promise; - getMinter(): Promise; - getAllowance(owner: AccAddress, spender: AccAddress): Promise; - getAllAllowances(owner: AccAddress, start_after?: AccAddress, limit?: number): Promise; - getAllAccounts(start_after?: AccAddress, limit?: number): Promise; - protected createExecuteMsg(executeMsg: TerraswapToken.HandleMsg, coins?: Coins.Input): MsgExecuteContract; - protected query(query_msg: TerraswapToken.QueryMsg): Promise; -} diff --git a/dist/contracts/TerraswapToken.js b/dist/contracts/TerraswapToken.js deleted file mode 100644 index 425b275c..00000000 --- a/dist/contracts/TerraswapToken.js +++ /dev/null @@ -1,222 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.TerraswapToken = void 0; -var terra_js_1 = require("@terra-money/terra.js"); -var ContractClient_1 = require("./ContractClient"); -var TerraswapToken = /** @class */ (function (_super) { - __extends(TerraswapToken, _super); - function TerraswapToken() { - return _super !== null && _super.apply(this, arguments) || this; - } - TerraswapToken.prototype.init = function (init_msg, migratable) { - return this.createInstantiateMsg(init_msg, {}, migratable); - }; - TerraswapToken.prototype.transfer = function (recipient, amount) { - return this.createExecuteMsg({ - transfer: { - recipient: recipient, - amount: new terra_js_1.Int(amount).toString() - } - }); - }; - TerraswapToken.prototype.transferFrom = function (owner, recipient, amount) { - return this.createExecuteMsg({ - transfer_from: { - owner: owner, - recipient: recipient, - amount: new terra_js_1.Int(amount).toString() - } - }); - }; - TerraswapToken.prototype.send = function (contract, amount, msg) { - return this.createExecuteMsg({ - send: { - contract: contract, - amount: new terra_js_1.Int(amount).toString(), - msg: msg - } - }); - }; - TerraswapToken.prototype.sendFrom = function (owner, contract, amount, msg) { - return this.createExecuteMsg({ - send_from: { - owner: owner, - contract: contract, - amount: new terra_js_1.Int(amount).toString(), - msg: msg - ? Buffer.from(JSON.stringify(msg)).toString('base64') - : undefined - } - }); - }; - TerraswapToken.prototype.mint = function (recipient, amount) { - return this.createExecuteMsg({ - mint: { - recipient: recipient, - amount: new terra_js_1.Int(amount).toString() - } - }); - }; - TerraswapToken.prototype.burn = function (amount) { - return this.createExecuteMsg({ - burn: { - amount: new terra_js_1.Int(amount).toString() - } - }); - }; - TerraswapToken.prototype.burnFrom = function (owner, amount) { - return this.createExecuteMsg({ - burn_from: { - owner: owner, - amount: new terra_js_1.Int(amount).toString() - } - }); - }; - TerraswapToken.prototype.increaseAllowance = function (spender, amount, expires) { - return this.createExecuteMsg({ - increase_allowance: { - spender: spender, - amount: new terra_js_1.Int(amount).toString(), - expires: expires - } - }); - }; - TerraswapToken.prototype.decreaseAllowance = function (spender, amount, expires) { - return this.createExecuteMsg({ - decrease_allowance: { - spender: spender, - amount: new terra_js_1.Int(amount).toString(), - expires: expires - } - }); - }; - TerraswapToken.prototype.getBalance = function (address) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - balance: { - address: address ? address : this.wallet.key.accAddress - } - })]; - }); - }); - }; - TerraswapToken.prototype.getTokenInfo = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - token_info: {} - })]; - }); - }); - }; - TerraswapToken.prototype.getMinter = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - minter: {} - })]; - }); - }); - }; - TerraswapToken.prototype.getAllowance = function (owner, spender) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - allowance: { - owner: owner, - spender: spender - } - })]; - }); - }); - }; - TerraswapToken.prototype.getAllAllowances = function (owner, start_after, limit) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - all_allowances: { - owner: owner, - start_after: start_after, - limit: limit - } - })]; - }); - }); - }; - TerraswapToken.prototype.getAllAccounts = function (start_after, limit) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.query({ - all_accounts: { - start_after: start_after, - limit: limit - } - })]; - }); - }); - }; - TerraswapToken.prototype.createExecuteMsg = function (executeMsg, coins) { - if (coins === void 0) { coins = {}; } - return _super.prototype.createExecuteMsg.call(this, executeMsg, coins); - }; - TerraswapToken.prototype.query = function (query_msg) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, _super.prototype.query.call(this, query_msg)]; - }); - }); - }; - return TerraswapToken; -}(ContractClient_1.ContractClient)); -exports.TerraswapToken = TerraswapToken; -//# sourceMappingURL=TerraswapToken.js.map \ No newline at end of file diff --git a/dist/contracts/TerraswapToken.js.map b/dist/contracts/TerraswapToken.js.map deleted file mode 100644 index 466c566a..00000000 --- a/dist/contracts/TerraswapToken.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"TerraswapToken.js","sourceRoot":"","sources":["../../src/contracts/TerraswapToken.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAO+B;AAC/B,mDAAkD;AAkNlD;IAAoC,kCAAc;IAAlD;;IAoMA,CAAC;IAnMQ,6BAAI,GAAX,UACE,QAAgC,EAChC,UAAmB;QAEnB,OAAO,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;IAC7D,CAAC;IAEM,iCAAQ,GAAf,UACE,SAAqB,EACrB,MAAqB;QAErB,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,QAAQ,EAAE;gBACR,SAAS,WAAA;gBACT,MAAM,EAAE,IAAI,cAAG,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;aACnC;SACF,CAAC,CAAC;IACL,CAAC;IAEM,qCAAY,GAAnB,UACE,KAAiB,EACjB,SAAqB,EACrB,MAAqB;QAErB,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,aAAa,EAAE;gBACb,KAAK,OAAA;gBACL,SAAS,WAAA;gBACT,MAAM,EAAE,IAAI,cAAG,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;aACnC;SACF,CAAC,CAAC;IACL,CAAC;IAEM,6BAAI,GAAX,UACE,QAAoB,EACpB,MAAqB,EACrB,GAAY;QAEZ,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,IAAI,EAAE;gBACJ,QAAQ,UAAA;gBACR,MAAM,EAAE,IAAI,cAAG,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;gBAClC,GAAG,KAAA;aACJ;SACF,CAAC,CAAC;IACL,CAAC;IAEM,iCAAQ,GAAf,UACE,KAAiB,EACjB,QAAoB,EACpB,MAAqB,EACrB,GAAS;QAET,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,SAAS,EAAE;gBACT,KAAK,OAAA;gBACL,QAAQ,UAAA;gBACR,MAAM,EAAE,IAAI,cAAG,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;gBAClC,GAAG,EAAE,GAAG;oBACN,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;oBACrD,CAAC,CAAC,SAAS;aACd;SACF,CAAC,CAAC;IACL,CAAC;IAEM,6BAAI,GAAX,UACE,SAAqB,EACrB,MAAqB;QAErB,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,IAAI,EAAE;gBACJ,SAAS,WAAA;gBACT,MAAM,EAAE,IAAI,cAAG,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;aACnC;SACF,CAAC,CAAC;IACL,CAAC;IAEM,6BAAI,GAAX,UAAY,MAAqB;QAC/B,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,IAAI,EAAE;gBACJ,MAAM,EAAE,IAAI,cAAG,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;aACnC;SACF,CAAC,CAAC;IACL,CAAC;IAEM,iCAAQ,GAAf,UACE,KAAiB,EACjB,MAAqB;QAErB,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,SAAS,EAAE;gBACT,KAAK,OAAA;gBACL,MAAM,EAAE,IAAI,cAAG,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;aACnC;SACF,CAAC,CAAC;IACL,CAAC;IAEM,0CAAiB,GAAxB,UACE,OAAmB,EACnB,MAAqB,EACrB,OAAmC;QAEnC,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,kBAAkB,EAAE;gBAClB,OAAO,SAAA;gBACP,MAAM,EAAE,IAAI,cAAG,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;gBAClC,OAAO,SAAA;aACR;SACF,CAAC,CAAC;IACL,CAAC;IAEM,0CAAiB,GAAxB,UACE,OAAmB,EACnB,MAAqB,EACrB,OAAmC;QAEnC,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAC3B,kBAAkB,EAAE;gBAClB,OAAO,SAAA;gBACP,MAAM,EAAE,IAAI,cAAG,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;gBAClC,OAAO,SAAA;aACR;SACF,CAAC,CAAC;IACL,CAAC;IAEY,mCAAU,GAAvB,UACE,OAAoB;;;gBAEpB,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,OAAO,EAAE;4BACP,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU;yBACxD;qBACF,CAAC,EAAC;;;KACJ;IAEY,qCAAY,GAAzB;;;gBACE,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,UAAU,EAAE,EAAE;qBACf,CAAC,EAAC;;;KACJ;IAEY,kCAAS,GAAtB;;;gBACE,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,MAAM,EAAE,EAAE;qBACX,CAAC,EAAC;;;KACJ;IAEY,qCAAY,GAAzB,UACE,KAAiB,EACjB,OAAmB;;;gBAEnB,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,SAAS,EAAE;4BACT,KAAK,OAAA;4BACL,OAAO,SAAA;yBACR;qBACF,CAAC,EAAC;;;KACJ;IAEY,yCAAgB,GAA7B,UACE,KAAiB,EACjB,WAAwB,EACxB,KAAc;;;gBAEd,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,cAAc,EAAE;4BACd,KAAK,OAAA;4BACL,WAAW,aAAA;4BACX,KAAK,OAAA;yBACN;qBACF,CAAC,EAAC;;;KACJ;IAEY,uCAAc,GAA3B,UACE,WAAwB,EACxB,KAAc;;;gBAEd,sBAAO,IAAI,CAAC,KAAK,CAAC;wBAChB,YAAY,EAAE;4BACZ,WAAW,aAAA;4BACX,KAAK,OAAA;yBACN;qBACF,CAAC,EAAC;;;KACJ;IAES,yCAAgB,GAA1B,UACE,UAAoC,EACpC,KAAuB;QAAvB,sBAAA,EAAA,UAAuB;QAEvB,OAAO,iBAAM,gBAAgB,YAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IACnD,CAAC;IAEe,8BAAK,GAArB,UAAyB,SAAkC;;;gBACzD,sBAAO,iBAAM,KAAK,YAAC,SAAS,CAAC,EAAC;;;KAC/B;IACH,qBAAC;AAAD,CAAC,AApMD,CAAoC,+BAAc,GAoMjD;AApMY,wCAAc"} \ No newline at end of file diff --git a/dist/contracts/index.d.ts b/dist/contracts/index.d.ts deleted file mode 100644 index 0c44d7b2..00000000 --- a/dist/contracts/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export * from './MirrorCollector'; -export * from './MirrorFactory'; -export * from './MirrorGov'; -export * from './MirrorMint'; -export * from './MirrorOracle'; -export * from './MirrorStaking'; -export * from './TerraswapFactory'; -export * from './TerraswapPair'; -export * from './TerraswapToken'; diff --git a/dist/contracts/index.js b/dist/contracts/index.js deleted file mode 100644 index 5bbe200c..00000000 --- a/dist/contracts/index.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./MirrorCollector"), exports); -__exportStar(require("./MirrorFactory"), exports); -__exportStar(require("./MirrorGov"), exports); -__exportStar(require("./MirrorMint"), exports); -__exportStar(require("./MirrorOracle"), exports); -__exportStar(require("./MirrorStaking"), exports); -__exportStar(require("./TerraswapFactory"), exports); -__exportStar(require("./TerraswapPair"), exports); -__exportStar(require("./TerraswapToken"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/contracts/index.js.map b/dist/contracts/index.js.map deleted file mode 100644 index b8399a09..00000000 --- a/dist/contracts/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAkC;AAClC,kDAAgC;AAChC,8CAA4B;AAC5B,+CAA6B;AAC7B,iDAA+B;AAC/B,kDAAgC;AAChC,qDAAmC;AACnC,kDAAgC;AAChC,mDAAiC"} \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index a11419e8..00000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './client'; -export * from './utils'; -export * from './contracts'; diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index c8f18a50..00000000 --- a/dist/index.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./client"), exports); -__exportStar(require("./utils"), exports); -__exportStar(require("./contracts"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f4fa7c03..00000000 --- a/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B"} \ No newline at end of file diff --git a/dist/utils/Asset.d.ts b/dist/utils/Asset.d.ts deleted file mode 100644 index cbbb1ec5..00000000 --- a/dist/utils/Asset.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { AccAddress } from '@terra-money/terra.js'; -export interface Token { - token: { - contract_addr: AccAddress; - }; -} -export interface NativeToken { - native_token: { - denom: string; - }; -} -export declare type AssetInfo = Token | NativeToken; -export declare function isNativeToken(assetInfo: AssetInfo): assetInfo is NativeToken; -export interface Asset { - info: AssetInfo; - amount: string; -} -export declare const UST: NativeToken; diff --git a/dist/utils/Asset.js b/dist/utils/Asset.js deleted file mode 100644 index 7e967f27..00000000 --- a/dist/utils/Asset.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.UST = exports.isNativeToken = void 0; -function isNativeToken(assetInfo) { - return 'native_token' in assetInfo; -} -exports.isNativeToken = isNativeToken; -exports.UST = { - native_token: { - denom: 'uusd' - } -}; -//# sourceMappingURL=Asset.js.map \ No newline at end of file diff --git a/dist/utils/Asset.js.map b/dist/utils/Asset.js.map deleted file mode 100644 index c8a46d2e..00000000 --- a/dist/utils/Asset.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Asset.js","sourceRoot":"","sources":["../../src/utils/Asset.ts"],"names":[],"mappings":";;;AAiBA,SAAgB,aAAa,CAAC,SAAoB;IAChD,OAAO,cAAc,IAAI,SAAS,CAAC;AACrC,CAAC;AAFD,sCAEC;AAOY,QAAA,GAAG,GAAgB;IAC9B,YAAY,EAAE;QACZ,KAAK,EAAE,MAAM;KACd;CACF,CAAC"} \ No newline at end of file diff --git a/dist/utils/EmptyKey.d.ts b/dist/utils/EmptyKey.d.ts deleted file mode 100644 index 1ded0023..00000000 --- a/dist/utils/EmptyKey.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// -import { Key } from '@terra-money/terra.js'; -export declare class EmptyKey extends Key { - constructor(); - sign(): Promise; -} diff --git a/dist/utils/EmptyKey.js b/dist/utils/EmptyKey.js deleted file mode 100644 index c9236d0c..00000000 --- a/dist/utils/EmptyKey.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.EmptyKey = void 0; -var terra_js_1 = require("@terra-money/terra.js"); -var EmptyKey = /** @class */ (function (_super) { - __extends(EmptyKey, _super); - function EmptyKey() { - return _super.call(this, Buffer.from('')) || this; - } - // eslint-disable-next-line class-methods-use-this - EmptyKey.prototype.sign = function () { - throw new Error('Key is empty - provide a Key when creating ContractClient to sign transactions.'); - }; - return EmptyKey; -}(terra_js_1.Key)); -exports.EmptyKey = EmptyKey; -//# sourceMappingURL=EmptyKey.js.map \ No newline at end of file diff --git a/dist/utils/EmptyKey.js.map b/dist/utils/EmptyKey.js.map deleted file mode 100644 index 4d1605f2..00000000 --- a/dist/utils/EmptyKey.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"EmptyKey.js","sourceRoot":"","sources":["../../src/utils/EmptyKey.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA4C;AAE5C;IAA8B,4BAAG;IAC/B;eACE,kBAAM,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACxB,CAAC;IAED,kDAAkD;IAC3C,uBAAI,GAAX;QACE,MAAM,IAAI,KAAK,CACb,iFAAiF,CAClF,CAAC;IACJ,CAAC;IACH,eAAC;AAAD,CAAC,AAXD,CAA8B,cAAG,GAWhC;AAXY,4BAAQ"} \ No newline at end of file diff --git a/dist/utils/EmptyObject.d.ts b/dist/utils/EmptyObject.d.ts deleted file mode 100644 index 2c07501a..00000000 --- a/dist/utils/EmptyObject.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare type EmptyObject = { - [_ in any]: never; -}; diff --git a/dist/utils/EmptyObject.js b/dist/utils/EmptyObject.js deleted file mode 100644 index f4162917..00000000 --- a/dist/utils/EmptyObject.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=EmptyObject.js.map \ No newline at end of file diff --git a/dist/utils/EmptyObject.js.map b/dist/utils/EmptyObject.js.map deleted file mode 100644 index dd9d68d0..00000000 --- a/dist/utils/EmptyObject.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"EmptyObject.js","sourceRoot":"","sources":["../../src/utils/EmptyObject.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/utils/index.d.ts b/dist/utils/index.d.ts deleted file mode 100644 index 70918ca3..00000000 --- a/dist/utils/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './Asset'; -export * from './EmptyKey'; -export * from './EmptyObject'; diff --git a/dist/utils/index.js b/dist/utils/index.js deleted file mode 100644 index a3c80617..00000000 --- a/dist/utils/index.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./Asset"), exports); -__exportStar(require("./EmptyKey"), exports); -__exportStar(require("./EmptyObject"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/utils/index.js.map b/dist/utils/index.js.map deleted file mode 100644 index 922720ab..00000000 --- a/dist/utils/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAAwB;AACxB,6CAA2B;AAC3B,gDAA8B"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 09d797b6..f575080a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,19 +14,19 @@ } }, "@babel/core": { - "version": "7.11.6", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.6.tgz", - "integrity": "sha512-Wpcv03AGnmkgm6uS6k8iwhIwTrcP0m17TL1n1sy7qD0qelDu4XNeW0dN0mHfa+Gei211yDaLoEe/VlbXQzM4Bg==", + "version": "7.12.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.3.tgz", + "integrity": "sha512-0qXcZYKZp3/6N2jKYVxZv0aNCsxTSVCiK72DTiTYZAu7sjg73W0/aynWjMbiGd87EQL4WyA8reiJVh92AVla9g==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.11.6", - "@babel/helper-module-transforms": "^7.11.0", - "@babel/helpers": "^7.10.4", - "@babel/parser": "^7.11.5", + "@babel/generator": "^7.12.1", + "@babel/helper-module-transforms": "^7.12.1", + "@babel/helpers": "^7.12.1", + "@babel/parser": "^7.12.3", "@babel/template": "^7.10.4", - "@babel/traverse": "^7.11.5", - "@babel/types": "^7.11.5", + "@babel/traverse": "^7.12.1", + "@babel/types": "^7.12.1", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", @@ -76,12 +76,12 @@ } }, "@babel/generator": { - "version": "7.11.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.6.tgz", - "integrity": "sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.5.tgz", + "integrity": "sha512-m16TQQJ8hPt7E+OS/XVQg/7U184MLXtvuGbCdA7na61vha+ImkyyNM/9DDA0unYCVZn3ZOhng+qz48/KBOT96A==", "dev": true, "requires": { - "@babel/types": "^7.11.5", + "@babel/types": "^7.12.5", "jsesc": "^2.5.1", "source-map": "^0.5.0" }, @@ -115,35 +115,37 @@ } }, "@babel/helper-member-expression-to-functions": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.11.0.tgz", - "integrity": "sha512-JbFlKHFntRV5qKw3YC0CvQnDZ4XMwgzzBbld7Ly4Mj4cbFy3KywcR8NtNctRToMWJOVvLINJv525Gd6wwVEx/Q==", + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.1.tgz", + "integrity": "sha512-k0CIe3tXUKTRSoEx1LQEPFU9vRQfqHtl+kf8eNnDqb4AUJEy5pz6aIiog+YWtVm2jpggjS1laH68bPsR+KWWPQ==", "dev": true, "requires": { - "@babel/types": "^7.11.0" + "@babel/types": "^7.12.1" } }, "@babel/helper-module-imports": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", - "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz", + "integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==", "dev": true, "requires": { - "@babel/types": "^7.10.4" + "@babel/types": "^7.12.5" } }, "@babel/helper-module-transforms": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.11.0.tgz", - "integrity": "sha512-02EVu8COMuTRO1TAzdMtpBPbe6aQ1w/8fePD2YgQmxZU4gpNWaL9gK3Jp7dxlkUlUCJOTaSeA+Hrm1BRQwqIhg==", + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.12.1.tgz", + "integrity": "sha512-QQzehgFAZ2bbISiCpmVGfiGux8YVFXQ0abBic2Envhej22DVXV9nCFaS5hIQbkyo1AdGb+gNME2TSh3hYJVV/w==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.10.4", - "@babel/helper-replace-supers": "^7.10.4", - "@babel/helper-simple-access": "^7.10.4", + "@babel/helper-module-imports": "^7.12.1", + "@babel/helper-replace-supers": "^7.12.1", + "@babel/helper-simple-access": "^7.12.1", "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/helper-validator-identifier": "^7.10.4", "@babel/template": "^7.10.4", - "@babel/types": "^7.11.0", + "@babel/traverse": "^7.12.1", + "@babel/types": "^7.12.1", "lodash": "^4.17.19" } }, @@ -163,25 +165,24 @@ "dev": true }, "@babel/helper-replace-supers": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz", - "integrity": "sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.5.tgz", + "integrity": "sha512-5YILoed0ZyIpF4gKcpZitEnXEJ9UoDRki1Ey6xz46rxOzfNMAhVIJMoune1hmPVxh40LRv1+oafz7UsWX+vyWA==", "dev": true, "requires": { - "@babel/helper-member-expression-to-functions": "^7.10.4", + "@babel/helper-member-expression-to-functions": "^7.12.1", "@babel/helper-optimise-call-expression": "^7.10.4", - "@babel/traverse": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/traverse": "^7.12.5", + "@babel/types": "^7.12.5" } }, "@babel/helper-simple-access": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz", - "integrity": "sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw==", + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.12.1.tgz", + "integrity": "sha512-OxBp7pMrjVewSSC8fXDFrHrBcJATOOFssZwv16F3/6Xtc138GHybBfPbm9kfiqQHKhYQrlamWILwlDCeyMFEaA==", "dev": true, "requires": { - "@babel/template": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/types": "^7.12.1" } }, "@babel/helper-split-export-declaration": { @@ -200,14 +201,14 @@ "dev": true }, "@babel/helpers": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.4.tgz", - "integrity": "sha512-L2gX/XeUONeEbI78dXSrJzGdz4GQ+ZTA/aazfUsFaWjSe95kiCuOZ5HsXvkiw3iwF+mFHSRUfJU8t6YavocdXA==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.5.tgz", + "integrity": "sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA==", "dev": true, "requires": { "@babel/template": "^7.10.4", - "@babel/traverse": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/traverse": "^7.12.5", + "@babel/types": "^7.12.5" } }, "@babel/highlight": { @@ -274,9 +275,9 @@ } }, "@babel/parser": { - "version": "7.11.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.5.tgz", - "integrity": "sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.5.tgz", + "integrity": "sha512-FVM6RZQ0mn2KCf1VUED7KepYeUWoVShczewOCfm3nzoBybaih51h+sYVVGthW9M6lPByEPTQf+xm27PBdlpwmQ==", "dev": true }, "@babel/plugin-syntax-async-generators": { @@ -298,9 +299,9 @@ } }, "@babel/plugin-syntax-class-properties": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.10.4.tgz", - "integrity": "sha512-GCSBF7iUle6rNugfURwNmCGG3Z/2+opxAMLs1nND4bhEG5PuxTIggDBoeYYSujAlLtsupzOHYJQgPS3pivwXIA==", + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.1.tgz", + "integrity": "sha512-U40A76x5gTwmESz+qiqssqmeEsKvcSyvtgktrm0uzcARAmM9I1jR221f6Oq+GmHrcD+LvZDag1UTOTe2fL3TeA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4" @@ -378,6 +379,15 @@ "@babel/helper-plugin-utils": "^7.8.0" } }, + "@babel/plugin-syntax-top-level-await": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.1.tgz", + "integrity": "sha512-i7ooMZFS+a/Om0crxZodrTzNEPJHZrlMVGMTEpFAj6rYY/bKCddB0Dk/YxfPuYXOopuhKk/e1jV6h+WUU9XN3A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, "@babel/template": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", @@ -390,17 +400,17 @@ } }, "@babel/traverse": { - "version": "7.11.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.5.tgz", - "integrity": "sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ==", + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.5.tgz", + "integrity": "sha512-xa15FbQnias7z9a62LwYAA5SZZPkHIXpd42C6uW68o8uTuua96FHZy1y61Va5P/i83FAAcMpW8+A/QayntzuqA==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.11.5", + "@babel/generator": "^7.12.5", "@babel/helper-function-name": "^7.10.4", "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/parser": "^7.11.5", - "@babel/types": "^7.11.5", + "@babel/parser": "^7.12.5", + "@babel/types": "^7.12.5", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.19" @@ -430,9 +440,9 @@ } }, "@babel/types": { - "version": "7.11.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", - "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", + "version": "7.12.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.6.tgz", + "integrity": "sha512-hwyjw6GvjBLiyy3W0YQf0Z5Zf4NpYejUnKFcfcUhZCSffoBBp30w6wP2Wn6pk31jMYZvcOrB/1b7cGXvEoKogA==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -457,9 +467,9 @@ } }, "@eslint/eslintrc": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.1.3.tgz", - "integrity": "sha512-4YVwPkANLeNtRjMekzux1ci8hIaH5eGKktGqR0d3LWsKNn5B2X/1Z6Trxy7jQXl9EBGE6Yj02O+t09FMeRllaA==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.1.tgz", + "integrity": "sha512-XRUeBZ5zBWLYgSANMpThFddrZZkEbGHgUdt5UJjZfnlN9BGCiUBrf+nvbRupSjMvqzwnQN0qwCmOxITt1cfywA==", "dev": true, "requires": { "ajv": "^6.12.4", @@ -517,48 +527,48 @@ "dev": true }, "@jest/console": { - "version": "26.5.2", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-26.5.2.tgz", - "integrity": "sha512-lJELzKINpF1v74DXHbCRIkQ/+nUV1M+ntj+X1J8LxCgpmJZjfLmhFejiMSbjjD66fayxl5Z06tbs3HMyuik6rw==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-26.6.2.tgz", + "integrity": "sha512-IY1R2i2aLsLr7Id3S6p2BA82GNWryt4oSvEXLAKc+L2zdi89dSkE8xC1C+0kpATG4JhBJREnQOH7/zmccM2B0g==", "dev": true, "requires": { - "@jest/types": "^26.5.2", + "@jest/types": "^26.6.2", "@types/node": "*", "chalk": "^4.0.0", - "jest-message-util": "^26.5.2", - "jest-util": "^26.5.2", + "jest-message-util": "^26.6.2", + "jest-util": "^26.6.2", "slash": "^3.0.0" } }, "@jest/core": { - "version": "26.4.2", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-26.4.2.tgz", - "integrity": "sha512-sDva7YkeNprxJfepOctzS8cAk9TOekldh+5FhVuXS40+94SHbiicRO1VV2tSoRtgIo+POs/Cdyf8p76vPTd6dg==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-26.6.3.tgz", + "integrity": "sha512-xvV1kKbhfUqFVuZ8Cyo+JPpipAHHAV3kcDBftiduK8EICXmTFddryy3P7NfZt8Pv37rA9nEJBKCCkglCPt/Xjw==", "dev": true, "requires": { - "@jest/console": "^26.3.0", - "@jest/reporters": "^26.4.1", - "@jest/test-result": "^26.3.0", - "@jest/transform": "^26.3.0", - "@jest/types": "^26.3.0", + "@jest/console": "^26.6.2", + "@jest/reporters": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/transform": "^26.6.2", + "@jest/types": "^26.6.2", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "exit": "^0.1.2", "graceful-fs": "^4.2.4", - "jest-changed-files": "^26.3.0", - "jest-config": "^26.4.2", - "jest-haste-map": "^26.3.0", - "jest-message-util": "^26.3.0", + "jest-changed-files": "^26.6.2", + "jest-config": "^26.6.3", + "jest-haste-map": "^26.6.2", + "jest-message-util": "^26.6.2", "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.4.0", - "jest-resolve-dependencies": "^26.4.2", - "jest-runner": "^26.4.2", - "jest-runtime": "^26.4.2", - "jest-snapshot": "^26.4.2", - "jest-util": "^26.3.0", - "jest-validate": "^26.4.2", - "jest-watcher": "^26.3.0", + "jest-resolve": "^26.6.2", + "jest-resolve-dependencies": "^26.6.3", + "jest-runner": "^26.6.3", + "jest-runtime": "^26.6.3", + "jest-snapshot": "^26.6.2", + "jest-util": "^26.6.2", + "jest-validate": "^26.6.2", + "jest-watcher": "^26.6.2", "micromatch": "^4.0.2", "p-each-series": "^2.1.0", "rimraf": "^3.0.0", @@ -578,53 +588,53 @@ } }, "@jest/environment": { - "version": "26.5.2", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-26.5.2.tgz", - "integrity": "sha512-YjhCD/Zhkz0/1vdlS/QN6QmuUdDkpgBdK4SdiVg4Y19e29g4VQYN5Xg8+YuHjdoWGY7wJHMxc79uDTeTOy9Ngw==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-26.6.2.tgz", + "integrity": "sha512-nFy+fHl28zUrRsCeMB61VDThV1pVTtlEokBRgqPrcT1JNq4yRNIyTHfyht6PqtUvY9IsuLGTrbG8kPXjSZIZwA==", "dev": true, "requires": { - "@jest/fake-timers": "^26.5.2", - "@jest/types": "^26.5.2", + "@jest/fake-timers": "^26.6.2", + "@jest/types": "^26.6.2", "@types/node": "*", - "jest-mock": "^26.5.2" + "jest-mock": "^26.6.2" } }, "@jest/fake-timers": { - "version": "26.5.2", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-26.5.2.tgz", - "integrity": "sha512-09Hn5Oraqt36V1akxQeWMVL0fR9c6PnEhpgLaYvREXZJAh2H2Y+QLCsl0g7uMoJeoWJAuz4tozk1prbR1Fc1sw==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-26.6.2.tgz", + "integrity": "sha512-14Uleatt7jdzefLPYM3KLcnUl1ZNikaKq34enpb5XG9i81JpppDb5muZvonvKyrl7ftEHkKS5L5/eB/kxJ+bvA==", "dev": true, "requires": { - "@jest/types": "^26.5.2", + "@jest/types": "^26.6.2", "@sinonjs/fake-timers": "^6.0.1", "@types/node": "*", - "jest-message-util": "^26.5.2", - "jest-mock": "^26.5.2", - "jest-util": "^26.5.2" + "jest-message-util": "^26.6.2", + "jest-mock": "^26.6.2", + "jest-util": "^26.6.2" } }, "@jest/globals": { - "version": "26.5.3", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.5.3.tgz", - "integrity": "sha512-7QztI0JC2CuB+Wx1VdnOUNeIGm8+PIaqngYsZXQCkH2QV0GFqzAYc9BZfU0nuqA6cbYrWh5wkuMzyii3P7deug==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.6.2.tgz", + "integrity": "sha512-85Ltnm7HlB/KesBUuALwQ68YTU72w9H2xW9FjZ1eL1U3lhtefjjl5c2MiUbpXt/i6LaPRvoOFJ22yCBSfQ0JIA==", "dev": true, "requires": { - "@jest/environment": "^26.5.2", - "@jest/types": "^26.5.2", - "expect": "^26.5.3" + "@jest/environment": "^26.6.2", + "@jest/types": "^26.6.2", + "expect": "^26.6.2" } }, "@jest/reporters": { - "version": "26.5.3", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-26.5.3.tgz", - "integrity": "sha512-X+vR0CpfMQzYcYmMFKNY9n4jklcb14Kffffp7+H/MqitWnb0440bW2L76NGWKAa+bnXhNoZr+lCVtdtPmfJVOQ==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-26.6.2.tgz", + "integrity": "sha512-h2bW53APG4HvkOnVMo8q3QXa6pcaNt1HkwVsOPMBV6LD/q9oSpxNSYZQYkAnjdMjrJ86UuYeLo+aEZClV6opnw==", "dev": true, "requires": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^26.5.2", - "@jest/test-result": "^26.5.2", - "@jest/transform": "^26.5.2", - "@jest/types": "^26.5.2", + "@jest/console": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/transform": "^26.6.2", + "@jest/types": "^26.6.2", "chalk": "^4.0.0", "collect-v8-coverage": "^1.0.0", "exit": "^0.1.2", @@ -635,22 +645,22 @@ "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.0.2", - "jest-haste-map": "^26.5.2", - "jest-resolve": "^26.5.2", - "jest-util": "^26.5.2", - "jest-worker": "^26.5.0", + "jest-haste-map": "^26.6.2", + "jest-resolve": "^26.6.2", + "jest-util": "^26.6.2", + "jest-worker": "^26.6.2", "node-notifier": "^8.0.0", "slash": "^3.0.0", "source-map": "^0.6.0", "string-length": "^4.0.1", "terminal-link": "^2.0.0", - "v8-to-istanbul": "^6.0.1" + "v8-to-istanbul": "^7.0.0" } }, "@jest/source-map": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-26.5.0.tgz", - "integrity": "sha512-jWAw9ZwYHJMe9eZq/WrsHlwF8E3hM9gynlcDpOyCb9bR8wEd9ZNBZCi7/jZyzHxC7t3thZ10gO2IDhu0bPKS5g==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-26.6.2.tgz", + "integrity": "sha512-YwYcCwAnNmOVsZ8mr3GfnzdXDAl4LaenZP5z+G0c8bzC9/dugL8zRmxZzdoTl4IaS3CryS1uWnROLPFmb6lVvA==", "dev": true, "requires": { "callsites": "^3.0.0", @@ -659,46 +669,46 @@ } }, "@jest/test-result": { - "version": "26.5.2", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-26.5.2.tgz", - "integrity": "sha512-E/Zp6LURJEGSCWpoMGmCFuuEI1OWuI3hmZwmULV0GsgJBh7u0rwqioxhRU95euUuviqBDN8ruX/vP/4bwYolXw==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-26.6.2.tgz", + "integrity": "sha512-5O7H5c/7YlojphYNrK02LlDIV2GNPYisKwHm2QTKjNZeEzezCbwYs9swJySv2UfPMyZ0VdsmMv7jIlD/IKYQpQ==", "dev": true, "requires": { - "@jest/console": "^26.5.2", - "@jest/types": "^26.5.2", + "@jest/console": "^26.6.2", + "@jest/types": "^26.6.2", "@types/istanbul-lib-coverage": "^2.0.0", "collect-v8-coverage": "^1.0.0" } }, "@jest/test-sequencer": { - "version": "26.5.3", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.5.3.tgz", - "integrity": "sha512-Wqzb7aQ13L3T47xHdpUqYMOpiqz6Dx2QDDghp5AV/eUDXR7JieY+E1s233TQlNyl+PqtqgjVokmyjzX/HA51BA==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.6.3.tgz", + "integrity": "sha512-YHlVIjP5nfEyjlrSr8t/YdNfU/1XEt7c5b4OxcXCjyRhjzLYu/rO69/WHPuYcbCWkz8kAeZVZp2N2+IOLLEPGw==", "dev": true, "requires": { - "@jest/test-result": "^26.5.2", + "@jest/test-result": "^26.6.2", "graceful-fs": "^4.2.4", - "jest-haste-map": "^26.5.2", - "jest-runner": "^26.5.3", - "jest-runtime": "^26.5.3" + "jest-haste-map": "^26.6.2", + "jest-runner": "^26.6.3", + "jest-runtime": "^26.6.3" } }, "@jest/transform": { - "version": "26.5.2", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-26.5.2.tgz", - "integrity": "sha512-AUNjvexh+APhhmS8S+KboPz+D3pCxPvEAGduffaAJYxIFxGi/ytZQkrqcKDUU0ERBAo5R7087fyOYr2oms1seg==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-26.6.2.tgz", + "integrity": "sha512-E9JjhUgNzvuQ+vVAL21vlyfy12gP0GhazGgJC4h6qUt1jSdUXGWJ1wfu/X7Sd8etSgxV4ovT1pb9v5D6QW4XgA==", "dev": true, "requires": { "@babel/core": "^7.1.0", - "@jest/types": "^26.5.2", + "@jest/types": "^26.6.2", "babel-plugin-istanbul": "^6.0.0", "chalk": "^4.0.0", "convert-source-map": "^1.4.0", "fast-json-stable-stringify": "^2.0.0", "graceful-fs": "^4.2.4", - "jest-haste-map": "^26.5.2", + "jest-haste-map": "^26.6.2", "jest-regex-util": "^26.0.0", - "jest-util": "^26.5.2", + "jest-util": "^26.6.2", "micromatch": "^4.0.2", "pirates": "^4.0.1", "slash": "^3.0.0", @@ -707,9 +717,9 @@ } }, "@jest/types": { - "version": "26.5.2", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.5.2.tgz", - "integrity": "sha512-QDs5d0gYiyetI8q+2xWdkixVQMklReZr4ltw7GFDtb4fuJIBCE6mzj2LnitGqCuAlLap6wPyb8fpoHgwZz5fdg==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", + "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", "dev": true, "requires": { "@types/istanbul-lib-coverage": "^2.0.0", @@ -764,24 +774,35 @@ } }, "@terra-money/terra.js": { - "version": "0.5.8", - "resolved": "https://registry.npmjs.org/@terra-money/terra.js/-/terra.js-0.5.8.tgz", - "integrity": "sha512-a+WqEgnxCIz0hCW/EhqF47TublEqPX/NdL5xNwve3sNFTjK7AqHcpVUS79hubimPy9HlDDZCSCF8YAXXJ7xfCQ==", + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/@terra-money/terra.js/-/terra.js-0.5.13.tgz", + "integrity": "sha512-v2B+VqVar6gryTfpHsusmDn2WIRT23xnTKsxFn6G20WIN5XCeRQa84cnAlZHuNP9w5ejuvRmoHX0Wg6g1DJo3g==", "requires": { "axios": "^0.20.0", "bech32": "^1.1.4", "bip32": "^2.0.6", "bip39": "^3.0.2", + "bufferutil": "^4.0.1", "crypto-js": "3.3.0", - "decimal.js": "^10.2.0", + "decimal.js": "^10.2.1", "post-message-stream": "^3.0.0", - "secp256k1": "^4.0.2" + "secp256k1": "^4.0.2", + "tmp": "^0.2.1", + "utf-8-validate": "^5.0.2", + "ws": "^7.3.1" + }, + "dependencies": { + "ws": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.0.tgz", + "integrity": "sha512-kyFwXuV/5ymf+IXhS6f0+eAFvydbaBW3zjpT6hUdAh/hbVjTIB5EHBGi0bPoCLSK2wcuz3BrEkB9LrYv1Nm4NQ==" + } } }, "@types/babel__core": { - "version": "7.1.10", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.10.tgz", - "integrity": "sha512-x8OM8XzITIMyiwl5Vmo2B1cR1S1Ipkyv4mdlbJjMa1lmuKvKY9FrBbEANIaMlnWn5Rf7uO+rC/VgYabNkE17Hw==", + "version": "7.1.12", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.12.tgz", + "integrity": "sha512-wMTHiiTiBAAPebqaPiPDLFA4LYPKr6Ph0Xq/6rq1Ur3v66HXyG+clfR9CNETkD7MQS8ZHvpQOtA53DLws5WAEQ==", "dev": true, "requires": { "@babel/parser": "^7.1.0", @@ -819,10 +840,36 @@ "@babel/types": "^7.3.0" } }, + "@types/eslint": { + "version": "7.2.4", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.4.tgz", + "integrity": "sha512-YCY4kzHMsHoyKspQH+nwSe+70Kep7Vjt2X+dZe5Vs2vkRudqtoFoUIv1RlJmZB8Hbp7McneupoZij4PadxsK5Q==", + "dev": true, + "requires": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "@types/eslint-scope": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.0.tgz", + "integrity": "sha512-O/ql2+rrCUe2W2rs7wMR+GqPRcgB6UiqN5RhrR5xruFlY7l9YLMn0ZkDzjoHLeiFkR8MCQZVudUuuvQ2BLC9Qw==", + "dev": true, + "requires": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "@types/estree": { + "version": "0.0.45", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.45.tgz", + "integrity": "sha512-jnqIUKDUqJbDIUxm0Uj7bnlMnRm1T/eZ9N+AVMqhPgzrba2GhGG5o/jCTwmdPK709nEZsGoMzXEDUjcXHa3W0g==", + "dev": true + }, "@types/graceful-fs": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.3.tgz", - "integrity": "sha512-AiHRaEB50LQg0pZmm659vNBb9f4SJ0qrAnteuzhSeAUcJKxoYgEnprg/83kppCnc2zvtCKbdZry1a5pVY3lOTQ==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.4.tgz", + "integrity": "sha512-mWA/4zFQhfvOA8zWkXobwJvBD7vzcxgrOQ0J5CH1votGqdq9m7+FwtGaqyCZqC3NyyBkc9z4m+iry4LlqcMWJg==", "dev": true, "requires": { "@types/node": "*" @@ -853,83 +900,13 @@ } }, "@types/jest": { - "version": "26.0.14", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-26.0.14.tgz", - "integrity": "sha512-Hz5q8Vu0D288x3iWXePSn53W7hAjP0H7EQ6QvDO9c7t46mR0lNOLlfuwQ+JkVxuhygHzlzPX+0jKdA3ZgSh+Vg==", + "version": "26.0.15", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-26.0.15.tgz", + "integrity": "sha512-s2VMReFXRg9XXxV+CW9e5Nz8fH2K1aEhwgjUqPPbQd7g95T0laAcvLv032EhFHIa5GHsZ8W7iJEQVaJq6k3Gog==", "dev": true, "requires": { - "jest-diff": "^25.2.1", - "pretty-format": "^25.2.1" - }, - "dependencies": { - "@jest/types": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-25.5.0.tgz", - "integrity": "sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^15.0.0", - "chalk": "^3.0.0" - } - }, - "@types/istanbul-reports": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.2.tgz", - "integrity": "sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "*", - "@types/istanbul-lib-report": "*" - } - }, - "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "diff-sequences": { - "version": "25.2.6", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-25.2.6.tgz", - "integrity": "sha512-Hq8o7+6GaZeoFjtpgvRBUknSXNeJiCx7V9Fr94ZMljNiCr9n9L8H8aJqgWOQiDDGdyn29fRNcDdRVJ5fdyihfg==", - "dev": true - }, - "jest-diff": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-25.5.0.tgz", - "integrity": "sha512-z1kygetuPiREYdNIumRpAHY6RXiGmp70YHptjdaxTWGmA085W3iCnXNx0DhflK3vwrKmrRWyY1wUpkPMVxMK7A==", - "dev": true, - "requires": { - "chalk": "^3.0.0", - "diff-sequences": "^25.2.6", - "jest-get-type": "^25.2.6", - "pretty-format": "^25.5.0" - } - }, - "jest-get-type": { - "version": "25.2.6", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-25.2.6.tgz", - "integrity": "sha512-DxjtyzOHjObRM+sM1knti6or+eOgcGU4xVSb2HNP1TqO4ahsT+rqZg+nyqHWJSvWgKC5cG3QjGFBqxLghiF/Ig==", - "dev": true - }, - "pretty-format": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-25.5.0.tgz", - "integrity": "sha512-kbo/kq2LQ/A/is0PQwsEHM7Ca6//bGPPvU6UnsdDRSKTWxT/ru/xb88v4BJf6a69H+uTytOEsTusT9ksd/1iWQ==", - "dev": true, - "requires": { - "@jest/types": "^25.5.0", - "ansi-regex": "^5.0.0", - "ansi-styles": "^4.0.0", - "react-is": "^16.12.0" - } - } + "jest-diff": "^26.0.0", + "pretty-format": "^26.0.0" } }, "@types/json-schema": { @@ -945,9 +922,9 @@ "dev": true }, "@types/node": { - "version": "14.11.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.8.tgz", - "integrity": "sha512-KPcKqKm5UKDkaYPTuXSx8wEP7vE9GnuaXIZKijwRYcePpZFDVuy2a57LarFKiORbHOuTOOwYzxVxcUzsh2P2Pw==", + "version": "14.14.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.7.tgz", + "integrity": "sha512-Zw1vhUSQZYw+7u5dAwNbIA9TuTotpzY/OF7sJM9FqPOF3SPjKnxrjoTktXDZgUjybf4cWVBP7O8wvKdSaGHweg==", "dev": true }, "@types/normalize-package-data": { @@ -963,9 +940,9 @@ "dev": true }, "@types/prettier": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.1.2.tgz", - "integrity": "sha512-IiPhNnenzkqdSdQH3ifk9LoX7oQe61ZlDdDO4+MUv6FyWdPGDPr26gCPVs3oguZEMq//nFZZpwUZcVuNJsG+DQ==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.1.5.tgz", + "integrity": "sha512-UEyp8LwZ4Dg30kVU2Q3amHHyTn1jEdhCIE59ANed76GaT1Vp76DD3ZWSAxgCrw6wJ0TqeoBpqmfUHiUDPs//HQ==", "dev": true }, "@types/stack-utils": { @@ -975,9 +952,9 @@ "dev": true }, "@types/yargs": { - "version": "15.0.8", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.8.tgz", - "integrity": "sha512-b0BYzFUzBpOhPjpl1wtAHU994jBeKF4TKVlT7ssFv44T617XNcPdRoG4AzHLVshLzlrF7i3lTelH7UbuNYV58Q==", + "version": "15.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.9.tgz", + "integrity": "sha512-HmU8SeIRhZCWcnRskCs36Q1Q00KBV6Cqh/ora8WN1+22dY07AZdn6Gel8QZ3t26XYPImtcL8WV/eqjhVmMEw4g==", "dev": true, "requires": { "@types/yargs-parser": "*" @@ -990,13 +967,13 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.5.0.tgz", - "integrity": "sha512-mjb/gwNcmDKNt+6mb7Aj/TjKzIJjOPcoCJpjBQC9ZnTRnBt1p4q5dJSSmIqAtsZ/Pff5N+hJlbiPc5bl6QN4OQ==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.7.0.tgz", + "integrity": "sha512-li9aiSVBBd7kU5VlQlT1AqP0uWGDK6JYKUQ9cVDnOg34VNnd9t4jr0Yqc/bKxJr/tDCPDaB4KzoSFN9fgVxe/Q==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "4.5.0", - "@typescript-eslint/scope-manager": "4.5.0", + "@typescript-eslint/experimental-utils": "4.7.0", + "@typescript-eslint/scope-manager": "4.7.0", "debug": "^4.1.1", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", @@ -1022,28 +999,28 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.5.0.tgz", - "integrity": "sha512-bW9IpSAKYvkqDGRZzayBXIgPsj2xmmVHLJ+flGSoN0fF98pGoKFhbunIol0VF2Crka7z984EEhFi623Rl7e6gg==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.7.0.tgz", + "integrity": "sha512-cymzovXAiD4EF+YoHAB5Oh02MpnXjvyaOb+v+BdpY7lsJXZQN34oIETeUwVT2XfV9rSNpXaIcknDLfupO/tUoA==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.5.0", - "@typescript-eslint/types": "4.5.0", - "@typescript-eslint/typescript-estree": "4.5.0", + "@typescript-eslint/scope-manager": "4.7.0", + "@typescript-eslint/types": "4.7.0", + "@typescript-eslint/typescript-estree": "4.7.0", "eslint-scope": "^5.0.0", "eslint-utils": "^2.0.0" } }, "@typescript-eslint/parser": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.5.0.tgz", - "integrity": "sha512-xb+gmyhQcnDWe+5+xxaQk5iCw6KqXd8VQxGiTeELTMoYeRjpocZYYRP1gFVM2C8Yl0SpUvLa1lhprwqZ00w3Iw==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.7.0.tgz", + "integrity": "sha512-+meGV8bMP1sJHBI2AFq1GeTwofcGiur8LoIr6v+rEmD9knyCqDlrQcFHR0KDDfldHIFDU/enZ53fla6ReF4wRw==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "4.5.0", - "@typescript-eslint/types": "4.5.0", - "@typescript-eslint/typescript-estree": "4.5.0", + "@typescript-eslint/scope-manager": "4.7.0", + "@typescript-eslint/types": "4.7.0", + "@typescript-eslint/typescript-estree": "4.7.0", "debug": "^4.1.1" }, "dependencies": { @@ -1065,29 +1042,29 @@ } }, "@typescript-eslint/scope-manager": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.5.0.tgz", - "integrity": "sha512-C0cEO0cTMPJ/w4RA/KVe4LFFkkSh9VHoFzKmyaaDWAnPYIEzVCtJ+Un8GZoJhcvq+mPFXEsXa01lcZDHDG6Www==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.7.0.tgz", + "integrity": "sha512-ILITvqwDJYbcDCROj6+Ob0oCKNg3SH46iWcNcTIT9B5aiVssoTYkhKjxOMNzR1F7WSJkik4zmuqve5MdnA0DyA==", "dev": true, "requires": { - "@typescript-eslint/types": "4.5.0", - "@typescript-eslint/visitor-keys": "4.5.0" + "@typescript-eslint/types": "4.7.0", + "@typescript-eslint/visitor-keys": "4.7.0" } }, "@typescript-eslint/types": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.5.0.tgz", - "integrity": "sha512-n2uQoXnyWNk0Les9MtF0gCK3JiWd987JQi97dMSxBOzVoLZXCNtxFckVqt1h8xuI1ix01t+iMY4h4rFMj/303g==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.7.0.tgz", + "integrity": "sha512-uLszFe0wExJc+I7q0Z/+BnP7wao/kzX0hB5vJn4LIgrfrMLgnB2UXoReV19lkJQS1a1mHWGGODSxnBx6JQC3Sg==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.5.0.tgz", - "integrity": "sha512-gN1mffq3zwRAjlYWzb5DanarOPdajQwx5MEWkWCk0XvqC8JpafDTeioDoow2L4CA/RkYZu7xEsGZRhqrTsAG8w==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.7.0.tgz", + "integrity": "sha512-5XZRQznD1MfUmxu1t8/j2Af4OxbA7EFU2rbo0No7meb46eHgGkSieFdfV6omiC/DGIBhH9H9gXn7okBbVOm8jw==", "dev": true, "requires": { - "@typescript-eslint/types": "4.5.0", - "@typescript-eslint/visitor-keys": "4.5.0", + "@typescript-eslint/types": "4.7.0", + "@typescript-eslint/visitor-keys": "4.7.0", "debug": "^4.1.1", "globby": "^11.0.1", "is-glob": "^4.0.1", @@ -1114,12 +1091,12 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.5.0.tgz", - "integrity": "sha512-UHq4FSa55NDZqscRU//O5ROFhHa9Hqn9KWTEvJGTArtTQp5GKv9Zqf6d/Q3YXXcFv4woyBml7fJQlQ+OuqRcHA==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.7.0.tgz", + "integrity": "sha512-aDJDWuCRsf1lXOtignlfiPODkzSxxop7D0rZ91L6ZuMlcMCSh0YyK+gAfo5zN/ih6WxMwhoXgJWC3cWQdaKC+A==", "dev": true, "requires": { - "@typescript-eslint/types": "4.5.0", + "@typescript-eslint/types": "4.7.0", "eslint-visitor-keys": "^2.0.0" } }, @@ -1298,6 +1275,21 @@ "@xtuc/long": "4.2.2" } }, + "@webpack-cli/info": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.1.0.tgz", + "integrity": "sha512-uNWSdaYHc+f3LdIZNwhdhkjjLDDl3jP2+XBqAq9H8DjrJUvlOKdP8TNruy1yEaDfgpAIgbSAN7pye4FEHg9tYQ==", + "dev": true, + "requires": { + "envinfo": "^7.7.3" + } + }, + "@webpack-cli/serve": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.1.0.tgz", + "integrity": "sha512-7RfnMXCpJ/NThrhq4gYQYILB18xWyoQcBey81oIyVbmgbc6m5ZHHyFK+DyH7pLHJf0p14MxL4mTsoPAgBSTpIg==", + "dev": true + }, "@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -1376,12 +1368,6 @@ "uri-js": "^4.2.2" } }, - "ajv-errors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", - "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", - "dev": true - }, "ajv-keywords": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", @@ -1436,12 +1422,6 @@ "picomatch": "^2.0.4" } }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true - }, "arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -1475,6 +1455,12 @@ "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", "dev": true }, + "array-back": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.1.tgz", + "integrity": "sha512-Z/JnaVEXv+A9xabHzN43FiiiWEE7gPCRXMrVmRm00tWbjZRul1iHm7ECzlyNq1p4a4ATXz+G9FJ3GqGOkOV3fg==", + "dev": true + }, "array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", @@ -1565,45 +1551,6 @@ "safer-buffer": "~2.1.0" } }, - "asn1.js": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", - "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "safer-buffer": "^2.1.0" - } - }, - "assert": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", - "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", - "dev": true, - "requires": { - "object-assign": "^4.1.1", - "util": "0.10.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", - "dev": true - }, - "util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", - "dev": true, - "requires": { - "inherits": "2.0.1" - } - } - } - }, "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", @@ -1622,17 +1569,10 @@ "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", "dev": true }, - "async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", - "dev": true, - "optional": true - }, - "async-limiter": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", - "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", + "async": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", "dev": true }, "asynckit": { @@ -1660,9 +1600,9 @@ "dev": true }, "aws4": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", - "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", "dev": true }, "axios": { @@ -1674,16 +1614,16 @@ } }, "babel-jest": { - "version": "26.5.2", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-26.5.2.tgz", - "integrity": "sha512-U3KvymF3SczA3vOL/cgiUFOznfMET+XDIXiWnoJV45siAp2pLMG8i2+/MGZlAC3f/F6Q40LR4M4qDrWZ9wkK8A==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-26.6.3.tgz", + "integrity": "sha512-pl4Q+GAVOHwvjrck6jKjvmGhnO3jHX/xuB9d27f+EJZ/6k+6nMuPjorrYp7s++bKKdANwzElBWnLWaObvTnaZA==", "dev": true, "requires": { - "@jest/transform": "^26.5.2", - "@jest/types": "^26.5.2", + "@jest/transform": "^26.6.2", + "@jest/types": "^26.6.2", "@types/babel__core": "^7.1.7", "babel-plugin-istanbul": "^6.0.0", - "babel-preset-jest": "^26.5.0", + "babel-preset-jest": "^26.6.2", "chalk": "^4.0.0", "graceful-fs": "^4.2.4", "slash": "^3.0.0" @@ -1703,9 +1643,9 @@ } }, "babel-plugin-jest-hoist": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.5.0.tgz", - "integrity": "sha512-ck17uZFD3CDfuwCLATWZxkkuGGFhMij8quP8CNhwj8ek1mqFgbFzRJ30xwC04LLscj/aKsVFfRST+b5PT7rSuw==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.6.2.tgz", + "integrity": "sha512-PO9t0697lNTmcEHH69mdtYiOIkkOlj9fySqfO3K1eCcdISevLAE0xY59VLLUj0SoiPiTX/JU2CYFpILydUa5Lw==", "dev": true, "requires": { "@babel/template": "^7.3.3", @@ -1715,9 +1655,9 @@ } }, "babel-preset-current-node-syntax": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-0.1.4.tgz", - "integrity": "sha512-5/INNCYhUGqw7VbVjT/hb3ucjgkVHKXY7lX3ZjlN4gm565VyFmJUrJ/h+h16ECVB38R/9SF6aACydpKMLZ/c9w==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.0.tgz", + "integrity": "sha512-mGkvkpocWJes1CmMKtgGUwCeeq0pOhALyymozzDWYomHTbDLwueDYG6p4TK1YOeYHCzBzYPsWkgTto10JubI1Q==", "dev": true, "requires": { "@babel/plugin-syntax-async-generators": "^7.8.4", @@ -1730,24 +1670,24 @@ "@babel/plugin-syntax-numeric-separator": "^7.8.3", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3" + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" } }, "babel-preset-jest": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-26.5.0.tgz", - "integrity": "sha512-F2vTluljhqkiGSJGBg/jOruA8vIIIL11YrxRcO7nviNTMbbofPSHwnm8mgP7d/wS7wRSexRoI6X1A6T74d4LQA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-26.6.2.tgz", + "integrity": "sha512-YvdtlVm9t3k777c5NPQIv6cxFFFapys25HiUmuSgHwIZhfifweR5c5Sf5nwE3MAbfu327CYSvps8Yx6ANLyleQ==", "dev": true, "requires": { - "babel-plugin-jest-hoist": "^26.5.0", - "babel-preset-current-node-syntax": "^0.1.3" + "babel-plugin-jest-hoist": "^26.6.2", + "babel-preset-current-node-syntax": "^1.0.0" } }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "base": { "version": "0.11.2", @@ -1783,12 +1723,6 @@ "safe-buffer": "^5.0.1" } }, - "base64-js": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", - "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", - "dev": true - }, "bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", @@ -1803,31 +1737,12 @@ "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==" }, - "bfj": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/bfj/-/bfj-6.1.2.tgz", - "integrity": "sha512-BmBJa4Lip6BPRINSZ0BPEIfB1wUY/9rwbwvIHQA1KjX9om29B6id0wnWXq7m3bn5JrUVjeOTnVuhPT1FiHwPGw==", - "dev": true, - "requires": { - "bluebird": "^3.5.5", - "check-types": "^8.0.3", - "hoopy": "^0.1.4", - "tryer": "^1.0.1" - } - }, "big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", "dev": true }, - "binary-extensions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", - "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", - "dev": true, - "optional": true - }, "bindings": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", @@ -1875,12 +1790,6 @@ } } }, - "bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, "bn.js": { "version": "4.11.9", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", @@ -1908,7 +1817,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1954,96 +1862,17 @@ "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", "dev": true }, - "browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, - "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, - "requires": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "browserify-rsa": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "randombytes": "^2.0.1" - } - }, - "browserify-sign": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", - "dev": true, - "requires": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", - "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "dependencies": { - "bn.js": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", - "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==", - "dev": true - }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, - "browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "browserslist": { + "version": "4.14.7", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.7.tgz", + "integrity": "sha512-BSVRLCeG3Xt/j/1cCGj1019Wbty0H+Yvu2AOuZSuoaUWn3RatbL33Cxk+Q4jRMRAbOm0p7SLravLjpnT6s0vzQ==", "dev": true, "requires": { - "pako": "~1.0.5" + "caniuse-lite": "^1.0.30001157", + "colorette": "^1.2.1", + "electron-to-chromium": "^1.3.591", + "escalade": "^3.1.1", + "node-releases": "^1.1.66" } }, "bs-logger": { @@ -2082,34 +1911,19 @@ "node-int64": "^0.4.0" } }, - "buffer": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", - "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", - "dev": true, - "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4", - "isarray": "^1.0.0" - } - }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true - }, - "builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", - "dev": true + "bufferutil": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.2.tgz", + "integrity": "sha512-AtnG3W6M8B2n4xDQ5R+70EXvOpnXsFYg/AK2yTZd+HQ/oxAdz+GI+DvjmhBw3L0ole+LJ0ngqY4JMbDzkfNzhA==", + "requires": { + "node-gyp-build": "^4.2.0" + } }, "bytes": { "version": "3.1.0", @@ -2117,29 +1931,6 @@ "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", "dev": true }, - "cacache": { - "version": "12.0.4", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", - "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", - "dev": true, - "requires": { - "bluebird": "^3.5.5", - "chownr": "^1.1.1", - "figgy-pudding": "^3.5.1", - "glob": "^7.1.4", - "graceful-fs": "^4.1.15", - "infer-owner": "^1.0.3", - "lru-cache": "^5.1.1", - "mississippi": "^3.0.0", - "mkdirp": "^0.5.1", - "move-concurrently": "^1.0.1", - "promise-inflight": "^1.0.1", - "rimraf": "^2.6.3", - "ssri": "^6.0.1", - "unique-filename": "^1.1.1", - "y18n": "^4.0.0" - } - }, "cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", @@ -2157,6 +1948,16 @@ "unset-value": "^1.0.0" } }, + "call-bind": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.0.tgz", + "integrity": "sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.0" + } + }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -2169,6 +1970,12 @@ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, + "caniuse-lite": { + "version": "1.0.30001157", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001157.tgz", + "integrity": "sha512-gOerH9Wz2IRZ2ZPdMfBvyOi3cjaz4O4dgNwPGzx8EhqAs4+2IL/O+fJsbt+znSigujoZG8bVcIAUM/I/E5K3MA==", + "dev": true + }, "capture-exit": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", @@ -2200,108 +2007,46 @@ "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", "dev": true }, - "check-types": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/check-types/-/check-types-8.0.3.tgz", - "integrity": "sha512-YpeKZngUmG65rLudJ4taU7VLkOCTMhNl/u4ctNC56LQS/zJTyNH0Lrtwm1tfTsbLlwvlfsA2d1c8vCf/Kh2KwQ==", + "chrome-trace-event": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz", + "integrity": "sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "cjs-module-lexer": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz", + "integrity": "sha512-uc2Vix1frTfnuzxxu1Hp4ktSvM3QaI4oXl4ZUqL1wjTu/BGki9TrCWoqLTg/drR1KwAEarXuRFCG2Svr1GxPFw==", "dev": true }, - "chokidar": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.2.tgz", - "integrity": "sha512-IZHaDeBeI+sZJRX7lGcXsdzgvZqKv6sECqsbErJA4mHWfpRrD8B97kSFN4cQz6nGBGiuFia1MKR4d6c1o8Cv7A==", + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", "dev": true, - "optional": true, "requires": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "fsevents": "~2.1.2", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.4.0" - }, - "dependencies": { - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "optional": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "optional": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "optional": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "optional": true, - "requires": { - "is-number": "^7.0.0" - } - } - } - }, - "chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "dev": true - }, - "chrome-trace-event": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz", - "integrity": "sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ==", - "dev": true, - "requires": { - "tslib": "^1.9.0" - } - }, - "ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true - }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" }, "dependencies": { "define-property": { @@ -2403,6 +2148,18 @@ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, "slice-ansi": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", @@ -2413,6 +2170,17 @@ "astral-regex": "^2.0.0", "is-fullwidth-code-point": "^3.0.0" } + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } } } }, @@ -2425,6 +2193,31 @@ "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^6.2.0" + }, + "dependencies": { + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + } } }, "co": { @@ -2464,6 +2257,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "colorette": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz", + "integrity": "sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==", + "dev": true + }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -2473,18 +2272,76 @@ "delayed-stream": "~1.0.0" } }, + "command-line-usage": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.1.tgz", + "integrity": "sha512-F59pEuAR9o1SF/bD0dQBDluhpT4jJQNWUHEuVBqpDmCUo6gPjCi+m9fCWnWZVR/oG6cMTUms4h+3NPl74wGXvA==", + "dev": true, + "requires": { + "array-back": "^4.0.1", + "chalk": "^2.4.2", + "table-layout": "^1.0.1", + "typical": "^5.2.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, "compare-versions": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", @@ -2500,37 +2357,12 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "confusing-browser-globals": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.9.tgz", - "integrity": "sha512-KbS1Y0jMtyPgIxjO7ZzMAuUpAKMt1SzCL9fsrKsX6b0zJPTaT0SiSPmewwVZg9UAO83HVIlEhZF84LIjZ0lmAw==", - "dev": true - }, - "console-browserify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", - "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", - "dev": true - }, - "constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.10.tgz", + "integrity": "sha512-gNld/3lySHwuhaVluJUKLePYirM3QNCKzVxqAdhJII9/WXKVX5PURzMVJspS1jTslSqjeuG4KMVTSouit5YPHA==", "dev": true }, "contains-path": { @@ -2591,20 +2423,6 @@ "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", "dev": true }, - "copy-concurrently": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", - "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", - "dev": true, - "requires": { - "aproba": "^1.1.1", - "fs-write-stream-atomic": "^1.0.8", - "iferr": "^0.1.5", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.0" - } - }, "copy-descriptor": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", @@ -2629,16 +2447,6 @@ "yaml": "^1.10.0" } }, - "create-ecdh": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", - "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "elliptic": "^6.5.3" - } - }, "create-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -2685,25 +2493,6 @@ } } }, - "crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "requires": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - } - }, "crypto-js": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz", @@ -2732,12 +2521,6 @@ } } }, - "cyclist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", - "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", - "dev": true - }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -2790,6 +2573,12 @@ "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", "dev": true }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true + }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -2833,28 +2622,12 @@ "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", "dev": true }, - "des.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", - "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, "destroy": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", "dev": true }, - "detect-file": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", - "dev": true - }, "detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -2868,22 +2641,11 @@ "dev": true }, "diff-sequences": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.5.0.tgz", - "integrity": "sha512-ZXx86srb/iYy6jG71k++wBN9P9J05UNQ5hQHQd9MtMPvcqXPx/vKU69jfHV637D00Q2gSgPk2D+jSx3l1lDW/Q==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz", + "integrity": "sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==", "dev": true }, - "diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - } - }, "dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -2902,12 +2664,6 @@ "esutils": "^2.0.2" } }, - "domain-browser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", - "dev": true - }, "domexception": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", @@ -2931,18 +2687,6 @@ "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", "dev": true }, - "duplexify": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", - "dev": true, - "requires": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - } - }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -2960,9 +2704,18 @@ "dev": true }, "ejs": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-2.7.4.tgz", - "integrity": "sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.5.tgz", + "integrity": "sha512-dldq3ZfFtgVTJMLjOe+/3sROTzALlL9E34V4/sDtUd/KlBSS0s6U1/+WPE1B4sj9CXHJpL1M6rhNJnc9Wbal9w==", + "dev": true, + "requires": { + "jake": "^10.6.1" + } + }, + "electron-to-chromium": { + "version": "1.3.592", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.592.tgz", + "integrity": "sha512-kGNowksvqQiPb1pUSQKpd8JFoGPLxYOwduNRCqCxGh/2Q1qE2JdmwouCW41lUzDxOb/2RIV4lR0tVIfboWlO9A==", "dev": true }, "elliptic": { @@ -2980,15 +2733,15 @@ } }, "emittery": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.1.tgz", - "integrity": "sha512-d34LN4L6h18Bzz9xpoku2nPwKxCPlPMr3EEKTkoEBi+1/+b0lcRkRJ1UVyyZaKNeqGR3swcGl6s390DNO4YVgQ==", + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz", + "integrity": "sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ==", "dev": true }, "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, "emojis-list": { @@ -3044,6 +2797,12 @@ "ansi-colors": "^4.1.1" } }, + "envinfo": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.7.3.tgz", + "integrity": "sha512-46+j5QxbPWza0PB1i15nZx0xQ4I/EfQxg9J8Had3b408SV63nEtor2e+oiY63amTo9KTuh2a3XLObNwduxYwwA==", + "dev": true + }, "errno": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", @@ -3093,6 +2852,12 @@ "is-symbol": "^1.0.2" } }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -3116,16 +2881,57 @@ "esutils": "^2.0.2", "optionator": "^0.8.1", "source-map": "~0.6.1" + }, + "dependencies": { + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + } } }, "eslint": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.11.0.tgz", - "integrity": "sha512-G9+qtYVCHaDi1ZuWzBsOWo2wSwd70TXnU6UHA3cTYHp7gCTXZcpggWFoUVAMRarg68qtPoNfFbzPh+VdOgmwmw==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.13.0.tgz", + "integrity": "sha512-uCORMuOO8tUzJmsdRtrvcGq5qposf7Rw0LwkTJkoDbOycVQtQjmnhZSuLQnozLE4TmAzlMVV45eCHmQ1OpDKUQ==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@eslint/eslintrc": "^0.1.3", + "@eslint/eslintrc": "^0.2.1", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -3189,48 +2995,18 @@ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, - "levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "requires": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - } - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "requires": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - } - }, "path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, - "prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true - }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -3246,15 +3022,6 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, - "type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "requires": { - "prelude-ls": "^1.2.1" - } - }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -3267,14 +3034,28 @@ } }, "eslint-config-airbnb-base": { - "version": "14.2.0", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.0.tgz", - "integrity": "sha512-Snswd5oC6nJaevs3nZoLSTvGJBvzTfnBqOIArkf3cbyTyq9UD79wOk8s+RiL6bhca0p/eRO6veczhf6A/7Jy8Q==", + "version": "14.2.1", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz", + "integrity": "sha512-GOrQyDtVEc1Xy20U7vsB2yAoB4nBlfH5HZJeatRXHleO+OS5Ot+MWij4Dpltw4/DyIkqUfqz1epfhVR5XWWQPA==", "dev": true, "requires": { - "confusing-browser-globals": "^1.0.9", - "object.assign": "^4.1.0", + "confusing-browser-globals": "^1.0.10", + "object.assign": "^4.1.2", "object.entries": "^1.1.2" + }, + "dependencies": { + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + } } }, "eslint-config-standard": { @@ -3520,9 +3301,9 @@ "dev": true }, "eslint-plugin-standard": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-4.0.1.tgz", - "integrity": "sha512-v/KBnfyaOMPmZc/dmc6ozOdWqekGp7bBGq4jLAecEfPGmfKiWS4sA8sC0LqiV9w5qmXAtXVn4M3p1jSyhY85SQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-4.1.0.tgz", + "integrity": "sha512-ZL7+QRixjTR6/528YNGyDotyffm5OQst/sGxKDwGb9Uqs4In5Egi4+jbobhqJoyoCM6/7v/1A5fhQ7ScMtDjaQ==", "dev": true }, "eslint-scope": { @@ -3641,16 +3422,6 @@ "integrity": "sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg==", "dev": true }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, "exec-sh": { "version": "0.3.4", "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.4.tgz", @@ -3770,26 +3541,17 @@ } } }, - "expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", - "dev": true, - "requires": { - "homedir-polyfill": "^1.0.1" - } - }, "expect": { - "version": "26.5.3", - "resolved": "https://registry.npmjs.org/expect/-/expect-26.5.3.tgz", - "integrity": "sha512-kkpOhGRWGOr+TEFUnYAjfGvv35bfP+OlPtqPIJpOCR9DVtv8QV+p8zG0Edqafh80fsjeE+7RBcVUq1xApnYglw==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/expect/-/expect-26.6.2.tgz", + "integrity": "sha512-9/hlOBkQl2l/PLHJx6JjoDF6xPKcJEsUlWKb23rKE7KzeDqUZKXKNMW27KIue5JMdBV9HgmoJPcc8HtO85t9IA==", "dev": true, "requires": { - "@jest/types": "^26.5.2", + "@jest/types": "^26.6.2", "ansi-styles": "^4.0.0", "jest-get-type": "^26.3.0", - "jest-matcher-utils": "^26.5.2", - "jest-message-util": "^26.5.2", + "jest-matcher-utils": "^26.6.2", + "jest-message-util": "^26.6.2", "jest-regex-util": "^26.0.0" } }, @@ -3941,9 +3703,9 @@ "dev": true }, "fastq": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.8.0.tgz", - "integrity": "sha512-SMIZoZdLh/fgofivvIkmknUXyPnvxRE3DhtZ5Me3Mrsk5gyPL42F0xr51TdRXskBxHfMp+07bcYzfsYEsSQA9Q==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.9.0.tgz", + "integrity": "sha512-i7FVWL8HhVY+CTkwFxkN2mk3h+787ixS5S63eb78diVRc1MCssarHq3W5cj0av7YDSwmaV928RNag+U1etRQ7w==", "dev": true, "requires": { "reusify": "^1.0.4" @@ -3958,12 +3720,6 @@ "bser": "2.1.1" } }, - "figgy-pudding": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", - "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", - "dev": true - }, "figures": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", @@ -3987,10 +3743,19 @@ "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, + "filelist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.1.tgz", + "integrity": "sha512-8zSK6Nu0DQIC08mUC46sWGXi+q3GGpKydAG36k+JDba6VRpkevvOWUW5a/PhShij4+vHT9M+ghgG7eM+a9JDUQ==", + "dev": true, + "requires": { + "minimatch": "^3.0.4" + } + }, "filesize": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/filesize/-/filesize-3.6.1.tgz", - "integrity": "sha512-7KjR1vv6qnicaPMi1iiTcI85CyYwRO/PSFCu6SvqL8jN2Wjt/NIYQTFtFs7fSDCYOstUkEWIQGFUg5YZQfjlcg==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/filesize/-/filesize-6.1.0.tgz", + "integrity": "sha512-LpCHtPQ3sFx67z+uh2HnSyWSLLu5Jxo21795uRDuar/EOuYWXib5EmPaGIBuSnRqH2IODiKA2k5re/K9OnN/Yg==", "dev": true }, "fill-range": { @@ -4031,17 +3796,6 @@ "unpipe": "~1.0.0" } }, - "find-cache-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", - "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^2.0.0", - "pkg-dir": "^3.0.0" - } - }, "find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -4061,41 +3815,6 @@ "semver-regex": "^2.0.0" } }, - "findup-sync": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", - "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", - "dev": true, - "requires": { - "detect-file": "^1.0.0", - "is-glob": "^4.0.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - }, - "dependencies": { - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - } - } - }, "flat-cache": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", @@ -4124,16 +3843,6 @@ "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", "dev": true }, - "flush-write-stream": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", - "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "readable-stream": "^2.3.6" - } - }, "follow-redirects": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz", @@ -4183,16 +3892,6 @@ "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", "dev": true }, - "from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - } - }, "fs-extra": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", @@ -4205,23 +3904,10 @@ "universalify": "^1.0.0" } }, - "fs-write-stream-atomic": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", - "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "iferr": "^0.1.5", - "imurmurhash": "^0.1.4", - "readable-stream": "1 || 2" - } - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { "version": "2.1.3", @@ -4243,9 +3929,9 @@ "dev": true }, "gensync": { - "version": "1.0.0-beta.1", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", - "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true }, "get-caller-file": { @@ -4254,6 +3940,17 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, + "get-intrinsic": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.1.tgz", + "integrity": "sha512-ZnWP+AmS1VUaLgTRy47+zKtjTxz+0xMpx3I52i+aalBK1QP19ggLF3Db89KJX7kjfOfP2eoa01qc++GwPgufPg==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, "get-own-enumerable-property-symbols": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", @@ -4294,7 +3991,6 @@ "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -4313,40 +4009,11 @@ "is-glob": "^4.0.1" } }, - "global-modules": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", - "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", - "dev": true, - "requires": { - "global-prefix": "^3.0.0" - }, - "dependencies": { - "global-prefix": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", - "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", - "dev": true, - "requires": { - "ini": "^1.3.5", - "kind-of": "^6.0.2", - "which": "^1.3.1" - } - } - } - }, - "global-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" - } + "glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true }, "globals": { "version": "12.4.0", @@ -4523,21 +4190,6 @@ "minimalistic-crypto-utils": "^1.0.1" } }, - "homedir-polyfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", - "dev": true, - "requires": { - "parse-passwd": "^1.0.0" - } - }, - "hoopy": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/hoopy/-/hoopy-0.1.4.tgz", - "integrity": "sha512-HRcs+2mr52W0K+x8RzcLzuPPmVIKMSv97RGHy0Ea9y/mpcaK+xTrjICA04KAHi4GRzxliNqNJEFYWHghy3rSfQ==", - "dev": true - }, "hosted-git-info": { "version": "2.8.8", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", @@ -4591,12 +4243,6 @@ "sshpk": "^1.7.0" } }, - "https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", - "dev": true - }, "human-signals": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", @@ -4641,18 +4287,6 @@ "safer-buffer": ">= 2.1.2 < 3" } }, - "ieee754": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", - "dev": true - }, - "iferr": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", - "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", - "dev": true - }, "ignore": { "version": "5.1.8", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", @@ -4710,17 +4344,10 @@ "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true }, - "infer-owner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", - "dev": true - }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -4731,12 +4358,6 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true - }, "interpret": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", @@ -4770,16 +4391,6 @@ "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "optional": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", @@ -4801,6 +4412,15 @@ "ci-info": "^2.0.0" } }, + "is-core-module": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.1.0.tgz", + "integrity": "sha512-YcV7BgVMRFRua2FqQzKtTDMz8iCuLEyGKjr70q8Zm1yy2qKcurbFEd79PAdHV77oL3NrAaOVQIbMmiHQCHB7ZA==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, "is-data-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", @@ -4847,9 +4467,9 @@ "dev": true }, "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, "is-generator-fn": { @@ -4962,12 +4582,6 @@ "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true }, - "is-wsl": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", - "dev": true - }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -5083,47 +4697,111 @@ "istanbul-lib-report": "^3.0.0" } }, + "jake": { + "version": "10.8.2", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.2.tgz", + "integrity": "sha512-eLpKyrfG3mzvGE2Du8VoPbeSkRry093+tyNjdYaBbJS9v17knImYGNXQCUV0gLxQtF82m3E8iRb/wdSQZLoq7A==", + "dev": true, + "requires": { + "async": "0.9.x", + "chalk": "^2.4.2", + "filelist": "^1.0.1", + "minimatch": "^3.0.4" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "jest": { - "version": "26.4.2", - "resolved": "https://registry.npmjs.org/jest/-/jest-26.4.2.tgz", - "integrity": "sha512-LLCjPrUh98Ik8CzW8LLVnSCfLaiY+wbK53U7VxnFSX7Q+kWC4noVeDvGWIFw0Amfq1lq2VfGm7YHWSLBV62MJw==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest/-/jest-26.6.3.tgz", + "integrity": "sha512-lGS5PXGAzR4RF7V5+XObhqz2KZIDUA1yD0DG6pBVmy10eh0ZIXQImRuzocsI/N2XZ1GrLFwTS27In2i2jlpq1Q==", "dev": true, "requires": { - "@jest/core": "^26.4.2", + "@jest/core": "^26.6.3", "import-local": "^3.0.2", - "jest-cli": "^26.4.2" + "jest-cli": "^26.6.3" }, "dependencies": { "jest-cli": { - "version": "26.4.2", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-26.4.2.tgz", - "integrity": "sha512-zb+lGd/SfrPvoRSC/0LWdaWCnscXc1mGYW//NP4/tmBvRPT3VntZ2jtKUONsRi59zc5JqmsSajA9ewJKFYp8Cw==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-26.6.3.tgz", + "integrity": "sha512-GF9noBSa9t08pSyl3CY4frMrqp+aQXFGFkf5hEPbh/pIUFYWMK6ZLTfbmadxJVcJrdRoChlWQsA2VkJcDFK8hg==", "dev": true, "requires": { - "@jest/core": "^26.4.2", - "@jest/test-result": "^26.3.0", - "@jest/types": "^26.3.0", + "@jest/core": "^26.6.3", + "@jest/test-result": "^26.6.2", + "@jest/types": "^26.6.2", "chalk": "^4.0.0", "exit": "^0.1.2", "graceful-fs": "^4.2.4", "import-local": "^3.0.2", "is-ci": "^2.0.0", - "jest-config": "^26.4.2", - "jest-util": "^26.3.0", - "jest-validate": "^26.4.2", + "jest-config": "^26.6.3", + "jest-util": "^26.6.2", + "jest-validate": "^26.6.2", "prompts": "^2.0.1", - "yargs": "^15.3.1" + "yargs": "^15.4.1" } } } }, "jest-changed-files": { - "version": "26.5.2", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-26.5.2.tgz", - "integrity": "sha512-qSmssmiIdvM5BWVtyK/nqVpN3spR5YyvkvPqz1x3BR1bwIxsWmU/MGwLoCrPNLbkG2ASAKfvmJpOduEApBPh2w==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-26.6.2.tgz", + "integrity": "sha512-fDS7szLcY9sCtIip8Fjry9oGf3I2ht/QT21bAHm5Dmf0mD4X3ReNUf17y+bO6fR8WgbIZTlbyG1ak/53cbRzKQ==", "dev": true, "requires": { - "@jest/types": "^26.5.2", + "@jest/types": "^26.6.2", "execa": "^4.0.0", "throat": "^5.0.0" }, @@ -5140,9 +4818,9 @@ } }, "execa": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.0.3.tgz", - "integrity": "sha512-WFDXGHckXPWZX19t1kCsXzOpqX9LWYNqn4C+HqZlk/V0imTkzJZqf87ZBhvpHaftERYknpk0fjSylnXVlVgI0A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", "dev": true, "requires": { "cross-spawn": "^7.0.0", @@ -5213,41 +4891,41 @@ } }, "jest-config": { - "version": "26.5.3", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-26.5.3.tgz", - "integrity": "sha512-NVhZiIuN0GQM6b6as4CI5FSCyXKxdrx5ACMCcv/7Pf+TeCajJhJc+6dwgdAVPyerUFB9pRBIz3bE7clSrRge/w==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-26.6.3.tgz", + "integrity": "sha512-t5qdIj/bCj2j7NFVHb2nFB4aUdfucDn3JRKgrZnplb8nieAirAzRSHP8uDEd+qV6ygzg9Pz4YG7UTJf94LPSyg==", "dev": true, "requires": { "@babel/core": "^7.1.0", - "@jest/test-sequencer": "^26.5.3", - "@jest/types": "^26.5.2", - "babel-jest": "^26.5.2", + "@jest/test-sequencer": "^26.6.3", + "@jest/types": "^26.6.2", + "babel-jest": "^26.6.3", "chalk": "^4.0.0", "deepmerge": "^4.2.2", "glob": "^7.1.1", "graceful-fs": "^4.2.4", - "jest-environment-jsdom": "^26.5.2", - "jest-environment-node": "^26.5.2", + "jest-environment-jsdom": "^26.6.2", + "jest-environment-node": "^26.6.2", "jest-get-type": "^26.3.0", - "jest-jasmine2": "^26.5.3", + "jest-jasmine2": "^26.6.3", "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.5.2", - "jest-util": "^26.5.2", - "jest-validate": "^26.5.3", + "jest-resolve": "^26.6.2", + "jest-util": "^26.6.2", + "jest-validate": "^26.6.2", "micromatch": "^4.0.2", - "pretty-format": "^26.5.2" + "pretty-format": "^26.6.2" } }, "jest-diff": { - "version": "26.5.2", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.5.2.tgz", - "integrity": "sha512-HCSWDUGwsov5oTlGzrRM+UPJI/Dpqi9jzeV0fdRNi3Ch5bnoXhnyJMmVg2juv9081zLIy3HGPI5mcuGgXM2xRA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.2.tgz", + "integrity": "sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA==", "dev": true, "requires": { "chalk": "^4.0.0", - "diff-sequences": "^26.5.0", + "diff-sequences": "^26.6.2", "jest-get-type": "^26.3.0", - "pretty-format": "^26.5.2" + "pretty-format": "^26.6.2" } }, "jest-docblock": { @@ -5260,45 +4938,45 @@ } }, "jest-each": { - "version": "26.5.2", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-26.5.2.tgz", - "integrity": "sha512-w7D9FNe0m2D3yZ0Drj9CLkyF/mGhmBSULMQTypzAKR746xXnjUrK8GUJdlLTWUF6dd0ks3MtvGP7/xNFr9Aphg==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-26.6.2.tgz", + "integrity": "sha512-Mer/f0KaATbjl8MCJ+0GEpNdqmnVmDYqCTJYTvoo7rqmRiDllmp2AYN+06F93nXcY3ur9ShIjS+CO/uD+BbH4A==", "dev": true, "requires": { - "@jest/types": "^26.5.2", + "@jest/types": "^26.6.2", "chalk": "^4.0.0", "jest-get-type": "^26.3.0", - "jest-util": "^26.5.2", - "pretty-format": "^26.5.2" + "jest-util": "^26.6.2", + "pretty-format": "^26.6.2" } }, "jest-environment-jsdom": { - "version": "26.5.2", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-26.5.2.tgz", - "integrity": "sha512-fWZPx0bluJaTQ36+PmRpvUtUlUFlGGBNyGX1SN3dLUHHMcQ4WseNEzcGGKOw4U5towXgxI4qDoI3vwR18H0RTw==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-26.6.2.tgz", + "integrity": "sha512-jgPqCruTlt3Kwqg5/WVFyHIOJHsiAvhcp2qiR2QQstuG9yWox5+iHpU3ZrcBxW14T4fe5Z68jAfLRh7joCSP2Q==", "dev": true, "requires": { - "@jest/environment": "^26.5.2", - "@jest/fake-timers": "^26.5.2", - "@jest/types": "^26.5.2", + "@jest/environment": "^26.6.2", + "@jest/fake-timers": "^26.6.2", + "@jest/types": "^26.6.2", "@types/node": "*", - "jest-mock": "^26.5.2", - "jest-util": "^26.5.2", + "jest-mock": "^26.6.2", + "jest-util": "^26.6.2", "jsdom": "^16.4.0" } }, "jest-environment-node": { - "version": "26.5.2", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-26.5.2.tgz", - "integrity": "sha512-YHjnDsf/GKFCYMGF1V+6HF7jhY1fcLfLNBDjhAOvFGvt6d8vXvNdJGVM7uTZ2VO/TuIyEFhPGaXMX5j3h7fsrA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-26.6.2.tgz", + "integrity": "sha512-zhtMio3Exty18dy8ee8eJ9kjnRyZC1N4C1Nt/VShN1apyXc8rWGtJ9lI7vqiWcyyXS4BVSEn9lxAM2D+07/Tag==", "dev": true, "requires": { - "@jest/environment": "^26.5.2", - "@jest/fake-timers": "^26.5.2", - "@jest/types": "^26.5.2", + "@jest/environment": "^26.6.2", + "@jest/fake-timers": "^26.6.2", + "@jest/types": "^26.6.2", "@types/node": "*", - "jest-mock": "^26.5.2", - "jest-util": "^26.5.2" + "jest-mock": "^26.6.2", + "jest-util": "^26.6.2" } }, "jest-get-type": { @@ -5308,12 +4986,12 @@ "dev": true }, "jest-haste-map": { - "version": "26.5.2", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-26.5.2.tgz", - "integrity": "sha512-lJIAVJN3gtO3k4xy+7i2Xjtwh8CfPcH08WYjZpe9xzveDaqGw9fVNCpkYu6M525wKFVkLmyi7ku+DxCAP1lyMA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-26.6.2.tgz", + "integrity": "sha512-easWIJXIw71B2RdR8kgqpjQrbMRWQBgiBwXYEhtGUTaX+doCjBheluShdDMeR8IMfJiTqH4+zfhtg29apJf/8w==", "dev": true, "requires": { - "@jest/types": "^26.5.2", + "@jest/types": "^26.6.2", "@types/graceful-fs": "^4.1.2", "@types/node": "*", "anymatch": "^3.0.3", @@ -5321,85 +4999,86 @@ "fsevents": "^2.1.2", "graceful-fs": "^4.2.4", "jest-regex-util": "^26.0.0", - "jest-serializer": "^26.5.0", - "jest-util": "^26.5.2", - "jest-worker": "^26.5.0", + "jest-serializer": "^26.6.2", + "jest-util": "^26.6.2", + "jest-worker": "^26.6.2", "micromatch": "^4.0.2", "sane": "^4.0.3", "walker": "^1.0.7" } }, "jest-jasmine2": { - "version": "26.5.3", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.5.3.tgz", - "integrity": "sha512-nFlZOpnGlNc7y/+UkkeHnvbOM+rLz4wB1AimgI9QhtnqSZte0wYjbAm8hf7TCwXlXgDwZxAXo6z0a2Wzn9FoOg==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.6.3.tgz", + "integrity": "sha512-kPKUrQtc8aYwBV7CqBg5pu+tmYXlvFlSFYn18ev4gPFtrRzB15N2gW/Roew3187q2w2eHuu0MU9TJz6w0/nPEg==", "dev": true, "requires": { "@babel/traverse": "^7.1.0", - "@jest/environment": "^26.5.2", - "@jest/source-map": "^26.5.0", - "@jest/test-result": "^26.5.2", - "@jest/types": "^26.5.2", + "@jest/environment": "^26.6.2", + "@jest/source-map": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/types": "^26.6.2", "@types/node": "*", "chalk": "^4.0.0", "co": "^4.6.0", - "expect": "^26.5.3", + "expect": "^26.6.2", "is-generator-fn": "^2.0.0", - "jest-each": "^26.5.2", - "jest-matcher-utils": "^26.5.2", - "jest-message-util": "^26.5.2", - "jest-runtime": "^26.5.3", - "jest-snapshot": "^26.5.3", - "jest-util": "^26.5.2", - "pretty-format": "^26.5.2", + "jest-each": "^26.6.2", + "jest-matcher-utils": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-runtime": "^26.6.3", + "jest-snapshot": "^26.6.2", + "jest-util": "^26.6.2", + "pretty-format": "^26.6.2", "throat": "^5.0.0" } }, "jest-leak-detector": { - "version": "26.5.2", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.5.2.tgz", - "integrity": "sha512-h7ia3dLzBFItmYERaLPEtEKxy3YlcbcRSjj0XRNJgBEyODuu+3DM2o62kvIFvs3PsaYoIIv+e+nLRI61Dj1CNw==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz", + "integrity": "sha512-i4xlXpsVSMeKvg2cEKdfhh0H39qlJlP5Ex1yQxwF9ubahboQYMgTtz5oML35AVA3B4Eu+YsmwaiKVev9KCvLxg==", "dev": true, "requires": { "jest-get-type": "^26.3.0", - "pretty-format": "^26.5.2" + "pretty-format": "^26.6.2" } }, "jest-matcher-utils": { - "version": "26.5.2", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.5.2.tgz", - "integrity": "sha512-W9GO9KBIC4gIArsNqDUKsLnhivaqf8MSs6ujO/JDcPIQrmY+aasewweXVET8KdrJ6ADQaUne5UzysvF/RR7JYA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz", + "integrity": "sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw==", "dev": true, "requires": { "chalk": "^4.0.0", - "jest-diff": "^26.5.2", + "jest-diff": "^26.6.2", "jest-get-type": "^26.3.0", - "pretty-format": "^26.5.2" + "pretty-format": "^26.6.2" } }, "jest-message-util": { - "version": "26.5.2", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.5.2.tgz", - "integrity": "sha512-Ocp9UYZ5Jl15C5PNsoDiGEk14A4NG0zZKknpWdZGoMzJuGAkVt10e97tnEVMYpk7LnQHZOfuK2j/izLBMcuCZw==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.6.2.tgz", + "integrity": "sha512-rGiLePzQ3AzwUshu2+Rn+UMFk0pHN58sOG+IaJbk5Jxuqo3NYO1U2/MIR4S1sKgsoYSXSzdtSa0TgrmtUwEbmA==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@jest/types": "^26.5.2", + "@jest/types": "^26.6.2", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.4", "micromatch": "^4.0.2", + "pretty-format": "^26.6.2", "slash": "^3.0.0", "stack-utils": "^2.0.2" } }, "jest-mock": { - "version": "26.5.2", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-26.5.2.tgz", - "integrity": "sha512-9SiU4b5PtO51v0MtJwVRqeGEroH66Bnwtq4ARdNP7jNXbpT7+ByeWNAk4NeT/uHfNSVDXEXgQo1XRuwEqS6Rdw==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-26.6.2.tgz", + "integrity": "sha512-YyFjePHHp1LzpzYcmgqkJ0nm0gg/lJx2aZFzFy1S6eUqNjXsOqTK10zNRff2dNfssgokjkG65OlWNcIlgd3zew==", "dev": true, "requires": { - "@jest/types": "^26.5.2", + "@jest/types": "^26.6.2", "@types/node": "*" } }, @@ -5416,89 +5095,102 @@ "dev": true }, "jest-resolve": { - "version": "26.5.2", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-26.5.2.tgz", - "integrity": "sha512-XsPxojXGRA0CoDD7Vis59ucz2p3cQFU5C+19tz3tLEAlhYKkK77IL0cjYjikY9wXnOaBeEdm1rOgSJjbZWpcZg==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-26.6.2.tgz", + "integrity": "sha512-sOxsZOq25mT1wRsfHcbtkInS+Ek7Q8jCHUB0ZUTP0tc/c41QHriU/NunqMfCUWsL4H3MHpvQD4QR9kSYhS7UvQ==", "dev": true, "requires": { - "@jest/types": "^26.5.2", + "@jest/types": "^26.6.2", "chalk": "^4.0.0", "graceful-fs": "^4.2.4", "jest-pnp-resolver": "^1.2.2", - "jest-util": "^26.5.2", + "jest-util": "^26.6.2", "read-pkg-up": "^7.0.1", - "resolve": "^1.17.0", + "resolve": "^1.18.1", "slash": "^3.0.0" + }, + "dependencies": { + "resolve": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.18.1.tgz", + "integrity": "sha512-lDfCPaMKfOJXjy0dPayzPdF1phampNWr3qFCjAu+rw/qbQmr5jWH5xN2hwh9QKfw9E5v4hwV7A+jrCmL8yjjqA==", + "dev": true, + "requires": { + "is-core-module": "^2.0.0", + "path-parse": "^1.0.6" + } + } } }, "jest-resolve-dependencies": { - "version": "26.5.3", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.5.3.tgz", - "integrity": "sha512-+KMDeke/BFK+mIQ2IYSyBz010h7zQaVt4Xie6cLqUGChorx66vVeQVv4ErNoMwInnyYHi1Ud73tDS01UbXbfLQ==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.6.3.tgz", + "integrity": "sha512-pVwUjJkxbhe4RY8QEWzN3vns2kqyuldKpxlxJlzEYfKSvY6/bMvxoFrYYzUO1Gx28yKWN37qyV7rIoIp2h8fTg==", "dev": true, "requires": { - "@jest/types": "^26.5.2", + "@jest/types": "^26.6.2", "jest-regex-util": "^26.0.0", - "jest-snapshot": "^26.5.3" + "jest-snapshot": "^26.6.2" } }, "jest-runner": { - "version": "26.5.3", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-26.5.3.tgz", - "integrity": "sha512-qproP0Pq7IIule+263W57k2+8kWCszVJTC9TJWGUz0xJBr+gNiniGXlG8rotd0XxwonD5UiJloYoSO5vbUr5FQ==", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-26.6.3.tgz", + "integrity": "sha512-atgKpRHnaA2OvByG/HpGA4g6CSPS/1LK0jK3gATJAoptC1ojltpmVlYC3TYgdmGp+GLuhzpH30Gvs36szSL2JQ==", "dev": true, "requires": { - "@jest/console": "^26.5.2", - "@jest/environment": "^26.5.2", - "@jest/test-result": "^26.5.2", - "@jest/types": "^26.5.2", + "@jest/console": "^26.6.2", + "@jest/environment": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/types": "^26.6.2", "@types/node": "*", "chalk": "^4.0.0", "emittery": "^0.7.1", "exit": "^0.1.2", "graceful-fs": "^4.2.4", - "jest-config": "^26.5.3", + "jest-config": "^26.6.3", "jest-docblock": "^26.0.0", - "jest-haste-map": "^26.5.2", - "jest-leak-detector": "^26.5.2", - "jest-message-util": "^26.5.2", - "jest-resolve": "^26.5.2", - "jest-runtime": "^26.5.3", - "jest-util": "^26.5.2", - "jest-worker": "^26.5.0", + "jest-haste-map": "^26.6.2", + "jest-leak-detector": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-resolve": "^26.6.2", + "jest-runtime": "^26.6.3", + "jest-util": "^26.6.2", + "jest-worker": "^26.6.2", "source-map-support": "^0.5.6", "throat": "^5.0.0" } }, "jest-runtime": { - "version": "26.5.3", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.5.3.tgz", - "integrity": "sha512-IDjalmn2s/Tc4GvUwhPHZ0iaXCdMRq5p6taW9P8RpU+FpG01O3+H8z+p3rDCQ9mbyyyviDgxy/LHPLzrIOKBkQ==", - "dev": true, - "requires": { - "@jest/console": "^26.5.2", - "@jest/environment": "^26.5.2", - "@jest/fake-timers": "^26.5.2", - "@jest/globals": "^26.5.3", - "@jest/source-map": "^26.5.0", - "@jest/test-result": "^26.5.2", - "@jest/transform": "^26.5.2", - "@jest/types": "^26.5.2", + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.6.3.tgz", + "integrity": "sha512-lrzyR3N8sacTAMeonbqpnSka1dHNux2uk0qqDXVkMv2c/A3wYnvQ4EXuI013Y6+gSKSCxdaczvf4HF0mVXHRdw==", + "dev": true, + "requires": { + "@jest/console": "^26.6.2", + "@jest/environment": "^26.6.2", + "@jest/fake-timers": "^26.6.2", + "@jest/globals": "^26.6.2", + "@jest/source-map": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/transform": "^26.6.2", + "@jest/types": "^26.6.2", "@types/yargs": "^15.0.0", "chalk": "^4.0.0", + "cjs-module-lexer": "^0.6.0", "collect-v8-coverage": "^1.0.0", "exit": "^0.1.2", "glob": "^7.1.3", "graceful-fs": "^4.2.4", - "jest-config": "^26.5.3", - "jest-haste-map": "^26.5.2", - "jest-message-util": "^26.5.2", - "jest-mock": "^26.5.2", + "jest-config": "^26.6.3", + "jest-haste-map": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-mock": "^26.6.2", "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.5.2", - "jest-snapshot": "^26.5.3", - "jest-util": "^26.5.2", - "jest-validate": "^26.5.3", + "jest-resolve": "^26.6.2", + "jest-snapshot": "^26.6.2", + "jest-util": "^26.6.2", + "jest-validate": "^26.6.2", "slash": "^3.0.0", "strip-bom": "^4.0.0", "yargs": "^15.4.1" @@ -5513,9 +5205,9 @@ } }, "jest-serializer": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-26.5.0.tgz", - "integrity": "sha512-+h3Gf5CDRlSLdgTv7y0vPIAoLgX/SI7T4v6hy+TEXMgYbv+ztzbg5PSN6mUXAT/hXYHvZRWm+MaObVfqkhCGxA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-26.6.2.tgz", + "integrity": "sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g==", "dev": true, "requires": { "@types/node": "*", @@ -5523,36 +5215,36 @@ } }, "jest-snapshot": { - "version": "26.5.3", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.5.3.tgz", - "integrity": "sha512-ZgAk0Wm0JJ75WS4lGaeRfa0zIgpL0KD595+XmtwlIEMe8j4FaYHyZhP1LNOO+8fXq7HJ3hll54+sFV9X4+CGVw==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.6.2.tgz", + "integrity": "sha512-OLhxz05EzUtsAmOMzuupt1lHYXCNib0ECyuZ/PZOx9TrZcC8vL0x+DUG3TL+GLX3yHG45e6YGjIm0XwDc3q3og==", "dev": true, "requires": { "@babel/types": "^7.0.0", - "@jest/types": "^26.5.2", + "@jest/types": "^26.6.2", "@types/babel__traverse": "^7.0.4", "@types/prettier": "^2.0.0", "chalk": "^4.0.0", - "expect": "^26.5.3", + "expect": "^26.6.2", "graceful-fs": "^4.2.4", - "jest-diff": "^26.5.2", + "jest-diff": "^26.6.2", "jest-get-type": "^26.3.0", - "jest-haste-map": "^26.5.2", - "jest-matcher-utils": "^26.5.2", - "jest-message-util": "^26.5.2", - "jest-resolve": "^26.5.2", + "jest-haste-map": "^26.6.2", + "jest-matcher-utils": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-resolve": "^26.6.2", "natural-compare": "^1.4.0", - "pretty-format": "^26.5.2", + "pretty-format": "^26.6.2", "semver": "^7.3.2" } }, "jest-util": { - "version": "26.5.2", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.5.2.tgz", - "integrity": "sha512-WTL675bK+GSSAYgS8z9FWdCT2nccO1yTIplNLPlP0OD8tUk/H5IrWKMMRudIQQ0qp8bb4k+1Qa8CxGKq9qnYdg==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.6.2.tgz", + "integrity": "sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q==", "dev": true, "requires": { - "@jest/types": "^26.5.2", + "@jest/types": "^26.6.2", "@types/node": "*", "chalk": "^4.0.0", "graceful-fs": "^4.2.4", @@ -5561,46 +5253,46 @@ } }, "jest-validate": { - "version": "26.5.3", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.5.3.tgz", - "integrity": "sha512-LX07qKeAtY+lsU0o3IvfDdN5KH9OulEGOMN1sFo6PnEf5/qjS1LZIwNk9blcBeW94pQUI9dLN9FlDYDWI5tyaA==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.6.2.tgz", + "integrity": "sha512-NEYZ9Aeyj0i5rQqbq+tpIOom0YS1u2MVu6+euBsvpgIme+FOfRmoC4R5p0JiAUpaFvFy24xgrpMknarR/93XjQ==", "dev": true, "requires": { - "@jest/types": "^26.5.2", + "@jest/types": "^26.6.2", "camelcase": "^6.0.0", "chalk": "^4.0.0", "jest-get-type": "^26.3.0", "leven": "^3.1.0", - "pretty-format": "^26.5.2" + "pretty-format": "^26.6.2" }, "dependencies": { "camelcase": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.1.0.tgz", - "integrity": "sha512-WCMml9ivU60+8rEJgELlFp1gxFcEGxwYleE3bziHEDeqsqAWGHdimB7beBFGjLzVNgPGyDsfgXLQEYMpmIFnVQ==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", "dev": true } } }, "jest-watcher": { - "version": "26.5.2", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-26.5.2.tgz", - "integrity": "sha512-i3m1NtWzF+FXfJ3ljLBB/WQEp4uaNhX7QcQUWMokcifFTUQBDFyUMEwk0JkJ1kopHbx7Een3KX0Q7+9koGM/Pw==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-26.6.2.tgz", + "integrity": "sha512-WKJob0P/Em2csiVthsI68p6aGKTIcsfjH9Gsx1f0A3Italz43e3ho0geSAVsmj09RWOELP1AZ/DXyJgOgDKxXQ==", "dev": true, "requires": { - "@jest/test-result": "^26.5.2", - "@jest/types": "^26.5.2", + "@jest/test-result": "^26.6.2", + "@jest/types": "^26.6.2", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", - "jest-util": "^26.5.2", + "jest-util": "^26.6.2", "string-length": "^4.0.1" } }, "jest-worker": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.5.0.tgz", - "integrity": "sha512-kTw66Dn4ZX7WpjZ7T/SUDgRhapFRKWmisVAF0Rv4Fu8SLFD7eLbqpLvbxVqYhSgaWa7I+bW7pHnbyfNsH6stug==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", + "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", "dev": true, "requires": { "@types/node": "*", @@ -5665,9 +5357,9 @@ }, "dependencies": { "ws": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz", - "integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.0.tgz", + "integrity": "sha512-kyFwXuV/5ymf+IXhS6f0+eAFvydbaBW3zjpT6hUdAh/hbVjTIB5EHBGi0bPoCLSK2wcuz3BrEkB9LrYv1Nm4NQ==", "dev": true } } @@ -5764,13 +5456,13 @@ "dev": true }, "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" } }, "lines-and-columns": { @@ -5780,20 +5472,20 @@ "dev": true }, "lint-staged": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.4.0.tgz", - "integrity": "sha512-uaiX4U5yERUSiIEQc329vhCTDDwUcSvKdRLsNomkYLRzijk3v8V9GWm2Nz0RMVB87VcuzLvtgy6OsjoH++QHIg==", + "version": "10.5.1", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.5.1.tgz", + "integrity": "sha512-fTkTGFtwFIJJzn/PbUO3RXyEBHIhbfYBE7+rJyLcOXabViaO/h6OslgeK6zpeUtzkDrzkgyAYDTLAwx6JzDTHw==", "dev": true, "requires": { "chalk": "^4.1.0", "cli-truncate": "^2.1.0", - "commander": "^6.0.0", + "commander": "^6.2.0", "cosmiconfig": "^7.0.0", - "debug": "^4.1.1", + "debug": "^4.2.0", "dedent": "^0.7.0", "enquirer": "^2.3.6", - "execa": "^4.0.3", - "listr2": "^2.6.0", + "execa": "^4.1.0", + "listr2": "^3.2.2", "log-symbols": "^4.0.0", "micromatch": "^4.0.2", "normalize-path": "^3.0.0", @@ -5803,9 +5495,9 @@ }, "dependencies": { "commander": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.1.0.tgz", - "integrity": "sha512-wl7PNrYWd2y5mp1OK/LhTlv8Ff4kQJQRXXAvF+uU/TPNiVJUxZLRYGj/B0y/lPGAVcSbJqH2Za/cvHmrPMC8mA==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.0.tgz", + "integrity": "sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q==", "dev": true }, "cross-spawn": { @@ -5829,9 +5521,9 @@ } }, "execa": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.0.3.tgz", - "integrity": "sha512-WFDXGHckXPWZX19t1kCsXzOpqX9LWYNqn4C+HqZlk/V0imTkzJZqf87ZBhvpHaftERYknpk0fjSylnXVlVgI0A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", "dev": true, "requires": { "cross-spawn": "^7.0.0", @@ -5908,9 +5600,9 @@ } }, "listr2": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-2.6.2.tgz", - "integrity": "sha512-6x6pKEMs8DSIpA/tixiYY2m/GcbgMplMVmhQAaLFxEtNSKLeWTGjtmU57xvv6QCm2XcqzyNXL/cTSVf4IChCRA==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.2.2.tgz", + "integrity": "sha512-AajqcZEUikF2ioph6PfH3dIuxJclhr3i3kHgTOP0xeXdWQohrvJAAmqVcV43/GI987HFY/vzT73jYXoa4esDHg==", "dev": true, "requires": { "chalk": "^4.1.0", @@ -5919,7 +5611,7 @@ "indent-string": "^4.0.0", "log-update": "^4.0.0", "p-map": "^4.0.0", - "rxjs": "^6.6.2", + "rxjs": "^6.6.3", "through": "^2.3.8" } }, @@ -5953,9 +5645,9 @@ } }, "loader-runner": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", - "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.1.0.tgz", + "integrity": "sha512-oR4lB4WvwFoC70ocraKhn5nkKSs23t57h9udUgw8o0iH8hMXeEoRuUgfcvgUwAJ1ZpRqBvcou4N2SMvM1DwMrA==", "dev": true }, "loader-utils": { @@ -6023,6 +5715,12 @@ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, "slice-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", @@ -6036,39 +5734,12 @@ } } }, - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, "lunr": { "version": "2.3.9", "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", "dev": true }, - "make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", - "dev": true, - "requires": { - "pify": "^4.0.1", - "semver": "^5.6.0" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, "make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -6121,16 +5792,6 @@ "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", "dev": true }, - "memory-fs": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", - "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", - "dev": true, - "requires": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" - } - }, "merge-descriptors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", @@ -6200,16 +5861,6 @@ } } }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - } - }, "mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", @@ -6251,7 +5902,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -6262,24 +5912,6 @@ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, - "mississippi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", - "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", - "dev": true, - "requires": { - "concat-stream": "^1.5.0", - "duplexify": "^3.4.2", - "end-of-stream": "^1.1.0", - "flush-write-stream": "^1.0.0", - "from2": "^2.1.0", - "parallel-transform": "^1.1.0", - "pump": "^3.0.0", - "pumpify": "^1.3.3", - "stream-each": "^1.1.0", - "through2": "^2.0.0" - } - }, "mixin-deep": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", @@ -6310,20 +5942,6 @@ "minimist": "^1.2.5" } }, - "move-concurrently": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", - "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", - "dev": true, - "requires": { - "aproba": "^1.1.1", - "copy-concurrently": "^1.0.0", - "fs-write-stream-atomic": "^1.0.8", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.3" - } - }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -6394,45 +6012,6 @@ "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", "dev": true }, - "node-libs-browser": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", - "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", - "dev": true, - "requires": { - "assert": "^1.1.1", - "browserify-zlib": "^0.2.0", - "buffer": "^4.3.0", - "console-browserify": "^1.1.0", - "constants-browserify": "^1.0.0", - "crypto-browserify": "^3.11.0", - "domain-browser": "^1.1.1", - "events": "^3.0.0", - "https-browserify": "^1.0.0", - "os-browserify": "^0.3.0", - "path-browserify": "0.0.1", - "process": "^0.11.10", - "punycode": "^1.2.4", - "querystring-es3": "^0.2.0", - "readable-stream": "^2.3.3", - "stream-browserify": "^2.0.1", - "stream-http": "^2.7.2", - "string_decoder": "^1.0.0", - "timers-browserify": "^2.0.4", - "tty-browserify": "0.0.0", - "url": "^0.11.0", - "util": "^0.11.0", - "vm-browserify": "^1.0.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - } - } - }, "node-modules-regexp": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", @@ -6476,6 +6055,12 @@ } } }, + "node-releases": { + "version": "1.1.66", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.66.tgz", + "integrity": "sha512-JHEQ1iWPGK+38VLB2H9ef2otU4l8s3yAMt9Xf934r6+ojCYDMHPMqvCc9TnzfeFSP1QEOeU6YZEd3+De0LTCgg==", + "dev": true + }, "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -6523,12 +6108,6 @@ "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", "dev": true }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, "object-copy": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", @@ -6717,7 +6296,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "requires": { "wrappy": "1" } @@ -6744,25 +6322,19 @@ "dev": true }, "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", "dev": true, "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" } }, - "os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", - "dev": true - }, "p-each-series": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.1.0.tgz", @@ -6808,23 +6380,6 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, - "pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true - }, - "parallel-transform": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", - "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", - "dev": true, - "requires": { - "cyclist": "^1.0.1", - "inherits": "^2.0.3", - "readable-stream": "^2.1.5" - } - }, "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -6834,19 +6389,6 @@ "callsites": "^3.0.0" } }, - "parse-asn1": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", - "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", - "dev": true, - "requires": { - "asn1.js": "^5.2.0", - "browserify-aes": "^1.0.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" - } - }, "parse-json": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", @@ -6859,12 +6401,6 @@ "lines-and-columns": "^1.1.6" } }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true - }, "parse5": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", @@ -6883,19 +6419,6 @@ "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", "dev": true }, - "path-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", - "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", - "dev": true - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true, - "optional": true - }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -6905,8 +6428,7 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-key": { "version": "2.0.1", @@ -6972,48 +6494,12 @@ } }, "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "requires": { - "find-up": "^3.0.0" - }, - "dependencies": { - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - } + "find-up": "^4.0.0" } }, "please-upgrade-node": { @@ -7040,9 +6526,9 @@ } }, "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, "prettier": { @@ -7052,23 +6538,17 @@ "dev": true }, "pretty-format": { - "version": "26.5.2", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.5.2.tgz", - "integrity": "sha512-VizyV669eqESlkOikKJI8Ryxl/kPpbdLwNdPs2GrbQs18MpySB5S0Yo0N7zkg2xTRiFq4CFw8ct5Vg4a0xP0og==", + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz", + "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==", "dev": true, "requires": { - "@jest/types": "^26.5.2", + "@jest/types": "^26.6.2", "ansi-regex": "^5.0.0", "ansi-styles": "^4.0.0", - "react-is": "^16.12.0" + "react-is": "^17.0.1" } }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "dev": true - }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -7080,20 +6560,14 @@ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, - "promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", - "dev": true - }, "prompts": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.3.2.tgz", - "integrity": "sha512-Q06uKs2CkNYVID0VqwfAl9mipo99zkBv/n2JtWY89Yxa3ZabWSrs0e2KTudKVa3peLUvYXMefDqIleLPVUBZMA==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.0.tgz", + "integrity": "sha512-awZAKrk3vN6CroQukBL+R9051a4R3zCZBlJm/HBfrSZ8iTpYix3VX1vU4mveiLpiwmOJT4wokTF9m6HUk4KqWQ==", "dev": true, "requires": { "kleur": "^3.0.3", - "sisteransi": "^1.0.4" + "sisteransi": "^1.0.5" } }, "proxy-addr": { @@ -7118,20 +6592,6 @@ "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", "dev": true }, - "public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -7142,29 +6602,6 @@ "once": "^1.3.1" } }, - "pumpify": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", - "dev": true, - "requires": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" - }, - "dependencies": { - "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - } - } - }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -7177,18 +6614,6 @@ "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", "dev": true }, - "querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "dev": true - }, - "querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", - "dev": true - }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -7197,16 +6622,6 @@ "safe-buffer": "^5.1.0" } }, - "randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, - "requires": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, "range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", @@ -7226,9 +6641,9 @@ } }, "react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "version": "17.0.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.1.tgz", + "integrity": "sha512-NAnt2iGDXohE5LI7uBnLnqvLQMtzhkiAOLXTmv+qnF9Ky7xAPcX8Up/xWIhxvLVGJvuLiNc4xQLtuqDRzb4fSA==", "dev": true }, "read-pkg": { @@ -7291,16 +6706,6 @@ } } }, - "readdirp": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz", - "integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==", - "dev": true, - "optional": true, - "requires": { - "picomatch": "^2.2.1" - } - }, "rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", @@ -7310,6 +6715,12 @@ "resolve": "^1.1.6" } }, + "reduce-flatten": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", + "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", + "dev": true + }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -7458,29 +6869,6 @@ "resolve-from": "^5.0.0" } }, - "resolve-dir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.0", - "global-modules": "^1.0.0" - }, - "dependencies": { - "global-modules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", - "dev": true, - "requires": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^1.0.0" - } - } - } - }, "resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -7515,15 +6903,6 @@ "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, "ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", @@ -7540,20 +6919,11 @@ "dev": true }, "run-parallel": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", - "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz", + "integrity": "sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw==", "dev": true }, - "run-queue": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", - "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", - "dev": true, - "requires": { - "aproba": "^1.1.1" - } - }, "rxjs": { "version": "6.6.3", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz", @@ -7652,14 +7022,14 @@ } }, "schema-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", - "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz", + "integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==", "dev": true, "requires": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" + "@types/json-schema": "^7.0.6", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" } }, "secp256k1": { @@ -7720,9 +7090,9 @@ } }, "serialize-javascript": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", - "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", + "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", "dev": true, "requires": { "randombytes": "^2.1.0" @@ -7769,12 +7139,6 @@ } } }, - "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", - "dev": true - }, "setprototypeof": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", @@ -7875,12 +7239,6 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true } } }, @@ -8130,15 +7488,6 @@ "tweetnacl": "~0.14.0" } }, - "ssri": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", - "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", - "dev": true, - "requires": { - "figgy-pudding": "^3.5.1" - } - }, "stack-utils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.2.tgz", @@ -8246,45 +7595,6 @@ "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", "dev": true }, - "stream-browserify": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", - "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", - "dev": true, - "requires": { - "inherits": "~2.0.1", - "readable-stream": "^2.0.2" - } - }, - "stream-each": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", - "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "stream-shift": "^1.0.0" - } - }, - "stream-http": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", - "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", - "dev": true, - "requires": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "to-arraybuffer": "^1.0.0", - "xtend": "^4.0.0" - } - }, - "stream-shift": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", - "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", - "dev": true - }, "string-argv": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", @@ -8302,14 +7612,31 @@ } }, "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } } }, "string.prototype.trimend": { @@ -8419,50 +7746,22 @@ "lodash": "^4.17.14", "slice-ansi": "^2.1.0", "string-width": "^3.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } } }, - "tapable": { - "version": "1.1.3", + "table-layout": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.1.tgz", + "integrity": "sha512-dEquqYNJiGwY7iPfZ3wbXDI944iqanTSchrACLL2nOB+1r+h1Nzu2eH+DuPPvWvm5Ry7iAPeFlgEtP5bIp5U7Q==", + "dev": true, + "requires": { + "array-back": "^4.0.1", + "deep-extend": "~0.6.0", + "typical": "^5.2.0", + "wordwrapjs": "^4.0.0" + } + }, + "tapable": { + "version": "1.1.3", "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", "dev": true @@ -8478,31 +7777,47 @@ } }, "terser": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", - "integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", + "version": "5.3.8", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.3.8.tgz", + "integrity": "sha512-zVotuHoIfnYjtlurOouTazciEfL7V38QMAOhGqpXDEg6yT13cF4+fEP9b0rrCEQTn+tT46uxgFsTZzhygk+CzQ==", "dev": true, "requires": { "commander": "^2.20.0", - "source-map": "~0.6.1", - "source-map-support": "~0.5.12" + "source-map": "~0.7.2", + "source-map-support": "~0.5.19" + }, + "dependencies": { + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true + } } }, "terser-webpack-plugin": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.5.tgz", - "integrity": "sha512-04Rfe496lN8EYruwi6oPQkG0vo8C+HT49X687FZnpPF0qMAIHONI6HEXYPKDOE8e5HjXTyKfqRd/agHtH0kOtw==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.0.3.tgz", + "integrity": "sha512-zFdGk8Lh9ZJGPxxPE6jwysOlATWB8GMW8HcfGULWA/nPal+3VdATflQvSBSLQJRCmYZnfFJl6vkRTiwJGNgPiQ==", "dev": true, "requires": { - "cacache": "^12.0.2", - "find-cache-dir": "^2.1.0", - "is-wsl": "^1.1.0", - "schema-utils": "^1.0.0", - "serialize-javascript": "^4.0.0", + "jest-worker": "^26.6.1", + "p-limit": "^3.0.2", + "schema-utils": "^3.0.0", + "serialize-javascript": "^5.0.1", "source-map": "^0.6.1", - "terser": "^4.1.2", - "webpack-sources": "^1.4.0", - "worker-farm": "^1.7.0" + "terser": "^5.3.8" + }, + "dependencies": { + "p-limit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.0.2.tgz", + "integrity": "sha512-iwqZSOoWIW+Ew4kAGUlN16J4M7OB3ysMLSZtnhmqx7njIHFPlxWBX8xo3lVTyFVq6mI/lL9qt2IsN1sHwaxJkg==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + } } }, "test-exclude": { @@ -8534,25 +7849,6 @@ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "timers-browserify": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.11.tgz", - "integrity": "sha512-60aV6sgJ5YEbzUdn9c8kYGIqOubPoUdqQCul3SBAsRCZ40s6Y5cMcrW4dt3/k/EsbLVJNl9n6Vz3fTc+k2GeKQ==", - "dev": true, - "requires": { - "setimmediate": "^1.0.4" - } - }, "tiny-secp256k1": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/tiny-secp256k1/-/tiny-secp256k1-1.1.5.tgz", @@ -8565,18 +7861,30 @@ "nan": "^2.13.2" } }, + "tmp": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", + "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "requires": { + "rimraf": "^3.0.0" + }, + "dependencies": { + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "requires": { + "glob": "^7.1.3" + } + } + } + }, "tmpl": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=", "dev": true }, - "to-arraybuffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", - "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", - "dev": true - }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -8651,16 +7959,10 @@ "punycode": "^2.1.1" } }, - "tryer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tryer/-/tryer-1.0.1.tgz", - "integrity": "sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==", - "dev": true - }, "ts-jest": { - "version": "26.4.1", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-26.4.1.tgz", - "integrity": "sha512-F4aFq01aS6mnAAa0DljNmKr/Kk9y4HVZ1m6/rtJ0ED56cuxINGq3Q9eVAh+z5vcYKe5qnTMvv90vE8vUMFxomg==", + "version": "26.4.4", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-26.4.4.tgz", + "integrity": "sha512-3lFWKbLxJm34QxyVNNCgXX1u4o/RV0myvA2y2Bxm46iGIjKlaY0own9gIckbjZJPn+WaJEnfPPJ20HHGpoq4yg==", "dev": true, "requires": { "@types/jest": "26.x", @@ -8690,13 +7992,19 @@ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", "dev": true + }, + "yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true } } }, "ts-loader": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-8.0.4.tgz", - "integrity": "sha512-5u8KF1SW8eCUb/Ff7At81e3wznPmT/27fvaGRO9CziVy+6NlPVRvrzSox4OwU0/e6OflOUB32Err4VquysCSAQ==", + "version": "8.0.11", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-8.0.11.tgz", + "integrity": "sha512-06X+mWA2JXoXJHYAesUUL4mHFYhnmyoCdQVMXofXF552Lzd4wNwSGg7unJpttqUP7ziaruM8d7u8LUB6I1sgzA==", "dev": true, "requires": { "chalk": "^2.3.0", @@ -8741,6 +8049,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -8754,14 +8068,6 @@ "dev": true, "requires": { "has-flag": "^3.0.0" - }, - "dependencies": { - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - } } } } @@ -8871,12 +8177,6 @@ "tslib": "^1.8.1" } }, - "tty-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", - "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", - "dev": true - }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -8893,12 +8193,12 @@ "dev": true }, "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "requires": { - "prelude-ls": "~1.1.2" + "prelude-ls": "^1.2.1" } }, "type-detect": { @@ -8923,12 +8223,6 @@ "mime-types": "~2.1.24" } }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true - }, "typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -8969,9 +8263,15 @@ "integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g==" }, "typescript": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.3.tgz", - "integrity": "sha512-tEu6DGxGgRJPb/mVPIZ48e69xCn2yRmCgYmDugAVwmJ6o+0u1RI18eO7E7WBTLYLaEVVOhwQmcdhQHweux/WPg==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.5.tgz", + "integrity": "sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ==", + "dev": true + }, + "typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", "dev": true }, "uglify-js": { @@ -8993,24 +8293,6 @@ "set-value": "^2.0.1" } }, - "unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "dev": true, - "requires": { - "unique-slug": "^2.0.0" - } - }, - "unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4" - } - }, "universalify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", @@ -9063,13 +8345,6 @@ } } }, - "upath": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", - "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", - "dev": true, - "optional": true - }, "uri-js": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", @@ -9085,45 +8360,18 @@ "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", "dev": true }, - "url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "dev": true, - "requires": { - "punycode": "1.3.2", - "querystring": "0.2.0" - }, - "dependencies": { - "punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - } - } - }, "use": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", "dev": true }, - "util": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", - "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", - "dev": true, + "utf-8-validate": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.3.tgz", + "integrity": "sha512-jtJM6fpGv8C1SoH4PtG22pGto6x+Y8uPprW0tw3//gGFhDDTiuksgradgFN6yRayDP4SyZZa6ZMGHLIa17+M8A==", "requires": { - "inherits": "2.0.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - } + "node-gyp-build": "^4.2.0" } }, "util-deprecate": { @@ -9151,9 +8399,9 @@ "dev": true }, "v8-to-istanbul": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-6.0.1.tgz", - "integrity": "sha512-PzM1WlqquhBvsV+Gco6WSFeg1AGdD53ccMRkFeyHRE/KRZaVacPOmQYP3EeVgDBtKD2BJ8kgynBQ5OtKiHCH+w==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-7.0.0.tgz", + "integrity": "sha512-fLL2rFuQpMtm9r8hrAV2apXX/WqHJ6+IC4/eQVdMDGBUgH/YMV4Gv3duk3kjmyg6uiQWBAA9nJwue4iJUOkHeA==", "dev": true, "requires": { "@types/istanbul-lib-coverage": "^2.0.1", @@ -9196,12 +8444,6 @@ "extsprintf": "^1.2.0" } }, - "vm-browserify": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", - "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", - "dev": true - }, "w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", @@ -9230,156 +8472,13 @@ } }, "watchpack": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.4.tgz", - "integrity": "sha512-aWAgTW4MoSJzZPAicljkO1hsi1oKj/RRq/OJQh2PKI2UKL04c2Bs+MBOB+BBABHTXJpf9mCwHN7ANCvYsvY2sg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.0.1.tgz", + "integrity": "sha512-vO8AKGX22ZRo6PiOFM9dC0re8IcKh8Kd/aH2zeqUc6w4/jBGlTy2P7fTC6ekT0NjVeGjgU2dGC5rNstKkeLEQg==", "dev": true, "requires": { - "chokidar": "^3.4.1", - "graceful-fs": "^4.1.2", - "neo-async": "^2.5.0", - "watchpack-chokidar2": "^2.0.0" - } - }, - "watchpack-chokidar2": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/watchpack-chokidar2/-/watchpack-chokidar2-2.0.0.tgz", - "integrity": "sha512-9TyfOyN/zLUbA288wZ8IsMZ+6cbzvsNyEzSBp6e/zkifi6xxbl8SmQ/CxQq32k8NNqrdVEVUVSEf56L4rQ/ZxA==", - "dev": true, - "optional": true, - "requires": { - "chokidar": "^2.1.8" - }, - "dependencies": { - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "optional": true, - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - }, - "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "optional": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } - } - }, - "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", - "dev": true, - "optional": true - }, - "chokidar": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", - "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", - "dev": true, - "optional": true, - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "fsevents": "^1.2.7", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - } - }, - "fsevents": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", - "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "dev": true, - "optional": true, - "requires": { - "bindings": "^1.5.0", - "nan": "^2.12.1" - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "optional": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "optional": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "optional": true, - "requires": { - "binary-extensions": "^1.0.0" - } - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "optional": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "dev": true, - "optional": true, - "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - } - } + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" } }, "webidl-conversions": { @@ -9389,395 +8488,256 @@ "dev": true }, "webpack": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.44.2.tgz", - "integrity": "sha512-6KJVGlCxYdISyurpQ0IPTklv+DULv05rs2hseIXer6D7KrUicRDLFb4IUM1S6LUAKypPM/nSiVSuv8jHu1m3/Q==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.4.0.tgz", + "integrity": "sha512-udpYTyqz8toTTdaOsL2QKPLeZLt2IEm9qY7yTXuFEQhKu5bk0yQD9BtAdVQksmz4jFbbWOiWmm3NHarO0zr/ng==", "dev": true, "requires": { + "@types/eslint-scope": "^3.7.0", + "@types/estree": "^0.0.45", "@webassemblyjs/ast": "1.9.0", "@webassemblyjs/helper-module-context": "1.9.0", "@webassemblyjs/wasm-edit": "1.9.0", "@webassemblyjs/wasm-parser": "1.9.0", - "acorn": "^6.4.1", - "ajv": "^6.10.2", - "ajv-keywords": "^3.4.1", + "acorn": "^8.0.4", + "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^4.3.0", - "eslint-scope": "^4.0.3", + "enhanced-resolve": "^5.3.1", + "eslint-scope": "^5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.4", "json-parse-better-errors": "^1.0.2", - "loader-runner": "^2.4.0", - "loader-utils": "^1.2.3", - "memory-fs": "^0.4.1", - "micromatch": "^3.1.10", - "mkdirp": "^0.5.3", - "neo-async": "^2.6.1", - "node-libs-browser": "^2.2.1", - "schema-utils": "^1.0.0", - "tapable": "^1.1.3", - "terser-webpack-plugin": "^1.4.3", - "watchpack": "^1.7.4", - "webpack-sources": "^1.4.1" + "loader-runner": "^4.1.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "pkg-dir": "^4.2.0", + "schema-utils": "^3.0.0", + "tapable": "^2.0.0", + "terser-webpack-plugin": "^5.0.3", + "watchpack": "^2.0.0", + "webpack-sources": "^2.1.1" }, "dependencies": { "acorn": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", - "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.0.4.tgz", + "integrity": "sha512-XNP0PqF1XD19ZlLKvB7cMmnZswW4C/03pRHgirB30uSJTaS3A3V1/P4sS3HPvFmjoriPCJQs+JDSbm4bL1TxGQ==", "dev": true }, - "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "enhanced-resolve": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.3.1.tgz", + "integrity": "sha512-G1XD3MRGrGfNcf6Hg0LVZG7GIKcYkbfHa5QMxt1HDUTdYoXH0JR1xXyg+MaKLF73E9A27uWNVxvFivNRYeUB6w==", "dev": true, "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" + "graceful-fs": "^4.2.4", + "tapable": "^2.0.0" } }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } + "tapable": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.1.1.tgz", + "integrity": "sha512-Wib1S8m2wdpLbmQz0RBEVosIyvb/ykfKXf3ZIDqvWoMg/zTNm6G/tDSuUM61J1kNCDXWJrLHGSFeMhAG+gAGpQ==", + "dev": true } } }, "webpack-bundle-analyzer": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-3.9.0.tgz", - "integrity": "sha512-Ob8amZfCm3rMB1ScjQVlbYYUEJyEjdEtQ92jqiFUYt5VkEeO2v5UMbv49P/gnmCZm3A6yaFQzCBvpZqN4MUsdA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.1.0.tgz", + "integrity": "sha512-R3oQaPn7KGJGqnOyuAbdNlH4Nm+w+gvoXQZWqYjgaMnR+vY4Ga8VD5ntfkKa00GarO7LQfOlePvtGvr254Z4Ag==", "dev": true, "requires": { - "acorn": "^7.1.1", - "acorn-walk": "^7.1.1", - "bfj": "^6.1.1", - "chalk": "^2.4.1", - "commander": "^2.18.0", - "ejs": "^2.6.1", - "express": "^4.16.3", - "filesize": "^3.6.1", - "gzip-size": "^5.0.0", - "lodash": "^4.17.19", - "mkdirp": "^0.5.1", - "opener": "^1.5.1", - "ws": "^6.0.0" + "acorn": "^8.0.4", + "acorn-walk": "^8.0.0", + "chalk": "^4.1.0", + "commander": "^6.2.0", + "ejs": "^3.1.5", + "express": "^4.17.1", + "filesize": "^6.1.0", + "gzip-size": "^5.1.1", + "lodash": "^4.17.20", + "mkdirp": "^1.0.4", + "opener": "^1.5.2", + "ws": "^7.3.1" }, "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } + "acorn": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.0.4.tgz", + "integrity": "sha512-XNP0PqF1XD19ZlLKvB7cMmnZswW4C/03pRHgirB30uSJTaS3A3V1/P4sS3HPvFmjoriPCJQs+JDSbm4bL1TxGQ==", + "dev": true }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } + "acorn-walk": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.0.0.tgz", + "integrity": "sha512-oZRad/3SMOI/pxbbmqyurIx7jHw1wZDcR9G44L8pUVFEomX/0dH89SrM1KaDXuv1NpzAXz6Op/Xu/Qd5XXzdEA==", + "dev": true }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "commander": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.0.tgz", + "integrity": "sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q==", "dev": true }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - }, - "dependencies": { - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - } - } + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true } } }, "webpack-cli": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.12.tgz", - "integrity": "sha512-NVWBaz9k839ZH/sinurM+HcDvJOTXwSjYp1ku+5XKeOC03z8v5QitnK/x+lAxGXFyhdayoIf/GOpv85z3/xPag==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.2.0.tgz", + "integrity": "sha512-EIl3k88vaF4fSxWSgtAQR+VwicfLMTZ9amQtqS4o+TDPW9HGaEpbFBbAZ4A3ZOT5SOnMxNOzROsSTPiE8tBJPA==", "dev": true, "requires": { - "chalk": "^2.4.2", - "cross-spawn": "^6.0.5", - "enhanced-resolve": "^4.1.1", - "findup-sync": "^3.0.0", - "global-modules": "^2.0.0", - "import-local": "^2.0.0", - "interpret": "^1.4.0", - "loader-utils": "^1.4.0", - "supports-color": "^6.1.0", - "v8-compile-cache": "^2.1.1", - "yargs": "^13.3.2" + "@webpack-cli/info": "^1.1.0", + "@webpack-cli/serve": "^1.1.0", + "colorette": "^1.2.1", + "command-line-usage": "^6.1.0", + "commander": "^6.2.0", + "enquirer": "^2.3.6", + "execa": "^4.1.0", + "import-local": "^3.0.2", + "interpret": "^2.2.0", + "leven": "^3.1.0", + "rechoir": "^0.7.0", + "v8-compile-cache": "^2.2.0", + "webpack-merge": "^4.2.2" }, "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "commander": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.0.tgz", + "integrity": "sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q==", "dev": true }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "dependencies": { - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" } }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "execa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", "dev": true, "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" } }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", "dev": true, "requires": { - "color-name": "1.1.3" + "pump": "^3.0.0" } }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "interpret": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", + "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", "dev": true }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", "dev": true }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "import-local": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", - "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, "requires": { - "pkg-dir": "^3.0.0", - "resolve-cwd": "^2.0.0" + "path-key": "^3.0.0" } }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "rechoir": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz", + "integrity": "sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q==", "dev": true, "requires": { - "p-limit": "^2.0.0" + "resolve": "^1.9.0" } }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "resolve-cwd": { + "shebang-command": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", - "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "requires": { - "resolve-from": "^3.0.0" + "shebang-regex": "^3.0.0" } }, - "resolve-from": { + "shebang-regex": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - }, - "dependencies": { - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - } - } - }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - } - }, - "yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", - "dev": true, - "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - } + "v8-compile-cache": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", + "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", + "dev": true }, - "yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "isexe": "^2.0.0" } } } }, + "webpack-merge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz", + "integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==", + "dev": true, + "requires": { + "lodash": "^4.17.15" + } + }, "webpack-sources": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", - "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.2.0.tgz", + "integrity": "sha512-bQsA24JLwcnWGArOKUxYKhX3Mz/nK1Xf6hxullKERyktjNMC4x8koOeaDNTA2fEJ09BdWLbM/iTW0ithREUP0w==", "dev": true, "requires": { - "source-list-map": "^2.0.0", - "source-map": "~0.6.1" + "source-list-map": "^2.0.1", + "source-map": "^0.6.1" } }, "whatwg-encoding": { @@ -9847,13 +8807,14 @@ "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, - "worker-farm": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz", - "integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==", + "wordwrapjs": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.0.tgz", + "integrity": "sha512-Svqw723a3R34KvsMgpjFBYCgNOSdcW3mQFK4wIfhGQhtaFVOJmdYoXgi63ne3dTlWgatVcUc7t4HtQ/+bUVIzQ==", "dev": true, "requires": { - "errno": "~0.1.7" + "reduce-flatten": "^2.0.0", + "typical": "^5.0.0" } }, "wrap-ansi": { @@ -9865,13 +8826,37 @@ "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" + }, + "dependencies": { + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + } } }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write": { "version": "1.0.3", @@ -9895,13 +8880,10 @@ } }, "ws": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", - "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", - "dev": true, - "requires": { - "async-limiter": "~1.0.0" - } + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.0.tgz", + "integrity": "sha512-kyFwXuV/5ymf+IXhS6f0+eAFvydbaBW3zjpT6hUdAh/hbVjTIB5EHBGi0bPoCLSK2wcuz3BrEkB9LrYv1Nm4NQ==", + "dev": true }, "xml-name-validator": { "version": "3.0.0", @@ -9915,24 +8897,12 @@ "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true - }, "y18n": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - }, "yaml": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", @@ -9958,23 +8928,40 @@ "yargs-parser": "^18.1.2" }, "dependencies": { - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", "dev": true, "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" } } } }, "yargs-parser": { - "version": "20.2.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.1.tgz", - "integrity": "sha512-yYsjuSkjbLMBp16eaOt7/siKTjNVjMm3SoJnIg3sEh/JsvqVVDyjRKmaJV4cl+lNIgq6QEco2i3gDebJl7/vLA==", - "dev": true + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } }, "yn": { "version": "3.1.1", diff --git a/package.json b/package.json index 9d050afb..2c303f9b 100644 --- a/package.json +++ b/package.json @@ -52,32 +52,32 @@ "arrowParens": "always" }, "devDependencies": { - "@types/jest": "^26.0.14", - "@types/node": "^14.11.2", - "@typescript-eslint/eslint-plugin": "^4.5.0", - "@typescript-eslint/parser": "^4.5.0", - "eslint": "^7.11.0", - "eslint-config-airbnb-base": "^14.2.0", + "@types/jest": "^26.0.15", + "@types/node": "^14.14.7", + "@typescript-eslint/eslint-plugin": "^4.7.0", + "@typescript-eslint/parser": "^4.7.0", + "eslint": "^7.13.0", + "eslint-config-airbnb-base": "^14.2.1", "eslint-config-standard": "^14.1.1", "eslint-plugin-import": "^2.22.1", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", - "eslint-plugin-standard": "^4.0.1", + "eslint-plugin-standard": "^4.1.0", "husky": "^4.3.0", - "jest": "^26.4.2", - "lint-staged": "^10.4.0", + "jest": "^26.6.3", + "lint-staged": "^10.5.1", "prettier": "^2.1.2", - "ts-jest": "^26.4.0", - "ts-loader": "^8.0.4", + "ts-jest": "^26.4.4", + "ts-loader": "^8.0.11", "ts-node": "^9.0.0", "tsconfig-paths-webpack-plugin": "^3.3.0", "typedoc": "^0.19.2", - "typescript": "^4.0.3", - "webpack": "^4.44.2", - "webpack-bundle-analyzer": "^3.9.0", - "webpack-cli": "^3.3.12" + "typescript": "^4.0.5", + "webpack": "^5.4.0", + "webpack-bundle-analyzer": "^4.1.0", + "webpack-cli": "^4.2.0" }, "dependencies": { - "@terra-money/terra.js": "^0.5.8" + "@terra-money/terra.js": "^0.5.13" } }