diff --git a/README.txt b/README.txt index cebfad6..42b0eee 100644 --- a/README.txt +++ b/README.txt @@ -5,7 +5,7 @@ Donate link: https://commerce.bitcanna.io Tags: payments, cryptocurrency, blockchain Requires at least: 3.0.1 Tested up to: 6.1.1 -Stable tag: 1.0.13 +Stable tag: 1.0.14 Requires PHP: 7.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -37,6 +37,10 @@ For our FAQ we'd like to refer you to our [documentation website](https://docs.b 5. After just a couple seconds, the payment will be performed and you can view your transaction. == Changelog == += 1.0.13 = +* Add failover on RPC/LCD +* Fix bech32 admin confirmation + = 1.0.13 = * Add keplr/ledger compatibility * Fix check balance keplr diff --git a/admin/partials/cosmos-settings.php b/admin/partials/cosmos-settings.php index 710f95d..78d0a6b 100644 --- a/admin/partials/cosmos-settings.php +++ b/admin/partials/cosmos-settings.php @@ -63,6 +63,7 @@ + @@ -97,7 +98,7 @@ - + + @@ -152,10 +155,12 @@ $("#goodAddr_"+element.name).show(); $("#badAddr_"+element.name).hide(); $("#badAddrPrefix_"+element.name).hide(); + $('#sendConfig').prop('disabled', false); } else { $("#goodAddr_"+element.name).hide(); $("#badAddr_"+element.name).hide(); $("#badAddrPrefix_"+element.name).show(); + $('#sendConfig').prop('disabled', true); } } catch (error) { @@ -163,6 +168,7 @@ $("#goodAddr_"+element.name).hide(); $("#badAddrPrefix_"+element.name).hide(); $("#badAddr_"+element.name).show(); + $('#sendConfig').prop('disabled', true); } }); }); @@ -183,6 +189,10 @@ const offlineSigner = window.keplr.getOfflineSigner(chainId) const accounts = await offlineSigner.getAccounts() $( '#' + foundChain.name ).val(accounts[0].address) + $("#goodAddr_"+foundChain.name).show(); + $("#badAddr_"+foundChain.name).hide(); + $("#badAddrPrefix_"+foundChain.name).hide(); + $('#sendConfig').prop('disabled', false); }); } }); diff --git a/cosmos-woocommerce.php b/cosmos-woocommerce.php index 81b0e5c..389f5a5 100644 --- a/cosmos-woocommerce.php +++ b/cosmos-woocommerce.php @@ -16,7 +16,7 @@ * Plugin Name: Cosmos Pay * Plugin URI: https://twitter.com/bitcannaglobal * Description: Easily accept cryptocurrency payments on your WordPress site. Enable multiple currencies from the interconnected Cosmos ecosystem. - * Version: 1.0.13 + * Version: 1.0.14 * Author: BitCanna * Author URI: https://commerce.bitcanna.io * License: GPL-2.0+ @@ -35,7 +35,7 @@ * Start at version 1.0.0 and use SemVer - https://semver.org * Rename this for your plugin and update it as you release new versions. */ -define( 'COSMOS_WOOCOMMERCE_VERSION', '1.0.13' ); +define( 'COSMOS_WOOCOMMERCE_VERSION', '1.0.14' ); diff --git a/public/js/bundle.js b/public/js/bundle.js index 9b30a87..16262c0 100644 --- a/public/js/bundle.js +++ b/public/js/bundle.js @@ -8,7 +8,7 @@ var r=n(7),o=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n) * @license MIT */ var r=n(74),o=n(263),i=n(118);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return J(e).length;default:if(r)return H(e).length;t=(""+t).toLowerCase(),r=!0}}function A(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return k(this,t,n);case"latin1":case"binary":return S(this,t,n);case"base64":return B(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,o);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,o){var i,a=1,s=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var d=-1;for(i=n;is&&(n=s-c),i=n;i>=0;i--){for(var l=!0,f=0;fo&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function B(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function C(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o239?4:u>223?3:u>191?2:1;if(o+l<=n)switch(l){case 1:u<128&&(d=u);break;case 2:128==(192&(i=e[o+1]))&&(c=(31&u)<<6|63&i)>127&&(d=c);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(c=(15&u)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(d=c);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(c=(15&u)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&c<1114112&&(d=c)}null===d?(d=65533,l=1):d>65535&&(d-=65536,r.push(d>>>10&1023|55296),d=56320|1023&d),r.push(d),o+=l}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},c.prototype.compare=function(e,t,n,r,o){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),u=this.slice(r,o),d=e.slice(t,n),l=0;lo)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return I(this,e,t,n);case"latin1":case"binary":return w(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function k(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,n,r,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function M(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o>>8*(r?o:1-o)}function x(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function D(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(e,t,n,r,i){return i||D(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function T(e,t,n,r,i){return i||D(e,0,n,8),o.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(o*=256);)r+=this[e+--t]*o;return r},c.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||R(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+o]=e/i&255;return t+n},c.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):x(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):x(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);R(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);R(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):x(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):x(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,n){return N(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return N(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return T(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return T(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function J(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(j,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,t,n,r){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(3))},function(e,t,n){(function(e){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:n(330).Buffer}catch(e){}function s(e,t){var n=e.charCodeAt(t);return n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function c(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function u(e,t,n,r){for(var o=0,i=Math.min(e.length,n),a=t;a=49?s-49+10:s>=17?s-17+10:s}return o}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===n)for(o=0,i=0;o>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)o=c(e,t,r)<=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this.strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,o=1;o<=67108863;o*=t)r++;r--,o=o/t|0;for(var i=e.length-n,a=i%r,s=Math.min(i,i-a)+n,c=0,d=n;d1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[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(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,c=a/67108864|0;n.words[0]=s;for(var u=1;u>>26,l=67108863&c,f=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=f;h++){var p=u-h|0;d+=(a=(o=0|e.words[p])*(i=0|t.words[h])+l)/67108864|0,l=67108863&a}n.words[u]=0|l,c=0|d}return 0!==c?n.words[u]=0|c:n.length--,n.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,i=0,a=0;a>>24-o&16777215)||a!==this.length-1?d[6-c.length]+c+n:c+n,(o+=2)>=26&&(o-=26,a--)}for(0!==i&&(n=i.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=l[e],h=f[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var A=p.modn(h).toString(e);n=(p=p.idivn(h)).isZero()?A+n:d[u-A.length]+A+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==a),this.toArrayLike(a,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var o=this.byteLength(),i=n||Math.max(1,o);r(o<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===t,u=new e(i),d=this.clone();if(c){for(s=0;!d.isZero();s++)a=d.andln(255),d.iushrn(8),u[s]=a;for(;s=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var o=0;o0&&(this.words[o]=~this.words[o]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var o=0,i=0;i>>26;for(;0!==o&&i>>26;if(this.length=n.length,0!==o)this.words[this.length]=o,this.length++;else if(n!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,h=0|a[1],p=8191&h,A=h>>>13,g=0|a[2],m=8191&g,v=g>>>13,y=0|a[3],b=8191&y,I=y>>>13,w=0|a[4],E=8191&w,_=w>>>13,B=0|a[5],C=8191&B,k=B>>>13,S=0|a[6],O=8191&S,Q=S>>>13,P=0|a[7],R=8191&P,M=P>>>13,x=0|a[8],D=8191&x,N=x>>>13,T=0|a[9],j=8191&T,U=T>>>13,H=0|s[0],J=8191&H,F=H>>>13,L=0|s[1],q=8191&L,G=L>>>13,V=0|s[2],z=8191&V,Y=V>>>13,K=0|s[3],W=8191&K,Z=K>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],ne=8191&te,re=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,de=0|s[8],le=8191&de,fe=de>>>13,he=0|s[9],pe=8191&he,Ae=he>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(u+(r=Math.imul(l,J))|0)+((8191&(o=(o=Math.imul(l,F))+Math.imul(f,J)|0))<<13)|0;u=((i=Math.imul(f,F))+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(p,J),o=(o=Math.imul(p,F))+Math.imul(A,J)|0,i=Math.imul(A,F);var me=(u+(r=r+Math.imul(l,q)|0)|0)+((8191&(o=(o=o+Math.imul(l,G)|0)+Math.imul(f,q)|0))<<13)|0;u=((i=i+Math.imul(f,G)|0)+(o>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,J),o=(o=Math.imul(m,F))+Math.imul(v,J)|0,i=Math.imul(v,F),r=r+Math.imul(p,q)|0,o=(o=o+Math.imul(p,G)|0)+Math.imul(A,q)|0,i=i+Math.imul(A,G)|0;var ve=(u+(r=r+Math.imul(l,z)|0)|0)+((8191&(o=(o=o+Math.imul(l,Y)|0)+Math.imul(f,z)|0))<<13)|0;u=((i=i+Math.imul(f,Y)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(b,J),o=(o=Math.imul(b,F))+Math.imul(I,J)|0,i=Math.imul(I,F),r=r+Math.imul(m,q)|0,o=(o=o+Math.imul(m,G)|0)+Math.imul(v,q)|0,i=i+Math.imul(v,G)|0,r=r+Math.imul(p,z)|0,o=(o=o+Math.imul(p,Y)|0)+Math.imul(A,z)|0,i=i+Math.imul(A,Y)|0;var ye=(u+(r=r+Math.imul(l,W)|0)|0)+((8191&(o=(o=o+Math.imul(l,Z)|0)+Math.imul(f,W)|0))<<13)|0;u=((i=i+Math.imul(f,Z)|0)+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(E,J),o=(o=Math.imul(E,F))+Math.imul(_,J)|0,i=Math.imul(_,F),r=r+Math.imul(b,q)|0,o=(o=o+Math.imul(b,G)|0)+Math.imul(I,q)|0,i=i+Math.imul(I,G)|0,r=r+Math.imul(m,z)|0,o=(o=o+Math.imul(m,Y)|0)+Math.imul(v,z)|0,i=i+Math.imul(v,Y)|0,r=r+Math.imul(p,W)|0,o=(o=o+Math.imul(p,Z)|0)+Math.imul(A,W)|0,i=i+Math.imul(A,Z)|0;var be=(u+(r=r+Math.imul(l,$)|0)|0)+((8191&(o=(o=o+Math.imul(l,ee)|0)+Math.imul(f,$)|0))<<13)|0;u=((i=i+Math.imul(f,ee)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(C,J),o=(o=Math.imul(C,F))+Math.imul(k,J)|0,i=Math.imul(k,F),r=r+Math.imul(E,q)|0,o=(o=o+Math.imul(E,G)|0)+Math.imul(_,q)|0,i=i+Math.imul(_,G)|0,r=r+Math.imul(b,z)|0,o=(o=o+Math.imul(b,Y)|0)+Math.imul(I,z)|0,i=i+Math.imul(I,Y)|0,r=r+Math.imul(m,W)|0,o=(o=o+Math.imul(m,Z)|0)+Math.imul(v,W)|0,i=i+Math.imul(v,Z)|0,r=r+Math.imul(p,$)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(A,$)|0,i=i+Math.imul(A,ee)|0;var Ie=(u+(r=r+Math.imul(l,ne)|0)|0)+((8191&(o=(o=o+Math.imul(l,re)|0)+Math.imul(f,ne)|0))<<13)|0;u=((i=i+Math.imul(f,re)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(O,J),o=(o=Math.imul(O,F))+Math.imul(Q,J)|0,i=Math.imul(Q,F),r=r+Math.imul(C,q)|0,o=(o=o+Math.imul(C,G)|0)+Math.imul(k,q)|0,i=i+Math.imul(k,G)|0,r=r+Math.imul(E,z)|0,o=(o=o+Math.imul(E,Y)|0)+Math.imul(_,z)|0,i=i+Math.imul(_,Y)|0,r=r+Math.imul(b,W)|0,o=(o=o+Math.imul(b,Z)|0)+Math.imul(I,W)|0,i=i+Math.imul(I,Z)|0,r=r+Math.imul(m,$)|0,o=(o=o+Math.imul(m,ee)|0)+Math.imul(v,$)|0,i=i+Math.imul(v,ee)|0,r=r+Math.imul(p,ne)|0,o=(o=o+Math.imul(p,re)|0)+Math.imul(A,ne)|0,i=i+Math.imul(A,re)|0;var we=(u+(r=r+Math.imul(l,ie)|0)|0)+((8191&(o=(o=o+Math.imul(l,ae)|0)+Math.imul(f,ie)|0))<<13)|0;u=((i=i+Math.imul(f,ae)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(R,J),o=(o=Math.imul(R,F))+Math.imul(M,J)|0,i=Math.imul(M,F),r=r+Math.imul(O,q)|0,o=(o=o+Math.imul(O,G)|0)+Math.imul(Q,q)|0,i=i+Math.imul(Q,G)|0,r=r+Math.imul(C,z)|0,o=(o=o+Math.imul(C,Y)|0)+Math.imul(k,z)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(E,W)|0,o=(o=o+Math.imul(E,Z)|0)+Math.imul(_,W)|0,i=i+Math.imul(_,Z)|0,r=r+Math.imul(b,$)|0,o=(o=o+Math.imul(b,ee)|0)+Math.imul(I,$)|0,i=i+Math.imul(I,ee)|0,r=r+Math.imul(m,ne)|0,o=(o=o+Math.imul(m,re)|0)+Math.imul(v,ne)|0,i=i+Math.imul(v,re)|0,r=r+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,ae)|0;var Ee=(u+(r=r+Math.imul(l,ce)|0)|0)+((8191&(o=(o=o+Math.imul(l,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((i=i+Math.imul(f,ue)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(D,J),o=(o=Math.imul(D,F))+Math.imul(N,J)|0,i=Math.imul(N,F),r=r+Math.imul(R,q)|0,o=(o=o+Math.imul(R,G)|0)+Math.imul(M,q)|0,i=i+Math.imul(M,G)|0,r=r+Math.imul(O,z)|0,o=(o=o+Math.imul(O,Y)|0)+Math.imul(Q,z)|0,i=i+Math.imul(Q,Y)|0,r=r+Math.imul(C,W)|0,o=(o=o+Math.imul(C,Z)|0)+Math.imul(k,W)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(E,$)|0,o=(o=o+Math.imul(E,ee)|0)+Math.imul(_,$)|0,i=i+Math.imul(_,ee)|0,r=r+Math.imul(b,ne)|0,o=(o=o+Math.imul(b,re)|0)+Math.imul(I,ne)|0,i=i+Math.imul(I,re)|0,r=r+Math.imul(m,ie)|0,o=(o=o+Math.imul(m,ae)|0)+Math.imul(v,ie)|0,i=i+Math.imul(v,ae)|0,r=r+Math.imul(p,ce)|0,o=(o=o+Math.imul(p,ue)|0)+Math.imul(A,ce)|0,i=i+Math.imul(A,ue)|0;var _e=(u+(r=r+Math.imul(l,le)|0)|0)+((8191&(o=(o=o+Math.imul(l,fe)|0)+Math.imul(f,le)|0))<<13)|0;u=((i=i+Math.imul(f,fe)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(j,J),o=(o=Math.imul(j,F))+Math.imul(U,J)|0,i=Math.imul(U,F),r=r+Math.imul(D,q)|0,o=(o=o+Math.imul(D,G)|0)+Math.imul(N,q)|0,i=i+Math.imul(N,G)|0,r=r+Math.imul(R,z)|0,o=(o=o+Math.imul(R,Y)|0)+Math.imul(M,z)|0,i=i+Math.imul(M,Y)|0,r=r+Math.imul(O,W)|0,o=(o=o+Math.imul(O,Z)|0)+Math.imul(Q,W)|0,i=i+Math.imul(Q,Z)|0,r=r+Math.imul(C,$)|0,o=(o=o+Math.imul(C,ee)|0)+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(E,ne)|0,o=(o=o+Math.imul(E,re)|0)+Math.imul(_,ne)|0,i=i+Math.imul(_,re)|0,r=r+Math.imul(b,ie)|0,o=(o=o+Math.imul(b,ae)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,ae)|0,r=r+Math.imul(m,ce)|0,o=(o=o+Math.imul(m,ue)|0)+Math.imul(v,ce)|0,i=i+Math.imul(v,ue)|0,r=r+Math.imul(p,le)|0,o=(o=o+Math.imul(p,fe)|0)+Math.imul(A,le)|0,i=i+Math.imul(A,fe)|0;var Be=(u+(r=r+Math.imul(l,pe)|0)|0)+((8191&(o=(o=o+Math.imul(l,Ae)|0)+Math.imul(f,pe)|0))<<13)|0;u=((i=i+Math.imul(f,Ae)|0)+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,q),o=(o=Math.imul(j,G))+Math.imul(U,q)|0,i=Math.imul(U,G),r=r+Math.imul(D,z)|0,o=(o=o+Math.imul(D,Y)|0)+Math.imul(N,z)|0,i=i+Math.imul(N,Y)|0,r=r+Math.imul(R,W)|0,o=(o=o+Math.imul(R,Z)|0)+Math.imul(M,W)|0,i=i+Math.imul(M,Z)|0,r=r+Math.imul(O,$)|0,o=(o=o+Math.imul(O,ee)|0)+Math.imul(Q,$)|0,i=i+Math.imul(Q,ee)|0,r=r+Math.imul(C,ne)|0,o=(o=o+Math.imul(C,re)|0)+Math.imul(k,ne)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(E,ie)|0,o=(o=o+Math.imul(E,ae)|0)+Math.imul(_,ie)|0,i=i+Math.imul(_,ae)|0,r=r+Math.imul(b,ce)|0,o=(o=o+Math.imul(b,ue)|0)+Math.imul(I,ce)|0,i=i+Math.imul(I,ue)|0,r=r+Math.imul(m,le)|0,o=(o=o+Math.imul(m,fe)|0)+Math.imul(v,le)|0,i=i+Math.imul(v,fe)|0;var Ce=(u+(r=r+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,Ae)|0)+Math.imul(A,pe)|0))<<13)|0;u=((i=i+Math.imul(A,Ae)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,z),o=(o=Math.imul(j,Y))+Math.imul(U,z)|0,i=Math.imul(U,Y),r=r+Math.imul(D,W)|0,o=(o=o+Math.imul(D,Z)|0)+Math.imul(N,W)|0,i=i+Math.imul(N,Z)|0,r=r+Math.imul(R,$)|0,o=(o=o+Math.imul(R,ee)|0)+Math.imul(M,$)|0,i=i+Math.imul(M,ee)|0,r=r+Math.imul(O,ne)|0,o=(o=o+Math.imul(O,re)|0)+Math.imul(Q,ne)|0,i=i+Math.imul(Q,re)|0,r=r+Math.imul(C,ie)|0,o=(o=o+Math.imul(C,ae)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,ae)|0,r=r+Math.imul(E,ce)|0,o=(o=o+Math.imul(E,ue)|0)+Math.imul(_,ce)|0,i=i+Math.imul(_,ue)|0,r=r+Math.imul(b,le)|0,o=(o=o+Math.imul(b,fe)|0)+Math.imul(I,le)|0,i=i+Math.imul(I,fe)|0;var ke=(u+(r=r+Math.imul(m,pe)|0)|0)+((8191&(o=(o=o+Math.imul(m,Ae)|0)+Math.imul(v,pe)|0))<<13)|0;u=((i=i+Math.imul(v,Ae)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,W),o=(o=Math.imul(j,Z))+Math.imul(U,W)|0,i=Math.imul(U,Z),r=r+Math.imul(D,$)|0,o=(o=o+Math.imul(D,ee)|0)+Math.imul(N,$)|0,i=i+Math.imul(N,ee)|0,r=r+Math.imul(R,ne)|0,o=(o=o+Math.imul(R,re)|0)+Math.imul(M,ne)|0,i=i+Math.imul(M,re)|0,r=r+Math.imul(O,ie)|0,o=(o=o+Math.imul(O,ae)|0)+Math.imul(Q,ie)|0,i=i+Math.imul(Q,ae)|0,r=r+Math.imul(C,ce)|0,o=(o=o+Math.imul(C,ue)|0)+Math.imul(k,ce)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(E,le)|0,o=(o=o+Math.imul(E,fe)|0)+Math.imul(_,le)|0,i=i+Math.imul(_,fe)|0;var Se=(u+(r=r+Math.imul(b,pe)|0)|0)+((8191&(o=(o=o+Math.imul(b,Ae)|0)+Math.imul(I,pe)|0))<<13)|0;u=((i=i+Math.imul(I,Ae)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,$),o=(o=Math.imul(j,ee))+Math.imul(U,$)|0,i=Math.imul(U,ee),r=r+Math.imul(D,ne)|0,o=(o=o+Math.imul(D,re)|0)+Math.imul(N,ne)|0,i=i+Math.imul(N,re)|0,r=r+Math.imul(R,ie)|0,o=(o=o+Math.imul(R,ae)|0)+Math.imul(M,ie)|0,i=i+Math.imul(M,ae)|0,r=r+Math.imul(O,ce)|0,o=(o=o+Math.imul(O,ue)|0)+Math.imul(Q,ce)|0,i=i+Math.imul(Q,ue)|0,r=r+Math.imul(C,le)|0,o=(o=o+Math.imul(C,fe)|0)+Math.imul(k,le)|0,i=i+Math.imul(k,fe)|0;var Oe=(u+(r=r+Math.imul(E,pe)|0)|0)+((8191&(o=(o=o+Math.imul(E,Ae)|0)+Math.imul(_,pe)|0))<<13)|0;u=((i=i+Math.imul(_,Ae)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(j,ne),o=(o=Math.imul(j,re))+Math.imul(U,ne)|0,i=Math.imul(U,re),r=r+Math.imul(D,ie)|0,o=(o=o+Math.imul(D,ae)|0)+Math.imul(N,ie)|0,i=i+Math.imul(N,ae)|0,r=r+Math.imul(R,ce)|0,o=(o=o+Math.imul(R,ue)|0)+Math.imul(M,ce)|0,i=i+Math.imul(M,ue)|0,r=r+Math.imul(O,le)|0,o=(o=o+Math.imul(O,fe)|0)+Math.imul(Q,le)|0,i=i+Math.imul(Q,fe)|0;var Qe=(u+(r=r+Math.imul(C,pe)|0)|0)+((8191&(o=(o=o+Math.imul(C,Ae)|0)+Math.imul(k,pe)|0))<<13)|0;u=((i=i+Math.imul(k,Ae)|0)+(o>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,r=Math.imul(j,ie),o=(o=Math.imul(j,ae))+Math.imul(U,ie)|0,i=Math.imul(U,ae),r=r+Math.imul(D,ce)|0,o=(o=o+Math.imul(D,ue)|0)+Math.imul(N,ce)|0,i=i+Math.imul(N,ue)|0,r=r+Math.imul(R,le)|0,o=(o=o+Math.imul(R,fe)|0)+Math.imul(M,le)|0,i=i+Math.imul(M,fe)|0;var Pe=(u+(r=r+Math.imul(O,pe)|0)|0)+((8191&(o=(o=o+Math.imul(O,Ae)|0)+Math.imul(Q,pe)|0))<<13)|0;u=((i=i+Math.imul(Q,Ae)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(j,ce),o=(o=Math.imul(j,ue))+Math.imul(U,ce)|0,i=Math.imul(U,ue),r=r+Math.imul(D,le)|0,o=(o=o+Math.imul(D,fe)|0)+Math.imul(N,le)|0,i=i+Math.imul(N,fe)|0;var Re=(u+(r=r+Math.imul(R,pe)|0)|0)+((8191&(o=(o=o+Math.imul(R,Ae)|0)+Math.imul(M,pe)|0))<<13)|0;u=((i=i+Math.imul(M,Ae)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,le),o=(o=Math.imul(j,fe))+Math.imul(U,le)|0,i=Math.imul(U,fe);var Me=(u+(r=r+Math.imul(D,pe)|0)|0)+((8191&(o=(o=o+Math.imul(D,Ae)|0)+Math.imul(N,pe)|0))<<13)|0;u=((i=i+Math.imul(N,Ae)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863;var xe=(u+(r=Math.imul(j,pe))|0)+((8191&(o=(o=Math.imul(j,Ae))+Math.imul(U,pe)|0))<<13)|0;return u=((i=Math.imul(U,Ae))+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,c[0]=ge,c[1]=me,c[2]=ve,c[3]=ye,c[4]=be,c[5]=Ie,c[6]=we,c[7]=Ee,c[8]=_e,c[9]=Be,c[10]=Ce,c[11]=ke,c[12]=Se,c[13]=Oe,c[14]=Qe,c[15]=Pe,c[16]=Re,c[17]=Me,c[18]=xe,0!==u&&(c[19]=u,n.length++),n};function A(e,t,n){return(new g).mulp(e,t,n)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=h),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,o=0,i=0;i>>26)|0)>>>26,a&=67108863}n.words[i]=s,r=a,a=o}return 0!==r?n.words[i]=r:n.length--,n.strip()}(this,e,t):A(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),n=i.prototype._countBits(e)-1,r=0;r>=1;return r},g.prototype.permute=function(e,t,n,r,o,i){for(var a=0;a>>=1)o++;return 1<>>=13,n[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,t+=o/67108864|0,t+=i>>>26,this.words[n]=67108863&i}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>o}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,n=e%26,o=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<a)for(this.length-=a,u=0;u=0&&(0!==d||u>=o);u--){var l=0|this.words[u];this.words[u]=d<<26-i|l>>>i,d=l&s}return c&&0!==d&&(c.words[c.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,o=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var o=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[o+n]=67108863&i}for(;o>26,this.words[o+n]=67108863&i;if(0===s)return this.strip();for(r(-1===s),s=0,o=0;o>26,this.words[o]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!==(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,c=r.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;l--){var f=67108864*(0|r.words[o.length+l])+(0|r.words[o.length+l-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(o,f,l);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(o,1,l),r.isZero()||(r.negative^=1);s&&(s.words[l]=f)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),o=e.andln(1),i=n.cmp(r);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,o=this.length-1;o>=0;o--)n=(t*n+(0|this.words[o]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*t;this.words[n]=o/e|0,t=o%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var d=n.clone(),l=t.clone();!t.isZero();){for(var f=0,h=1;0==(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(d),a.isub(l)),o.iushrn(1),a.iushrn(1);for(var p=0,A=1;0==(n.words[0]&A)&&p<26;++p,A<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(d),c.isub(l)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,d=1;0==(t.words[0]&d)&&u<26;++u,d<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var l=0,f=1;0==(n.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(n.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var o=t.cmp(n);if(o<0){var i=t;t=n,n=i}else if(0===o||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,o=1<>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:oe.length)return 1;if(this.length=0;n--){var r=0|this.words[n],o=0|e.words[n];if(r!==o){ro&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new E(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function I(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function _(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},o(y,v),y.prototype.split=function(e,t){for(var n=Math.min(e.length,9),r=0;r>>22,o=i}o>>>=22,e.words[r-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=o,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new b;else if("p192"===e)t=new I;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return m[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},E.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new i(2*d*d).toRed(this);0!==this.pow(d,u).cmp(c);)d.redIAdd(c);for(var l=this.pow(d,o),f=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var A=h,g=0;0!==A.cmp(s);g++)A=A.redSqr();r(g=0;r--){for(var u=t.words[r],d=c-1;d>=0;d--){var l=u>>d&1;o!==n[0]&&(o=this.sqr(o)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===r&&0===d)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}c=26}return o},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new _(e)},o(_,E),_.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},_.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},_.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},_.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},_.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(50)(e))},function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Any=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1));t.protobufPackage="google.protobuf";const a={typeUrl:""};t.Any={encode:(e,t=i.default.Writer.create())=>(""!==e.typeUrl&&t.uint32(10).string(e.typeUrl),0!==e.value.length&&t.uint32(18).bytes(e.value),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},a);for(o.value=new Uint8Array;n.pos>>3){case 1:o.typeUrl=n.string();break;case 2:o.value=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},a);return t.typeUrl=void 0!==e.typeUrl&&null!==e.typeUrl?String(e.typeUrl):"",t.value=void 0!==e.value&&null!==e.value?function(e){const t=c(e),n=new Uint8Array(t.length);for(let e=0;e{if(void 0!==s)return s;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw"Unable to locate global object"})();const c=s.atob||(e=>s.Buffer.from(e,"base64").toString("binary"));const u=s.btoa||(e=>s.Buffer.from(e,"binary").toString("base64"));i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())}).call(this,n(3))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DecProto=t.IntProto=t.DecCoin=t.Coin=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1));t.protobufPackage="cosmos.base.v1beta1";const a={denom:"",amount:""};t.Coin={encode:(e,t=i.default.Writer.create())=>(""!==e.denom&&t.uint32(10).string(e.denom),""!==e.amount&&t.uint32(18).string(e.amount),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},a);for(;n.pos>>3){case 1:o.denom=n.string();break;case 2:o.amount=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},a);return t.denom=void 0!==e.denom&&null!==e.denom?String(e.denom):"",t.amount=void 0!==e.amount&&null!==e.amount?String(e.amount):"",t},toJSON(e){const t={};return void 0!==e.denom&&(t.denom=e.denom),void 0!==e.amount&&(t.amount=e.amount),t},fromPartial(e){var t,n;const r=Object.assign({},a);return r.denom=null!==(t=e.denom)&&void 0!==t?t:"",r.amount=null!==(n=e.amount)&&void 0!==n?n:"",r}};const s={denom:"",amount:""};t.DecCoin={encode:(e,t=i.default.Writer.create())=>(""!==e.denom&&t.uint32(10).string(e.denom),""!==e.amount&&t.uint32(18).string(e.amount),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},s);for(;n.pos>>3){case 1:o.denom=n.string();break;case 2:o.amount=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},s);return t.denom=void 0!==e.denom&&null!==e.denom?String(e.denom):"",t.amount=void 0!==e.amount&&null!==e.amount?String(e.amount):"",t},toJSON(e){const t={};return void 0!==e.denom&&(t.denom=e.denom),void 0!==e.amount&&(t.amount=e.amount),t},fromPartial(e){var t,n;const r=Object.assign({},s);return r.denom=null!==(t=e.denom)&&void 0!==t?t:"",r.amount=null!==(n=e.amount)&&void 0!==n?n:"",r}};const c={int:""};t.IntProto={encode:(e,t=i.default.Writer.create())=>(""!==e.int&&t.uint32(10).string(e.int),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},c);for(;n.pos>>3){case 1:o.int=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},c);return t.int=void 0!==e.int&&null!==e.int?String(e.int):"",t},toJSON(e){const t={};return void 0!==e.int&&(t.int=e.int),t},fromPartial(e){var t;const n=Object.assign({},c);return n.int=null!==(t=e.int)&&void 0!==t?t:"",n}};const u={dec:""};t.DecProto={encode:(e,t=i.default.Writer.create())=>(""!==e.dec&&t.uint32(10).string(e.dec),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},u);for(;n.pos>>3){case 1:o.dec=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},u);return t.dec=void 0!==e.dec&&null!==e.dec?String(e.dec):"",t},toJSON(e){const t={};return void 0!==e.dec&&(t.dec=e.dec),t},fromPartial(e){var t;const n=Object.assign({},u);return n.dec=null!==(t=e.dec)&&void 0!==t?t:"",n}},i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Uint64=t.Uint53=t.Uint32=t.Int53=t.Decimal=void 0;var r=n(420);Object.defineProperty(t,"Decimal",{enumerable:!0,get:function(){return r.Decimal}});var o=n(422);Object.defineProperty(t,"Int53",{enumerable:!0,get:function(){return o.Int53}}),Object.defineProperty(t,"Uint32",{enumerable:!0,get:function(){return o.Uint32}}),Object.defineProperty(t,"Uint53",{enumerable:!0,get:function(){return o.Uint53}}),Object.defineProperty(t,"Uint64",{enumerable:!0,get:function(){return o.Uint64}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isUint8Array=t.isNonNullObject=t.sleep=t.assertDefinedAndNotNull=t.assertDefined=t.assert=t.arrayContentStartsWith=t.arrayContentEquals=void 0;var r=n(447);Object.defineProperty(t,"arrayContentEquals",{enumerable:!0,get:function(){return r.arrayContentEquals}}),Object.defineProperty(t,"arrayContentStartsWith",{enumerable:!0,get:function(){return r.arrayContentStartsWith}});var o=n(448);Object.defineProperty(t,"assert",{enumerable:!0,get:function(){return o.assert}}),Object.defineProperty(t,"assertDefined",{enumerable:!0,get:function(){return o.assertDefined}}),Object.defineProperty(t,"assertDefinedAndNotNull",{enumerable:!0,get:function(){return o.assertDefinedAndNotNull}});var i=n(449);Object.defineProperty(t,"sleep",{enumerable:!0,get:function(){return i.sleep}});var a=n(450);Object.defineProperty(t,"isNonNullObject",{enumerable:!0,get:function(){return a.isNonNullObject}}),Object.defineProperty(t,"isUint8Array",{enumerable:!0,get:function(){return a.isUint8Array}})},function(e,t,n){"use strict";var r=n(182),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function a(e){return void 0===e}function s(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===o.call(e)}function d(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n(o>>1)-1?(o>>1)-c:c,i.isubn(s)):s=0,r[a]=s,i.iushrn(1)}return r},r.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var r,o=0,i=0;e.cmpn(-o)>0||t.cmpn(-i)>0;){var a,s,c=e.andln(3)+o&3,u=t.andln(3)+i&3;3===c&&(c=-1),3===u&&(u=-1),a=0==(1&c)?0:3!==(r=e.andln(7)+o&7)&&5!==r||2!==u?c:-c,n[0].push(a),s=0==(1&u)?0:3!==(r=t.andln(7)+i&7)&&5!==r||2!==c?u:-u,n[1].push(s),2*o===a+1&&(o=1-o),2*i===s+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return n},r.cachedProperty=function(e,t,n){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new o(e,"hex","le")}},function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PageResponse=t.PageRequest=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1));t.protobufPackage="cosmos.base.query.v1beta1";const a={offset:o.default.UZERO,limit:o.default.UZERO,countTotal:!1,reverse:!1};t.PageRequest={encode:(e,t=i.default.Writer.create())=>(0!==e.key.length&&t.uint32(10).bytes(e.key),e.offset.isZero()||t.uint32(16).uint64(e.offset),e.limit.isZero()||t.uint32(24).uint64(e.limit),!0===e.countTotal&&t.uint32(32).bool(e.countTotal),!0===e.reverse&&t.uint32(40).bool(e.reverse),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},a);for(o.key=new Uint8Array;n.pos>>3){case 1:o.key=n.bytes();break;case 2:o.offset=n.uint64();break;case 3:o.limit=n.uint64();break;case 4:o.countTotal=n.bool();break;case 5:o.reverse=n.bool();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},a);return t.key=void 0!==e.key&&null!==e.key?d(e.key):new Uint8Array,t.offset=void 0!==e.offset&&null!==e.offset?o.default.fromString(e.offset):o.default.UZERO,t.limit=void 0!==e.limit&&null!==e.limit?o.default.fromString(e.limit):o.default.UZERO,t.countTotal=void 0!==e.countTotal&&null!==e.countTotal&&Boolean(e.countTotal),t.reverse=void 0!==e.reverse&&null!==e.reverse&&Boolean(e.reverse),t},toJSON(e){const t={};return void 0!==e.key&&(t.key=f(void 0!==e.key?e.key:new Uint8Array)),void 0!==e.offset&&(t.offset=(e.offset||o.default.UZERO).toString()),void 0!==e.limit&&(t.limit=(e.limit||o.default.UZERO).toString()),void 0!==e.countTotal&&(t.countTotal=e.countTotal),void 0!==e.reverse&&(t.reverse=e.reverse),t},fromPartial(e){var t,n,r;const i=Object.assign({},a);return i.key=null!==(t=e.key)&&void 0!==t?t:new Uint8Array,i.offset=void 0!==e.offset&&null!==e.offset?o.default.fromValue(e.offset):o.default.UZERO,i.limit=void 0!==e.limit&&null!==e.limit?o.default.fromValue(e.limit):o.default.UZERO,i.countTotal=null!==(n=e.countTotal)&&void 0!==n&&n,i.reverse=null!==(r=e.reverse)&&void 0!==r&&r,i}};const s={total:o.default.UZERO};t.PageResponse={encode:(e,t=i.default.Writer.create())=>(0!==e.nextKey.length&&t.uint32(10).bytes(e.nextKey),e.total.isZero()||t.uint32(16).uint64(e.total),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},s);for(o.nextKey=new Uint8Array;n.pos>>3){case 1:o.nextKey=n.bytes();break;case 2:o.total=n.uint64();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},s);return t.nextKey=void 0!==e.nextKey&&null!==e.nextKey?d(e.nextKey):new Uint8Array,t.total=void 0!==e.total&&null!==e.total?o.default.fromString(e.total):o.default.UZERO,t},toJSON(e){const t={};return void 0!==e.nextKey&&(t.nextKey=f(void 0!==e.nextKey?e.nextKey:new Uint8Array)),void 0!==e.total&&(t.total=(e.total||o.default.UZERO).toString()),t},fromPartial(e){var t;const n=Object.assign({},s);return n.nextKey=null!==(t=e.nextKey)&&void 0!==t?t:new Uint8Array,n.total=void 0!==e.total&&null!==e.total?o.default.fromValue(e.total):o.default.UZERO,n}};var c=(()=>{if(void 0!==c)return c;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw"Unable to locate global object"})();const u=c.atob||(e=>c.Buffer.from(e,"base64").toString("binary"));function d(e){const t=u(e),n=new Uint8Array(t.length);for(let e=0;ec.Buffer.from(e,"binary").toString("base64"));function f(e){const t=[];for(const n of e)t.push(String.fromCharCode(n));return l(t.join(""))}i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())}).call(this,n(3))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringToPath=t.Slip10RawIndex=t.slip10CurveFromString=t.Slip10Curve=t.Slip10=t.pathToString=t.sha512=t.Sha512=t.sha256=t.Sha256=t.Secp256k1Signature=t.ExtendedSecp256k1Signature=t.Secp256k1=t.ripemd160=t.Ripemd160=t.Random=t.Xchacha20poly1305Ietf=t.xchacha20NonceLength=t.isArgon2idOptions=t.Ed25519Keypair=t.Ed25519=t.Argon2id=t.keccak256=t.Keccak256=t.Hmac=t.EnglishMnemonic=t.Bip39=void 0;var r=n(439);Object.defineProperty(t,"Bip39",{enumerable:!0,get:function(){return r.Bip39}}),Object.defineProperty(t,"EnglishMnemonic",{enumerable:!0,get:function(){return r.EnglishMnemonic}});var o=n(198);Object.defineProperty(t,"Hmac",{enumerable:!0,get:function(){return o.Hmac}});var i=n(454);Object.defineProperty(t,"Keccak256",{enumerable:!0,get:function(){return i.Keccak256}}),Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return i.keccak256}});var a=n(456);Object.defineProperty(t,"Argon2id",{enumerable:!0,get:function(){return a.Argon2id}}),Object.defineProperty(t,"Ed25519",{enumerable:!0,get:function(){return a.Ed25519}}),Object.defineProperty(t,"Ed25519Keypair",{enumerable:!0,get:function(){return a.Ed25519Keypair}}),Object.defineProperty(t,"isArgon2idOptions",{enumerable:!0,get:function(){return a.isArgon2idOptions}}),Object.defineProperty(t,"xchacha20NonceLength",{enumerable:!0,get:function(){return a.xchacha20NonceLength}}),Object.defineProperty(t,"Xchacha20poly1305Ietf",{enumerable:!0,get:function(){return a.Xchacha20poly1305Ietf}});var s=n(457);Object.defineProperty(t,"Random",{enumerable:!0,get:function(){return s.Random}});var c=n(458);Object.defineProperty(t,"Ripemd160",{enumerable:!0,get:function(){return c.Ripemd160}}),Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return c.ripemd160}});var u=n(459);Object.defineProperty(t,"Secp256k1",{enumerable:!0,get:function(){return u.Secp256k1}});var d=n(201);Object.defineProperty(t,"ExtendedSecp256k1Signature",{enumerable:!0,get:function(){return d.ExtendedSecp256k1Signature}}),Object.defineProperty(t,"Secp256k1Signature",{enumerable:!0,get:function(){return d.Secp256k1Signature}});var l=n(100);Object.defineProperty(t,"Sha256",{enumerable:!0,get:function(){return l.Sha256}}),Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return l.sha256}}),Object.defineProperty(t,"Sha512",{enumerable:!0,get:function(){return l.Sha512}}),Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return l.sha512}});var f=n(461);Object.defineProperty(t,"pathToString",{enumerable:!0,get:function(){return f.pathToString}}),Object.defineProperty(t,"Slip10",{enumerable:!0,get:function(){return f.Slip10}}),Object.defineProperty(t,"Slip10Curve",{enumerable:!0,get:function(){return f.Slip10Curve}}),Object.defineProperty(t,"slip10CurveFromString",{enumerable:!0,get:function(){return f.slip10CurveFromString}}),Object.defineProperty(t,"Slip10RawIndex",{enumerable:!0,get:function(){return f.Slip10RawIndex}}),Object.defineProperty(t,"stringToPath",{enumerable:!0,get:function(){return f.stringToPath}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.longify=t.decodeCosmosSdkDecFromProto=t.createProtobufRpcClient=t.createPagination=t.QueryClient=void 0;var r=n(478);Object.defineProperty(t,"QueryClient",{enumerable:!0,get:function(){return r.QueryClient}});var o=n(501);Object.defineProperty(t,"createPagination",{enumerable:!0,get:function(){return o.createPagination}}),Object.defineProperty(t,"createProtobufRpcClient",{enumerable:!0,get:function(){return o.createProtobufRpcClient}}),Object.defineProperty(t,"decodeCosmosSdkDecFromProto",{enumerable:!0,get:function(){return o.decodeCosmosSdkDecFromProto}}),Object.defineProperty(t,"longify",{enumerable:!0,get:function(){return o.longify}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toUtf8=t.fromUtf8=t.toRfc3339=t.fromRfc3339=t.toHex=t.fromHex=t.Bech32=t.toBase64=t.fromBase64=t.toAscii=t.fromAscii=void 0;var r=n(265);Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return r.fromAscii}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return r.toAscii}});var o=n(266);Object.defineProperty(t,"fromBase64",{enumerable:!0,get:function(){return o.fromBase64}}),Object.defineProperty(t,"toBase64",{enumerable:!0,get:function(){return o.toBase64}});var i=n(267);Object.defineProperty(t,"Bech32",{enumerable:!0,get:function(){return i.Bech32}});var a=n(268);Object.defineProperty(t,"fromHex",{enumerable:!0,get:function(){return a.fromHex}}),Object.defineProperty(t,"toHex",{enumerable:!0,get:function(){return a.toHex}});var s=n(269);Object.defineProperty(t,"fromRfc3339",{enumerable:!0,get:function(){return s.fromRfc3339}}),Object.defineProperty(t,"toRfc3339",{enumerable:!0,get:function(){return s.toRfc3339}});var c=n(271);Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return c.fromUtf8}}),Object.defineProperty(t,"toUtf8",{enumerable:!0,get:function(){return c.toUtf8}})},function(e,t,n){"use strict";var r=n(17),o=n(2);function i(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function c(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=o,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o>6|192,n[r++]=63&a|128):i(e,o)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++o)),n[r++]=a>>18|240,n[r++]=a>>12&63|128,n[r++]=a>>6&63|128,n[r++]=63&a|128):(n[r++]=a>>12|224,n[r++]=a>>6&63|128,n[r++]=63&a|128)}else for(o=0;o>>0}return a},t.split32=function(e,t){for(var n=new Array(4*e.length),r=0,o=0;r>>24,n[o+1]=i>>>16&255,n[o+2]=i>>>8&255,n[o+3]=255&i):(n[o+3]=i>>>24,n[o+2]=i>>>16&255,n[o+1]=i>>>8&255,n[o]=255&i)}return n},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,n){return e+t+n>>>0},t.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},t.sum32_5=function(e,t,n,r,o){return e+t+n+r+o>>>0},t.sum64=function(e,t,n,r){var o=e[t],i=r+e[t+1]>>>0,a=(i>>0,e[t+1]=i},t.sum64_hi=function(e,t,n,r){return(t+r>>>0>>0},t.sum64_lo=function(e,t,n,r){return t+r>>>0},t.sum64_4_hi=function(e,t,n,r,o,i,a,s){var c=0,u=t;return c+=(u=u+r>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,n,r,o,i,a,s){return t+r+i+s>>>0},t.sum64_5_hi=function(e,t,n,r,o,i,a,s,c,u){var d=0,l=t;return d+=(l=l+r>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,n,r,o,i,a,s,c,u){return t+r+i+s+u>>>0},t.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},t.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},t.shr64_hi=function(e,t,n){return e>>>n},t.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},function(e,t,n){var r=n(4).Buffer,o=n(284).Transform,i=n(30).StringDecoder;function a(e){o.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}n(2)(a,o),a.prototype.update=function(e,t,n){"string"==typeof e&&(e=r.from(e,t));var o=this._update(e);return this.hashMode?this:(n&&(o=this._toString(o,n)),o)},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(e,t,n){var r;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){r=e}finally{n(r)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||r.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,n){if(this._decoder||(this._decoder=new i(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var r=this._decoder.write(e);return n&&(r+=this._decoder.end()),r},e.exports=a},function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Fee=t.ModeInfo_Multi=t.ModeInfo_Single=t.ModeInfo=t.SignerInfo=t.AuthInfo=t.TxBody=t.SignDoc=t.TxRaw=t.Tx=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(9),s=n(53),c=n(97),u=n(10);t.protobufPackage="cosmos.tx.v1beta1";const d={};t.Tx={encode(e,n=i.default.Writer.create()){void 0!==e.body&&t.TxBody.encode(e.body,n.uint32(10).fork()).ldelim(),void 0!==e.authInfo&&t.AuthInfo.encode(e.authInfo,n.uint32(18).fork()).ldelim();for(const t of e.signatures)n.uint32(26).bytes(t);return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},d);for(a.signatures=[];r.pos>>3){case 1:a.body=t.TxBody.decode(r,r.uint32());break;case 2:a.authInfo=t.AuthInfo.decode(r,r.uint32());break;case 3:a.signatures.push(r.bytes());break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},d);return r.body=void 0!==e.body&&null!==e.body?t.TxBody.fromJSON(e.body):void 0,r.authInfo=void 0!==e.authInfo&&null!==e.authInfo?t.AuthInfo.fromJSON(e.authInfo):void 0,r.signatures=(null!==(n=e.signatures)&&void 0!==n?n:[]).map(e=>w(e)),r},toJSON(e){const n={};return void 0!==e.body&&(n.body=e.body?t.TxBody.toJSON(e.body):void 0),void 0!==e.authInfo&&(n.authInfo=e.authInfo?t.AuthInfo.toJSON(e.authInfo):void 0),e.signatures?n.signatures=e.signatures.map(e=>_(void 0!==e?e:new Uint8Array)):n.signatures=[],n},fromPartial(e){var n;const r=Object.assign({},d);return r.body=void 0!==e.body&&null!==e.body?t.TxBody.fromPartial(e.body):void 0,r.authInfo=void 0!==e.authInfo&&null!==e.authInfo?t.AuthInfo.fromPartial(e.authInfo):void 0,r.signatures=(null===(n=e.signatures)||void 0===n?void 0:n.map(e=>e))||[],r}};const l={};t.TxRaw={encode(e,t=i.default.Writer.create()){0!==e.bodyBytes.length&&t.uint32(10).bytes(e.bodyBytes),0!==e.authInfoBytes.length&&t.uint32(18).bytes(e.authInfoBytes);for(const n of e.signatures)t.uint32(26).bytes(n);return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},l);for(o.signatures=[],o.bodyBytes=new Uint8Array,o.authInfoBytes=new Uint8Array;n.pos>>3){case 1:o.bodyBytes=n.bytes();break;case 2:o.authInfoBytes=n.bytes();break;case 3:o.signatures.push(n.bytes());break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},l);return n.bodyBytes=void 0!==e.bodyBytes&&null!==e.bodyBytes?w(e.bodyBytes):new Uint8Array,n.authInfoBytes=void 0!==e.authInfoBytes&&null!==e.authInfoBytes?w(e.authInfoBytes):new Uint8Array,n.signatures=(null!==(t=e.signatures)&&void 0!==t?t:[]).map(e=>w(e)),n},toJSON(e){const t={};return void 0!==e.bodyBytes&&(t.bodyBytes=_(void 0!==e.bodyBytes?e.bodyBytes:new Uint8Array)),void 0!==e.authInfoBytes&&(t.authInfoBytes=_(void 0!==e.authInfoBytes?e.authInfoBytes:new Uint8Array)),e.signatures?t.signatures=e.signatures.map(e=>_(void 0!==e?e:new Uint8Array)):t.signatures=[],t},fromPartial(e){var t,n,r;const o=Object.assign({},l);return o.bodyBytes=null!==(t=e.bodyBytes)&&void 0!==t?t:new Uint8Array,o.authInfoBytes=null!==(n=e.authInfoBytes)&&void 0!==n?n:new Uint8Array,o.signatures=(null===(r=e.signatures)||void 0===r?void 0:r.map(e=>e))||[],o}};const f={chainId:"",accountNumber:o.default.UZERO};t.SignDoc={encode:(e,t=i.default.Writer.create())=>(0!==e.bodyBytes.length&&t.uint32(10).bytes(e.bodyBytes),0!==e.authInfoBytes.length&&t.uint32(18).bytes(e.authInfoBytes),""!==e.chainId&&t.uint32(26).string(e.chainId),e.accountNumber.isZero()||t.uint32(32).uint64(e.accountNumber),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},f);for(o.bodyBytes=new Uint8Array,o.authInfoBytes=new Uint8Array;n.pos>>3){case 1:o.bodyBytes=n.bytes();break;case 2:o.authInfoBytes=n.bytes();break;case 3:o.chainId=n.string();break;case 4:o.accountNumber=n.uint64();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},f);return t.bodyBytes=void 0!==e.bodyBytes&&null!==e.bodyBytes?w(e.bodyBytes):new Uint8Array,t.authInfoBytes=void 0!==e.authInfoBytes&&null!==e.authInfoBytes?w(e.authInfoBytes):new Uint8Array,t.chainId=void 0!==e.chainId&&null!==e.chainId?String(e.chainId):"",t.accountNumber=void 0!==e.accountNumber&&null!==e.accountNumber?o.default.fromString(e.accountNumber):o.default.UZERO,t},toJSON(e){const t={};return void 0!==e.bodyBytes&&(t.bodyBytes=_(void 0!==e.bodyBytes?e.bodyBytes:new Uint8Array)),void 0!==e.authInfoBytes&&(t.authInfoBytes=_(void 0!==e.authInfoBytes?e.authInfoBytes:new Uint8Array)),void 0!==e.chainId&&(t.chainId=e.chainId),void 0!==e.accountNumber&&(t.accountNumber=(e.accountNumber||o.default.UZERO).toString()),t},fromPartial(e){var t,n,r;const i=Object.assign({},f);return i.bodyBytes=null!==(t=e.bodyBytes)&&void 0!==t?t:new Uint8Array,i.authInfoBytes=null!==(n=e.authInfoBytes)&&void 0!==n?n:new Uint8Array,i.chainId=null!==(r=e.chainId)&&void 0!==r?r:"",i.accountNumber=void 0!==e.accountNumber&&null!==e.accountNumber?o.default.fromValue(e.accountNumber):o.default.UZERO,i}};const h={memo:"",timeoutHeight:o.default.UZERO};t.TxBody={encode(e,t=i.default.Writer.create()){for(const n of e.messages)a.Any.encode(n,t.uint32(10).fork()).ldelim();""!==e.memo&&t.uint32(18).string(e.memo),e.timeoutHeight.isZero()||t.uint32(24).uint64(e.timeoutHeight);for(const n of e.extensionOptions)a.Any.encode(n,t.uint32(8186).fork()).ldelim();for(const n of e.nonCriticalExtensionOptions)a.Any.encode(n,t.uint32(16378).fork()).ldelim();return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},h);for(o.messages=[],o.extensionOptions=[],o.nonCriticalExtensionOptions=[];n.pos>>3){case 1:o.messages.push(a.Any.decode(n,n.uint32()));break;case 2:o.memo=n.string();break;case 3:o.timeoutHeight=n.uint64();break;case 1023:o.extensionOptions.push(a.Any.decode(n,n.uint32()));break;case 2047:o.nonCriticalExtensionOptions.push(a.Any.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o},fromJSON(e){var t,n,r;const i=Object.assign({},h);return i.messages=(null!==(t=e.messages)&&void 0!==t?t:[]).map(e=>a.Any.fromJSON(e)),i.memo=void 0!==e.memo&&null!==e.memo?String(e.memo):"",i.timeoutHeight=void 0!==e.timeoutHeight&&null!==e.timeoutHeight?o.default.fromString(e.timeoutHeight):o.default.UZERO,i.extensionOptions=(null!==(n=e.extensionOptions)&&void 0!==n?n:[]).map(e=>a.Any.fromJSON(e)),i.nonCriticalExtensionOptions=(null!==(r=e.nonCriticalExtensionOptions)&&void 0!==r?r:[]).map(e=>a.Any.fromJSON(e)),i},toJSON(e){const t={};return e.messages?t.messages=e.messages.map(e=>e?a.Any.toJSON(e):void 0):t.messages=[],void 0!==e.memo&&(t.memo=e.memo),void 0!==e.timeoutHeight&&(t.timeoutHeight=(e.timeoutHeight||o.default.UZERO).toString()),e.extensionOptions?t.extensionOptions=e.extensionOptions.map(e=>e?a.Any.toJSON(e):void 0):t.extensionOptions=[],e.nonCriticalExtensionOptions?t.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions.map(e=>e?a.Any.toJSON(e):void 0):t.nonCriticalExtensionOptions=[],t},fromPartial(e){var t,n,r,i;const s=Object.assign({},h);return s.messages=(null===(t=e.messages)||void 0===t?void 0:t.map(e=>a.Any.fromPartial(e)))||[],s.memo=null!==(n=e.memo)&&void 0!==n?n:"",s.timeoutHeight=void 0!==e.timeoutHeight&&null!==e.timeoutHeight?o.default.fromValue(e.timeoutHeight):o.default.UZERO,s.extensionOptions=(null===(r=e.extensionOptions)||void 0===r?void 0:r.map(e=>a.Any.fromPartial(e)))||[],s.nonCriticalExtensionOptions=(null===(i=e.nonCriticalExtensionOptions)||void 0===i?void 0:i.map(e=>a.Any.fromPartial(e)))||[],s}};const p={};t.AuthInfo={encode(e,n=i.default.Writer.create()){for(const r of e.signerInfos)t.SignerInfo.encode(r,n.uint32(10).fork()).ldelim();return void 0!==e.fee&&t.Fee.encode(e.fee,n.uint32(18).fork()).ldelim(),n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},p);for(a.signerInfos=[];r.pos>>3){case 1:a.signerInfos.push(t.SignerInfo.decode(r,r.uint32()));break;case 2:a.fee=t.Fee.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},p);return r.signerInfos=(null!==(n=e.signerInfos)&&void 0!==n?n:[]).map(e=>t.SignerInfo.fromJSON(e)),r.fee=void 0!==e.fee&&null!==e.fee?t.Fee.fromJSON(e.fee):void 0,r},toJSON(e){const n={};return e.signerInfos?n.signerInfos=e.signerInfos.map(e=>e?t.SignerInfo.toJSON(e):void 0):n.signerInfos=[],void 0!==e.fee&&(n.fee=e.fee?t.Fee.toJSON(e.fee):void 0),n},fromPartial(e){var n;const r=Object.assign({},p);return r.signerInfos=(null===(n=e.signerInfos)||void 0===n?void 0:n.map(e=>t.SignerInfo.fromPartial(e)))||[],r.fee=void 0!==e.fee&&null!==e.fee?t.Fee.fromPartial(e.fee):void 0,r}};const A={sequence:o.default.UZERO};t.SignerInfo={encode:(e,n=i.default.Writer.create())=>(void 0!==e.publicKey&&a.Any.encode(e.publicKey,n.uint32(10).fork()).ldelim(),void 0!==e.modeInfo&&t.ModeInfo.encode(e.modeInfo,n.uint32(18).fork()).ldelim(),e.sequence.isZero()||n.uint32(24).uint64(e.sequence),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const s=Object.assign({},A);for(;r.pos>>3){case 1:s.publicKey=a.Any.decode(r,r.uint32());break;case 2:s.modeInfo=t.ModeInfo.decode(r,r.uint32());break;case 3:s.sequence=r.uint64();break;default:r.skipType(7&e)}}return s},fromJSON(e){const n=Object.assign({},A);return n.publicKey=void 0!==e.publicKey&&null!==e.publicKey?a.Any.fromJSON(e.publicKey):void 0,n.modeInfo=void 0!==e.modeInfo&&null!==e.modeInfo?t.ModeInfo.fromJSON(e.modeInfo):void 0,n.sequence=void 0!==e.sequence&&null!==e.sequence?o.default.fromString(e.sequence):o.default.UZERO,n},toJSON(e){const n={};return void 0!==e.publicKey&&(n.publicKey=e.publicKey?a.Any.toJSON(e.publicKey):void 0),void 0!==e.modeInfo&&(n.modeInfo=e.modeInfo?t.ModeInfo.toJSON(e.modeInfo):void 0),void 0!==e.sequence&&(n.sequence=(e.sequence||o.default.UZERO).toString()),n},fromPartial(e){const n=Object.assign({},A);return n.publicKey=void 0!==e.publicKey&&null!==e.publicKey?a.Any.fromPartial(e.publicKey):void 0,n.modeInfo=void 0!==e.modeInfo&&null!==e.modeInfo?t.ModeInfo.fromPartial(e.modeInfo):void 0,n.sequence=void 0!==e.sequence&&null!==e.sequence?o.default.fromValue(e.sequence):o.default.UZERO,n}};const g={};t.ModeInfo={encode:(e,n=i.default.Writer.create())=>(void 0!==e.single&&t.ModeInfo_Single.encode(e.single,n.uint32(10).fork()).ldelim(),void 0!==e.multi&&t.ModeInfo_Multi.encode(e.multi,n.uint32(18).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},g);for(;r.pos>>3){case 1:a.single=t.ModeInfo_Single.decode(r,r.uint32());break;case 2:a.multi=t.ModeInfo_Multi.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},g);return n.single=void 0!==e.single&&null!==e.single?t.ModeInfo_Single.fromJSON(e.single):void 0,n.multi=void 0!==e.multi&&null!==e.multi?t.ModeInfo_Multi.fromJSON(e.multi):void 0,n},toJSON(e){const n={};return void 0!==e.single&&(n.single=e.single?t.ModeInfo_Single.toJSON(e.single):void 0),void 0!==e.multi&&(n.multi=e.multi?t.ModeInfo_Multi.toJSON(e.multi):void 0),n},fromPartial(e){const n=Object.assign({},g);return n.single=void 0!==e.single&&null!==e.single?t.ModeInfo_Single.fromPartial(e.single):void 0,n.multi=void 0!==e.multi&&null!==e.multi?t.ModeInfo_Multi.fromPartial(e.multi):void 0,n}};const m={mode:0};t.ModeInfo_Single={encode:(e,t=i.default.Writer.create())=>(0!==e.mode&&t.uint32(8).int32(e.mode),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},m);for(;n.pos>>3){case 1:o.mode=n.int32();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},m);return t.mode=void 0!==e.mode&&null!==e.mode?s.signModeFromJSON(e.mode):0,t},toJSON(e){const t={};return void 0!==e.mode&&(t.mode=s.signModeToJSON(e.mode)),t},fromPartial(e){var t;const n=Object.assign({},m);return n.mode=null!==(t=e.mode)&&void 0!==t?t:0,n}};const v={};t.ModeInfo_Multi={encode(e,n=i.default.Writer.create()){void 0!==e.bitarray&&c.CompactBitArray.encode(e.bitarray,n.uint32(10).fork()).ldelim();for(const r of e.modeInfos)t.ModeInfo.encode(r,n.uint32(18).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},v);for(a.modeInfos=[];r.pos>>3){case 1:a.bitarray=c.CompactBitArray.decode(r,r.uint32());break;case 2:a.modeInfos.push(t.ModeInfo.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},v);return r.bitarray=void 0!==e.bitarray&&null!==e.bitarray?c.CompactBitArray.fromJSON(e.bitarray):void 0,r.modeInfos=(null!==(n=e.modeInfos)&&void 0!==n?n:[]).map(e=>t.ModeInfo.fromJSON(e)),r},toJSON(e){const n={};return void 0!==e.bitarray&&(n.bitarray=e.bitarray?c.CompactBitArray.toJSON(e.bitarray):void 0),e.modeInfos?n.modeInfos=e.modeInfos.map(e=>e?t.ModeInfo.toJSON(e):void 0):n.modeInfos=[],n},fromPartial(e){var n;const r=Object.assign({},v);return r.bitarray=void 0!==e.bitarray&&null!==e.bitarray?c.CompactBitArray.fromPartial(e.bitarray):void 0,r.modeInfos=(null===(n=e.modeInfos)||void 0===n?void 0:n.map(e=>t.ModeInfo.fromPartial(e)))||[],r}};const y={gasLimit:o.default.UZERO,payer:"",granter:""};t.Fee={encode(e,t=i.default.Writer.create()){for(const n of e.amount)u.Coin.encode(n,t.uint32(10).fork()).ldelim();return e.gasLimit.isZero()||t.uint32(16).uint64(e.gasLimit),""!==e.payer&&t.uint32(26).string(e.payer),""!==e.granter&&t.uint32(34).string(e.granter),t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},y);for(o.amount=[];n.pos>>3){case 1:o.amount.push(u.Coin.decode(n,n.uint32()));break;case 2:o.gasLimit=n.uint64();break;case 3:o.payer=n.string();break;case 4:o.granter=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},y);return n.amount=(null!==(t=e.amount)&&void 0!==t?t:[]).map(e=>u.Coin.fromJSON(e)),n.gasLimit=void 0!==e.gasLimit&&null!==e.gasLimit?o.default.fromString(e.gasLimit):o.default.UZERO,n.payer=void 0!==e.payer&&null!==e.payer?String(e.payer):"",n.granter=void 0!==e.granter&&null!==e.granter?String(e.granter):"",n},toJSON(e){const t={};return e.amount?t.amount=e.amount.map(e=>e?u.Coin.toJSON(e):void 0):t.amount=[],void 0!==e.gasLimit&&(t.gasLimit=(e.gasLimit||o.default.UZERO).toString()),void 0!==e.payer&&(t.payer=e.payer),void 0!==e.granter&&(t.granter=e.granter),t},fromPartial(e){var t,n,r;const i=Object.assign({},y);return i.amount=(null===(t=e.amount)||void 0===t?void 0:t.map(e=>u.Coin.fromPartial(e)))||[],i.gasLimit=void 0!==e.gasLimit&&null!==e.gasLimit?o.default.fromValue(e.gasLimit):o.default.UZERO,i.payer=null!==(n=e.payer)&&void 0!==n?n:"",i.granter=null!==(r=e.granter)&&void 0!==r?r:"",i}};var b=(()=>{if(void 0!==b)return b;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw"Unable to locate global object"})();const I=b.atob||(e=>b.Buffer.from(e,"base64").toString("binary"));function w(e){const t=I(e),n=new Uint8Array(t.length);for(let e=0;eb.Buffer.from(e,"binary").toString("base64"));function _(e){const t=[];for(const n of e)t.push(String.fromCharCode(n));return E(t.join(""))}i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())}).call(this,n(3))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.executeKdf=t.makeStdTx=t.isStdTx=t.serializeSignDoc=t.makeSignDoc=t.encodeSecp256k1Signature=t.decodeSignature=t.Secp256k1Wallet=t.Secp256k1HdWallet=t.extractKdfConfiguration=t.pubkeyType=t.isSinglePubkey=t.isSecp256k1Pubkey=t.isMultisigThresholdPubkey=t.isEd25519Pubkey=t.makeCosmoshubPath=t.createMultisigThresholdPubkey=t.encodeSecp256k1Pubkey=t.encodeBech32Pubkey=t.encodeAminoPubkey=t.decodeBech32Pubkey=t.decodeAminoPubkey=t.parseCoins=t.coins=t.coin=t.addCoins=t.rawSecp256k1PubkeyToRawAddress=t.rawEd25519PubkeyToRawAddress=t.pubkeyToRawAddress=t.pubkeyToAddress=void 0;var r=n(67);Object.defineProperty(t,"pubkeyToAddress",{enumerable:!0,get:function(){return r.pubkeyToAddress}}),Object.defineProperty(t,"pubkeyToRawAddress",{enumerable:!0,get:function(){return r.pubkeyToRawAddress}}),Object.defineProperty(t,"rawEd25519PubkeyToRawAddress",{enumerable:!0,get:function(){return r.rawEd25519PubkeyToRawAddress}}),Object.defineProperty(t,"rawSecp256k1PubkeyToRawAddress",{enumerable:!0,get:function(){return r.rawSecp256k1PubkeyToRawAddress}});var o=n(462);Object.defineProperty(t,"addCoins",{enumerable:!0,get:function(){return o.addCoins}}),Object.defineProperty(t,"coin",{enumerable:!0,get:function(){return o.coin}}),Object.defineProperty(t,"coins",{enumerable:!0,get:function(){return o.coins}}),Object.defineProperty(t,"parseCoins",{enumerable:!0,get:function(){return o.parseCoins}});var i=n(102);Object.defineProperty(t,"decodeAminoPubkey",{enumerable:!0,get:function(){return i.decodeAminoPubkey}}),Object.defineProperty(t,"decodeBech32Pubkey",{enumerable:!0,get:function(){return i.decodeBech32Pubkey}}),Object.defineProperty(t,"encodeAminoPubkey",{enumerable:!0,get:function(){return i.encodeAminoPubkey}}),Object.defineProperty(t,"encodeBech32Pubkey",{enumerable:!0,get:function(){return i.encodeBech32Pubkey}}),Object.defineProperty(t,"encodeSecp256k1Pubkey",{enumerable:!0,get:function(){return i.encodeSecp256k1Pubkey}});var a=n(463);Object.defineProperty(t,"createMultisigThresholdPubkey",{enumerable:!0,get:function(){return a.createMultisigThresholdPubkey}});var s=n(202);Object.defineProperty(t,"makeCosmoshubPath",{enumerable:!0,get:function(){return s.makeCosmoshubPath}});var c=n(69);Object.defineProperty(t,"isEd25519Pubkey",{enumerable:!0,get:function(){return c.isEd25519Pubkey}}),Object.defineProperty(t,"isMultisigThresholdPubkey",{enumerable:!0,get:function(){return c.isMultisigThresholdPubkey}}),Object.defineProperty(t,"isSecp256k1Pubkey",{enumerable:!0,get:function(){return c.isSecp256k1Pubkey}}),Object.defineProperty(t,"isSinglePubkey",{enumerable:!0,get:function(){return c.isSinglePubkey}}),Object.defineProperty(t,"pubkeyType",{enumerable:!0,get:function(){return c.pubkeyType}});var u=n(464);Object.defineProperty(t,"extractKdfConfiguration",{enumerable:!0,get:function(){return u.extractKdfConfiguration}}),Object.defineProperty(t,"Secp256k1HdWallet",{enumerable:!0,get:function(){return u.Secp256k1HdWallet}});var d=n(465);Object.defineProperty(t,"Secp256k1Wallet",{enumerable:!0,get:function(){return d.Secp256k1Wallet}});var l=n(103);Object.defineProperty(t,"decodeSignature",{enumerable:!0,get:function(){return l.decodeSignature}}),Object.defineProperty(t,"encodeSecp256k1Signature",{enumerable:!0,get:function(){return l.encodeSecp256k1Signature}});var f=n(104);Object.defineProperty(t,"makeSignDoc",{enumerable:!0,get:function(){return f.makeSignDoc}}),Object.defineProperty(t,"serializeSignDoc",{enumerable:!0,get:function(){return f.serializeSignDoc}});var h=n(466);Object.defineProperty(t,"isStdTx",{enumerable:!0,get:function(){return h.isStdTx}}),Object.defineProperty(t,"makeStdTx",{enumerable:!0,get:function(){return h.makeStdTx}});var p=n(203);Object.defineProperty(t,"executeKdf",{enumerable:!0,get:function(){return p.executeKdf}})},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Timestamp=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1));t.protobufPackage="google.protobuf";const a={seconds:o.default.ZERO,nanos:0};t.Timestamp={encode:(e,t=i.default.Writer.create())=>(e.seconds.isZero()||t.uint32(8).int64(e.seconds),0!==e.nanos&&t.uint32(16).int32(e.nanos),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},a);for(;n.pos>>3){case 1:o.seconds=n.int64();break;case 2:o.nanos=n.int32();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},a);return t.seconds=void 0!==e.seconds&&null!==e.seconds?o.default.fromString(e.seconds):o.default.ZERO,t.nanos=void 0!==e.nanos&&null!==e.nanos?Number(e.nanos):0,t},toJSON(e){const t={};return void 0!==e.seconds&&(t.seconds=(e.seconds||o.default.ZERO).toString()),void 0!==e.nanos&&(t.nanos=e.nanos),t},fromPartial(e){var t;const n=Object.assign({},a);return n.seconds=void 0!==e.seconds&&null!==e.seconds?o.default.fromValue(e.seconds):o.default.ZERO,n.nanos=null!==(t=e.nanos)&&void 0!==t?t:0,n}},i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Params=t.Height=t.ClientUpdateProposal=t.ClientConsensusStates=t.ConsensusStateWithHeight=t.IdentifiedClientState=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(9);t.protobufPackage="ibc.core.client.v1";const s={clientId:""};t.IdentifiedClientState={encode:(e,t=i.default.Writer.create())=>(""!==e.clientId&&t.uint32(10).string(e.clientId),void 0!==e.clientState&&a.Any.encode(e.clientState,t.uint32(18).fork()).ldelim(),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},s);for(;n.pos>>3){case 1:o.clientId=n.string();break;case 2:o.clientState=a.Any.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},s);return t.clientId=void 0!==e.clientId&&null!==e.clientId?String(e.clientId):"",t.clientState=void 0!==e.clientState&&null!==e.clientState?a.Any.fromJSON(e.clientState):void 0,t},toJSON(e){const t={};return void 0!==e.clientId&&(t.clientId=e.clientId),void 0!==e.clientState&&(t.clientState=e.clientState?a.Any.toJSON(e.clientState):void 0),t},fromPartial(e){var t;const n=Object.assign({},s);return n.clientId=null!==(t=e.clientId)&&void 0!==t?t:"",n.clientState=void 0!==e.clientState&&null!==e.clientState?a.Any.fromPartial(e.clientState):void 0,n}};const c={};t.ConsensusStateWithHeight={encode:(e,n=i.default.Writer.create())=>(void 0!==e.height&&t.Height.encode(e.height,n.uint32(10).fork()).ldelim(),void 0!==e.consensusState&&a.Any.encode(e.consensusState,n.uint32(18).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const s=Object.assign({},c);for(;r.pos>>3){case 1:s.height=t.Height.decode(r,r.uint32());break;case 2:s.consensusState=a.Any.decode(r,r.uint32());break;default:r.skipType(7&e)}}return s},fromJSON(e){const n=Object.assign({},c);return n.height=void 0!==e.height&&null!==e.height?t.Height.fromJSON(e.height):void 0,n.consensusState=void 0!==e.consensusState&&null!==e.consensusState?a.Any.fromJSON(e.consensusState):void 0,n},toJSON(e){const n={};return void 0!==e.height&&(n.height=e.height?t.Height.toJSON(e.height):void 0),void 0!==e.consensusState&&(n.consensusState=e.consensusState?a.Any.toJSON(e.consensusState):void 0),n},fromPartial(e){const n=Object.assign({},c);return n.height=void 0!==e.height&&null!==e.height?t.Height.fromPartial(e.height):void 0,n.consensusState=void 0!==e.consensusState&&null!==e.consensusState?a.Any.fromPartial(e.consensusState):void 0,n}};const u={clientId:""};t.ClientConsensusStates={encode(e,n=i.default.Writer.create()){""!==e.clientId&&n.uint32(10).string(e.clientId);for(const r of e.consensusStates)t.ConsensusStateWithHeight.encode(r,n.uint32(18).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},u);for(a.consensusStates=[];r.pos>>3){case 1:a.clientId=r.string();break;case 2:a.consensusStates.push(t.ConsensusStateWithHeight.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},u);return r.clientId=void 0!==e.clientId&&null!==e.clientId?String(e.clientId):"",r.consensusStates=(null!==(n=e.consensusStates)&&void 0!==n?n:[]).map(e=>t.ConsensusStateWithHeight.fromJSON(e)),r},toJSON(e){const n={};return void 0!==e.clientId&&(n.clientId=e.clientId),e.consensusStates?n.consensusStates=e.consensusStates.map(e=>e?t.ConsensusStateWithHeight.toJSON(e):void 0):n.consensusStates=[],n},fromPartial(e){var n,r;const o=Object.assign({},u);return o.clientId=null!==(n=e.clientId)&&void 0!==n?n:"",o.consensusStates=(null===(r=e.consensusStates)||void 0===r?void 0:r.map(e=>t.ConsensusStateWithHeight.fromPartial(e)))||[],o}};const d={title:"",description:"",clientId:""};t.ClientUpdateProposal={encode:(e,t=i.default.Writer.create())=>(""!==e.title&&t.uint32(10).string(e.title),""!==e.description&&t.uint32(18).string(e.description),""!==e.clientId&&t.uint32(26).string(e.clientId),void 0!==e.header&&a.Any.encode(e.header,t.uint32(34).fork()).ldelim(),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},d);for(;n.pos>>3){case 1:o.title=n.string();break;case 2:o.description=n.string();break;case 3:o.clientId=n.string();break;case 4:o.header=a.Any.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},d);return t.title=void 0!==e.title&&null!==e.title?String(e.title):"",t.description=void 0!==e.description&&null!==e.description?String(e.description):"",t.clientId=void 0!==e.clientId&&null!==e.clientId?String(e.clientId):"",t.header=void 0!==e.header&&null!==e.header?a.Any.fromJSON(e.header):void 0,t},toJSON(e){const t={};return void 0!==e.title&&(t.title=e.title),void 0!==e.description&&(t.description=e.description),void 0!==e.clientId&&(t.clientId=e.clientId),void 0!==e.header&&(t.header=e.header?a.Any.toJSON(e.header):void 0),t},fromPartial(e){var t,n,r;const o=Object.assign({},d);return o.title=null!==(t=e.title)&&void 0!==t?t:"",o.description=null!==(n=e.description)&&void 0!==n?n:"",o.clientId=null!==(r=e.clientId)&&void 0!==r?r:"",o.header=void 0!==e.header&&null!==e.header?a.Any.fromPartial(e.header):void 0,o}};const l={revisionNumber:o.default.UZERO,revisionHeight:o.default.UZERO};t.Height={encode:(e,t=i.default.Writer.create())=>(e.revisionNumber.isZero()||t.uint32(8).uint64(e.revisionNumber),e.revisionHeight.isZero()||t.uint32(16).uint64(e.revisionHeight),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},l);for(;n.pos>>3){case 1:o.revisionNumber=n.uint64();break;case 2:o.revisionHeight=n.uint64();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},l);return t.revisionNumber=void 0!==e.revisionNumber&&null!==e.revisionNumber?o.default.fromString(e.revisionNumber):o.default.UZERO,t.revisionHeight=void 0!==e.revisionHeight&&null!==e.revisionHeight?o.default.fromString(e.revisionHeight):o.default.UZERO,t},toJSON(e){const t={};return void 0!==e.revisionNumber&&(t.revisionNumber=(e.revisionNumber||o.default.UZERO).toString()),void 0!==e.revisionHeight&&(t.revisionHeight=(e.revisionHeight||o.default.UZERO).toString()),t},fromPartial(e){const t=Object.assign({},l);return t.revisionNumber=void 0!==e.revisionNumber&&null!==e.revisionNumber?o.default.fromValue(e.revisionNumber):o.default.UZERO,t.revisionHeight=void 0!==e.revisionHeight&&null!==e.revisionHeight?o.default.fromValue(e.revisionHeight):o.default.UZERO,t}};const f={allowedClients:""};t.Params={encode(e,t=i.default.Writer.create()){for(const n of e.allowedClients)t.uint32(10).string(n);return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},f);for(o.allowedClients=[];n.pos>>3){case 1:o.allowedClients.push(n.string());break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},f);return n.allowedClients=(null!==(t=e.allowedClients)&&void 0!==t?t:[]).map(e=>String(e)),n},toJSON(e){const t={};return e.allowedClients?t.allowedClients=e.allowedClients.map(e=>e):t.allowedClients=[],t},fromPartial(e){var t;const n=Object.assign({},f);return n.allowedClients=(null===(t=e.allowedClients)||void 0===t?void 0:t.map(e=>e))||[],n}},i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())},function(e,t,n){"use strict";var r,o="object"==typeof Reflect?Reflect:null,i=o&&"function"==typeof o.apply?o.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}m(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&m(e,"error",t,n)}(e,o,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function d(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var o,i,a,s;if(u(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=d(e))>0&&a.length>o&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,s=c,console&&console.warn&&console.warn(s)}return e}function f(){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 h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=f.bind(r);return o.listener=n,r.wrapFn=o,o}function p(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)i(c,this,t);else{var u=c.length,d=g(c,u);for(n=0;n=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):A.call(e,t)},s.prototype.listenerCount=A,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){"use strict";var r=n(4).Buffer,o=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=d,this.end=l,t=3;break;default:return this.write=f,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function d(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0)return o>0&&(e.lastNeed=o-1),o;if(--r=0)return o>0&&(e.lastNeed=o-2),o;if(--r=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";var r=n(58),o=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=l;var i=Object.create(n(47));i.inherits=n(2);var a=n(131),s=n(80);i.inherits(l,a);for(var c=o(s.prototype),u=0;u4294967295)throw new RangeError("requested too many random bytes");var n=o.allocUnsafe(e);if(e>0)if(e>65536)for(var a=0;a0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=o,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=i,r.ProtocolError=i("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;nnew Uint8Array(e.buffer,e.byteOffset,e.byteLength);t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");const o=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));t.bytesToHex=function(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let n=0;n{},t.asyncLoop=async function(e,n,r){let o=Date.now();for(let i=0;i=0&&ee instanceof Uint8Array))throw new Error("Uint8Array list expected");if(1===e.length)return e[0];const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);for(let t=0,r=0;te().update(a(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,n)=>e(n).update(a(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(r.crypto.web)return r.crypto.web.getRandomValues(new Uint8Array(e));if(r.crypto.node)return new Uint8Array(r.crypto.node.randomBytes(e).buffer);throw new Error("The environment doesn't have randomBytes function")}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.NO_IL=t.NO=t.MemoryStream=t.Stream=void 0;var i=n(484),a=n(486),s=i.default(a.getPolyfill()),c={};function u(){}function d(e){for(var t=e.length,n=Array(t),r=0;r=this.max&&t._n(e)},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),B=function(){function e(e,t){this.out=e,this.op=t}return e.prototype._n=function(){this.op.end()},e.prototype._e=function(e){this.out._e(e)},e.prototype._c=function(){this.op.end()},e}(),C=function(){function e(e,t){this.type="endWhen",this.ins=t,this.out=c,this.o=e,this.oil=f}return e.prototype._start=function(e){this.out=e,this.o._add(this.oil=new B(e,this)),this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.o._remove(this.oil),this.out=c,this.oil=f},e.prototype.end=function(){var e=this.out;e!==c&&e._c()},e.prototype._n=function(e){var t=this.out;t!==c&&t._n(e)},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){this.end()},e}(),k=function(){function e(e,t){this.type="filter",this.ins=t,this.out=c,this.f=e}return e.prototype._start=function(e){this.out=e,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c},e.prototype._n=function(e){var t=this.out;if(t!==c){var n=l(this,e,t);n!==c&&n&&t._n(e)}},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),S=function(){function e(e,t){this.out=e,this.op=t}return e.prototype._n=function(e){this.out._n(e)},e.prototype._e=function(e){this.out._e(e)},e.prototype._c=function(){this.op.inner=c,this.op.less()},e}(),O=function(){function e(e){this.type="flatten",this.ins=e,this.out=c,this.open=!0,this.inner=c,this.il=f}return e.prototype._start=function(e){this.out=e,this.open=!0,this.inner=c,this.il=f,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.inner!==c&&this.inner._remove(this.il),this.out=c,this.open=!0,this.inner=c,this.il=f},e.prototype.less=function(){var e=this.out;e!==c&&(this.open||this.inner!==c||e._c())},e.prototype._n=function(e){var t=this.out;if(t!==c){var n=this.inner,r=this.il;n!==c&&r!==f&&n._remove(r),(this.inner=e)._add(this.il=new S(t,this))}},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){this.open=!1,this.less()},e}(),Q=function(){function e(e,t,n){var r=this;this.type="fold",this.ins=n,this.out=c,this.f=function(t){return e(r.acc,t)},this.acc=this.seed=t}return e.prototype._start=function(e){this.out=e,this.acc=this.seed,e._n(this.acc),this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c,this.acc=this.seed},e.prototype._n=function(e){var t=this.out;if(t!==c){var n=l(this,e,t);n!==c&&t._n(this.acc=n)}},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),P=function(){function e(e){this.type="last",this.ins=e,this.out=c,this.has=!1,this.val=c}return e.prototype._start=function(e){this.out=e,this.has=!1,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c,this.val=c},e.prototype._n=function(e){this.has=!0,this.val=e},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&(this.has?(e._n(this.val),e._c()):e._e(new Error("last() failed because input stream completed")))},e}(),R=function(){function e(e,t){this.type="map",this.ins=t,this.out=c,this.f=e}return e.prototype._start=function(e){this.out=e,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c},e.prototype._n=function(e){var t=this.out;if(t!==c){var n=l(this,e,t);n!==c&&t._n(n)}},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),M=function(){function e(e){this.type="remember",this.ins=e,this.out=c}return e.prototype._start=function(e){this.out=e,this.ins._add(e)},e.prototype._stop=function(){this.ins._remove(this.out),this.out=c},e}(),x=function(){function e(e,t){this.type="replaceError",this.ins=t,this.out=c,this.f=e}return e.prototype._start=function(e){this.out=e,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c},e.prototype._n=function(e){var t=this.out;t!==c&&t._n(e)},e.prototype._e=function(e){var t=this.out;if(t!==c)try{this.ins._remove(this),(this.ins=this.f(e))._add(this)}catch(e){t._e(e)}},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),D=function(){function e(e,t){this.type="startWith",this.ins=e,this.out=c,this.val=t}return e.prototype._start=function(e){this.out=e,this.out._n(this.val),this.ins._add(e)},e.prototype._stop=function(){this.ins._remove(this.out),this.out=c},e}(),N=function(){function e(e,t){this.type="take",this.ins=t,this.out=c,this.max=e,this.taken=0}return e.prototype._start=function(e){this.out=e,this.taken=0,this.max<=0?e._c():this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c},e.prototype._n=function(e){var t=this.out;if(t!==c){var n=++this.taken;n1))if(this._stopID!==c)clearTimeout(this._stopID),this._stopID=c;else{var r=this._prod;r!==c&&r._start(this)}},e.prototype._remove=function(e){var t=this,n=this._target;if(n)return n._remove(e);var r=this._ils,o=r.indexOf(e);o>-1&&(r.splice(o,1),this._prod!==c&&r.length<=0?(this._err=c,this._stopID=setTimeout((function(){return t._stopNow()}))):1===r.length&&this._pruneCycles())},e.prototype._pruneCycles=function(){this._hasNoSinks(this,[])&&this._remove(this._ils[0])},e.prototype._hasNoSinks=function(e,t){if(-1!==t.indexOf(e))return!0;if(e.out===this)return!0;if(e.out&&e.out!==c)return this._hasNoSinks(e.out,t.concat(e));if(e._ils){for(var n=0,r=e._ils.length;n1)this._has&&e._n(this._v);else if(this._stopID!==c)this._has&&e._n(this._v),clearTimeout(this._stopID),this._stopID=c;else if(this._has)e._n(this._v);else{var r=this._prod;r!==c&&r._start(this)}},t.prototype._stopNow=function(){this._has=!1,e.prototype._stopNow.call(this)},t.prototype._x=function(){this._has=!1,e.prototype._x.call(this)},t.prototype.map=function(e){return this._map(e)},t.prototype.mapTo=function(t){return e.prototype.mapTo.call(this,t)},t.prototype.take=function(t){return e.prototype.take.call(this,t)},t.prototype.endWhen=function(t){return e.prototype.endWhen.call(this,t)},t.prototype.replaceError=function(t){return e.prototype.replaceError.call(this,t)},t.prototype.remember=function(){return this},t.prototype.debug=function(t){return e.prototype.debug.call(this,t)},t}(T);t.MemoryStream=j;var U=T;t.default=U},function(e,t,n){"use strict";var r=n(2),o=n(75),i=n(56),a=n(57),s=n(24);function c(e){s.call(this,"digest"),this._hash=e}r(c,s),c.prototype._update=function(e){this._hash.update(e)},c.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new o:"rmd160"===e||"ripemd160"===e?new i:new c(a(e))}},function(e,t,n){"use strict";var r={};function o(e,t,n){n||(n=Error);var o=function(e){var n,r;function o(n,r,o){return e.call(this,function(e,n,r){return"string"==typeof t?t:t(e,n,r)}(n,r,o))||this}return r=e,(n=o).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,o}(n);o.prototype.name=n.name,o.prototype.code=e,r[e]=o}function i(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return String(e)})),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}o("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),o("ERR_INVALID_ARG_TYPE",(function(e,t,n){var r,o,a,s;if("string"==typeof t&&(o="not ",t.substr(!a||a<0?0:+a,o.length)===o)?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))s="The ".concat(e," ").concat(r," ").concat(i(t,"type"));else{var c=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(c," ").concat(r," ").concat(i(t,"type"))}return s+=". Received type ".concat(typeof n)}),TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=r},function(e,t,n){"use strict";(function(t){var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=u;var o=n(123),i=n(127);n(2)(u,o);for(var a=r(i.prototype),s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,o=(n-r)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},o.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=o},function(e,t,n){"use strict";var r={};function o(e,t,n){n||(n=Error);var o=function(e){var n,r;function o(n,r,o){return e.call(this,function(e,n,r){return"string"==typeof t?t:t(e,n,r)}(n,r,o))||this}return r=e,(n=o).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,o}(n);o.prototype.name=n.name,o.prototype.code=e,r[e]=o}function i(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return String(e)})),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}o("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),o("ERR_INVALID_ARG_TYPE",(function(e,t,n){var r,o,a,s;if("string"==typeof t&&(o="not ",t.substr(!a||a<0?0:+a,o.length)===o)?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))s="The ".concat(e," ").concat(r," ").concat(i(t,"type"));else{var c=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(c," ").concat(r," ").concat(i(t,"type"))}return s+=". Received type ".concat(typeof n)}),TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=r},function(e,t,n){"use strict";(function(t){var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=u;var o=n(156),i=n(160);n(2)(u,o);for(var a=r(i.prototype),s=0;s=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-n,this.endian);for(var o=0;o>>24&255,r[o++]=e>>>16&255,r[o++]=e>>>8&255,r[o++]=255&e}else for(r[o++]=255&e,r[o++]=e>>>8&255,r[o++]=e>>>16&255,r[o++]=e>>>24&255,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,i=8;i>>3){case 1:a.signatures.push(t.SignatureDescriptor.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},l);return r.signatures=(null!==(n=e.signatures)&&void 0!==n?n:[]).map(e=>t.SignatureDescriptor.fromJSON(e)),r},toJSON(e){const n={};return e.signatures?n.signatures=e.signatures.map(e=>e?t.SignatureDescriptor.toJSON(e):void 0):n.signatures=[],n},fromPartial(e){var n;const r=Object.assign({},l);return r.signatures=(null===(n=e.signatures)||void 0===n?void 0:n.map(e=>t.SignatureDescriptor.fromPartial(e)))||[],r}};const f={sequence:o.default.UZERO};t.SignatureDescriptor={encode:(e,n=i.default.Writer.create())=>(void 0!==e.publicKey&&a.Any.encode(e.publicKey,n.uint32(10).fork()).ldelim(),void 0!==e.data&&t.SignatureDescriptor_Data.encode(e.data,n.uint32(18).fork()).ldelim(),e.sequence.isZero()||n.uint32(24).uint64(e.sequence),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const s=Object.assign({},f);for(;r.pos>>3){case 1:s.publicKey=a.Any.decode(r,r.uint32());break;case 2:s.data=t.SignatureDescriptor_Data.decode(r,r.uint32());break;case 3:s.sequence=r.uint64();break;default:r.skipType(7&e)}}return s},fromJSON(e){const n=Object.assign({},f);return n.publicKey=void 0!==e.publicKey&&null!==e.publicKey?a.Any.fromJSON(e.publicKey):void 0,n.data=void 0!==e.data&&null!==e.data?t.SignatureDescriptor_Data.fromJSON(e.data):void 0,n.sequence=void 0!==e.sequence&&null!==e.sequence?o.default.fromString(e.sequence):o.default.UZERO,n},toJSON(e){const n={};return void 0!==e.publicKey&&(n.publicKey=e.publicKey?a.Any.toJSON(e.publicKey):void 0),void 0!==e.data&&(n.data=e.data?t.SignatureDescriptor_Data.toJSON(e.data):void 0),void 0!==e.sequence&&(n.sequence=(e.sequence||o.default.UZERO).toString()),n},fromPartial(e){const n=Object.assign({},f);return n.publicKey=void 0!==e.publicKey&&null!==e.publicKey?a.Any.fromPartial(e.publicKey):void 0,n.data=void 0!==e.data&&null!==e.data?t.SignatureDescriptor_Data.fromPartial(e.data):void 0,n.sequence=void 0!==e.sequence&&null!==e.sequence?o.default.fromValue(e.sequence):o.default.UZERO,n}};const h={};t.SignatureDescriptor_Data={encode:(e,n=i.default.Writer.create())=>(void 0!==e.single&&t.SignatureDescriptor_Data_Single.encode(e.single,n.uint32(10).fork()).ldelim(),void 0!==e.multi&&t.SignatureDescriptor_Data_Multi.encode(e.multi,n.uint32(18).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},h);for(;r.pos>>3){case 1:a.single=t.SignatureDescriptor_Data_Single.decode(r,r.uint32());break;case 2:a.multi=t.SignatureDescriptor_Data_Multi.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},h);return n.single=void 0!==e.single&&null!==e.single?t.SignatureDescriptor_Data_Single.fromJSON(e.single):void 0,n.multi=void 0!==e.multi&&null!==e.multi?t.SignatureDescriptor_Data_Multi.fromJSON(e.multi):void 0,n},toJSON(e){const n={};return void 0!==e.single&&(n.single=e.single?t.SignatureDescriptor_Data_Single.toJSON(e.single):void 0),void 0!==e.multi&&(n.multi=e.multi?t.SignatureDescriptor_Data_Multi.toJSON(e.multi):void 0),n},fromPartial(e){const n=Object.assign({},h);return n.single=void 0!==e.single&&null!==e.single?t.SignatureDescriptor_Data_Single.fromPartial(e.single):void 0,n.multi=void 0!==e.multi&&null!==e.multi?t.SignatureDescriptor_Data_Multi.fromPartial(e.multi):void 0,n}};const p={mode:0};t.SignatureDescriptor_Data_Single={encode:(e,t=i.default.Writer.create())=>(0!==e.mode&&t.uint32(8).int32(e.mode),0!==e.signature.length&&t.uint32(18).bytes(e.signature),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},p);for(o.signature=new Uint8Array;n.pos>>3){case 1:o.mode=n.int32();break;case 2:o.signature=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},p);return t.mode=void 0!==e.mode&&null!==e.mode?u(e.mode):0,t.signature=void 0!==e.signature&&null!==e.signature?function(e){const t=m(e),n=new Uint8Array(t.length);for(let e=0;e>>3){case 1:a.bitarray=s.CompactBitArray.decode(r,r.uint32());break;case 2:a.signatures.push(t.SignatureDescriptor_Data.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},A);return r.bitarray=void 0!==e.bitarray&&null!==e.bitarray?s.CompactBitArray.fromJSON(e.bitarray):void 0,r.signatures=(null!==(n=e.signatures)&&void 0!==n?n:[]).map(e=>t.SignatureDescriptor_Data.fromJSON(e)),r},toJSON(e){const n={};return void 0!==e.bitarray&&(n.bitarray=e.bitarray?s.CompactBitArray.toJSON(e.bitarray):void 0),e.signatures?n.signatures=e.signatures.map(e=>e?t.SignatureDescriptor_Data.toJSON(e):void 0):n.signatures=[],n},fromPartial(e){var n;const r=Object.assign({},A);return r.bitarray=void 0!==e.bitarray&&null!==e.bitarray?s.CompactBitArray.fromPartial(e.bitarray):void 0,r.signatures=(null===(n=e.signatures)||void 0===n?void 0:n.map(e=>t.SignatureDescriptor_Data.fromPartial(e)))||[],r}};var g=(()=>{if(void 0!==g)return g;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw"Unable to locate global object"})();const m=g.atob||(e=>g.Buffer.from(e,"base64").toString("binary"));const v=g.btoa||(e=>g.Buffer.from(e,"binary").toString("base64"));i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())}).call(this,n(3))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stakingTypes=t.isMsgUndelegateEncodeObject=t.isMsgDelegateEncodeObject=t.isAminoMsgUndelegate=t.isAminoMsgEditValidator=t.isAminoMsgDelegate=t.isAminoMsgCreateValidator=t.isAminoMsgBeginRedelegate=t.createStakingAminoConverters=t.setupSlashingExtension=t.isAminoMsgUnjail=t.createSlashingAminoConverters=t.setupMintExtension=t.setupIbcExtension=t.isMsgTransferEncodeObject=t.ibcTypes=t.isAminoMsgTransfer=t.createIbcAminoConverters=t.setupGovExtension=t.isMsgVoteEncodeObject=t.isMsgSubmitProposalEncodeObject=t.isMsgDepositEncodeObject=t.govTypes=t.isAminoMsgVote=t.isAminoMsgSubmitProposal=t.isAminoMsgDeposit=t.createGovAminoConverters=t.feegrantTypes=t.createFreegrantAminoConverters=t.isAminoMsgSubmitEvidence=t.createEvidenceAminoConverters=t.setupDistributionExtension=t.isMsgWithdrawDelegatorRewardEncodeObject=t.distributionTypes=t.isAminoMsgWithdrawValidatorCommission=t.isAminoMsgWithdrawDelegatorReward=t.isAminoMsgSetWithdrawAddress=t.isAminoMsgFundCommunityPool=t.createDistributionAminoConverters=t.isAminoMsgVerifyInvariant=t.createCrysisAminoConverters=t.setupBankExtension=t.isMsgSendEncodeObject=t.bankTypes=t.isAminoMsgSend=t.isAminoMsgMultiSend=t.createBankAminoConverters=t.authzTypes=t.createAuthzAminoConverters=t.setupAuthExtension=void 0,t.vestingTypes=t.createVestingAminoConverters=t.setupTxExtension=t.setupStakingExtension=void 0;var r=n(476);Object.defineProperty(t,"setupAuthExtension",{enumerable:!0,get:function(){return r.setupAuthExtension}});var o=n(502);Object.defineProperty(t,"createAuthzAminoConverters",{enumerable:!0,get:function(){return o.createAuthzAminoConverters}});var i=n(503);Object.defineProperty(t,"authzTypes",{enumerable:!0,get:function(){return i.authzTypes}});var a=n(506);Object.defineProperty(t,"createBankAminoConverters",{enumerable:!0,get:function(){return a.createBankAminoConverters}}),Object.defineProperty(t,"isAminoMsgMultiSend",{enumerable:!0,get:function(){return a.isAminoMsgMultiSend}}),Object.defineProperty(t,"isAminoMsgSend",{enumerable:!0,get:function(){return a.isAminoMsgSend}});var s=n(507);Object.defineProperty(t,"bankTypes",{enumerable:!0,get:function(){return s.bankTypes}}),Object.defineProperty(t,"isMsgSendEncodeObject",{enumerable:!0,get:function(){return s.isMsgSendEncodeObject}});var c=n(508);Object.defineProperty(t,"setupBankExtension",{enumerable:!0,get:function(){return c.setupBankExtension}});var u=n(510);Object.defineProperty(t,"createCrysisAminoConverters",{enumerable:!0,get:function(){return u.createCrysisAminoConverters}}),Object.defineProperty(t,"isAminoMsgVerifyInvariant",{enumerable:!0,get:function(){return u.isAminoMsgVerifyInvariant}});var d=n(511);Object.defineProperty(t,"createDistributionAminoConverters",{enumerable:!0,get:function(){return d.createDistributionAminoConverters}}),Object.defineProperty(t,"isAminoMsgFundCommunityPool",{enumerable:!0,get:function(){return d.isAminoMsgFundCommunityPool}}),Object.defineProperty(t,"isAminoMsgSetWithdrawAddress",{enumerable:!0,get:function(){return d.isAminoMsgSetWithdrawAddress}}),Object.defineProperty(t,"isAminoMsgWithdrawDelegatorReward",{enumerable:!0,get:function(){return d.isAminoMsgWithdrawDelegatorReward}}),Object.defineProperty(t,"isAminoMsgWithdrawValidatorCommission",{enumerable:!0,get:function(){return d.isAminoMsgWithdrawValidatorCommission}});var l=n(512);Object.defineProperty(t,"distributionTypes",{enumerable:!0,get:function(){return l.distributionTypes}}),Object.defineProperty(t,"isMsgWithdrawDelegatorRewardEncodeObject",{enumerable:!0,get:function(){return l.isMsgWithdrawDelegatorRewardEncodeObject}});var f=n(513);Object.defineProperty(t,"setupDistributionExtension",{enumerable:!0,get:function(){return f.setupDistributionExtension}});var h=n(516);Object.defineProperty(t,"createEvidenceAminoConverters",{enumerable:!0,get:function(){return h.createEvidenceAminoConverters}}),Object.defineProperty(t,"isAminoMsgSubmitEvidence",{enumerable:!0,get:function(){return h.isAminoMsgSubmitEvidence}});var p=n(517);Object.defineProperty(t,"createFreegrantAminoConverters",{enumerable:!0,get:function(){return p.createFreegrantAminoConverters}});var A=n(518);Object.defineProperty(t,"feegrantTypes",{enumerable:!0,get:function(){return A.feegrantTypes}});var g=n(520);Object.defineProperty(t,"createGovAminoConverters",{enumerable:!0,get:function(){return g.createGovAminoConverters}}),Object.defineProperty(t,"isAminoMsgDeposit",{enumerable:!0,get:function(){return g.isAminoMsgDeposit}}),Object.defineProperty(t,"isAminoMsgSubmitProposal",{enumerable:!0,get:function(){return g.isAminoMsgSubmitProposal}}),Object.defineProperty(t,"isAminoMsgVote",{enumerable:!0,get:function(){return g.isAminoMsgVote}});var m=n(521);Object.defineProperty(t,"govTypes",{enumerable:!0,get:function(){return m.govTypes}}),Object.defineProperty(t,"isMsgDepositEncodeObject",{enumerable:!0,get:function(){return m.isMsgDepositEncodeObject}}),Object.defineProperty(t,"isMsgSubmitProposalEncodeObject",{enumerable:!0,get:function(){return m.isMsgSubmitProposalEncodeObject}}),Object.defineProperty(t,"isMsgVoteEncodeObject",{enumerable:!0,get:function(){return m.isMsgVoteEncodeObject}});var v=n(523);Object.defineProperty(t,"setupGovExtension",{enumerable:!0,get:function(){return v.setupGovExtension}});var y=n(525);Object.defineProperty(t,"createIbcAminoConverters",{enumerable:!0,get:function(){return y.createIbcAminoConverters}}),Object.defineProperty(t,"isAminoMsgTransfer",{enumerable:!0,get:function(){return y.isAminoMsgTransfer}});var b=n(526);Object.defineProperty(t,"ibcTypes",{enumerable:!0,get:function(){return b.ibcTypes}}),Object.defineProperty(t,"isMsgTransferEncodeObject",{enumerable:!0,get:function(){return b.isMsgTransferEncodeObject}});var I=n(530);Object.defineProperty(t,"setupIbcExtension",{enumerable:!0,get:function(){return I.setupIbcExtension}});var w=n(538);Object.defineProperty(t,"setupMintExtension",{enumerable:!0,get:function(){return w.setupMintExtension}});var E=n(541);Object.defineProperty(t,"createSlashingAminoConverters",{enumerable:!0,get:function(){return E.createSlashingAminoConverters}}),Object.defineProperty(t,"isAminoMsgUnjail",{enumerable:!0,get:function(){return E.isAminoMsgUnjail}});var _=n(542);Object.defineProperty(t,"setupSlashingExtension",{enumerable:!0,get:function(){return _.setupSlashingExtension}});var B=n(545);Object.defineProperty(t,"createStakingAminoConverters",{enumerable:!0,get:function(){return B.createStakingAminoConverters}}),Object.defineProperty(t,"isAminoMsgBeginRedelegate",{enumerable:!0,get:function(){return B.isAminoMsgBeginRedelegate}}),Object.defineProperty(t,"isAminoMsgCreateValidator",{enumerable:!0,get:function(){return B.isAminoMsgCreateValidator}}),Object.defineProperty(t,"isAminoMsgDelegate",{enumerable:!0,get:function(){return B.isAminoMsgDelegate}}),Object.defineProperty(t,"isAminoMsgEditValidator",{enumerable:!0,get:function(){return B.isAminoMsgEditValidator}}),Object.defineProperty(t,"isAminoMsgUndelegate",{enumerable:!0,get:function(){return B.isAminoMsgUndelegate}});var C=n(546);Object.defineProperty(t,"isMsgDelegateEncodeObject",{enumerable:!0,get:function(){return C.isMsgDelegateEncodeObject}}),Object.defineProperty(t,"isMsgUndelegateEncodeObject",{enumerable:!0,get:function(){return C.isMsgUndelegateEncodeObject}}),Object.defineProperty(t,"stakingTypes",{enumerable:!0,get:function(){return C.stakingTypes}});var k=n(547);Object.defineProperty(t,"setupStakingExtension",{enumerable:!0,get:function(){return k.setupStakingExtension}});var S=n(549);Object.defineProperty(t,"setupTxExtension",{enumerable:!0,get:function(){return S.setupTxExtension}});var O=n(554);Object.defineProperty(t,"createVestingAminoConverters",{enumerable:!0,get:function(){return O.createVestingAminoConverters}});var Q=n(555);Object.defineProperty(t,"vestingTypes",{enumerable:!0,get:function(){return Q.vestingTypes}})},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Duration=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1));t.protobufPackage="google.protobuf";const a={seconds:o.default.ZERO,nanos:0};t.Duration={encode:(e,t=i.default.Writer.create())=>(e.seconds.isZero()||t.uint32(8).int64(e.seconds),0!==e.nanos&&t.uint32(16).int32(e.nanos),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},a);for(;n.pos>>3){case 1:o.seconds=n.int64();break;case 2:o.nanos=n.int32();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},a);return t.seconds=void 0!==e.seconds&&null!==e.seconds?o.default.fromString(e.seconds):o.default.ZERO,t.nanos=void 0!==e.nanos&&null!==e.nanos?Number(e.nanos):0,t},toJSON(e){const t={};return void 0!==e.seconds&&(t.seconds=(e.seconds||o.default.ZERO).toString()),void 0!==e.nanos&&(t.nanos=e.nanos),t},fromPartial(e){var t;const n=Object.assign({},a);return n.seconds=void 0!==e.seconds&&null!==e.seconds?o.default.fromValue(e.seconds):o.default.ZERO,n.nanos=null!==(t=e.nanos)&&void 0!==t?t:0,n}},i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())},function(e,t,n){"use strict";var r=n(7).Buffer,o=n(2),i=n(122),a=new Array(16),s=[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],c=[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],u=[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],d=[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],l=[0,1518500249,1859775393,2400959708,2840853838],f=[1352829926,1548603684,1836072691,2053994217,0];function h(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<>>32-t}function A(e,t,n,r,o,i,a,s){return p(e+(t^n^r)+i+a|0,s)+o|0}function g(e,t,n,r,o,i,a,s){return p(e+(t&n|~t&r)+i+a|0,s)+o|0}function m(e,t,n,r,o,i,a,s){return p(e+((t|~n)^r)+i+a|0,s)+o|0}function v(e,t,n,r,o,i,a,s){return p(e+(t&r|n&~r)+i+a|0,s)+o|0}function y(e,t,n,r,o,i,a,s){return p(e+(t^(n|~r))+i+a|0,s)+o|0}o(h,i),h.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var n=0|this._a,r=0|this._b,o=0|this._c,i=0|this._d,h=0|this._e,b=0|this._a,I=0|this._b,w=0|this._c,E=0|this._d,_=0|this._e,B=0;B<80;B+=1){var C,k;B<16?(C=A(n,r,o,i,h,e[s[B]],l[0],u[B]),k=y(b,I,w,E,_,e[c[B]],f[0],d[B])):B<32?(C=g(n,r,o,i,h,e[s[B]],l[1],u[B]),k=v(b,I,w,E,_,e[c[B]],f[1],d[B])):B<48?(C=m(n,r,o,i,h,e[s[B]],l[2],u[B]),k=m(b,I,w,E,_,e[c[B]],f[2],d[B])):B<64?(C=v(n,r,o,i,h,e[s[B]],l[3],u[B]),k=g(b,I,w,E,_,e[c[B]],f[3],d[B])):(C=y(n,r,o,i,h,e[s[B]],l[4],u[B]),k=A(b,I,w,E,_,e[c[B]],f[4],d[B])),n=h,h=i,i=p(o,10),o=r,r=C,b=_,_=E,E=p(w,10),w=I,I=k}var S=this._b+o+E|0;this._b=this._c+i+_|0,this._c=this._d+h+b|0,this._d=this._e+n+I|0,this._e=this._a+r+w|0,this._a=S},h.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=r.alloc?r.alloc(20):new r(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=h},function(e,t,n){(t=e.exports=function(e){e=e.toLowerCase();var n=t[e];if(!n)throw new Error(e+" is not supported (we accept pull requests)");return new n}).sha=n(280),t.sha1=n(281),t.sha224=n(282),t.sha256=n(129),t.sha384=n(283),t.sha512=n(130)},function(e,t,n){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,r,o){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,n)}));case 3:return t.nextTick((function(){e.call(null,n,r)}));case 4:return t.nextTick((function(){e.call(null,n,r,o)}));default:for(i=new Array(s-1),a=0;a=0;r--){var o=e[r];"."===o?e.splice(r,1):".."===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r=-1&&!o;i--){var a=i>=0?arguments[i]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,o="/"===a.charAt(0))}return(o?"/":"")+(t=n(r(t.split("/"),(function(e){return!!e})),!o).join("/"))||"."},t.normalize=function(e){var i=t.isAbsolute(e),a="/"===o(e,-1);return(e=n(r(e.split("/"),(function(e){return!!e})),!i).join("/"))||i||(e="."),e&&a&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var o=r(e.split("/")),i=r(n.split("/")),a=Math.min(o.length,i.length),s=a,c=0;c=1;--i)if(47===(t=e.charCodeAt(i))){if(!o){r=i;break}}else o=!1;return-1===r?n?"/":".":n&&1===r?"/":e.slice(0,r)},t.basename=function(e,t){var n=function(e){"string"!=typeof e&&(e+="");var t,n=0,r=-1,o=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!o){n=t+1;break}}else-1===r&&(o=!1,r=t+1);return-1===r?"":e.slice(n,r)}(e);return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,n=0,r=-1,o=!0,i=0,a=e.length-1;a>=0;--a){var s=e.charCodeAt(a);if(47!==s)-1===r&&(o=!1,r=a+1),46===s?-1===t?t=a:1!==i&&(i=1):-1!==t&&(i=-1);else if(!o){n=a+1;break}}return-1===t||-1===r||0===i||1===i&&t===r-1&&t===n+1?"":e.slice(t,r)};var o="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(this,n(6))},function(e,t,n){var r=n(4).Buffer;function o(e){r.isBuffer(e)||(e=r.from(e));for(var t=e.length/4|0,n=new Array(t),o=0;o>>24]^d[p>>>16&255]^l[A>>>8&255]^f[255&g]^t[m++],a=u[p>>>24]^d[A>>>16&255]^l[g>>>8&255]^f[255&h]^t[m++],s=u[A>>>24]^d[g>>>16&255]^l[h>>>8&255]^f[255&p]^t[m++],c=u[g>>>24]^d[h>>>16&255]^l[p>>>8&255]^f[255&A]^t[m++],h=i,p=a,A=s,g=c;return i=(r[h>>>24]<<24|r[p>>>16&255]<<16|r[A>>>8&255]<<8|r[255&g])^t[m++],a=(r[p>>>24]<<24|r[A>>>16&255]<<16|r[g>>>8&255]<<8|r[255&h])^t[m++],s=(r[A>>>24]<<24|r[g>>>16&255]<<16|r[h>>>8&255]<<8|r[255&p])^t[m++],c=(r[g>>>24]<<24|r[h>>>16&255]<<16|r[p>>>8&255]<<8|r[255&A])^t[m++],[i>>>=0,a>>>=0,s>>>=0,c>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var n=[],r=[],o=[[],[],[],[]],i=[[],[],[],[]],a=0,s=0,c=0;c<256;++c){var u=s^s<<1^s<<2^s<<3^s<<4;u=u>>>8^255&u^99,n[a]=u,r[u]=a;var d=e[a],l=e[d],f=e[l],h=257*e[u]^16843008*u;o[0][a]=h<<24|h>>>8,o[1][a]=h<<16|h>>>16,o[2][a]=h<<8|h>>>24,o[3][a]=h,h=16843009*f^65537*l^257*d^16843008*a,i[0][u]=h<<24|h>>>8,i[1][u]=h<<16|h>>>16,i[2][u]=h<<8|h>>>24,i[3][u]=h,0===a?a=s=1:(a=d^e[e[e[f^d]]],s^=e[e[s]])}return{SBOX:n,INV_SBOX:r,SUB_MIX:o,INV_SUB_MIX:i}}();function u(e){this._key=o(e),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var e=this._key,t=e.length,n=t+6,r=4*(n+1),o=[],i=0;i>>24,a=c.SBOX[a>>>24]<<24|c.SBOX[a>>>16&255]<<16|c.SBOX[a>>>8&255]<<8|c.SBOX[255&a],a^=s[i/t|0]<<24):t>6&&i%t==4&&(a=c.SBOX[a>>>24]<<24|c.SBOX[a>>>16&255]<<16|c.SBOX[a>>>8&255]<<8|c.SBOX[255&a]),o[i]=o[i-t]^a}for(var u=[],d=0;d>>24]]^c.INV_SUB_MIX[1][c.SBOX[f>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[f>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&f]]}this._nRounds=n,this._keySchedule=o,this._invKeySchedule=u},u.prototype.encryptBlockRaw=function(e){return a(e=o(e),this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},u.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),n=r.allocUnsafe(16);return n.writeUInt32BE(t[0],0),n.writeUInt32BE(t[1],4),n.writeUInt32BE(t[2],8),n.writeUInt32BE(t[3],12),n},u.prototype.decryptBlock=function(e){var t=(e=o(e))[1];e[1]=e[3],e[3]=t;var n=a(e,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),i=r.allocUnsafe(16);return i.writeUInt32BE(n[0],0),i.writeUInt32BE(n[3],4),i.writeUInt32BE(n[2],8),i.writeUInt32BE(n[1],12),i},u.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},e.exports.AES=u},function(e,t,n){var r=n(4).Buffer,o=n(75);e.exports=function(e,t,n,i){if(r.isBuffer(e)||(e=r.from(e,"binary")),t&&(r.isBuffer(t)||(t=r.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=n/8,s=r.alloc(a),c=r.alloc(i||0),u=r.alloc(0);a>0||i>0;){var d=new o;d.update(u),d.update(e),t&&d.update(t),u=d.digest();var l=0;if(a>0){var f=s.length-a;l=Math.min(a,u.length),u.copy(s,f,0,l),a-=l}if(l0){var h=c.length-i,p=Math.min(i,u.length-l);u.copy(c,h,l,l+p),i-=p}}return u.fill(0),{key:s,iv:c}}},function(e,t,n){"use strict";var r=n(8),o=n(18),i=o.getNAF,a=o.getJSF,s=o.assert;function c(e,t){this.type=e,this.p=new r(t.p,16),this.red=t.prime?r.red(t.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=t.n&&new r(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){s(e.precomputed);var n=e._getDoubles(),r=i(t,1,this._bitLength),o=(1<=a;d--)c=(c<<1)+r[d];u.push(c)}for(var l=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=o;h>0;h--){for(a=0;a=0;u--){for(var d=0;u>=0&&0===a[u];u--)d++;if(u>=0&&d++,c=c.dblp(d),u<0)break;var l=a[u];s(0!==l),c="affine"===e.type?l>0?c.mixedAdd(o[l-1>>1]):c.mixedAdd(o[-l-1>>1].neg()):l>0?c.add(o[l-1>>1]):c.add(o[-l-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,n,r,o){var s,c,u,d=this._wnafT1,l=this._wnafT2,f=this._wnafT3,h=0;for(s=0;s=1;s-=2){var A=s-1,g=s;if(1===d[A]&&1===d[g]){var m=[t[A],null,null,t[g]];0===t[A].y.cmp(t[g].y)?(m[1]=t[A].add(t[g]),m[2]=t[A].toJ().mixedAdd(t[g].neg())):0===t[A].y.cmp(t[g].y.redNeg())?(m[1]=t[A].toJ().mixedAdd(t[g]),m[2]=t[A].add(t[g].neg())):(m[1]=t[A].toJ().mixedAdd(t[g]),m[2]=t[A].toJ().mixedAdd(t[g].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],y=a(n[A],n[g]);for(h=Math.max(y[0].length,h),f[A]=new Array(h),f[g]=new Array(h),c=0;c=0;s--){for(var _=0;s>=0;){var B=!0;for(c=0;c=0&&_++,w=w.dblp(_),s<0)break;for(c=0;c0?u=l[c][C-1>>1]:C<0&&(u=l[c][-C-1>>1].neg()),w="affine"===u.type?w.mixedAdd(u):w.add(u))}}for(s=0;s=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,o=0;oObject.assign(Object.assign({},t),{[n]:i(e[n])}),{})}function a(e){return JSON.stringify(i(e))}t.sortedJsonStringify=a,t.makeSignDoc=function(e,t,n,r,i,a){return{chain_id:n,account_number:o.Uint53.fromString(i.toString()).toString(),sequence:o.Uint53.fromString(a.toString()).toString(),fee:t,msgs:e,memo:r}},t.serializeSignDoc=function(e){return r.toUtf8(a(e))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pubkeyToAddress=t.pubkeyToRawAddress=t.rawSecp256k1PubkeyToRawAddress=t.rawEd25519PubkeyToRawAddress=void 0;const r=n(20),o=n(5),i=n(102),a=n(69);function s(e){if(32!==e.length)throw new Error("Invalid Ed25519 pubkey length: "+e.length);return(0,r.sha256)(e).slice(0,20)}function c(e){if(33!==e.length)throw new Error("Invalid Secp256k1 pubkey length (compressed): "+e.length);return(0,r.ripemd160)((0,r.sha256)(e))}function u(e){if((0,a.isSecp256k1Pubkey)(e)){return c((0,o.fromBase64)(e.value))}if((0,a.isEd25519Pubkey)(e)){return s((0,o.fromBase64)(e.value))}if((0,a.isMultisigThresholdPubkey)(e)){const t=(0,i.encodeAminoPubkey)(e);return(0,r.sha256)(t).slice(0,20)}throw new Error("Unsupported public key type")}t.rawEd25519PubkeyToRawAddress=s,t.rawSecp256k1PubkeyToRawAddress=c,t.pubkeyToRawAddress=u,t.pubkeyToAddress=function(e,t){return(0,o.toBech32)(t,u(e))}},function(e,t,n){"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Wrong positive integer: "+e)}function o(e){if("boolean"!=typeof e)throw new Error("Expected boolean, not "+e)}function i(e,...t){if(!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function a(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function s(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function c(e,t){i(e);const n=t.outputLen;if(e.length>>3){case 1:r.key=e.bytes();break;case 2:r.value=e.bytes();break;case 3:r.leaf=d.ics23.LeafOp.decode(e,e.uint32());break;case 4:r.path&&r.path.length||(r.path=[]),r.path.push(d.ics23.InnerOp.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.key&&e.hasOwnProperty("key")&&!(e.key&&"number"==typeof e.key.length||u.isString(e.key)))return"key: buffer expected";if(null!=e.value&&e.hasOwnProperty("value")&&!(e.value&&"number"==typeof e.value.length||u.isString(e.value)))return"value: buffer expected";if(null!=e.leaf&&e.hasOwnProperty("leaf")&&(n=d.ics23.LeafOp.verify(e.leaf)))return"leaf."+n;if(null!=e.path&&e.hasOwnProperty("path")){if(!Array.isArray(e.path))return"path: array expected";for(var t=0;t>>3){case 1:r.key=e.bytes();break;case 2:r.left=d.ics23.ExistenceProof.decode(e,e.uint32());break;case 3:r.right=d.ics23.ExistenceProof.decode(e,e.uint32());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.key&&e.hasOwnProperty("key")&&!(e.key&&"number"==typeof e.key.length||u.isString(e.key))?"key: buffer expected":null!=e.left&&e.hasOwnProperty("left")&&(t=d.ics23.ExistenceProof.verify(e.left))?"left."+t:null!=e.right&&e.hasOwnProperty("right")&&(t=d.ics23.ExistenceProof.verify(e.right))?"right."+t:null;var t},e.fromObject=function(e){if(e instanceof d.ics23.NonExistenceProof)return e;var t=new d.ics23.NonExistenceProof;if(null!=e.key&&("string"==typeof e.key?u.base64.decode(e.key,t.key=u.newBuffer(u.base64.length(e.key)),0):e.key.length&&(t.key=e.key)),null!=e.left){if("object"!=typeof e.left)throw TypeError(".ics23.NonExistenceProof.left: object expected");t.left=d.ics23.ExistenceProof.fromObject(e.left)}if(null!=e.right){if("object"!=typeof e.right)throw TypeError(".ics23.NonExistenceProof.right: object expected");t.right=d.ics23.ExistenceProof.fromObject(e.right)}return t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(t.bytes===String?n.key="":(n.key=[],t.bytes!==Array&&(n.key=u.newBuffer(n.key))),n.left=null,n.right=null),null!=e.key&&e.hasOwnProperty("key")&&(n.key=t.bytes===String?u.base64.encode(e.key,0,e.key.length):t.bytes===Array?Array.prototype.slice.call(e.key):e.key),null!=e.left&&e.hasOwnProperty("left")&&(n.left=d.ics23.ExistenceProof.toObject(e.left,t)),null!=e.right&&e.hasOwnProperty("right")&&(n.right=d.ics23.ExistenceProof.toObject(e.right,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.CommitmentProof=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 1:r.exist=d.ics23.ExistenceProof.decode(e,e.uint32());break;case 2:r.nonexist=d.ics23.NonExistenceProof.decode(e,e.uint32());break;case 3:r.batch=d.ics23.BatchProof.decode(e,e.uint32());break;case 4:r.compressed=d.ics23.CompressedBatchProof.decode(e,e.uint32());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.exist&&e.hasOwnProperty("exist")&&(t.proof=1,n=d.ics23.ExistenceProof.verify(e.exist)))return"exist."+n;if(null!=e.nonexist&&e.hasOwnProperty("nonexist")){if(1===t.proof)return"proof: multiple values";if(t.proof=1,n=d.ics23.NonExistenceProof.verify(e.nonexist))return"nonexist."+n}if(null!=e.batch&&e.hasOwnProperty("batch")){if(1===t.proof)return"proof: multiple values";if(t.proof=1,n=d.ics23.BatchProof.verify(e.batch))return"batch."+n}if(null!=e.compressed&&e.hasOwnProperty("compressed")){if(1===t.proof)return"proof: multiple values";var n;if(t.proof=1,n=d.ics23.CompressedBatchProof.verify(e.compressed))return"compressed."+n}return null},e.fromObject=function(e){if(e instanceof d.ics23.CommitmentProof)return e;var t=new d.ics23.CommitmentProof;if(null!=e.exist){if("object"!=typeof e.exist)throw TypeError(".ics23.CommitmentProof.exist: object expected");t.exist=d.ics23.ExistenceProof.fromObject(e.exist)}if(null!=e.nonexist){if("object"!=typeof e.nonexist)throw TypeError(".ics23.CommitmentProof.nonexist: object expected");t.nonexist=d.ics23.NonExistenceProof.fromObject(e.nonexist)}if(null!=e.batch){if("object"!=typeof e.batch)throw TypeError(".ics23.CommitmentProof.batch: object expected");t.batch=d.ics23.BatchProof.fromObject(e.batch)}if(null!=e.compressed){if("object"!=typeof e.compressed)throw TypeError(".ics23.CommitmentProof.compressed: object expected");t.compressed=d.ics23.CompressedBatchProof.fromObject(e.compressed)}return t},e.toObject=function(e,t){t||(t={});var n={};return null!=e.exist&&e.hasOwnProperty("exist")&&(n.exist=d.ics23.ExistenceProof.toObject(e.exist,t),t.oneofs&&(n.proof="exist")),null!=e.nonexist&&e.hasOwnProperty("nonexist")&&(n.nonexist=d.ics23.NonExistenceProof.toObject(e.nonexist,t),t.oneofs&&(n.proof="nonexist")),null!=e.batch&&e.hasOwnProperty("batch")&&(n.batch=d.ics23.BatchProof.toObject(e.batch,t),t.oneofs&&(n.proof="batch")),null!=e.compressed&&e.hasOwnProperty("compressed")&&(n.compressed=d.ics23.CompressedBatchProof.toObject(e.compressed,t),t.oneofs&&(n.proof="compressed")),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.LeafOp=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 1:r.hash=e.int32();break;case 2:r.prehashKey=e.int32();break;case 3:r.prehashValue=e.int32();break;case 4:r.length=e.int32();break;case 5:r.prefix=e.bytes();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.hash&&e.hasOwnProperty("hash"))switch(e.hash){default:return"hash: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:}if(null!=e.prehashKey&&e.hasOwnProperty("prehashKey"))switch(e.prehashKey){default:return"prehashKey: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:}if(null!=e.prehashValue&&e.hasOwnProperty("prehashValue"))switch(e.prehashValue){default:return"prehashValue: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:}if(null!=e.length&&e.hasOwnProperty("length"))switch(e.length){default:return"length: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:}return null!=e.prefix&&e.hasOwnProperty("prefix")&&!(e.prefix&&"number"==typeof e.prefix.length||u.isString(e.prefix))?"prefix: buffer expected":null},e.fromObject=function(e){if(e instanceof d.ics23.LeafOp)return e;var t=new d.ics23.LeafOp;switch(e.hash){case"NO_HASH":case 0:t.hash=0;break;case"SHA256":case 1:t.hash=1;break;case"SHA512":case 2:t.hash=2;break;case"KECCAK":case 3:t.hash=3;break;case"RIPEMD160":case 4:t.hash=4;break;case"BITCOIN":case 5:t.hash=5;break;case"SHA512_256":case 6:t.hash=6}switch(e.prehashKey){case"NO_HASH":case 0:t.prehashKey=0;break;case"SHA256":case 1:t.prehashKey=1;break;case"SHA512":case 2:t.prehashKey=2;break;case"KECCAK":case 3:t.prehashKey=3;break;case"RIPEMD160":case 4:t.prehashKey=4;break;case"BITCOIN":case 5:t.prehashKey=5;break;case"SHA512_256":case 6:t.prehashKey=6}switch(e.prehashValue){case"NO_HASH":case 0:t.prehashValue=0;break;case"SHA256":case 1:t.prehashValue=1;break;case"SHA512":case 2:t.prehashValue=2;break;case"KECCAK":case 3:t.prehashValue=3;break;case"RIPEMD160":case 4:t.prehashValue=4;break;case"BITCOIN":case 5:t.prehashValue=5;break;case"SHA512_256":case 6:t.prehashValue=6}switch(e.length){case"NO_PREFIX":case 0:t.length=0;break;case"VAR_PROTO":case 1:t.length=1;break;case"VAR_RLP":case 2:t.length=2;break;case"FIXED32_BIG":case 3:t.length=3;break;case"FIXED32_LITTLE":case 4:t.length=4;break;case"FIXED64_BIG":case 5:t.length=5;break;case"FIXED64_LITTLE":case 6:t.length=6;break;case"REQUIRE_32_BYTES":case 7:t.length=7;break;case"REQUIRE_64_BYTES":case 8:t.length=8}return null!=e.prefix&&("string"==typeof e.prefix?u.base64.decode(e.prefix,t.prefix=u.newBuffer(u.base64.length(e.prefix)),0):e.prefix.length&&(t.prefix=e.prefix)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.hash=t.enums===String?"NO_HASH":0,n.prehashKey=t.enums===String?"NO_HASH":0,n.prehashValue=t.enums===String?"NO_HASH":0,n.length=t.enums===String?"NO_PREFIX":0,t.bytes===String?n.prefix="":(n.prefix=[],t.bytes!==Array&&(n.prefix=u.newBuffer(n.prefix)))),null!=e.hash&&e.hasOwnProperty("hash")&&(n.hash=t.enums===String?d.ics23.HashOp[e.hash]:e.hash),null!=e.prehashKey&&e.hasOwnProperty("prehashKey")&&(n.prehashKey=t.enums===String?d.ics23.HashOp[e.prehashKey]:e.prehashKey),null!=e.prehashValue&&e.hasOwnProperty("prehashValue")&&(n.prehashValue=t.enums===String?d.ics23.HashOp[e.prehashValue]:e.prehashValue),null!=e.length&&e.hasOwnProperty("length")&&(n.length=t.enums===String?d.ics23.LengthOp[e.length]:e.length),null!=e.prefix&&e.hasOwnProperty("prefix")&&(n.prefix=t.bytes===String?u.base64.encode(e.prefix,0,e.prefix.length):t.bytes===Array?Array.prototype.slice.call(e.prefix):e.prefix),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.InnerOp=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 1:r.hash=e.int32();break;case 2:r.prefix=e.bytes();break;case 3:r.suffix=e.bytes();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.hash&&e.hasOwnProperty("hash"))switch(e.hash){default:return"hash: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:}return null!=e.prefix&&e.hasOwnProperty("prefix")&&!(e.prefix&&"number"==typeof e.prefix.length||u.isString(e.prefix))?"prefix: buffer expected":null!=e.suffix&&e.hasOwnProperty("suffix")&&!(e.suffix&&"number"==typeof e.suffix.length||u.isString(e.suffix))?"suffix: buffer expected":null},e.fromObject=function(e){if(e instanceof d.ics23.InnerOp)return e;var t=new d.ics23.InnerOp;switch(e.hash){case"NO_HASH":case 0:t.hash=0;break;case"SHA256":case 1:t.hash=1;break;case"SHA512":case 2:t.hash=2;break;case"KECCAK":case 3:t.hash=3;break;case"RIPEMD160":case 4:t.hash=4;break;case"BITCOIN":case 5:t.hash=5;break;case"SHA512_256":case 6:t.hash=6}return null!=e.prefix&&("string"==typeof e.prefix?u.base64.decode(e.prefix,t.prefix=u.newBuffer(u.base64.length(e.prefix)),0):e.prefix.length&&(t.prefix=e.prefix)),null!=e.suffix&&("string"==typeof e.suffix?u.base64.decode(e.suffix,t.suffix=u.newBuffer(u.base64.length(e.suffix)),0):e.suffix.length&&(t.suffix=e.suffix)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.hash=t.enums===String?"NO_HASH":0,t.bytes===String?n.prefix="":(n.prefix=[],t.bytes!==Array&&(n.prefix=u.newBuffer(n.prefix))),t.bytes===String?n.suffix="":(n.suffix=[],t.bytes!==Array&&(n.suffix=u.newBuffer(n.suffix)))),null!=e.hash&&e.hasOwnProperty("hash")&&(n.hash=t.enums===String?d.ics23.HashOp[e.hash]:e.hash),null!=e.prefix&&e.hasOwnProperty("prefix")&&(n.prefix=t.bytes===String?u.base64.encode(e.prefix,0,e.prefix.length):t.bytes===Array?Array.prototype.slice.call(e.prefix):e.prefix),null!=e.suffix&&e.hasOwnProperty("suffix")&&(n.suffix=t.bytes===String?u.base64.encode(e.suffix,0,e.suffix.length):t.bytes===Array?Array.prototype.slice.call(e.suffix):e.suffix),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.ProofSpec=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 1:r.leafSpec=d.ics23.LeafOp.decode(e,e.uint32());break;case 2:r.innerSpec=d.ics23.InnerSpec.decode(e,e.uint32());break;case 3:r.maxDepth=e.int32();break;case 4:r.minDepth=e.int32();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.leafSpec&&e.hasOwnProperty("leafSpec")&&(t=d.ics23.LeafOp.verify(e.leafSpec))?"leafSpec."+t:null!=e.innerSpec&&e.hasOwnProperty("innerSpec")&&(t=d.ics23.InnerSpec.verify(e.innerSpec))?"innerSpec."+t:null!=e.maxDepth&&e.hasOwnProperty("maxDepth")&&!u.isInteger(e.maxDepth)?"maxDepth: integer expected":null!=e.minDepth&&e.hasOwnProperty("minDepth")&&!u.isInteger(e.minDepth)?"minDepth: integer expected":null;var t},e.fromObject=function(e){if(e instanceof d.ics23.ProofSpec)return e;var t=new d.ics23.ProofSpec;if(null!=e.leafSpec){if("object"!=typeof e.leafSpec)throw TypeError(".ics23.ProofSpec.leafSpec: object expected");t.leafSpec=d.ics23.LeafOp.fromObject(e.leafSpec)}if(null!=e.innerSpec){if("object"!=typeof e.innerSpec)throw TypeError(".ics23.ProofSpec.innerSpec: object expected");t.innerSpec=d.ics23.InnerSpec.fromObject(e.innerSpec)}return null!=e.maxDepth&&(t.maxDepth=0|e.maxDepth),null!=e.minDepth&&(t.minDepth=0|e.minDepth),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.leafSpec=null,n.innerSpec=null,n.maxDepth=0,n.minDepth=0),null!=e.leafSpec&&e.hasOwnProperty("leafSpec")&&(n.leafSpec=d.ics23.LeafOp.toObject(e.leafSpec,t)),null!=e.innerSpec&&e.hasOwnProperty("innerSpec")&&(n.innerSpec=d.ics23.InnerSpec.toObject(e.innerSpec,t)),null!=e.maxDepth&&e.hasOwnProperty("maxDepth")&&(n.maxDepth=e.maxDepth),null!=e.minDepth&&e.hasOwnProperty("minDepth")&&(n.minDepth=e.minDepth),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.InnerSpec=function(){function e(e){if(this.childOrder=[],e)for(var t=Object.keys(e),n=0;n>>3){case 1:if(r.childOrder&&r.childOrder.length||(r.childOrder=[]),2==(7&o))for(var i=e.uint32()+e.pos;e.pos>>3){case 1:r.entries&&r.entries.length||(r.entries=[]),r.entries.push(d.ics23.BatchEntry.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.entries&&e.hasOwnProperty("entries")){if(!Array.isArray(e.entries))return"entries: array expected";for(var t=0;t>>3){case 1:r.exist=d.ics23.ExistenceProof.decode(e,e.uint32());break;case 2:r.nonexist=d.ics23.NonExistenceProof.decode(e,e.uint32());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.exist&&e.hasOwnProperty("exist")&&(t.proof=1,n=d.ics23.ExistenceProof.verify(e.exist)))return"exist."+n;if(null!=e.nonexist&&e.hasOwnProperty("nonexist")){if(1===t.proof)return"proof: multiple values";var n;if(t.proof=1,n=d.ics23.NonExistenceProof.verify(e.nonexist))return"nonexist."+n}return null},e.fromObject=function(e){if(e instanceof d.ics23.BatchEntry)return e;var t=new d.ics23.BatchEntry;if(null!=e.exist){if("object"!=typeof e.exist)throw TypeError(".ics23.BatchEntry.exist: object expected");t.exist=d.ics23.ExistenceProof.fromObject(e.exist)}if(null!=e.nonexist){if("object"!=typeof e.nonexist)throw TypeError(".ics23.BatchEntry.nonexist: object expected");t.nonexist=d.ics23.NonExistenceProof.fromObject(e.nonexist)}return t},e.toObject=function(e,t){t||(t={});var n={};return null!=e.exist&&e.hasOwnProperty("exist")&&(n.exist=d.ics23.ExistenceProof.toObject(e.exist,t),t.oneofs&&(n.proof="exist")),null!=e.nonexist&&e.hasOwnProperty("nonexist")&&(n.nonexist=d.ics23.NonExistenceProof.toObject(e.nonexist,t),t.oneofs&&(n.proof="nonexist")),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.CompressedBatchProof=function(){function e(e){if(this.entries=[],this.lookupInners=[],e)for(var t=Object.keys(e),n=0;n>>3){case 1:r.entries&&r.entries.length||(r.entries=[]),r.entries.push(d.ics23.CompressedBatchEntry.decode(e,e.uint32()));break;case 2:r.lookupInners&&r.lookupInners.length||(r.lookupInners=[]),r.lookupInners.push(d.ics23.InnerOp.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.entries&&e.hasOwnProperty("entries")){if(!Array.isArray(e.entries))return"entries: array expected";for(var t=0;t>>3){case 1:r.exist=d.ics23.CompressedExistenceProof.decode(e,e.uint32());break;case 2:r.nonexist=d.ics23.CompressedNonExistenceProof.decode(e,e.uint32());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.exist&&e.hasOwnProperty("exist")&&(t.proof=1,n=d.ics23.CompressedExistenceProof.verify(e.exist)))return"exist."+n;if(null!=e.nonexist&&e.hasOwnProperty("nonexist")){if(1===t.proof)return"proof: multiple values";var n;if(t.proof=1,n=d.ics23.CompressedNonExistenceProof.verify(e.nonexist))return"nonexist."+n}return null},e.fromObject=function(e){if(e instanceof d.ics23.CompressedBatchEntry)return e;var t=new d.ics23.CompressedBatchEntry;if(null!=e.exist){if("object"!=typeof e.exist)throw TypeError(".ics23.CompressedBatchEntry.exist: object expected");t.exist=d.ics23.CompressedExistenceProof.fromObject(e.exist)}if(null!=e.nonexist){if("object"!=typeof e.nonexist)throw TypeError(".ics23.CompressedBatchEntry.nonexist: object expected");t.nonexist=d.ics23.CompressedNonExistenceProof.fromObject(e.nonexist)}return t},e.toObject=function(e,t){t||(t={});var n={};return null!=e.exist&&e.hasOwnProperty("exist")&&(n.exist=d.ics23.CompressedExistenceProof.toObject(e.exist,t),t.oneofs&&(n.proof="exist")),null!=e.nonexist&&e.hasOwnProperty("nonexist")&&(n.nonexist=d.ics23.CompressedNonExistenceProof.toObject(e.nonexist,t),t.oneofs&&(n.proof="nonexist")),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.CompressedExistenceProof=function(){function e(e){if(this.path=[],e)for(var t=Object.keys(e),n=0;n>>3){case 1:r.key=e.bytes();break;case 2:r.value=e.bytes();break;case 3:r.leaf=d.ics23.LeafOp.decode(e,e.uint32());break;case 4:if(r.path&&r.path.length||(r.path=[]),2==(7&o))for(var i=e.uint32()+e.pos;e.pos>>3){case 1:r.key=e.bytes();break;case 2:r.left=d.ics23.CompressedExistenceProof.decode(e,e.uint32());break;case 3:r.right=d.ics23.CompressedExistenceProof.decode(e,e.uint32());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.key&&e.hasOwnProperty("key")&&!(e.key&&"number"==typeof e.key.length||u.isString(e.key))?"key: buffer expected":null!=e.left&&e.hasOwnProperty("left")&&(t=d.ics23.CompressedExistenceProof.verify(e.left))?"left."+t:null!=e.right&&e.hasOwnProperty("right")&&(t=d.ics23.CompressedExistenceProof.verify(e.right))?"right."+t:null;var t},e.fromObject=function(e){if(e instanceof d.ics23.CompressedNonExistenceProof)return e;var t=new d.ics23.CompressedNonExistenceProof;if(null!=e.key&&("string"==typeof e.key?u.base64.decode(e.key,t.key=u.newBuffer(u.base64.length(e.key)),0):e.key.length&&(t.key=e.key)),null!=e.left){if("object"!=typeof e.left)throw TypeError(".ics23.CompressedNonExistenceProof.left: object expected");t.left=d.ics23.CompressedExistenceProof.fromObject(e.left)}if(null!=e.right){if("object"!=typeof e.right)throw TypeError(".ics23.CompressedNonExistenceProof.right: object expected");t.right=d.ics23.CompressedExistenceProof.fromObject(e.right)}return t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(t.bytes===String?n.key="":(n.key=[],t.bytes!==Array&&(n.key=u.newBuffer(n.key))),n.left=null,n.right=null),null!=e.key&&e.hasOwnProperty("key")&&(n.key=t.bytes===String?u.base64.encode(e.key,0,e.key.length):t.bytes===Array?Array.prototype.slice.call(e.key):e.key),null!=e.left&&e.hasOwnProperty("left")&&(n.left=d.ics23.CompressedExistenceProof.toObject(e.left,t)),null!=e.right&&e.hasOwnProperty("right")&&(n.right=d.ics23.CompressedExistenceProof.toObject(e.right,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i),e.exports=d},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.ValueAndUpdates=t.toListPromise=t.fromListPromise=t.firstEvent=t.dropDuplicates=t.DefaultValueProducer=t.concat=void 0;var i=n(483);Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return i.concat}});var a=n(496);Object.defineProperty(t,"DefaultValueProducer",{enumerable:!0,get:function(){return a.DefaultValueProducer}});var s=n(497);Object.defineProperty(t,"dropDuplicates",{enumerable:!0,get:function(){return s.dropDuplicates}});var c=n(498);Object.defineProperty(t,"firstEvent",{enumerable:!0,get:function(){return c.firstEvent}}),Object.defineProperty(t,"fromListPromise",{enumerable:!0,get:function(){return c.fromListPromise}}),Object.defineProperty(t,"toListPromise",{enumerable:!0,get:function(){return c.toListPromise}}),o(n(499),t);var u=n(500);Object.defineProperty(t,"ValueAndUpdates",{enumerable:!0,get:function(){return u.ValueAndUpdates}})},function(e,t,n){"use strict";n.r(t);const r=n(249);let o=[];!async function(){r.get("https://store-api.bitcanna.io").then((function(e){e.data.forEach((function(e){o.push(e)}))})).catch((function(e){console.log(e)}))}(),t.default=o},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Secp256k1HdWallet=t.extractKdfConfiguration=t.executeKdf=t.makeCosmoshubPath=t.pubkeyType=t.makeStdTx=t.isWrappedStdTx=t.isStdTx=t.SigningCosmosClient=t.decodeSignature=t.encodeSecp256k1Signature=t.findSequenceForSignedTx=t.encodeSecp256k1Pubkey=t.encodeBech32Pubkey=t.encodeAminoPubkey=t.decodeBech32Pubkey=t.decodeAminoPubkey=t.isMsgSend=t.isMsgDelegate=t.uint64ToString=t.uint64ToNumber=t.setupSupplyExtension=t.setupStakingExtension=t.setupSlashingExtension=t.setupMintExtension=t.setupGovExtension=t.setupDistributionExtension=t.setupBankExtension=t.setupAuthExtension=t.normalizePubkey=t.normalizeLcdApiArray=t.LcdClient=t.BroadcastMode=t.GasPrice=t.buildFeeTable=t.serializeSignDoc=t.makeSignDoc=t.isSearchByTagsQuery=t.isSearchBySentFromOrToQuery=t.isSearchByIdQuery=t.isSearchByHeightQuery=t.isBroadcastTxSuccess=t.isBroadcastTxFailure=t.CosmosClient=t.assertIsBroadcastTxSuccess=t.parseCoins=t.coins=t.coin=t.rawSecp256k1PubkeyToAddress=t.pubkeyToAddress=t.logs=void 0;const a=i(n(117));t.logs=a;var s=n(119);Object.defineProperty(t,"pubkeyToAddress",{enumerable:!0,get:function(){return s.pubkeyToAddress}}),Object.defineProperty(t,"rawSecp256k1PubkeyToAddress",{enumerable:!0,get:function(){return s.rawSecp256k1PubkeyToAddress}});var c=n(179);Object.defineProperty(t,"coin",{enumerable:!0,get:function(){return c.coin}}),Object.defineProperty(t,"coins",{enumerable:!0,get:function(){return c.coins}}),Object.defineProperty(t,"parseCoins",{enumerable:!0,get:function(){return c.parseCoins}});var u=n(180);Object.defineProperty(t,"assertIsBroadcastTxSuccess",{enumerable:!0,get:function(){return u.assertIsBroadcastTxSuccess}}),Object.defineProperty(t,"CosmosClient",{enumerable:!0,get:function(){return u.CosmosClient}}),Object.defineProperty(t,"isBroadcastTxFailure",{enumerable:!0,get:function(){return u.isBroadcastTxFailure}}),Object.defineProperty(t,"isBroadcastTxSuccess",{enumerable:!0,get:function(){return u.isBroadcastTxSuccess}}),Object.defineProperty(t,"isSearchByHeightQuery",{enumerable:!0,get:function(){return u.isSearchByHeightQuery}}),Object.defineProperty(t,"isSearchByIdQuery",{enumerable:!0,get:function(){return u.isSearchByIdQuery}}),Object.defineProperty(t,"isSearchBySentFromOrToQuery",{enumerable:!0,get:function(){return u.isSearchBySentFromOrToQuery}}),Object.defineProperty(t,"isSearchByTagsQuery",{enumerable:!0,get:function(){return u.isSearchByTagsQuery}});var d=n(66);Object.defineProperty(t,"makeSignDoc",{enumerable:!0,get:function(){return d.makeSignDoc}}),Object.defineProperty(t,"serializeSignDoc",{enumerable:!0,get:function(){return d.serializeSignDoc}});var l=n(190);Object.defineProperty(t,"buildFeeTable",{enumerable:!0,get:function(){return l.buildFeeTable}}),Object.defineProperty(t,"GasPrice",{enumerable:!0,get:function(){return l.GasPrice}});var f=n(93);Object.defineProperty(t,"BroadcastMode",{enumerable:!0,get:function(){return f.BroadcastMode}}),Object.defineProperty(t,"LcdClient",{enumerable:!0,get:function(){return f.LcdClient}}),Object.defineProperty(t,"normalizeLcdApiArray",{enumerable:!0,get:function(){return f.normalizeLcdApiArray}}),Object.defineProperty(t,"normalizePubkey",{enumerable:!0,get:function(){return f.normalizePubkey}}),Object.defineProperty(t,"setupAuthExtension",{enumerable:!0,get:function(){return f.setupAuthExtension}}),Object.defineProperty(t,"setupBankExtension",{enumerable:!0,get:function(){return f.setupBankExtension}}),Object.defineProperty(t,"setupDistributionExtension",{enumerable:!0,get:function(){return f.setupDistributionExtension}}),Object.defineProperty(t,"setupGovExtension",{enumerable:!0,get:function(){return f.setupGovExtension}}),Object.defineProperty(t,"setupMintExtension",{enumerable:!0,get:function(){return f.setupMintExtension}}),Object.defineProperty(t,"setupSlashingExtension",{enumerable:!0,get:function(){return f.setupSlashingExtension}}),Object.defineProperty(t,"setupStakingExtension",{enumerable:!0,get:function(){return f.setupStakingExtension}}),Object.defineProperty(t,"setupSupplyExtension",{enumerable:!0,get:function(){return f.setupSupplyExtension}}),Object.defineProperty(t,"uint64ToNumber",{enumerable:!0,get:function(){return f.uint64ToNumber}}),Object.defineProperty(t,"uint64ToString",{enumerable:!0,get:function(){return f.uint64ToString}});var h=n(415);Object.defineProperty(t,"isMsgDelegate",{enumerable:!0,get:function(){return h.isMsgDelegate}}),Object.defineProperty(t,"isMsgSend",{enumerable:!0,get:function(){return h.isMsgSend}});var p=n(95);Object.defineProperty(t,"decodeAminoPubkey",{enumerable:!0,get:function(){return p.decodeAminoPubkey}}),Object.defineProperty(t,"decodeBech32Pubkey",{enumerable:!0,get:function(){return p.decodeBech32Pubkey}}),Object.defineProperty(t,"encodeAminoPubkey",{enumerable:!0,get:function(){return p.encodeAminoPubkey}}),Object.defineProperty(t,"encodeBech32Pubkey",{enumerable:!0,get:function(){return p.encodeBech32Pubkey}}),Object.defineProperty(t,"encodeSecp256k1Pubkey",{enumerable:!0,get:function(){return p.encodeSecp256k1Pubkey}});var A=n(416);Object.defineProperty(t,"findSequenceForSignedTx",{enumerable:!0,get:function(){return A.findSequenceForSignedTx}});var g=n(96);Object.defineProperty(t,"encodeSecp256k1Signature",{enumerable:!0,get:function(){return g.encodeSecp256k1Signature}}),Object.defineProperty(t,"decodeSignature",{enumerable:!0,get:function(){return g.decodeSignature}});var m=n(417);Object.defineProperty(t,"SigningCosmosClient",{enumerable:!0,get:function(){return m.SigningCosmosClient}});var v=n(191);Object.defineProperty(t,"isStdTx",{enumerable:!0,get:function(){return v.isStdTx}}),Object.defineProperty(t,"isWrappedStdTx",{enumerable:!0,get:function(){return v.isWrappedStdTx}}),Object.defineProperty(t,"makeStdTx",{enumerable:!0,get:function(){return v.makeStdTx}});var y=n(65);Object.defineProperty(t,"pubkeyType",{enumerable:!0,get:function(){return y.pubkeyType}});var b=n(192);Object.defineProperty(t,"makeCosmoshubPath",{enumerable:!0,get:function(){return b.makeCosmoshubPath}}),Object.defineProperty(t,"executeKdf",{enumerable:!0,get:function(){return b.executeKdf}});var I=n(418);Object.defineProperty(t,"extractKdfConfiguration",{enumerable:!0,get:function(){return I.extractKdfConfiguration}}),Object.defineProperty(t,"Secp256k1HdWallet",{enumerable:!0,get:function(){return I.Secp256k1HdWallet}})},function(e,t,n){"use strict";t.byteLength=function(e){var t=u(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=u(e),a=r[0],s=r[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),d=0,l=s>0?a-4:a;for(n=0;n>16&255,c[d++]=t>>8&255,c[d++]=255&t;2===s&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,c[d++]=255&t);1===s&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,c[d++]=t>>8&255,c[d++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,s=n-o;as?s:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,c=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function d(e,t,n){for(var o,i,a=[],s=t;s>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t,n){"use strict";var r=n(2),o=n(122),i=n(4).Buffer,a=new Array(16);function s(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<>>32-t}function u(e,t,n,r,o,i,a){return c(e+(t&n|~t&r)+o+i|0,a)+t|0}function d(e,t,n,r,o,i,a){return c(e+(t&r|n&~r)+o+i|0,a)+t|0}function l(e,t,n,r,o,i,a){return c(e+(t^n^r)+o+i|0,a)+t|0}function f(e,t,n,r,o,i,a){return c(e+(n^(t|~r))+o+i|0,a)+t|0}r(s,o),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var n=this._a,r=this._b,o=this._c,i=this._d;n=u(n,r,o,i,e[0],3614090360,7),i=u(i,n,r,o,e[1],3905402710,12),o=u(o,i,n,r,e[2],606105819,17),r=u(r,o,i,n,e[3],3250441966,22),n=u(n,r,o,i,e[4],4118548399,7),i=u(i,n,r,o,e[5],1200080426,12),o=u(o,i,n,r,e[6],2821735955,17),r=u(r,o,i,n,e[7],4249261313,22),n=u(n,r,o,i,e[8],1770035416,7),i=u(i,n,r,o,e[9],2336552879,12),o=u(o,i,n,r,e[10],4294925233,17),r=u(r,o,i,n,e[11],2304563134,22),n=u(n,r,o,i,e[12],1804603682,7),i=u(i,n,r,o,e[13],4254626195,12),o=u(o,i,n,r,e[14],2792965006,17),n=d(n,r=u(r,o,i,n,e[15],1236535329,22),o,i,e[1],4129170786,5),i=d(i,n,r,o,e[6],3225465664,9),o=d(o,i,n,r,e[11],643717713,14),r=d(r,o,i,n,e[0],3921069994,20),n=d(n,r,o,i,e[5],3593408605,5),i=d(i,n,r,o,e[10],38016083,9),o=d(o,i,n,r,e[15],3634488961,14),r=d(r,o,i,n,e[4],3889429448,20),n=d(n,r,o,i,e[9],568446438,5),i=d(i,n,r,o,e[14],3275163606,9),o=d(o,i,n,r,e[3],4107603335,14),r=d(r,o,i,n,e[8],1163531501,20),n=d(n,r,o,i,e[13],2850285829,5),i=d(i,n,r,o,e[2],4243563512,9),o=d(o,i,n,r,e[7],1735328473,14),n=l(n,r=d(r,o,i,n,e[12],2368359562,20),o,i,e[5],4294588738,4),i=l(i,n,r,o,e[8],2272392833,11),o=l(o,i,n,r,e[11],1839030562,16),r=l(r,o,i,n,e[14],4259657740,23),n=l(n,r,o,i,e[1],2763975236,4),i=l(i,n,r,o,e[4],1272893353,11),o=l(o,i,n,r,e[7],4139469664,16),r=l(r,o,i,n,e[10],3200236656,23),n=l(n,r,o,i,e[13],681279174,4),i=l(i,n,r,o,e[0],3936430074,11),o=l(o,i,n,r,e[3],3572445317,16),r=l(r,o,i,n,e[6],76029189,23),n=l(n,r,o,i,e[9],3654602809,4),i=l(i,n,r,o,e[12],3873151461,11),o=l(o,i,n,r,e[15],530742520,16),n=f(n,r=l(r,o,i,n,e[2],3299628645,23),o,i,e[0],4096336452,6),i=f(i,n,r,o,e[7],1126891415,10),o=f(o,i,n,r,e[14],2878612391,15),r=f(r,o,i,n,e[5],4237533241,21),n=f(n,r,o,i,e[12],1700485571,6),i=f(i,n,r,o,e[3],2399980690,10),o=f(o,i,n,r,e[10],4293915773,15),r=f(r,o,i,n,e[1],2240044497,21),n=f(n,r,o,i,e[8],1873313359,6),i=f(i,n,r,o,e[15],4264355552,10),o=f(o,i,n,r,e[6],2734768916,15),r=f(r,o,i,n,e[13],1309151649,21),n=f(n,r,o,i,e[4],4149444226,6),i=f(i,n,r,o,e[11],3174756917,10),o=f(o,i,n,r,e[2],718787259,15),r=f(r,o,i,n,e[9],3951481745,21),this._a=this._a+n|0,this._b=this._b+r|0,this._c=this._c+o|0,this._d=this._d+i|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 e=i.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},function(e,t,n){(function(t){function n(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,n(3))},function(e,t,n){"use strict";var r=n(39).codes.ERR_STREAM_PREMATURE_CLOSE;function o(){}e.exports=function e(t,n,i){if("function"==typeof n)return e(t,null,n);n||(n={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),o=0;o-1?r:i.nextTick;v.WritableState=m;var u=Object.create(n(47));u.inherits=n(2);var d={deprecate:n(76)},l=n(132),f=n(79).Buffer,h=o.Uint8Array||function(){};var p,A=n(133);function g(){}function m(e,t){s=s||n(31),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var o=e.highWaterMark,u=e.writableHighWaterMark,d=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(u||0===u)?u:d,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 l=!1===e.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,o){--t.pendingcb,n?(i.nextTick(o,r),i.nextTick(_,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(o(r),e._writableState.errorEmitted=!0,e.emit("error",r),_(e,t))}(e,n,r,t,o);else{var a=w(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||I(e,n),r?c(b,e,n,a,o):b(e,n,a,o)}}(t,e)},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(e){if(s=s||n(31),!(p.call(v,this)||this instanceof s))return new v(e);this._writableState=new m(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function y(e,t,n,r,o,i,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function b(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),_(e,t)}function I(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,o=new Array(r),i=t.corkedRequestsFree;i.entry=n;for(var s=0,c=!0;n;)o[s]=n,n.isBuf||(c=!1),n=n.next,s+=1;o.allBuffers=c,y(e,t,!0,t.length,o,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;n;){var u=n.chunk,d=n.encoding,l=n.callback;if(y(e,t,!1,t.objectMode?1:u.length,u,d,l),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function w(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),_(e,t)}))}function _(e,t){var n=w(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(E,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}u.inherits(v,l),m.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(m.prototype,"buffer",{get:d.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===v&&(e&&e._writableState instanceof m)}})):p=function(e){return e instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(e,t,n){var r,o=this._writableState,a=!1,s=!o.objectMode&&(r=e,f.isBuffer(r)||r instanceof h);return s&&!f.isBuffer(e)&&(e=function(e){return f.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=g),o.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),i.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var o=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),i.nextTick(r,a),o=!1),o}(this,o,e,n))&&(o.pendingcb++,a=function(e,t,n,r,o,i){if(!n){var a=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=f.from(t,n));return t}(t,r,o);r!==a&&(n=!0,o="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var c=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,_(e,t),n&&(t.finished?i.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),v.prototype.destroy=A.destroy,v.prototype._undestroy=A.undestroy,v.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(6),n(288).setImmediate,n(3))},function(e,t,n){"use strict";var r=n(17);function o(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}e.exports=o,o.prototype._init=function(){},o.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},o.prototype._buffer=function(e,t){for(var n=Math.min(this.buffer.length-this.bufferOff,e.length-t),r=0;r0;r--)t+=this._buffer(e,t),n+=this._flushBuffer(o,n);return t+=this._buffer(e,t),o},o.prototype.final=function(e){var t,n;return e&&(t=this.update(e)),n="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(n):n},o.prototype._pad=function(e,t){if(0===t)return!1;for(;t=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function a(e,n){var o=function(e){var t=i(e);return{blinder:t.toRed(r.mont(e.modulus)).redPow(new r(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(n),a=n.modulus.byteLength(),s=new r(e).mul(o.blinder).umod(n.modulus),c=s.toRed(r.mont(n.prime1)),u=s.toRed(r.mont(n.prime2)),d=n.coefficient,l=n.prime1,f=n.prime2,h=c.redPow(n.exponent1).fromRed(),p=u.redPow(n.exponent2).fromRed(),A=h.isub(p).imul(d).umod(l).imul(f);return p.iadd(A).imul(o.unblinder).umod(n.modulus).toArrayLike(t,"be",a)}a.getr=i,e.exports=a}).call(this,n(7).Buffer)},function(e,t,n){"use strict";var r,o=t,i=n(88),a=n(163),s=n(18).assert;function c(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(e,t){Object.defineProperty(o,e,{configurable:!0,enumerable:!0,get:function(){var n=new c(t);return Object.defineProperty(o,e,{configurable:!0,enumerable:!0,value:n}),n}})}o.PresetCurve=c,u("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:i.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("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:i.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("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:i.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("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:i.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"]}),u("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:i.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"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["9"]}),u("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:i.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=n(356)}catch(e){r=void 0}u("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:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},function(e,t,n){var r=t;r.utils=n(23),r.common=n(51),r.sha=n(350),r.ripemd=n(354),r.hmac=n(355),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},function(e,t,n){"use strict";(function(t){var r,o=n(7),i=o.Buffer,a={};for(r in o)o.hasOwnProperty(r)&&"SlowBuffer"!==r&&"Buffer"!==r&&(a[r]=o[r]);var s=a.Buffer={};for(r in i)i.hasOwnProperty(r)&&"allocUnsafe"!==r&&"allocUnsafeSlow"!==r&&(s[r]=i[r]);if(a.Buffer.prototype=i.prototype,s.from&&s.from!==Uint8Array.from||(s.from=function(e,t,n){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return i(e,t,n)}),s.alloc||(s.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=i(e);return t&&0!==t.length?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r}),!a.kStringMaxLength)try{a.kStringMaxLength=t.binding("buffer").kStringMaxLength}catch(e){}a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),e.exports=a}).call(this,n(6))},function(e,t,n){"use strict";const r=n(91).Reporter,o=n(52).EncoderBuffer,i=n(52).DecoderBuffer,a=n(17),s=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],c=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s);function u(e,t,n){const r={};this._baseState=r,r.name=n,r.enc=e,r.parent=t||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}e.exports=u;const d=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];u.prototype.clone=function(){const e=this._baseState,t={};d.forEach((function(n){t[n]=e[n]}));const n=new this.constructor(t.parent);return n._baseState=t,n},u.prototype._wrap=function(){const e=this._baseState;c.forEach((function(t){this[t]=function(){const n=new this.constructor(this);return e.children.push(n),n[t].apply(n,arguments)}}),this)},u.prototype._init=function(e){const t=this._baseState;a(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),a.equal(t.children.length,1,"Root node can have only one child")},u.prototype._useArgs=function(e){const t=this._baseState,n=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==n.length&&(a(null===t.children),t.children=n,n.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(a(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;const t={};return Object.keys(e).forEach((function(n){n==(0|n)&&(n|=0);const r=e[n];t[r]=n})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){u.prototype[e]=function(){const t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),s.forEach((function(e){u.prototype[e]=function(){const t=this._baseState,n=Array.prototype.slice.call(arguments);return a(null===t.tag),t.tag=e,this._useArgs(n),this}})),u.prototype.use=function(e){a(e);const t=this._baseState;return a(null===t.use),t.use=e,this},u.prototype.optional=function(){return this._baseState.optional=!0,this},u.prototype.def=function(e){const t=this._baseState;return a(null===t.default),t.default=e,t.optional=!0,this},u.prototype.explicit=function(e){const t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.explicit=e,this},u.prototype.implicit=function(e){const t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.implicit=e,this},u.prototype.obj=function(){const e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},u.prototype.key=function(e){const t=this._baseState;return a(null===t.key),t.key=e,this},u.prototype.any=function(){return this._baseState.any=!0,this},u.prototype.choice=function(e){const t=this._baseState;return a(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},u.prototype.contains=function(e){const t=this._baseState;return a(null===t.use),t.contains=e,this},u.prototype._decode=function(e,t){const n=this._baseState;if(null===n.parent)return e.wrapResult(n.children[0]._decode(e,t));let r,o=n.default,a=!0,s=null;if(null!==n.key&&(s=e.enterKey(n.key)),n.optional){let r=null;if(null!==n.explicit?r=n.explicit:null!==n.implicit?r=n.implicit:null!==n.tag&&(r=n.tag),null!==r||n.any){if(a=this._peekTag(e,r,n.any),e.isError(a))return a}else{const r=e.save();try{null===n.choice?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),a=!0}catch(e){a=!1}e.restore(r)}}if(n.obj&&a&&(r=e.enterObject()),a){if(null!==n.explicit){const t=this._decodeTag(e,n.explicit);if(e.isError(t))return t;e=t}const r=e.offset;if(null===n.use&&null===n.choice){let t;n.any&&(t=e.save());const r=this._decodeTag(e,null!==n.implicit?n.implicit:n.tag,n.any);if(e.isError(r))return r;n.any?o=e.raw(t):e=r}if(t&&t.track&&null!==n.tag&&t.track(e.path(),r,e.length,"tagged"),t&&t.track&&null!==n.tag&&t.track(e.path(),e.offset,e.length,"content"),n.any||(o=null===n.choice?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t)),e.isError(o))return o;if(n.any||null!==n.choice||null===n.children||n.children.forEach((function(n){n._decode(e,t)})),n.contains&&("octstr"===n.tag||"bitstr"===n.tag)){const r=new i(o);o=this._getUse(n.contains,e._reporterState.obj)._decode(r,t)}}return n.obj&&a&&(o=e.leaveObject(r)),null===n.key||null===o&&!0!==a?null!==s&&e.exitKey(s):e.leaveKey(s,n.key,o),o},u.prototype._decodeGeneric=function(e,t,n){const r=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,r.args[0],n):/str$/.test(e)?this._decodeStr(t,e,n):"objid"===e&&r.args?this._decodeObjid(t,r.args[0],r.args[1],n):"objid"===e?this._decodeObjid(t,null,null,n):"gentime"===e||"utctime"===e?this._decodeTime(t,e,n):"null_"===e?this._decodeNull(t,n):"bool"===e?this._decodeBool(t,n):"objDesc"===e?this._decodeStr(t,e,n):"int"===e||"enum"===e?this._decodeInt(t,r.args&&r.args[0],n):null!==r.use?this._getUse(r.use,t._reporterState.obj)._decode(t,n):t.error("unknown tag: "+e)},u.prototype._getUse=function(e,t){const n=this._baseState;return n.useDecoder=this._use(e,t),a(null===n.useDecoder._baseState.parent),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder},u.prototype._decodeChoice=function(e,t){const n=this._baseState;let r=null,o=!1;return Object.keys(n.choice).some((function(i){const a=e.save(),s=n.choice[i];try{const n=s._decode(e,t);if(e.isError(n))return!1;r={type:i,value:n},o=!0}catch(t){return e.restore(a),!1}return!0}),this),o?r:e.error("Choice not matched")},u.prototype._createEncoderBuffer=function(e){return new o(e,this.reporter)},u.prototype._encode=function(e,t,n){const r=this._baseState;if(null!==r.default&&r.default===e)return;const o=this._encodeValue(e,t,n);return void 0===o||this._skipDefault(o,t,n)?void 0:o},u.prototype._encodeValue=function(e,t,n){const o=this._baseState;if(null===o.parent)return o.children[0]._encode(e,t||new r);let i=null;if(this.reporter=t,o.optional&&void 0===e){if(null===o.default)return;e=o.default}let a=null,s=!1;if(o.any)i=this._createEncoderBuffer(e);else if(o.choice)i=this._encodeChoice(e,t);else if(o.contains)a=this._getUse(o.contains,n)._encode(e,t),s=!0;else if(o.children)a=o.children.map((function(n){if("null_"===n._baseState.tag)return n._encode(null,t,e);if(null===n._baseState.key)return t.error("Child should have a key");const r=t.enterKey(n._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");const o=n._encode(e[n._baseState.key],t,e);return t.leaveKey(r),o}),this).filter((function(e){return e})),a=this._createEncoderBuffer(a);else if("seqof"===o.tag||"setof"===o.tag){if(!o.args||1!==o.args.length)return t.error("Too many args for : "+o.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");const n=this.clone();n._baseState.implicit=null,a=this._createEncoderBuffer(e.map((function(n){const r=this._baseState;return this._getUse(r.args[0],e)._encode(n,t)}),n))}else null!==o.use?i=this._getUse(o.use,n)._encode(e,t):(a=this._encodePrimitive(o.tag,e),s=!0);if(!o.any&&null===o.choice){const e=null!==o.implicit?o.implicit:o.tag,n=null===o.implicit?"universal":"context";null===e?null===o.use&&t.error("Tag could be omitted only for .use()"):null===o.use&&(i=this._encodeComposite(e,s,n,a))}return null!==o.explicit&&(i=this._encodeComposite(o.explicit,!1,"context",i)),i},u.prototype._encodeChoice=function(e,t){const n=this._baseState,r=n.choice[e.type];return r||a(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),r._encode(e.value,t)},u.prototype._encodePrimitive=function(e,t){const n=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&n.args)return this._encodeObjid(t,n.reverseArgs[0],n.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,n.args&&n.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},u.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},u.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},function(e,t,n){"use strict";const r=n(2);function o(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function i(e,t){this.path=e,this.rethrow(t)}t.Reporter=o,o.prototype.isError=function(e){return e instanceof i},o.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},o.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},o.prototype.enterKey=function(e){return this._reporterState.path.push(e)},o.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},o.prototype.leaveKey=function(e,t,n){const r=this._reporterState;this.exitKey(e),null!==r.obj&&(r.obj[t]=n)},o.prototype.path=function(){return this._reporterState.path.join("/")},o.prototype.enterObject=function(){const e=this._reporterState,t=e.obj;return e.obj={},t},o.prototype.leaveObject=function(e){const t=this._reporterState,n=t.obj;return t.obj=e,n},o.prototype.error=function(e){let t;const n=this._reporterState,r=e instanceof i;if(t=r?e:new i(n.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!n.options.partial)throw t;return r||n.errors.push(t),t},o.prototype.wrapResult=function(e){const t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},r(i,Error),i.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,i),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},function(e,t,n){"use strict";function r(e){const t={};return Object.keys(e).forEach((function(n){(0|n)==n&&(n|=0);const r=e[n];t[r]=n})),t}t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=r(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=r(t.tag)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint64ToString=t.uint64ToNumber=t.normalizePubkey=t.normalizeLcdApiArray=t.LcdClient=t.BroadcastMode=t.setupSupplyExtension=t.setupStakingExtension=t.setupSlashingExtension=t.setupMintExtension=t.setupGovExtension=t.setupDistributionExtension=t.setupBankExtension=t.setupAuthExtension=void 0;var r=n(386);Object.defineProperty(t,"setupAuthExtension",{enumerable:!0,get:function(){return r.setupAuthExtension}});var o=n(387);Object.defineProperty(t,"setupBankExtension",{enumerable:!0,get:function(){return o.setupBankExtension}});var i=n(388);Object.defineProperty(t,"setupDistributionExtension",{enumerable:!0,get:function(){return i.setupDistributionExtension}});var a=n(389);Object.defineProperty(t,"setupGovExtension",{enumerable:!0,get:function(){return a.setupGovExtension}});var s=n(390);Object.defineProperty(t,"setupMintExtension",{enumerable:!0,get:function(){return s.setupMintExtension}});var c=n(391);Object.defineProperty(t,"setupSlashingExtension",{enumerable:!0,get:function(){return c.setupSlashingExtension}});var u=n(392);Object.defineProperty(t,"setupStakingExtension",{enumerable:!0,get:function(){return u.setupStakingExtension}});var d=n(393);Object.defineProperty(t,"setupSupplyExtension",{enumerable:!0,get:function(){return d.setupSupplyExtension}});var l=n(181);Object.defineProperty(t,"BroadcastMode",{enumerable:!0,get:function(){return l.BroadcastMode}});var f=n(394);Object.defineProperty(t,"LcdClient",{enumerable:!0,get:function(){return f.LcdClient}}),Object.defineProperty(t,"normalizeLcdApiArray",{enumerable:!0,get:function(){return f.normalizeLcdApiArray}});var h=n(414);Object.defineProperty(t,"normalizePubkey",{enumerable:!0,get:function(){return h.normalizePubkey}}),Object.defineProperty(t,"uint64ToNumber",{enumerable:!0,get:function(){return h.uint64ToNumber}}),Object.defineProperty(t,"uint64ToString",{enumerable:!0,get:function(){return h.uint64ToString}})},function(e,t,n){"use strict";(function(t){var r=n(13),o=n(401),i=n(184),a={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(c=n(185)),c),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(s(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,n=t&&t.silentJSONParsing,o=t&&t.forcedJSONParsing,a=!n&&"json"===this.responseType;if(a||o&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw i(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){u.headers[e]=r.merge(a)})),e.exports=u}).call(this,n(6))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodeBech32Pubkey=t.encodeAminoPubkey=t.decodeBech32Pubkey=t.decodeAminoPubkey=t.encodeSecp256k1Pubkey=void 0;const r=n(22),o=n(45),i=n(65);t.encodeSecp256k1Pubkey=function(e){if(33!==e.length||2!==e[0]&&3!==e[0])throw new Error("Public key must be compressed secp256k1, i.e. 33 bytes starting with 0x02 or 0x03");return{type:i.pubkeyType.secp256k1,value:r.toBase64(e)}};const a=r.fromHex("eb5ae98721"),s=r.fromHex("1624de6420"),c=r.fromHex("0dfb1005"),u=a.length;function d(e){const t=e.slice(0,u),n=e.slice(u);if(o.arrayContentEquals(t,a)){if(33!==n.length)throw new Error("Invalid rest data length. Expected 33 bytes (compressed secp256k1 pubkey).");return{type:i.pubkeyType.secp256k1,value:r.toBase64(n)}}if(o.arrayContentEquals(t,s)){if(32!==n.length)throw new Error("Invalid rest data length. Expected 32 bytes (Ed25519 pubkey).");return{type:i.pubkeyType.ed25519,value:r.toBase64(n)}}if(o.arrayContentEquals(t,c)){if(32!==n.length)throw new Error("Invalid rest data length. Expected 32 bytes (Sr25519 pubkey).");return{type:i.pubkeyType.sr25519,value:r.toBase64(n)}}throw new Error("Unsupported Pubkey type. Amino prefix: "+r.toHex(t))}function l(e){let t;switch(e.type){case i.pubkeyType.secp256k1:t=a;break;case i.pubkeyType.ed25519:t=s;break;default:throw new Error("Unsupported pubkey type")}return new Uint8Array([...t,...r.fromBase64(e.value)])}t.decodeAminoPubkey=d,t.decodeBech32Pubkey=function(e){const{data:t}=r.Bech32.decode(e);return d(t)},t.encodeAminoPubkey=l,t.encodeBech32Pubkey=function(e,t){return r.Bech32.encode(t,l(e))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeSignature=t.encodeSecp256k1Signature=void 0;const r=n(22),o=n(95),i=n(65);t.encodeSecp256k1Signature=function(e,t){if(64!==t.length)throw new Error("Signature must be 64 bytes long. Cosmos SDK uses a 2x32 byte fixed length encoding for the secp256k1 signature integers r and s.");return{pub_key:o.encodeSecp256k1Pubkey(e),signature:r.toBase64(t)}},t.decodeSignature=function(e){switch(e.pub_key.type){case i.pubkeyType.secp256k1:return{pubkey:r.fromBase64(e.pub_key.value),signature:r.fromBase64(e.signature)};default:throw new Error("Unsupported pubkey type")}}},function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompactBitArray=t.MultiSignature=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1));t.protobufPackage="cosmos.crypto.multisig.v1beta1";const a={};t.MultiSignature={encode(e,t=i.default.Writer.create()){for(const n of e.signatures)t.uint32(10).bytes(n);return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},a);for(o.signatures=[];n.pos>>3){case 1:o.signatures.push(n.bytes());break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},a);return n.signatures=(null!==(t=e.signatures)&&void 0!==t?t:[]).map(e=>d(e)),n},toJSON(e){const t={};return e.signatures?t.signatures=e.signatures.map(e=>f(void 0!==e?e:new Uint8Array)):t.signatures=[],t},fromPartial(e){var t;const n=Object.assign({},a);return n.signatures=(null===(t=e.signatures)||void 0===t?void 0:t.map(e=>e))||[],n}};const s={extraBitsStored:0};t.CompactBitArray={encode:(e,t=i.default.Writer.create())=>(0!==e.extraBitsStored&&t.uint32(8).uint32(e.extraBitsStored),0!==e.elems.length&&t.uint32(18).bytes(e.elems),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},s);for(o.elems=new Uint8Array;n.pos>>3){case 1:o.extraBitsStored=n.uint32();break;case 2:o.elems=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},s);return t.extraBitsStored=void 0!==e.extraBitsStored&&null!==e.extraBitsStored?Number(e.extraBitsStored):0,t.elems=void 0!==e.elems&&null!==e.elems?d(e.elems):new Uint8Array,t},toJSON(e){const t={};return void 0!==e.extraBitsStored&&(t.extraBitsStored=e.extraBitsStored),void 0!==e.elems&&(t.elems=f(void 0!==e.elems?e.elems:new Uint8Array)),t},fromPartial(e){var t,n;const r=Object.assign({},s);return r.extraBitsStored=null!==(t=e.extraBitsStored)&&void 0!==t?t:0,r.elems=null!==(n=e.elems)&&void 0!==n?n:new Uint8Array,r}};var c=(()=>{if(void 0!==c)return c;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw"Unable to locate global object"})();const u=c.atob||(e=>c.Buffer.from(e,"base64").toString("binary"));function d(e){const t=u(e),n=new Uint8Array(t.length);for(let e=0;ec.Buffer.from(e,"binary").toString("base64"));function f(e){const t=[];for(const n of e)t.push(String.fromCharCode(n));return l(t.join(""))}i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())}).call(this,n(3))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha384=t.sha512_256=t.sha512=t.SHA512=void 0;const r=n(99),o=n(196),i=n(36),[a,s]=o.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),c=new Uint32Array(80),u=new Uint32Array(80);class d extends r.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:n,Bl:r,Ch:o,Cl:i,Dh:a,Dl:s,Eh:c,El:u,Fh:d,Fl:l,Gh:f,Gl:h,Hh:p,Hl:A}=this;return[e,t,n,r,o,i,a,s,c,u,d,l,f,h,p,A]}set(e,t,n,r,o,i,a,s,c,u,d,l,f,h,p,A){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|o,this.Cl=0|i,this.Dh=0|a,this.Dl=0|s,this.Eh=0|c,this.El=0|u,this.Fh=0|d,this.Fl=0|l,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|A}process(e,t){for(let n=0;n<16;n++,t+=4)c[n]=e.getUint32(t),u[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|c[e-15],n=0|u[e-15],r=o.default.rotrSH(t,n,1)^o.default.rotrSH(t,n,8)^o.default.shrSH(t,n,7),i=o.default.rotrSL(t,n,1)^o.default.rotrSL(t,n,8)^o.default.shrSL(t,n,7),a=0|c[e-2],s=0|u[e-2],d=o.default.rotrSH(a,s,19)^o.default.rotrBH(a,s,61)^o.default.shrSH(a,s,6),l=o.default.rotrSL(a,s,19)^o.default.rotrBL(a,s,61)^o.default.shrSL(a,s,6),f=o.default.add4L(i,l,u[e-7],u[e-16]),h=o.default.add4H(f,r,d,c[e-7],c[e-16]);c[e]=0|h,u[e]=0|f}let{Ah:n,Al:r,Bh:i,Bl:d,Ch:l,Cl:f,Dh:h,Dl:p,Eh:A,El:g,Fh:m,Fl:v,Gh:y,Gl:b,Hh:I,Hl:w}=this;for(let e=0;e<80;e++){const t=o.default.rotrSH(A,g,14)^o.default.rotrSH(A,g,18)^o.default.rotrBH(A,g,41),E=o.default.rotrSL(A,g,14)^o.default.rotrSL(A,g,18)^o.default.rotrBL(A,g,41),_=A&m^~A&y,B=g&v^~g&b,C=o.default.add5L(w,E,B,s[e],u[e]),k=o.default.add5H(C,I,t,_,a[e],c[e]),S=0|C,O=o.default.rotrSH(n,r,28)^o.default.rotrBH(n,r,34)^o.default.rotrBH(n,r,39),Q=o.default.rotrSL(n,r,28)^o.default.rotrBL(n,r,34)^o.default.rotrBL(n,r,39),P=n&i^n&l^i&l,R=r&d^r&f^d&f;I=0|y,w=0|b,y=0|m,b=0|v,m=0|A,v=0|g,({h:A,l:g}=o.default.add(0|h,0|p,0|k,0|S)),h=0|l,p=0|f,l=0|i,f=0|d,i=0|n,d=0|r;const M=o.default.add3L(S,Q,R);n=o.default.add3H(M,k,O,P),r=0|M}({h:n,l:r}=o.default.add(0|this.Ah,0|this.Al,0|n,0|r)),({h:i,l:d}=o.default.add(0|this.Bh,0|this.Bl,0|i,0|d)),({h:l,l:f}=o.default.add(0|this.Ch,0|this.Cl,0|l,0|f)),({h:h,l:p}=o.default.add(0|this.Dh,0|this.Dl,0|h,0|p)),({h:A,l:g}=o.default.add(0|this.Eh,0|this.El,0|A,0|g)),({h:m,l:v}=o.default.add(0|this.Fh,0|this.Fl,0|m,0|v)),({h:y,l:b}=o.default.add(0|this.Gh,0|this.Gl,0|y,0|b)),({h:I,l:w}=o.default.add(0|this.Hh,0|this.Hl,0|I,0|w)),this.set(n,r,i,d,l,f,h,p,A,g,m,v,y,b,I,w)}roundClean(){c.fill(0),u.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}t.SHA512=d;class l extends d{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class f extends d{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}t.sha512=(0,i.wrapConstructor)(()=>new d),t.sha512_256=(0,i.wrapConstructor)(()=>new l),t.sha384=(0,i.wrapConstructor)(()=>new f)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;const r=n(68),o=n(36);class i extends o.Hash{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,o.createView)(this.buffer)}update(e){r.default.exists(this);const{view:t,buffer:n,blockLen:i}=this,a=(e=(0,o.toBytes)(e)).length;for(let r=0;ri-s&&(this.process(n,0),s=0);for(let e=s;e>o&i),s=Number(n&i),c=r?4:0,u=r?0:4;e.setUint32(t+c,a,r),e.setUint32(t+u,s,r)}(n,i-8,BigInt(8*this.length),a),this.process(n,0);const c=(0,o.createView)(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const d=this.get(),l=u/4;if(l>d.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e0;){if(18!=t.shift())throw new Error("Invalid multisig data. Expecting 0x12 prefix before participant pubkey length.");const[e,n]=f(t);if(t.splice(0,n),t.length127)throw new Error("Decoding numbers > 127 is not supported here. Please tell those lazy CosmJS maintainers to port the binary.Varint implementation from the Go standard library and write some tests.");return[e[0],1]}function h(e){const t=o.Uint53.fromString(e.toString()).toNumber();if(t>127)throw new Error("Encoding numbers > 127 is not supported here. Please tell those lazy CosmJS maintainers to port the binary.PutUvarint implementation from the Go standard library and write some tests.");return[t]}function p(e){if((0,a.isMultisigThresholdPubkey)(e)){const t=Array.from(d);t.push(8),t.push(...h(e.value.threshold));for(const n of e.value.pubkeys.map(e=>p(e)))t.push(18),t.push(...h(n.length)),t.push(...n);return new Uint8Array(t)}if((0,a.isEd25519Pubkey)(e))return new Uint8Array([...c,...(0,r.fromBase64)(e.value)]);if((0,a.isSecp256k1Pubkey)(e))return new Uint8Array([...s,...(0,r.fromBase64)(e.value)]);throw new Error("Unsupported pubkey type")}t.decodeAminoPubkey=l,t.decodeBech32Pubkey=function(e){const{data:t}=(0,r.fromBech32)(e);return l(t)},t.encodeAminoPubkey=p,t.encodeBech32Pubkey=function(e,t){return(0,r.toBech32)(t,p(e))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeSignature=t.encodeSecp256k1Signature=void 0;const r=n(5),o=n(102),i=n(69);t.encodeSecp256k1Signature=function(e,t){if(64!==t.length)throw new Error("Signature must be 64 bytes long. Cosmos SDK uses a 2x32 byte fixed length encoding for the secp256k1 signature integers r and s.");return{pub_key:(0,o.encodeSecp256k1Pubkey)(e),signature:(0,r.toBase64)(t)}},t.decodeSignature=function(e){switch(e.pub_key.type){case i.pubkeyType.secp256k1:return{pubkey:(0,r.fromBase64)(e.pub_key.value),signature:(0,r.fromBase64)(e.signature)};default:throw new Error("Unsupported pubkey type")}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeSignDoc=t.makeSignDoc=t.sortedJsonStringify=void 0;const r=n(5),o=n(11);function i(e){if("object"!=typeof e||null===e)return e;if(Array.isArray(e))return e.map(i);const t=Object.keys(e).sort(),n={};return t.forEach(t=>{n[t]=i(e[t])}),n}function a(e){return JSON.stringify(i(e))}t.sortedJsonStringify=a,t.makeSignDoc=function(e,t,n,r,i,a){return{chain_id:n,account_number:o.Uint53.fromString(i.toString()).toString(),sequence:o.Uint53.fromString(a.toString()).toString(),fee:t,msgs:e,memo:r||""}},t.serializeSignDoc=function(e){return(0,r.toUtf8)(a(e))}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.makeSignBytes=t.makeSignDoc=t.makeAuthInfoBytes=void 0;const o=n(53),i=n(25),a=r(n(0));function s(e,t){return e.map(({pubkey:e,sequence:n})=>({publicKey:e,modeInfo:{single:{mode:t}},sequence:a.default.fromNumber(n)}))}t.makeAuthInfoBytes=function(e,t,n,r=o.SignMode.SIGN_MODE_DIRECT){const c={signerInfos:s(e,r),fee:{amount:[...t],gasLimit:a.default.fromNumber(n)}};return i.AuthInfo.encode(i.AuthInfo.fromPartial(c)).finish()},t.makeSignDoc=function(e,t,n,r){return{bodyBytes:e,authInfoBytes:t,chainId:n,accountNumber:a.default.fromNumber(r)}},t.makeSignBytes=function({accountNumber:e,authInfoBytes:t,bodyBytes:n,chainId:r}){const o=i.SignDoc.fromPartial({accountNumber:e,authInfoBytes:t,bodyBytes:n,chainId:r});return i.SignDoc.encode(o).finish()}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Params=t.ModuleAccount=t.BaseAccount=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(9);t.protobufPackage="cosmos.auth.v1beta1";const s={address:"",accountNumber:o.default.UZERO,sequence:o.default.UZERO};t.BaseAccount={encode:(e,t=i.default.Writer.create())=>(""!==e.address&&t.uint32(10).string(e.address),void 0!==e.pubKey&&a.Any.encode(e.pubKey,t.uint32(18).fork()).ldelim(),e.accountNumber.isZero()||t.uint32(24).uint64(e.accountNumber),e.sequence.isZero()||t.uint32(32).uint64(e.sequence),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},s);for(;n.pos>>3){case 1:o.address=n.string();break;case 2:o.pubKey=a.Any.decode(n,n.uint32());break;case 3:o.accountNumber=n.uint64();break;case 4:o.sequence=n.uint64();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},s);return t.address=void 0!==e.address&&null!==e.address?String(e.address):"",t.pubKey=void 0!==e.pubKey&&null!==e.pubKey?a.Any.fromJSON(e.pubKey):void 0,t.accountNumber=void 0!==e.accountNumber&&null!==e.accountNumber?o.default.fromString(e.accountNumber):o.default.UZERO,t.sequence=void 0!==e.sequence&&null!==e.sequence?o.default.fromString(e.sequence):o.default.UZERO,t},toJSON(e){const t={};return void 0!==e.address&&(t.address=e.address),void 0!==e.pubKey&&(t.pubKey=e.pubKey?a.Any.toJSON(e.pubKey):void 0),void 0!==e.accountNumber&&(t.accountNumber=(e.accountNumber||o.default.UZERO).toString()),void 0!==e.sequence&&(t.sequence=(e.sequence||o.default.UZERO).toString()),t},fromPartial(e){var t;const n=Object.assign({},s);return n.address=null!==(t=e.address)&&void 0!==t?t:"",n.pubKey=void 0!==e.pubKey&&null!==e.pubKey?a.Any.fromPartial(e.pubKey):void 0,n.accountNumber=void 0!==e.accountNumber&&null!==e.accountNumber?o.default.fromValue(e.accountNumber):o.default.UZERO,n.sequence=void 0!==e.sequence&&null!==e.sequence?o.default.fromValue(e.sequence):o.default.UZERO,n}};const c={name:"",permissions:""};t.ModuleAccount={encode(e,n=i.default.Writer.create()){void 0!==e.baseAccount&&t.BaseAccount.encode(e.baseAccount,n.uint32(10).fork()).ldelim(),""!==e.name&&n.uint32(18).string(e.name);for(const t of e.permissions)n.uint32(26).string(t);return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},c);for(a.permissions=[];r.pos>>3){case 1:a.baseAccount=t.BaseAccount.decode(r,r.uint32());break;case 2:a.name=r.string();break;case 3:a.permissions.push(r.string());break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},c);return r.baseAccount=void 0!==e.baseAccount&&null!==e.baseAccount?t.BaseAccount.fromJSON(e.baseAccount):void 0,r.name=void 0!==e.name&&null!==e.name?String(e.name):"",r.permissions=(null!==(n=e.permissions)&&void 0!==n?n:[]).map(e=>String(e)),r},toJSON(e){const n={};return void 0!==e.baseAccount&&(n.baseAccount=e.baseAccount?t.BaseAccount.toJSON(e.baseAccount):void 0),void 0!==e.name&&(n.name=e.name),e.permissions?n.permissions=e.permissions.map(e=>e):n.permissions=[],n},fromPartial(e){var n,r;const o=Object.assign({},c);return o.baseAccount=void 0!==e.baseAccount&&null!==e.baseAccount?t.BaseAccount.fromPartial(e.baseAccount):void 0,o.name=null!==(n=e.name)&&void 0!==n?n:"",o.permissions=(null===(r=e.permissions)||void 0===r?void 0:r.map(e=>e))||[],o}};const u={maxMemoCharacters:o.default.UZERO,txSigLimit:o.default.UZERO,txSizeCostPerByte:o.default.UZERO,sigVerifyCostEd25519:o.default.UZERO,sigVerifyCostSecp256k1:o.default.UZERO};t.Params={encode:(e,t=i.default.Writer.create())=>(e.maxMemoCharacters.isZero()||t.uint32(8).uint64(e.maxMemoCharacters),e.txSigLimit.isZero()||t.uint32(16).uint64(e.txSigLimit),e.txSizeCostPerByte.isZero()||t.uint32(24).uint64(e.txSizeCostPerByte),e.sigVerifyCostEd25519.isZero()||t.uint32(32).uint64(e.sigVerifyCostEd25519),e.sigVerifyCostSecp256k1.isZero()||t.uint32(40).uint64(e.sigVerifyCostSecp256k1),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},u);for(;n.pos>>3){case 1:o.maxMemoCharacters=n.uint64();break;case 2:o.txSigLimit=n.uint64();break;case 3:o.txSizeCostPerByte=n.uint64();break;case 4:o.sigVerifyCostEd25519=n.uint64();break;case 5:o.sigVerifyCostSecp256k1=n.uint64();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},u);return t.maxMemoCharacters=void 0!==e.maxMemoCharacters&&null!==e.maxMemoCharacters?o.default.fromString(e.maxMemoCharacters):o.default.UZERO,t.txSigLimit=void 0!==e.txSigLimit&&null!==e.txSigLimit?o.default.fromString(e.txSigLimit):o.default.UZERO,t.txSizeCostPerByte=void 0!==e.txSizeCostPerByte&&null!==e.txSizeCostPerByte?o.default.fromString(e.txSizeCostPerByte):o.default.UZERO,t.sigVerifyCostEd25519=void 0!==e.sigVerifyCostEd25519&&null!==e.sigVerifyCostEd25519?o.default.fromString(e.sigVerifyCostEd25519):o.default.UZERO,t.sigVerifyCostSecp256k1=void 0!==e.sigVerifyCostSecp256k1&&null!==e.sigVerifyCostSecp256k1?o.default.fromString(e.sigVerifyCostSecp256k1):o.default.UZERO,t},toJSON(e){const t={};return void 0!==e.maxMemoCharacters&&(t.maxMemoCharacters=(e.maxMemoCharacters||o.default.UZERO).toString()),void 0!==e.txSigLimit&&(t.txSigLimit=(e.txSigLimit||o.default.UZERO).toString()),void 0!==e.txSizeCostPerByte&&(t.txSizeCostPerByte=(e.txSizeCostPerByte||o.default.UZERO).toString()),void 0!==e.sigVerifyCostEd25519&&(t.sigVerifyCostEd25519=(e.sigVerifyCostEd25519||o.default.UZERO).toString()),void 0!==e.sigVerifyCostSecp256k1&&(t.sigVerifyCostSecp256k1=(e.sigVerifyCostSecp256k1||o.default.UZERO).toString()),t},fromPartial(e){const t=Object.assign({},u);return t.maxMemoCharacters=void 0!==e.maxMemoCharacters&&null!==e.maxMemoCharacters?o.default.fromValue(e.maxMemoCharacters):o.default.UZERO,t.txSigLimit=void 0!==e.txSigLimit&&null!==e.txSigLimit?o.default.fromValue(e.txSigLimit):o.default.UZERO,t.txSizeCostPerByte=void 0!==e.txSizeCostPerByte&&null!==e.txSizeCostPerByte?o.default.fromValue(e.txSizeCostPerByte):o.default.UZERO,t.sigVerifyCostEd25519=void 0!==e.sigVerifyCostEd25519&&null!==e.sigVerifyCostEd25519?o.default.fromValue(e.sigVerifyCostEd25519):o.default.UZERO,t.sigVerifyCostSecp256k1=void 0!==e.sigVerifyCostSecp256k1&&null!==e.sigVerifyCostSecp256k1?o.default.fromValue(e.sigVerifyCostSecp256k1):o.default.UZERO,t}},i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())},function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TallyParams=t.VotingParams=t.DepositParams=t.Vote=t.TallyResult=t.Proposal=t.Deposit=t.TextProposal=t.WeightedVoteOption=t.proposalStatusToJSON=t.proposalStatusFromJSON=t.ProposalStatus=t.voteOptionToJSON=t.voteOptionFromJSON=t.VoteOption=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(9),s=n(27),c=n(55),u=n(10);var d,l;function f(e){switch(e){case 0:case"VOTE_OPTION_UNSPECIFIED":return d.VOTE_OPTION_UNSPECIFIED;case 1:case"VOTE_OPTION_YES":return d.VOTE_OPTION_YES;case 2:case"VOTE_OPTION_ABSTAIN":return d.VOTE_OPTION_ABSTAIN;case 3:case"VOTE_OPTION_NO":return d.VOTE_OPTION_NO;case 4:case"VOTE_OPTION_NO_WITH_VETO":return d.VOTE_OPTION_NO_WITH_VETO;case-1:case"UNRECOGNIZED":default:return d.UNRECOGNIZED}}function h(e){switch(e){case d.VOTE_OPTION_UNSPECIFIED:return"VOTE_OPTION_UNSPECIFIED";case d.VOTE_OPTION_YES:return"VOTE_OPTION_YES";case d.VOTE_OPTION_ABSTAIN:return"VOTE_OPTION_ABSTAIN";case d.VOTE_OPTION_NO:return"VOTE_OPTION_NO";case d.VOTE_OPTION_NO_WITH_VETO:return"VOTE_OPTION_NO_WITH_VETO";default:return"UNKNOWN"}}function p(e){switch(e){case 0:case"PROPOSAL_STATUS_UNSPECIFIED":return l.PROPOSAL_STATUS_UNSPECIFIED;case 1:case"PROPOSAL_STATUS_DEPOSIT_PERIOD":return l.PROPOSAL_STATUS_DEPOSIT_PERIOD;case 2:case"PROPOSAL_STATUS_VOTING_PERIOD":return l.PROPOSAL_STATUS_VOTING_PERIOD;case 3:case"PROPOSAL_STATUS_PASSED":return l.PROPOSAL_STATUS_PASSED;case 4:case"PROPOSAL_STATUS_REJECTED":return l.PROPOSAL_STATUS_REJECTED;case 5:case"PROPOSAL_STATUS_FAILED":return l.PROPOSAL_STATUS_FAILED;case-1:case"UNRECOGNIZED":default:return l.UNRECOGNIZED}}function A(e){switch(e){case l.PROPOSAL_STATUS_UNSPECIFIED:return"PROPOSAL_STATUS_UNSPECIFIED";case l.PROPOSAL_STATUS_DEPOSIT_PERIOD:return"PROPOSAL_STATUS_DEPOSIT_PERIOD";case l.PROPOSAL_STATUS_VOTING_PERIOD:return"PROPOSAL_STATUS_VOTING_PERIOD";case l.PROPOSAL_STATUS_PASSED:return"PROPOSAL_STATUS_PASSED";case l.PROPOSAL_STATUS_REJECTED:return"PROPOSAL_STATUS_REJECTED";case l.PROPOSAL_STATUS_FAILED:return"PROPOSAL_STATUS_FAILED";default:return"UNKNOWN"}}t.protobufPackage="cosmos.gov.v1beta1",function(e){e[e.VOTE_OPTION_UNSPECIFIED=0]="VOTE_OPTION_UNSPECIFIED",e[e.VOTE_OPTION_YES=1]="VOTE_OPTION_YES",e[e.VOTE_OPTION_ABSTAIN=2]="VOTE_OPTION_ABSTAIN",e[e.VOTE_OPTION_NO=3]="VOTE_OPTION_NO",e[e.VOTE_OPTION_NO_WITH_VETO=4]="VOTE_OPTION_NO_WITH_VETO",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(d=t.VoteOption||(t.VoteOption={})),t.voteOptionFromJSON=f,t.voteOptionToJSON=h,function(e){e[e.PROPOSAL_STATUS_UNSPECIFIED=0]="PROPOSAL_STATUS_UNSPECIFIED",e[e.PROPOSAL_STATUS_DEPOSIT_PERIOD=1]="PROPOSAL_STATUS_DEPOSIT_PERIOD",e[e.PROPOSAL_STATUS_VOTING_PERIOD=2]="PROPOSAL_STATUS_VOTING_PERIOD",e[e.PROPOSAL_STATUS_PASSED=3]="PROPOSAL_STATUS_PASSED",e[e.PROPOSAL_STATUS_REJECTED=4]="PROPOSAL_STATUS_REJECTED",e[e.PROPOSAL_STATUS_FAILED=5]="PROPOSAL_STATUS_FAILED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(l=t.ProposalStatus||(t.ProposalStatus={})),t.proposalStatusFromJSON=p,t.proposalStatusToJSON=A;const g={option:0,weight:""};t.WeightedVoteOption={encode:(e,t=i.default.Writer.create())=>(0!==e.option&&t.uint32(8).int32(e.option),""!==e.weight&&t.uint32(18).string(e.weight),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},g);for(;n.pos>>3){case 1:o.option=n.int32();break;case 2:o.weight=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},g);return t.option=void 0!==e.option&&null!==e.option?f(e.option):0,t.weight=void 0!==e.weight&&null!==e.weight?String(e.weight):"",t},toJSON(e){const t={};return void 0!==e.option&&(t.option=h(e.option)),void 0!==e.weight&&(t.weight=e.weight),t},fromPartial(e){var t,n;const r=Object.assign({},g);return r.option=null!==(t=e.option)&&void 0!==t?t:0,r.weight=null!==(n=e.weight)&&void 0!==n?n:"",r}};const m={title:"",description:""};t.TextProposal={encode:(e,t=i.default.Writer.create())=>(""!==e.title&&t.uint32(10).string(e.title),""!==e.description&&t.uint32(18).string(e.description),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},m);for(;n.pos>>3){case 1:o.title=n.string();break;case 2:o.description=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},m);return t.title=void 0!==e.title&&null!==e.title?String(e.title):"",t.description=void 0!==e.description&&null!==e.description?String(e.description):"",t},toJSON(e){const t={};return void 0!==e.title&&(t.title=e.title),void 0!==e.description&&(t.description=e.description),t},fromPartial(e){var t,n;const r=Object.assign({},m);return r.title=null!==(t=e.title)&&void 0!==t?t:"",r.description=null!==(n=e.description)&&void 0!==n?n:"",r}};const v={proposalId:o.default.UZERO,depositor:""};t.Deposit={encode(e,t=i.default.Writer.create()){e.proposalId.isZero()||t.uint32(8).uint64(e.proposalId),""!==e.depositor&&t.uint32(18).string(e.depositor);for(const n of e.amount)u.Coin.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},v);for(o.amount=[];n.pos>>3){case 1:o.proposalId=n.uint64();break;case 2:o.depositor=n.string();break;case 3:o.amount.push(u.Coin.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},v);return n.proposalId=void 0!==e.proposalId&&null!==e.proposalId?o.default.fromString(e.proposalId):o.default.UZERO,n.depositor=void 0!==e.depositor&&null!==e.depositor?String(e.depositor):"",n.amount=(null!==(t=e.amount)&&void 0!==t?t:[]).map(e=>u.Coin.fromJSON(e)),n},toJSON(e){const t={};return void 0!==e.proposalId&&(t.proposalId=(e.proposalId||o.default.UZERO).toString()),void 0!==e.depositor&&(t.depositor=e.depositor),e.amount?t.amount=e.amount.map(e=>e?u.Coin.toJSON(e):void 0):t.amount=[],t},fromPartial(e){var t,n;const r=Object.assign({},v);return r.proposalId=void 0!==e.proposalId&&null!==e.proposalId?o.default.fromValue(e.proposalId):o.default.UZERO,r.depositor=null!==(t=e.depositor)&&void 0!==t?t:"",r.amount=(null===(n=e.amount)||void 0===n?void 0:n.map(e=>u.Coin.fromPartial(e)))||[],r}};const y={proposalId:o.default.UZERO,status:0};t.Proposal={encode(e,n=i.default.Writer.create()){e.proposalId.isZero()||n.uint32(8).uint64(e.proposalId),void 0!==e.content&&a.Any.encode(e.content,n.uint32(18).fork()).ldelim(),0!==e.status&&n.uint32(24).int32(e.status),void 0!==e.finalTallyResult&&t.TallyResult.encode(e.finalTallyResult,n.uint32(34).fork()).ldelim(),void 0!==e.submitTime&&s.Timestamp.encode(e.submitTime,n.uint32(42).fork()).ldelim(),void 0!==e.depositEndTime&&s.Timestamp.encode(e.depositEndTime,n.uint32(50).fork()).ldelim();for(const t of e.totalDeposit)u.Coin.encode(t,n.uint32(58).fork()).ldelim();return void 0!==e.votingStartTime&&s.Timestamp.encode(e.votingStartTime,n.uint32(66).fork()).ldelim(),void 0!==e.votingEndTime&&s.Timestamp.encode(e.votingEndTime,n.uint32(74).fork()).ldelim(),n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const c=Object.assign({},y);for(c.totalDeposit=[];r.pos>>3){case 1:c.proposalId=r.uint64();break;case 2:c.content=a.Any.decode(r,r.uint32());break;case 3:c.status=r.int32();break;case 4:c.finalTallyResult=t.TallyResult.decode(r,r.uint32());break;case 5:c.submitTime=s.Timestamp.decode(r,r.uint32());break;case 6:c.depositEndTime=s.Timestamp.decode(r,r.uint32());break;case 7:c.totalDeposit.push(u.Coin.decode(r,r.uint32()));break;case 8:c.votingStartTime=s.Timestamp.decode(r,r.uint32());break;case 9:c.votingEndTime=s.Timestamp.decode(r,r.uint32());break;default:r.skipType(7&e)}}return c},fromJSON(e){var n;const r=Object.assign({},y);return r.proposalId=void 0!==e.proposalId&&null!==e.proposalId?o.default.fromString(e.proposalId):o.default.UZERO,r.content=void 0!==e.content&&null!==e.content?a.Any.fromJSON(e.content):void 0,r.status=void 0!==e.status&&null!==e.status?p(e.status):0,r.finalTallyResult=void 0!==e.finalTallyResult&&null!==e.finalTallyResult?t.TallyResult.fromJSON(e.finalTallyResult):void 0,r.submitTime=void 0!==e.submitTime&&null!==e.submitTime?R(e.submitTime):void 0,r.depositEndTime=void 0!==e.depositEndTime&&null!==e.depositEndTime?R(e.depositEndTime):void 0,r.totalDeposit=(null!==(n=e.totalDeposit)&&void 0!==n?n:[]).map(e=>u.Coin.fromJSON(e)),r.votingStartTime=void 0!==e.votingStartTime&&null!==e.votingStartTime?R(e.votingStartTime):void 0,r.votingEndTime=void 0!==e.votingEndTime&&null!==e.votingEndTime?R(e.votingEndTime):void 0,r},toJSON(e){const n={};return void 0!==e.proposalId&&(n.proposalId=(e.proposalId||o.default.UZERO).toString()),void 0!==e.content&&(n.content=e.content?a.Any.toJSON(e.content):void 0),void 0!==e.status&&(n.status=A(e.status)),void 0!==e.finalTallyResult&&(n.finalTallyResult=e.finalTallyResult?t.TallyResult.toJSON(e.finalTallyResult):void 0),void 0!==e.submitTime&&(n.submitTime=P(e.submitTime).toISOString()),void 0!==e.depositEndTime&&(n.depositEndTime=P(e.depositEndTime).toISOString()),e.totalDeposit?n.totalDeposit=e.totalDeposit.map(e=>e?u.Coin.toJSON(e):void 0):n.totalDeposit=[],void 0!==e.votingStartTime&&(n.votingStartTime=P(e.votingStartTime).toISOString()),void 0!==e.votingEndTime&&(n.votingEndTime=P(e.votingEndTime).toISOString()),n},fromPartial(e){var n,r;const i=Object.assign({},y);return i.proposalId=void 0!==e.proposalId&&null!==e.proposalId?o.default.fromValue(e.proposalId):o.default.UZERO,i.content=void 0!==e.content&&null!==e.content?a.Any.fromPartial(e.content):void 0,i.status=null!==(n=e.status)&&void 0!==n?n:0,i.finalTallyResult=void 0!==e.finalTallyResult&&null!==e.finalTallyResult?t.TallyResult.fromPartial(e.finalTallyResult):void 0,i.submitTime=void 0!==e.submitTime&&null!==e.submitTime?s.Timestamp.fromPartial(e.submitTime):void 0,i.depositEndTime=void 0!==e.depositEndTime&&null!==e.depositEndTime?s.Timestamp.fromPartial(e.depositEndTime):void 0,i.totalDeposit=(null===(r=e.totalDeposit)||void 0===r?void 0:r.map(e=>u.Coin.fromPartial(e)))||[],i.votingStartTime=void 0!==e.votingStartTime&&null!==e.votingStartTime?s.Timestamp.fromPartial(e.votingStartTime):void 0,i.votingEndTime=void 0!==e.votingEndTime&&null!==e.votingEndTime?s.Timestamp.fromPartial(e.votingEndTime):void 0,i}};const b={yes:"",abstain:"",no:"",noWithVeto:""};t.TallyResult={encode:(e,t=i.default.Writer.create())=>(""!==e.yes&&t.uint32(10).string(e.yes),""!==e.abstain&&t.uint32(18).string(e.abstain),""!==e.no&&t.uint32(26).string(e.no),""!==e.noWithVeto&&t.uint32(34).string(e.noWithVeto),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},b);for(;n.pos>>3){case 1:o.yes=n.string();break;case 2:o.abstain=n.string();break;case 3:o.no=n.string();break;case 4:o.noWithVeto=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},b);return t.yes=void 0!==e.yes&&null!==e.yes?String(e.yes):"",t.abstain=void 0!==e.abstain&&null!==e.abstain?String(e.abstain):"",t.no=void 0!==e.no&&null!==e.no?String(e.no):"",t.noWithVeto=void 0!==e.noWithVeto&&null!==e.noWithVeto?String(e.noWithVeto):"",t},toJSON(e){const t={};return void 0!==e.yes&&(t.yes=e.yes),void 0!==e.abstain&&(t.abstain=e.abstain),void 0!==e.no&&(t.no=e.no),void 0!==e.noWithVeto&&(t.noWithVeto=e.noWithVeto),t},fromPartial(e){var t,n,r,o;const i=Object.assign({},b);return i.yes=null!==(t=e.yes)&&void 0!==t?t:"",i.abstain=null!==(n=e.abstain)&&void 0!==n?n:"",i.no=null!==(r=e.no)&&void 0!==r?r:"",i.noWithVeto=null!==(o=e.noWithVeto)&&void 0!==o?o:"",i}};const I={proposalId:o.default.UZERO,voter:"",option:0};t.Vote={encode(e,n=i.default.Writer.create()){e.proposalId.isZero()||n.uint32(8).uint64(e.proposalId),""!==e.voter&&n.uint32(18).string(e.voter),0!==e.option&&n.uint32(24).int32(e.option);for(const r of e.options)t.WeightedVoteOption.encode(r,n.uint32(34).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},I);for(a.options=[];r.pos>>3){case 1:a.proposalId=r.uint64();break;case 2:a.voter=r.string();break;case 3:a.option=r.int32();break;case 4:a.options.push(t.WeightedVoteOption.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},I);return r.proposalId=void 0!==e.proposalId&&null!==e.proposalId?o.default.fromString(e.proposalId):o.default.UZERO,r.voter=void 0!==e.voter&&null!==e.voter?String(e.voter):"",r.option=void 0!==e.option&&null!==e.option?f(e.option):0,r.options=(null!==(n=e.options)&&void 0!==n?n:[]).map(e=>t.WeightedVoteOption.fromJSON(e)),r},toJSON(e){const n={};return void 0!==e.proposalId&&(n.proposalId=(e.proposalId||o.default.UZERO).toString()),void 0!==e.voter&&(n.voter=e.voter),void 0!==e.option&&(n.option=h(e.option)),e.options?n.options=e.options.map(e=>e?t.WeightedVoteOption.toJSON(e):void 0):n.options=[],n},fromPartial(e){var n,r,i;const a=Object.assign({},I);return a.proposalId=void 0!==e.proposalId&&null!==e.proposalId?o.default.fromValue(e.proposalId):o.default.UZERO,a.voter=null!==(n=e.voter)&&void 0!==n?n:"",a.option=null!==(r=e.option)&&void 0!==r?r:0,a.options=(null===(i=e.options)||void 0===i?void 0:i.map(e=>t.WeightedVoteOption.fromPartial(e)))||[],a}};const w={};t.DepositParams={encode(e,t=i.default.Writer.create()){for(const n of e.minDeposit)u.Coin.encode(n,t.uint32(10).fork()).ldelim();return void 0!==e.maxDepositPeriod&&c.Duration.encode(e.maxDepositPeriod,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},w);for(o.minDeposit=[];n.pos>>3){case 1:o.minDeposit.push(u.Coin.decode(n,n.uint32()));break;case 2:o.maxDepositPeriod=c.Duration.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},w);return n.minDeposit=(null!==(t=e.minDeposit)&&void 0!==t?t:[]).map(e=>u.Coin.fromJSON(e)),n.maxDepositPeriod=void 0!==e.maxDepositPeriod&&null!==e.maxDepositPeriod?c.Duration.fromJSON(e.maxDepositPeriod):void 0,n},toJSON(e){const t={};return e.minDeposit?t.minDeposit=e.minDeposit.map(e=>e?u.Coin.toJSON(e):void 0):t.minDeposit=[],void 0!==e.maxDepositPeriod&&(t.maxDepositPeriod=e.maxDepositPeriod?c.Duration.toJSON(e.maxDepositPeriod):void 0),t},fromPartial(e){var t;const n=Object.assign({},w);return n.minDeposit=(null===(t=e.minDeposit)||void 0===t?void 0:t.map(e=>u.Coin.fromPartial(e)))||[],n.maxDepositPeriod=void 0!==e.maxDepositPeriod&&null!==e.maxDepositPeriod?c.Duration.fromPartial(e.maxDepositPeriod):void 0,n}};const E={};t.VotingParams={encode:(e,t=i.default.Writer.create())=>(void 0!==e.votingPeriod&&c.Duration.encode(e.votingPeriod,t.uint32(10).fork()).ldelim(),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},E);for(;n.pos>>3){case 1:o.votingPeriod=c.Duration.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},E);return t.votingPeriod=void 0!==e.votingPeriod&&null!==e.votingPeriod?c.Duration.fromJSON(e.votingPeriod):void 0,t},toJSON(e){const t={};return void 0!==e.votingPeriod&&(t.votingPeriod=e.votingPeriod?c.Duration.toJSON(e.votingPeriod):void 0),t},fromPartial(e){const t=Object.assign({},E);return t.votingPeriod=void 0!==e.votingPeriod&&null!==e.votingPeriod?c.Duration.fromPartial(e.votingPeriod):void 0,t}};const _={};t.TallyParams={encode:(e,t=i.default.Writer.create())=>(0!==e.quorum.length&&t.uint32(10).bytes(e.quorum),0!==e.threshold.length&&t.uint32(18).bytes(e.threshold),0!==e.vetoThreshold.length&&t.uint32(26).bytes(e.vetoThreshold),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},_);for(o.quorum=new Uint8Array,o.threshold=new Uint8Array,o.vetoThreshold=new Uint8Array;n.pos>>3){case 1:o.quorum=n.bytes();break;case 2:o.threshold=n.bytes();break;case 3:o.vetoThreshold=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},_);return t.quorum=void 0!==e.quorum&&null!==e.quorum?k(e.quorum):new Uint8Array,t.threshold=void 0!==e.threshold&&null!==e.threshold?k(e.threshold):new Uint8Array,t.vetoThreshold=void 0!==e.vetoThreshold&&null!==e.vetoThreshold?k(e.vetoThreshold):new Uint8Array,t},toJSON(e){const t={};return void 0!==e.quorum&&(t.quorum=O(void 0!==e.quorum?e.quorum:new Uint8Array)),void 0!==e.threshold&&(t.threshold=O(void 0!==e.threshold?e.threshold:new Uint8Array)),void 0!==e.vetoThreshold&&(t.vetoThreshold=O(void 0!==e.vetoThreshold?e.vetoThreshold:new Uint8Array)),t},fromPartial(e){var t,n,r;const o=Object.assign({},_);return o.quorum=null!==(t=e.quorum)&&void 0!==t?t:new Uint8Array,o.threshold=null!==(n=e.threshold)&&void 0!==n?n:new Uint8Array,o.vetoThreshold=null!==(r=e.vetoThreshold)&&void 0!==r?r:new Uint8Array,o}};var B=(()=>{if(void 0!==B)return B;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw"Unable to locate global object"})();const C=B.atob||(e=>B.Buffer.from(e,"base64").toString("binary"));function k(e){const t=C(e),n=new Uint8Array(t.length);for(let e=0;eB.Buffer.from(e,"binary").toString("base64"));function O(e){const t=[];for(const n of e)t.push(String.fromCharCode(n));return S(t.join(""))}function Q(e){var t;return{seconds:(t=e.getTime()/1e3,o.default.fromNumber(t)),nanos:e.getTime()%1e3*1e6}}function P(e){let t=1e3*e.seconds.toNumber();return t+=e.nanos/1e6,new Date(t)}function R(e){return e instanceof Date?Q(e):"string"==typeof e?Q(new Date(e)):s.Timestamp.fromJSON(e)}i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())}).call(this,n(3))},function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Acknowledgement=t.PacketState=t.Packet=t.Counterparty=t.IdentifiedChannel=t.Channel=t.orderToJSON=t.orderFromJSON=t.Order=t.stateToJSON=t.stateFromJSON=t.State=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(28);var s,c;function u(e){switch(e){case 0:case"STATE_UNINITIALIZED_UNSPECIFIED":return s.STATE_UNINITIALIZED_UNSPECIFIED;case 1:case"STATE_INIT":return s.STATE_INIT;case 2:case"STATE_TRYOPEN":return s.STATE_TRYOPEN;case 3:case"STATE_OPEN":return s.STATE_OPEN;case 4:case"STATE_CLOSED":return s.STATE_CLOSED;case-1:case"UNRECOGNIZED":default:return s.UNRECOGNIZED}}function d(e){switch(e){case s.STATE_UNINITIALIZED_UNSPECIFIED:return"STATE_UNINITIALIZED_UNSPECIFIED";case s.STATE_INIT:return"STATE_INIT";case s.STATE_TRYOPEN:return"STATE_TRYOPEN";case s.STATE_OPEN:return"STATE_OPEN";case s.STATE_CLOSED:return"STATE_CLOSED";default:return"UNKNOWN"}}function l(e){switch(e){case 0:case"ORDER_NONE_UNSPECIFIED":return c.ORDER_NONE_UNSPECIFIED;case 1:case"ORDER_UNORDERED":return c.ORDER_UNORDERED;case 2:case"ORDER_ORDERED":return c.ORDER_ORDERED;case-1:case"UNRECOGNIZED":default:return c.UNRECOGNIZED}}function f(e){switch(e){case c.ORDER_NONE_UNSPECIFIED:return"ORDER_NONE_UNSPECIFIED";case c.ORDER_UNORDERED:return"ORDER_UNORDERED";case c.ORDER_ORDERED:return"ORDER_ORDERED";default:return"UNKNOWN"}}t.protobufPackage="ibc.core.channel.v1",function(e){e[e.STATE_UNINITIALIZED_UNSPECIFIED=0]="STATE_UNINITIALIZED_UNSPECIFIED",e[e.STATE_INIT=1]="STATE_INIT",e[e.STATE_TRYOPEN=2]="STATE_TRYOPEN",e[e.STATE_OPEN=3]="STATE_OPEN",e[e.STATE_CLOSED=4]="STATE_CLOSED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(s=t.State||(t.State={})),t.stateFromJSON=u,t.stateToJSON=d,function(e){e[e.ORDER_NONE_UNSPECIFIED=0]="ORDER_NONE_UNSPECIFIED",e[e.ORDER_UNORDERED=1]="ORDER_UNORDERED",e[e.ORDER_ORDERED=2]="ORDER_ORDERED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(c=t.Order||(t.Order={})),t.orderFromJSON=l,t.orderToJSON=f;const h={state:0,ordering:0,connectionHops:"",version:""};t.Channel={encode(e,n=i.default.Writer.create()){0!==e.state&&n.uint32(8).int32(e.state),0!==e.ordering&&n.uint32(16).int32(e.ordering),void 0!==e.counterparty&&t.Counterparty.encode(e.counterparty,n.uint32(26).fork()).ldelim();for(const t of e.connectionHops)n.uint32(34).string(t);return""!==e.version&&n.uint32(42).string(e.version),n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},h);for(a.connectionHops=[];r.pos>>3){case 1:a.state=r.int32();break;case 2:a.ordering=r.int32();break;case 3:a.counterparty=t.Counterparty.decode(r,r.uint32());break;case 4:a.connectionHops.push(r.string());break;case 5:a.version=r.string();break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},h);return r.state=void 0!==e.state&&null!==e.state?u(e.state):0,r.ordering=void 0!==e.ordering&&null!==e.ordering?l(e.ordering):0,r.counterparty=void 0!==e.counterparty&&null!==e.counterparty?t.Counterparty.fromJSON(e.counterparty):void 0,r.connectionHops=(null!==(n=e.connectionHops)&&void 0!==n?n:[]).map(e=>String(e)),r.version=void 0!==e.version&&null!==e.version?String(e.version):"",r},toJSON(e){const n={};return void 0!==e.state&&(n.state=d(e.state)),void 0!==e.ordering&&(n.ordering=f(e.ordering)),void 0!==e.counterparty&&(n.counterparty=e.counterparty?t.Counterparty.toJSON(e.counterparty):void 0),e.connectionHops?n.connectionHops=e.connectionHops.map(e=>e):n.connectionHops=[],void 0!==e.version&&(n.version=e.version),n},fromPartial(e){var n,r,o,i;const a=Object.assign({},h);return a.state=null!==(n=e.state)&&void 0!==n?n:0,a.ordering=null!==(r=e.ordering)&&void 0!==r?r:0,a.counterparty=void 0!==e.counterparty&&null!==e.counterparty?t.Counterparty.fromPartial(e.counterparty):void 0,a.connectionHops=(null===(o=e.connectionHops)||void 0===o?void 0:o.map(e=>e))||[],a.version=null!==(i=e.version)&&void 0!==i?i:"",a}};const p={state:0,ordering:0,connectionHops:"",version:"",portId:"",channelId:""};t.IdentifiedChannel={encode(e,n=i.default.Writer.create()){0!==e.state&&n.uint32(8).int32(e.state),0!==e.ordering&&n.uint32(16).int32(e.ordering),void 0!==e.counterparty&&t.Counterparty.encode(e.counterparty,n.uint32(26).fork()).ldelim();for(const t of e.connectionHops)n.uint32(34).string(t);return""!==e.version&&n.uint32(42).string(e.version),""!==e.portId&&n.uint32(50).string(e.portId),""!==e.channelId&&n.uint32(58).string(e.channelId),n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},p);for(a.connectionHops=[];r.pos>>3){case 1:a.state=r.int32();break;case 2:a.ordering=r.int32();break;case 3:a.counterparty=t.Counterparty.decode(r,r.uint32());break;case 4:a.connectionHops.push(r.string());break;case 5:a.version=r.string();break;case 6:a.portId=r.string();break;case 7:a.channelId=r.string();break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},p);return r.state=void 0!==e.state&&null!==e.state?u(e.state):0,r.ordering=void 0!==e.ordering&&null!==e.ordering?l(e.ordering):0,r.counterparty=void 0!==e.counterparty&&null!==e.counterparty?t.Counterparty.fromJSON(e.counterparty):void 0,r.connectionHops=(null!==(n=e.connectionHops)&&void 0!==n?n:[]).map(e=>String(e)),r.version=void 0!==e.version&&null!==e.version?String(e.version):"",r.portId=void 0!==e.portId&&null!==e.portId?String(e.portId):"",r.channelId=void 0!==e.channelId&&null!==e.channelId?String(e.channelId):"",r},toJSON(e){const n={};return void 0!==e.state&&(n.state=d(e.state)),void 0!==e.ordering&&(n.ordering=f(e.ordering)),void 0!==e.counterparty&&(n.counterparty=e.counterparty?t.Counterparty.toJSON(e.counterparty):void 0),e.connectionHops?n.connectionHops=e.connectionHops.map(e=>e):n.connectionHops=[],void 0!==e.version&&(n.version=e.version),void 0!==e.portId&&(n.portId=e.portId),void 0!==e.channelId&&(n.channelId=e.channelId),n},fromPartial(e){var n,r,o,i,a,s;const c=Object.assign({},p);return c.state=null!==(n=e.state)&&void 0!==n?n:0,c.ordering=null!==(r=e.ordering)&&void 0!==r?r:0,c.counterparty=void 0!==e.counterparty&&null!==e.counterparty?t.Counterparty.fromPartial(e.counterparty):void 0,c.connectionHops=(null===(o=e.connectionHops)||void 0===o?void 0:o.map(e=>e))||[],c.version=null!==(i=e.version)&&void 0!==i?i:"",c.portId=null!==(a=e.portId)&&void 0!==a?a:"",c.channelId=null!==(s=e.channelId)&&void 0!==s?s:"",c}};const A={portId:"",channelId:""};t.Counterparty={encode:(e,t=i.default.Writer.create())=>(""!==e.portId&&t.uint32(10).string(e.portId),""!==e.channelId&&t.uint32(18).string(e.channelId),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},A);for(;n.pos>>3){case 1:o.portId=n.string();break;case 2:o.channelId=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},A);return t.portId=void 0!==e.portId&&null!==e.portId?String(e.portId):"",t.channelId=void 0!==e.channelId&&null!==e.channelId?String(e.channelId):"",t},toJSON(e){const t={};return void 0!==e.portId&&(t.portId=e.portId),void 0!==e.channelId&&(t.channelId=e.channelId),t},fromPartial(e){var t,n;const r=Object.assign({},A);return r.portId=null!==(t=e.portId)&&void 0!==t?t:"",r.channelId=null!==(n=e.channelId)&&void 0!==n?n:"",r}};const g={sequence:o.default.UZERO,sourcePort:"",sourceChannel:"",destinationPort:"",destinationChannel:"",timeoutTimestamp:o.default.UZERO};t.Packet={encode:(e,t=i.default.Writer.create())=>(e.sequence.isZero()||t.uint32(8).uint64(e.sequence),""!==e.sourcePort&&t.uint32(18).string(e.sourcePort),""!==e.sourceChannel&&t.uint32(26).string(e.sourceChannel),""!==e.destinationPort&&t.uint32(34).string(e.destinationPort),""!==e.destinationChannel&&t.uint32(42).string(e.destinationChannel),0!==e.data.length&&t.uint32(50).bytes(e.data),void 0!==e.timeoutHeight&&a.Height.encode(e.timeoutHeight,t.uint32(58).fork()).ldelim(),e.timeoutTimestamp.isZero()||t.uint32(64).uint64(e.timeoutTimestamp),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},g);for(o.data=new Uint8Array;n.pos>>3){case 1:o.sequence=n.uint64();break;case 2:o.sourcePort=n.string();break;case 3:o.sourceChannel=n.string();break;case 4:o.destinationPort=n.string();break;case 5:o.destinationChannel=n.string();break;case 6:o.data=n.bytes();break;case 7:o.timeoutHeight=a.Height.decode(n,n.uint32());break;case 8:o.timeoutTimestamp=n.uint64();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},g);return t.sequence=void 0!==e.sequence&&null!==e.sequence?o.default.fromString(e.sequence):o.default.UZERO,t.sourcePort=void 0!==e.sourcePort&&null!==e.sourcePort?String(e.sourcePort):"",t.sourceChannel=void 0!==e.sourceChannel&&null!==e.sourceChannel?String(e.sourceChannel):"",t.destinationPort=void 0!==e.destinationPort&&null!==e.destinationPort?String(e.destinationPort):"",t.destinationChannel=void 0!==e.destinationChannel&&null!==e.destinationChannel?String(e.destinationChannel):"",t.data=void 0!==e.data&&null!==e.data?I(e.data):new Uint8Array,t.timeoutHeight=void 0!==e.timeoutHeight&&null!==e.timeoutHeight?a.Height.fromJSON(e.timeoutHeight):void 0,t.timeoutTimestamp=void 0!==e.timeoutTimestamp&&null!==e.timeoutTimestamp?o.default.fromString(e.timeoutTimestamp):o.default.UZERO,t},toJSON(e){const t={};return void 0!==e.sequence&&(t.sequence=(e.sequence||o.default.UZERO).toString()),void 0!==e.sourcePort&&(t.sourcePort=e.sourcePort),void 0!==e.sourceChannel&&(t.sourceChannel=e.sourceChannel),void 0!==e.destinationPort&&(t.destinationPort=e.destinationPort),void 0!==e.destinationChannel&&(t.destinationChannel=e.destinationChannel),void 0!==e.data&&(t.data=E(void 0!==e.data?e.data:new Uint8Array)),void 0!==e.timeoutHeight&&(t.timeoutHeight=e.timeoutHeight?a.Height.toJSON(e.timeoutHeight):void 0),void 0!==e.timeoutTimestamp&&(t.timeoutTimestamp=(e.timeoutTimestamp||o.default.UZERO).toString()),t},fromPartial(e){var t,n,r,i,s;const c=Object.assign({},g);return c.sequence=void 0!==e.sequence&&null!==e.sequence?o.default.fromValue(e.sequence):o.default.UZERO,c.sourcePort=null!==(t=e.sourcePort)&&void 0!==t?t:"",c.sourceChannel=null!==(n=e.sourceChannel)&&void 0!==n?n:"",c.destinationPort=null!==(r=e.destinationPort)&&void 0!==r?r:"",c.destinationChannel=null!==(i=e.destinationChannel)&&void 0!==i?i:"",c.data=null!==(s=e.data)&&void 0!==s?s:new Uint8Array,c.timeoutHeight=void 0!==e.timeoutHeight&&null!==e.timeoutHeight?a.Height.fromPartial(e.timeoutHeight):void 0,c.timeoutTimestamp=void 0!==e.timeoutTimestamp&&null!==e.timeoutTimestamp?o.default.fromValue(e.timeoutTimestamp):o.default.UZERO,c}};const m={portId:"",channelId:"",sequence:o.default.UZERO};t.PacketState={encode:(e,t=i.default.Writer.create())=>(""!==e.portId&&t.uint32(10).string(e.portId),""!==e.channelId&&t.uint32(18).string(e.channelId),e.sequence.isZero()||t.uint32(24).uint64(e.sequence),0!==e.data.length&&t.uint32(34).bytes(e.data),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},m);for(o.data=new Uint8Array;n.pos>>3){case 1:o.portId=n.string();break;case 2:o.channelId=n.string();break;case 3:o.sequence=n.uint64();break;case 4:o.data=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},m);return t.portId=void 0!==e.portId&&null!==e.portId?String(e.portId):"",t.channelId=void 0!==e.channelId&&null!==e.channelId?String(e.channelId):"",t.sequence=void 0!==e.sequence&&null!==e.sequence?o.default.fromString(e.sequence):o.default.UZERO,t.data=void 0!==e.data&&null!==e.data?I(e.data):new Uint8Array,t},toJSON(e){const t={};return void 0!==e.portId&&(t.portId=e.portId),void 0!==e.channelId&&(t.channelId=e.channelId),void 0!==e.sequence&&(t.sequence=(e.sequence||o.default.UZERO).toString()),void 0!==e.data&&(t.data=E(void 0!==e.data?e.data:new Uint8Array)),t},fromPartial(e){var t,n,r;const i=Object.assign({},m);return i.portId=null!==(t=e.portId)&&void 0!==t?t:"",i.channelId=null!==(n=e.channelId)&&void 0!==n?n:"",i.sequence=void 0!==e.sequence&&null!==e.sequence?o.default.fromValue(e.sequence):o.default.UZERO,i.data=null!==(r=e.data)&&void 0!==r?r:new Uint8Array,i}};const v={};t.Acknowledgement={encode:(e,t=i.default.Writer.create())=>(void 0!==e.result&&t.uint32(170).bytes(e.result),void 0!==e.error&&t.uint32(178).string(e.error),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},v);for(;n.pos>>3){case 21:o.result=n.bytes();break;case 22:o.error=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},v);return t.result=void 0!==e.result&&null!==e.result?I(e.result):void 0,t.error=void 0!==e.error&&null!==e.error?String(e.error):void 0,t},toJSON(e){const t={};return void 0!==e.result&&(t.result=void 0!==e.result?E(e.result):void 0),void 0!==e.error&&(t.error=e.error),t},fromPartial(e){var t,n;const r=Object.assign({},v);return r.result=null!==(t=e.result)&&void 0!==t?t:void 0,r.error=null!==(n=e.error)&&void 0!==n?n:void 0,r}};var y=(()=>{if(void 0!==y)return y;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw"Unable to locate global object"})();const b=y.atob||(e=>y.Buffer.from(e,"base64").toString("binary"));function I(e){const t=b(e),n=new Uint8Array(t.length);for(let e=0;ey.Buffer.from(e,"binary").toString("base64"));function E(e){const t=[];for(const n of e)t.push(String.fromCharCode(n));return w(t.join(""))}i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())}).call(this,n(3))},function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TxProof=t.BlockMeta=t.LightBlock=t.SignedHeader=t.Proposal=t.CommitSig=t.Commit=t.Vote=t.Data=t.Header=t.BlockID=t.Part=t.PartSetHeader=t.signedMsgTypeToJSON=t.signedMsgTypeFromJSON=t.SignedMsgType=t.blockIDFlagToJSON=t.blockIDFlagFromJSON=t.BlockIDFlag=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(223),s=n(537),c=n(27),u=n(224);var d,l;function f(e){switch(e){case 0:case"BLOCK_ID_FLAG_UNKNOWN":return d.BLOCK_ID_FLAG_UNKNOWN;case 1:case"BLOCK_ID_FLAG_ABSENT":return d.BLOCK_ID_FLAG_ABSENT;case 2:case"BLOCK_ID_FLAG_COMMIT":return d.BLOCK_ID_FLAG_COMMIT;case 3:case"BLOCK_ID_FLAG_NIL":return d.BLOCK_ID_FLAG_NIL;case-1:case"UNRECOGNIZED":default:return d.UNRECOGNIZED}}function h(e){switch(e){case d.BLOCK_ID_FLAG_UNKNOWN:return"BLOCK_ID_FLAG_UNKNOWN";case d.BLOCK_ID_FLAG_ABSENT:return"BLOCK_ID_FLAG_ABSENT";case d.BLOCK_ID_FLAG_COMMIT:return"BLOCK_ID_FLAG_COMMIT";case d.BLOCK_ID_FLAG_NIL:return"BLOCK_ID_FLAG_NIL";default:return"UNKNOWN"}}function p(e){switch(e){case 0:case"SIGNED_MSG_TYPE_UNKNOWN":return l.SIGNED_MSG_TYPE_UNKNOWN;case 1:case"SIGNED_MSG_TYPE_PREVOTE":return l.SIGNED_MSG_TYPE_PREVOTE;case 2:case"SIGNED_MSG_TYPE_PRECOMMIT":return l.SIGNED_MSG_TYPE_PRECOMMIT;case 32:case"SIGNED_MSG_TYPE_PROPOSAL":return l.SIGNED_MSG_TYPE_PROPOSAL;case-1:case"UNRECOGNIZED":default:return l.UNRECOGNIZED}}function A(e){switch(e){case l.SIGNED_MSG_TYPE_UNKNOWN:return"SIGNED_MSG_TYPE_UNKNOWN";case l.SIGNED_MSG_TYPE_PREVOTE:return"SIGNED_MSG_TYPE_PREVOTE";case l.SIGNED_MSG_TYPE_PRECOMMIT:return"SIGNED_MSG_TYPE_PRECOMMIT";case l.SIGNED_MSG_TYPE_PROPOSAL:return"SIGNED_MSG_TYPE_PROPOSAL";default:return"UNKNOWN"}}t.protobufPackage="tendermint.types",function(e){e[e.BLOCK_ID_FLAG_UNKNOWN=0]="BLOCK_ID_FLAG_UNKNOWN",e[e.BLOCK_ID_FLAG_ABSENT=1]="BLOCK_ID_FLAG_ABSENT",e[e.BLOCK_ID_FLAG_COMMIT=2]="BLOCK_ID_FLAG_COMMIT",e[e.BLOCK_ID_FLAG_NIL=3]="BLOCK_ID_FLAG_NIL",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(d=t.BlockIDFlag||(t.BlockIDFlag={})),t.blockIDFlagFromJSON=f,t.blockIDFlagToJSON=h,function(e){e[e.SIGNED_MSG_TYPE_UNKNOWN=0]="SIGNED_MSG_TYPE_UNKNOWN",e[e.SIGNED_MSG_TYPE_PREVOTE=1]="SIGNED_MSG_TYPE_PREVOTE",e[e.SIGNED_MSG_TYPE_PRECOMMIT=2]="SIGNED_MSG_TYPE_PRECOMMIT",e[e.SIGNED_MSG_TYPE_PROPOSAL=32]="SIGNED_MSG_TYPE_PROPOSAL",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(l=t.SignedMsgType||(t.SignedMsgType={})),t.signedMsgTypeFromJSON=p,t.signedMsgTypeToJSON=A;const g={total:0};t.PartSetHeader={encode:(e,t=i.default.Writer.create())=>(0!==e.total&&t.uint32(8).uint32(e.total),0!==e.hash.length&&t.uint32(18).bytes(e.hash),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},g);for(o.hash=new Uint8Array;n.pos>>3){case 1:o.total=n.uint32();break;case 2:o.hash=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},g);return t.total=void 0!==e.total&&null!==e.total?Number(e.total):0,t.hash=void 0!==e.hash&&null!==e.hash?P(e.hash):new Uint8Array,t},toJSON(e){const t={};return void 0!==e.total&&(t.total=e.total),void 0!==e.hash&&(t.hash=M(void 0!==e.hash?e.hash:new Uint8Array)),t},fromPartial(e){var t,n;const r=Object.assign({},g);return r.total=null!==(t=e.total)&&void 0!==t?t:0,r.hash=null!==(n=e.hash)&&void 0!==n?n:new Uint8Array,r}};const m={index:0};t.Part={encode:(e,t=i.default.Writer.create())=>(0!==e.index&&t.uint32(8).uint32(e.index),0!==e.bytes.length&&t.uint32(18).bytes(e.bytes),void 0!==e.proof&&a.Proof.encode(e.proof,t.uint32(26).fork()).ldelim(),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},m);for(o.bytes=new Uint8Array;n.pos>>3){case 1:o.index=n.uint32();break;case 2:o.bytes=n.bytes();break;case 3:o.proof=a.Proof.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},m);return t.index=void 0!==e.index&&null!==e.index?Number(e.index):0,t.bytes=void 0!==e.bytes&&null!==e.bytes?P(e.bytes):new Uint8Array,t.proof=void 0!==e.proof&&null!==e.proof?a.Proof.fromJSON(e.proof):void 0,t},toJSON(e){const t={};return void 0!==e.index&&(t.index=e.index),void 0!==e.bytes&&(t.bytes=M(void 0!==e.bytes?e.bytes:new Uint8Array)),void 0!==e.proof&&(t.proof=e.proof?a.Proof.toJSON(e.proof):void 0),t},fromPartial(e){var t,n;const r=Object.assign({},m);return r.index=null!==(t=e.index)&&void 0!==t?t:0,r.bytes=null!==(n=e.bytes)&&void 0!==n?n:new Uint8Array,r.proof=void 0!==e.proof&&null!==e.proof?a.Proof.fromPartial(e.proof):void 0,r}};const v={};t.BlockID={encode:(e,n=i.default.Writer.create())=>(0!==e.hash.length&&n.uint32(10).bytes(e.hash),void 0!==e.partSetHeader&&t.PartSetHeader.encode(e.partSetHeader,n.uint32(18).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},v);for(a.hash=new Uint8Array;r.pos>>3){case 1:a.hash=r.bytes();break;case 2:a.partSetHeader=t.PartSetHeader.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},v);return n.hash=void 0!==e.hash&&null!==e.hash?P(e.hash):new Uint8Array,n.partSetHeader=void 0!==e.partSetHeader&&null!==e.partSetHeader?t.PartSetHeader.fromJSON(e.partSetHeader):void 0,n},toJSON(e){const n={};return void 0!==e.hash&&(n.hash=M(void 0!==e.hash?e.hash:new Uint8Array)),void 0!==e.partSetHeader&&(n.partSetHeader=e.partSetHeader?t.PartSetHeader.toJSON(e.partSetHeader):void 0),n},fromPartial(e){var n;const r=Object.assign({},v);return r.hash=null!==(n=e.hash)&&void 0!==n?n:new Uint8Array,r.partSetHeader=void 0!==e.partSetHeader&&null!==e.partSetHeader?t.PartSetHeader.fromPartial(e.partSetHeader):void 0,r}};const y={chainId:"",height:o.default.ZERO};t.Header={encode:(e,n=i.default.Writer.create())=>(void 0!==e.version&&s.Consensus.encode(e.version,n.uint32(10).fork()).ldelim(),""!==e.chainId&&n.uint32(18).string(e.chainId),e.height.isZero()||n.uint32(24).int64(e.height),void 0!==e.time&&c.Timestamp.encode(e.time,n.uint32(34).fork()).ldelim(),void 0!==e.lastBlockId&&t.BlockID.encode(e.lastBlockId,n.uint32(42).fork()).ldelim(),0!==e.lastCommitHash.length&&n.uint32(50).bytes(e.lastCommitHash),0!==e.dataHash.length&&n.uint32(58).bytes(e.dataHash),0!==e.validatorsHash.length&&n.uint32(66).bytes(e.validatorsHash),0!==e.nextValidatorsHash.length&&n.uint32(74).bytes(e.nextValidatorsHash),0!==e.consensusHash.length&&n.uint32(82).bytes(e.consensusHash),0!==e.appHash.length&&n.uint32(90).bytes(e.appHash),0!==e.lastResultsHash.length&&n.uint32(98).bytes(e.lastResultsHash),0!==e.evidenceHash.length&&n.uint32(106).bytes(e.evidenceHash),0!==e.proposerAddress.length&&n.uint32(114).bytes(e.proposerAddress),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},y);for(a.lastCommitHash=new Uint8Array,a.dataHash=new Uint8Array,a.validatorsHash=new Uint8Array,a.nextValidatorsHash=new Uint8Array,a.consensusHash=new Uint8Array,a.appHash=new Uint8Array,a.lastResultsHash=new Uint8Array,a.evidenceHash=new Uint8Array,a.proposerAddress=new Uint8Array;r.pos>>3){case 1:a.version=s.Consensus.decode(r,r.uint32());break;case 2:a.chainId=r.string();break;case 3:a.height=r.int64();break;case 4:a.time=c.Timestamp.decode(r,r.uint32());break;case 5:a.lastBlockId=t.BlockID.decode(r,r.uint32());break;case 6:a.lastCommitHash=r.bytes();break;case 7:a.dataHash=r.bytes();break;case 8:a.validatorsHash=r.bytes();break;case 9:a.nextValidatorsHash=r.bytes();break;case 10:a.consensusHash=r.bytes();break;case 11:a.appHash=r.bytes();break;case 12:a.lastResultsHash=r.bytes();break;case 13:a.evidenceHash=r.bytes();break;case 14:a.proposerAddress=r.bytes();break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},y);return n.version=void 0!==e.version&&null!==e.version?s.Consensus.fromJSON(e.version):void 0,n.chainId=void 0!==e.chainId&&null!==e.chainId?String(e.chainId):"",n.height=void 0!==e.height&&null!==e.height?o.default.fromString(e.height):o.default.ZERO,n.time=void 0!==e.time&&null!==e.time?N(e.time):void 0,n.lastBlockId=void 0!==e.lastBlockId&&null!==e.lastBlockId?t.BlockID.fromJSON(e.lastBlockId):void 0,n.lastCommitHash=void 0!==e.lastCommitHash&&null!==e.lastCommitHash?P(e.lastCommitHash):new Uint8Array,n.dataHash=void 0!==e.dataHash&&null!==e.dataHash?P(e.dataHash):new Uint8Array,n.validatorsHash=void 0!==e.validatorsHash&&null!==e.validatorsHash?P(e.validatorsHash):new Uint8Array,n.nextValidatorsHash=void 0!==e.nextValidatorsHash&&null!==e.nextValidatorsHash?P(e.nextValidatorsHash):new Uint8Array,n.consensusHash=void 0!==e.consensusHash&&null!==e.consensusHash?P(e.consensusHash):new Uint8Array,n.appHash=void 0!==e.appHash&&null!==e.appHash?P(e.appHash):new Uint8Array,n.lastResultsHash=void 0!==e.lastResultsHash&&null!==e.lastResultsHash?P(e.lastResultsHash):new Uint8Array,n.evidenceHash=void 0!==e.evidenceHash&&null!==e.evidenceHash?P(e.evidenceHash):new Uint8Array,n.proposerAddress=void 0!==e.proposerAddress&&null!==e.proposerAddress?P(e.proposerAddress):new Uint8Array,n},toJSON(e){const n={};return void 0!==e.version&&(n.version=e.version?s.Consensus.toJSON(e.version):void 0),void 0!==e.chainId&&(n.chainId=e.chainId),void 0!==e.height&&(n.height=(e.height||o.default.ZERO).toString()),void 0!==e.time&&(n.time=D(e.time).toISOString()),void 0!==e.lastBlockId&&(n.lastBlockId=e.lastBlockId?t.BlockID.toJSON(e.lastBlockId):void 0),void 0!==e.lastCommitHash&&(n.lastCommitHash=M(void 0!==e.lastCommitHash?e.lastCommitHash:new Uint8Array)),void 0!==e.dataHash&&(n.dataHash=M(void 0!==e.dataHash?e.dataHash:new Uint8Array)),void 0!==e.validatorsHash&&(n.validatorsHash=M(void 0!==e.validatorsHash?e.validatorsHash:new Uint8Array)),void 0!==e.nextValidatorsHash&&(n.nextValidatorsHash=M(void 0!==e.nextValidatorsHash?e.nextValidatorsHash:new Uint8Array)),void 0!==e.consensusHash&&(n.consensusHash=M(void 0!==e.consensusHash?e.consensusHash:new Uint8Array)),void 0!==e.appHash&&(n.appHash=M(void 0!==e.appHash?e.appHash:new Uint8Array)),void 0!==e.lastResultsHash&&(n.lastResultsHash=M(void 0!==e.lastResultsHash?e.lastResultsHash:new Uint8Array)),void 0!==e.evidenceHash&&(n.evidenceHash=M(void 0!==e.evidenceHash?e.evidenceHash:new Uint8Array)),void 0!==e.proposerAddress&&(n.proposerAddress=M(void 0!==e.proposerAddress?e.proposerAddress:new Uint8Array)),n},fromPartial(e){var n,r,i,a,u,d,l,f,h,p;const A=Object.assign({},y);return A.version=void 0!==e.version&&null!==e.version?s.Consensus.fromPartial(e.version):void 0,A.chainId=null!==(n=e.chainId)&&void 0!==n?n:"",A.height=void 0!==e.height&&null!==e.height?o.default.fromValue(e.height):o.default.ZERO,A.time=void 0!==e.time&&null!==e.time?c.Timestamp.fromPartial(e.time):void 0,A.lastBlockId=void 0!==e.lastBlockId&&null!==e.lastBlockId?t.BlockID.fromPartial(e.lastBlockId):void 0,A.lastCommitHash=null!==(r=e.lastCommitHash)&&void 0!==r?r:new Uint8Array,A.dataHash=null!==(i=e.dataHash)&&void 0!==i?i:new Uint8Array,A.validatorsHash=null!==(a=e.validatorsHash)&&void 0!==a?a:new Uint8Array,A.nextValidatorsHash=null!==(u=e.nextValidatorsHash)&&void 0!==u?u:new Uint8Array,A.consensusHash=null!==(d=e.consensusHash)&&void 0!==d?d:new Uint8Array,A.appHash=null!==(l=e.appHash)&&void 0!==l?l:new Uint8Array,A.lastResultsHash=null!==(f=e.lastResultsHash)&&void 0!==f?f:new Uint8Array,A.evidenceHash=null!==(h=e.evidenceHash)&&void 0!==h?h:new Uint8Array,A.proposerAddress=null!==(p=e.proposerAddress)&&void 0!==p?p:new Uint8Array,A}};const b={};t.Data={encode(e,t=i.default.Writer.create()){for(const n of e.txs)t.uint32(10).bytes(n);return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},b);for(o.txs=[];n.pos>>3){case 1:o.txs.push(n.bytes());break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},b);return n.txs=(null!==(t=e.txs)&&void 0!==t?t:[]).map(e=>P(e)),n},toJSON(e){const t={};return e.txs?t.txs=e.txs.map(e=>M(void 0!==e?e:new Uint8Array)):t.txs=[],t},fromPartial(e){var t;const n=Object.assign({},b);return n.txs=(null===(t=e.txs)||void 0===t?void 0:t.map(e=>e))||[],n}};const I={type:0,height:o.default.ZERO,round:0,validatorIndex:0};t.Vote={encode:(e,n=i.default.Writer.create())=>(0!==e.type&&n.uint32(8).int32(e.type),e.height.isZero()||n.uint32(16).int64(e.height),0!==e.round&&n.uint32(24).int32(e.round),void 0!==e.blockId&&t.BlockID.encode(e.blockId,n.uint32(34).fork()).ldelim(),void 0!==e.timestamp&&c.Timestamp.encode(e.timestamp,n.uint32(42).fork()).ldelim(),0!==e.validatorAddress.length&&n.uint32(50).bytes(e.validatorAddress),0!==e.validatorIndex&&n.uint32(56).int32(e.validatorIndex),0!==e.signature.length&&n.uint32(66).bytes(e.signature),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},I);for(a.validatorAddress=new Uint8Array,a.signature=new Uint8Array;r.pos>>3){case 1:a.type=r.int32();break;case 2:a.height=r.int64();break;case 3:a.round=r.int32();break;case 4:a.blockId=t.BlockID.decode(r,r.uint32());break;case 5:a.timestamp=c.Timestamp.decode(r,r.uint32());break;case 6:a.validatorAddress=r.bytes();break;case 7:a.validatorIndex=r.int32();break;case 8:a.signature=r.bytes();break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},I);return n.type=void 0!==e.type&&null!==e.type?p(e.type):0,n.height=void 0!==e.height&&null!==e.height?o.default.fromString(e.height):o.default.ZERO,n.round=void 0!==e.round&&null!==e.round?Number(e.round):0,n.blockId=void 0!==e.blockId&&null!==e.blockId?t.BlockID.fromJSON(e.blockId):void 0,n.timestamp=void 0!==e.timestamp&&null!==e.timestamp?N(e.timestamp):void 0,n.validatorAddress=void 0!==e.validatorAddress&&null!==e.validatorAddress?P(e.validatorAddress):new Uint8Array,n.validatorIndex=void 0!==e.validatorIndex&&null!==e.validatorIndex?Number(e.validatorIndex):0,n.signature=void 0!==e.signature&&null!==e.signature?P(e.signature):new Uint8Array,n},toJSON(e){const n={};return void 0!==e.type&&(n.type=A(e.type)),void 0!==e.height&&(n.height=(e.height||o.default.ZERO).toString()),void 0!==e.round&&(n.round=e.round),void 0!==e.blockId&&(n.blockId=e.blockId?t.BlockID.toJSON(e.blockId):void 0),void 0!==e.timestamp&&(n.timestamp=D(e.timestamp).toISOString()),void 0!==e.validatorAddress&&(n.validatorAddress=M(void 0!==e.validatorAddress?e.validatorAddress:new Uint8Array)),void 0!==e.validatorIndex&&(n.validatorIndex=e.validatorIndex),void 0!==e.signature&&(n.signature=M(void 0!==e.signature?e.signature:new Uint8Array)),n},fromPartial(e){var n,r,i,a,s;const u=Object.assign({},I);return u.type=null!==(n=e.type)&&void 0!==n?n:0,u.height=void 0!==e.height&&null!==e.height?o.default.fromValue(e.height):o.default.ZERO,u.round=null!==(r=e.round)&&void 0!==r?r:0,u.blockId=void 0!==e.blockId&&null!==e.blockId?t.BlockID.fromPartial(e.blockId):void 0,u.timestamp=void 0!==e.timestamp&&null!==e.timestamp?c.Timestamp.fromPartial(e.timestamp):void 0,u.validatorAddress=null!==(i=e.validatorAddress)&&void 0!==i?i:new Uint8Array,u.validatorIndex=null!==(a=e.validatorIndex)&&void 0!==a?a:0,u.signature=null!==(s=e.signature)&&void 0!==s?s:new Uint8Array,u}};const w={height:o.default.ZERO,round:0};t.Commit={encode(e,n=i.default.Writer.create()){e.height.isZero()||n.uint32(8).int64(e.height),0!==e.round&&n.uint32(16).int32(e.round),void 0!==e.blockId&&t.BlockID.encode(e.blockId,n.uint32(26).fork()).ldelim();for(const r of e.signatures)t.CommitSig.encode(r,n.uint32(34).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},w);for(a.signatures=[];r.pos>>3){case 1:a.height=r.int64();break;case 2:a.round=r.int32();break;case 3:a.blockId=t.BlockID.decode(r,r.uint32());break;case 4:a.signatures.push(t.CommitSig.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},w);return r.height=void 0!==e.height&&null!==e.height?o.default.fromString(e.height):o.default.ZERO,r.round=void 0!==e.round&&null!==e.round?Number(e.round):0,r.blockId=void 0!==e.blockId&&null!==e.blockId?t.BlockID.fromJSON(e.blockId):void 0,r.signatures=(null!==(n=e.signatures)&&void 0!==n?n:[]).map(e=>t.CommitSig.fromJSON(e)),r},toJSON(e){const n={};return void 0!==e.height&&(n.height=(e.height||o.default.ZERO).toString()),void 0!==e.round&&(n.round=e.round),void 0!==e.blockId&&(n.blockId=e.blockId?t.BlockID.toJSON(e.blockId):void 0),e.signatures?n.signatures=e.signatures.map(e=>e?t.CommitSig.toJSON(e):void 0):n.signatures=[],n},fromPartial(e){var n,r;const i=Object.assign({},w);return i.height=void 0!==e.height&&null!==e.height?o.default.fromValue(e.height):o.default.ZERO,i.round=null!==(n=e.round)&&void 0!==n?n:0,i.blockId=void 0!==e.blockId&&null!==e.blockId?t.BlockID.fromPartial(e.blockId):void 0,i.signatures=(null===(r=e.signatures)||void 0===r?void 0:r.map(e=>t.CommitSig.fromPartial(e)))||[],i}};const E={blockIdFlag:0};t.CommitSig={encode:(e,t=i.default.Writer.create())=>(0!==e.blockIdFlag&&t.uint32(8).int32(e.blockIdFlag),0!==e.validatorAddress.length&&t.uint32(18).bytes(e.validatorAddress),void 0!==e.timestamp&&c.Timestamp.encode(e.timestamp,t.uint32(26).fork()).ldelim(),0!==e.signature.length&&t.uint32(34).bytes(e.signature),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},E);for(o.validatorAddress=new Uint8Array,o.signature=new Uint8Array;n.pos>>3){case 1:o.blockIdFlag=n.int32();break;case 2:o.validatorAddress=n.bytes();break;case 3:o.timestamp=c.Timestamp.decode(n,n.uint32());break;case 4:o.signature=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},E);return t.blockIdFlag=void 0!==e.blockIdFlag&&null!==e.blockIdFlag?f(e.blockIdFlag):0,t.validatorAddress=void 0!==e.validatorAddress&&null!==e.validatorAddress?P(e.validatorAddress):new Uint8Array,t.timestamp=void 0!==e.timestamp&&null!==e.timestamp?N(e.timestamp):void 0,t.signature=void 0!==e.signature&&null!==e.signature?P(e.signature):new Uint8Array,t},toJSON(e){const t={};return void 0!==e.blockIdFlag&&(t.blockIdFlag=h(e.blockIdFlag)),void 0!==e.validatorAddress&&(t.validatorAddress=M(void 0!==e.validatorAddress?e.validatorAddress:new Uint8Array)),void 0!==e.timestamp&&(t.timestamp=D(e.timestamp).toISOString()),void 0!==e.signature&&(t.signature=M(void 0!==e.signature?e.signature:new Uint8Array)),t},fromPartial(e){var t,n,r;const o=Object.assign({},E);return o.blockIdFlag=null!==(t=e.blockIdFlag)&&void 0!==t?t:0,o.validatorAddress=null!==(n=e.validatorAddress)&&void 0!==n?n:new Uint8Array,o.timestamp=void 0!==e.timestamp&&null!==e.timestamp?c.Timestamp.fromPartial(e.timestamp):void 0,o.signature=null!==(r=e.signature)&&void 0!==r?r:new Uint8Array,o}};const _={type:0,height:o.default.ZERO,round:0,polRound:0};t.Proposal={encode:(e,n=i.default.Writer.create())=>(0!==e.type&&n.uint32(8).int32(e.type),e.height.isZero()||n.uint32(16).int64(e.height),0!==e.round&&n.uint32(24).int32(e.round),0!==e.polRound&&n.uint32(32).int32(e.polRound),void 0!==e.blockId&&t.BlockID.encode(e.blockId,n.uint32(42).fork()).ldelim(),void 0!==e.timestamp&&c.Timestamp.encode(e.timestamp,n.uint32(50).fork()).ldelim(),0!==e.signature.length&&n.uint32(58).bytes(e.signature),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},_);for(a.signature=new Uint8Array;r.pos>>3){case 1:a.type=r.int32();break;case 2:a.height=r.int64();break;case 3:a.round=r.int32();break;case 4:a.polRound=r.int32();break;case 5:a.blockId=t.BlockID.decode(r,r.uint32());break;case 6:a.timestamp=c.Timestamp.decode(r,r.uint32());break;case 7:a.signature=r.bytes();break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},_);return n.type=void 0!==e.type&&null!==e.type?p(e.type):0,n.height=void 0!==e.height&&null!==e.height?o.default.fromString(e.height):o.default.ZERO,n.round=void 0!==e.round&&null!==e.round?Number(e.round):0,n.polRound=void 0!==e.polRound&&null!==e.polRound?Number(e.polRound):0,n.blockId=void 0!==e.blockId&&null!==e.blockId?t.BlockID.fromJSON(e.blockId):void 0,n.timestamp=void 0!==e.timestamp&&null!==e.timestamp?N(e.timestamp):void 0,n.signature=void 0!==e.signature&&null!==e.signature?P(e.signature):new Uint8Array,n},toJSON(e){const n={};return void 0!==e.type&&(n.type=A(e.type)),void 0!==e.height&&(n.height=(e.height||o.default.ZERO).toString()),void 0!==e.round&&(n.round=e.round),void 0!==e.polRound&&(n.polRound=e.polRound),void 0!==e.blockId&&(n.blockId=e.blockId?t.BlockID.toJSON(e.blockId):void 0),void 0!==e.timestamp&&(n.timestamp=D(e.timestamp).toISOString()),void 0!==e.signature&&(n.signature=M(void 0!==e.signature?e.signature:new Uint8Array)),n},fromPartial(e){var n,r,i,a;const s=Object.assign({},_);return s.type=null!==(n=e.type)&&void 0!==n?n:0,s.height=void 0!==e.height&&null!==e.height?o.default.fromValue(e.height):o.default.ZERO,s.round=null!==(r=e.round)&&void 0!==r?r:0,s.polRound=null!==(i=e.polRound)&&void 0!==i?i:0,s.blockId=void 0!==e.blockId&&null!==e.blockId?t.BlockID.fromPartial(e.blockId):void 0,s.timestamp=void 0!==e.timestamp&&null!==e.timestamp?c.Timestamp.fromPartial(e.timestamp):void 0,s.signature=null!==(a=e.signature)&&void 0!==a?a:new Uint8Array,s}};const B={};t.SignedHeader={encode:(e,n=i.default.Writer.create())=>(void 0!==e.header&&t.Header.encode(e.header,n.uint32(10).fork()).ldelim(),void 0!==e.commit&&t.Commit.encode(e.commit,n.uint32(18).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},B);for(;r.pos>>3){case 1:a.header=t.Header.decode(r,r.uint32());break;case 2:a.commit=t.Commit.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},B);return n.header=void 0!==e.header&&null!==e.header?t.Header.fromJSON(e.header):void 0,n.commit=void 0!==e.commit&&null!==e.commit?t.Commit.fromJSON(e.commit):void 0,n},toJSON(e){const n={};return void 0!==e.header&&(n.header=e.header?t.Header.toJSON(e.header):void 0),void 0!==e.commit&&(n.commit=e.commit?t.Commit.toJSON(e.commit):void 0),n},fromPartial(e){const n=Object.assign({},B);return n.header=void 0!==e.header&&null!==e.header?t.Header.fromPartial(e.header):void 0,n.commit=void 0!==e.commit&&null!==e.commit?t.Commit.fromPartial(e.commit):void 0,n}};const C={};t.LightBlock={encode:(e,n=i.default.Writer.create())=>(void 0!==e.signedHeader&&t.SignedHeader.encode(e.signedHeader,n.uint32(10).fork()).ldelim(),void 0!==e.validatorSet&&u.ValidatorSet.encode(e.validatorSet,n.uint32(18).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},C);for(;r.pos>>3){case 1:a.signedHeader=t.SignedHeader.decode(r,r.uint32());break;case 2:a.validatorSet=u.ValidatorSet.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},C);return n.signedHeader=void 0!==e.signedHeader&&null!==e.signedHeader?t.SignedHeader.fromJSON(e.signedHeader):void 0,n.validatorSet=void 0!==e.validatorSet&&null!==e.validatorSet?u.ValidatorSet.fromJSON(e.validatorSet):void 0,n},toJSON(e){const n={};return void 0!==e.signedHeader&&(n.signedHeader=e.signedHeader?t.SignedHeader.toJSON(e.signedHeader):void 0),void 0!==e.validatorSet&&(n.validatorSet=e.validatorSet?u.ValidatorSet.toJSON(e.validatorSet):void 0),n},fromPartial(e){const n=Object.assign({},C);return n.signedHeader=void 0!==e.signedHeader&&null!==e.signedHeader?t.SignedHeader.fromPartial(e.signedHeader):void 0,n.validatorSet=void 0!==e.validatorSet&&null!==e.validatorSet?u.ValidatorSet.fromPartial(e.validatorSet):void 0,n}};const k={blockSize:o.default.ZERO,numTxs:o.default.ZERO};t.BlockMeta={encode:(e,n=i.default.Writer.create())=>(void 0!==e.blockId&&t.BlockID.encode(e.blockId,n.uint32(10).fork()).ldelim(),e.blockSize.isZero()||n.uint32(16).int64(e.blockSize),void 0!==e.header&&t.Header.encode(e.header,n.uint32(26).fork()).ldelim(),e.numTxs.isZero()||n.uint32(32).int64(e.numTxs),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},k);for(;r.pos>>3){case 1:a.blockId=t.BlockID.decode(r,r.uint32());break;case 2:a.blockSize=r.int64();break;case 3:a.header=t.Header.decode(r,r.uint32());break;case 4:a.numTxs=r.int64();break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},k);return n.blockId=void 0!==e.blockId&&null!==e.blockId?t.BlockID.fromJSON(e.blockId):void 0,n.blockSize=void 0!==e.blockSize&&null!==e.blockSize?o.default.fromString(e.blockSize):o.default.ZERO,n.header=void 0!==e.header&&null!==e.header?t.Header.fromJSON(e.header):void 0,n.numTxs=void 0!==e.numTxs&&null!==e.numTxs?o.default.fromString(e.numTxs):o.default.ZERO,n},toJSON(e){const n={};return void 0!==e.blockId&&(n.blockId=e.blockId?t.BlockID.toJSON(e.blockId):void 0),void 0!==e.blockSize&&(n.blockSize=(e.blockSize||o.default.ZERO).toString()),void 0!==e.header&&(n.header=e.header?t.Header.toJSON(e.header):void 0),void 0!==e.numTxs&&(n.numTxs=(e.numTxs||o.default.ZERO).toString()),n},fromPartial(e){const n=Object.assign({},k);return n.blockId=void 0!==e.blockId&&null!==e.blockId?t.BlockID.fromPartial(e.blockId):void 0,n.blockSize=void 0!==e.blockSize&&null!==e.blockSize?o.default.fromValue(e.blockSize):o.default.ZERO,n.header=void 0!==e.header&&null!==e.header?t.Header.fromPartial(e.header):void 0,n.numTxs=void 0!==e.numTxs&&null!==e.numTxs?o.default.fromValue(e.numTxs):o.default.ZERO,n}};const S={};t.TxProof={encode:(e,t=i.default.Writer.create())=>(0!==e.rootHash.length&&t.uint32(10).bytes(e.rootHash),0!==e.data.length&&t.uint32(18).bytes(e.data),void 0!==e.proof&&a.Proof.encode(e.proof,t.uint32(26).fork()).ldelim(),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},S);for(o.rootHash=new Uint8Array,o.data=new Uint8Array;n.pos>>3){case 1:o.rootHash=n.bytes();break;case 2:o.data=n.bytes();break;case 3:o.proof=a.Proof.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},S);return t.rootHash=void 0!==e.rootHash&&null!==e.rootHash?P(e.rootHash):new Uint8Array,t.data=void 0!==e.data&&null!==e.data?P(e.data):new Uint8Array,t.proof=void 0!==e.proof&&null!==e.proof?a.Proof.fromJSON(e.proof):void 0,t},toJSON(e){const t={};return void 0!==e.rootHash&&(t.rootHash=M(void 0!==e.rootHash?e.rootHash:new Uint8Array)),void 0!==e.data&&(t.data=M(void 0!==e.data?e.data:new Uint8Array)),void 0!==e.proof&&(t.proof=e.proof?a.Proof.toJSON(e.proof):void 0),t},fromPartial(e){var t,n;const r=Object.assign({},S);return r.rootHash=null!==(t=e.rootHash)&&void 0!==t?t:new Uint8Array,r.data=null!==(n=e.data)&&void 0!==n?n:new Uint8Array,r.proof=void 0!==e.proof&&null!==e.proof?a.Proof.fromPartial(e.proof):void 0,r}};var O=(()=>{if(void 0!==O)return O;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw"Unable to locate global object"})();const Q=O.atob||(e=>O.Buffer.from(e,"base64").toString("binary"));function P(e){const t=Q(e),n=new Uint8Array(t.length);for(let e=0;eO.Buffer.from(e,"binary").toString("base64"));function M(e){const t=[];for(const n of e)t.push(String.fromCharCode(n));return R(t.join(""))}function x(e){var t;return{seconds:(t=e.getTime()/1e3,o.default.fromNumber(t)),nanos:e.getTime()%1e3*1e6}}function D(e){let t=1e3*e.seconds.toNumber();return t+=e.nanos/1e6,new Date(t)}function N(e){return e instanceof Date?x(e):"string"==typeof e?x(new Date(e)):c.Timestamp.fromJSON(e)}i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())}).call(this,n(3))},function(e,t,n){"use strict";(function(t){var r=n(14),o=n(571),i=n(236),a={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(c=n(237)),c),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(s(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,n=t&&t.silentJSONParsing,o=t&&t.forcedJSONParsing,a=!n&&"json"===this.responseType;if(a||o&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw i(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){u.headers[e]=r.merge(a)})),e.exports=u}).call(this,n(6))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasProtocol=t.instanceOfRpcStreamingClient=void 0,t.instanceOfRpcStreamingClient=function(e){return"function"==typeof e.listen},t.hasProtocol=function(e){return-1!==e.search("://")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Tendermint34Client=t.VoteType=t.broadcastTxSyncSuccess=t.broadcastTxCommitSuccess=t.SubscriptionEventType=t.Method=void 0;var r=n(113);Object.defineProperty(t,"Method",{enumerable:!0,get:function(){return r.Method}}),Object.defineProperty(t,"SubscriptionEventType",{enumerable:!0,get:function(){return r.SubscriptionEventType}});var o=n(588);Object.defineProperty(t,"broadcastTxCommitSuccess",{enumerable:!0,get:function(){return o.broadcastTxCommitSuccess}}),Object.defineProperty(t,"broadcastTxSyncSuccess",{enumerable:!0,get:function(){return o.broadcastTxSyncSuccess}}),Object.defineProperty(t,"VoteType",{enumerable:!0,get:function(){return o.VoteType}});var i=n(589);Object.defineProperty(t,"Tendermint34Client",{enumerable:!0,get:function(){return i.Tendermint34Client}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildQuery=t.SubscriptionEventType=t.Method=void 0,function(e){e.AbciInfo="abci_info",e.AbciQuery="abci_query",e.Block="block",e.Blockchain="blockchain",e.BlockResults="block_results",e.BlockSearch="block_search",e.BroadcastTxAsync="broadcast_tx_async",e.BroadcastTxSync="broadcast_tx_sync",e.BroadcastTxCommit="broadcast_tx_commit",e.Commit="commit",e.Genesis="genesis",e.Health="health",e.NumUnconfirmedTxs="num_unconfirmed_txs",e.Status="status",e.Subscribe="subscribe",e.Tx="tx",e.TxSearch="tx_search",e.Validators="validators",e.Unsubscribe="unsubscribe"}(t.Method||(t.Method={})),function(e){e.NewBlock="NewBlock",e.NewBlockHeader="NewBlockHeader",e.Tx="Tx"}(t.SubscriptionEventType||(t.SubscriptionEventType={})),t.buildQuery=function(e){return[...(e.tags?e.tags:[]).map(e=>`${e.key}='${e.value}'`),...e.raw?[e.raw]:[]].join(" AND ")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodeBlockId=t.encodeVersion=t.encodeBytes=t.encodeTime=t.encodeInt=t.encodeString=t.Integer=t.dictionaryToStringMap=t.may=t.optional=t.assertNotEmpty=t.assertObject=t.assertArray=t.assertNumber=t.assertString=t.assertBoolean=t.assertSet=void 0;const r=n(5),o=n(11);function i(e){if(void 0===e)throw new Error("Value must not be undefined");if(null===e)throw new Error("Value must not be null");return e}t.assertSet=i,t.assertBoolean=function(e){if(i(e),"boolean"!=typeof e)throw new Error("Value must be a boolean");return e},t.assertString=function(e){if(i(e),"string"!=typeof e)throw new Error("Value must be a string");return e},t.assertNumber=function(e){if(i(e),"number"!=typeof e)throw new Error("Value must be a number");return e},t.assertArray=function(e){if(i(e),!Array.isArray(e))throw new Error("Value must be a an array");return e},t.assertObject=function(e){if(i(e),"object"!=typeof e)throw new Error("Value must be an object");if("[object Object]"!==Object.prototype.toString.call(e))throw new Error("Value must be a simple object");return e},t.assertNotEmpty=function(e){if(i(e),"number"==typeof e&&0===e)throw new Error("must provide a non-zero value");if(0===e.length)throw new Error("must provide a non-empty value");return e},t.optional=function(e,t){return null==e?t:e},t.may=function(e,t){return null==t?void 0:e(t)},t.dictionaryToStringMap=function(e){const t=new Map;for(const n of Object.keys(e)){const r=e[n];if("string"!=typeof r)throw new Error("Found dictionary value of type other than string");t.set(n,r)}return t};function a(e){return e>=128?Uint8Array.from([255&e|128,...a(e>>7)]):Uint8Array.from([255&e])}t.Integer=class{static parse(e){return("number"==typeof e?new o.Int53(e):o.Int53.fromString(e)).toNumber()}static encode(e){return new o.Int53(e).toString()}},t.encodeString=function(e){const t=(0,r.toUtf8)(e);return Uint8Array.from([t.length,...t])},t.encodeInt=a,t.encodeTime=function(e){const t=e.getTime(),n=Math.floor(t/1e3),r=n?[8,...a(n)]:new Uint8Array,o=(e.nanoseconds||0)+t%1e3*1e6,i=o?[16,...a(o)]:new Uint8Array;return Uint8Array.from([...r,...i])},t.encodeBytes=function(e){if(e.length>=128)throw new Error("Not implemented for byte arrays of length 128 or more");return e.length?Uint8Array.from([e.length,...e]):new Uint8Array},t.encodeVersion=function(e){const t=e.block?Uint8Array.from([8,...a(e.block)]):new Uint8Array,n=e.app?Uint8Array.from([16,...a(e.app)]):new Uint8Array;return Uint8Array.from([...t,...n])},t.encodeBlockId=function(e){return Uint8Array.from([10,e.hash.length,...e.hash,18,e.parts.hash.length+4,8,e.parts.total,18,e.parts.hash.length,...e.parts.hash])}},function(e,t,n){const r=n(72),{SigningCosmosClient:o}=n(73);t.addKeplrChain=async function(e){let t=r.default.find(t=>t.name===e);if(window.getOfflineSigner&&window.keplr)if(window.keplr.experimentalSuggestChain)try{await window.keplr.experimentalSuggestChain({chainId:t.chainId,chainName:t.name,rpc:t.rpcURL,rest:t.apiURL,stakeCurrency:{coinDenom:t.coinLookup.viewDenom,coinMinimalDenom:t.coinLookup.chainDenom,coinDecimals:6},bip44:{coinType:118},bech32Config:{bech32PrefixAccAddr:t.coinLookup.addressPrefix,bech32PrefixAccPub:t.coinLookup.addressPrefix+"pub",bech32PrefixValAddr:t.coinLookup.addressPrefix+"valoper",bech32PrefixValPub:t.coinLookup.addressPrefix+"valoperpub",bech32PrefixConsAddr:t.coinLookup.addressPrefix+"valcons",bech32PrefixConsPub:t.coinLookup.addressPrefix+"valconspub"},currencies:[{coinDenom:t.coinLookup.viewDenom,coinMinimalDenom:t.coinLookup.chainDenom,coinDecimals:6}],feeCurrencies:[{coinDenom:t.coinLookup.viewDenom,coinMinimalDenom:t.coinLookup.chainDenom,coinDecimals:6}],coinType:118,gasPriceStep:{low:.01,average:.025,high:.04}})}catch{alert("Failed to suggest the chain")}else alert("Please use the recent version of keplr extension");else alert("Please install keplr extension");const n=t.chainId;await window.keplr.enable(n);const i=window.getOfflineSigner(n);window.keplr.defaultOptions={sign:{preferNoSetMemo:!0,preferNoSetFee:!0,disableBalanceCheck:!1}};const a=await i.getAccounts();new o(t.rpcURL,a[0].address,i);return{accounts:a,foundChain:t}},t.getCount=function(){return 1}},function(e,t,n){const r=n(72),{SigningCosmosClient:o}=n(73),{assertIsBroadcastTxSuccess:i,SigningStargateClient:a}=n(207),s=n(249);t.sendByChain=async function(e,t,n,o,i,c,u){let d=r.default.find(t=>t.name===e);if(n=parseFloat(n),isNaN(n))return alert("Invalid amount"),!1;n*=1e6,n=Math.floor(n),(async()=>{const e=d.chainId;await window.keplr.enable(e);const r=await window.getOfflineSignerAuto(e),l=await r.getAccounts(),f=await a.connectWithSigner(d.rpcURL,r),h={denom:d.coinLookup.chainDenom,amount:n.toString()},p={amount:[{denom:d.coinLookup.chainDenom,amount:"5000"}],gas:"200000"};try{const e=await f.sendTokens(l[0].address,t,[h],p,i);if(console.log(e),void 0!==e.code&&0!==e.code)alert("Failed to send tx: "+e.log||!1);else{u("#spinner").hide("slow"),u("#AcceptedTx").show(),u("#returnResult").html(e.transactionHash);var A="/api-cosmos/?tx_hash="+e.transactionHash+"&order_id="+o;s.get(A).then((function(t){console.log(t),u("#returnResultStore").html(t.data.message),u("#sendForm").hide(),u("#viewFinalTx").show(),u("#checkAdresse").show(),u("#waitingcheckAdresse").hide(),u("#checkAdresse").css("color","#31BF91"),u("#checkAmount").show(),u("#waitingcheckAmount").hide(),u(".woocommerce-thankyou-order-received").css("border-color","#20c005"),u(".woocommerce-thankyou-order-received").css("color","#20c005"),u(".woocommerce-thankyou-order-received").html("Payment accepted"),u("#validateTx").hide("slow"),u("#finalUrlTx").attr("href","https://www.mintscan.io/"+d.mintscanId+"/txs/"+e.transactionHash),u("#viewFinalTx").show(1e3),u("#timer").hide(),"true"===c&&setTimeout((function(){window.location.href="/my-account/view-order/"+o+"/"}),5e3)})).catch((function(e){}))}}catch(e){console.error(e),u("#keplrError").html(e),u("#spinner").hide(),u("#cancelTx").show()}})()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findAttribute=t.parseLogs=t.parseLog=t.parseEvent=t.parseAttribute=void 0;const r=n(45);function o(e){if(!r.isNonNullObject(e))throw new Error("Attribute must be a non-null object");const{key:t,value:n}=e;if("string"!=typeof t||!t)throw new Error("Attribute's key must be a non-empty string");if("string"!=typeof n&&void 0!==n)throw new Error("Attribute's value must be a string or unset");return{key:t,value:n||""}}function i(e){if(!r.isNonNullObject(e))throw new Error("Event must be a non-null object");const{type:t,attributes:n}=e;if("string"!=typeof t||""===t)throw new Error("Event type must be a non-empty string");if(!Array.isArray(n))throw new Error("Event's attributes must be an array");return{type:t,attributes:n.map(o)}}function a(e){if(!r.isNonNullObject(e))throw new Error("Log must be a non-null object");const{msg_index:t,log:n,events:o}=e;if("number"!=typeof t)throw new Error("Log's msg_index must be a number");if("string"!=typeof n)throw new Error("Log's log must be a string");if(!Array.isArray(o))throw new Error("Log's events must be an array");return{msg_index:t,log:n,events:o.map(i)}}t.parseAttribute=o,t.parseEvent=i,t.parseLog=a,t.parseLogs=function(e){if(!Array.isArray(e))throw new Error("Logs must be an array");return e.map(a)},t.findAttribute=function(e,t,n){var r;const o=e.find(()=>!0),i=null===(r=null==o?void 0:o.events.find(e=>e.type===t))||void 0===r?void 0:r.attributes.find(e=>e.key===n);if(!i)throw new Error(`Could not find attribute '${n}' in first event of type '${t}' in first log.`);return i}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pubkeyToAddress=t.rawSecp256k1PubkeyToAddress=void 0;const r=n(46),o=n(22),i=n(65);function a(e,t){if(33!==e.length)throw new Error("Invalid Secp256k1 pubkey length (compressed): "+e.length);const n=r.sha256(e),i=r.ripemd160(n);return o.Bech32.encode(t,i)}t.rawSecp256k1PubkeyToAddress=a,t.pubkeyToAddress=function(e,t){const n=o.fromBase64(e.value);switch(e.type){case i.pubkeyType.secp256k1:return a(n,t);case i.pubkeyType.ed25519:{if(32!==n.length)throw new Error("Invalid Ed25519 pubkey length: "+n.length);const e=r.sha256(n);return o.Bech32.encode(t,e.slice(0,20))}case i.pubkeyType.sr25519:{if(32!==n.length)throw new Error("Invalid Sr25519 pubkey length: "+n.length);const e=r.sha256(n);return o.Bech32.encode(t,e.slice(0,20))}default:throw new Error("Unrecognized public key algorithm")}}},function(e,t,n){"use strict";for(var r="qpzry9x8gf2tvdw0s3jn54khce6mua7l",o={},i=0;i>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function c(e){for(var t=1,n=0;n126)return"Invalid prefix ("+e+")";t=s(t)^r>>5}for(t=s(t),n=0;nt)return"Exceeds length limit";var n=e.toLowerCase(),r=e.toUpperCase();if(e!==n&&e!==r)return"Mixed-case string "+e;var i=(e=n).lastIndexOf("1");if(-1===i)return"No separator character for "+e;if(0===i)return"Missing prefix for "+e;var a=e.slice(0,i),u=e.slice(i+1);if(u.length<6)return"Data too short";var d=c(a);if("string"==typeof d)return d;for(var l=[],f=0;f=u.length||l.push(p)}return 1!==d?"Invalid checksum for "+e:{prefix:a,words:l}}function d(e,t,n,r){for(var o=0,i=0,a=(1<=n;)i-=n,s.push(o>>i&a);if(r)i>0&&s.push(o<=t)return"Excess padding";if(o<n)throw new TypeError("Exceeds length limit");var o=c(e=e.toLowerCase());if("string"==typeof o)throw new Error(o);for(var i=e+"1",a=0;a>5!=0)throw new Error("Non 5-bit word");o=s(o)^u,i+=r.charAt(u)}for(a=0;a<6;++a)o=s(o);for(o^=1,a=0;a<6;++a){i+=r.charAt(o>>5*(5-a)&31)}return i},toWordsUnsafe:function(e){var t=d(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=d(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=d(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=d(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const r=n(38),o=n(59),i=n(32),a=n(140);let s=a._default;const c="A wordlist is required but a default could not be found.\nPlease pass a 2048 word array explicitly.";function u(e){return(e||"").normalize("NFKD")}function d(e,t,n){for(;e.lengthd(e.toString(2),"0",8)).join("")}function h(e){const t=8*e.length/32,n=r("sha256").update(e).digest();return f(Array.from(n)).slice(0,t)}function p(e){return"mnemonic"+(e||"")}function A(t,n){if(!(n=n||s))throw new Error(c);const r=u(t).split(" ");if(r.length%3!=0)throw new Error("Invalid mnemonic");const o=r.map(e=>{const t=n.indexOf(e);if(-1===t)throw new Error("Invalid mnemonic");return d(t.toString(2),"0",11)}).join(""),i=32*Math.floor(o.length/33),a=o.slice(0,i),f=o.slice(i),p=a.match(/(.{1,8})/g).map(l);if(p.length<16)throw new Error("Invalid entropy");if(p.length>32)throw new Error("Invalid entropy");if(p.length%4!=0)throw new Error("Invalid entropy");const A=e.from(p);if(h(A)!==f)throw new Error("Invalid mnemonic checksum");return A.toString("hex")}function g(t,n){if(e.isBuffer(t)||(t=e.from(t,"hex")),!(n=n||s))throw new Error(c);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=(f(Array.from(t))+h(t)).match(/(.{1,11})/g).map(e=>{const t=l(e);return n[t]});return"あいこくしん"===n[0]?r.join(" "):r.join(" ")}t.mnemonicToSeedSync=function(t,n){const r=e.from(u(t),"utf8"),i=e.from(p(u(n)),"utf8");return o.pbkdf2Sync(r,i,2048,64,"sha512")},t.mnemonicToSeed=function(t,n){return Promise.resolve().then(()=>function(e,t,n,r,i){return Promise.resolve().then(()=>new Promise((a,s)=>{o.pbkdf2(e,t,n,r,i,(e,t)=>e?s(e):a(t))}))}(e.from(u(t),"utf8"),e.from(p(u(n)),"utf8"),2048,64,"sha512"))},t.mnemonicToEntropy=A,t.entropyToMnemonic=g,t.generateMnemonic=function(e,t,n){if((e=e||128)%32!=0)throw new TypeError("Invalid entropy");return g((t=t||i)(e/8),n)},t.validateMnemonic=function(e,t){try{A(e,t)}catch(e){return!1}return!0},t.setDefaultWordlist=function(e){const t=a.wordlists[e];if(!t)throw new Error('Could not find wordlist for language "'+e+'"');s=t},t.getDefaultWordlist=function(){if(!s)throw new Error("No Default Wordlist set");return Object.keys(a.wordlists).filter(e=>"JA"!==e&&"EN"!==e&&a.wordlists[e].every((e,t)=>e===s[t]))[0]};var m=n(140);t.wordlists=m.wordlists}).call(this,n(7).Buffer)},function(e,t,n){"use strict";var r=n(4).Buffer,o=n(272).Transform;function i(e){o.call(this),this._block=r.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}n(2)(i,o),i.prototype._transform=function(e,t,n){var r=null;try{this.update(e,t)}catch(e){r=e}n(r)},i.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},i.prototype.update=function(e,t){if(function(e,t){if(!r.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");r.isBuffer(e)||(e=r.from(e,t));for(var n=this._block,o=0;this._blockOffset+e.length-o>=this._blockSize;){for(var i=this._blockOffset;i0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},i.prototype._update=function(){throw new Error("_update is not implemented")},i.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var n=0;n<4;++n)this._length[n]=0;return t},i.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=i},function(e,t,n){"use strict";(function(t,r){var o;e.exports=B,B.ReadableState=_;n(29).EventEmitter;var i=function(e,t){return e.listeners(t).length},a=n(124),s=n(7).Buffer,c=t.Uint8Array||function(){};var u,d=n(273);u=d&&d.debuglog?d.debuglog("stream"):function(){};var l,f,h,p=n(274),A=n(125),g=n(126).getHighWaterMark,m=n(39).codes,v=m.ERR_INVALID_ARG_TYPE,y=m.ERR_STREAM_PUSH_AFTER_EOF,b=m.ERR_METHOD_NOT_IMPLEMENTED,I=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(2)(B,a);var w=A.errorOrDestroy,E=["error","close","destroy","pause","resume"];function _(e,t,r){o=o||n(40),e=e||{},"boolean"!=typeof r&&(r=t instanceof o),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",r),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!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=n(30).StringDecoder),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function B(e){if(o=o||n(40),!(this instanceof B))return new B(e);var t=this instanceof o;this._readableState=new _(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function C(e,t,n,r,o){u("readableAddChunk",t);var i,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(u("onEofChunk"),t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,Q(e)))}(e,a);else if(o||(i=function(e,t){var n;r=t,s.isBuffer(r)||r instanceof c||"string"==typeof t||void 0===t||e.objectMode||(n=new v("chunk",["string","Buffer","Uint8Array"],t));var r;return n}(a,t)),i)w(e,i);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),r)a.endEmitted?w(e,new I):k(e,a,t,!0);else if(a.ended)w(e,new y);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?k(e,a,t,!1):P(e,a)):k(e,a,t,!1)}else r||(a.reading=!1,P(e,a));return!a.ended&&(a.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(Q,e))}function Q(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,N(e)}function P(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function x(e){u("readable nexttick read 0"),e.read(0)}function D(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),N(e),t.flowing&&!t.reading&&e.read(0)}function N(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function T(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function j(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(U,t,e))}function U(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function H(e,t){for(var n=0,r=e.length;n=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?j(this):O(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&j(this),null;var r,o=t.needReadable;return u("need readable",o),(0===t.length||t.length-e0?T(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&j(this)),null!==r&&this.emit("data",r),r},B.prototype._read=function(e){w(this,new b("_read()"))},B.prototype.pipe=function(e,t){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,u("pipe count=%d opts=%j",o.pipesCount,t);var a=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:g;function s(t,r){u("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,u("cleanup"),e.removeListener("close",p),e.removeListener("finish",A),e.removeListener("drain",d),e.removeListener("error",h),e.removeListener("unpipe",s),n.removeListener("end",c),n.removeListener("end",g),n.removeListener("data",f),l=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||d())}function c(){u("onend"),e.end()}o.endEmitted?r.nextTick(a):n.once("end",a),e.on("unpipe",s);var d=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,N(e))}}(n);e.on("drain",d);var l=!1;function f(t){u("ondata");var r=e.write(t);u("dest.write",r),!1===r&&((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==H(o.pipes,e))&&!l&&(u("false write response, pause",o.awaitDrain),o.awaitDrain++),n.pause())}function h(t){u("onerror",t),g(),e.removeListener("error",h),0===i(e,"error")&&w(e,t)}function p(){e.removeListener("finish",A),g()}function A(){u("onfinish"),e.removeListener("close",p),g()}function g(){u("unpipe"),n.unpipe(e)}return n.on("data",f),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",h),e.once("close",p),e.once("finish",A),e.emit("pipe",n),o.flowing||(u("pipe resume"),n.resume()),e},B.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==o.flowing&&this.resume()):"readable"===e&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,u("on readable",o.length,o.reading),o.length?O(this):o.reading||r.nextTick(x,this))),n},B.prototype.addListener=B.prototype.on,B.prototype.removeListener=function(e,t){var n=a.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(M,this),n},B.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(M,this),t},B.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(D,e,t))}(this,e)),e.paused=!1,this},B.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},B.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var o in e.on("end",(function(){if(u("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(o){(u("wrapped data"),n.decoder&&(o=n.decoder.write(o)),n.objectMode&&null==o)||(n.objectMode||o&&o.length)&&(t.push(o)||(r=!0,e.pause()))})),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var i=0;i-1))throw new I(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(B.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(B.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),B.prototype._write=function(e,t,n){n(new A("_write()"))},B.prototype._writev=null,B.prototype.end=function(e,t,n){var o=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),o.corked&&(o.corked=1,this.uncork()),o.ending||function(e,t,n){t.ending=!0,P(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,o,n),this},Object.defineProperty(B.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(B.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),B.prototype.destroy=l.destroy,B.prototype._undestroy=l.undestroy,B.prototype._destroy=function(e,t){t(e)}}).call(this,n(3),n(6))},function(e,t,n){"use strict";e.exports=d;var r=n(39).codes,o=r.ERR_METHOD_NOT_IMPLEMENTED,i=r.ERR_MULTIPLE_CALLBACK,a=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=r.ERR_TRANSFORM_WITH_LENGTH_0,c=n(40);function u(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new i);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function f(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}r(c,o),c.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},c.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,o=0|this._b,i=0|this._c,s=0|this._d,c=0|this._e,p=0|this._f,A=0|this._g,g=0|this._h,m=0;m<16;++m)n[m]=e.readInt32BE(4*m);for(;m<64;++m)n[m]=0|(((t=n[m-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+n[m-7]+h(n[m-15])+n[m-16];for(var v=0;v<64;++v){var y=g+f(c)+u(c,p,A)+a[v]+n[v]|0,b=l(r)+d(r,o,i)|0;g=A,A=p,p=c,c=s+y|0,s=i,i=o,o=r,r=y+b|0}this._a=r+this._a|0,this._b=o+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0,this._f=p+this._f|0,this._g=A+this._g|0,this._h=g+this._h|0},c.prototype._hash=function(){var e=i.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=c},function(e,t,n){var r=n(2),o=n(41),i=n(4).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 c(){this.init(),this._w=s,o.call(this,128,112)}function u(e,t,n){return n^e&(t^n)}function d(e,t,n){return e&t|n&(e|t)}function l(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function f(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function A(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function g(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function m(e,t){return e>>>0>>0?1:0}r(c,o),c.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},c.prototype._update=function(e){for(var t=this._w,n=0|this._ah,r=0|this._bh,o=0|this._ch,i=0|this._dh,s=0|this._eh,c=0|this._fh,v=0|this._gh,y=0|this._hh,b=0|this._al,I=0|this._bl,w=0|this._cl,E=0|this._dl,_=0|this._el,B=0|this._fl,C=0|this._gl,k=0|this._hl,S=0;S<32;S+=2)t[S]=e.readInt32BE(4*S),t[S+1]=e.readInt32BE(4*S+4);for(;S<160;S+=2){var O=t[S-30],Q=t[S-30+1],P=h(O,Q),R=p(Q,O),M=A(O=t[S-4],Q=t[S-4+1]),x=g(Q,O),D=t[S-14],N=t[S-14+1],T=t[S-32],j=t[S-32+1],U=R+N|0,H=P+D+m(U,R)|0;H=(H=H+M+m(U=U+x|0,x)|0)+T+m(U=U+j|0,j)|0,t[S]=H,t[S+1]=U}for(var J=0;J<160;J+=2){H=t[J],U=t[J+1];var F=d(n,r,o),L=d(b,I,w),q=l(n,b),G=l(b,n),V=f(s,_),z=f(_,s),Y=a[J],K=a[J+1],W=u(s,c,v),Z=u(_,B,C),X=k+z|0,$=y+V+m(X,k)|0;$=($=($=$+W+m(X=X+Z|0,Z)|0)+Y+m(X=X+K|0,K)|0)+H+m(X=X+U|0,U)|0;var ee=G+L|0,te=q+F+m(ee,G)|0;y=v,k=C,v=c,C=B,c=s,B=_,s=i+$+m(_=E+X|0,E)|0,i=o,E=w,o=r,w=I,r=n,I=b,n=$+te+m(b=X+ee|0,X)|0}this._al=this._al+b|0,this._bl=this._bl+I|0,this._cl=this._cl+w|0,this._dl=this._dl+E|0,this._el=this._el+_|0,this._fl=this._fl+B|0,this._gl=this._gl+C|0,this._hl=this._hl+k|0,this._ah=this._ah+n+m(this._al,b)|0,this._bh=this._bh+r+m(this._bl,I)|0,this._ch=this._ch+o+m(this._cl,w)|0,this._dh=this._dh+i+m(this._dl,E)|0,this._eh=this._eh+s+m(this._el,_)|0,this._fh=this._fh+c+m(this._fl,B)|0,this._gh=this._gh+v+m(this._gl,C)|0,this._hh=this._hh+y+m(this._hl,k)|0},c.prototype._hash=function(){var e=i.allocUnsafe(64);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=c},function(e,t,n){"use strict";(function(t,r){var o=n(58);e.exports=y;var i,a=n(118);y.ReadableState=v;n(29).EventEmitter;var s=function(e,t){return e.listeners(t).length},c=n(132),u=n(79).Buffer,d=t.Uint8Array||function(){};var l=Object.create(n(47));l.inherits=n(2);var f=n(285),h=void 0;h=f&&f.debuglog?f.debuglog("stream"):function(){};var p,A=n(286),g=n(133);l.inherits(y,c);var m=["error","close","destroy","pause","resume"];function v(e,t){e=e||{};var r=t instanceof(i=i||n(31));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var o=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new A,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=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=n(30).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function y(e){if(i=i||n(31),!(this instanceof y))return new y(e);this._readableState=new v(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),c.call(this)}function b(e,t,n,r,o){var i,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,E(e)}(e,a)):(o||(i=function(e,t){var n;r=t,u.isBuffer(r)||r instanceof d||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(a,t)),i?e.emit("error",i):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):I(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?I(e,a,t,!1):B(e,a)):I(e,a,t,!1))):r||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?o.nextTick(_,e):_(e))}function _(e){h("emit readable"),e.emit("readable"),O(e)}function B(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(C,e,t))}function C(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;ei.length?i.length:e;if(a===i.length?o+=i:o+=i.slice(0,e),0===(e-=a)){a===i.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(a));break}++r}return t.length-=r,o}(e,t):function(e,t){var n=u.allocUnsafe(e),r=t.head,o=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(n,n.length-e,0,a),0===(e-=a)){a===i.length?(++o,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(a));break}++o}return t.length-=o,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function P(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,o.nextTick(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function M(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):E(this),null;if(0===(e=w(e,t))&&t.ended)return 0===t.length&&P(this),null;var r,o=t.needReadable;return h("need readable",o),(0===t.length||t.length-e0?Q(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&P(this)),null!==r&&this.emit("data",r),r},y.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},y.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,h("pipe count=%d opts=%j",i.pipesCount,t);var c=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?d:y;function u(t,r){h("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),e.removeListener("close",m),e.removeListener("finish",v),e.removeListener("drain",l),e.removeListener("error",g),e.removeListener("unpipe",u),n.removeListener("end",d),n.removeListener("end",y),n.removeListener("data",A),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function d(){h("onend"),e.end()}i.endEmitted?o.nextTick(c):n.once("end",c),e.on("unpipe",u);var l=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,O(e))}}(n);e.on("drain",l);var f=!1;var p=!1;function A(t){h("ondata"),p=!1,!1!==e.write(t)||p||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==M(i.pipes,e))&&!f&&(h("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,p=!0),n.pause())}function g(t){h("onerror",t),y(),e.removeListener("error",g),0===s(e,"error")&&e.emit("error",t)}function m(){e.removeListener("finish",v),y()}function v(){h("onfinish"),e.removeListener("close",m),y()}function y(){h("unpipe"),n.unpipe(e)}return n.on("data",A),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",g),e.once("close",m),e.once("finish",v),e.emit("pipe",n),i.flowing||(h("pipe resume"),n.resume()),e},y.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;in||t!=t)throw new TypeError("Bad key length")}},function(e,t,n){(function(t,n){var r;if(t.process&&t.process.browser)r="utf-8";else if(t.process&&t.process.version){r=parseInt(n.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else r="utf-8";e.exports=r}).call(this,n(3),n(6))},function(e,t,n){var r=n(138),o=n(56),i=n(57),a=n(4).Buffer,s=n(135),c=n(136),u=n(139),d=a.alloc(128),l={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function f(e,t,n){var s=function(e){function t(t){return i(e).update(t).digest()}return"rmd160"===e||"ripemd160"===e?function(e){return(new o).update(e).digest()}:"md5"===e?r:t}(e),c="sha512"===e||"sha384"===e?128:64;t.length>c?t=s(t):t.length(new e).update(t).digest();let r=t;if(r.length>n&&(r=this.hash(r)),r.length92^e),this.iKeyPad=r.map(e=>54^e),this.messageHasher=new e,this.blockSize=n,this.update(this.iKeyPad)}update(e){return this.messageHasher.update(e),this}digest(){const e=this.messageHasher.digest();return this.hash(new Uint8Array([...this.oKeyPad,...e]))}}},function(e,t,n){var r,o,i,a,s;s="object"==typeof(a=this).sodium&&"function"==typeof a.sodium.onload?a.sodium.onload:null,o=[t,n(311)],void 0!==(i="function"==typeof(r=function(e,t){"use strict";var n,r=t.ready.then((function(){function r(){if(0!==n._sodium_init())throw new Error("libsodium was not correctly initialized.");for(var t=["crypto_aead_chacha20poly1305_decrypt","crypto_aead_chacha20poly1305_decrypt_detached","crypto_aead_chacha20poly1305_encrypt","crypto_aead_chacha20poly1305_encrypt_detached","crypto_aead_chacha20poly1305_ietf_decrypt","crypto_aead_chacha20poly1305_ietf_decrypt_detached","crypto_aead_chacha20poly1305_ietf_encrypt","crypto_aead_chacha20poly1305_ietf_encrypt_detached","crypto_aead_chacha20poly1305_ietf_keygen","crypto_aead_chacha20poly1305_keygen","crypto_aead_xchacha20poly1305_ietf_decrypt","crypto_aead_xchacha20poly1305_ietf_decrypt_detached","crypto_aead_xchacha20poly1305_ietf_encrypt","crypto_aead_xchacha20poly1305_ietf_encrypt_detached","crypto_aead_xchacha20poly1305_ietf_keygen","crypto_auth","crypto_auth_hmacsha256","crypto_auth_hmacsha256_final","crypto_auth_hmacsha256_init","crypto_auth_hmacsha256_keygen","crypto_auth_hmacsha256_update","crypto_auth_hmacsha256_verify","crypto_auth_hmacsha512","crypto_auth_hmacsha512_final","crypto_auth_hmacsha512_init","crypto_auth_hmacsha512_keygen","crypto_auth_hmacsha512_update","crypto_auth_hmacsha512_verify","crypto_auth_keygen","crypto_auth_verify","crypto_box_beforenm","crypto_box_curve25519xchacha20poly1305_keypair","crypto_box_curve25519xchacha20poly1305_seal","crypto_box_curve25519xchacha20poly1305_seal_open","crypto_box_detached","crypto_box_easy","crypto_box_easy_afternm","crypto_box_keypair","crypto_box_open_detached","crypto_box_open_easy","crypto_box_open_easy_afternm","crypto_box_seal","crypto_box_seal_open","crypto_box_seed_keypair","crypto_core_ed25519_add","crypto_core_ed25519_from_hash","crypto_core_ed25519_from_uniform","crypto_core_ed25519_is_valid_point","crypto_core_ed25519_random","crypto_core_ed25519_scalar_add","crypto_core_ed25519_scalar_complement","crypto_core_ed25519_scalar_invert","crypto_core_ed25519_scalar_mul","crypto_core_ed25519_scalar_negate","crypto_core_ed25519_scalar_random","crypto_core_ed25519_scalar_reduce","crypto_core_ed25519_scalar_sub","crypto_core_ed25519_sub","crypto_core_hchacha20","crypto_core_hsalsa20","crypto_core_ristretto255_add","crypto_core_ristretto255_from_hash","crypto_core_ristretto255_is_valid_point","crypto_core_ristretto255_random","crypto_core_ristretto255_scalar_add","crypto_core_ristretto255_scalar_complement","crypto_core_ristretto255_scalar_invert","crypto_core_ristretto255_scalar_mul","crypto_core_ristretto255_scalar_negate","crypto_core_ristretto255_scalar_random","crypto_core_ristretto255_scalar_reduce","crypto_core_ristretto255_scalar_sub","crypto_core_ristretto255_sub","crypto_generichash","crypto_generichash_blake2b_salt_personal","crypto_generichash_final","crypto_generichash_init","crypto_generichash_keygen","crypto_generichash_update","crypto_hash","crypto_hash_sha256","crypto_hash_sha256_final","crypto_hash_sha256_init","crypto_hash_sha256_update","crypto_hash_sha512","crypto_hash_sha512_final","crypto_hash_sha512_init","crypto_hash_sha512_update","crypto_kdf_derive_from_key","crypto_kdf_keygen","crypto_kx_client_session_keys","crypto_kx_keypair","crypto_kx_seed_keypair","crypto_kx_server_session_keys","crypto_onetimeauth","crypto_onetimeauth_final","crypto_onetimeauth_init","crypto_onetimeauth_keygen","crypto_onetimeauth_update","crypto_onetimeauth_verify","crypto_pwhash","crypto_pwhash_scryptsalsa208sha256","crypto_pwhash_scryptsalsa208sha256_ll","crypto_pwhash_scryptsalsa208sha256_str","crypto_pwhash_scryptsalsa208sha256_str_verify","crypto_pwhash_str","crypto_pwhash_str_needs_rehash","crypto_pwhash_str_verify","crypto_scalarmult","crypto_scalarmult_base","crypto_scalarmult_ed25519","crypto_scalarmult_ed25519_base","crypto_scalarmult_ed25519_base_noclamp","crypto_scalarmult_ed25519_noclamp","crypto_scalarmult_ristretto255","crypto_scalarmult_ristretto255_base","crypto_secretbox_detached","crypto_secretbox_easy","crypto_secretbox_keygen","crypto_secretbox_open_detached","crypto_secretbox_open_easy","crypto_secretstream_xchacha20poly1305_init_pull","crypto_secretstream_xchacha20poly1305_init_push","crypto_secretstream_xchacha20poly1305_keygen","crypto_secretstream_xchacha20poly1305_pull","crypto_secretstream_xchacha20poly1305_push","crypto_secretstream_xchacha20poly1305_rekey","crypto_shorthash","crypto_shorthash_keygen","crypto_shorthash_siphashx24","crypto_sign","crypto_sign_detached","crypto_sign_ed25519_pk_to_curve25519","crypto_sign_ed25519_sk_to_curve25519","crypto_sign_ed25519_sk_to_pk","crypto_sign_ed25519_sk_to_seed","crypto_sign_final_create","crypto_sign_final_verify","crypto_sign_init","crypto_sign_keypair","crypto_sign_open","crypto_sign_seed_keypair","crypto_sign_update","crypto_sign_verify_detached","crypto_stream_chacha20","crypto_stream_chacha20_ietf_xor","crypto_stream_chacha20_ietf_xor_ic","crypto_stream_chacha20_keygen","crypto_stream_chacha20_xor","crypto_stream_chacha20_xor_ic","crypto_stream_keygen","crypto_stream_xchacha20_keygen","crypto_stream_xchacha20_xor","crypto_stream_xchacha20_xor_ic","randombytes_buf","randombytes_buf_deterministic","randombytes_close","randombytes_random","randombytes_set_implementation","randombytes_stir","randombytes_uniform","sodium_version_string"],r=[I,w,E,_,B,C,k,S,O,Q,P,R,M,x,D,N,T,j,U,H,J,F,L,q,G,V,z,Y,K,W,Z,X,$,ee,te,ne,re,oe,ie,ae,se,ce,ue,de,le,fe,he,pe,Ae,ge,me,ve,ye,be,Ie,we,Ee,_e,Be,Ce,ke,Se,Oe,Qe,Pe,Re,Me,xe,De,Ne,Te,je,Ue,He,Je,Fe,Le,qe,Ge,Ve,ze,Ye,Ke,We,Ze,Xe,$e,et,tt,nt,rt,ot,it,at,st,ct,ut,dt,lt,ft,ht,pt,At,gt,mt,vt,yt,bt,It,wt,Et,_t,Bt,Ct,kt,St,Ot,Qt,Pt,Rt,Mt,xt,Dt,Nt,Tt,jt,Ut,Ht,Jt,Ft,Lt,qt,Gt,Vt,zt,Yt,Kt,Wt,Zt,Xt,$t,en,tn,nn,rn,on,an,sn,cn,un,dn,ln,fn,hn,pn,An,gn,mn,vn,yn,bn,In],o=0;o=240?(d=4,c=!0):l>=224?(d=3,c=!0):l>=192?(d=2,c=!0):l<128&&(d=1,c=!0)}while(!c);for(var f=d-(s.length-u),h=0;h>8&-39)<<8|87+(t=e[i]>>>4)+(t-10>>8&-39),o+=String.fromCharCode(255&r)+String.fromCharCode(r>>>8);return o}var s={ORIGINAL:1,ORIGINAL_NO_PADDING:3,URLSAFE:5,URLSAFE_NO_PADDING:7};function c(e){if(null==e)return s.URLSAFE_NO_PADDING;if(e!==s.ORIGINAL&&e!==s.ORIGINAL_NO_PADDING&&e!==s.URLSAFE&&e!=s.URLSAFE_NO_PADDING)throw new Error("unsupported base64 variant");return e}function u(e,t){t=c(t),e=b(o,e,"input");var r,o=[],a=0|Math.floor(e.length/3),s=e.length-3*a,u=4*a+(0!==s?0==(2&t)?4:2+(s>>>1):0),d=new h(u+1),l=p(e);return o.push(l),o.push(d.address),0===n._sodium_bin2base64(d.address,d.length,l,e.length,t)&&m(o,"conversion failed"),d.length=u,r=i(d.to_Uint8Array()),g(o),r}function d(e,t){var n=t||"uint8array";if(!l(n))throw new Error(n+" output format is not available");if(e instanceof h){if("uint8array"===n)return e.to_Uint8Array();if("text"===n)return i(e.to_Uint8Array());if("hex"===n)return a(e.to_Uint8Array());if("base64"===n)return u(e.to_Uint8Array(),s.URLSAFE_NO_PADDING);throw new Error('What is output format "'+n+'"?')}if("object"==typeof e){for(var r=Object.keys(e),o={},c=0;c>>24>>>8,c,l);var w=d(m,a);return g(s),w}function nt(e){var t=[];f(e);var r=new h(0|n._crypto_kdf_keybytes()),o=r.address;t.push(o),n._crypto_kdf_keygen(o);var i=d(r,e);return g(t),i}function rt(e,t,r,o){var i=[];f(o),e=b(i,e,"clientPublicKey");var a,s=0|n._crypto_kx_publickeybytes();e.length!==s&&v(i,"invalid clientPublicKey length"),a=p(e),i.push(a),t=b(i,t,"clientSecretKey");var c,u=0|n._crypto_kx_secretkeybytes();t.length!==u&&v(i,"invalid clientSecretKey length"),c=p(t),i.push(c),r=b(i,r,"serverPublicKey");var l,A=0|n._crypto_kx_publickeybytes();r.length!==A&&v(i,"invalid serverPublicKey length"),l=p(r),i.push(l);var y=new h(0|n._crypto_kx_sessionkeybytes()),I=y.address;i.push(I);var w=new h(0|n._crypto_kx_sessionkeybytes()),E=w.address;if(i.push(E),0==(0|n._crypto_kx_client_session_keys(I,E,a,c,l))){var _=d({sharedRx:y,sharedTx:w},o);return g(i),_}m(i,"invalid usage")}function ot(e){var t=[];f(e);var r=new h(0|n._crypto_kx_publickeybytes()),o=r.address;t.push(o);var i=new h(0|n._crypto_kx_secretkeybytes()),a=i.address;if(t.push(a),0==(0|n._crypto_kx_keypair(o,a))){var s={publicKey:d(r,e),privateKey:d(i,e),keyType:"x25519"};return g(t),s}m(t,"internal error")}function it(e,t){var r=[];f(t),e=b(r,e,"seed");var o,i=0|n._crypto_kx_seedbytes();e.length!==i&&v(r,"invalid seed length"),o=p(e),r.push(o);var a=new h(0|n._crypto_kx_publickeybytes()),s=a.address;r.push(s);var c=new h(0|n._crypto_kx_secretkeybytes()),u=c.address;if(r.push(u),0==(0|n._crypto_kx_seed_keypair(s,u,o))){var l={publicKey:d(a,t),privateKey:d(c,t),keyType:"x25519"};return g(r),l}m(r,"internal error")}function at(e,t,r,o){var i=[];f(o),e=b(i,e,"serverPublicKey");var a,s=0|n._crypto_kx_publickeybytes();e.length!==s&&v(i,"invalid serverPublicKey length"),a=p(e),i.push(a),t=b(i,t,"serverSecretKey");var c,u=0|n._crypto_kx_secretkeybytes();t.length!==u&&v(i,"invalid serverSecretKey length"),c=p(t),i.push(c),r=b(i,r,"clientPublicKey");var l,A=0|n._crypto_kx_publickeybytes();r.length!==A&&v(i,"invalid clientPublicKey length"),l=p(r),i.push(l);var y=new h(0|n._crypto_kx_sessionkeybytes()),I=y.address;i.push(I);var w=new h(0|n._crypto_kx_sessionkeybytes()),E=w.address;if(i.push(E),0==(0|n._crypto_kx_server_session_keys(I,E,a,c,l))){var _=d({sharedRx:y,sharedTx:w},o);return g(i),_}m(i,"invalid usage")}function st(e,t,r){var o=[];f(r);var i=p(e=b(o,e,"message")),a=e.length;o.push(i),t=b(o,t,"key");var s,c=0|n._crypto_onetimeauth_keybytes();t.length!==c&&v(o,"invalid key length"),s=p(t),o.push(s);var u=new h(0|n._crypto_onetimeauth_bytes()),l=u.address;if(o.push(l),0==(0|n._crypto_onetimeauth(l,i,a,0,s))){var A=d(u,r);return g(o),A}m(o,"invalid usage")}function ct(e,t){var r=[];f(t),y(r,e,"state_address");var o=new h(0|n._crypto_onetimeauth_bytes()),i=o.address;if(r.push(i),0==(0|n._crypto_onetimeauth_final(e,i))){var a=(n._free(e),d(o,t));return g(r),a}m(r,"invalid usage")}function ut(e,t){var r=[];f(t);var o=null;null!=e&&(o=p(e=b(r,e,"key")),e.length,r.push(o));var i=new h(144).address;if(0==(0|n._crypto_onetimeauth_init(i,o))){var a=i;return g(r),a}m(r,"invalid usage")}function dt(e){var t=[];f(e);var r=new h(0|n._crypto_onetimeauth_keybytes()),o=r.address;t.push(o),n._crypto_onetimeauth_keygen(o);var i=d(r,e);return g(t),i}function lt(e,t,r){var o=[];f(r),y(o,e,"state_address");var i=p(t=b(o,t,"message_chunk")),a=t.length;o.push(i),0!=(0|n._crypto_onetimeauth_update(e,i,a))&&m(o,"invalid usage"),g(o)}function ft(e,t,r){var o=[];e=b(o,e,"hash");var i,a=0|n._crypto_onetimeauth_bytes();e.length!==a&&v(o,"invalid hash length"),i=p(e),o.push(i);var s=p(t=b(o,t,"message")),c=t.length;o.push(s),r=b(o,r,"key");var u,d=0|n._crypto_onetimeauth_keybytes();r.length!==d&&v(o,"invalid key length"),u=p(r),o.push(u);var l=0==(0|n._crypto_onetimeauth_verify(i,s,c,0,u));return g(o),l}function ht(e,t,r,o,i,a,s){var c=[];f(s),y(c,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&v(c,"keyLength must be an unsigned integer");var u=p(t=b(c,t,"password")),l=t.length;c.push(u),r=b(c,r,"salt");var A,I=0|n._crypto_pwhash_saltbytes();r.length!==I&&v(c,"invalid salt length"),A=p(r),c.push(A),y(c,o,"opsLimit"),("number"!=typeof o||(0|o)!==o||o<0)&&v(c,"opsLimit must be an unsigned integer"),y(c,i,"memLimit"),("number"!=typeof i||(0|i)!==i||i<0)&&v(c,"memLimit must be an unsigned integer"),y(c,a,"algorithm"),("number"!=typeof a||(0|a)!==a||a<0)&&v(c,"algorithm must be an unsigned integer");var w=new h(0|e),E=w.address;if(c.push(E),0==(0|n._crypto_pwhash(E,e,0,u,l,0,A,o,0,i,a))){var _=d(w,s);return g(c),_}m(c,"invalid usage")}function pt(e,t,r,o,i,a){var s=[];f(a),y(s,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&v(s,"keyLength must be an unsigned integer");var c=p(t=b(s,t,"password")),u=t.length;s.push(c),r=b(s,r,"salt");var l,A=0|n._crypto_pwhash_scryptsalsa208sha256_saltbytes();r.length!==A&&v(s,"invalid salt length"),l=p(r),s.push(l),y(s,o,"opsLimit"),("number"!=typeof o||(0|o)!==o||o<0)&&v(s,"opsLimit must be an unsigned integer"),y(s,i,"memLimit"),("number"!=typeof i||(0|i)!==i||i<0)&&v(s,"memLimit must be an unsigned integer");var I=new h(0|e),w=I.address;if(s.push(w),0==(0|n._crypto_pwhash_scryptsalsa208sha256(w,e,0,c,u,0,l,o,0,i))){var E=d(I,a);return g(s),E}m(s,"invalid usage")}function At(e,t,r,o,i,a,s){var c=[];f(s);var u=p(e=b(c,e,"password")),l=e.length;c.push(u);var A=p(t=b(c,t,"salt")),I=t.length;c.push(A),y(c,r,"opsLimit"),("number"!=typeof r||(0|r)!==r||r<0)&&v(c,"opsLimit must be an unsigned integer"),y(c,o,"r"),("number"!=typeof o||(0|o)!==o||o<0)&&v(c,"r must be an unsigned integer"),y(c,i,"p"),("number"!=typeof i||(0|i)!==i||i<0)&&v(c,"p must be an unsigned integer"),y(c,a,"keyLength"),("number"!=typeof a||(0|a)!==a||a<0)&&v(c,"keyLength must be an unsigned integer");var w=new h(0|a),E=w.address;if(c.push(E),0==(0|n._crypto_pwhash_scryptsalsa208sha256_ll(u,l,A,I,r,0,o,i,E,a))){var _=d(w,s);return g(c),_}m(c,"invalid usage")}function gt(e,t,r,o){var i=[];f(o);var a=p(e=b(i,e,"password")),s=e.length;i.push(a),y(i,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&v(i,"opsLimit must be an unsigned integer"),y(i,r,"memLimit"),("number"!=typeof r||(0|r)!==r||r<0)&&v(i,"memLimit must be an unsigned integer");var c=new h(0|n._crypto_pwhash_scryptsalsa208sha256_strbytes()).address;if(i.push(c),0==(0|n._crypto_pwhash_scryptsalsa208sha256_str(c,a,s,0,t,0,r))){var u=n.UTF8ToString(c);return g(i),u}m(i,"invalid usage")}function mt(e,t,r){var i=[];f(r),"string"!=typeof e&&v(i,"hashed_password must be a string"),e=o(e+"\0"),null!=s&&e.length-1!==s&&v(i,"invalid hashed_password length");var a=p(e),s=e.length-1;i.push(a);var c=p(t=b(i,t,"password")),u=t.length;i.push(c);var d=0==(0|n._crypto_pwhash_scryptsalsa208sha256_str_verify(a,c,u,0));return g(i),d}function vt(e,t,r,o){var i=[];f(o);var a=p(e=b(i,e,"password")),s=e.length;i.push(a),y(i,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&v(i,"opsLimit must be an unsigned integer"),y(i,r,"memLimit"),("number"!=typeof r||(0|r)!==r||r<0)&&v(i,"memLimit must be an unsigned integer");var c=new h(0|n._crypto_pwhash_strbytes()).address;if(i.push(c),0==(0|n._crypto_pwhash_str(c,a,s,0,t,0,r))){var u=n.UTF8ToString(c);return g(i),u}m(i,"invalid usage")}function yt(e,t,r,i){var a=[];f(i),"string"!=typeof e&&v(a,"hashed_password must be a string"),e=o(e+"\0"),null!=c&&e.length-1!==c&&v(a,"invalid hashed_password length");var s=p(e),c=e.length-1;a.push(s),y(a,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&v(a,"opsLimit must be an unsigned integer"),y(a,r,"memLimit"),("number"!=typeof r||(0|r)!==r||r<0)&&v(a,"memLimit must be an unsigned integer");var u=0!=(0|n._crypto_pwhash_str_needs_rehash(s,t,0,r));return g(a),u}function bt(e,t,r){var i=[];f(r),"string"!=typeof e&&v(i,"hashed_password must be a string"),e=o(e+"\0"),null!=s&&e.length-1!==s&&v(i,"invalid hashed_password length");var a=p(e),s=e.length-1;i.push(a);var c=p(t=b(i,t,"password")),u=t.length;i.push(c);var d=0==(0|n._crypto_pwhash_str_verify(a,c,u,0));return g(i),d}function It(e,t,r){var o=[];f(r),e=b(o,e,"privateKey");var i,a=0|n._crypto_scalarmult_scalarbytes();e.length!==a&&v(o,"invalid privateKey length"),i=p(e),o.push(i),t=b(o,t,"publicKey");var s,c=0|n._crypto_scalarmult_bytes();t.length!==c&&v(o,"invalid publicKey length"),s=p(t),o.push(s);var u=new h(0|n._crypto_scalarmult_bytes()),l=u.address;if(o.push(l),0==(0|n._crypto_scalarmult(l,i,s))){var A=d(u,r);return g(o),A}m(o,"weak public key")}function wt(e,t){var r=[];f(t),e=b(r,e,"privateKey");var o,i=0|n._crypto_scalarmult_scalarbytes();e.length!==i&&v(r,"invalid privateKey length"),o=p(e),r.push(o);var a=new h(0|n._crypto_scalarmult_bytes()),s=a.address;if(r.push(s),0==(0|n._crypto_scalarmult_base(s,o))){var c=d(a,t);return g(r),c}m(r,"unknown error")}function Et(e,t,r){var o=[];f(r),e=b(o,e,"n");var i,a=0|n._crypto_scalarmult_ed25519_scalarbytes();e.length!==a&&v(o,"invalid n length"),i=p(e),o.push(i),t=b(o,t,"p");var s,c=0|n._crypto_scalarmult_ed25519_bytes();t.length!==c&&v(o,"invalid p length"),s=p(t),o.push(s);var u=new h(0|n._crypto_scalarmult_ed25519_bytes()),l=u.address;if(o.push(l),0==(0|n._crypto_scalarmult_ed25519(l,i,s))){var A=d(u,r);return g(o),A}m(o,"invalid point or scalar is 0")}function _t(e,t){var r=[];f(t),e=b(r,e,"scalar");var o,i=0|n._crypto_scalarmult_ed25519_scalarbytes();e.length!==i&&v(r,"invalid scalar length"),o=p(e),r.push(o);var a=new h(0|n._crypto_scalarmult_ed25519_bytes()),s=a.address;if(r.push(s),0==(0|n._crypto_scalarmult_ed25519_base(s,o))){var c=d(a,t);return g(r),c}m(r,"scalar is 0")}function Bt(e,t){var r=[];f(t),e=b(r,e,"scalar");var o,i=0|n._crypto_scalarmult_ed25519_scalarbytes();e.length!==i&&v(r,"invalid scalar length"),o=p(e),r.push(o);var a=new h(0|n._crypto_scalarmult_ed25519_bytes()),s=a.address;if(r.push(s),0==(0|n._crypto_scalarmult_ed25519_base_noclamp(s,o))){var c=d(a,t);return g(r),c}m(r,"scalar is 0")}function Ct(e,t,r){var o=[];f(r),e=b(o,e,"n");var i,a=0|n._crypto_scalarmult_ed25519_scalarbytes();e.length!==a&&v(o,"invalid n length"),i=p(e),o.push(i),t=b(o,t,"p");var s,c=0|n._crypto_scalarmult_ed25519_bytes();t.length!==c&&v(o,"invalid p length"),s=p(t),o.push(s);var u=new h(0|n._crypto_scalarmult_ed25519_bytes()),l=u.address;if(o.push(l),0==(0|n._crypto_scalarmult_ed25519_noclamp(l,i,s))){var A=d(u,r);return g(o),A}m(o,"invalid point or scalar is 0")}function kt(e,t,r){var o=[];f(r),e=b(o,e,"scalar");var i,a=0|n._crypto_scalarmult_ristretto255_scalarbytes();e.length!==a&&v(o,"invalid scalar length"),i=p(e),o.push(i),t=b(o,t,"element");var s,c=0|n._crypto_scalarmult_ristretto255_bytes();t.length!==c&&v(o,"invalid element length"),s=p(t),o.push(s);var u=new h(0|n._crypto_scalarmult_ristretto255_bytes()),l=u.address;if(o.push(l),0==(0|n._crypto_scalarmult_ristretto255(l,i,s))){var A=d(u,r);return g(o),A}m(o,"result is identity element")}function St(e,t){var r=[];f(t),e=b(r,e,"scalar");var o,i=0|n._crypto_core_ristretto255_scalarbytes();e.length!==i&&v(r,"invalid scalar length"),o=p(e),r.push(o);var a=new h(0|n._crypto_core_ristretto255_bytes()),s=a.address;if(r.push(s),0==(0|n._crypto_scalarmult_ristretto255_base(s,o))){var c=d(a,t);return g(r),c}m(r,"scalar is 0")}function Ot(e,t,r,o){var i=[];f(o);var a=p(e=b(i,e,"message")),s=e.length;i.push(a),t=b(i,t,"nonce");var c,u=0|n._crypto_secretbox_noncebytes();t.length!==u&&v(i,"invalid nonce length"),c=p(t),i.push(c),r=b(i,r,"key");var l,A=0|n._crypto_secretbox_keybytes();r.length!==A&&v(i,"invalid key length"),l=p(r),i.push(l);var y=new h(0|s),I=y.address;i.push(I);var w=new h(0|n._crypto_secretbox_macbytes()),E=w.address;if(i.push(E),0==(0|n._crypto_secretbox_detached(I,E,a,s,0,c,l))){var _=d({mac:w,cipher:y},o);return g(i),_}m(i,"invalid usage")}function Qt(e,t,r,o){var i=[];f(o);var a=p(e=b(i,e,"message")),s=e.length;i.push(a),t=b(i,t,"nonce");var c,u=0|n._crypto_secretbox_noncebytes();t.length!==u&&v(i,"invalid nonce length"),c=p(t),i.push(c),r=b(i,r,"key");var l,A=0|n._crypto_secretbox_keybytes();r.length!==A&&v(i,"invalid key length"),l=p(r),i.push(l);var y=new h(s+n._crypto_secretbox_macbytes()|0),I=y.address;if(i.push(I),0==(0|n._crypto_secretbox_easy(I,a,s,0,c,l))){var w=d(y,o);return g(i),w}m(i,"invalid usage")}function Pt(e){var t=[];f(e);var r=new h(0|n._crypto_secretbox_keybytes()),o=r.address;t.push(o),n._crypto_secretbox_keygen(o);var i=d(r,e);return g(t),i}function Rt(e,t,r,o,i){var a=[];f(i);var s=p(e=b(a,e,"ciphertext")),c=e.length;a.push(s),t=b(a,t,"mac");var u,l=0|n._crypto_secretbox_macbytes();t.length!==l&&v(a,"invalid mac length"),u=p(t),a.push(u),r=b(a,r,"nonce");var A,y=0|n._crypto_secretbox_noncebytes();r.length!==y&&v(a,"invalid nonce length"),A=p(r),a.push(A),o=b(a,o,"key");var I,w=0|n._crypto_secretbox_keybytes();o.length!==w&&v(a,"invalid key length"),I=p(o),a.push(I);var E=new h(0|c),_=E.address;if(a.push(_),0==(0|n._crypto_secretbox_open_detached(_,s,u,c,0,A,I))){var B=d(E,i);return g(a),B}m(a,"wrong secret key for the given ciphertext")}function Mt(e,t,r,o){var i=[];f(o),e=b(i,e,"ciphertext");var a,s=n._crypto_secretbox_macbytes(),c=e.length;c>>0;return g([]),t}function vn(e,t){var r=[];f(t);for(var o=n._malloc(24),i=0;i<6;i++)n.setValue(o+4*i,n.Runtime.addFunction(e[["implementation_name","random","stir","uniform","buf","close"][i]]),"i32");0!=(0|n._randombytes_set_implementation(o))&&m(r,"unsupported implementation"),g(r)}function yn(e){f(e),n._randombytes_stir()}function bn(e,t){var r=[];f(t),y(r,e,"upper_bound"),("number"!=typeof e||(0|e)!==e||e<0)&&v(r,"upper_bound must be an unsigned integer");var o=n._randombytes_uniform(e)>>>0;return g(r),o}function In(){var e=n._sodium_version_string(),t=n.UTF8ToString(e);return g([]),t}return h.prototype.to_Uint8Array=function(){var e=new Uint8Array(this.length);return e.set(n.HEAPU8.subarray(this.address,this.address+this.length)),e},e.add=function(e,t){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can added");var n=e.length,r=0,o=0;if(t.length!=e.length)throw new TypeError("Arguments must have the same length");for(o=0;o>=8,r+=e[o]+t[o],e[o]=255&r},e.base64_variants=s,e.compare=function(e,t){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be compared");if(e.length!==t.length)throw new TypeError("Only instances of identical length can be compared");for(var n=0,r=1,o=e.length;o-- >0;)n|=t[o]-e[o]>>8&r,r&=(t[o]^e[o])-1>>8;return n+n+r-1},e.from_base64=function(e,t){t=c(t);var r,o=[],i=new h(3*(e=b(o,e,"input")).length/4),a=p(e),s=A(4),u=A(4);return o.push(a),o.push(i.address),o.push(i.result_bin_len_p),o.push(i.b64_end_p),0!==n._sodium_base642bin(i.address,i.length,a,e.length,0,s,u,t)&&m(o,"invalid input"),n.getValue(u,"i32")-a!==e.length&&m(o,"incomplete input"),i.length=n.getValue(s,"i32"),r=i.to_Uint8Array(),g(o),r},e.from_hex=function(e){var t,r=[],o=new h((e=b(r,e,"input")).length/2),i=p(e),a=A(4);return r.push(i),r.push(o.address),r.push(o.hex_end_p),0!==n._sodium_hex2bin(o.address,o.length,i,e.length,0,0,a)&&m(r,"invalid input"),n.getValue(a,"i32")-i!==e.length&&m(r,"incomplete input"),t=o.to_Uint8Array(),g(r),t},e.from_string=o,e.increment=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be incremented");for(var t=256,n=0,r=e.length;n>=8,t+=e[n],e[n]=255&t},e.is_zero=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be checked");for(var t=0,n=0,r=e.length;n 0");var r,o=[],i=A(4),a=1,s=0,c=0|e.length,u=new h(c+t);o.push(i),o.push(u.address);for(var d=u.address,l=u.address+c+t;d>>48|c>>>32|c>>>16|c))-1>>16);return 0!==n._sodium_pad(i,u.address,e.length,t,u.length)&&m(o,"internal error"),u.length=n.getValue(i,"i32"),r=u.to_Uint8Array(),g(o),r},e.unpad=function(e,t){if(!(e instanceof Uint8Array))throw new TypeError("buffer must be a Uint8Array");if((t|=0)<=0)throw new Error("block size must be > 0");var r=[],o=p(e),i=A(4);return r.push(o),r.push(i),0!==n._sodium_unpad(i,o,e.length,t)&&m(r,"unsupported/invalid padding"),e=(e=new Uint8Array(e)).subarray(0,n.getValue(i,"i32")),g(r),e},e.ready=r,e.symbols=function(){return Object.keys(e).sort()},e.to_base64=u,e.to_hex=a,e.to_string=i,e})?r.apply(t,o):r)&&(e.exports=i),s&&a.sodium.ready.then((function(){s(a.sodium)}))},function(e,t){},function(e,t,n){"use strict";var r=n(2),o=n(312),i=n(24),a=n(4).Buffer,s=n(138),c=n(56),u=n(57),d=a.alloc(128);function l(e,t){i.call(this,"digest"),"string"==typeof t&&(t=a.from(t));var n="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=t,t.length>n)?t=("rmd160"===e?new c:u(e)).update(t).digest():t.length>>0},t.writeUInt32BE=function(e,t,n){e[0+n]=t>>>24,e[1+n]=t>>>16&255,e[2+n]=t>>>8&255,e[3+n]=255&t},t.ip=function(e,t,n,r){for(var o=0,i=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)o<<=1,o|=t>>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)i<<=1,i|=t>>>s+a&1;for(s=1;s<=25;s+=8)i<<=1,i|=e>>>s+a&1}n[r+0]=o>>>0,n[r+1]=i>>>0},t.rip=function(e,t,n,r){for(var o=0,i=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)i<<=1,i|=t>>>s+a&1,i<<=1,i|=e>>>s+a&1;n[r+0]=o>>>0,n[r+1]=i>>>0},t.pc1=function(e,t,n,r){for(var o=0,i=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1}for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1;n[r+0]=o>>>0,n[r+1]=i>>>0},t.r28shl=function(e,t){return e<>>28-t};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,n,o){for(var i=0,a=0,s=r.length>>>1,c=0;c>>r[c]&1;for(c=s;c>>r[c]&1;n[o+0]=i>>>0,n[o+1]=a>>>0},t.expand=function(e,t,n){var r=0,o=0;r=(1&e)<<5|e>>>27;for(var i=23;i>=15;i-=4)r<<=6,r|=e>>>i&63;for(i=11;i>=3;i-=4)o|=e>>>i&63,o<<=6;o|=(31&e)<<1|e>>>31,t[n+0]=r>>>0,t[n+1]=o>>>0};var o=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var n=0,r=0;r<4;r++){n<<=4,n|=o[64*r+(e>>>18-6*r&63)]}for(r=0;r<4;r++){n<<=4,n|=o[256+64*r+(t>>>18-6*r&63)]}return n>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,n=0;n>>i[n]&1;return t>>>0},t.padSplit=function(e,t,n){for(var r=e.toString(2);r.length>>1];n=i.r28shl(n,s),o=i.r28shl(o,s),i.pc2(n,o,e.keys,a)}},c.prototype._update=function(e,t,n,r){var o=this._desState,a=i.readUInt32BE(e,t),s=i.readUInt32BE(e,t+4);i.ip(a,s,o.tmp,0),a=o.tmp[0],s=o.tmp[1],"encrypt"===this.type?this._encrypt(o,a,s,o.tmp,0):this._decrypt(o,a,s,o.tmp,0),a=o.tmp[0],s=o.tmp[1],i.writeUInt32BE(n,a,r),i.writeUInt32BE(n,s,r+4)},c.prototype._pad=function(e,t){for(var n=e.length-t,r=t;r>>0,a=f}i.rip(s,a,r,o)},c.prototype._decrypt=function(e,t,n,r,o){for(var a=n,s=t,c=e.keys.length-2;c>=0;c-=2){var u=e.keys[c],d=e.keys[c+1];i.expand(a,e.tmp,0),u^=e.tmp[0],d^=e.tmp[1];var l=i.substitute(u,d),f=a;a=(s^i.permute(l))>>>0,s=f}i.rip(a,s,r,o)}},function(e,t,n){var r=n(49),o=n(4).Buffer,i=n(150);function a(e){var t=e._cipher.encryptBlockRaw(e._prev);return i(e._prev),t}t.encrypt=function(e,t){var n=Math.ceil(t.length/16),i=e._cache.length;e._cache=o.concat([e._cache,o.allocUnsafe(16*n)]);for(var s=0;se;)n.ishrn(1);if(n.isEven()&&n.iadd(s),n.testn(1)||n.iadd(c),t.cmp(c)){if(!t.cmp(u))for(;n.mod(d).cmp(l);)n.iadd(h)}else for(;n.mod(i).cmp(f);)n.iadd(h);if(g(p=n.shrn(1))&&g(n)&&m(p)&&m(n)&&a.test(p)&&a.test(n))return n}}},function(e,t,n){var r=n(8),o=n(84);function i(e){this.rand=e||new o.Rand}e.exports=i,i.create=function(e){return new i(e)},i.prototype._randbelow=function(e){var t=e.bitLength(),n=Math.ceil(t/8);do{var o=new r(this.rand.generate(n))}while(o.cmp(e)>=0);return o},i.prototype._randrange=function(e,t){var n=t.sub(e);return e.add(this._randbelow(n))},i.prototype.test=function(e,t,n){var o=e.bitLength(),i=r.mont(e),a=new r(1).toRed(i);t||(t=Math.max(1,o/48|0));for(var s=e.subn(1),c=0;!s.testn(c);c++);for(var u=e.shrn(c),d=s.toRed(i);t>0;t--){var l=this._randrange(new r(2),s);n&&n(l);var f=l.toRed(i).redPow(u);if(0!==f.cmp(a)&&0!==f.cmp(d)){for(var h=1;h0;t--){var d=this._randrange(new r(2),a),l=e.gcd(d);if(0!==l.cmpn(1))return l;var f=d.toRed(o).redPow(c);if(0!==f.cmp(i)&&0!==f.cmp(u)){for(var h=1;h0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),r)a.endEmitted?w(e,new I):k(e,a,t,!0);else if(a.ended)w(e,new y);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?k(e,a,t,!1):P(e,a)):k(e,a,t,!1)}else r||(a.reading=!1,P(e,a));return!a.ended&&(a.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(Q,e))}function Q(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,N(e)}function P(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function x(e){u("readable nexttick read 0"),e.read(0)}function D(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),N(e),t.flowing&&!t.reading&&e.read(0)}function N(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function T(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function j(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(U,t,e))}function U(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function H(e,t){for(var n=0,r=e.length;n=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?j(this):O(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&j(this),null;var r,o=t.needReadable;return u("need readable",o),(0===t.length||t.length-e0?T(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&j(this)),null!==r&&this.emit("data",r),r},B.prototype._read=function(e){w(this,new b("_read()"))},B.prototype.pipe=function(e,t){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,u("pipe count=%d opts=%j",o.pipesCount,t);var a=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:g;function s(t,r){u("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,u("cleanup"),e.removeListener("close",p),e.removeListener("finish",A),e.removeListener("drain",d),e.removeListener("error",h),e.removeListener("unpipe",s),n.removeListener("end",c),n.removeListener("end",g),n.removeListener("data",f),l=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||d())}function c(){u("onend"),e.end()}o.endEmitted?r.nextTick(a):n.once("end",a),e.on("unpipe",s);var d=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,N(e))}}(n);e.on("drain",d);var l=!1;function f(t){u("ondata");var r=e.write(t);u("dest.write",r),!1===r&&((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==H(o.pipes,e))&&!l&&(u("false write response, pause",o.awaitDrain),o.awaitDrain++),n.pause())}function h(t){u("onerror",t),g(),e.removeListener("error",h),0===i(e,"error")&&w(e,t)}function p(){e.removeListener("finish",A),g()}function A(){u("onfinish"),e.removeListener("close",p),g()}function g(){u("unpipe"),n.unpipe(e)}return n.on("data",f),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",h),e.once("close",p),e.once("finish",A),e.emit("pipe",n),o.flowing||(u("pipe resume"),n.resume()),e},B.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==o.flowing&&this.resume()):"readable"===e&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,u("on readable",o.length,o.reading),o.length?O(this):o.reading||r.nextTick(x,this))),n},B.prototype.addListener=B.prototype.on,B.prototype.removeListener=function(e,t){var n=a.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(M,this),n},B.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(M,this),t},B.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(D,e,t))}(this,e)),e.paused=!1,this},B.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},B.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var o in e.on("end",(function(){if(u("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(o){(u("wrapped data"),n.decoder&&(o=n.decoder.write(o)),n.objectMode&&null==o)||(n.objectMode||o&&o.length)&&(t.push(o)||(r=!0,e.pause()))})),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var i=0;i-1))throw new I(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(B.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(B.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),B.prototype._write=function(e,t,n){n(new A("_write()"))},B.prototype._writev=null,B.prototype.end=function(e,t,n){var o=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),o.corked&&(o.corked=1,this.uncork()),o.ending||function(e,t,n){t.ending=!0,P(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,o,n),this},Object.defineProperty(B.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(B.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),B.prototype.destroy=l.destroy,B.prototype._undestroy=l.undestroy,B.prototype._destroy=function(e,t){t(e)}}).call(this,n(3),n(6))},function(e,t,n){"use strict";e.exports=d;var r=n(42).codes,o=r.ERR_METHOD_NOT_IMPLEMENTED,i=r.ERR_MULTIPLE_CALLBACK,a=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=r.ERR_TRANSFORM_WITH_LENGTH_0,c=n(43);function u(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new i);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length>8,a=255&o;i?n.push(i,a):n.push(a)}return n},r.zero2=o,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}},function(e,t,n){"use strict";var r=t;r.base=n(63),r.short=n(347),r.mont=n(348),r.edwards=n(349)},function(e,t,n){"use strict";var r=n(23).rotr32;function o(e,t,n){return e&t^~e&n}function i(e,t,n){return e&t^e&n^t&n}function a(e,t,n){return e^t^n}t.ft_1=function(e,t,n,r){return 0===e?o(t,n,r):1===e||3===e?a(t,n,r):2===e?i(t,n,r):void 0},t.ch32=o,t.maj32=i,t.p32=a,t.s0_256=function(e){return r(e,2)^r(e,13)^r(e,22)},t.s1_256=function(e){return r(e,6)^r(e,11)^r(e,25)},t.g0_256=function(e){return r(e,7)^r(e,18)^e>>>3},t.g1_256=function(e){return r(e,17)^r(e,19)^e>>>10}},function(e,t,n){"use strict";var r=n(23),o=n(51),i=n(164),a=n(17),s=r.sum32,c=r.sum32_4,u=r.sum32_5,d=i.ch32,l=i.maj32,f=i.s0_256,h=i.s1_256,p=i.g0_256,A=i.g1_256,g=o.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;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}r.inherits(v,g),e.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function c(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function u(e,t,n,o){for(var i=0,a=0,s=Math.min(e.length,n),c=t;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===n)for(o=0,i=0;o>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)o=c(e,t,r)<=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,o=1;o<=67108863;o*=t)r++;r--,o=o/t|0;for(var i=e.length-n,a=i%r,s=Math.min(i,i-a)+n,c=0,d=n;d1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?""}var f=["","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"],h=[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],p=[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];i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,i=0,a=0;a>>24-o&16777215,(o+=2)>=26&&(o-=26,a--),n=0!==i||a!==this.length-1?f[6-c.length]+c+n:c+n}for(0!==i&&(n=i.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=h[e],d=p[e];n="";var l=this.clone();for(l.negative=0;!l.isZero();){var A=l.modrn(d).toString(e);n=(l=l.idivn(d)).isZero()?A+n:f[u-A.length]+A+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},a&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function A(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,c=a/67108864|0;n.words[0]=s;for(var u=1;u>>26,l=67108863&c,f=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=f;h++){var p=u-h|0;d+=(a=(o=0|e.words[p])*(i=0|t.words[h])+l)/67108864|0,l=67108863&a}n.words[u]=0|l,c=0|d}return 0!==c?n.words[u]=0|c:n.length--,n._strip()}i.prototype.toArrayLike=function(e,t,n){this._strip();var o=this.byteLength(),i=n||Math.max(1,o);r(o<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,o),a},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,o=0,i=0;o>8&255),n>16&255),6===i?(n>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===i?(n>=0&&(e[n--]=a>>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var o=0;o0&&(this.words[o]=~this.words[o]&67108863>>26-n),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var o=0,i=0;i>>26;for(;0!==o&&i>>26;if(this.length=n.length,0!==o)this.words[this.length]=o,this.length++;else if(n!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,h=0|a[1],p=8191&h,A=h>>>13,g=0|a[2],m=8191&g,v=g>>>13,y=0|a[3],b=8191&y,I=y>>>13,w=0|a[4],E=8191&w,_=w>>>13,B=0|a[5],C=8191&B,k=B>>>13,S=0|a[6],O=8191&S,Q=S>>>13,P=0|a[7],R=8191&P,M=P>>>13,x=0|a[8],D=8191&x,N=x>>>13,T=0|a[9],j=8191&T,U=T>>>13,H=0|s[0],J=8191&H,F=H>>>13,L=0|s[1],q=8191&L,G=L>>>13,V=0|s[2],z=8191&V,Y=V>>>13,K=0|s[3],W=8191&K,Z=K>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],ne=8191&te,re=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,de=0|s[8],le=8191&de,fe=de>>>13,he=0|s[9],pe=8191&he,Ae=he>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(u+(r=Math.imul(l,J))|0)+((8191&(o=(o=Math.imul(l,F))+Math.imul(f,J)|0))<<13)|0;u=((i=Math.imul(f,F))+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(p,J),o=(o=Math.imul(p,F))+Math.imul(A,J)|0,i=Math.imul(A,F);var me=(u+(r=r+Math.imul(l,q)|0)|0)+((8191&(o=(o=o+Math.imul(l,G)|0)+Math.imul(f,q)|0))<<13)|0;u=((i=i+Math.imul(f,G)|0)+(o>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,J),o=(o=Math.imul(m,F))+Math.imul(v,J)|0,i=Math.imul(v,F),r=r+Math.imul(p,q)|0,o=(o=o+Math.imul(p,G)|0)+Math.imul(A,q)|0,i=i+Math.imul(A,G)|0;var ve=(u+(r=r+Math.imul(l,z)|0)|0)+((8191&(o=(o=o+Math.imul(l,Y)|0)+Math.imul(f,z)|0))<<13)|0;u=((i=i+Math.imul(f,Y)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(b,J),o=(o=Math.imul(b,F))+Math.imul(I,J)|0,i=Math.imul(I,F),r=r+Math.imul(m,q)|0,o=(o=o+Math.imul(m,G)|0)+Math.imul(v,q)|0,i=i+Math.imul(v,G)|0,r=r+Math.imul(p,z)|0,o=(o=o+Math.imul(p,Y)|0)+Math.imul(A,z)|0,i=i+Math.imul(A,Y)|0;var ye=(u+(r=r+Math.imul(l,W)|0)|0)+((8191&(o=(o=o+Math.imul(l,Z)|0)+Math.imul(f,W)|0))<<13)|0;u=((i=i+Math.imul(f,Z)|0)+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(E,J),o=(o=Math.imul(E,F))+Math.imul(_,J)|0,i=Math.imul(_,F),r=r+Math.imul(b,q)|0,o=(o=o+Math.imul(b,G)|0)+Math.imul(I,q)|0,i=i+Math.imul(I,G)|0,r=r+Math.imul(m,z)|0,o=(o=o+Math.imul(m,Y)|0)+Math.imul(v,z)|0,i=i+Math.imul(v,Y)|0,r=r+Math.imul(p,W)|0,o=(o=o+Math.imul(p,Z)|0)+Math.imul(A,W)|0,i=i+Math.imul(A,Z)|0;var be=(u+(r=r+Math.imul(l,$)|0)|0)+((8191&(o=(o=o+Math.imul(l,ee)|0)+Math.imul(f,$)|0))<<13)|0;u=((i=i+Math.imul(f,ee)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(C,J),o=(o=Math.imul(C,F))+Math.imul(k,J)|0,i=Math.imul(k,F),r=r+Math.imul(E,q)|0,o=(o=o+Math.imul(E,G)|0)+Math.imul(_,q)|0,i=i+Math.imul(_,G)|0,r=r+Math.imul(b,z)|0,o=(o=o+Math.imul(b,Y)|0)+Math.imul(I,z)|0,i=i+Math.imul(I,Y)|0,r=r+Math.imul(m,W)|0,o=(o=o+Math.imul(m,Z)|0)+Math.imul(v,W)|0,i=i+Math.imul(v,Z)|0,r=r+Math.imul(p,$)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(A,$)|0,i=i+Math.imul(A,ee)|0;var Ie=(u+(r=r+Math.imul(l,ne)|0)|0)+((8191&(o=(o=o+Math.imul(l,re)|0)+Math.imul(f,ne)|0))<<13)|0;u=((i=i+Math.imul(f,re)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(O,J),o=(o=Math.imul(O,F))+Math.imul(Q,J)|0,i=Math.imul(Q,F),r=r+Math.imul(C,q)|0,o=(o=o+Math.imul(C,G)|0)+Math.imul(k,q)|0,i=i+Math.imul(k,G)|0,r=r+Math.imul(E,z)|0,o=(o=o+Math.imul(E,Y)|0)+Math.imul(_,z)|0,i=i+Math.imul(_,Y)|0,r=r+Math.imul(b,W)|0,o=(o=o+Math.imul(b,Z)|0)+Math.imul(I,W)|0,i=i+Math.imul(I,Z)|0,r=r+Math.imul(m,$)|0,o=(o=o+Math.imul(m,ee)|0)+Math.imul(v,$)|0,i=i+Math.imul(v,ee)|0,r=r+Math.imul(p,ne)|0,o=(o=o+Math.imul(p,re)|0)+Math.imul(A,ne)|0,i=i+Math.imul(A,re)|0;var we=(u+(r=r+Math.imul(l,ie)|0)|0)+((8191&(o=(o=o+Math.imul(l,ae)|0)+Math.imul(f,ie)|0))<<13)|0;u=((i=i+Math.imul(f,ae)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(R,J),o=(o=Math.imul(R,F))+Math.imul(M,J)|0,i=Math.imul(M,F),r=r+Math.imul(O,q)|0,o=(o=o+Math.imul(O,G)|0)+Math.imul(Q,q)|0,i=i+Math.imul(Q,G)|0,r=r+Math.imul(C,z)|0,o=(o=o+Math.imul(C,Y)|0)+Math.imul(k,z)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(E,W)|0,o=(o=o+Math.imul(E,Z)|0)+Math.imul(_,W)|0,i=i+Math.imul(_,Z)|0,r=r+Math.imul(b,$)|0,o=(o=o+Math.imul(b,ee)|0)+Math.imul(I,$)|0,i=i+Math.imul(I,ee)|0,r=r+Math.imul(m,ne)|0,o=(o=o+Math.imul(m,re)|0)+Math.imul(v,ne)|0,i=i+Math.imul(v,re)|0,r=r+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,ae)|0;var Ee=(u+(r=r+Math.imul(l,ce)|0)|0)+((8191&(o=(o=o+Math.imul(l,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((i=i+Math.imul(f,ue)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(D,J),o=(o=Math.imul(D,F))+Math.imul(N,J)|0,i=Math.imul(N,F),r=r+Math.imul(R,q)|0,o=(o=o+Math.imul(R,G)|0)+Math.imul(M,q)|0,i=i+Math.imul(M,G)|0,r=r+Math.imul(O,z)|0,o=(o=o+Math.imul(O,Y)|0)+Math.imul(Q,z)|0,i=i+Math.imul(Q,Y)|0,r=r+Math.imul(C,W)|0,o=(o=o+Math.imul(C,Z)|0)+Math.imul(k,W)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(E,$)|0,o=(o=o+Math.imul(E,ee)|0)+Math.imul(_,$)|0,i=i+Math.imul(_,ee)|0,r=r+Math.imul(b,ne)|0,o=(o=o+Math.imul(b,re)|0)+Math.imul(I,ne)|0,i=i+Math.imul(I,re)|0,r=r+Math.imul(m,ie)|0,o=(o=o+Math.imul(m,ae)|0)+Math.imul(v,ie)|0,i=i+Math.imul(v,ae)|0,r=r+Math.imul(p,ce)|0,o=(o=o+Math.imul(p,ue)|0)+Math.imul(A,ce)|0,i=i+Math.imul(A,ue)|0;var _e=(u+(r=r+Math.imul(l,le)|0)|0)+((8191&(o=(o=o+Math.imul(l,fe)|0)+Math.imul(f,le)|0))<<13)|0;u=((i=i+Math.imul(f,fe)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(j,J),o=(o=Math.imul(j,F))+Math.imul(U,J)|0,i=Math.imul(U,F),r=r+Math.imul(D,q)|0,o=(o=o+Math.imul(D,G)|0)+Math.imul(N,q)|0,i=i+Math.imul(N,G)|0,r=r+Math.imul(R,z)|0,o=(o=o+Math.imul(R,Y)|0)+Math.imul(M,z)|0,i=i+Math.imul(M,Y)|0,r=r+Math.imul(O,W)|0,o=(o=o+Math.imul(O,Z)|0)+Math.imul(Q,W)|0,i=i+Math.imul(Q,Z)|0,r=r+Math.imul(C,$)|0,o=(o=o+Math.imul(C,ee)|0)+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(E,ne)|0,o=(o=o+Math.imul(E,re)|0)+Math.imul(_,ne)|0,i=i+Math.imul(_,re)|0,r=r+Math.imul(b,ie)|0,o=(o=o+Math.imul(b,ae)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,ae)|0,r=r+Math.imul(m,ce)|0,o=(o=o+Math.imul(m,ue)|0)+Math.imul(v,ce)|0,i=i+Math.imul(v,ue)|0,r=r+Math.imul(p,le)|0,o=(o=o+Math.imul(p,fe)|0)+Math.imul(A,le)|0,i=i+Math.imul(A,fe)|0;var Be=(u+(r=r+Math.imul(l,pe)|0)|0)+((8191&(o=(o=o+Math.imul(l,Ae)|0)+Math.imul(f,pe)|0))<<13)|0;u=((i=i+Math.imul(f,Ae)|0)+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,q),o=(o=Math.imul(j,G))+Math.imul(U,q)|0,i=Math.imul(U,G),r=r+Math.imul(D,z)|0,o=(o=o+Math.imul(D,Y)|0)+Math.imul(N,z)|0,i=i+Math.imul(N,Y)|0,r=r+Math.imul(R,W)|0,o=(o=o+Math.imul(R,Z)|0)+Math.imul(M,W)|0,i=i+Math.imul(M,Z)|0,r=r+Math.imul(O,$)|0,o=(o=o+Math.imul(O,ee)|0)+Math.imul(Q,$)|0,i=i+Math.imul(Q,ee)|0,r=r+Math.imul(C,ne)|0,o=(o=o+Math.imul(C,re)|0)+Math.imul(k,ne)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(E,ie)|0,o=(o=o+Math.imul(E,ae)|0)+Math.imul(_,ie)|0,i=i+Math.imul(_,ae)|0,r=r+Math.imul(b,ce)|0,o=(o=o+Math.imul(b,ue)|0)+Math.imul(I,ce)|0,i=i+Math.imul(I,ue)|0,r=r+Math.imul(m,le)|0,o=(o=o+Math.imul(m,fe)|0)+Math.imul(v,le)|0,i=i+Math.imul(v,fe)|0;var Ce=(u+(r=r+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,Ae)|0)+Math.imul(A,pe)|0))<<13)|0;u=((i=i+Math.imul(A,Ae)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,z),o=(o=Math.imul(j,Y))+Math.imul(U,z)|0,i=Math.imul(U,Y),r=r+Math.imul(D,W)|0,o=(o=o+Math.imul(D,Z)|0)+Math.imul(N,W)|0,i=i+Math.imul(N,Z)|0,r=r+Math.imul(R,$)|0,o=(o=o+Math.imul(R,ee)|0)+Math.imul(M,$)|0,i=i+Math.imul(M,ee)|0,r=r+Math.imul(O,ne)|0,o=(o=o+Math.imul(O,re)|0)+Math.imul(Q,ne)|0,i=i+Math.imul(Q,re)|0,r=r+Math.imul(C,ie)|0,o=(o=o+Math.imul(C,ae)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,ae)|0,r=r+Math.imul(E,ce)|0,o=(o=o+Math.imul(E,ue)|0)+Math.imul(_,ce)|0,i=i+Math.imul(_,ue)|0,r=r+Math.imul(b,le)|0,o=(o=o+Math.imul(b,fe)|0)+Math.imul(I,le)|0,i=i+Math.imul(I,fe)|0;var ke=(u+(r=r+Math.imul(m,pe)|0)|0)+((8191&(o=(o=o+Math.imul(m,Ae)|0)+Math.imul(v,pe)|0))<<13)|0;u=((i=i+Math.imul(v,Ae)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,W),o=(o=Math.imul(j,Z))+Math.imul(U,W)|0,i=Math.imul(U,Z),r=r+Math.imul(D,$)|0,o=(o=o+Math.imul(D,ee)|0)+Math.imul(N,$)|0,i=i+Math.imul(N,ee)|0,r=r+Math.imul(R,ne)|0,o=(o=o+Math.imul(R,re)|0)+Math.imul(M,ne)|0,i=i+Math.imul(M,re)|0,r=r+Math.imul(O,ie)|0,o=(o=o+Math.imul(O,ae)|0)+Math.imul(Q,ie)|0,i=i+Math.imul(Q,ae)|0,r=r+Math.imul(C,ce)|0,o=(o=o+Math.imul(C,ue)|0)+Math.imul(k,ce)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(E,le)|0,o=(o=o+Math.imul(E,fe)|0)+Math.imul(_,le)|0,i=i+Math.imul(_,fe)|0;var Se=(u+(r=r+Math.imul(b,pe)|0)|0)+((8191&(o=(o=o+Math.imul(b,Ae)|0)+Math.imul(I,pe)|0))<<13)|0;u=((i=i+Math.imul(I,Ae)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,$),o=(o=Math.imul(j,ee))+Math.imul(U,$)|0,i=Math.imul(U,ee),r=r+Math.imul(D,ne)|0,o=(o=o+Math.imul(D,re)|0)+Math.imul(N,ne)|0,i=i+Math.imul(N,re)|0,r=r+Math.imul(R,ie)|0,o=(o=o+Math.imul(R,ae)|0)+Math.imul(M,ie)|0,i=i+Math.imul(M,ae)|0,r=r+Math.imul(O,ce)|0,o=(o=o+Math.imul(O,ue)|0)+Math.imul(Q,ce)|0,i=i+Math.imul(Q,ue)|0,r=r+Math.imul(C,le)|0,o=(o=o+Math.imul(C,fe)|0)+Math.imul(k,le)|0,i=i+Math.imul(k,fe)|0;var Oe=(u+(r=r+Math.imul(E,pe)|0)|0)+((8191&(o=(o=o+Math.imul(E,Ae)|0)+Math.imul(_,pe)|0))<<13)|0;u=((i=i+Math.imul(_,Ae)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(j,ne),o=(o=Math.imul(j,re))+Math.imul(U,ne)|0,i=Math.imul(U,re),r=r+Math.imul(D,ie)|0,o=(o=o+Math.imul(D,ae)|0)+Math.imul(N,ie)|0,i=i+Math.imul(N,ae)|0,r=r+Math.imul(R,ce)|0,o=(o=o+Math.imul(R,ue)|0)+Math.imul(M,ce)|0,i=i+Math.imul(M,ue)|0,r=r+Math.imul(O,le)|0,o=(o=o+Math.imul(O,fe)|0)+Math.imul(Q,le)|0,i=i+Math.imul(Q,fe)|0;var Qe=(u+(r=r+Math.imul(C,pe)|0)|0)+((8191&(o=(o=o+Math.imul(C,Ae)|0)+Math.imul(k,pe)|0))<<13)|0;u=((i=i+Math.imul(k,Ae)|0)+(o>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,r=Math.imul(j,ie),o=(o=Math.imul(j,ae))+Math.imul(U,ie)|0,i=Math.imul(U,ae),r=r+Math.imul(D,ce)|0,o=(o=o+Math.imul(D,ue)|0)+Math.imul(N,ce)|0,i=i+Math.imul(N,ue)|0,r=r+Math.imul(R,le)|0,o=(o=o+Math.imul(R,fe)|0)+Math.imul(M,le)|0,i=i+Math.imul(M,fe)|0;var Pe=(u+(r=r+Math.imul(O,pe)|0)|0)+((8191&(o=(o=o+Math.imul(O,Ae)|0)+Math.imul(Q,pe)|0))<<13)|0;u=((i=i+Math.imul(Q,Ae)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(j,ce),o=(o=Math.imul(j,ue))+Math.imul(U,ce)|0,i=Math.imul(U,ue),r=r+Math.imul(D,le)|0,o=(o=o+Math.imul(D,fe)|0)+Math.imul(N,le)|0,i=i+Math.imul(N,fe)|0;var Re=(u+(r=r+Math.imul(R,pe)|0)|0)+((8191&(o=(o=o+Math.imul(R,Ae)|0)+Math.imul(M,pe)|0))<<13)|0;u=((i=i+Math.imul(M,Ae)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,le),o=(o=Math.imul(j,fe))+Math.imul(U,le)|0,i=Math.imul(U,fe);var Me=(u+(r=r+Math.imul(D,pe)|0)|0)+((8191&(o=(o=o+Math.imul(D,Ae)|0)+Math.imul(N,pe)|0))<<13)|0;u=((i=i+Math.imul(N,Ae)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863;var xe=(u+(r=Math.imul(j,pe))|0)+((8191&(o=(o=Math.imul(j,Ae))+Math.imul(U,pe)|0))<<13)|0;return u=((i=Math.imul(U,Ae))+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,c[0]=ge,c[1]=me,c[2]=ve,c[3]=ye,c[4]=be,c[5]=Ie,c[6]=we,c[7]=Ee,c[8]=_e,c[9]=Be,c[10]=Ce,c[11]=ke,c[12]=Se,c[13]=Oe,c[14]=Qe,c[15]=Pe,c[16]=Re,c[17]=Me,c[18]=xe,0!==u&&(c[19]=u,n.length++),n};function m(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,o=0,i=0;i>>26)|0)>>>26,a&=67108863}n.words[i]=s,r=a,a=o}return 0!==r?n.words[i]=r:n.length--,n._strip()}function v(e,t,n){return m(e,t,n)}function y(e,t){this.x=e,this.y=t}Math.imul||(g=A),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):n<63?A(this,e,t):n<1024?m(this,e,t):v(this,e,t)},y.prototype.makeRBT=function(e){for(var t=new Array(e),n=i.prototype._countBits(e)-1,r=0;r>=1;return r},y.prototype.permute=function(e,t,n,r,o,i){for(var a=0;a>>=1)o++;return 1<>>=13,n[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,n+=i/67108864|0,n+=a>>>26,this.words[o]=67108863&a}return 0!==n&&(this.words[o]=n,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>o&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,n=e%26,o=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<a)for(this.length-=a,u=0;u=0&&(0!==d||u>=o);u--){var l=0|this.words[u];this.words[u]=d<<26-i|l>>>i,d=l&s}return c&&0!==d&&(c.words[c.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,o=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var o=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[o+n]=67108863&i}for(;o>26,this.words[o+n]=67108863&i;if(0===s)return this._strip();for(r(-1===s),s=0,o=0;o>26,this.words[o]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!==(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,c=r.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;l--){var f=67108864*(0|r.words[o.length+l])+(0|r.words[o.length+l-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(o,f,l);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(o,1,l),r.isZero()||(r.negative^=1);s&&(s.words[l]=f)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),o=e.andln(1),i=n.cmp(r);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,o=0,i=this.length-1;i>=0;i--)o=(n*o+(0|this.words[i]))%e;return t?-o:o},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,o=this.length-1;o>=0;o--){var i=(0|this.words[o])+67108864*n;this.words[o]=i/e|0,n=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var d=n.clone(),l=t.clone();!t.isZero();){for(var f=0,h=1;0==(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(d),a.isub(l)),o.iushrn(1),a.iushrn(1);for(var p=0,A=1;0==(n.words[0]&A)&&p<26;++p,A<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(d),c.isub(l)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,d=1;0==(t.words[0]&d)&&u<26;++u,d<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var l=0,f=1;0==(n.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(n.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var o=t.cmp(n);if(o<0){var i=t;t=n,n=i}else if(0===o||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,o=1<>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:oe.length)return 1;if(this.length=0;n--){var r=0|this.words[n],o=0|e.words[n];if(r!==o){ro&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new C(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function I(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){I.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){I.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){I.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function B(){I.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function C(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){C.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}I.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},I.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},I.prototype.split=function(e,t){e.iushrn(this.n,0,t)},I.prototype.imulK=function(e){return e.imul(this.k)},o(w,I),w.prototype.split=function(e,t){for(var n=Math.min(e.length,9),r=0;r>>22,o=i}o>>>=22,e.words[r-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=o,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new E;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new B}return b[e]=t,t},C.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},C.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},C.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(d(e,e.umod(this.m)._forceRed(this)),e)},C.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},C.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},C.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},C.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},C.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},C.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},C.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},C.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},C.prototype.isqr=function(e){return this.imul(e,e.clone())},C.prototype.sqr=function(e){return this.mul(e,e)},C.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new i(2*d*d).toRed(this);0!==this.pow(d,u).cmp(c);)d.redIAdd(c);for(var l=this.pow(d,o),f=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var A=h,g=0;0!==A.cmp(s);g++)A=A.redSqr();r(g=0;r--){for(var u=t.words[r],d=c-1;d>=0;d--){var l=u>>d&1;o!==n[0]&&(o=this.sqr(o)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===r&&0===d)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}c=26}return o},C.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},C.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new k(e)},o(k,C),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(50)(e))},function(e,t,n){"use strict";const r=t;r.bignum=n(8),r.define=n(366).define,r.base=n(369),r.constants=n(370),r.decoders=n(171),r.encoders=n(169)},function(e,t,n){"use strict";const r=t;r.der=n(170),r.pem=n(367)},function(e,t,n){"use strict";const r=n(2),o=n(89).Buffer,i=n(90),a=n(92);function s(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new c,this.tree._init(e.body)}function c(e){i.call(this,"der",e)}function u(e){return e<10?"0"+e:e}e.exports=s,s.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},r(c,i),c.prototype._encodeComposite=function(e,t,n,r){const i=function(e,t,n,r){let o;"seqof"===e?e="seq":"setof"===e&&(e="set");if(a.tagByName.hasOwnProperty(e))o=a.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return r.error("Unknown tag: "+e);o=e}if(o>=31)return r.error("Multi-octet tag encoding unsupported");t||(o|=32);return o|=a.tagClassByName[n||"universal"]<<6,o}(e,t,n,this.reporter);if(r.length<128){const e=o.alloc(2);return e[0]=i,e[1]=r.length,this._createEncoderBuffer([e,r])}let s=1;for(let e=r.length;e>=256;e>>=8)s++;const c=o.alloc(2+s);c[0]=i,c[1]=128|s;for(let e=1+s,t=r.length;t>0;e--,t>>=8)c[e]=255&t;return this._createEncoderBuffer([c,r])},c.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){const t=o.alloc(2*e.length);for(let n=0;n=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let r=0;for(let t=0;t=128;n>>=7)r++}const i=o.alloc(r);let a=i.length-1;for(let t=e.length-1;t>=0;t--){let n=e[t];for(i[a--]=127&n;(n>>=7)>0;)i[a--]=128|127&n}return this._createEncoderBuffer(i)},c.prototype._encodeTime=function(e,t){let n;const r=new Date(e);return"gentime"===t?n=[u(r.getUTCFullYear()),u(r.getUTCMonth()+1),u(r.getUTCDate()),u(r.getUTCHours()),u(r.getUTCMinutes()),u(r.getUTCSeconds()),"Z"].join(""):"utctime"===t?n=[u(r.getUTCFullYear()%100),u(r.getUTCMonth()+1),u(r.getUTCDate()),u(r.getUTCHours()),u(r.getUTCMinutes()),u(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!o.isBuffer(e)){const t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=o.from(t)}if(o.isBuffer(e)){let t=e.length;0===e.length&&t++;const n=o.alloc(t);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let n=1;for(let t=e;t>=256;t>>=8)n++;const r=new Array(n);for(let t=r.length-1;t>=0;t--)r[t]=255&e,e>>=8;return 128&r[0]&&r.unshift(0),this._createEncoderBuffer(o.from(r))},c.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},c.prototype._skipDefault=function(e,t,n){const r=this._baseState;let o;if(null===r.default)return!1;const i=e.join();if(void 0===r.defaultBuffer&&(r.defaultBuffer=this._encodeValue(r.default,t,n).join()),i.length!==r.defaultBuffer.length)return!1;for(o=0;o>6],o=0==(32&n);if(31==(31&n)){let r=n;for(n=0;128==(128&r);){if(r=e.readUInt8(t),e.isError(r))return r;n<<=7,n|=127&r}}else n&=31;return{cls:r,primitive:o,tag:n,tagStr:s.tag[n]}}function l(e,t,n){let r=e.readUInt8(n);if(e.isError(r))return r;if(!t&&128===r)return null;if(0==(128&r))return r;const o=127&r;if(o>4)return e.error("length octect is too long");r=0;for(let t=0;t32||0===e.length||0===e[0])throw new Error("Unsigned integer r must be encoded as unpadded big endian.");if(t.length>32||0===t.length||0===t[0])throw new Error("Unsigned integer s must be encoded as unpadded big endian.");this.data={r:e,s:t}}static fromFixedLength(e){if(64!==e.length)throw new Error(`Got invalid data length: ${e.length}. Expected 2x 32 bytes for the pair (r, s)`);return new o(r(e.slice(0,32)),r(e.slice(32,64)))}static fromDer(e){let t=0;if(48!==e[t++])throw new Error("Prefix 0x30 expected");const n=e[t++];if(e.length-t!==n)throw new Error("Data length mismatch detected");if(2!==e[t++])throw new Error("INTEGER tag expected");const i=e[t++];if(i>=128)throw new Error("Decoding length values above 127 not supported");const a=e.slice(t,t+i);t+=i;if(2!==e[t++])throw new Error("INTEGER tag expected");const s=e[t++];if(s>=128)throw new Error("Decoding length values above 127 not supported");const c=e.slice(t,t+s);return t+=s,new o(r(a),r(c))}r(e){if(void 0===e)return this.data.r;{const t=e-this.data.r.length;if(t<0)throw new Error("Length too small to hold parameter r");const n=new Uint8Array(t);return new Uint8Array([...n,...this.data.r])}}s(e){if(void 0===e)return this.data.s;{const t=e-this.data.s.length;if(t<0)throw new Error("Length too small to hold parameter s");const n=new Uint8Array(t);return new Uint8Array([...n,...this.data.s])}}toFixedLength(){return new Uint8Array([...this.r(32),...this.s(32)])}toDer(){const e=this.data.r[0]>=128?new Uint8Array([0,...this.data.r]):this.data.r,t=this.data.s[0]>=128?new Uint8Array([0,...this.data.s]):this.data.s,n=e.length,r=t.length,o=new Uint8Array([2,n,...e,2,r,...t]);return new Uint8Array([48,o.length,...o])}}t.Secp256k1Signature=o;class i extends o{constructor(e,t,n){if(super(e,t),!Number.isInteger(n))throw new Error("The recovery parameter must be an integer.");if(n<0||n>4)throw new Error("The recovery parameter must be one of 0, 1, 2, 3.");this.recovery=n}static fromFixedLength(e){if(65!==e.length)throw new Error(`Got invalid data length ${e.length}. Expected 32 + 32 + 1`);return new i(r(e.slice(0,32)),r(e.slice(32,64)),e[64])}toFixedLength(){return new Uint8Array([...this.r(32),...this.s(32),this.recovery])}}t.ExtendedSecp256k1Signature=i},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.sha512=t.Sha512=t.sha256=t.Sha256=t.sha1=t.Sha1=void 0;const o=r(n(57));class i{constructor(e){this.blockSize=64,this.impl=o.default("sha1"),e&&this.update(e)}update(e){return this.impl.update(e),this}digest(){return new Uint8Array(this.impl.digest())}}t.Sha1=i,t.sha1=function(e){return new i(e).digest()};class a{constructor(e){this.blockSize=64,this.impl=o.default("sha256"),e&&this.update(e)}update(e){return this.impl.update(e),this}digest(){return new Uint8Array(this.impl.digest())}}t.Sha256=a,t.sha256=function(e){return new a(e).digest()};class s{constructor(e){this.blockSize=128,this.impl=o.default("sha512"),e&&this.update(e)}update(e){return this.impl.update(e),this}digest(){return new Uint8Array(this.impl.digest())}}t.Sha512=s,t.sha512=function(e){return new s(e).digest()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseCoins=t.coins=t.coin=void 0;const r=n(44);function o(e,t){return{amount:new r.Uint53(e).toString(),denom:t}}t.coin=o,t.coins=function(e,t){return[o(e,t)]},t.parseCoins=function(e){return e.replace(/\s/g,"").split(",").filter(Boolean).map(e=>{const t=e.match(/^([0-9]+)([a-zA-Z]+)/);if(!t)throw new Error("Got an invalid coin string");return{amount:r.Uint64.fromString(t[1]).toString(),denom:t[2]}})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CosmosClient=t.isSearchByTagsQuery=t.isSearchBySentFromOrToQuery=t.isSearchByHeightQuery=t.isSearchByIdQuery=t.assertIsBroadcastTxSuccess=t.isBroadcastTxSuccess=t.isBroadcastTxFailure=void 0;const r=n(46),o=n(22),i=n(44),a=n(93),s=n(117);function c(e){return!!e.code}function u(e){return void 0!==e.id}function d(e){return void 0!==e.height}function l(e){return void 0!==e.sentFromOrTo}function f(e){return void 0!==e.tags}t.isBroadcastTxFailure=c,t.isBroadcastTxSuccess=function(e){return!c(e)},t.assertIsBroadcastTxSuccess=function(e){if(c(e))throw new Error(`Error when broadcasting tx ${e.transactionHash} at height ${e.height}. Code: ${e.code}; Raw log: ${e.rawLog}`)},t.isSearchByIdQuery=u,t.isSearchByHeightQuery=d,t.isSearchBySentFromOrToQuery=l,t.isSearchByTagsQuery=f;t.CosmosClient=class{constructor(e,t=a.BroadcastMode.Block){this.lcdClient=a.LcdClient.withExtensions({apiUrl:e,broadcastMode:t},a.setupAuthExtension)}async getChainId(){if(!this.chainId){const e=(await this.lcdClient.nodeInfo()).node_info.network;if(!e)throw new Error("Chain ID must not be empty");this.chainId=e}return this.chainId}async getHeight(){if(this.anyValidAddress){const{height:e}=await this.lcdClient.auth.account(this.anyValidAddress);return parseInt(e,10)}{const e=await this.lcdClient.blocksLatest();return parseInt(e.block.header.height,10)}}async getIdentifier(e){const t=await this.lcdClient.encodeTx(e),n=r.sha256(o.fromBase64(t.tx));return o.toHex(n).toUpperCase()}async getSequence(e){const t=await this.getAccount(e);if(!t)throw new Error("Account does not exist on chain. Send some tokens there before trying to query sequence.");return{accountNumber:t.accountNumber,sequence:t.sequence}}async getAccount(e){const t=(await this.lcdClient.auth.account(e)).result.value;return""===t.address?void 0:(this.anyValidAddress=t.address,{address:t.address,balance:t.coins,pubkey:a.normalizePubkey(t.public_key)||void 0,accountNumber:a.uint64ToNumber(t.account_number),sequence:a.uint64ToNumber(t.sequence)})}async getBlock(e){const t=void 0!==e?await this.lcdClient.blocks(e):await this.lcdClient.blocksLatest();return{id:t.block_id.hash,header:{version:t.block.header.version,time:t.block.header.time,height:parseInt(t.block.header.height,10),chainId:t.block.header.chain_id},txs:(t.block.data.txs||[]).map(o.fromBase64)}}async searchTx(e,t={}){const n=t.minHeight||0,r=t.maxHeight||Number.MAX_SAFE_INTEGER;if(re.hash);i=[...r,...a.filter(e=>!s.includes(e.hash))]}else{if(!f(e))throw new Error("Unknown query type");{const t=o(e.tags.map(e=>`${e.key}=${e.value}`).join("&"));i=await this.txsQuery(t)}}return i.filter(e=>e.height>=n&&e.height<=r)}async broadcastTx(e){const t=await this.lcdClient.broadcastTx(e);if(!t.txhash.match(/^([0-9A-F][0-9A-F])+$/))throw new Error("Received ill-formatted txhash. Must be non-empty upper-case hex");return void 0!==t.code?{height:i.Uint53.fromString(t.height).toNumber(),transactionHash:t.txhash,code:t.code,rawLog:t.raw_log||""}:{logs:t.logs?s.parseLogs(t.logs):[],rawLog:t.raw_log||"",transactionHash:t.txhash,data:t.data?o.fromHex(t.data):void 0}}async txsQuery(e){const t=await this.lcdClient.txsQuery(e+"&limit=100");if(parseInt(t.page_total,10)>1)throw new Error(`Found more results on the backend than we can process currently. Results: ${t.total_count}, supported: 100`);return t.txs.map(e=>({height:parseInt(e.height,10),hash:e.txhash,code:e.code||0,rawLog:e.raw_log,logs:s.parseLogs(e.logs||[]),tx:e.tx,timestamp:e.timestamp}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BroadcastMode=void 0,function(e){e.Block="block",e.Sync="sync",e.Async="async"}(t.BroadcastMode||(t.BroadcastMode={}))},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r.+?)(?[a-z]+)$/);if(!t)throw new Error("Invalid gas price string");const{amount:n,denom:o}=t.groups;if(o.length<3||o.length>127)throw new Error("Gas price denomination must be between 3 and 127 characters");const a=r.Decimal.fromUserInput(n,18);return new i(a,o)}}function a(e,{denom:t,amount:n}){const i=Math.ceil(n.multiply(new r.Uint53(e)).toFloatApproximation());return{amount:o.coins(i,t),gas:e.toString()}}t.GasPrice=i,t.buildFeeTable=function(e,t,n){return Object.entries(t).reduce((t,[r,o])=>Object.assign(Object.assign({},t),{[r]:a(n[r]||o,e)}),{})}},function(e,t,n){"use strict";function r(e){const{memo:t,msg:n,fee:r,signatures:o}=e;return"string"==typeof t&&Array.isArray(n)&&"object"==typeof r&&Array.isArray(o)}Object.defineProperty(t,"__esModule",{value:!0}),t.isWrappedStdTx=t.makeStdTx=t.isStdTx=void 0,t.isStdTx=r,t.makeStdTx=function(e,t){return{msg:e.msgs,fee:e.fee,memo:e.memo,signatures:Array.isArray(t)?t:[t]}},t.isWrappedStdTx=function(e){return"cosmos-sdk/StdTx"===e.type&&r(e.value)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decrypt=t.encrypt=t.supportedAlgorithms=t.executeKdf=t.cosmjsSalt=t.makeCosmoshubPath=void 0;const r=n(46),o=n(22);t.makeCosmoshubPath=function(e){return[r.Slip10RawIndex.hardened(44),r.Slip10RawIndex.hardened(118),r.Slip10RawIndex.hardened(0),r.Slip10RawIndex.normal(0),r.Slip10RawIndex.normal(e)]},t.cosmjsSalt=o.toAscii("The CosmJS salt."),t.executeKdf=async function(e,n){switch(n.algorithm){case"argon2id":{const o=n.params;if(!r.isArgon2idOptions(o))throw new Error("Invalid format of argon2id params");return r.Argon2id.execute(e,t.cosmjsSalt,o)}default:throw new Error("Unsupported KDF algorithm")}},t.supportedAlgorithms={xchacha20poly1305Ietf:"xchacha20poly1305-ietf"},t.encrypt=async function(e,n,o){switch(o.algorithm){case t.supportedAlgorithms.xchacha20poly1305Ietf:{const t=r.Random.getBytes(r.xchacha20NonceLength);return new Uint8Array([...t,...await r.Xchacha20poly1305Ietf.encrypt(e,n,t)])}default:throw new Error(`Unsupported encryption algorithm: '${o.algorithm}'`)}},t.decrypt=async function(e,n,o){switch(o.algorithm){case t.supportedAlgorithms.xchacha20poly1305Ietf:{const t=e.slice(0,r.xchacha20NonceLength);return r.Xchacha20poly1305Ietf.decrypt(e.slice(r.xchacha20NonceLength),n,t)}default:throw new Error(`Unsupported encryption algorithm: '${o.algorithm}'`)}}},function(e,t,n){(function(e){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:n(421).Buffer}catch(e){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function c(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function u(e,t,n,o){for(var i=0,a=0,s=Math.min(e.length,n),c=t;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===n)for(o=0,i=0;o>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)o=c(e,t,r)<=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,o=1;o<=67108863;o*=t)r++;r--,o=o/t|0;for(var i=e.length-n,a=i%r,s=Math.min(i,i-a)+n,c=0,d=n;d1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?""}var f=["","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"],h=[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],p=[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];i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,i=0,a=0;a>>24-o&16777215,(o+=2)>=26&&(o-=26,a--),n=0!==i||a!==this.length-1?f[6-c.length]+c+n:c+n}for(0!==i&&(n=i.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=h[e],d=p[e];n="";var l=this.clone();for(l.negative=0;!l.isZero();){var A=l.modrn(d).toString(e);n=(l=l.idivn(d)).isZero()?A+n:f[u-A.length]+A+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},a&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function A(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,c=a/67108864|0;n.words[0]=s;for(var u=1;u>>26,l=67108863&c,f=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=f;h++){var p=u-h|0;d+=(a=(o=0|e.words[p])*(i=0|t.words[h])+l)/67108864|0,l=67108863&a}n.words[u]=0|l,c=0|d}return 0!==c?n.words[u]=0|c:n.length--,n._strip()}i.prototype.toArrayLike=function(e,t,n){this._strip();var o=this.byteLength(),i=n||Math.max(1,o);r(o<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,o),a},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,o=0,i=0;o>8&255),n>16&255),6===i?(n>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===i?(n>=0&&(e[n--]=a>>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var o=0;o0&&(this.words[o]=~this.words[o]&67108863>>26-n),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var o=0,i=0;i>>26;for(;0!==o&&i>>26;if(this.length=n.length,0!==o)this.words[this.length]=o,this.length++;else if(n!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,h=0|a[1],p=8191&h,A=h>>>13,g=0|a[2],m=8191&g,v=g>>>13,y=0|a[3],b=8191&y,I=y>>>13,w=0|a[4],E=8191&w,_=w>>>13,B=0|a[5],C=8191&B,k=B>>>13,S=0|a[6],O=8191&S,Q=S>>>13,P=0|a[7],R=8191&P,M=P>>>13,x=0|a[8],D=8191&x,N=x>>>13,T=0|a[9],j=8191&T,U=T>>>13,H=0|s[0],J=8191&H,F=H>>>13,L=0|s[1],q=8191&L,G=L>>>13,V=0|s[2],z=8191&V,Y=V>>>13,K=0|s[3],W=8191&K,Z=K>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],ne=8191&te,re=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,de=0|s[8],le=8191&de,fe=de>>>13,he=0|s[9],pe=8191&he,Ae=he>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(u+(r=Math.imul(l,J))|0)+((8191&(o=(o=Math.imul(l,F))+Math.imul(f,J)|0))<<13)|0;u=((i=Math.imul(f,F))+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(p,J),o=(o=Math.imul(p,F))+Math.imul(A,J)|0,i=Math.imul(A,F);var me=(u+(r=r+Math.imul(l,q)|0)|0)+((8191&(o=(o=o+Math.imul(l,G)|0)+Math.imul(f,q)|0))<<13)|0;u=((i=i+Math.imul(f,G)|0)+(o>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,J),o=(o=Math.imul(m,F))+Math.imul(v,J)|0,i=Math.imul(v,F),r=r+Math.imul(p,q)|0,o=(o=o+Math.imul(p,G)|0)+Math.imul(A,q)|0,i=i+Math.imul(A,G)|0;var ve=(u+(r=r+Math.imul(l,z)|0)|0)+((8191&(o=(o=o+Math.imul(l,Y)|0)+Math.imul(f,z)|0))<<13)|0;u=((i=i+Math.imul(f,Y)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(b,J),o=(o=Math.imul(b,F))+Math.imul(I,J)|0,i=Math.imul(I,F),r=r+Math.imul(m,q)|0,o=(o=o+Math.imul(m,G)|0)+Math.imul(v,q)|0,i=i+Math.imul(v,G)|0,r=r+Math.imul(p,z)|0,o=(o=o+Math.imul(p,Y)|0)+Math.imul(A,z)|0,i=i+Math.imul(A,Y)|0;var ye=(u+(r=r+Math.imul(l,W)|0)|0)+((8191&(o=(o=o+Math.imul(l,Z)|0)+Math.imul(f,W)|0))<<13)|0;u=((i=i+Math.imul(f,Z)|0)+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(E,J),o=(o=Math.imul(E,F))+Math.imul(_,J)|0,i=Math.imul(_,F),r=r+Math.imul(b,q)|0,o=(o=o+Math.imul(b,G)|0)+Math.imul(I,q)|0,i=i+Math.imul(I,G)|0,r=r+Math.imul(m,z)|0,o=(o=o+Math.imul(m,Y)|0)+Math.imul(v,z)|0,i=i+Math.imul(v,Y)|0,r=r+Math.imul(p,W)|0,o=(o=o+Math.imul(p,Z)|0)+Math.imul(A,W)|0,i=i+Math.imul(A,Z)|0;var be=(u+(r=r+Math.imul(l,$)|0)|0)+((8191&(o=(o=o+Math.imul(l,ee)|0)+Math.imul(f,$)|0))<<13)|0;u=((i=i+Math.imul(f,ee)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(C,J),o=(o=Math.imul(C,F))+Math.imul(k,J)|0,i=Math.imul(k,F),r=r+Math.imul(E,q)|0,o=(o=o+Math.imul(E,G)|0)+Math.imul(_,q)|0,i=i+Math.imul(_,G)|0,r=r+Math.imul(b,z)|0,o=(o=o+Math.imul(b,Y)|0)+Math.imul(I,z)|0,i=i+Math.imul(I,Y)|0,r=r+Math.imul(m,W)|0,o=(o=o+Math.imul(m,Z)|0)+Math.imul(v,W)|0,i=i+Math.imul(v,Z)|0,r=r+Math.imul(p,$)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(A,$)|0,i=i+Math.imul(A,ee)|0;var Ie=(u+(r=r+Math.imul(l,ne)|0)|0)+((8191&(o=(o=o+Math.imul(l,re)|0)+Math.imul(f,ne)|0))<<13)|0;u=((i=i+Math.imul(f,re)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(O,J),o=(o=Math.imul(O,F))+Math.imul(Q,J)|0,i=Math.imul(Q,F),r=r+Math.imul(C,q)|0,o=(o=o+Math.imul(C,G)|0)+Math.imul(k,q)|0,i=i+Math.imul(k,G)|0,r=r+Math.imul(E,z)|0,o=(o=o+Math.imul(E,Y)|0)+Math.imul(_,z)|0,i=i+Math.imul(_,Y)|0,r=r+Math.imul(b,W)|0,o=(o=o+Math.imul(b,Z)|0)+Math.imul(I,W)|0,i=i+Math.imul(I,Z)|0,r=r+Math.imul(m,$)|0,o=(o=o+Math.imul(m,ee)|0)+Math.imul(v,$)|0,i=i+Math.imul(v,ee)|0,r=r+Math.imul(p,ne)|0,o=(o=o+Math.imul(p,re)|0)+Math.imul(A,ne)|0,i=i+Math.imul(A,re)|0;var we=(u+(r=r+Math.imul(l,ie)|0)|0)+((8191&(o=(o=o+Math.imul(l,ae)|0)+Math.imul(f,ie)|0))<<13)|0;u=((i=i+Math.imul(f,ae)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(R,J),o=(o=Math.imul(R,F))+Math.imul(M,J)|0,i=Math.imul(M,F),r=r+Math.imul(O,q)|0,o=(o=o+Math.imul(O,G)|0)+Math.imul(Q,q)|0,i=i+Math.imul(Q,G)|0,r=r+Math.imul(C,z)|0,o=(o=o+Math.imul(C,Y)|0)+Math.imul(k,z)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(E,W)|0,o=(o=o+Math.imul(E,Z)|0)+Math.imul(_,W)|0,i=i+Math.imul(_,Z)|0,r=r+Math.imul(b,$)|0,o=(o=o+Math.imul(b,ee)|0)+Math.imul(I,$)|0,i=i+Math.imul(I,ee)|0,r=r+Math.imul(m,ne)|0,o=(o=o+Math.imul(m,re)|0)+Math.imul(v,ne)|0,i=i+Math.imul(v,re)|0,r=r+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,ae)|0;var Ee=(u+(r=r+Math.imul(l,ce)|0)|0)+((8191&(o=(o=o+Math.imul(l,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((i=i+Math.imul(f,ue)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(D,J),o=(o=Math.imul(D,F))+Math.imul(N,J)|0,i=Math.imul(N,F),r=r+Math.imul(R,q)|0,o=(o=o+Math.imul(R,G)|0)+Math.imul(M,q)|0,i=i+Math.imul(M,G)|0,r=r+Math.imul(O,z)|0,o=(o=o+Math.imul(O,Y)|0)+Math.imul(Q,z)|0,i=i+Math.imul(Q,Y)|0,r=r+Math.imul(C,W)|0,o=(o=o+Math.imul(C,Z)|0)+Math.imul(k,W)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(E,$)|0,o=(o=o+Math.imul(E,ee)|0)+Math.imul(_,$)|0,i=i+Math.imul(_,ee)|0,r=r+Math.imul(b,ne)|0,o=(o=o+Math.imul(b,re)|0)+Math.imul(I,ne)|0,i=i+Math.imul(I,re)|0,r=r+Math.imul(m,ie)|0,o=(o=o+Math.imul(m,ae)|0)+Math.imul(v,ie)|0,i=i+Math.imul(v,ae)|0,r=r+Math.imul(p,ce)|0,o=(o=o+Math.imul(p,ue)|0)+Math.imul(A,ce)|0,i=i+Math.imul(A,ue)|0;var _e=(u+(r=r+Math.imul(l,le)|0)|0)+((8191&(o=(o=o+Math.imul(l,fe)|0)+Math.imul(f,le)|0))<<13)|0;u=((i=i+Math.imul(f,fe)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(j,J),o=(o=Math.imul(j,F))+Math.imul(U,J)|0,i=Math.imul(U,F),r=r+Math.imul(D,q)|0,o=(o=o+Math.imul(D,G)|0)+Math.imul(N,q)|0,i=i+Math.imul(N,G)|0,r=r+Math.imul(R,z)|0,o=(o=o+Math.imul(R,Y)|0)+Math.imul(M,z)|0,i=i+Math.imul(M,Y)|0,r=r+Math.imul(O,W)|0,o=(o=o+Math.imul(O,Z)|0)+Math.imul(Q,W)|0,i=i+Math.imul(Q,Z)|0,r=r+Math.imul(C,$)|0,o=(o=o+Math.imul(C,ee)|0)+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(E,ne)|0,o=(o=o+Math.imul(E,re)|0)+Math.imul(_,ne)|0,i=i+Math.imul(_,re)|0,r=r+Math.imul(b,ie)|0,o=(o=o+Math.imul(b,ae)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,ae)|0,r=r+Math.imul(m,ce)|0,o=(o=o+Math.imul(m,ue)|0)+Math.imul(v,ce)|0,i=i+Math.imul(v,ue)|0,r=r+Math.imul(p,le)|0,o=(o=o+Math.imul(p,fe)|0)+Math.imul(A,le)|0,i=i+Math.imul(A,fe)|0;var Be=(u+(r=r+Math.imul(l,pe)|0)|0)+((8191&(o=(o=o+Math.imul(l,Ae)|0)+Math.imul(f,pe)|0))<<13)|0;u=((i=i+Math.imul(f,Ae)|0)+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,q),o=(o=Math.imul(j,G))+Math.imul(U,q)|0,i=Math.imul(U,G),r=r+Math.imul(D,z)|0,o=(o=o+Math.imul(D,Y)|0)+Math.imul(N,z)|0,i=i+Math.imul(N,Y)|0,r=r+Math.imul(R,W)|0,o=(o=o+Math.imul(R,Z)|0)+Math.imul(M,W)|0,i=i+Math.imul(M,Z)|0,r=r+Math.imul(O,$)|0,o=(o=o+Math.imul(O,ee)|0)+Math.imul(Q,$)|0,i=i+Math.imul(Q,ee)|0,r=r+Math.imul(C,ne)|0,o=(o=o+Math.imul(C,re)|0)+Math.imul(k,ne)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(E,ie)|0,o=(o=o+Math.imul(E,ae)|0)+Math.imul(_,ie)|0,i=i+Math.imul(_,ae)|0,r=r+Math.imul(b,ce)|0,o=(o=o+Math.imul(b,ue)|0)+Math.imul(I,ce)|0,i=i+Math.imul(I,ue)|0,r=r+Math.imul(m,le)|0,o=(o=o+Math.imul(m,fe)|0)+Math.imul(v,le)|0,i=i+Math.imul(v,fe)|0;var Ce=(u+(r=r+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,Ae)|0)+Math.imul(A,pe)|0))<<13)|0;u=((i=i+Math.imul(A,Ae)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,z),o=(o=Math.imul(j,Y))+Math.imul(U,z)|0,i=Math.imul(U,Y),r=r+Math.imul(D,W)|0,o=(o=o+Math.imul(D,Z)|0)+Math.imul(N,W)|0,i=i+Math.imul(N,Z)|0,r=r+Math.imul(R,$)|0,o=(o=o+Math.imul(R,ee)|0)+Math.imul(M,$)|0,i=i+Math.imul(M,ee)|0,r=r+Math.imul(O,ne)|0,o=(o=o+Math.imul(O,re)|0)+Math.imul(Q,ne)|0,i=i+Math.imul(Q,re)|0,r=r+Math.imul(C,ie)|0,o=(o=o+Math.imul(C,ae)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,ae)|0,r=r+Math.imul(E,ce)|0,o=(o=o+Math.imul(E,ue)|0)+Math.imul(_,ce)|0,i=i+Math.imul(_,ue)|0,r=r+Math.imul(b,le)|0,o=(o=o+Math.imul(b,fe)|0)+Math.imul(I,le)|0,i=i+Math.imul(I,fe)|0;var ke=(u+(r=r+Math.imul(m,pe)|0)|0)+((8191&(o=(o=o+Math.imul(m,Ae)|0)+Math.imul(v,pe)|0))<<13)|0;u=((i=i+Math.imul(v,Ae)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,W),o=(o=Math.imul(j,Z))+Math.imul(U,W)|0,i=Math.imul(U,Z),r=r+Math.imul(D,$)|0,o=(o=o+Math.imul(D,ee)|0)+Math.imul(N,$)|0,i=i+Math.imul(N,ee)|0,r=r+Math.imul(R,ne)|0,o=(o=o+Math.imul(R,re)|0)+Math.imul(M,ne)|0,i=i+Math.imul(M,re)|0,r=r+Math.imul(O,ie)|0,o=(o=o+Math.imul(O,ae)|0)+Math.imul(Q,ie)|0,i=i+Math.imul(Q,ae)|0,r=r+Math.imul(C,ce)|0,o=(o=o+Math.imul(C,ue)|0)+Math.imul(k,ce)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(E,le)|0,o=(o=o+Math.imul(E,fe)|0)+Math.imul(_,le)|0,i=i+Math.imul(_,fe)|0;var Se=(u+(r=r+Math.imul(b,pe)|0)|0)+((8191&(o=(o=o+Math.imul(b,Ae)|0)+Math.imul(I,pe)|0))<<13)|0;u=((i=i+Math.imul(I,Ae)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,$),o=(o=Math.imul(j,ee))+Math.imul(U,$)|0,i=Math.imul(U,ee),r=r+Math.imul(D,ne)|0,o=(o=o+Math.imul(D,re)|0)+Math.imul(N,ne)|0,i=i+Math.imul(N,re)|0,r=r+Math.imul(R,ie)|0,o=(o=o+Math.imul(R,ae)|0)+Math.imul(M,ie)|0,i=i+Math.imul(M,ae)|0,r=r+Math.imul(O,ce)|0,o=(o=o+Math.imul(O,ue)|0)+Math.imul(Q,ce)|0,i=i+Math.imul(Q,ue)|0,r=r+Math.imul(C,le)|0,o=(o=o+Math.imul(C,fe)|0)+Math.imul(k,le)|0,i=i+Math.imul(k,fe)|0;var Oe=(u+(r=r+Math.imul(E,pe)|0)|0)+((8191&(o=(o=o+Math.imul(E,Ae)|0)+Math.imul(_,pe)|0))<<13)|0;u=((i=i+Math.imul(_,Ae)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(j,ne),o=(o=Math.imul(j,re))+Math.imul(U,ne)|0,i=Math.imul(U,re),r=r+Math.imul(D,ie)|0,o=(o=o+Math.imul(D,ae)|0)+Math.imul(N,ie)|0,i=i+Math.imul(N,ae)|0,r=r+Math.imul(R,ce)|0,o=(o=o+Math.imul(R,ue)|0)+Math.imul(M,ce)|0,i=i+Math.imul(M,ue)|0,r=r+Math.imul(O,le)|0,o=(o=o+Math.imul(O,fe)|0)+Math.imul(Q,le)|0,i=i+Math.imul(Q,fe)|0;var Qe=(u+(r=r+Math.imul(C,pe)|0)|0)+((8191&(o=(o=o+Math.imul(C,Ae)|0)+Math.imul(k,pe)|0))<<13)|0;u=((i=i+Math.imul(k,Ae)|0)+(o>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,r=Math.imul(j,ie),o=(o=Math.imul(j,ae))+Math.imul(U,ie)|0,i=Math.imul(U,ae),r=r+Math.imul(D,ce)|0,o=(o=o+Math.imul(D,ue)|0)+Math.imul(N,ce)|0,i=i+Math.imul(N,ue)|0,r=r+Math.imul(R,le)|0,o=(o=o+Math.imul(R,fe)|0)+Math.imul(M,le)|0,i=i+Math.imul(M,fe)|0;var Pe=(u+(r=r+Math.imul(O,pe)|0)|0)+((8191&(o=(o=o+Math.imul(O,Ae)|0)+Math.imul(Q,pe)|0))<<13)|0;u=((i=i+Math.imul(Q,Ae)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(j,ce),o=(o=Math.imul(j,ue))+Math.imul(U,ce)|0,i=Math.imul(U,ue),r=r+Math.imul(D,le)|0,o=(o=o+Math.imul(D,fe)|0)+Math.imul(N,le)|0,i=i+Math.imul(N,fe)|0;var Re=(u+(r=r+Math.imul(R,pe)|0)|0)+((8191&(o=(o=o+Math.imul(R,Ae)|0)+Math.imul(M,pe)|0))<<13)|0;u=((i=i+Math.imul(M,Ae)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,le),o=(o=Math.imul(j,fe))+Math.imul(U,le)|0,i=Math.imul(U,fe);var Me=(u+(r=r+Math.imul(D,pe)|0)|0)+((8191&(o=(o=o+Math.imul(D,Ae)|0)+Math.imul(N,pe)|0))<<13)|0;u=((i=i+Math.imul(N,Ae)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863;var xe=(u+(r=Math.imul(j,pe))|0)+((8191&(o=(o=Math.imul(j,Ae))+Math.imul(U,pe)|0))<<13)|0;return u=((i=Math.imul(U,Ae))+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,c[0]=ge,c[1]=me,c[2]=ve,c[3]=ye,c[4]=be,c[5]=Ie,c[6]=we,c[7]=Ee,c[8]=_e,c[9]=Be,c[10]=Ce,c[11]=ke,c[12]=Se,c[13]=Oe,c[14]=Qe,c[15]=Pe,c[16]=Re,c[17]=Me,c[18]=xe,0!==u&&(c[19]=u,n.length++),n};function m(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,o=0,i=0;i>>26)|0)>>>26,a&=67108863}n.words[i]=s,r=a,a=o}return 0!==r?n.words[i]=r:n.length--,n._strip()}function v(e,t,n){return m(e,t,n)}function y(e,t){this.x=e,this.y=t}Math.imul||(g=A),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):n<63?A(this,e,t):n<1024?m(this,e,t):v(this,e,t)},y.prototype.makeRBT=function(e){for(var t=new Array(e),n=i.prototype._countBits(e)-1,r=0;r>=1;return r},y.prototype.permute=function(e,t,n,r,o,i){for(var a=0;a>>=1)o++;return 1<>>=13,n[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,n+=i/67108864|0,n+=a>>>26,this.words[o]=67108863&a}return 0!==n&&(this.words[o]=n,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>o&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,n=e%26,o=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<a)for(this.length-=a,u=0;u=0&&(0!==d||u>=o);u--){var l=0|this.words[u];this.words[u]=d<<26-i|l>>>i,d=l&s}return c&&0!==d&&(c.words[c.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,o=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var o=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[o+n]=67108863&i}for(;o>26,this.words[o+n]=67108863&i;if(0===s)return this._strip();for(r(-1===s),s=0,o=0;o>26,this.words[o]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!==(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,c=r.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;l--){var f=67108864*(0|r.words[o.length+l])+(0|r.words[o.length+l-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(o,f,l);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(o,1,l),r.isZero()||(r.negative^=1);s&&(s.words[l]=f)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),o=e.andln(1),i=n.cmp(r);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,o=0,i=this.length-1;i>=0;i--)o=(n*o+(0|this.words[i]))%e;return t?-o:o},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,o=this.length-1;o>=0;o--){var i=(0|this.words[o])+67108864*n;this.words[o]=i/e|0,n=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var d=n.clone(),l=t.clone();!t.isZero();){for(var f=0,h=1;0==(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(d),a.isub(l)),o.iushrn(1),a.iushrn(1);for(var p=0,A=1;0==(n.words[0]&A)&&p<26;++p,A<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(d),c.isub(l)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,d=1;0==(t.words[0]&d)&&u<26;++u,d<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var l=0,f=1;0==(n.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(n.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var o=t.cmp(n);if(o<0){var i=t;t=n,n=i}else if(0===o||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,o=1<>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:oe.length)return 1;if(this.length=0;n--){var r=0|this.words[n],o=0|e.words[n];if(r!==o){ro&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new C(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function I(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){I.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){I.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){I.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function B(){I.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function C(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){C.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}I.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},I.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},I.prototype.split=function(e,t){e.iushrn(this.n,0,t)},I.prototype.imulK=function(e){return e.imul(this.k)},o(w,I),w.prototype.split=function(e,t){for(var n=Math.min(e.length,9),r=0;r>>22,o=i}o>>>=22,e.words[r-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=o,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new E;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new B}return b[e]=t,t},C.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},C.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},C.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(d(e,e.umod(this.m)._forceRed(this)),e)},C.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},C.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},C.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},C.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},C.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},C.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},C.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},C.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},C.prototype.isqr=function(e){return this.imul(e,e.clone())},C.prototype.sqr=function(e){return this.mul(e,e)},C.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new i(2*d*d).toRed(this);0!==this.pow(d,u).cmp(c);)d.redIAdd(c);for(var l=this.pow(d,o),f=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var A=h,g=0;0!==A.cmp(s);g++)A=A.redSqr();r(g=0;r--){for(var u=t.words[r],d=c-1;d>=0;d--){var l=u>>d&1;o!==n[0]&&(o=this.sqr(o)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===r&&0===d)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}c=26}return o},C.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},C.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new k(e)},o(k,C),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(50)(e))},function(e,t,n){"use strict";e.exports=l;var r,o=n(35),i=o.LongBits,a=o.base64,s=o.utf8;function c(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function u(){}function d(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var f=function(){return o.Buffer?function(){return(l.create=function(){return new r})()}:function(){return new l}};function h(e,t,n){t[n]=255&e}function p(e,t){this.len=e,this.next=void 0,this.val=t}function A(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function g(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}l.create=f(),l.alloc=function(e){return new o.Array(e)},o.Array!==Array&&(l.alloc=o.pool(l.alloc,o.Array.prototype.subarray)),l.prototype._push=function(e,t,n){return this.tail=this.tail.next=new c(e,t,n),this.len+=t,this},p.prototype=Object.create(c.prototype),p.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(A,10,i.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=i.from(e);return this._push(A,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(A,t.length(),t)},l.prototype.bool=function(e){return this._push(h,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=i.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(o.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(o.float.writeDoubleLE,8,e)};var m=o.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r>>0;if(!t)return this._push(h,1,0);if(o.isString(e)){var n=l.alloc(t=a.length(e));a.decode(e,n,0),e=n}return this.uint32(t)._push(m,t,e)},l.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(h,1,0)},l.prototype.fork=function(){return this.states=new d(this),this.head=this.tail=new c(u,0,0),this.len=0,this},l.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},l._configure=function(e){r=e,l.create=f(),r._configure()}},function(e,t,n){"use strict";e.exports=c;var r,o=n(35),i=o.LongBits,a=o.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var u,d="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},l=function(){return o.Buffer?function(e){return(c.create=function(e){return o.Buffer.isBuffer(e)?new r(e):d(e)})(e)}:d};function f(){var e=new i(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw s(this,8);return new i(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}c.create=l(),c.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,c.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return u}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return h(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|h(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw s(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},c.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){r=e,c.create=l(),r._configure();var t=o.Long?"toLong":"toNumber";o.merge(c.prototype,{int64:function(){return f.call(this)[t](!1)},uint64:function(){return f.call(this)[t](!0)},sint64:function(){return f.call(this).zzDecode()[t](!1)},fixed64:function(){return p.call(this)[t](!0)},sfixed64:function(){return p.call(this)[t](!1)}})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.add=t.toBig=t.split=t.fromBig=void 0;const r=BigInt(2**32-1),o=BigInt(32);function i(e,t=!1){return t?{h:Number(e&r),l:Number(e>>o&r)}:{h:0|Number(e>>o&r),l:0|Number(e&r)}}function a(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let o=0;oBigInt(e>>>0)<>>0);function s(e,t,n,r){const o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:0|o}}t.add=s;const c={fromBig:i,split:a,toBig:t.toBig,shrSH:(e,t,n)=>e>>>n,shrSL:(e,t,n)=>e<<32-n|t>>>n,rotrSH:(e,t,n)=>e>>>n|t<<32-n,rotrSL:(e,t,n)=>e<<32-n|t>>>n,rotrBH:(e,t,n)=>e<<64-n|t>>>n-32,rotrBL:(e,t,n)=>e>>>n-32|t<<64-n,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,n)=>e<>>32-n,rotlSL:(e,t,n)=>t<>>32-n,rotlBH:(e,t,n)=>t<>>64-n,rotlBL:(e,t,n)=>e<>>64-n,add:s,add3L:(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),add3H:(e,t,n,r)=>t+n+r+(e/2**32|0)|0,add4L:(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),add4H:(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0,add5H:(e,t,n,r,o,i)=>t+n+r+o+i+(e/2**32|0)|0,add5L:(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0)};t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=void 0;const r=n(99),o=n(36),i=(e,t,n)=>e&t^e&n^t&n,a=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),s=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint32Array(64);class u extends r.SHA2{constructor(){super(64,32,8,!1),this.A=0|s[0],this.B=0|s[1],this.C=0|s[2],this.D=0|s[3],this.E=0|s[4],this.F=0|s[5],this.G=0|s[6],this.H=0|s[7]}get(){const{A:e,B:t,C:n,D:r,E:o,F:i,G:a,H:s}=this;return[e,t,n,r,o,i,a,s]}set(e,t,n,r,o,i,a,s){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|o,this.F=0|i,this.G=0|a,this.H=0|s}process(e,t){for(let n=0;n<16;n++,t+=4)c[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=c[e-15],n=c[e-2],r=(0,o.rotr)(t,7)^(0,o.rotr)(t,18)^t>>>3,i=(0,o.rotr)(n,17)^(0,o.rotr)(n,19)^n>>>10;c[e]=i+c[e-7]+r+c[e-16]|0}let{A:n,B:r,C:s,D:u,E:d,F:l,G:f,H:h}=this;for(let e=0;e<64;e++){const t=h+((0,o.rotr)(d,6)^(0,o.rotr)(d,11)^(0,o.rotr)(d,25))+((p=d)&l^~p&f)+a[e]+c[e]|0,A=((0,o.rotr)(n,2)^(0,o.rotr)(n,13)^(0,o.rotr)(n,22))+i(n,r,s)|0;h=f,f=l,l=d,d=u+t|0,u=s,s=r,r=n,n=t+A|0}var p;n=n+this.A|0,r=r+this.B|0,s=s+this.C|0,u=u+this.D|0,d=d+this.E|0,l=l+this.F|0,f=f+this.G|0,h=h+this.H|0,this.set(n,r,s,u,d,l,f,h)}roundClean(){c.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}t.sha256=(0,o.wrapConstructor)(()=>new u)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hmac=void 0;t.Hmac=class{constructor(e,t){const n=(new e).blockSize;this.hash=t=>(new e).update(t).digest();let r=t;if(r.length>n&&(r=this.hash(r)),r.length92^e),this.iKeyPad=r.map(e=>54^e),this.messageHasher=new e,this.blockSize=n,this.update(this.iKeyPad)}update(e){return this.messageHasher.update(e),this}digest(){const e=this.messageHasher.digest();return this.hash(new Uint8Array([...this.oKeyPad,...e]))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=t.RIPEMD160=void 0;const r=n(99),o=n(36),i=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),a=Uint8Array.from({length:16},(e,t)=>t),s=a.map(e=>(9*e+5)%16);let c=[a],u=[s];for(let e=0;e<4;e++)for(let t of[c,u])t.push(t[e].map(e=>i[e]));const d=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>new Uint8Array(e)),l=c.map((e,t)=>e.map(e=>d[t][e])),f=u.map((e,t)=>e.map(e=>d[t][e])),h=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),p=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),A=(e,t)=>e<>>32-t;function g(e,t,n,r){return 0===e?t^n^r:1===e?t&n|~t&r:2===e?(t|~n)^r:3===e?t&r|n&~r:t^(n|~r)}const m=new Uint32Array(16);class v extends r.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:n,h3:r,h4:o}=this;return[e,t,n,r,o]}set(e,t,n,r,o){this.h0=0|e,this.h1=0|t,this.h2=0|n,this.h3=0|r,this.h4=0|o}process(e,t){for(let n=0;n<16;n++,t+=4)m[n]=e.getUint32(t,!0);let n=0|this.h0,r=n,o=0|this.h1,i=o,a=0|this.h2,s=a,d=0|this.h3,v=d,y=0|this.h4,b=y;for(let e=0;e<5;e++){const t=4-e,I=h[e],w=p[e],E=c[e],_=u[e],B=l[e],C=f[e];for(let t=0;t<16;t++){const r=A(n+g(e,o,a,d)+m[E[t]]+I,B[t])+y|0;n=y,y=d,d=0|A(a,10),a=o,o=r}for(let e=0;e<16;e++){const n=A(r+g(t,i,s,v)+m[_[e]]+w,C[e])+b|0;r=b,b=v,v=0|A(s,10),s=i,i=n}}this.set(this.h1+a+v|0,this.h2+d+b|0,this.h3+y+r|0,this.h4+n+i|0,this.h0+o+s|0)}roundClean(){m.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}t.RIPEMD160=v,t.ripemd160=(0,o.wrapConstructor)(()=>new v)},function(e,t,n){(function(e){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:n(460).Buffer}catch(e){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function c(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function u(e,t,n,o){for(var i=0,a=0,s=Math.min(e.length,n),c=t;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===n)for(o=0,i=0;o>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)o=c(e,t,r)<=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,o=1;o<=67108863;o*=t)r++;r--,o=o/t|0;for(var i=e.length-n,a=i%r,s=Math.min(i,i-a)+n,c=0,d=n;d1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?""}var f=["","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"],h=[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],p=[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];i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,i=0,a=0;a>>24-o&16777215,(o+=2)>=26&&(o-=26,a--),n=0!==i||a!==this.length-1?f[6-c.length]+c+n:c+n}for(0!==i&&(n=i.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=h[e],d=p[e];n="";var l=this.clone();for(l.negative=0;!l.isZero();){var A=l.modrn(d).toString(e);n=(l=l.idivn(d)).isZero()?A+n:f[u-A.length]+A+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},a&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function A(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,c=a/67108864|0;n.words[0]=s;for(var u=1;u>>26,l=67108863&c,f=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=f;h++){var p=u-h|0;d+=(a=(o=0|e.words[p])*(i=0|t.words[h])+l)/67108864|0,l=67108863&a}n.words[u]=0|l,c=0|d}return 0!==c?n.words[u]=0|c:n.length--,n._strip()}i.prototype.toArrayLike=function(e,t,n){this._strip();var o=this.byteLength(),i=n||Math.max(1,o);r(o<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,o),a},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,o=0,i=0;o>8&255),n>16&255),6===i?(n>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===i?(n>=0&&(e[n--]=a>>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var o=0;o0&&(this.words[o]=~this.words[o]&67108863>>26-n),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var o=0,i=0;i>>26;for(;0!==o&&i>>26;if(this.length=n.length,0!==o)this.words[this.length]=o,this.length++;else if(n!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,h=0|a[1],p=8191&h,A=h>>>13,g=0|a[2],m=8191&g,v=g>>>13,y=0|a[3],b=8191&y,I=y>>>13,w=0|a[4],E=8191&w,_=w>>>13,B=0|a[5],C=8191&B,k=B>>>13,S=0|a[6],O=8191&S,Q=S>>>13,P=0|a[7],R=8191&P,M=P>>>13,x=0|a[8],D=8191&x,N=x>>>13,T=0|a[9],j=8191&T,U=T>>>13,H=0|s[0],J=8191&H,F=H>>>13,L=0|s[1],q=8191&L,G=L>>>13,V=0|s[2],z=8191&V,Y=V>>>13,K=0|s[3],W=8191&K,Z=K>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],ne=8191&te,re=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,de=0|s[8],le=8191&de,fe=de>>>13,he=0|s[9],pe=8191&he,Ae=he>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(u+(r=Math.imul(l,J))|0)+((8191&(o=(o=Math.imul(l,F))+Math.imul(f,J)|0))<<13)|0;u=((i=Math.imul(f,F))+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(p,J),o=(o=Math.imul(p,F))+Math.imul(A,J)|0,i=Math.imul(A,F);var me=(u+(r=r+Math.imul(l,q)|0)|0)+((8191&(o=(o=o+Math.imul(l,G)|0)+Math.imul(f,q)|0))<<13)|0;u=((i=i+Math.imul(f,G)|0)+(o>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,J),o=(o=Math.imul(m,F))+Math.imul(v,J)|0,i=Math.imul(v,F),r=r+Math.imul(p,q)|0,o=(o=o+Math.imul(p,G)|0)+Math.imul(A,q)|0,i=i+Math.imul(A,G)|0;var ve=(u+(r=r+Math.imul(l,z)|0)|0)+((8191&(o=(o=o+Math.imul(l,Y)|0)+Math.imul(f,z)|0))<<13)|0;u=((i=i+Math.imul(f,Y)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(b,J),o=(o=Math.imul(b,F))+Math.imul(I,J)|0,i=Math.imul(I,F),r=r+Math.imul(m,q)|0,o=(o=o+Math.imul(m,G)|0)+Math.imul(v,q)|0,i=i+Math.imul(v,G)|0,r=r+Math.imul(p,z)|0,o=(o=o+Math.imul(p,Y)|0)+Math.imul(A,z)|0,i=i+Math.imul(A,Y)|0;var ye=(u+(r=r+Math.imul(l,W)|0)|0)+((8191&(o=(o=o+Math.imul(l,Z)|0)+Math.imul(f,W)|0))<<13)|0;u=((i=i+Math.imul(f,Z)|0)+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(E,J),o=(o=Math.imul(E,F))+Math.imul(_,J)|0,i=Math.imul(_,F),r=r+Math.imul(b,q)|0,o=(o=o+Math.imul(b,G)|0)+Math.imul(I,q)|0,i=i+Math.imul(I,G)|0,r=r+Math.imul(m,z)|0,o=(o=o+Math.imul(m,Y)|0)+Math.imul(v,z)|0,i=i+Math.imul(v,Y)|0,r=r+Math.imul(p,W)|0,o=(o=o+Math.imul(p,Z)|0)+Math.imul(A,W)|0,i=i+Math.imul(A,Z)|0;var be=(u+(r=r+Math.imul(l,$)|0)|0)+((8191&(o=(o=o+Math.imul(l,ee)|0)+Math.imul(f,$)|0))<<13)|0;u=((i=i+Math.imul(f,ee)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(C,J),o=(o=Math.imul(C,F))+Math.imul(k,J)|0,i=Math.imul(k,F),r=r+Math.imul(E,q)|0,o=(o=o+Math.imul(E,G)|0)+Math.imul(_,q)|0,i=i+Math.imul(_,G)|0,r=r+Math.imul(b,z)|0,o=(o=o+Math.imul(b,Y)|0)+Math.imul(I,z)|0,i=i+Math.imul(I,Y)|0,r=r+Math.imul(m,W)|0,o=(o=o+Math.imul(m,Z)|0)+Math.imul(v,W)|0,i=i+Math.imul(v,Z)|0,r=r+Math.imul(p,$)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(A,$)|0,i=i+Math.imul(A,ee)|0;var Ie=(u+(r=r+Math.imul(l,ne)|0)|0)+((8191&(o=(o=o+Math.imul(l,re)|0)+Math.imul(f,ne)|0))<<13)|0;u=((i=i+Math.imul(f,re)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(O,J),o=(o=Math.imul(O,F))+Math.imul(Q,J)|0,i=Math.imul(Q,F),r=r+Math.imul(C,q)|0,o=(o=o+Math.imul(C,G)|0)+Math.imul(k,q)|0,i=i+Math.imul(k,G)|0,r=r+Math.imul(E,z)|0,o=(o=o+Math.imul(E,Y)|0)+Math.imul(_,z)|0,i=i+Math.imul(_,Y)|0,r=r+Math.imul(b,W)|0,o=(o=o+Math.imul(b,Z)|0)+Math.imul(I,W)|0,i=i+Math.imul(I,Z)|0,r=r+Math.imul(m,$)|0,o=(o=o+Math.imul(m,ee)|0)+Math.imul(v,$)|0,i=i+Math.imul(v,ee)|0,r=r+Math.imul(p,ne)|0,o=(o=o+Math.imul(p,re)|0)+Math.imul(A,ne)|0,i=i+Math.imul(A,re)|0;var we=(u+(r=r+Math.imul(l,ie)|0)|0)+((8191&(o=(o=o+Math.imul(l,ae)|0)+Math.imul(f,ie)|0))<<13)|0;u=((i=i+Math.imul(f,ae)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(R,J),o=(o=Math.imul(R,F))+Math.imul(M,J)|0,i=Math.imul(M,F),r=r+Math.imul(O,q)|0,o=(o=o+Math.imul(O,G)|0)+Math.imul(Q,q)|0,i=i+Math.imul(Q,G)|0,r=r+Math.imul(C,z)|0,o=(o=o+Math.imul(C,Y)|0)+Math.imul(k,z)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(E,W)|0,o=(o=o+Math.imul(E,Z)|0)+Math.imul(_,W)|0,i=i+Math.imul(_,Z)|0,r=r+Math.imul(b,$)|0,o=(o=o+Math.imul(b,ee)|0)+Math.imul(I,$)|0,i=i+Math.imul(I,ee)|0,r=r+Math.imul(m,ne)|0,o=(o=o+Math.imul(m,re)|0)+Math.imul(v,ne)|0,i=i+Math.imul(v,re)|0,r=r+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,ae)|0;var Ee=(u+(r=r+Math.imul(l,ce)|0)|0)+((8191&(o=(o=o+Math.imul(l,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((i=i+Math.imul(f,ue)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(D,J),o=(o=Math.imul(D,F))+Math.imul(N,J)|0,i=Math.imul(N,F),r=r+Math.imul(R,q)|0,o=(o=o+Math.imul(R,G)|0)+Math.imul(M,q)|0,i=i+Math.imul(M,G)|0,r=r+Math.imul(O,z)|0,o=(o=o+Math.imul(O,Y)|0)+Math.imul(Q,z)|0,i=i+Math.imul(Q,Y)|0,r=r+Math.imul(C,W)|0,o=(o=o+Math.imul(C,Z)|0)+Math.imul(k,W)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(E,$)|0,o=(o=o+Math.imul(E,ee)|0)+Math.imul(_,$)|0,i=i+Math.imul(_,ee)|0,r=r+Math.imul(b,ne)|0,o=(o=o+Math.imul(b,re)|0)+Math.imul(I,ne)|0,i=i+Math.imul(I,re)|0,r=r+Math.imul(m,ie)|0,o=(o=o+Math.imul(m,ae)|0)+Math.imul(v,ie)|0,i=i+Math.imul(v,ae)|0,r=r+Math.imul(p,ce)|0,o=(o=o+Math.imul(p,ue)|0)+Math.imul(A,ce)|0,i=i+Math.imul(A,ue)|0;var _e=(u+(r=r+Math.imul(l,le)|0)|0)+((8191&(o=(o=o+Math.imul(l,fe)|0)+Math.imul(f,le)|0))<<13)|0;u=((i=i+Math.imul(f,fe)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(j,J),o=(o=Math.imul(j,F))+Math.imul(U,J)|0,i=Math.imul(U,F),r=r+Math.imul(D,q)|0,o=(o=o+Math.imul(D,G)|0)+Math.imul(N,q)|0,i=i+Math.imul(N,G)|0,r=r+Math.imul(R,z)|0,o=(o=o+Math.imul(R,Y)|0)+Math.imul(M,z)|0,i=i+Math.imul(M,Y)|0,r=r+Math.imul(O,W)|0,o=(o=o+Math.imul(O,Z)|0)+Math.imul(Q,W)|0,i=i+Math.imul(Q,Z)|0,r=r+Math.imul(C,$)|0,o=(o=o+Math.imul(C,ee)|0)+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(E,ne)|0,o=(o=o+Math.imul(E,re)|0)+Math.imul(_,ne)|0,i=i+Math.imul(_,re)|0,r=r+Math.imul(b,ie)|0,o=(o=o+Math.imul(b,ae)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,ae)|0,r=r+Math.imul(m,ce)|0,o=(o=o+Math.imul(m,ue)|0)+Math.imul(v,ce)|0,i=i+Math.imul(v,ue)|0,r=r+Math.imul(p,le)|0,o=(o=o+Math.imul(p,fe)|0)+Math.imul(A,le)|0,i=i+Math.imul(A,fe)|0;var Be=(u+(r=r+Math.imul(l,pe)|0)|0)+((8191&(o=(o=o+Math.imul(l,Ae)|0)+Math.imul(f,pe)|0))<<13)|0;u=((i=i+Math.imul(f,Ae)|0)+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,q),o=(o=Math.imul(j,G))+Math.imul(U,q)|0,i=Math.imul(U,G),r=r+Math.imul(D,z)|0,o=(o=o+Math.imul(D,Y)|0)+Math.imul(N,z)|0,i=i+Math.imul(N,Y)|0,r=r+Math.imul(R,W)|0,o=(o=o+Math.imul(R,Z)|0)+Math.imul(M,W)|0,i=i+Math.imul(M,Z)|0,r=r+Math.imul(O,$)|0,o=(o=o+Math.imul(O,ee)|0)+Math.imul(Q,$)|0,i=i+Math.imul(Q,ee)|0,r=r+Math.imul(C,ne)|0,o=(o=o+Math.imul(C,re)|0)+Math.imul(k,ne)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(E,ie)|0,o=(o=o+Math.imul(E,ae)|0)+Math.imul(_,ie)|0,i=i+Math.imul(_,ae)|0,r=r+Math.imul(b,ce)|0,o=(o=o+Math.imul(b,ue)|0)+Math.imul(I,ce)|0,i=i+Math.imul(I,ue)|0,r=r+Math.imul(m,le)|0,o=(o=o+Math.imul(m,fe)|0)+Math.imul(v,le)|0,i=i+Math.imul(v,fe)|0;var Ce=(u+(r=r+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,Ae)|0)+Math.imul(A,pe)|0))<<13)|0;u=((i=i+Math.imul(A,Ae)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,z),o=(o=Math.imul(j,Y))+Math.imul(U,z)|0,i=Math.imul(U,Y),r=r+Math.imul(D,W)|0,o=(o=o+Math.imul(D,Z)|0)+Math.imul(N,W)|0,i=i+Math.imul(N,Z)|0,r=r+Math.imul(R,$)|0,o=(o=o+Math.imul(R,ee)|0)+Math.imul(M,$)|0,i=i+Math.imul(M,ee)|0,r=r+Math.imul(O,ne)|0,o=(o=o+Math.imul(O,re)|0)+Math.imul(Q,ne)|0,i=i+Math.imul(Q,re)|0,r=r+Math.imul(C,ie)|0,o=(o=o+Math.imul(C,ae)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,ae)|0,r=r+Math.imul(E,ce)|0,o=(o=o+Math.imul(E,ue)|0)+Math.imul(_,ce)|0,i=i+Math.imul(_,ue)|0,r=r+Math.imul(b,le)|0,o=(o=o+Math.imul(b,fe)|0)+Math.imul(I,le)|0,i=i+Math.imul(I,fe)|0;var ke=(u+(r=r+Math.imul(m,pe)|0)|0)+((8191&(o=(o=o+Math.imul(m,Ae)|0)+Math.imul(v,pe)|0))<<13)|0;u=((i=i+Math.imul(v,Ae)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,W),o=(o=Math.imul(j,Z))+Math.imul(U,W)|0,i=Math.imul(U,Z),r=r+Math.imul(D,$)|0,o=(o=o+Math.imul(D,ee)|0)+Math.imul(N,$)|0,i=i+Math.imul(N,ee)|0,r=r+Math.imul(R,ne)|0,o=(o=o+Math.imul(R,re)|0)+Math.imul(M,ne)|0,i=i+Math.imul(M,re)|0,r=r+Math.imul(O,ie)|0,o=(o=o+Math.imul(O,ae)|0)+Math.imul(Q,ie)|0,i=i+Math.imul(Q,ae)|0,r=r+Math.imul(C,ce)|0,o=(o=o+Math.imul(C,ue)|0)+Math.imul(k,ce)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(E,le)|0,o=(o=o+Math.imul(E,fe)|0)+Math.imul(_,le)|0,i=i+Math.imul(_,fe)|0;var Se=(u+(r=r+Math.imul(b,pe)|0)|0)+((8191&(o=(o=o+Math.imul(b,Ae)|0)+Math.imul(I,pe)|0))<<13)|0;u=((i=i+Math.imul(I,Ae)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,$),o=(o=Math.imul(j,ee))+Math.imul(U,$)|0,i=Math.imul(U,ee),r=r+Math.imul(D,ne)|0,o=(o=o+Math.imul(D,re)|0)+Math.imul(N,ne)|0,i=i+Math.imul(N,re)|0,r=r+Math.imul(R,ie)|0,o=(o=o+Math.imul(R,ae)|0)+Math.imul(M,ie)|0,i=i+Math.imul(M,ae)|0,r=r+Math.imul(O,ce)|0,o=(o=o+Math.imul(O,ue)|0)+Math.imul(Q,ce)|0,i=i+Math.imul(Q,ue)|0,r=r+Math.imul(C,le)|0,o=(o=o+Math.imul(C,fe)|0)+Math.imul(k,le)|0,i=i+Math.imul(k,fe)|0;var Oe=(u+(r=r+Math.imul(E,pe)|0)|0)+((8191&(o=(o=o+Math.imul(E,Ae)|0)+Math.imul(_,pe)|0))<<13)|0;u=((i=i+Math.imul(_,Ae)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(j,ne),o=(o=Math.imul(j,re))+Math.imul(U,ne)|0,i=Math.imul(U,re),r=r+Math.imul(D,ie)|0,o=(o=o+Math.imul(D,ae)|0)+Math.imul(N,ie)|0,i=i+Math.imul(N,ae)|0,r=r+Math.imul(R,ce)|0,o=(o=o+Math.imul(R,ue)|0)+Math.imul(M,ce)|0,i=i+Math.imul(M,ue)|0,r=r+Math.imul(O,le)|0,o=(o=o+Math.imul(O,fe)|0)+Math.imul(Q,le)|0,i=i+Math.imul(Q,fe)|0;var Qe=(u+(r=r+Math.imul(C,pe)|0)|0)+((8191&(o=(o=o+Math.imul(C,Ae)|0)+Math.imul(k,pe)|0))<<13)|0;u=((i=i+Math.imul(k,Ae)|0)+(o>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,r=Math.imul(j,ie),o=(o=Math.imul(j,ae))+Math.imul(U,ie)|0,i=Math.imul(U,ae),r=r+Math.imul(D,ce)|0,o=(o=o+Math.imul(D,ue)|0)+Math.imul(N,ce)|0,i=i+Math.imul(N,ue)|0,r=r+Math.imul(R,le)|0,o=(o=o+Math.imul(R,fe)|0)+Math.imul(M,le)|0,i=i+Math.imul(M,fe)|0;var Pe=(u+(r=r+Math.imul(O,pe)|0)|0)+((8191&(o=(o=o+Math.imul(O,Ae)|0)+Math.imul(Q,pe)|0))<<13)|0;u=((i=i+Math.imul(Q,Ae)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(j,ce),o=(o=Math.imul(j,ue))+Math.imul(U,ce)|0,i=Math.imul(U,ue),r=r+Math.imul(D,le)|0,o=(o=o+Math.imul(D,fe)|0)+Math.imul(N,le)|0,i=i+Math.imul(N,fe)|0;var Re=(u+(r=r+Math.imul(R,pe)|0)|0)+((8191&(o=(o=o+Math.imul(R,Ae)|0)+Math.imul(M,pe)|0))<<13)|0;u=((i=i+Math.imul(M,Ae)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,le),o=(o=Math.imul(j,fe))+Math.imul(U,le)|0,i=Math.imul(U,fe);var Me=(u+(r=r+Math.imul(D,pe)|0)|0)+((8191&(o=(o=o+Math.imul(D,Ae)|0)+Math.imul(N,pe)|0))<<13)|0;u=((i=i+Math.imul(N,Ae)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863;var xe=(u+(r=Math.imul(j,pe))|0)+((8191&(o=(o=Math.imul(j,Ae))+Math.imul(U,pe)|0))<<13)|0;return u=((i=Math.imul(U,Ae))+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,c[0]=ge,c[1]=me,c[2]=ve,c[3]=ye,c[4]=be,c[5]=Ie,c[6]=we,c[7]=Ee,c[8]=_e,c[9]=Be,c[10]=Ce,c[11]=ke,c[12]=Se,c[13]=Oe,c[14]=Qe,c[15]=Pe,c[16]=Re,c[17]=Me,c[18]=xe,0!==u&&(c[19]=u,n.length++),n};function m(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,o=0,i=0;i>>26)|0)>>>26,a&=67108863}n.words[i]=s,r=a,a=o}return 0!==r?n.words[i]=r:n.length--,n._strip()}function v(e,t,n){return m(e,t,n)}function y(e,t){this.x=e,this.y=t}Math.imul||(g=A),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):n<63?A(this,e,t):n<1024?m(this,e,t):v(this,e,t)},y.prototype.makeRBT=function(e){for(var t=new Array(e),n=i.prototype._countBits(e)-1,r=0;r>=1;return r},y.prototype.permute=function(e,t,n,r,o,i){for(var a=0;a>>=1)o++;return 1<>>=13,n[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,n+=i/67108864|0,n+=a>>>26,this.words[o]=67108863&a}return 0!==n&&(this.words[o]=n,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>o&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,n=e%26,o=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<a)for(this.length-=a,u=0;u=0&&(0!==d||u>=o);u--){var l=0|this.words[u];this.words[u]=d<<26-i|l>>>i,d=l&s}return c&&0!==d&&(c.words[c.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,o=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var o=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[o+n]=67108863&i}for(;o>26,this.words[o+n]=67108863&i;if(0===s)return this._strip();for(r(-1===s),s=0,o=0;o>26,this.words[o]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!==(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,c=r.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;l--){var f=67108864*(0|r.words[o.length+l])+(0|r.words[o.length+l-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(o,f,l);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(o,1,l),r.isZero()||(r.negative^=1);s&&(s.words[l]=f)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),o=e.andln(1),i=n.cmp(r);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,o=0,i=this.length-1;i>=0;i--)o=(n*o+(0|this.words[i]))%e;return t?-o:o},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,o=this.length-1;o>=0;o--){var i=(0|this.words[o])+67108864*n;this.words[o]=i/e|0,n=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var d=n.clone(),l=t.clone();!t.isZero();){for(var f=0,h=1;0==(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(d),a.isub(l)),o.iushrn(1),a.iushrn(1);for(var p=0,A=1;0==(n.words[0]&A)&&p<26;++p,A<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(d),c.isub(l)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,d=1;0==(t.words[0]&d)&&u<26;++u,d<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var l=0,f=1;0==(n.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(n.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var o=t.cmp(n);if(o<0){var i=t;t=n,n=i}else if(0===o||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,o=1<>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:oe.length)return 1;if(this.length=0;n--){var r=0|this.words[n],o=0|e.words[n];if(r!==o){ro&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new C(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function I(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){I.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){I.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){I.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function B(){I.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function C(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){C.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}I.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},I.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},I.prototype.split=function(e,t){e.iushrn(this.n,0,t)},I.prototype.imulK=function(e){return e.imul(this.k)},o(w,I),w.prototype.split=function(e,t){for(var n=Math.min(e.length,9),r=0;r>>22,o=i}o>>>=22,e.words[r-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=o,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new E;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new B}return b[e]=t,t},C.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},C.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},C.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(d(e,e.umod(this.m)._forceRed(this)),e)},C.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},C.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},C.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},C.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},C.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},C.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},C.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},C.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},C.prototype.isqr=function(e){return this.imul(e,e.clone())},C.prototype.sqr=function(e){return this.mul(e,e)},C.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new i(2*d*d).toRed(this);0!==this.pow(d,u).cmp(c);)d.redIAdd(c);for(var l=this.pow(d,o),f=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var A=h,g=0;0!==A.cmp(s);g++)A=A.redSqr();r(g=0;r--){for(var u=t.words[r],d=c-1;d>=0;d--){var l=u>>d&1;o!==n[0]&&(o=this.sqr(o)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===r&&0===d)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}c=26}return o},C.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},C.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new k(e)},o(k,C),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(50)(e))},function(e,t,n){"use strict";function r(e){let t=0;for(const n of e){if(0!==n)break;t++}return e.slice(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedSecp256k1Signature=t.Secp256k1Signature=void 0;class o{constructor(e,t){if(e.length>32||0===e.length||0===e[0])throw new Error("Unsigned integer r must be encoded as unpadded big endian.");if(t.length>32||0===t.length||0===t[0])throw new Error("Unsigned integer s must be encoded as unpadded big endian.");this.data={r:e,s:t}}static fromFixedLength(e){if(64!==e.length)throw new Error(`Got invalid data length: ${e.length}. Expected 2x 32 bytes for the pair (r, s)`);return new o(r(e.slice(0,32)),r(e.slice(32,64)))}static fromDer(e){let t=0;if(48!==e[t++])throw new Error("Prefix 0x30 expected");const n=e[t++];if(e.length-t!==n)throw new Error("Data length mismatch detected");if(2!==e[t++])throw new Error("INTEGER tag expected");const i=e[t++];if(i>=128)throw new Error("Decoding length values above 127 not supported");const a=e.slice(t,t+i);t+=i;if(2!==e[t++])throw new Error("INTEGER tag expected");const s=e[t++];if(s>=128)throw new Error("Decoding length values above 127 not supported");const c=e.slice(t,t+s);return t+=s,new o(r(a),r(c))}r(e){if(void 0===e)return this.data.r;{const t=e-this.data.r.length;if(t<0)throw new Error("Length too small to hold parameter r");const n=new Uint8Array(t);return new Uint8Array([...n,...this.data.r])}}s(e){if(void 0===e)return this.data.s;{const t=e-this.data.s.length;if(t<0)throw new Error("Length too small to hold parameter s");const n=new Uint8Array(t);return new Uint8Array([...n,...this.data.s])}}toFixedLength(){return new Uint8Array([...this.r(32),...this.s(32)])}toDer(){const e=this.data.r[0]>=128?new Uint8Array([0,...this.data.r]):this.data.r,t=this.data.s[0]>=128?new Uint8Array([0,...this.data.s]):this.data.s,n=e.length,r=t.length,o=new Uint8Array([2,n,...e,2,r,...t]);return new Uint8Array([48,o.length,...o])}}t.Secp256k1Signature=o;class i extends o{constructor(e,t,n){if(super(e,t),!Number.isInteger(n))throw new Error("The recovery parameter must be an integer.");if(n<0||n>4)throw new Error("The recovery parameter must be one of 0, 1, 2, 3.");this.recovery=n}static fromFixedLength(e){if(65!==e.length)throw new Error(`Got invalid data length ${e.length}. Expected 32 + 32 + 1`);return new i(r(e.slice(0,32)),r(e.slice(32,64)),e[64])}toFixedLength(){return new Uint8Array([...this.r(32),...this.s(32),this.recovery])}}t.ExtendedSecp256k1Signature=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeCosmoshubPath=void 0;const r=n(20);t.makeCosmoshubPath=function(e){return[r.Slip10RawIndex.hardened(44),r.Slip10RawIndex.hardened(118),r.Slip10RawIndex.hardened(0),r.Slip10RawIndex.normal(0),r.Slip10RawIndex.normal(e)]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decrypt=t.encrypt=t.supportedAlgorithms=t.executeKdf=t.cosmjsSalt=void 0;const r=n(20),o=n(5);t.cosmjsSalt=(0,o.toAscii)("The CosmJS salt."),t.executeKdf=async function(e,n){switch(n.algorithm){case"argon2id":{const o=n.params;if(!(0,r.isArgon2idOptions)(o))throw new Error("Invalid format of argon2id params");return r.Argon2id.execute(e,t.cosmjsSalt,o)}default:throw new Error("Unsupported KDF algorithm")}},t.supportedAlgorithms={xchacha20poly1305Ietf:"xchacha20poly1305-ietf"},t.encrypt=async function(e,n,o){switch(o.algorithm){case t.supportedAlgorithms.xchacha20poly1305Ietf:{const t=r.Random.getBytes(r.xchacha20NonceLength);return new Uint8Array([...t,...await r.Xchacha20poly1305Ietf.encrypt(e,n,t)])}default:throw new Error(`Unsupported encryption algorithm: '${o.algorithm}'`)}},t.decrypt=async function(e,n,o){switch(o.algorithm){case t.supportedAlgorithms.xchacha20poly1305Ietf:{const t=e.slice(0,r.xchacha20NonceLength);return r.Xchacha20poly1305Ietf.decrypt(e.slice(r.xchacha20NonceLength),n,t)}default:throw new Error(`Unsupported encryption algorithm: '${o.algorithm}'`)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decrypt=t.encrypt=t.supportedAlgorithms=t.executeKdf=t.cosmjsSalt=void 0;const r=n(20),o=n(5);t.cosmjsSalt=(0,o.toAscii)("The CosmJS salt."),t.executeKdf=async function(e,n){switch(n.algorithm){case"argon2id":{const o=n.params;if(!(0,r.isArgon2idOptions)(o))throw new Error("Invalid format of argon2id params");return r.Argon2id.execute(e,t.cosmjsSalt,o)}default:throw new Error("Unsupported KDF algorithm")}},t.supportedAlgorithms={xchacha20poly1305Ietf:"xchacha20poly1305-ietf"},t.encrypt=async function(e,n,o){switch(o.algorithm){case t.supportedAlgorithms.xchacha20poly1305Ietf:{const t=r.Random.getBytes(r.xchacha20NonceLength);return new Uint8Array([...t,...await r.Xchacha20poly1305Ietf.encrypt(e,n,t)])}default:throw new Error(`Unsupported encryption algorithm: '${o.algorithm}'`)}},t.decrypt=async function(e,n,o){switch(o.algorithm){case t.supportedAlgorithms.xchacha20poly1305Ietf:{const t=e.slice(0,r.xchacha20NonceLength);return r.Xchacha20poly1305Ietf.decrypt(e.slice(r.xchacha20NonceLength),n,t)}default:throw new Error(`Unsupported encryption algorithm: '${o.algorithm}'`)}}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MsgClientImpl=t.MsgMultiSendResponse=t.MsgMultiSend=t.MsgSendResponse=t.MsgSend=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(10),s=n(206);t.protobufPackage="cosmos.bank.v1beta1";const c={fromAddress:"",toAddress:""};t.MsgSend={encode(e,t=i.default.Writer.create()){""!==e.fromAddress&&t.uint32(10).string(e.fromAddress),""!==e.toAddress&&t.uint32(18).string(e.toAddress);for(const n of e.amount)a.Coin.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},c);for(o.amount=[];n.pos>>3){case 1:o.fromAddress=n.string();break;case 2:o.toAddress=n.string();break;case 3:o.amount.push(a.Coin.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},c);return n.fromAddress=void 0!==e.fromAddress&&null!==e.fromAddress?String(e.fromAddress):"",n.toAddress=void 0!==e.toAddress&&null!==e.toAddress?String(e.toAddress):"",n.amount=(null!==(t=e.amount)&&void 0!==t?t:[]).map(e=>a.Coin.fromJSON(e)),n},toJSON(e){const t={};return void 0!==e.fromAddress&&(t.fromAddress=e.fromAddress),void 0!==e.toAddress&&(t.toAddress=e.toAddress),e.amount?t.amount=e.amount.map(e=>e?a.Coin.toJSON(e):void 0):t.amount=[],t},fromPartial(e){var t,n,r;const o=Object.assign({},c);return o.fromAddress=null!==(t=e.fromAddress)&&void 0!==t?t:"",o.toAddress=null!==(n=e.toAddress)&&void 0!==n?n:"",o.amount=(null===(r=e.amount)||void 0===r?void 0:r.map(e=>a.Coin.fromPartial(e)))||[],o}};const u={};t.MsgSendResponse={encode:(e,t=i.default.Writer.create())=>t,decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},u);for(;n.posObject.assign({},u),toJSON:e=>({}),fromPartial:e=>Object.assign({},u)};const d={};t.MsgMultiSend={encode(e,t=i.default.Writer.create()){for(const n of e.inputs)s.Input.encode(n,t.uint32(10).fork()).ldelim();for(const n of e.outputs)s.Output.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},d);for(o.inputs=[],o.outputs=[];n.pos>>3){case 1:o.inputs.push(s.Input.decode(n,n.uint32()));break;case 2:o.outputs.push(s.Output.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o},fromJSON(e){var t,n;const r=Object.assign({},d);return r.inputs=(null!==(t=e.inputs)&&void 0!==t?t:[]).map(e=>s.Input.fromJSON(e)),r.outputs=(null!==(n=e.outputs)&&void 0!==n?n:[]).map(e=>s.Output.fromJSON(e)),r},toJSON(e){const t={};return e.inputs?t.inputs=e.inputs.map(e=>e?s.Input.toJSON(e):void 0):t.inputs=[],e.outputs?t.outputs=e.outputs.map(e=>e?s.Output.toJSON(e):void 0):t.outputs=[],t},fromPartial(e){var t,n;const r=Object.assign({},d);return r.inputs=(null===(t=e.inputs)||void 0===t?void 0:t.map(e=>s.Input.fromPartial(e)))||[],r.outputs=(null===(n=e.outputs)||void 0===n?void 0:n.map(e=>s.Output.fromPartial(e)))||[],r}};const l={};t.MsgMultiSendResponse={encode:(e,t=i.default.Writer.create())=>t,decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},l);for(;n.posObject.assign({},l),toJSON:e=>({}),fromPartial:e=>Object.assign({},l)};t.MsgClientImpl=class{constructor(e){this.rpc=e,this.Send=this.Send.bind(this),this.MultiSend=this.MultiSend.bind(this)}Send(e){const n=t.MsgSend.encode(e).finish();return this.rpc.request("cosmos.bank.v1beta1.Msg","Send",n).then(e=>t.MsgSendResponse.decode(new i.default.Reader(e)))}MultiSend(e){const n=t.MsgMultiSend.encode(e).finish();return this.rpc.request("cosmos.bank.v1beta1.Msg","MultiSend",n).then(e=>t.MsgMultiSendResponse.decode(new i.default.Reader(e)))}},i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=t.DenomUnit=t.Supply=t.Output=t.Input=t.SendEnabled=t.Params=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(10);t.protobufPackage="cosmos.bank.v1beta1";const s={defaultSendEnabled:!1};t.Params={encode(e,n=i.default.Writer.create()){for(const r of e.sendEnabled)t.SendEnabled.encode(r,n.uint32(10).fork()).ldelim();return!0===e.defaultSendEnabled&&n.uint32(16).bool(e.defaultSendEnabled),n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},s);for(a.sendEnabled=[];r.pos>>3){case 1:a.sendEnabled.push(t.SendEnabled.decode(r,r.uint32()));break;case 2:a.defaultSendEnabled=r.bool();break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},s);return r.sendEnabled=(null!==(n=e.sendEnabled)&&void 0!==n?n:[]).map(e=>t.SendEnabled.fromJSON(e)),r.defaultSendEnabled=void 0!==e.defaultSendEnabled&&null!==e.defaultSendEnabled&&Boolean(e.defaultSendEnabled),r},toJSON(e){const n={};return e.sendEnabled?n.sendEnabled=e.sendEnabled.map(e=>e?t.SendEnabled.toJSON(e):void 0):n.sendEnabled=[],void 0!==e.defaultSendEnabled&&(n.defaultSendEnabled=e.defaultSendEnabled),n},fromPartial(e){var n,r;const o=Object.assign({},s);return o.sendEnabled=(null===(n=e.sendEnabled)||void 0===n?void 0:n.map(e=>t.SendEnabled.fromPartial(e)))||[],o.defaultSendEnabled=null!==(r=e.defaultSendEnabled)&&void 0!==r&&r,o}};const c={denom:"",enabled:!1};t.SendEnabled={encode:(e,t=i.default.Writer.create())=>(""!==e.denom&&t.uint32(10).string(e.denom),!0===e.enabled&&t.uint32(16).bool(e.enabled),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},c);for(;n.pos>>3){case 1:o.denom=n.string();break;case 2:o.enabled=n.bool();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},c);return t.denom=void 0!==e.denom&&null!==e.denom?String(e.denom):"",t.enabled=void 0!==e.enabled&&null!==e.enabled&&Boolean(e.enabled),t},toJSON(e){const t={};return void 0!==e.denom&&(t.denom=e.denom),void 0!==e.enabled&&(t.enabled=e.enabled),t},fromPartial(e){var t,n;const r=Object.assign({},c);return r.denom=null!==(t=e.denom)&&void 0!==t?t:"",r.enabled=null!==(n=e.enabled)&&void 0!==n&&n,r}};const u={address:""};t.Input={encode(e,t=i.default.Writer.create()){""!==e.address&&t.uint32(10).string(e.address);for(const n of e.coins)a.Coin.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},u);for(o.coins=[];n.pos>>3){case 1:o.address=n.string();break;case 2:o.coins.push(a.Coin.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},u);return n.address=void 0!==e.address&&null!==e.address?String(e.address):"",n.coins=(null!==(t=e.coins)&&void 0!==t?t:[]).map(e=>a.Coin.fromJSON(e)),n},toJSON(e){const t={};return void 0!==e.address&&(t.address=e.address),e.coins?t.coins=e.coins.map(e=>e?a.Coin.toJSON(e):void 0):t.coins=[],t},fromPartial(e){var t,n;const r=Object.assign({},u);return r.address=null!==(t=e.address)&&void 0!==t?t:"",r.coins=(null===(n=e.coins)||void 0===n?void 0:n.map(e=>a.Coin.fromPartial(e)))||[],r}};const d={address:""};t.Output={encode(e,t=i.default.Writer.create()){""!==e.address&&t.uint32(10).string(e.address);for(const n of e.coins)a.Coin.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},d);for(o.coins=[];n.pos>>3){case 1:o.address=n.string();break;case 2:o.coins.push(a.Coin.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},d);return n.address=void 0!==e.address&&null!==e.address?String(e.address):"",n.coins=(null!==(t=e.coins)&&void 0!==t?t:[]).map(e=>a.Coin.fromJSON(e)),n},toJSON(e){const t={};return void 0!==e.address&&(t.address=e.address),e.coins?t.coins=e.coins.map(e=>e?a.Coin.toJSON(e):void 0):t.coins=[],t},fromPartial(e){var t,n;const r=Object.assign({},d);return r.address=null!==(t=e.address)&&void 0!==t?t:"",r.coins=(null===(n=e.coins)||void 0===n?void 0:n.map(e=>a.Coin.fromPartial(e)))||[],r}};const l={};t.Supply={encode(e,t=i.default.Writer.create()){for(const n of e.total)a.Coin.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},l);for(o.total=[];n.pos>>3){case 1:o.total.push(a.Coin.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},l);return n.total=(null!==(t=e.total)&&void 0!==t?t:[]).map(e=>a.Coin.fromJSON(e)),n},toJSON(e){const t={};return e.total?t.total=e.total.map(e=>e?a.Coin.toJSON(e):void 0):t.total=[],t},fromPartial(e){var t;const n=Object.assign({},l);return n.total=(null===(t=e.total)||void 0===t?void 0:t.map(e=>a.Coin.fromPartial(e)))||[],n}};const f={denom:"",exponent:0,aliases:""};t.DenomUnit={encode(e,t=i.default.Writer.create()){""!==e.denom&&t.uint32(10).string(e.denom),0!==e.exponent&&t.uint32(16).uint32(e.exponent);for(const n of e.aliases)t.uint32(26).string(n);return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},f);for(o.aliases=[];n.pos>>3){case 1:o.denom=n.string();break;case 2:o.exponent=n.uint32();break;case 3:o.aliases.push(n.string());break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},f);return n.denom=void 0!==e.denom&&null!==e.denom?String(e.denom):"",n.exponent=void 0!==e.exponent&&null!==e.exponent?Number(e.exponent):0,n.aliases=(null!==(t=e.aliases)&&void 0!==t?t:[]).map(e=>String(e)),n},toJSON(e){const t={};return void 0!==e.denom&&(t.denom=e.denom),void 0!==e.exponent&&(t.exponent=e.exponent),e.aliases?t.aliases=e.aliases.map(e=>e):t.aliases=[],t},fromPartial(e){var t,n,r;const o=Object.assign({},f);return o.denom=null!==(t=e.denom)&&void 0!==t?t:"",o.exponent=null!==(n=e.exponent)&&void 0!==n?n:0,o.aliases=(null===(r=e.aliases)||void 0===r?void 0:r.map(e=>e))||[],o}};const h={description:"",base:"",display:"",name:"",symbol:""};t.Metadata={encode(e,n=i.default.Writer.create()){""!==e.description&&n.uint32(10).string(e.description);for(const r of e.denomUnits)t.DenomUnit.encode(r,n.uint32(18).fork()).ldelim();return""!==e.base&&n.uint32(26).string(e.base),""!==e.display&&n.uint32(34).string(e.display),""!==e.name&&n.uint32(42).string(e.name),""!==e.symbol&&n.uint32(50).string(e.symbol),n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},h);for(a.denomUnits=[];r.pos>>3){case 1:a.description=r.string();break;case 2:a.denomUnits.push(t.DenomUnit.decode(r,r.uint32()));break;case 3:a.base=r.string();break;case 4:a.display=r.string();break;case 5:a.name=r.string();break;case 6:a.symbol=r.string();break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},h);return r.description=void 0!==e.description&&null!==e.description?String(e.description):"",r.denomUnits=(null!==(n=e.denomUnits)&&void 0!==n?n:[]).map(e=>t.DenomUnit.fromJSON(e)),r.base=void 0!==e.base&&null!==e.base?String(e.base):"",r.display=void 0!==e.display&&null!==e.display?String(e.display):"",r.name=void 0!==e.name&&null!==e.name?String(e.name):"",r.symbol=void 0!==e.symbol&&null!==e.symbol?String(e.symbol):"",r},toJSON(e){const n={};return void 0!==e.description&&(n.description=e.description),e.denomUnits?n.denomUnits=e.denomUnits.map(e=>e?t.DenomUnit.toJSON(e):void 0):n.denomUnits=[],void 0!==e.base&&(n.base=e.base),void 0!==e.display&&(n.display=e.display),void 0!==e.name&&(n.name=e.name),void 0!==e.symbol&&(n.symbol=e.symbol),n},fromPartial(e){var n,r,o,i,a,s;const c=Object.assign({},h);return c.description=null!==(n=e.description)&&void 0!==n?n:"",c.denomUnits=(null===(r=e.denomUnits)||void 0===r?void 0:r.map(e=>t.DenomUnit.fromPartial(e)))||[],c.base=null!==(o=e.base)&&void 0!==o?o:"",c.display=null!==(i=e.display)&&void 0!==i?i:"",c.name=null!==(a=e.name)&&void 0!==a?a:"",c.symbol=null!==(s=e.symbol)&&void 0!==s?s:"",c}},i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.QueryClient=t.decodeCosmosSdkDecFromProto=t.createProtobufRpcClient=t.createPagination=t.makeMultisignedTx=t.createStakingAminoConverters=t.createIbcAminoConverters=t.createGovAminoConverters=t.createFreegrantAminoConverters=t.createDistributionAminoConverters=t.createBankAminoConverters=t.createAuthzAminoConverters=t.setupTxExtension=t.setupStakingExtension=t.setupMintExtension=t.setupIbcExtension=t.setupGovExtension=t.setupDistributionExtension=t.setupBankExtension=t.setupAuthExtension=t.isMsgWithdrawDelegatorRewardEncodeObject=t.isMsgVoteEncodeObject=t.isMsgUndelegateEncodeObject=t.isMsgTransferEncodeObject=t.isMsgSubmitProposalEncodeObject=t.isMsgSendEncodeObject=t.isMsgDepositEncodeObject=t.isMsgDelegateEncodeObject=t.isAminoMsgWithdrawValidatorCommission=t.isAminoMsgWithdrawDelegatorReward=t.isAminoMsgVote=t.isAminoMsgVerifyInvariant=t.isAminoMsgUnjail=t.isAminoMsgUndelegate=t.isAminoMsgSubmitProposal=t.isAminoMsgSubmitEvidence=t.isAminoMsgSetWithdrawAddress=t.isAminoMsgSend=t.isAminoMsgMultiSend=t.isAminoMsgFundCommunityPool=t.isAminoMsgEditValidator=t.isAminoMsgDeposit=t.isAminoMsgDelegate=t.isAminoMsgCreateValidator=t.isAminoMsgBeginRedelegate=t.logs=t.GasPrice=t.calculateFee=t.AminoTypes=t.accountFromAny=void 0,t.parseCoins=t.makeCosmoshubPath=t.coins=t.coin=t.TimeoutError=t.StargateClient=t.isDeliverTxSuccess=t.isDeliverTxFailure=t.assertIsDeliverTxSuccess=t.assertIsDeliverTxFailure=t.SigningStargateClient=t.defaultRegistryTypes=t.isSearchByTagsQuery=t.isSearchBySentFromOrToQuery=t.isSearchByHeightQuery=void 0;var a=n(208);Object.defineProperty(t,"accountFromAny",{enumerable:!0,get:function(){return a.accountFromAny}});var s=n(209);Object.defineProperty(t,"AminoTypes",{enumerable:!0,get:function(){return s.AminoTypes}});var c=n(210);Object.defineProperty(t,"calculateFee",{enumerable:!0,get:function(){return c.calculateFee}}),Object.defineProperty(t,"GasPrice",{enumerable:!0,get:function(){return c.GasPrice}}),t.logs=i(n(475));var u=n(54);Object.defineProperty(t,"isAminoMsgBeginRedelegate",{enumerable:!0,get:function(){return u.isAminoMsgBeginRedelegate}}),Object.defineProperty(t,"isAminoMsgCreateValidator",{enumerable:!0,get:function(){return u.isAminoMsgCreateValidator}}),Object.defineProperty(t,"isAminoMsgDelegate",{enumerable:!0,get:function(){return u.isAminoMsgDelegate}}),Object.defineProperty(t,"isAminoMsgDeposit",{enumerable:!0,get:function(){return u.isAminoMsgDeposit}}),Object.defineProperty(t,"isAminoMsgEditValidator",{enumerable:!0,get:function(){return u.isAminoMsgEditValidator}}),Object.defineProperty(t,"isAminoMsgFundCommunityPool",{enumerable:!0,get:function(){return u.isAminoMsgFundCommunityPool}}),Object.defineProperty(t,"isAminoMsgMultiSend",{enumerable:!0,get:function(){return u.isAminoMsgMultiSend}}),Object.defineProperty(t,"isAminoMsgSend",{enumerable:!0,get:function(){return u.isAminoMsgSend}}),Object.defineProperty(t,"isAminoMsgSetWithdrawAddress",{enumerable:!0,get:function(){return u.isAminoMsgSetWithdrawAddress}}),Object.defineProperty(t,"isAminoMsgSubmitEvidence",{enumerable:!0,get:function(){return u.isAminoMsgSubmitEvidence}}),Object.defineProperty(t,"isAminoMsgSubmitProposal",{enumerable:!0,get:function(){return u.isAminoMsgSubmitProposal}}),Object.defineProperty(t,"isAminoMsgUndelegate",{enumerable:!0,get:function(){return u.isAminoMsgUndelegate}}),Object.defineProperty(t,"isAminoMsgUnjail",{enumerable:!0,get:function(){return u.isAminoMsgUnjail}}),Object.defineProperty(t,"isAminoMsgVerifyInvariant",{enumerable:!0,get:function(){return u.isAminoMsgVerifyInvariant}}),Object.defineProperty(t,"isAminoMsgVote",{enumerable:!0,get:function(){return u.isAminoMsgVote}}),Object.defineProperty(t,"isAminoMsgWithdrawDelegatorReward",{enumerable:!0,get:function(){return u.isAminoMsgWithdrawDelegatorReward}}),Object.defineProperty(t,"isAminoMsgWithdrawValidatorCommission",{enumerable:!0,get:function(){return u.isAminoMsgWithdrawValidatorCommission}}),Object.defineProperty(t,"isMsgDelegateEncodeObject",{enumerable:!0,get:function(){return u.isMsgDelegateEncodeObject}}),Object.defineProperty(t,"isMsgDepositEncodeObject",{enumerable:!0,get:function(){return u.isMsgDepositEncodeObject}}),Object.defineProperty(t,"isMsgSendEncodeObject",{enumerable:!0,get:function(){return u.isMsgSendEncodeObject}}),Object.defineProperty(t,"isMsgSubmitProposalEncodeObject",{enumerable:!0,get:function(){return u.isMsgSubmitProposalEncodeObject}}),Object.defineProperty(t,"isMsgTransferEncodeObject",{enumerable:!0,get:function(){return u.isMsgTransferEncodeObject}}),Object.defineProperty(t,"isMsgUndelegateEncodeObject",{enumerable:!0,get:function(){return u.isMsgUndelegateEncodeObject}}),Object.defineProperty(t,"isMsgVoteEncodeObject",{enumerable:!0,get:function(){return u.isMsgVoteEncodeObject}}),Object.defineProperty(t,"isMsgWithdrawDelegatorRewardEncodeObject",{enumerable:!0,get:function(){return u.isMsgWithdrawDelegatorRewardEncodeObject}}),Object.defineProperty(t,"setupAuthExtension",{enumerable:!0,get:function(){return u.setupAuthExtension}}),Object.defineProperty(t,"setupBankExtension",{enumerable:!0,get:function(){return u.setupBankExtension}}),Object.defineProperty(t,"setupDistributionExtension",{enumerable:!0,get:function(){return u.setupDistributionExtension}}),Object.defineProperty(t,"setupGovExtension",{enumerable:!0,get:function(){return u.setupGovExtension}}),Object.defineProperty(t,"setupIbcExtension",{enumerable:!0,get:function(){return u.setupIbcExtension}}),Object.defineProperty(t,"setupMintExtension",{enumerable:!0,get:function(){return u.setupMintExtension}}),Object.defineProperty(t,"setupStakingExtension",{enumerable:!0,get:function(){return u.setupStakingExtension}}),Object.defineProperty(t,"setupTxExtension",{enumerable:!0,get:function(){return u.setupTxExtension}});var d=n(54);Object.defineProperty(t,"createAuthzAminoConverters",{enumerable:!0,get:function(){return d.createAuthzAminoConverters}}),Object.defineProperty(t,"createBankAminoConverters",{enumerable:!0,get:function(){return d.createBankAminoConverters}}),Object.defineProperty(t,"createDistributionAminoConverters",{enumerable:!0,get:function(){return d.createDistributionAminoConverters}}),Object.defineProperty(t,"createFreegrantAminoConverters",{enumerable:!0,get:function(){return d.createFreegrantAminoConverters}}),Object.defineProperty(t,"createGovAminoConverters",{enumerable:!0,get:function(){return d.createGovAminoConverters}}),Object.defineProperty(t,"createIbcAminoConverters",{enumerable:!0,get:function(){return d.createIbcAminoConverters}}),Object.defineProperty(t,"createStakingAminoConverters",{enumerable:!0,get:function(){return d.createStakingAminoConverters}});var l=n(557);Object.defineProperty(t,"makeMultisignedTx",{enumerable:!0,get:function(){return l.makeMultisignedTx}});var f=n(21);Object.defineProperty(t,"createPagination",{enumerable:!0,get:function(){return f.createPagination}}),Object.defineProperty(t,"createProtobufRpcClient",{enumerable:!0,get:function(){return f.createProtobufRpcClient}}),Object.defineProperty(t,"decodeCosmosSdkDecFromProto",{enumerable:!0,get:function(){return f.decodeCosmosSdkDecFromProto}}),Object.defineProperty(t,"QueryClient",{enumerable:!0,get:function(){return f.QueryClient}});var h=n(228);Object.defineProperty(t,"isSearchByHeightQuery",{enumerable:!0,get:function(){return h.isSearchByHeightQuery}}),Object.defineProperty(t,"isSearchBySentFromOrToQuery",{enumerable:!0,get:function(){return h.isSearchBySentFromOrToQuery}}),Object.defineProperty(t,"isSearchByTagsQuery",{enumerable:!0,get:function(){return h.isSearchByTagsQuery}});var p=n(558);Object.defineProperty(t,"defaultRegistryTypes",{enumerable:!0,get:function(){return p.defaultRegistryTypes}}),Object.defineProperty(t,"SigningStargateClient",{enumerable:!0,get:function(){return p.SigningStargateClient}});var A=n(248);Object.defineProperty(t,"assertIsDeliverTxFailure",{enumerable:!0,get:function(){return A.assertIsDeliverTxFailure}}),Object.defineProperty(t,"assertIsDeliverTxSuccess",{enumerable:!0,get:function(){return A.assertIsDeliverTxSuccess}}),Object.defineProperty(t,"isDeliverTxFailure",{enumerable:!0,get:function(){return A.isDeliverTxFailure}}),Object.defineProperty(t,"isDeliverTxSuccess",{enumerable:!0,get:function(){return A.isDeliverTxSuccess}}),Object.defineProperty(t,"StargateClient",{enumerable:!0,get:function(){return A.StargateClient}}),Object.defineProperty(t,"TimeoutError",{enumerable:!0,get:function(){return A.TimeoutError}});var g=n(34);Object.defineProperty(t,"coin",{enumerable:!0,get:function(){return g.coin}}),Object.defineProperty(t,"coins",{enumerable:!0,get:function(){return g.coins}}),Object.defineProperty(t,"makeCosmoshubPath",{enumerable:!0,get:function(){return g.makeCosmoshubPath}}),Object.defineProperty(t,"parseCoins",{enumerable:!0,get:function(){return g.parseCoins}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.accountFromAny=void 0;const r=n(11),o=n(34),i=n(12),a=n(106),s=n(474);function c(e){return r.Uint64.fromString(e.toString())}function u(e){const{address:t,pubKey:n,accountNumber:r,sequence:i}=e;return{address:t,pubkey:(0,o.decodePubkey)(n),accountNumber:c(r).toNumber(),sequence:c(i).toNumber()}}t.accountFromAny=function(e){var t,n,r,o,c,d,l;const{typeUrl:f,value:h}=e;switch(f){case"/cosmos.auth.v1beta1.BaseAccount":return u(a.BaseAccount.decode(h));case"/cosmos.auth.v1beta1.ModuleAccount":{const e=a.ModuleAccount.decode(h).baseAccount;return(0,i.assert)(e),u(e)}case"/cosmos.vesting.v1beta1.BaseVestingAccount":{const e=null===(t=s.BaseVestingAccount.decode(h))||void 0===t?void 0:t.baseAccount;return(0,i.assert)(e),u(e)}case"/cosmos.vesting.v1beta1.ContinuousVestingAccount":{const e=null===(r=null===(n=s.ContinuousVestingAccount.decode(h))||void 0===n?void 0:n.baseVestingAccount)||void 0===r?void 0:r.baseAccount;return(0,i.assert)(e),u(e)}case"/cosmos.vesting.v1beta1.DelayedVestingAccount":{const e=null===(c=null===(o=s.DelayedVestingAccount.decode(h))||void 0===o?void 0:o.baseVestingAccount)||void 0===c?void 0:c.baseAccount;return(0,i.assert)(e),u(e)}case"/cosmos.vesting.v1beta1.PeriodicVestingAccount":{const e=null===(l=null===(d=s.PeriodicVestingAccount.decode(h))||void 0===d?void 0:d.baseVestingAccount)||void 0===l?void 0:l.baseAccount;return(0,i.assert)(e),u(e)}default:throw new Error(`Unsupported type: '${f}'`)}}},function(e,t,n){"use strict";function r(e){return"string"!=typeof e[1]}Object.defineProperty(t,"__esModule",{value:!0}),t.AminoTypes=void 0;t.AminoTypes=class{constructor(e){this.register=e}toAmino({typeUrl:e,value:t}){const n=this.register[e];if("not_supported_by_chain"===n)throw new Error(`The message type '${e}' cannot be signed using the Amino JSON sign mode because this is not supported by chain.`);if(!n)throw new Error(`Type URL '${e}' does not exist in the Amino message type register. If you need support for this message type, you can pass in additional entries to the AminoTypes constructor. If you think this message type should be included by default, please open an issue at https://github.com/cosmos/cosmjs/issues.`);return{type:n.aminoType,value:n.toAmino(t)}}fromAmino({type:e,value:t}){const n=Object.entries(this.register).filter(r).filter(([t,{aminoType:n}])=>n===e);switch(n.length){case 0:throw new Error(`Amino type identifier '${e}' does not exist in the Amino message type register. If you need support for this message type, you can pass in additional entries to the AminoTypes constructor. If you think this message type should be included by default, please open an issue at https://github.com/cosmos/cosmjs/issues.`);case 1:{const[e,r]=n[0];return{typeUrl:e,value:r.fromAmino(t)}}default:throw new Error(`Multiple types are registered with Amino type identifier '${e}': '`+n.map(([e,t])=>e).sort().join("', '")+"'. Thus fromAmino cannot be performed.")}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateFee=t.GasPrice=void 0;const r=n(11),o=n(34);class i{constructor(e,t){this.amount=e,this.denom=t}static fromString(e){const t=e.match(/^([0-9.]+)([a-z][a-z0-9]*)$/i);if(!t)throw new Error("Invalid gas price string");const[n,o,a]=t;!function(e){if(e.length<3||e.length>128)throw new Error("Denom must be between 3 and 128 characters")}(a);const s=r.Decimal.fromUserInput(o,18);return new i(s,a)}toString(){return this.amount.toString()+this.denom}}t.GasPrice=i,t.calculateFee=function(e,t){const n="string"==typeof t?i.fromString(t):t,{denom:a,amount:s}=n,c=s.multiply(new r.Uint53(e)).ceil().toString();return{amount:(0,o.coins)(c,a),gas:e.toString()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ensureLeftNeighbor=t.ensureSpec=t.calculateExistenceRoot=t.verifyNonExistence=t.verifyExistence=t.smtSpec=t.tendermintSpec=t.iavlSpec=void 0;const r=n(70),o=n(482),i=n(212);function a(e,t,n,r,o){c(e,t);const a=s(e);(0,i.ensureBytesEqual)(a,n),(0,i.ensureBytesEqual)(r,e.key),(0,i.ensureBytesEqual)(o,e.value)}function s(e){if(!e.key||!e.value)throw new Error("Existence proof needs key and value set");if(!e.leaf)throw new Error("Existence proof must start with a leaf operation");const t=e.path||[];let n=(0,o.applyLeaf)(e.leaf,e.key,e.value);for(const e of t)n=(0,o.applyInner)(e,n);return n}function c(e,t){if(!e.leaf)throw new Error("Existence proof must start with a leaf operation");if(!t.leafSpec)throw new Error("Spec must include leafSpec");if(!t.innerSpec)throw new Error("Spec must include innerSpec");(0,i.ensureLeaf)(e.leaf,t.leafSpec);const n=e.path||[];if(t.minDepth&&n.lengtht.maxDepth)throw new Error("Too many inner nodes "+n.length);for(const e of n)(0,i.ensureInner)(e,t.leafSpec.prefix,t.innerSpec)}function u(e,t){const{minPrefix:n,maxPrefix:r,suffix:o}=p(e,0);for(const e of t)if(!h(e,n,r,o))throw new Error("Step not leftmost")}function d(e,t){const n=e.childOrder.length-1,{minPrefix:r,maxPrefix:o,suffix:i}=p(e,n);for(const e of t)if(!h(e,r,o,i))throw new Error("Step not leftmost")}function l(e,t,n){const r=[...t],o=[...n];let a=r.pop(),s=o.pop();for(;(0,i.bytesEqual)(a.prefix,s.prefix)&&(0,i.bytesEqual)(a.suffix,s.suffix);)a=r.pop(),s=o.pop();if(!function(e,t,n){const r=f(e,t);return f(e,n)===r+1}(e,a,s))throw new Error("Not left neightbor at first divergent step");d(e,r),u(e,o)}function f(e,t){for(let n=0;nn)&&(e.suffix||[]).length===r)}function p(e,t){const n=function(e,t){if(t<0||t>=e.length)throw new Error("Invalid branch: "+t);return e.findIndex(e=>e===t)}(e.childOrder,t),r=n*e.childSize;return{minPrefix:r+e.minPrefixLength,maxPrefix:r+e.maxPrefixLength,suffix:(e.childOrder.length-1-n)*e.childSize}}t.iavlSpec={leafSpec:{prefix:Uint8Array.from([0]),hash:r.ics23.HashOp.SHA256,prehashValue:r.ics23.HashOp.SHA256,prehashKey:r.ics23.HashOp.NO_HASH,length:r.ics23.LengthOp.VAR_PROTO},innerSpec:{childOrder:[0,1],minPrefixLength:4,maxPrefixLength:12,childSize:33,hash:r.ics23.HashOp.SHA256}},t.tendermintSpec={leafSpec:{prefix:Uint8Array.from([0]),hash:r.ics23.HashOp.SHA256,prehashValue:r.ics23.HashOp.SHA256,prehashKey:r.ics23.HashOp.NO_HASH,length:r.ics23.LengthOp.VAR_PROTO},innerSpec:{childOrder:[0,1],minPrefixLength:1,maxPrefixLength:1,childSize:32,hash:r.ics23.HashOp.SHA256}},t.smtSpec={leafSpec:{hash:r.ics23.HashOp.SHA256,prehashKey:r.ics23.HashOp.NO_HASH,prehashValue:r.ics23.HashOp.SHA256,length:r.ics23.LengthOp.NO_PREFIX,prefix:Uint8Array.from([0])},innerSpec:{childOrder:[0,1],childSize:32,minPrefixLength:1,maxPrefixLength:1,emptyChild:new Uint8Array(32),hash:r.ics23.HashOp.SHA256},maxDepth:256},t.verifyExistence=a,t.verifyNonExistence=function(e,t,n,r){let o,s;if(e.left&&(a(e.left,t,n,e.left.key,e.left.value),o=e.left.key),e.right&&(a(e.right,t,n,e.right.key,e.right.value),s=e.right.key),!o&&!s)throw new Error("neither left nor right proof defined");if(o&&(0,i.ensureBytesBefore)(o,r),s&&(0,i.ensureBytesBefore)(r,s),!t.innerSpec)throw new Error("no inner spec");o?s?l(t.innerSpec,e.left.path,e.right.path):d(t.innerSpec,e.left.path):u(t.innerSpec,e.right.path)},t.calculateExistenceRoot=s,t.ensureSpec=c,t.ensureLeftNeighbor=l},function(e,t,n){"use strict";function r(e,t){if(e.length!==t.length)throw new Error(`Different lengths ${e.length} vs ${t.length}`);for(let n=0;nt[r])return!1}return e.length(n.maxPrefixLength||0)+r)throw new Error(`Prefix too long: ${e.prefix.length} bytes`)},t.ensureBytesEqual=r,t.bytesEqual=function(e,t){if(e.length!==t.length)return!1;for(let n=0;n2?arguments[2]:{},i=r(t);o&&(i=a.call(i,Object.getOwnPropertySymbols(t)));for(var s=0;s=0&&"[object Function]"===r.call(e.callee)),n}},function(e,t,n){"use strict";var r=n(493);e.exports=Function.prototype.bind||r},function(e,t,n){"use strict";"undefined"!=typeof self?e.exports=self:"undefined"!=typeof window?e.exports=window:e.exports=Function("return this")()},function(e,t,n){"use strict";(function(t){var r=n(216);e.exports=function(){return"object"==typeof t&&t&&t.Math===Math&&t.Array===Array?t:r}}).call(this,n(3))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MsgClientImpl=t.MsgFundCommunityPoolResponse=t.MsgFundCommunityPool=t.MsgWithdrawValidatorCommissionResponse=t.MsgWithdrawValidatorCommission=t.MsgWithdrawDelegatorRewardResponse=t.MsgWithdrawDelegatorReward=t.MsgSetWithdrawAddressResponse=t.MsgSetWithdrawAddress=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(10);t.protobufPackage="cosmos.distribution.v1beta1";const s={delegatorAddress:"",withdrawAddress:""};t.MsgSetWithdrawAddress={encode:(e,t=i.default.Writer.create())=>(""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.withdrawAddress&&t.uint32(18).string(e.withdrawAddress),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},s);for(;n.pos>>3){case 1:o.delegatorAddress=n.string();break;case 2:o.withdrawAddress=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},s);return t.delegatorAddress=void 0!==e.delegatorAddress&&null!==e.delegatorAddress?String(e.delegatorAddress):"",t.withdrawAddress=void 0!==e.withdrawAddress&&null!==e.withdrawAddress?String(e.withdrawAddress):"",t},toJSON(e){const t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.withdrawAddress&&(t.withdrawAddress=e.withdrawAddress),t},fromPartial(e){var t,n;const r=Object.assign({},s);return r.delegatorAddress=null!==(t=e.delegatorAddress)&&void 0!==t?t:"",r.withdrawAddress=null!==(n=e.withdrawAddress)&&void 0!==n?n:"",r}};const c={};t.MsgSetWithdrawAddressResponse={encode:(e,t=i.default.Writer.create())=>t,decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},c);for(;n.posObject.assign({},c),toJSON:e=>({}),fromPartial:e=>Object.assign({},c)};const u={delegatorAddress:"",validatorAddress:""};t.MsgWithdrawDelegatorReward={encode:(e,t=i.default.Writer.create())=>(""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.validatorAddress&&t.uint32(18).string(e.validatorAddress),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},u);for(;n.pos>>3){case 1:o.delegatorAddress=n.string();break;case 2:o.validatorAddress=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},u);return t.delegatorAddress=void 0!==e.delegatorAddress&&null!==e.delegatorAddress?String(e.delegatorAddress):"",t.validatorAddress=void 0!==e.validatorAddress&&null!==e.validatorAddress?String(e.validatorAddress):"",t},toJSON(e){const t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){var t,n;const r=Object.assign({},u);return r.delegatorAddress=null!==(t=e.delegatorAddress)&&void 0!==t?t:"",r.validatorAddress=null!==(n=e.validatorAddress)&&void 0!==n?n:"",r}};const d={};t.MsgWithdrawDelegatorRewardResponse={encode:(e,t=i.default.Writer.create())=>t,decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},d);for(;n.posObject.assign({},d),toJSON:e=>({}),fromPartial:e=>Object.assign({},d)};const l={validatorAddress:""};t.MsgWithdrawValidatorCommission={encode:(e,t=i.default.Writer.create())=>(""!==e.validatorAddress&&t.uint32(10).string(e.validatorAddress),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},l);for(;n.pos>>3){case 1:o.validatorAddress=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},l);return t.validatorAddress=void 0!==e.validatorAddress&&null!==e.validatorAddress?String(e.validatorAddress):"",t},toJSON(e){const t={};return void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){var t;const n=Object.assign({},l);return n.validatorAddress=null!==(t=e.validatorAddress)&&void 0!==t?t:"",n}};const f={};t.MsgWithdrawValidatorCommissionResponse={encode:(e,t=i.default.Writer.create())=>t,decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},f);for(;n.posObject.assign({},f),toJSON:e=>({}),fromPartial:e=>Object.assign({},f)};const h={depositor:""};t.MsgFundCommunityPool={encode(e,t=i.default.Writer.create()){for(const n of e.amount)a.Coin.encode(n,t.uint32(10).fork()).ldelim();return""!==e.depositor&&t.uint32(18).string(e.depositor),t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},h);for(o.amount=[];n.pos>>3){case 1:o.amount.push(a.Coin.decode(n,n.uint32()));break;case 2:o.depositor=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},h);return n.amount=(null!==(t=e.amount)&&void 0!==t?t:[]).map(e=>a.Coin.fromJSON(e)),n.depositor=void 0!==e.depositor&&null!==e.depositor?String(e.depositor):"",n},toJSON(e){const t={};return e.amount?t.amount=e.amount.map(e=>e?a.Coin.toJSON(e):void 0):t.amount=[],void 0!==e.depositor&&(t.depositor=e.depositor),t},fromPartial(e){var t,n;const r=Object.assign({},h);return r.amount=(null===(t=e.amount)||void 0===t?void 0:t.map(e=>a.Coin.fromPartial(e)))||[],r.depositor=null!==(n=e.depositor)&&void 0!==n?n:"",r}};const p={};t.MsgFundCommunityPoolResponse={encode:(e,t=i.default.Writer.create())=>t,decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},p);for(;n.posObject.assign({},p),toJSON:e=>({}),fromPartial:e=>Object.assign({},p)};t.MsgClientImpl=class{constructor(e){this.rpc=e,this.SetWithdrawAddress=this.SetWithdrawAddress.bind(this),this.WithdrawDelegatorReward=this.WithdrawDelegatorReward.bind(this),this.WithdrawValidatorCommission=this.WithdrawValidatorCommission.bind(this),this.FundCommunityPool=this.FundCommunityPool.bind(this)}SetWithdrawAddress(e){const n=t.MsgSetWithdrawAddress.encode(e).finish();return this.rpc.request("cosmos.distribution.v1beta1.Msg","SetWithdrawAddress",n).then(e=>t.MsgSetWithdrawAddressResponse.decode(new i.default.Reader(e)))}WithdrawDelegatorReward(e){const n=t.MsgWithdrawDelegatorReward.encode(e).finish();return this.rpc.request("cosmos.distribution.v1beta1.Msg","WithdrawDelegatorReward",n).then(e=>t.MsgWithdrawDelegatorRewardResponse.decode(new i.default.Reader(e)))}WithdrawValidatorCommission(e){const n=t.MsgWithdrawValidatorCommission.encode(e).finish();return this.rpc.request("cosmos.distribution.v1beta1.Msg","WithdrawValidatorCommission",n).then(e=>t.MsgWithdrawValidatorCommissionResponse.decode(new i.default.Reader(e)))}FundCommunityPool(e){const n=t.MsgFundCommunityPool.encode(e).finish();return this.rpc.request("cosmos.distribution.v1beta1.Msg","FundCommunityPool",n).then(e=>t.MsgFundCommunityPoolResponse.decode(new i.default.Reader(e)))}},i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MsgClientImpl=t.MsgTransferResponse=t.MsgTransfer=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(10),s=n(28);t.protobufPackage="ibc.applications.transfer.v1";const c={sourcePort:"",sourceChannel:"",sender:"",receiver:"",timeoutTimestamp:o.default.UZERO};t.MsgTransfer={encode:(e,t=i.default.Writer.create())=>(""!==e.sourcePort&&t.uint32(10).string(e.sourcePort),""!==e.sourceChannel&&t.uint32(18).string(e.sourceChannel),void 0!==e.token&&a.Coin.encode(e.token,t.uint32(26).fork()).ldelim(),""!==e.sender&&t.uint32(34).string(e.sender),""!==e.receiver&&t.uint32(42).string(e.receiver),void 0!==e.timeoutHeight&&s.Height.encode(e.timeoutHeight,t.uint32(50).fork()).ldelim(),e.timeoutTimestamp.isZero()||t.uint32(56).uint64(e.timeoutTimestamp),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},c);for(;n.pos>>3){case 1:o.sourcePort=n.string();break;case 2:o.sourceChannel=n.string();break;case 3:o.token=a.Coin.decode(n,n.uint32());break;case 4:o.sender=n.string();break;case 5:o.receiver=n.string();break;case 6:o.timeoutHeight=s.Height.decode(n,n.uint32());break;case 7:o.timeoutTimestamp=n.uint64();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},c);return t.sourcePort=void 0!==e.sourcePort&&null!==e.sourcePort?String(e.sourcePort):"",t.sourceChannel=void 0!==e.sourceChannel&&null!==e.sourceChannel?String(e.sourceChannel):"",t.token=void 0!==e.token&&null!==e.token?a.Coin.fromJSON(e.token):void 0,t.sender=void 0!==e.sender&&null!==e.sender?String(e.sender):"",t.receiver=void 0!==e.receiver&&null!==e.receiver?String(e.receiver):"",t.timeoutHeight=void 0!==e.timeoutHeight&&null!==e.timeoutHeight?s.Height.fromJSON(e.timeoutHeight):void 0,t.timeoutTimestamp=void 0!==e.timeoutTimestamp&&null!==e.timeoutTimestamp?o.default.fromString(e.timeoutTimestamp):o.default.UZERO,t},toJSON(e){const t={};return void 0!==e.sourcePort&&(t.sourcePort=e.sourcePort),void 0!==e.sourceChannel&&(t.sourceChannel=e.sourceChannel),void 0!==e.token&&(t.token=e.token?a.Coin.toJSON(e.token):void 0),void 0!==e.sender&&(t.sender=e.sender),void 0!==e.receiver&&(t.receiver=e.receiver),void 0!==e.timeoutHeight&&(t.timeoutHeight=e.timeoutHeight?s.Height.toJSON(e.timeoutHeight):void 0),void 0!==e.timeoutTimestamp&&(t.timeoutTimestamp=(e.timeoutTimestamp||o.default.UZERO).toString()),t},fromPartial(e){var t,n,r,i;const u=Object.assign({},c);return u.sourcePort=null!==(t=e.sourcePort)&&void 0!==t?t:"",u.sourceChannel=null!==(n=e.sourceChannel)&&void 0!==n?n:"",u.token=void 0!==e.token&&null!==e.token?a.Coin.fromPartial(e.token):void 0,u.sender=null!==(r=e.sender)&&void 0!==r?r:"",u.receiver=null!==(i=e.receiver)&&void 0!==i?i:"",u.timeoutHeight=void 0!==e.timeoutHeight&&null!==e.timeoutHeight?s.Height.fromPartial(e.timeoutHeight):void 0,u.timeoutTimestamp=void 0!==e.timeoutTimestamp&&null!==e.timeoutTimestamp?o.default.fromValue(e.timeoutTimestamp):o.default.UZERO,u}};const u={};t.MsgTransferResponse={encode:(e,t=i.default.Writer.create())=>t,decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},u);for(;n.posObject.assign({},u),toJSON:e=>({}),fromPartial:e=>Object.assign({},u)};t.MsgClientImpl=class{constructor(e){this.rpc=e,this.Transfer=this.Transfer.bind(this)}Transfer(e){const n=t.MsgTransfer.encode(e).finish();return this.rpc.request("ibc.applications.transfer.v1.Msg","Transfer",n).then(e=>t.MsgTransferResponse.decode(new i.default.Reader(e)))}},i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Version=t.ConnectionPaths=t.ClientPaths=t.Counterparty=t.IdentifiedConnection=t.ConnectionEnd=t.stateToJSON=t.stateFromJSON=t.State=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(221);var s;function c(e){switch(e){case 0:case"STATE_UNINITIALIZED_UNSPECIFIED":return s.STATE_UNINITIALIZED_UNSPECIFIED;case 1:case"STATE_INIT":return s.STATE_INIT;case 2:case"STATE_TRYOPEN":return s.STATE_TRYOPEN;case 3:case"STATE_OPEN":return s.STATE_OPEN;case-1:case"UNRECOGNIZED":default:return s.UNRECOGNIZED}}function u(e){switch(e){case s.STATE_UNINITIALIZED_UNSPECIFIED:return"STATE_UNINITIALIZED_UNSPECIFIED";case s.STATE_INIT:return"STATE_INIT";case s.STATE_TRYOPEN:return"STATE_TRYOPEN";case s.STATE_OPEN:return"STATE_OPEN";default:return"UNKNOWN"}}t.protobufPackage="ibc.core.connection.v1",function(e){e[e.STATE_UNINITIALIZED_UNSPECIFIED=0]="STATE_UNINITIALIZED_UNSPECIFIED",e[e.STATE_INIT=1]="STATE_INIT",e[e.STATE_TRYOPEN=2]="STATE_TRYOPEN",e[e.STATE_OPEN=3]="STATE_OPEN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(s=t.State||(t.State={})),t.stateFromJSON=c,t.stateToJSON=u;const d={clientId:"",state:0,delayPeriod:o.default.UZERO};t.ConnectionEnd={encode(e,n=i.default.Writer.create()){""!==e.clientId&&n.uint32(10).string(e.clientId);for(const r of e.versions)t.Version.encode(r,n.uint32(18).fork()).ldelim();return 0!==e.state&&n.uint32(24).int32(e.state),void 0!==e.counterparty&&t.Counterparty.encode(e.counterparty,n.uint32(34).fork()).ldelim(),e.delayPeriod.isZero()||n.uint32(40).uint64(e.delayPeriod),n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},d);for(a.versions=[];r.pos>>3){case 1:a.clientId=r.string();break;case 2:a.versions.push(t.Version.decode(r,r.uint32()));break;case 3:a.state=r.int32();break;case 4:a.counterparty=t.Counterparty.decode(r,r.uint32());break;case 5:a.delayPeriod=r.uint64();break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},d);return r.clientId=void 0!==e.clientId&&null!==e.clientId?String(e.clientId):"",r.versions=(null!==(n=e.versions)&&void 0!==n?n:[]).map(e=>t.Version.fromJSON(e)),r.state=void 0!==e.state&&null!==e.state?c(e.state):0,r.counterparty=void 0!==e.counterparty&&null!==e.counterparty?t.Counterparty.fromJSON(e.counterparty):void 0,r.delayPeriod=void 0!==e.delayPeriod&&null!==e.delayPeriod?o.default.fromString(e.delayPeriod):o.default.UZERO,r},toJSON(e){const n={};return void 0!==e.clientId&&(n.clientId=e.clientId),e.versions?n.versions=e.versions.map(e=>e?t.Version.toJSON(e):void 0):n.versions=[],void 0!==e.state&&(n.state=u(e.state)),void 0!==e.counterparty&&(n.counterparty=e.counterparty?t.Counterparty.toJSON(e.counterparty):void 0),void 0!==e.delayPeriod&&(n.delayPeriod=(e.delayPeriod||o.default.UZERO).toString()),n},fromPartial(e){var n,r,i;const a=Object.assign({},d);return a.clientId=null!==(n=e.clientId)&&void 0!==n?n:"",a.versions=(null===(r=e.versions)||void 0===r?void 0:r.map(e=>t.Version.fromPartial(e)))||[],a.state=null!==(i=e.state)&&void 0!==i?i:0,a.counterparty=void 0!==e.counterparty&&null!==e.counterparty?t.Counterparty.fromPartial(e.counterparty):void 0,a.delayPeriod=void 0!==e.delayPeriod&&null!==e.delayPeriod?o.default.fromValue(e.delayPeriod):o.default.UZERO,a}};const l={id:"",clientId:"",state:0,delayPeriod:o.default.UZERO};t.IdentifiedConnection={encode(e,n=i.default.Writer.create()){""!==e.id&&n.uint32(10).string(e.id),""!==e.clientId&&n.uint32(18).string(e.clientId);for(const r of e.versions)t.Version.encode(r,n.uint32(26).fork()).ldelim();return 0!==e.state&&n.uint32(32).int32(e.state),void 0!==e.counterparty&&t.Counterparty.encode(e.counterparty,n.uint32(42).fork()).ldelim(),e.delayPeriod.isZero()||n.uint32(48).uint64(e.delayPeriod),n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},l);for(a.versions=[];r.pos>>3){case 1:a.id=r.string();break;case 2:a.clientId=r.string();break;case 3:a.versions.push(t.Version.decode(r,r.uint32()));break;case 4:a.state=r.int32();break;case 5:a.counterparty=t.Counterparty.decode(r,r.uint32());break;case 6:a.delayPeriod=r.uint64();break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},l);return r.id=void 0!==e.id&&null!==e.id?String(e.id):"",r.clientId=void 0!==e.clientId&&null!==e.clientId?String(e.clientId):"",r.versions=(null!==(n=e.versions)&&void 0!==n?n:[]).map(e=>t.Version.fromJSON(e)),r.state=void 0!==e.state&&null!==e.state?c(e.state):0,r.counterparty=void 0!==e.counterparty&&null!==e.counterparty?t.Counterparty.fromJSON(e.counterparty):void 0,r.delayPeriod=void 0!==e.delayPeriod&&null!==e.delayPeriod?o.default.fromString(e.delayPeriod):o.default.UZERO,r},toJSON(e){const n={};return void 0!==e.id&&(n.id=e.id),void 0!==e.clientId&&(n.clientId=e.clientId),e.versions?n.versions=e.versions.map(e=>e?t.Version.toJSON(e):void 0):n.versions=[],void 0!==e.state&&(n.state=u(e.state)),void 0!==e.counterparty&&(n.counterparty=e.counterparty?t.Counterparty.toJSON(e.counterparty):void 0),void 0!==e.delayPeriod&&(n.delayPeriod=(e.delayPeriod||o.default.UZERO).toString()),n},fromPartial(e){var n,r,i,a;const s=Object.assign({},l);return s.id=null!==(n=e.id)&&void 0!==n?n:"",s.clientId=null!==(r=e.clientId)&&void 0!==r?r:"",s.versions=(null===(i=e.versions)||void 0===i?void 0:i.map(e=>t.Version.fromPartial(e)))||[],s.state=null!==(a=e.state)&&void 0!==a?a:0,s.counterparty=void 0!==e.counterparty&&null!==e.counterparty?t.Counterparty.fromPartial(e.counterparty):void 0,s.delayPeriod=void 0!==e.delayPeriod&&null!==e.delayPeriod?o.default.fromValue(e.delayPeriod):o.default.UZERO,s}};const f={clientId:"",connectionId:""};t.Counterparty={encode:(e,t=i.default.Writer.create())=>(""!==e.clientId&&t.uint32(10).string(e.clientId),""!==e.connectionId&&t.uint32(18).string(e.connectionId),void 0!==e.prefix&&a.MerklePrefix.encode(e.prefix,t.uint32(26).fork()).ldelim(),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},f);for(;n.pos>>3){case 1:o.clientId=n.string();break;case 2:o.connectionId=n.string();break;case 3:o.prefix=a.MerklePrefix.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},f);return t.clientId=void 0!==e.clientId&&null!==e.clientId?String(e.clientId):"",t.connectionId=void 0!==e.connectionId&&null!==e.connectionId?String(e.connectionId):"",t.prefix=void 0!==e.prefix&&null!==e.prefix?a.MerklePrefix.fromJSON(e.prefix):void 0,t},toJSON(e){const t={};return void 0!==e.clientId&&(t.clientId=e.clientId),void 0!==e.connectionId&&(t.connectionId=e.connectionId),void 0!==e.prefix&&(t.prefix=e.prefix?a.MerklePrefix.toJSON(e.prefix):void 0),t},fromPartial(e){var t,n;const r=Object.assign({},f);return r.clientId=null!==(t=e.clientId)&&void 0!==t?t:"",r.connectionId=null!==(n=e.connectionId)&&void 0!==n?n:"",r.prefix=void 0!==e.prefix&&null!==e.prefix?a.MerklePrefix.fromPartial(e.prefix):void 0,r}};const h={paths:""};t.ClientPaths={encode(e,t=i.default.Writer.create()){for(const n of e.paths)t.uint32(10).string(n);return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},h);for(o.paths=[];n.pos>>3){case 1:o.paths.push(n.string());break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},h);return n.paths=(null!==(t=e.paths)&&void 0!==t?t:[]).map(e=>String(e)),n},toJSON(e){const t={};return e.paths?t.paths=e.paths.map(e=>e):t.paths=[],t},fromPartial(e){var t;const n=Object.assign({},h);return n.paths=(null===(t=e.paths)||void 0===t?void 0:t.map(e=>e))||[],n}};const p={clientId:"",paths:""};t.ConnectionPaths={encode(e,t=i.default.Writer.create()){""!==e.clientId&&t.uint32(10).string(e.clientId);for(const n of e.paths)t.uint32(18).string(n);return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},p);for(o.paths=[];n.pos>>3){case 1:o.clientId=n.string();break;case 2:o.paths.push(n.string());break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},p);return n.clientId=void 0!==e.clientId&&null!==e.clientId?String(e.clientId):"",n.paths=(null!==(t=e.paths)&&void 0!==t?t:[]).map(e=>String(e)),n},toJSON(e){const t={};return void 0!==e.clientId&&(t.clientId=e.clientId),e.paths?t.paths=e.paths.map(e=>e):t.paths=[],t},fromPartial(e){var t,n;const r=Object.assign({},p);return r.clientId=null!==(t=e.clientId)&&void 0!==t?t:"",r.paths=(null===(n=e.paths)||void 0===n?void 0:n.map(e=>e))||[],r}};const A={identifier:"",features:""};t.Version={encode(e,t=i.default.Writer.create()){""!==e.identifier&&t.uint32(10).string(e.identifier);for(const n of e.features)t.uint32(18).string(n);return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},A);for(o.features=[];n.pos>>3){case 1:o.identifier=n.string();break;case 2:o.features.push(n.string());break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},A);return n.identifier=void 0!==e.identifier&&null!==e.identifier?String(e.identifier):"",n.features=(null!==(t=e.features)&&void 0!==t?t:[]).map(e=>String(e)),n},toJSON(e){const t={};return void 0!==e.identifier&&(t.identifier=e.identifier),e.features?t.features=e.features.map(e=>e):t.features=[],t},fromPartial(e){var t,n;const r=Object.assign({},A);return r.identifier=null!==(t=e.identifier)&&void 0!==t?t:"",r.features=(null===(n=e.features)||void 0===n?void 0:n.map(e=>e))||[],r}},i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())},function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MerkleProof=t.MerklePath=t.MerklePrefix=t.MerkleRoot=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(222);t.protobufPackage="ibc.core.commitment.v1";const s={};t.MerkleRoot={encode:(e,t=i.default.Writer.create())=>(0!==e.hash.length&&t.uint32(10).bytes(e.hash),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},s);for(o.hash=new Uint8Array;n.pos>>3){case 1:o.hash=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},s);return t.hash=void 0!==e.hash&&null!==e.hash?h(e.hash):new Uint8Array,t},toJSON(e){const t={};return void 0!==e.hash&&(t.hash=A(void 0!==e.hash?e.hash:new Uint8Array)),t},fromPartial(e){var t;const n=Object.assign({},s);return n.hash=null!==(t=e.hash)&&void 0!==t?t:new Uint8Array,n}};const c={};t.MerklePrefix={encode:(e,t=i.default.Writer.create())=>(0!==e.keyPrefix.length&&t.uint32(10).bytes(e.keyPrefix),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},c);for(o.keyPrefix=new Uint8Array;n.pos>>3){case 1:o.keyPrefix=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},c);return t.keyPrefix=void 0!==e.keyPrefix&&null!==e.keyPrefix?h(e.keyPrefix):new Uint8Array,t},toJSON(e){const t={};return void 0!==e.keyPrefix&&(t.keyPrefix=A(void 0!==e.keyPrefix?e.keyPrefix:new Uint8Array)),t},fromPartial(e){var t;const n=Object.assign({},c);return n.keyPrefix=null!==(t=e.keyPrefix)&&void 0!==t?t:new Uint8Array,n}};const u={keyPath:""};t.MerklePath={encode(e,t=i.default.Writer.create()){for(const n of e.keyPath)t.uint32(10).string(n);return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},u);for(o.keyPath=[];n.pos>>3){case 1:o.keyPath.push(n.string());break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},u);return n.keyPath=(null!==(t=e.keyPath)&&void 0!==t?t:[]).map(e=>String(e)),n},toJSON(e){const t={};return e.keyPath?t.keyPath=e.keyPath.map(e=>e):t.keyPath=[],t},fromPartial(e){var t;const n=Object.assign({},u);return n.keyPath=(null===(t=e.keyPath)||void 0===t?void 0:t.map(e=>e))||[],n}};const d={};t.MerkleProof={encode(e,t=i.default.Writer.create()){for(const n of e.proofs)a.CommitmentProof.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},d);for(o.proofs=[];n.pos>>3){case 1:o.proofs.push(a.CommitmentProof.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},d);return n.proofs=(null!==(t=e.proofs)&&void 0!==t?t:[]).map(e=>a.CommitmentProof.fromJSON(e)),n},toJSON(e){const t={};return e.proofs?t.proofs=e.proofs.map(e=>e?a.CommitmentProof.toJSON(e):void 0):t.proofs=[],t},fromPartial(e){var t;const n=Object.assign({},d);return n.proofs=(null===(t=e.proofs)||void 0===t?void 0:t.map(e=>a.CommitmentProof.fromPartial(e)))||[],n}};var l=(()=>{if(void 0!==l)return l;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw"Unable to locate global object"})();const f=l.atob||(e=>l.Buffer.from(e,"base64").toString("binary"));function h(e){const t=f(e),n=new Uint8Array(t.length);for(let e=0;el.Buffer.from(e,"binary").toString("base64"));function A(e){const t=[];for(const n of e)t.push(String.fromCharCode(n));return p(t.join(""))}i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())}).call(this,n(3))},function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompressedNonExistenceProof=t.CompressedExistenceProof=t.CompressedBatchEntry=t.CompressedBatchProof=t.BatchEntry=t.BatchProof=t.InnerSpec=t.ProofSpec=t.InnerOp=t.LeafOp=t.CommitmentProof=t.NonExistenceProof=t.ExistenceProof=t.lengthOpToJSON=t.lengthOpFromJSON=t.LengthOp=t.hashOpToJSON=t.hashOpFromJSON=t.HashOp=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1));var a,s;function c(e){switch(e){case 0:case"NO_HASH":return a.NO_HASH;case 1:case"SHA256":return a.SHA256;case 2:case"SHA512":return a.SHA512;case 3:case"KECCAK":return a.KECCAK;case 4:case"RIPEMD160":return a.RIPEMD160;case 5:case"BITCOIN":return a.BITCOIN;case-1:case"UNRECOGNIZED":default:return a.UNRECOGNIZED}}function u(e){switch(e){case a.NO_HASH:return"NO_HASH";case a.SHA256:return"SHA256";case a.SHA512:return"SHA512";case a.KECCAK:return"KECCAK";case a.RIPEMD160:return"RIPEMD160";case a.BITCOIN:return"BITCOIN";default:return"UNKNOWN"}}function d(e){switch(e){case 0:case"NO_PREFIX":return s.NO_PREFIX;case 1:case"VAR_PROTO":return s.VAR_PROTO;case 2:case"VAR_RLP":return s.VAR_RLP;case 3:case"FIXED32_BIG":return s.FIXED32_BIG;case 4:case"FIXED32_LITTLE":return s.FIXED32_LITTLE;case 5:case"FIXED64_BIG":return s.FIXED64_BIG;case 6:case"FIXED64_LITTLE":return s.FIXED64_LITTLE;case 7:case"REQUIRE_32_BYTES":return s.REQUIRE_32_BYTES;case 8:case"REQUIRE_64_BYTES":return s.REQUIRE_64_BYTES;case-1:case"UNRECOGNIZED":default:return s.UNRECOGNIZED}}function l(e){switch(e){case s.NO_PREFIX:return"NO_PREFIX";case s.VAR_PROTO:return"VAR_PROTO";case s.VAR_RLP:return"VAR_RLP";case s.FIXED32_BIG:return"FIXED32_BIG";case s.FIXED32_LITTLE:return"FIXED32_LITTLE";case s.FIXED64_BIG:return"FIXED64_BIG";case s.FIXED64_LITTLE:return"FIXED64_LITTLE";case s.REQUIRE_32_BYTES:return"REQUIRE_32_BYTES";case s.REQUIRE_64_BYTES:return"REQUIRE_64_BYTES";default:return"UNKNOWN"}}t.protobufPackage="ics23",function(e){e[e.NO_HASH=0]="NO_HASH",e[e.SHA256=1]="SHA256",e[e.SHA512=2]="SHA512",e[e.KECCAK=3]="KECCAK",e[e.RIPEMD160=4]="RIPEMD160",e[e.BITCOIN=5]="BITCOIN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(a=t.HashOp||(t.HashOp={})),t.hashOpFromJSON=c,t.hashOpToJSON=u,function(e){e[e.NO_PREFIX=0]="NO_PREFIX",e[e.VAR_PROTO=1]="VAR_PROTO",e[e.VAR_RLP=2]="VAR_RLP",e[e.FIXED32_BIG=3]="FIXED32_BIG",e[e.FIXED32_LITTLE=4]="FIXED32_LITTLE",e[e.FIXED64_BIG=5]="FIXED64_BIG",e[e.FIXED64_LITTLE=6]="FIXED64_LITTLE",e[e.REQUIRE_32_BYTES=7]="REQUIRE_32_BYTES",e[e.REQUIRE_64_BYTES=8]="REQUIRE_64_BYTES",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(s=t.LengthOp||(t.LengthOp={})),t.lengthOpFromJSON=d,t.lengthOpToJSON=l;const f={};t.ExistenceProof={encode(e,n=i.default.Writer.create()){0!==e.key.length&&n.uint32(10).bytes(e.key),0!==e.value.length&&n.uint32(18).bytes(e.value),void 0!==e.leaf&&t.LeafOp.encode(e.leaf,n.uint32(26).fork()).ldelim();for(const r of e.path)t.InnerOp.encode(r,n.uint32(34).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},f);for(a.path=[],a.key=new Uint8Array,a.value=new Uint8Array;r.pos>>3){case 1:a.key=r.bytes();break;case 2:a.value=r.bytes();break;case 3:a.leaf=t.LeafOp.decode(r,r.uint32());break;case 4:a.path.push(t.InnerOp.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},f);return r.key=void 0!==e.key&&null!==e.key?k(e.key):new Uint8Array,r.value=void 0!==e.value&&null!==e.value?k(e.value):new Uint8Array,r.leaf=void 0!==e.leaf&&null!==e.leaf?t.LeafOp.fromJSON(e.leaf):void 0,r.path=(null!==(n=e.path)&&void 0!==n?n:[]).map(e=>t.InnerOp.fromJSON(e)),r},toJSON(e){const n={};return void 0!==e.key&&(n.key=O(void 0!==e.key?e.key:new Uint8Array)),void 0!==e.value&&(n.value=O(void 0!==e.value?e.value:new Uint8Array)),void 0!==e.leaf&&(n.leaf=e.leaf?t.LeafOp.toJSON(e.leaf):void 0),e.path?n.path=e.path.map(e=>e?t.InnerOp.toJSON(e):void 0):n.path=[],n},fromPartial(e){var n,r,o;const i=Object.assign({},f);return i.key=null!==(n=e.key)&&void 0!==n?n:new Uint8Array,i.value=null!==(r=e.value)&&void 0!==r?r:new Uint8Array,i.leaf=void 0!==e.leaf&&null!==e.leaf?t.LeafOp.fromPartial(e.leaf):void 0,i.path=(null===(o=e.path)||void 0===o?void 0:o.map(e=>t.InnerOp.fromPartial(e)))||[],i}};const h={};t.NonExistenceProof={encode:(e,n=i.default.Writer.create())=>(0!==e.key.length&&n.uint32(10).bytes(e.key),void 0!==e.left&&t.ExistenceProof.encode(e.left,n.uint32(18).fork()).ldelim(),void 0!==e.right&&t.ExistenceProof.encode(e.right,n.uint32(26).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},h);for(a.key=new Uint8Array;r.pos>>3){case 1:a.key=r.bytes();break;case 2:a.left=t.ExistenceProof.decode(r,r.uint32());break;case 3:a.right=t.ExistenceProof.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},h);return n.key=void 0!==e.key&&null!==e.key?k(e.key):new Uint8Array,n.left=void 0!==e.left&&null!==e.left?t.ExistenceProof.fromJSON(e.left):void 0,n.right=void 0!==e.right&&null!==e.right?t.ExistenceProof.fromJSON(e.right):void 0,n},toJSON(e){const n={};return void 0!==e.key&&(n.key=O(void 0!==e.key?e.key:new Uint8Array)),void 0!==e.left&&(n.left=e.left?t.ExistenceProof.toJSON(e.left):void 0),void 0!==e.right&&(n.right=e.right?t.ExistenceProof.toJSON(e.right):void 0),n},fromPartial(e){var n;const r=Object.assign({},h);return r.key=null!==(n=e.key)&&void 0!==n?n:new Uint8Array,r.left=void 0!==e.left&&null!==e.left?t.ExistenceProof.fromPartial(e.left):void 0,r.right=void 0!==e.right&&null!==e.right?t.ExistenceProof.fromPartial(e.right):void 0,r}};const p={};t.CommitmentProof={encode:(e,n=i.default.Writer.create())=>(void 0!==e.exist&&t.ExistenceProof.encode(e.exist,n.uint32(10).fork()).ldelim(),void 0!==e.nonexist&&t.NonExistenceProof.encode(e.nonexist,n.uint32(18).fork()).ldelim(),void 0!==e.batch&&t.BatchProof.encode(e.batch,n.uint32(26).fork()).ldelim(),void 0!==e.compressed&&t.CompressedBatchProof.encode(e.compressed,n.uint32(34).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},p);for(;r.pos>>3){case 1:a.exist=t.ExistenceProof.decode(r,r.uint32());break;case 2:a.nonexist=t.NonExistenceProof.decode(r,r.uint32());break;case 3:a.batch=t.BatchProof.decode(r,r.uint32());break;case 4:a.compressed=t.CompressedBatchProof.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},p);return n.exist=void 0!==e.exist&&null!==e.exist?t.ExistenceProof.fromJSON(e.exist):void 0,n.nonexist=void 0!==e.nonexist&&null!==e.nonexist?t.NonExistenceProof.fromJSON(e.nonexist):void 0,n.batch=void 0!==e.batch&&null!==e.batch?t.BatchProof.fromJSON(e.batch):void 0,n.compressed=void 0!==e.compressed&&null!==e.compressed?t.CompressedBatchProof.fromJSON(e.compressed):void 0,n},toJSON(e){const n={};return void 0!==e.exist&&(n.exist=e.exist?t.ExistenceProof.toJSON(e.exist):void 0),void 0!==e.nonexist&&(n.nonexist=e.nonexist?t.NonExistenceProof.toJSON(e.nonexist):void 0),void 0!==e.batch&&(n.batch=e.batch?t.BatchProof.toJSON(e.batch):void 0),void 0!==e.compressed&&(n.compressed=e.compressed?t.CompressedBatchProof.toJSON(e.compressed):void 0),n},fromPartial(e){const n=Object.assign({},p);return n.exist=void 0!==e.exist&&null!==e.exist?t.ExistenceProof.fromPartial(e.exist):void 0,n.nonexist=void 0!==e.nonexist&&null!==e.nonexist?t.NonExistenceProof.fromPartial(e.nonexist):void 0,n.batch=void 0!==e.batch&&null!==e.batch?t.BatchProof.fromPartial(e.batch):void 0,n.compressed=void 0!==e.compressed&&null!==e.compressed?t.CompressedBatchProof.fromPartial(e.compressed):void 0,n}};const A={hash:0,prehashKey:0,prehashValue:0,length:0};t.LeafOp={encode:(e,t=i.default.Writer.create())=>(0!==e.hash&&t.uint32(8).int32(e.hash),0!==e.prehashKey&&t.uint32(16).int32(e.prehashKey),0!==e.prehashValue&&t.uint32(24).int32(e.prehashValue),0!==e.length&&t.uint32(32).int32(e.length),0!==e.prefix.length&&t.uint32(42).bytes(e.prefix),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},A);for(o.prefix=new Uint8Array;n.pos>>3){case 1:o.hash=n.int32();break;case 2:o.prehashKey=n.int32();break;case 3:o.prehashValue=n.int32();break;case 4:o.length=n.int32();break;case 5:o.prefix=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},A);return t.hash=void 0!==e.hash&&null!==e.hash?c(e.hash):0,t.prehashKey=void 0!==e.prehashKey&&null!==e.prehashKey?c(e.prehashKey):0,t.prehashValue=void 0!==e.prehashValue&&null!==e.prehashValue?c(e.prehashValue):0,t.length=void 0!==e.length&&null!==e.length?d(e.length):0,t.prefix=void 0!==e.prefix&&null!==e.prefix?k(e.prefix):new Uint8Array,t},toJSON(e){const t={};return void 0!==e.hash&&(t.hash=u(e.hash)),void 0!==e.prehashKey&&(t.prehashKey=u(e.prehashKey)),void 0!==e.prehashValue&&(t.prehashValue=u(e.prehashValue)),void 0!==e.length&&(t.length=l(e.length)),void 0!==e.prefix&&(t.prefix=O(void 0!==e.prefix?e.prefix:new Uint8Array)),t},fromPartial(e){var t,n,r,o,i;const a=Object.assign({},A);return a.hash=null!==(t=e.hash)&&void 0!==t?t:0,a.prehashKey=null!==(n=e.prehashKey)&&void 0!==n?n:0,a.prehashValue=null!==(r=e.prehashValue)&&void 0!==r?r:0,a.length=null!==(o=e.length)&&void 0!==o?o:0,a.prefix=null!==(i=e.prefix)&&void 0!==i?i:new Uint8Array,a}};const g={hash:0};t.InnerOp={encode:(e,t=i.default.Writer.create())=>(0!==e.hash&&t.uint32(8).int32(e.hash),0!==e.prefix.length&&t.uint32(18).bytes(e.prefix),0!==e.suffix.length&&t.uint32(26).bytes(e.suffix),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},g);for(o.prefix=new Uint8Array,o.suffix=new Uint8Array;n.pos>>3){case 1:o.hash=n.int32();break;case 2:o.prefix=n.bytes();break;case 3:o.suffix=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},g);return t.hash=void 0!==e.hash&&null!==e.hash?c(e.hash):0,t.prefix=void 0!==e.prefix&&null!==e.prefix?k(e.prefix):new Uint8Array,t.suffix=void 0!==e.suffix&&null!==e.suffix?k(e.suffix):new Uint8Array,t},toJSON(e){const t={};return void 0!==e.hash&&(t.hash=u(e.hash)),void 0!==e.prefix&&(t.prefix=O(void 0!==e.prefix?e.prefix:new Uint8Array)),void 0!==e.suffix&&(t.suffix=O(void 0!==e.suffix?e.suffix:new Uint8Array)),t},fromPartial(e){var t,n,r;const o=Object.assign({},g);return o.hash=null!==(t=e.hash)&&void 0!==t?t:0,o.prefix=null!==(n=e.prefix)&&void 0!==n?n:new Uint8Array,o.suffix=null!==(r=e.suffix)&&void 0!==r?r:new Uint8Array,o}};const m={maxDepth:0,minDepth:0};t.ProofSpec={encode:(e,n=i.default.Writer.create())=>(void 0!==e.leafSpec&&t.LeafOp.encode(e.leafSpec,n.uint32(10).fork()).ldelim(),void 0!==e.innerSpec&&t.InnerSpec.encode(e.innerSpec,n.uint32(18).fork()).ldelim(),0!==e.maxDepth&&n.uint32(24).int32(e.maxDepth),0!==e.minDepth&&n.uint32(32).int32(e.minDepth),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},m);for(;r.pos>>3){case 1:a.leafSpec=t.LeafOp.decode(r,r.uint32());break;case 2:a.innerSpec=t.InnerSpec.decode(r,r.uint32());break;case 3:a.maxDepth=r.int32();break;case 4:a.minDepth=r.int32();break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},m);return n.leafSpec=void 0!==e.leafSpec&&null!==e.leafSpec?t.LeafOp.fromJSON(e.leafSpec):void 0,n.innerSpec=void 0!==e.innerSpec&&null!==e.innerSpec?t.InnerSpec.fromJSON(e.innerSpec):void 0,n.maxDepth=void 0!==e.maxDepth&&null!==e.maxDepth?Number(e.maxDepth):0,n.minDepth=void 0!==e.minDepth&&null!==e.minDepth?Number(e.minDepth):0,n},toJSON(e){const n={};return void 0!==e.leafSpec&&(n.leafSpec=e.leafSpec?t.LeafOp.toJSON(e.leafSpec):void 0),void 0!==e.innerSpec&&(n.innerSpec=e.innerSpec?t.InnerSpec.toJSON(e.innerSpec):void 0),void 0!==e.maxDepth&&(n.maxDepth=e.maxDepth),void 0!==e.minDepth&&(n.minDepth=e.minDepth),n},fromPartial(e){var n,r;const o=Object.assign({},m);return o.leafSpec=void 0!==e.leafSpec&&null!==e.leafSpec?t.LeafOp.fromPartial(e.leafSpec):void 0,o.innerSpec=void 0!==e.innerSpec&&null!==e.innerSpec?t.InnerSpec.fromPartial(e.innerSpec):void 0,o.maxDepth=null!==(n=e.maxDepth)&&void 0!==n?n:0,o.minDepth=null!==(r=e.minDepth)&&void 0!==r?r:0,o}};const v={childOrder:0,childSize:0,minPrefixLength:0,maxPrefixLength:0,hash:0};t.InnerSpec={encode(e,t=i.default.Writer.create()){t.uint32(10).fork();for(const n of e.childOrder)t.int32(n);return t.ldelim(),0!==e.childSize&&t.uint32(16).int32(e.childSize),0!==e.minPrefixLength&&t.uint32(24).int32(e.minPrefixLength),0!==e.maxPrefixLength&&t.uint32(32).int32(e.maxPrefixLength),0!==e.emptyChild.length&&t.uint32(42).bytes(e.emptyChild),0!==e.hash&&t.uint32(48).int32(e.hash),t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},v);for(o.childOrder=[],o.emptyChild=new Uint8Array;n.pos>>3){case 1:if(2==(7&e)){const e=n.uint32()+n.pos;for(;n.posNumber(e)),n.childSize=void 0!==e.childSize&&null!==e.childSize?Number(e.childSize):0,n.minPrefixLength=void 0!==e.minPrefixLength&&null!==e.minPrefixLength?Number(e.minPrefixLength):0,n.maxPrefixLength=void 0!==e.maxPrefixLength&&null!==e.maxPrefixLength?Number(e.maxPrefixLength):0,n.emptyChild=void 0!==e.emptyChild&&null!==e.emptyChild?k(e.emptyChild):new Uint8Array,n.hash=void 0!==e.hash&&null!==e.hash?c(e.hash):0,n},toJSON(e){const t={};return e.childOrder?t.childOrder=e.childOrder.map(e=>e):t.childOrder=[],void 0!==e.childSize&&(t.childSize=e.childSize),void 0!==e.minPrefixLength&&(t.minPrefixLength=e.minPrefixLength),void 0!==e.maxPrefixLength&&(t.maxPrefixLength=e.maxPrefixLength),void 0!==e.emptyChild&&(t.emptyChild=O(void 0!==e.emptyChild?e.emptyChild:new Uint8Array)),void 0!==e.hash&&(t.hash=u(e.hash)),t},fromPartial(e){var t,n,r,o,i,a;const s=Object.assign({},v);return s.childOrder=(null===(t=e.childOrder)||void 0===t?void 0:t.map(e=>e))||[],s.childSize=null!==(n=e.childSize)&&void 0!==n?n:0,s.minPrefixLength=null!==(r=e.minPrefixLength)&&void 0!==r?r:0,s.maxPrefixLength=null!==(o=e.maxPrefixLength)&&void 0!==o?o:0,s.emptyChild=null!==(i=e.emptyChild)&&void 0!==i?i:new Uint8Array,s.hash=null!==(a=e.hash)&&void 0!==a?a:0,s}};const y={};t.BatchProof={encode(e,n=i.default.Writer.create()){for(const r of e.entries)t.BatchEntry.encode(r,n.uint32(10).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},y);for(a.entries=[];r.pos>>3){case 1:a.entries.push(t.BatchEntry.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},y);return r.entries=(null!==(n=e.entries)&&void 0!==n?n:[]).map(e=>t.BatchEntry.fromJSON(e)),r},toJSON(e){const n={};return e.entries?n.entries=e.entries.map(e=>e?t.BatchEntry.toJSON(e):void 0):n.entries=[],n},fromPartial(e){var n;const r=Object.assign({},y);return r.entries=(null===(n=e.entries)||void 0===n?void 0:n.map(e=>t.BatchEntry.fromPartial(e)))||[],r}};const b={};t.BatchEntry={encode:(e,n=i.default.Writer.create())=>(void 0!==e.exist&&t.ExistenceProof.encode(e.exist,n.uint32(10).fork()).ldelim(),void 0!==e.nonexist&&t.NonExistenceProof.encode(e.nonexist,n.uint32(18).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},b);for(;r.pos>>3){case 1:a.exist=t.ExistenceProof.decode(r,r.uint32());break;case 2:a.nonexist=t.NonExistenceProof.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},b);return n.exist=void 0!==e.exist&&null!==e.exist?t.ExistenceProof.fromJSON(e.exist):void 0,n.nonexist=void 0!==e.nonexist&&null!==e.nonexist?t.NonExistenceProof.fromJSON(e.nonexist):void 0,n},toJSON(e){const n={};return void 0!==e.exist&&(n.exist=e.exist?t.ExistenceProof.toJSON(e.exist):void 0),void 0!==e.nonexist&&(n.nonexist=e.nonexist?t.NonExistenceProof.toJSON(e.nonexist):void 0),n},fromPartial(e){const n=Object.assign({},b);return n.exist=void 0!==e.exist&&null!==e.exist?t.ExistenceProof.fromPartial(e.exist):void 0,n.nonexist=void 0!==e.nonexist&&null!==e.nonexist?t.NonExistenceProof.fromPartial(e.nonexist):void 0,n}};const I={};t.CompressedBatchProof={encode(e,n=i.default.Writer.create()){for(const r of e.entries)t.CompressedBatchEntry.encode(r,n.uint32(10).fork()).ldelim();for(const r of e.lookupInners)t.InnerOp.encode(r,n.uint32(18).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},I);for(a.entries=[],a.lookupInners=[];r.pos>>3){case 1:a.entries.push(t.CompressedBatchEntry.decode(r,r.uint32()));break;case 2:a.lookupInners.push(t.InnerOp.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n,r;const o=Object.assign({},I);return o.entries=(null!==(n=e.entries)&&void 0!==n?n:[]).map(e=>t.CompressedBatchEntry.fromJSON(e)),o.lookupInners=(null!==(r=e.lookupInners)&&void 0!==r?r:[]).map(e=>t.InnerOp.fromJSON(e)),o},toJSON(e){const n={};return e.entries?n.entries=e.entries.map(e=>e?t.CompressedBatchEntry.toJSON(e):void 0):n.entries=[],e.lookupInners?n.lookupInners=e.lookupInners.map(e=>e?t.InnerOp.toJSON(e):void 0):n.lookupInners=[],n},fromPartial(e){var n,r;const o=Object.assign({},I);return o.entries=(null===(n=e.entries)||void 0===n?void 0:n.map(e=>t.CompressedBatchEntry.fromPartial(e)))||[],o.lookupInners=(null===(r=e.lookupInners)||void 0===r?void 0:r.map(e=>t.InnerOp.fromPartial(e)))||[],o}};const w={};t.CompressedBatchEntry={encode:(e,n=i.default.Writer.create())=>(void 0!==e.exist&&t.CompressedExistenceProof.encode(e.exist,n.uint32(10).fork()).ldelim(),void 0!==e.nonexist&&t.CompressedNonExistenceProof.encode(e.nonexist,n.uint32(18).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},w);for(;r.pos>>3){case 1:a.exist=t.CompressedExistenceProof.decode(r,r.uint32());break;case 2:a.nonexist=t.CompressedNonExistenceProof.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},w);return n.exist=void 0!==e.exist&&null!==e.exist?t.CompressedExistenceProof.fromJSON(e.exist):void 0,n.nonexist=void 0!==e.nonexist&&null!==e.nonexist?t.CompressedNonExistenceProof.fromJSON(e.nonexist):void 0,n},toJSON(e){const n={};return void 0!==e.exist&&(n.exist=e.exist?t.CompressedExistenceProof.toJSON(e.exist):void 0),void 0!==e.nonexist&&(n.nonexist=e.nonexist?t.CompressedNonExistenceProof.toJSON(e.nonexist):void 0),n},fromPartial(e){const n=Object.assign({},w);return n.exist=void 0!==e.exist&&null!==e.exist?t.CompressedExistenceProof.fromPartial(e.exist):void 0,n.nonexist=void 0!==e.nonexist&&null!==e.nonexist?t.CompressedNonExistenceProof.fromPartial(e.nonexist):void 0,n}};const E={path:0};t.CompressedExistenceProof={encode(e,n=i.default.Writer.create()){0!==e.key.length&&n.uint32(10).bytes(e.key),0!==e.value.length&&n.uint32(18).bytes(e.value),void 0!==e.leaf&&t.LeafOp.encode(e.leaf,n.uint32(26).fork()).ldelim(),n.uint32(34).fork();for(const t of e.path)n.int32(t);return n.ldelim(),n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},E);for(a.path=[],a.key=new Uint8Array,a.value=new Uint8Array;r.pos>>3){case 1:a.key=r.bytes();break;case 2:a.value=r.bytes();break;case 3:a.leaf=t.LeafOp.decode(r,r.uint32());break;case 4:if(2==(7&e)){const e=r.uint32()+r.pos;for(;r.posNumber(e)),r},toJSON(e){const n={};return void 0!==e.key&&(n.key=O(void 0!==e.key?e.key:new Uint8Array)),void 0!==e.value&&(n.value=O(void 0!==e.value?e.value:new Uint8Array)),void 0!==e.leaf&&(n.leaf=e.leaf?t.LeafOp.toJSON(e.leaf):void 0),e.path?n.path=e.path.map(e=>e):n.path=[],n},fromPartial(e){var n,r,o;const i=Object.assign({},E);return i.key=null!==(n=e.key)&&void 0!==n?n:new Uint8Array,i.value=null!==(r=e.value)&&void 0!==r?r:new Uint8Array,i.leaf=void 0!==e.leaf&&null!==e.leaf?t.LeafOp.fromPartial(e.leaf):void 0,i.path=(null===(o=e.path)||void 0===o?void 0:o.map(e=>e))||[],i}};const _={};t.CompressedNonExistenceProof={encode:(e,n=i.default.Writer.create())=>(0!==e.key.length&&n.uint32(10).bytes(e.key),void 0!==e.left&&t.CompressedExistenceProof.encode(e.left,n.uint32(18).fork()).ldelim(),void 0!==e.right&&t.CompressedExistenceProof.encode(e.right,n.uint32(26).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},_);for(a.key=new Uint8Array;r.pos>>3){case 1:a.key=r.bytes();break;case 2:a.left=t.CompressedExistenceProof.decode(r,r.uint32());break;case 3:a.right=t.CompressedExistenceProof.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},_);return n.key=void 0!==e.key&&null!==e.key?k(e.key):new Uint8Array,n.left=void 0!==e.left&&null!==e.left?t.CompressedExistenceProof.fromJSON(e.left):void 0,n.right=void 0!==e.right&&null!==e.right?t.CompressedExistenceProof.fromJSON(e.right):void 0,n},toJSON(e){const n={};return void 0!==e.key&&(n.key=O(void 0!==e.key?e.key:new Uint8Array)),void 0!==e.left&&(n.left=e.left?t.CompressedExistenceProof.toJSON(e.left):void 0),void 0!==e.right&&(n.right=e.right?t.CompressedExistenceProof.toJSON(e.right):void 0),n},fromPartial(e){var n;const r=Object.assign({},_);return r.key=null!==(n=e.key)&&void 0!==n?n:new Uint8Array,r.left=void 0!==e.left&&null!==e.left?t.CompressedExistenceProof.fromPartial(e.left):void 0,r.right=void 0!==e.right&&null!==e.right?t.CompressedExistenceProof.fromPartial(e.right):void 0,r}};var B=(()=>{if(void 0!==B)return B;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw"Unable to locate global object"})();const C=B.atob||(e=>B.Buffer.from(e,"base64").toString("binary"));function k(e){const t=C(e),n=new Uint8Array(t.length);for(let e=0;eB.Buffer.from(e,"binary").toString("base64"));function O(e){const t=[];for(const n of e)t.push(String.fromCharCode(n));return S(t.join(""))}i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())}).call(this,n(3))},function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ProofOps=t.ProofOp=t.DominoOp=t.ValueOp=t.Proof=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1));t.protobufPackage="tendermint.crypto";const a={total:o.default.ZERO,index:o.default.ZERO};t.Proof={encode(e,t=i.default.Writer.create()){e.total.isZero()||t.uint32(8).int64(e.total),e.index.isZero()||t.uint32(16).int64(e.index),0!==e.leafHash.length&&t.uint32(26).bytes(e.leafHash);for(const n of e.aunts)t.uint32(34).bytes(n);return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},a);for(o.aunts=[],o.leafHash=new Uint8Array;n.pos>>3){case 1:o.total=n.int64();break;case 2:o.index=n.int64();break;case 3:o.leafHash=n.bytes();break;case 4:o.aunts.push(n.bytes());break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},a);return n.total=void 0!==e.total&&null!==e.total?o.default.fromString(e.total):o.default.ZERO,n.index=void 0!==e.index&&null!==e.index?o.default.fromString(e.index):o.default.ZERO,n.leafHash=void 0!==e.leafHash&&null!==e.leafHash?h(e.leafHash):new Uint8Array,n.aunts=(null!==(t=e.aunts)&&void 0!==t?t:[]).map(e=>h(e)),n},toJSON(e){const t={};return void 0!==e.total&&(t.total=(e.total||o.default.ZERO).toString()),void 0!==e.index&&(t.index=(e.index||o.default.ZERO).toString()),void 0!==e.leafHash&&(t.leafHash=A(void 0!==e.leafHash?e.leafHash:new Uint8Array)),e.aunts?t.aunts=e.aunts.map(e=>A(void 0!==e?e:new Uint8Array)):t.aunts=[],t},fromPartial(e){var t,n;const r=Object.assign({},a);return r.total=void 0!==e.total&&null!==e.total?o.default.fromValue(e.total):o.default.ZERO,r.index=void 0!==e.index&&null!==e.index?o.default.fromValue(e.index):o.default.ZERO,r.leafHash=null!==(t=e.leafHash)&&void 0!==t?t:new Uint8Array,r.aunts=(null===(n=e.aunts)||void 0===n?void 0:n.map(e=>e))||[],r}};const s={};t.ValueOp={encode:(e,n=i.default.Writer.create())=>(0!==e.key.length&&n.uint32(10).bytes(e.key),void 0!==e.proof&&t.Proof.encode(e.proof,n.uint32(18).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},s);for(a.key=new Uint8Array;r.pos>>3){case 1:a.key=r.bytes();break;case 2:a.proof=t.Proof.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},s);return n.key=void 0!==e.key&&null!==e.key?h(e.key):new Uint8Array,n.proof=void 0!==e.proof&&null!==e.proof?t.Proof.fromJSON(e.proof):void 0,n},toJSON(e){const n={};return void 0!==e.key&&(n.key=A(void 0!==e.key?e.key:new Uint8Array)),void 0!==e.proof&&(n.proof=e.proof?t.Proof.toJSON(e.proof):void 0),n},fromPartial(e){var n;const r=Object.assign({},s);return r.key=null!==(n=e.key)&&void 0!==n?n:new Uint8Array,r.proof=void 0!==e.proof&&null!==e.proof?t.Proof.fromPartial(e.proof):void 0,r}};const c={key:"",input:"",output:""};t.DominoOp={encode:(e,t=i.default.Writer.create())=>(""!==e.key&&t.uint32(10).string(e.key),""!==e.input&&t.uint32(18).string(e.input),""!==e.output&&t.uint32(26).string(e.output),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},c);for(;n.pos>>3){case 1:o.key=n.string();break;case 2:o.input=n.string();break;case 3:o.output=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},c);return t.key=void 0!==e.key&&null!==e.key?String(e.key):"",t.input=void 0!==e.input&&null!==e.input?String(e.input):"",t.output=void 0!==e.output&&null!==e.output?String(e.output):"",t},toJSON(e){const t={};return void 0!==e.key&&(t.key=e.key),void 0!==e.input&&(t.input=e.input),void 0!==e.output&&(t.output=e.output),t},fromPartial(e){var t,n,r;const o=Object.assign({},c);return o.key=null!==(t=e.key)&&void 0!==t?t:"",o.input=null!==(n=e.input)&&void 0!==n?n:"",o.output=null!==(r=e.output)&&void 0!==r?r:"",o}};const u={type:""};t.ProofOp={encode:(e,t=i.default.Writer.create())=>(""!==e.type&&t.uint32(10).string(e.type),0!==e.key.length&&t.uint32(18).bytes(e.key),0!==e.data.length&&t.uint32(26).bytes(e.data),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},u);for(o.key=new Uint8Array,o.data=new Uint8Array;n.pos>>3){case 1:o.type=n.string();break;case 2:o.key=n.bytes();break;case 3:o.data=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},u);return t.type=void 0!==e.type&&null!==e.type?String(e.type):"",t.key=void 0!==e.key&&null!==e.key?h(e.key):new Uint8Array,t.data=void 0!==e.data&&null!==e.data?h(e.data):new Uint8Array,t},toJSON(e){const t={};return void 0!==e.type&&(t.type=e.type),void 0!==e.key&&(t.key=A(void 0!==e.key?e.key:new Uint8Array)),void 0!==e.data&&(t.data=A(void 0!==e.data?e.data:new Uint8Array)),t},fromPartial(e){var t,n,r;const o=Object.assign({},u);return o.type=null!==(t=e.type)&&void 0!==t?t:"",o.key=null!==(n=e.key)&&void 0!==n?n:new Uint8Array,o.data=null!==(r=e.data)&&void 0!==r?r:new Uint8Array,o}};const d={};t.ProofOps={encode(e,n=i.default.Writer.create()){for(const r of e.ops)t.ProofOp.encode(r,n.uint32(10).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},d);for(a.ops=[];r.pos>>3){case 1:a.ops.push(t.ProofOp.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},d);return r.ops=(null!==(n=e.ops)&&void 0!==n?n:[]).map(e=>t.ProofOp.fromJSON(e)),r},toJSON(e){const n={};return e.ops?n.ops=e.ops.map(e=>e?t.ProofOp.toJSON(e):void 0):n.ops=[],n},fromPartial(e){var n;const r=Object.assign({},d);return r.ops=(null===(n=e.ops)||void 0===n?void 0:n.map(e=>t.ProofOp.fromPartial(e)))||[],r}};var l=(()=>{if(void 0!==l)return l;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw"Unable to locate global object"})();const f=l.atob||(e=>l.Buffer.from(e,"base64").toString("binary"));function h(e){const t=f(e),n=new Uint8Array(t.length);for(let e=0;el.Buffer.from(e,"binary").toString("base64"));function A(e){const t=[];for(const n of e)t.push(String.fromCharCode(n));return p(t.join(""))}i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())}).call(this,n(3))},function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleValidator=t.Validator=t.ValidatorSet=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(225);t.protobufPackage="tendermint.types";const s={totalVotingPower:o.default.ZERO};t.ValidatorSet={encode(e,n=i.default.Writer.create()){for(const r of e.validators)t.Validator.encode(r,n.uint32(10).fork()).ldelim();return void 0!==e.proposer&&t.Validator.encode(e.proposer,n.uint32(18).fork()).ldelim(),e.totalVotingPower.isZero()||n.uint32(24).int64(e.totalVotingPower),n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},s);for(a.validators=[];r.pos>>3){case 1:a.validators.push(t.Validator.decode(r,r.uint32()));break;case 2:a.proposer=t.Validator.decode(r,r.uint32());break;case 3:a.totalVotingPower=r.int64();break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},s);return r.validators=(null!==(n=e.validators)&&void 0!==n?n:[]).map(e=>t.Validator.fromJSON(e)),r.proposer=void 0!==e.proposer&&null!==e.proposer?t.Validator.fromJSON(e.proposer):void 0,r.totalVotingPower=void 0!==e.totalVotingPower&&null!==e.totalVotingPower?o.default.fromString(e.totalVotingPower):o.default.ZERO,r},toJSON(e){const n={};return e.validators?n.validators=e.validators.map(e=>e?t.Validator.toJSON(e):void 0):n.validators=[],void 0!==e.proposer&&(n.proposer=e.proposer?t.Validator.toJSON(e.proposer):void 0),void 0!==e.totalVotingPower&&(n.totalVotingPower=(e.totalVotingPower||o.default.ZERO).toString()),n},fromPartial(e){var n;const r=Object.assign({},s);return r.validators=(null===(n=e.validators)||void 0===n?void 0:n.map(e=>t.Validator.fromPartial(e)))||[],r.proposer=void 0!==e.proposer&&null!==e.proposer?t.Validator.fromPartial(e.proposer):void 0,r.totalVotingPower=void 0!==e.totalVotingPower&&null!==e.totalVotingPower?o.default.fromValue(e.totalVotingPower):o.default.ZERO,r}};const c={votingPower:o.default.ZERO,proposerPriority:o.default.ZERO};t.Validator={encode:(e,t=i.default.Writer.create())=>(0!==e.address.length&&t.uint32(10).bytes(e.address),void 0!==e.pubKey&&a.PublicKey.encode(e.pubKey,t.uint32(18).fork()).ldelim(),e.votingPower.isZero()||t.uint32(24).int64(e.votingPower),e.proposerPriority.isZero()||t.uint32(32).int64(e.proposerPriority),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},c);for(o.address=new Uint8Array;n.pos>>3){case 1:o.address=n.bytes();break;case 2:o.pubKey=a.PublicKey.decode(n,n.uint32());break;case 3:o.votingPower=n.int64();break;case 4:o.proposerPriority=n.int64();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},c);return t.address=void 0!==e.address&&null!==e.address?function(e){const t=l(e),n=new Uint8Array(t.length);for(let e=0;e(void 0!==e.pubKey&&a.PublicKey.encode(e.pubKey,t.uint32(10).fork()).ldelim(),e.votingPower.isZero()||t.uint32(16).int64(e.votingPower),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},u);for(;n.pos>>3){case 1:o.pubKey=a.PublicKey.decode(n,n.uint32());break;case 2:o.votingPower=n.int64();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},u);return t.pubKey=void 0!==e.pubKey&&null!==e.pubKey?a.PublicKey.fromJSON(e.pubKey):void 0,t.votingPower=void 0!==e.votingPower&&null!==e.votingPower?o.default.fromString(e.votingPower):o.default.ZERO,t},toJSON(e){const t={};return void 0!==e.pubKey&&(t.pubKey=e.pubKey?a.PublicKey.toJSON(e.pubKey):void 0),void 0!==e.votingPower&&(t.votingPower=(e.votingPower||o.default.ZERO).toString()),t},fromPartial(e){const t=Object.assign({},u);return t.pubKey=void 0!==e.pubKey&&null!==e.pubKey?a.PublicKey.fromPartial(e.pubKey):void 0,t.votingPower=void 0!==e.votingPower&&null!==e.votingPower?o.default.fromValue(e.votingPower):o.default.ZERO,t}};var d=(()=>{if(void 0!==d)return d;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw"Unable to locate global object"})();const l=d.atob||(e=>d.Buffer.from(e,"base64").toString("binary"));const f=d.btoa||(e=>d.Buffer.from(e,"binary").toString("base64"));i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())}).call(this,n(3))},function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PublicKey=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1));t.protobufPackage="tendermint.crypto";const a={};t.PublicKey={encode:(e,t=i.default.Writer.create())=>(void 0!==e.ed25519&&t.uint32(10).bytes(e.ed25519),void 0!==e.secp256k1&&t.uint32(18).bytes(e.secp256k1),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},a);for(;n.pos>>3){case 1:o.ed25519=n.bytes();break;case 2:o.secp256k1=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},a);return t.ed25519=void 0!==e.ed25519&&null!==e.ed25519?u(e.ed25519):void 0,t.secp256k1=void 0!==e.secp256k1&&null!==e.secp256k1?u(e.secp256k1):void 0,t},toJSON(e){const t={};return void 0!==e.ed25519&&(t.ed25519=void 0!==e.ed25519?l(e.ed25519):void 0),void 0!==e.secp256k1&&(t.secp256k1=void 0!==e.secp256k1?l(e.secp256k1):void 0),t},fromPartial(e){var t,n;const r=Object.assign({},a);return r.ed25519=null!==(t=e.ed25519)&&void 0!==t?t:void 0,r.secp256k1=null!==(n=e.secp256k1)&&void 0!==n?n:void 0,r}};var s=(()=>{if(void 0!==s)return s;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw"Unable to locate global object"})();const c=s.atob||(e=>s.Buffer.from(e,"base64").toString("binary"));function u(e){const t=c(e),n=new Uint8Array(t.length);for(let e=0;es.Buffer.from(e,"binary").toString("base64"));function l(e){const t=[];for(const n of e)t.push(String.fromCharCode(n));return d(t.join(""))}i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())}).call(this,n(3))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MsgClientImpl=t.MsgUndelegateResponse=t.MsgUndelegate=t.MsgBeginRedelegateResponse=t.MsgBeginRedelegate=t.MsgDelegateResponse=t.MsgDelegate=t.MsgEditValidatorResponse=t.MsgEditValidator=t.MsgCreateValidatorResponse=t.MsgCreateValidator=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(227),s=n(9),c=n(10),u=n(27);t.protobufPackage="cosmos.staking.v1beta1";const d={minSelfDelegation:"",delegatorAddress:"",validatorAddress:""};t.MsgCreateValidator={encode:(e,t=i.default.Writer.create())=>(void 0!==e.description&&a.Description.encode(e.description,t.uint32(10).fork()).ldelim(),void 0!==e.commission&&a.CommissionRates.encode(e.commission,t.uint32(18).fork()).ldelim(),""!==e.minSelfDelegation&&t.uint32(26).string(e.minSelfDelegation),""!==e.delegatorAddress&&t.uint32(34).string(e.delegatorAddress),""!==e.validatorAddress&&t.uint32(42).string(e.validatorAddress),void 0!==e.pubkey&&s.Any.encode(e.pubkey,t.uint32(50).fork()).ldelim(),void 0!==e.value&&c.Coin.encode(e.value,t.uint32(58).fork()).ldelim(),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},d);for(;n.pos>>3){case 1:o.description=a.Description.decode(n,n.uint32());break;case 2:o.commission=a.CommissionRates.decode(n,n.uint32());break;case 3:o.minSelfDelegation=n.string();break;case 4:o.delegatorAddress=n.string();break;case 5:o.validatorAddress=n.string();break;case 6:o.pubkey=s.Any.decode(n,n.uint32());break;case 7:o.value=c.Coin.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},d);return t.description=void 0!==e.description&&null!==e.description?a.Description.fromJSON(e.description):void 0,t.commission=void 0!==e.commission&&null!==e.commission?a.CommissionRates.fromJSON(e.commission):void 0,t.minSelfDelegation=void 0!==e.minSelfDelegation&&null!==e.minSelfDelegation?String(e.minSelfDelegation):"",t.delegatorAddress=void 0!==e.delegatorAddress&&null!==e.delegatorAddress?String(e.delegatorAddress):"",t.validatorAddress=void 0!==e.validatorAddress&&null!==e.validatorAddress?String(e.validatorAddress):"",t.pubkey=void 0!==e.pubkey&&null!==e.pubkey?s.Any.fromJSON(e.pubkey):void 0,t.value=void 0!==e.value&&null!==e.value?c.Coin.fromJSON(e.value):void 0,t},toJSON(e){const t={};return void 0!==e.description&&(t.description=e.description?a.Description.toJSON(e.description):void 0),void 0!==e.commission&&(t.commission=e.commission?a.CommissionRates.toJSON(e.commission):void 0),void 0!==e.minSelfDelegation&&(t.minSelfDelegation=e.minSelfDelegation),void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),void 0!==e.pubkey&&(t.pubkey=e.pubkey?s.Any.toJSON(e.pubkey):void 0),void 0!==e.value&&(t.value=e.value?c.Coin.toJSON(e.value):void 0),t},fromPartial(e){var t,n,r;const o=Object.assign({},d);return o.description=void 0!==e.description&&null!==e.description?a.Description.fromPartial(e.description):void 0,o.commission=void 0!==e.commission&&null!==e.commission?a.CommissionRates.fromPartial(e.commission):void 0,o.minSelfDelegation=null!==(t=e.minSelfDelegation)&&void 0!==t?t:"",o.delegatorAddress=null!==(n=e.delegatorAddress)&&void 0!==n?n:"",o.validatorAddress=null!==(r=e.validatorAddress)&&void 0!==r?r:"",o.pubkey=void 0!==e.pubkey&&null!==e.pubkey?s.Any.fromPartial(e.pubkey):void 0,o.value=void 0!==e.value&&null!==e.value?c.Coin.fromPartial(e.value):void 0,o}};const l={};t.MsgCreateValidatorResponse={encode:(e,t=i.default.Writer.create())=>t,decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},l);for(;n.posObject.assign({},l),toJSON:e=>({}),fromPartial:e=>Object.assign({},l)};const f={validatorAddress:"",commissionRate:"",minSelfDelegation:""};t.MsgEditValidator={encode:(e,t=i.default.Writer.create())=>(void 0!==e.description&&a.Description.encode(e.description,t.uint32(10).fork()).ldelim(),""!==e.validatorAddress&&t.uint32(18).string(e.validatorAddress),""!==e.commissionRate&&t.uint32(26).string(e.commissionRate),""!==e.minSelfDelegation&&t.uint32(34).string(e.minSelfDelegation),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},f);for(;n.pos>>3){case 1:o.description=a.Description.decode(n,n.uint32());break;case 2:o.validatorAddress=n.string();break;case 3:o.commissionRate=n.string();break;case 4:o.minSelfDelegation=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},f);return t.description=void 0!==e.description&&null!==e.description?a.Description.fromJSON(e.description):void 0,t.validatorAddress=void 0!==e.validatorAddress&&null!==e.validatorAddress?String(e.validatorAddress):"",t.commissionRate=void 0!==e.commissionRate&&null!==e.commissionRate?String(e.commissionRate):"",t.minSelfDelegation=void 0!==e.minSelfDelegation&&null!==e.minSelfDelegation?String(e.minSelfDelegation):"",t},toJSON(e){const t={};return void 0!==e.description&&(t.description=e.description?a.Description.toJSON(e.description):void 0),void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),void 0!==e.commissionRate&&(t.commissionRate=e.commissionRate),void 0!==e.minSelfDelegation&&(t.minSelfDelegation=e.minSelfDelegation),t},fromPartial(e){var t,n,r;const o=Object.assign({},f);return o.description=void 0!==e.description&&null!==e.description?a.Description.fromPartial(e.description):void 0,o.validatorAddress=null!==(t=e.validatorAddress)&&void 0!==t?t:"",o.commissionRate=null!==(n=e.commissionRate)&&void 0!==n?n:"",o.minSelfDelegation=null!==(r=e.minSelfDelegation)&&void 0!==r?r:"",o}};const h={};t.MsgEditValidatorResponse={encode:(e,t=i.default.Writer.create())=>t,decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},h);for(;n.posObject.assign({},h),toJSON:e=>({}),fromPartial:e=>Object.assign({},h)};const p={delegatorAddress:"",validatorAddress:""};t.MsgDelegate={encode:(e,t=i.default.Writer.create())=>(""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.validatorAddress&&t.uint32(18).string(e.validatorAddress),void 0!==e.amount&&c.Coin.encode(e.amount,t.uint32(26).fork()).ldelim(),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},p);for(;n.pos>>3){case 1:o.delegatorAddress=n.string();break;case 2:o.validatorAddress=n.string();break;case 3:o.amount=c.Coin.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},p);return t.delegatorAddress=void 0!==e.delegatorAddress&&null!==e.delegatorAddress?String(e.delegatorAddress):"",t.validatorAddress=void 0!==e.validatorAddress&&null!==e.validatorAddress?String(e.validatorAddress):"",t.amount=void 0!==e.amount&&null!==e.amount?c.Coin.fromJSON(e.amount):void 0,t},toJSON(e){const t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),void 0!==e.amount&&(t.amount=e.amount?c.Coin.toJSON(e.amount):void 0),t},fromPartial(e){var t,n;const r=Object.assign({},p);return r.delegatorAddress=null!==(t=e.delegatorAddress)&&void 0!==t?t:"",r.validatorAddress=null!==(n=e.validatorAddress)&&void 0!==n?n:"",r.amount=void 0!==e.amount&&null!==e.amount?c.Coin.fromPartial(e.amount):void 0,r}};const A={};t.MsgDelegateResponse={encode:(e,t=i.default.Writer.create())=>t,decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},A);for(;n.posObject.assign({},A),toJSON:e=>({}),fromPartial:e=>Object.assign({},A)};const g={delegatorAddress:"",validatorSrcAddress:"",validatorDstAddress:""};t.MsgBeginRedelegate={encode:(e,t=i.default.Writer.create())=>(""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.validatorSrcAddress&&t.uint32(18).string(e.validatorSrcAddress),""!==e.validatorDstAddress&&t.uint32(26).string(e.validatorDstAddress),void 0!==e.amount&&c.Coin.encode(e.amount,t.uint32(34).fork()).ldelim(),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},g);for(;n.pos>>3){case 1:o.delegatorAddress=n.string();break;case 2:o.validatorSrcAddress=n.string();break;case 3:o.validatorDstAddress=n.string();break;case 4:o.amount=c.Coin.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},g);return t.delegatorAddress=void 0!==e.delegatorAddress&&null!==e.delegatorAddress?String(e.delegatorAddress):"",t.validatorSrcAddress=void 0!==e.validatorSrcAddress&&null!==e.validatorSrcAddress?String(e.validatorSrcAddress):"",t.validatorDstAddress=void 0!==e.validatorDstAddress&&null!==e.validatorDstAddress?String(e.validatorDstAddress):"",t.amount=void 0!==e.amount&&null!==e.amount?c.Coin.fromJSON(e.amount):void 0,t},toJSON(e){const t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorSrcAddress&&(t.validatorSrcAddress=e.validatorSrcAddress),void 0!==e.validatorDstAddress&&(t.validatorDstAddress=e.validatorDstAddress),void 0!==e.amount&&(t.amount=e.amount?c.Coin.toJSON(e.amount):void 0),t},fromPartial(e){var t,n,r;const o=Object.assign({},g);return o.delegatorAddress=null!==(t=e.delegatorAddress)&&void 0!==t?t:"",o.validatorSrcAddress=null!==(n=e.validatorSrcAddress)&&void 0!==n?n:"",o.validatorDstAddress=null!==(r=e.validatorDstAddress)&&void 0!==r?r:"",o.amount=void 0!==e.amount&&null!==e.amount?c.Coin.fromPartial(e.amount):void 0,o}};const m={};t.MsgBeginRedelegateResponse={encode:(e,t=i.default.Writer.create())=>(void 0!==e.completionTime&&u.Timestamp.encode(e.completionTime,t.uint32(10).fork()).ldelim(),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},m);for(;n.pos>>3){case 1:o.completionTime=u.Timestamp.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},m);return t.completionTime=void 0!==e.completionTime&&null!==e.completionTime?w(e.completionTime):void 0,t},toJSON(e){const t={};return void 0!==e.completionTime&&(t.completionTime=I(e.completionTime).toISOString()),t},fromPartial(e){const t=Object.assign({},m);return t.completionTime=void 0!==e.completionTime&&null!==e.completionTime?u.Timestamp.fromPartial(e.completionTime):void 0,t}};const v={delegatorAddress:"",validatorAddress:""};t.MsgUndelegate={encode:(e,t=i.default.Writer.create())=>(""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.validatorAddress&&t.uint32(18).string(e.validatorAddress),void 0!==e.amount&&c.Coin.encode(e.amount,t.uint32(26).fork()).ldelim(),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},v);for(;n.pos>>3){case 1:o.delegatorAddress=n.string();break;case 2:o.validatorAddress=n.string();break;case 3:o.amount=c.Coin.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},v);return t.delegatorAddress=void 0!==e.delegatorAddress&&null!==e.delegatorAddress?String(e.delegatorAddress):"",t.validatorAddress=void 0!==e.validatorAddress&&null!==e.validatorAddress?String(e.validatorAddress):"",t.amount=void 0!==e.amount&&null!==e.amount?c.Coin.fromJSON(e.amount):void 0,t},toJSON(e){const t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),void 0!==e.amount&&(t.amount=e.amount?c.Coin.toJSON(e.amount):void 0),t},fromPartial(e){var t,n;const r=Object.assign({},v);return r.delegatorAddress=null!==(t=e.delegatorAddress)&&void 0!==t?t:"",r.validatorAddress=null!==(n=e.validatorAddress)&&void 0!==n?n:"",r.amount=void 0!==e.amount&&null!==e.amount?c.Coin.fromPartial(e.amount):void 0,r}};const y={};t.MsgUndelegateResponse={encode:(e,t=i.default.Writer.create())=>(void 0!==e.completionTime&&u.Timestamp.encode(e.completionTime,t.uint32(10).fork()).ldelim(),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},y);for(;n.pos>>3){case 1:o.completionTime=u.Timestamp.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},y);return t.completionTime=void 0!==e.completionTime&&null!==e.completionTime?w(e.completionTime):void 0,t},toJSON(e){const t={};return void 0!==e.completionTime&&(t.completionTime=I(e.completionTime).toISOString()),t},fromPartial(e){const t=Object.assign({},y);return t.completionTime=void 0!==e.completionTime&&null!==e.completionTime?u.Timestamp.fromPartial(e.completionTime):void 0,t}};function b(e){var t;return{seconds:(t=e.getTime()/1e3,o.default.fromNumber(t)),nanos:e.getTime()%1e3*1e6}}function I(e){let t=1e3*e.seconds.toNumber();return t+=e.nanos/1e6,new Date(t)}function w(e){return e instanceof Date?b(e):"string"==typeof e?b(new Date(e)):u.Timestamp.fromJSON(e)}t.MsgClientImpl=class{constructor(e){this.rpc=e,this.CreateValidator=this.CreateValidator.bind(this),this.EditValidator=this.EditValidator.bind(this),this.Delegate=this.Delegate.bind(this),this.BeginRedelegate=this.BeginRedelegate.bind(this),this.Undelegate=this.Undelegate.bind(this)}CreateValidator(e){const n=t.MsgCreateValidator.encode(e).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","CreateValidator",n).then(e=>t.MsgCreateValidatorResponse.decode(new i.default.Reader(e)))}EditValidator(e){const n=t.MsgEditValidator.encode(e).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","EditValidator",n).then(e=>t.MsgEditValidatorResponse.decode(new i.default.Reader(e)))}Delegate(e){const n=t.MsgDelegate.encode(e).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","Delegate",n).then(e=>t.MsgDelegateResponse.decode(new i.default.Reader(e)))}BeginRedelegate(e){const n=t.MsgBeginRedelegate.encode(e).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","BeginRedelegate",n).then(e=>t.MsgBeginRedelegateResponse.decode(new i.default.Reader(e)))}Undelegate(e){const n=t.MsgUndelegate.encode(e).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","Undelegate",n).then(e=>t.MsgUndelegateResponse.decode(new i.default.Reader(e)))}},i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Pool=t.RedelegationResponse=t.RedelegationEntryResponse=t.DelegationResponse=t.Params=t.Redelegation=t.RedelegationEntry=t.UnbondingDelegationEntry=t.UnbondingDelegation=t.Delegation=t.DVVTriplets=t.DVVTriplet=t.DVPairs=t.DVPair=t.ValAddresses=t.Validator=t.Description=t.Commission=t.CommissionRates=t.HistoricalInfo=t.bondStatusToJSON=t.bondStatusFromJSON=t.BondStatus=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(109),s=n(27),c=n(9),u=n(55),d=n(10);var l;function f(e){switch(e){case 0:case"BOND_STATUS_UNSPECIFIED":return l.BOND_STATUS_UNSPECIFIED;case 1:case"BOND_STATUS_UNBONDED":return l.BOND_STATUS_UNBONDED;case 2:case"BOND_STATUS_UNBONDING":return l.BOND_STATUS_UNBONDING;case 3:case"BOND_STATUS_BONDED":return l.BOND_STATUS_BONDED;case-1:case"UNRECOGNIZED":default:return l.UNRECOGNIZED}}function h(e){switch(e){case l.BOND_STATUS_UNSPECIFIED:return"BOND_STATUS_UNSPECIFIED";case l.BOND_STATUS_UNBONDED:return"BOND_STATUS_UNBONDED";case l.BOND_STATUS_UNBONDING:return"BOND_STATUS_UNBONDING";case l.BOND_STATUS_BONDED:return"BOND_STATUS_BONDED";default:return"UNKNOWN"}}t.protobufPackage="cosmos.staking.v1beta1",function(e){e[e.BOND_STATUS_UNSPECIFIED=0]="BOND_STATUS_UNSPECIFIED",e[e.BOND_STATUS_UNBONDED=1]="BOND_STATUS_UNBONDED",e[e.BOND_STATUS_UNBONDING=2]="BOND_STATUS_UNBONDING",e[e.BOND_STATUS_BONDED=3]="BOND_STATUS_BONDED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(l=t.BondStatus||(t.BondStatus={})),t.bondStatusFromJSON=f,t.bondStatusToJSON=h;const p={};t.HistoricalInfo={encode(e,n=i.default.Writer.create()){void 0!==e.header&&a.Header.encode(e.header,n.uint32(10).fork()).ldelim();for(const r of e.valset)t.Validator.encode(r,n.uint32(18).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const s=Object.assign({},p);for(s.valset=[];r.pos>>3){case 1:s.header=a.Header.decode(r,r.uint32());break;case 2:s.valset.push(t.Validator.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return s},fromJSON(e){var n;const r=Object.assign({},p);return r.header=void 0!==e.header&&null!==e.header?a.Header.fromJSON(e.header):void 0,r.valset=(null!==(n=e.valset)&&void 0!==n?n:[]).map(e=>t.Validator.fromJSON(e)),r},toJSON(e){const n={};return void 0!==e.header&&(n.header=e.header?a.Header.toJSON(e.header):void 0),e.valset?n.valset=e.valset.map(e=>e?t.Validator.toJSON(e):void 0):n.valset=[],n},fromPartial(e){var n;const r=Object.assign({},p);return r.header=void 0!==e.header&&null!==e.header?a.Header.fromPartial(e.header):void 0,r.valset=(null===(n=e.valset)||void 0===n?void 0:n.map(e=>t.Validator.fromPartial(e)))||[],r}};const A={rate:"",maxRate:"",maxChangeRate:""};t.CommissionRates={encode:(e,t=i.default.Writer.create())=>(""!==e.rate&&t.uint32(10).string(e.rate),""!==e.maxRate&&t.uint32(18).string(e.maxRate),""!==e.maxChangeRate&&t.uint32(26).string(e.maxChangeRate),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},A);for(;n.pos>>3){case 1:o.rate=n.string();break;case 2:o.maxRate=n.string();break;case 3:o.maxChangeRate=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},A);return t.rate=void 0!==e.rate&&null!==e.rate?String(e.rate):"",t.maxRate=void 0!==e.maxRate&&null!==e.maxRate?String(e.maxRate):"",t.maxChangeRate=void 0!==e.maxChangeRate&&null!==e.maxChangeRate?String(e.maxChangeRate):"",t},toJSON(e){const t={};return void 0!==e.rate&&(t.rate=e.rate),void 0!==e.maxRate&&(t.maxRate=e.maxRate),void 0!==e.maxChangeRate&&(t.maxChangeRate=e.maxChangeRate),t},fromPartial(e){var t,n,r;const o=Object.assign({},A);return o.rate=null!==(t=e.rate)&&void 0!==t?t:"",o.maxRate=null!==(n=e.maxRate)&&void 0!==n?n:"",o.maxChangeRate=null!==(r=e.maxChangeRate)&&void 0!==r?r:"",o}};const g={};t.Commission={encode:(e,n=i.default.Writer.create())=>(void 0!==e.commissionRates&&t.CommissionRates.encode(e.commissionRates,n.uint32(10).fork()).ldelim(),void 0!==e.updateTime&&s.Timestamp.encode(e.updateTime,n.uint32(18).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},g);for(;r.pos>>3){case 1:a.commissionRates=t.CommissionRates.decode(r,r.uint32());break;case 2:a.updateTime=s.Timestamp.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},g);return n.commissionRates=void 0!==e.commissionRates&&null!==e.commissionRates?t.CommissionRates.fromJSON(e.commissionRates):void 0,n.updateTime=void 0!==e.updateTime&&null!==e.updateTime?N(e.updateTime):void 0,n},toJSON(e){const n={};return void 0!==e.commissionRates&&(n.commissionRates=e.commissionRates?t.CommissionRates.toJSON(e.commissionRates):void 0),void 0!==e.updateTime&&(n.updateTime=D(e.updateTime).toISOString()),n},fromPartial(e){const n=Object.assign({},g);return n.commissionRates=void 0!==e.commissionRates&&null!==e.commissionRates?t.CommissionRates.fromPartial(e.commissionRates):void 0,n.updateTime=void 0!==e.updateTime&&null!==e.updateTime?s.Timestamp.fromPartial(e.updateTime):void 0,n}};const m={moniker:"",identity:"",website:"",securityContact:"",details:""};t.Description={encode:(e,t=i.default.Writer.create())=>(""!==e.moniker&&t.uint32(10).string(e.moniker),""!==e.identity&&t.uint32(18).string(e.identity),""!==e.website&&t.uint32(26).string(e.website),""!==e.securityContact&&t.uint32(34).string(e.securityContact),""!==e.details&&t.uint32(42).string(e.details),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},m);for(;n.pos>>3){case 1:o.moniker=n.string();break;case 2:o.identity=n.string();break;case 3:o.website=n.string();break;case 4:o.securityContact=n.string();break;case 5:o.details=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},m);return t.moniker=void 0!==e.moniker&&null!==e.moniker?String(e.moniker):"",t.identity=void 0!==e.identity&&null!==e.identity?String(e.identity):"",t.website=void 0!==e.website&&null!==e.website?String(e.website):"",t.securityContact=void 0!==e.securityContact&&null!==e.securityContact?String(e.securityContact):"",t.details=void 0!==e.details&&null!==e.details?String(e.details):"",t},toJSON(e){const t={};return void 0!==e.moniker&&(t.moniker=e.moniker),void 0!==e.identity&&(t.identity=e.identity),void 0!==e.website&&(t.website=e.website),void 0!==e.securityContact&&(t.securityContact=e.securityContact),void 0!==e.details&&(t.details=e.details),t},fromPartial(e){var t,n,r,o,i;const a=Object.assign({},m);return a.moniker=null!==(t=e.moniker)&&void 0!==t?t:"",a.identity=null!==(n=e.identity)&&void 0!==n?n:"",a.website=null!==(r=e.website)&&void 0!==r?r:"",a.securityContact=null!==(o=e.securityContact)&&void 0!==o?o:"",a.details=null!==(i=e.details)&&void 0!==i?i:"",a}};const v={operatorAddress:"",jailed:!1,status:0,tokens:"",delegatorShares:"",unbondingHeight:o.default.ZERO,minSelfDelegation:""};t.Validator={encode:(e,n=i.default.Writer.create())=>(""!==e.operatorAddress&&n.uint32(10).string(e.operatorAddress),void 0!==e.consensusPubkey&&c.Any.encode(e.consensusPubkey,n.uint32(18).fork()).ldelim(),!0===e.jailed&&n.uint32(24).bool(e.jailed),0!==e.status&&n.uint32(32).int32(e.status),""!==e.tokens&&n.uint32(42).string(e.tokens),""!==e.delegatorShares&&n.uint32(50).string(e.delegatorShares),void 0!==e.description&&t.Description.encode(e.description,n.uint32(58).fork()).ldelim(),e.unbondingHeight.isZero()||n.uint32(64).int64(e.unbondingHeight),void 0!==e.unbondingTime&&s.Timestamp.encode(e.unbondingTime,n.uint32(74).fork()).ldelim(),void 0!==e.commission&&t.Commission.encode(e.commission,n.uint32(82).fork()).ldelim(),""!==e.minSelfDelegation&&n.uint32(90).string(e.minSelfDelegation),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},v);for(;r.pos>>3){case 1:a.operatorAddress=r.string();break;case 2:a.consensusPubkey=c.Any.decode(r,r.uint32());break;case 3:a.jailed=r.bool();break;case 4:a.status=r.int32();break;case 5:a.tokens=r.string();break;case 6:a.delegatorShares=r.string();break;case 7:a.description=t.Description.decode(r,r.uint32());break;case 8:a.unbondingHeight=r.int64();break;case 9:a.unbondingTime=s.Timestamp.decode(r,r.uint32());break;case 10:a.commission=t.Commission.decode(r,r.uint32());break;case 11:a.minSelfDelegation=r.string();break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},v);return n.operatorAddress=void 0!==e.operatorAddress&&null!==e.operatorAddress?String(e.operatorAddress):"",n.consensusPubkey=void 0!==e.consensusPubkey&&null!==e.consensusPubkey?c.Any.fromJSON(e.consensusPubkey):void 0,n.jailed=void 0!==e.jailed&&null!==e.jailed&&Boolean(e.jailed),n.status=void 0!==e.status&&null!==e.status?f(e.status):0,n.tokens=void 0!==e.tokens&&null!==e.tokens?String(e.tokens):"",n.delegatorShares=void 0!==e.delegatorShares&&null!==e.delegatorShares?String(e.delegatorShares):"",n.description=void 0!==e.description&&null!==e.description?t.Description.fromJSON(e.description):void 0,n.unbondingHeight=void 0!==e.unbondingHeight&&null!==e.unbondingHeight?o.default.fromString(e.unbondingHeight):o.default.ZERO,n.unbondingTime=void 0!==e.unbondingTime&&null!==e.unbondingTime?N(e.unbondingTime):void 0,n.commission=void 0!==e.commission&&null!==e.commission?t.Commission.fromJSON(e.commission):void 0,n.minSelfDelegation=void 0!==e.minSelfDelegation&&null!==e.minSelfDelegation?String(e.minSelfDelegation):"",n},toJSON(e){const n={};return void 0!==e.operatorAddress&&(n.operatorAddress=e.operatorAddress),void 0!==e.consensusPubkey&&(n.consensusPubkey=e.consensusPubkey?c.Any.toJSON(e.consensusPubkey):void 0),void 0!==e.jailed&&(n.jailed=e.jailed),void 0!==e.status&&(n.status=h(e.status)),void 0!==e.tokens&&(n.tokens=e.tokens),void 0!==e.delegatorShares&&(n.delegatorShares=e.delegatorShares),void 0!==e.description&&(n.description=e.description?t.Description.toJSON(e.description):void 0),void 0!==e.unbondingHeight&&(n.unbondingHeight=(e.unbondingHeight||o.default.ZERO).toString()),void 0!==e.unbondingTime&&(n.unbondingTime=D(e.unbondingTime).toISOString()),void 0!==e.commission&&(n.commission=e.commission?t.Commission.toJSON(e.commission):void 0),void 0!==e.minSelfDelegation&&(n.minSelfDelegation=e.minSelfDelegation),n},fromPartial(e){var n,r,i,a,u,d;const l=Object.assign({},v);return l.operatorAddress=null!==(n=e.operatorAddress)&&void 0!==n?n:"",l.consensusPubkey=void 0!==e.consensusPubkey&&null!==e.consensusPubkey?c.Any.fromPartial(e.consensusPubkey):void 0,l.jailed=null!==(r=e.jailed)&&void 0!==r&&r,l.status=null!==(i=e.status)&&void 0!==i?i:0,l.tokens=null!==(a=e.tokens)&&void 0!==a?a:"",l.delegatorShares=null!==(u=e.delegatorShares)&&void 0!==u?u:"",l.description=void 0!==e.description&&null!==e.description?t.Description.fromPartial(e.description):void 0,l.unbondingHeight=void 0!==e.unbondingHeight&&null!==e.unbondingHeight?o.default.fromValue(e.unbondingHeight):o.default.ZERO,l.unbondingTime=void 0!==e.unbondingTime&&null!==e.unbondingTime?s.Timestamp.fromPartial(e.unbondingTime):void 0,l.commission=void 0!==e.commission&&null!==e.commission?t.Commission.fromPartial(e.commission):void 0,l.minSelfDelegation=null!==(d=e.minSelfDelegation)&&void 0!==d?d:"",l}};const y={addresses:""};t.ValAddresses={encode(e,t=i.default.Writer.create()){for(const n of e.addresses)t.uint32(10).string(n);return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},y);for(o.addresses=[];n.pos>>3){case 1:o.addresses.push(n.string());break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},y);return n.addresses=(null!==(t=e.addresses)&&void 0!==t?t:[]).map(e=>String(e)),n},toJSON(e){const t={};return e.addresses?t.addresses=e.addresses.map(e=>e):t.addresses=[],t},fromPartial(e){var t;const n=Object.assign({},y);return n.addresses=(null===(t=e.addresses)||void 0===t?void 0:t.map(e=>e))||[],n}};const b={delegatorAddress:"",validatorAddress:""};t.DVPair={encode:(e,t=i.default.Writer.create())=>(""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.validatorAddress&&t.uint32(18).string(e.validatorAddress),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},b);for(;n.pos>>3){case 1:o.delegatorAddress=n.string();break;case 2:o.validatorAddress=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},b);return t.delegatorAddress=void 0!==e.delegatorAddress&&null!==e.delegatorAddress?String(e.delegatorAddress):"",t.validatorAddress=void 0!==e.validatorAddress&&null!==e.validatorAddress?String(e.validatorAddress):"",t},toJSON(e){const t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){var t,n;const r=Object.assign({},b);return r.delegatorAddress=null!==(t=e.delegatorAddress)&&void 0!==t?t:"",r.validatorAddress=null!==(n=e.validatorAddress)&&void 0!==n?n:"",r}};const I={};t.DVPairs={encode(e,n=i.default.Writer.create()){for(const r of e.pairs)t.DVPair.encode(r,n.uint32(10).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},I);for(a.pairs=[];r.pos>>3){case 1:a.pairs.push(t.DVPair.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},I);return r.pairs=(null!==(n=e.pairs)&&void 0!==n?n:[]).map(e=>t.DVPair.fromJSON(e)),r},toJSON(e){const n={};return e.pairs?n.pairs=e.pairs.map(e=>e?t.DVPair.toJSON(e):void 0):n.pairs=[],n},fromPartial(e){var n;const r=Object.assign({},I);return r.pairs=(null===(n=e.pairs)||void 0===n?void 0:n.map(e=>t.DVPair.fromPartial(e)))||[],r}};const w={delegatorAddress:"",validatorSrcAddress:"",validatorDstAddress:""};t.DVVTriplet={encode:(e,t=i.default.Writer.create())=>(""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.validatorSrcAddress&&t.uint32(18).string(e.validatorSrcAddress),""!==e.validatorDstAddress&&t.uint32(26).string(e.validatorDstAddress),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},w);for(;n.pos>>3){case 1:o.delegatorAddress=n.string();break;case 2:o.validatorSrcAddress=n.string();break;case 3:o.validatorDstAddress=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},w);return t.delegatorAddress=void 0!==e.delegatorAddress&&null!==e.delegatorAddress?String(e.delegatorAddress):"",t.validatorSrcAddress=void 0!==e.validatorSrcAddress&&null!==e.validatorSrcAddress?String(e.validatorSrcAddress):"",t.validatorDstAddress=void 0!==e.validatorDstAddress&&null!==e.validatorDstAddress?String(e.validatorDstAddress):"",t},toJSON(e){const t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorSrcAddress&&(t.validatorSrcAddress=e.validatorSrcAddress),void 0!==e.validatorDstAddress&&(t.validatorDstAddress=e.validatorDstAddress),t},fromPartial(e){var t,n,r;const o=Object.assign({},w);return o.delegatorAddress=null!==(t=e.delegatorAddress)&&void 0!==t?t:"",o.validatorSrcAddress=null!==(n=e.validatorSrcAddress)&&void 0!==n?n:"",o.validatorDstAddress=null!==(r=e.validatorDstAddress)&&void 0!==r?r:"",o}};const E={};t.DVVTriplets={encode(e,n=i.default.Writer.create()){for(const r of e.triplets)t.DVVTriplet.encode(r,n.uint32(10).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},E);for(a.triplets=[];r.pos>>3){case 1:a.triplets.push(t.DVVTriplet.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},E);return r.triplets=(null!==(n=e.triplets)&&void 0!==n?n:[]).map(e=>t.DVVTriplet.fromJSON(e)),r},toJSON(e){const n={};return e.triplets?n.triplets=e.triplets.map(e=>e?t.DVVTriplet.toJSON(e):void 0):n.triplets=[],n},fromPartial(e){var n;const r=Object.assign({},E);return r.triplets=(null===(n=e.triplets)||void 0===n?void 0:n.map(e=>t.DVVTriplet.fromPartial(e)))||[],r}};const _={delegatorAddress:"",validatorAddress:"",shares:""};t.Delegation={encode:(e,t=i.default.Writer.create())=>(""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.validatorAddress&&t.uint32(18).string(e.validatorAddress),""!==e.shares&&t.uint32(26).string(e.shares),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},_);for(;n.pos>>3){case 1:o.delegatorAddress=n.string();break;case 2:o.validatorAddress=n.string();break;case 3:o.shares=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},_);return t.delegatorAddress=void 0!==e.delegatorAddress&&null!==e.delegatorAddress?String(e.delegatorAddress):"",t.validatorAddress=void 0!==e.validatorAddress&&null!==e.validatorAddress?String(e.validatorAddress):"",t.shares=void 0!==e.shares&&null!==e.shares?String(e.shares):"",t},toJSON(e){const t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),void 0!==e.shares&&(t.shares=e.shares),t},fromPartial(e){var t,n,r;const o=Object.assign({},_);return o.delegatorAddress=null!==(t=e.delegatorAddress)&&void 0!==t?t:"",o.validatorAddress=null!==(n=e.validatorAddress)&&void 0!==n?n:"",o.shares=null!==(r=e.shares)&&void 0!==r?r:"",o}};const B={delegatorAddress:"",validatorAddress:""};t.UnbondingDelegation={encode(e,n=i.default.Writer.create()){""!==e.delegatorAddress&&n.uint32(10).string(e.delegatorAddress),""!==e.validatorAddress&&n.uint32(18).string(e.validatorAddress);for(const r of e.entries)t.UnbondingDelegationEntry.encode(r,n.uint32(26).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},B);for(a.entries=[];r.pos>>3){case 1:a.delegatorAddress=r.string();break;case 2:a.validatorAddress=r.string();break;case 3:a.entries.push(t.UnbondingDelegationEntry.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},B);return r.delegatorAddress=void 0!==e.delegatorAddress&&null!==e.delegatorAddress?String(e.delegatorAddress):"",r.validatorAddress=void 0!==e.validatorAddress&&null!==e.validatorAddress?String(e.validatorAddress):"",r.entries=(null!==(n=e.entries)&&void 0!==n?n:[]).map(e=>t.UnbondingDelegationEntry.fromJSON(e)),r},toJSON(e){const n={};return void 0!==e.delegatorAddress&&(n.delegatorAddress=e.delegatorAddress),void 0!==e.validatorAddress&&(n.validatorAddress=e.validatorAddress),e.entries?n.entries=e.entries.map(e=>e?t.UnbondingDelegationEntry.toJSON(e):void 0):n.entries=[],n},fromPartial(e){var n,r,o;const i=Object.assign({},B);return i.delegatorAddress=null!==(n=e.delegatorAddress)&&void 0!==n?n:"",i.validatorAddress=null!==(r=e.validatorAddress)&&void 0!==r?r:"",i.entries=(null===(o=e.entries)||void 0===o?void 0:o.map(e=>t.UnbondingDelegationEntry.fromPartial(e)))||[],i}};const C={creationHeight:o.default.ZERO,initialBalance:"",balance:""};t.UnbondingDelegationEntry={encode:(e,t=i.default.Writer.create())=>(e.creationHeight.isZero()||t.uint32(8).int64(e.creationHeight),void 0!==e.completionTime&&s.Timestamp.encode(e.completionTime,t.uint32(18).fork()).ldelim(),""!==e.initialBalance&&t.uint32(26).string(e.initialBalance),""!==e.balance&&t.uint32(34).string(e.balance),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},C);for(;n.pos>>3){case 1:o.creationHeight=n.int64();break;case 2:o.completionTime=s.Timestamp.decode(n,n.uint32());break;case 3:o.initialBalance=n.string();break;case 4:o.balance=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},C);return t.creationHeight=void 0!==e.creationHeight&&null!==e.creationHeight?o.default.fromString(e.creationHeight):o.default.ZERO,t.completionTime=void 0!==e.completionTime&&null!==e.completionTime?N(e.completionTime):void 0,t.initialBalance=void 0!==e.initialBalance&&null!==e.initialBalance?String(e.initialBalance):"",t.balance=void 0!==e.balance&&null!==e.balance?String(e.balance):"",t},toJSON(e){const t={};return void 0!==e.creationHeight&&(t.creationHeight=(e.creationHeight||o.default.ZERO).toString()),void 0!==e.completionTime&&(t.completionTime=D(e.completionTime).toISOString()),void 0!==e.initialBalance&&(t.initialBalance=e.initialBalance),void 0!==e.balance&&(t.balance=e.balance),t},fromPartial(e){var t,n;const r=Object.assign({},C);return r.creationHeight=void 0!==e.creationHeight&&null!==e.creationHeight?o.default.fromValue(e.creationHeight):o.default.ZERO,r.completionTime=void 0!==e.completionTime&&null!==e.completionTime?s.Timestamp.fromPartial(e.completionTime):void 0,r.initialBalance=null!==(t=e.initialBalance)&&void 0!==t?t:"",r.balance=null!==(n=e.balance)&&void 0!==n?n:"",r}};const k={creationHeight:o.default.ZERO,initialBalance:"",sharesDst:""};t.RedelegationEntry={encode:(e,t=i.default.Writer.create())=>(e.creationHeight.isZero()||t.uint32(8).int64(e.creationHeight),void 0!==e.completionTime&&s.Timestamp.encode(e.completionTime,t.uint32(18).fork()).ldelim(),""!==e.initialBalance&&t.uint32(26).string(e.initialBalance),""!==e.sharesDst&&t.uint32(34).string(e.sharesDst),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},k);for(;n.pos>>3){case 1:o.creationHeight=n.int64();break;case 2:o.completionTime=s.Timestamp.decode(n,n.uint32());break;case 3:o.initialBalance=n.string();break;case 4:o.sharesDst=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},k);return t.creationHeight=void 0!==e.creationHeight&&null!==e.creationHeight?o.default.fromString(e.creationHeight):o.default.ZERO,t.completionTime=void 0!==e.completionTime&&null!==e.completionTime?N(e.completionTime):void 0,t.initialBalance=void 0!==e.initialBalance&&null!==e.initialBalance?String(e.initialBalance):"",t.sharesDst=void 0!==e.sharesDst&&null!==e.sharesDst?String(e.sharesDst):"",t},toJSON(e){const t={};return void 0!==e.creationHeight&&(t.creationHeight=(e.creationHeight||o.default.ZERO).toString()),void 0!==e.completionTime&&(t.completionTime=D(e.completionTime).toISOString()),void 0!==e.initialBalance&&(t.initialBalance=e.initialBalance),void 0!==e.sharesDst&&(t.sharesDst=e.sharesDst),t},fromPartial(e){var t,n;const r=Object.assign({},k);return r.creationHeight=void 0!==e.creationHeight&&null!==e.creationHeight?o.default.fromValue(e.creationHeight):o.default.ZERO,r.completionTime=void 0!==e.completionTime&&null!==e.completionTime?s.Timestamp.fromPartial(e.completionTime):void 0,r.initialBalance=null!==(t=e.initialBalance)&&void 0!==t?t:"",r.sharesDst=null!==(n=e.sharesDst)&&void 0!==n?n:"",r}};const S={delegatorAddress:"",validatorSrcAddress:"",validatorDstAddress:""};t.Redelegation={encode(e,n=i.default.Writer.create()){""!==e.delegatorAddress&&n.uint32(10).string(e.delegatorAddress),""!==e.validatorSrcAddress&&n.uint32(18).string(e.validatorSrcAddress),""!==e.validatorDstAddress&&n.uint32(26).string(e.validatorDstAddress);for(const r of e.entries)t.RedelegationEntry.encode(r,n.uint32(34).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},S);for(a.entries=[];r.pos>>3){case 1:a.delegatorAddress=r.string();break;case 2:a.validatorSrcAddress=r.string();break;case 3:a.validatorDstAddress=r.string();break;case 4:a.entries.push(t.RedelegationEntry.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},S);return r.delegatorAddress=void 0!==e.delegatorAddress&&null!==e.delegatorAddress?String(e.delegatorAddress):"",r.validatorSrcAddress=void 0!==e.validatorSrcAddress&&null!==e.validatorSrcAddress?String(e.validatorSrcAddress):"",r.validatorDstAddress=void 0!==e.validatorDstAddress&&null!==e.validatorDstAddress?String(e.validatorDstAddress):"",r.entries=(null!==(n=e.entries)&&void 0!==n?n:[]).map(e=>t.RedelegationEntry.fromJSON(e)),r},toJSON(e){const n={};return void 0!==e.delegatorAddress&&(n.delegatorAddress=e.delegatorAddress),void 0!==e.validatorSrcAddress&&(n.validatorSrcAddress=e.validatorSrcAddress),void 0!==e.validatorDstAddress&&(n.validatorDstAddress=e.validatorDstAddress),e.entries?n.entries=e.entries.map(e=>e?t.RedelegationEntry.toJSON(e):void 0):n.entries=[],n},fromPartial(e){var n,r,o,i;const a=Object.assign({},S);return a.delegatorAddress=null!==(n=e.delegatorAddress)&&void 0!==n?n:"",a.validatorSrcAddress=null!==(r=e.validatorSrcAddress)&&void 0!==r?r:"",a.validatorDstAddress=null!==(o=e.validatorDstAddress)&&void 0!==o?o:"",a.entries=(null===(i=e.entries)||void 0===i?void 0:i.map(e=>t.RedelegationEntry.fromPartial(e)))||[],a}};const O={maxValidators:0,maxEntries:0,historicalEntries:0,bondDenom:""};t.Params={encode:(e,t=i.default.Writer.create())=>(void 0!==e.unbondingTime&&u.Duration.encode(e.unbondingTime,t.uint32(10).fork()).ldelim(),0!==e.maxValidators&&t.uint32(16).uint32(e.maxValidators),0!==e.maxEntries&&t.uint32(24).uint32(e.maxEntries),0!==e.historicalEntries&&t.uint32(32).uint32(e.historicalEntries),""!==e.bondDenom&&t.uint32(42).string(e.bondDenom),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},O);for(;n.pos>>3){case 1:o.unbondingTime=u.Duration.decode(n,n.uint32());break;case 2:o.maxValidators=n.uint32();break;case 3:o.maxEntries=n.uint32();break;case 4:o.historicalEntries=n.uint32();break;case 5:o.bondDenom=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},O);return t.unbondingTime=void 0!==e.unbondingTime&&null!==e.unbondingTime?u.Duration.fromJSON(e.unbondingTime):void 0,t.maxValidators=void 0!==e.maxValidators&&null!==e.maxValidators?Number(e.maxValidators):0,t.maxEntries=void 0!==e.maxEntries&&null!==e.maxEntries?Number(e.maxEntries):0,t.historicalEntries=void 0!==e.historicalEntries&&null!==e.historicalEntries?Number(e.historicalEntries):0,t.bondDenom=void 0!==e.bondDenom&&null!==e.bondDenom?String(e.bondDenom):"",t},toJSON(e){const t={};return void 0!==e.unbondingTime&&(t.unbondingTime=e.unbondingTime?u.Duration.toJSON(e.unbondingTime):void 0),void 0!==e.maxValidators&&(t.maxValidators=e.maxValidators),void 0!==e.maxEntries&&(t.maxEntries=e.maxEntries),void 0!==e.historicalEntries&&(t.historicalEntries=e.historicalEntries),void 0!==e.bondDenom&&(t.bondDenom=e.bondDenom),t},fromPartial(e){var t,n,r,o;const i=Object.assign({},O);return i.unbondingTime=void 0!==e.unbondingTime&&null!==e.unbondingTime?u.Duration.fromPartial(e.unbondingTime):void 0,i.maxValidators=null!==(t=e.maxValidators)&&void 0!==t?t:0,i.maxEntries=null!==(n=e.maxEntries)&&void 0!==n?n:0,i.historicalEntries=null!==(r=e.historicalEntries)&&void 0!==r?r:0,i.bondDenom=null!==(o=e.bondDenom)&&void 0!==o?o:"",i}};const Q={};t.DelegationResponse={encode:(e,n=i.default.Writer.create())=>(void 0!==e.delegation&&t.Delegation.encode(e.delegation,n.uint32(10).fork()).ldelim(),void 0!==e.balance&&d.Coin.encode(e.balance,n.uint32(18).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},Q);for(;r.pos>>3){case 1:a.delegation=t.Delegation.decode(r,r.uint32());break;case 2:a.balance=d.Coin.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},Q);return n.delegation=void 0!==e.delegation&&null!==e.delegation?t.Delegation.fromJSON(e.delegation):void 0,n.balance=void 0!==e.balance&&null!==e.balance?d.Coin.fromJSON(e.balance):void 0,n},toJSON(e){const n={};return void 0!==e.delegation&&(n.delegation=e.delegation?t.Delegation.toJSON(e.delegation):void 0),void 0!==e.balance&&(n.balance=e.balance?d.Coin.toJSON(e.balance):void 0),n},fromPartial(e){const n=Object.assign({},Q);return n.delegation=void 0!==e.delegation&&null!==e.delegation?t.Delegation.fromPartial(e.delegation):void 0,n.balance=void 0!==e.balance&&null!==e.balance?d.Coin.fromPartial(e.balance):void 0,n}};const P={balance:""};t.RedelegationEntryResponse={encode:(e,n=i.default.Writer.create())=>(void 0!==e.redelegationEntry&&t.RedelegationEntry.encode(e.redelegationEntry,n.uint32(10).fork()).ldelim(),""!==e.balance&&n.uint32(34).string(e.balance),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},P);for(;r.pos>>3){case 1:a.redelegationEntry=t.RedelegationEntry.decode(r,r.uint32());break;case 4:a.balance=r.string();break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},P);return n.redelegationEntry=void 0!==e.redelegationEntry&&null!==e.redelegationEntry?t.RedelegationEntry.fromJSON(e.redelegationEntry):void 0,n.balance=void 0!==e.balance&&null!==e.balance?String(e.balance):"",n},toJSON(e){const n={};return void 0!==e.redelegationEntry&&(n.redelegationEntry=e.redelegationEntry?t.RedelegationEntry.toJSON(e.redelegationEntry):void 0),void 0!==e.balance&&(n.balance=e.balance),n},fromPartial(e){var n;const r=Object.assign({},P);return r.redelegationEntry=void 0!==e.redelegationEntry&&null!==e.redelegationEntry?t.RedelegationEntry.fromPartial(e.redelegationEntry):void 0,r.balance=null!==(n=e.balance)&&void 0!==n?n:"",r}};const R={};t.RedelegationResponse={encode(e,n=i.default.Writer.create()){void 0!==e.redelegation&&t.Redelegation.encode(e.redelegation,n.uint32(10).fork()).ldelim();for(const r of e.entries)t.RedelegationEntryResponse.encode(r,n.uint32(18).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},R);for(a.entries=[];r.pos>>3){case 1:a.redelegation=t.Redelegation.decode(r,r.uint32());break;case 2:a.entries.push(t.RedelegationEntryResponse.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},R);return r.redelegation=void 0!==e.redelegation&&null!==e.redelegation?t.Redelegation.fromJSON(e.redelegation):void 0,r.entries=(null!==(n=e.entries)&&void 0!==n?n:[]).map(e=>t.RedelegationEntryResponse.fromJSON(e)),r},toJSON(e){const n={};return void 0!==e.redelegation&&(n.redelegation=e.redelegation?t.Redelegation.toJSON(e.redelegation):void 0),e.entries?n.entries=e.entries.map(e=>e?t.RedelegationEntryResponse.toJSON(e):void 0):n.entries=[],n},fromPartial(e){var n;const r=Object.assign({},R);return r.redelegation=void 0!==e.redelegation&&null!==e.redelegation?t.Redelegation.fromPartial(e.redelegation):void 0,r.entries=(null===(n=e.entries)||void 0===n?void 0:n.map(e=>t.RedelegationEntryResponse.fromPartial(e)))||[],r}};const M={notBondedTokens:"",bondedTokens:""};function x(e){var t;return{seconds:(t=e.getTime()/1e3,o.default.fromNumber(t)),nanos:e.getTime()%1e3*1e6}}function D(e){let t=1e3*e.seconds.toNumber();return t+=e.nanos/1e6,new Date(t)}function N(e){return e instanceof Date?x(e):"string"==typeof e?x(new Date(e)):s.Timestamp.fromJSON(e)}t.Pool={encode:(e,t=i.default.Writer.create())=>(""!==e.notBondedTokens&&t.uint32(10).string(e.notBondedTokens),""!==e.bondedTokens&&t.uint32(18).string(e.bondedTokens),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},M);for(;n.pos>>3){case 1:o.notBondedTokens=n.string();break;case 2:o.bondedTokens=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},M);return t.notBondedTokens=void 0!==e.notBondedTokens&&null!==e.notBondedTokens?String(e.notBondedTokens):"",t.bondedTokens=void 0!==e.bondedTokens&&null!==e.bondedTokens?String(e.bondedTokens):"",t},toJSON(e){const t={};return void 0!==e.notBondedTokens&&(t.notBondedTokens=e.notBondedTokens),void 0!==e.bondedTokens&&(t.bondedTokens=e.bondedTokens),t},fromPartial(e){var t,n;const r=Object.assign({},M);return r.notBondedTokens=null!==(t=e.notBondedTokens)&&void 0!==t?t:"",r.bondedTokens=null!==(n=e.bondedTokens)&&void 0!==n?n:"",r}},i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSearchByTagsQuery=t.isSearchBySentFromOrToQuery=t.isSearchByHeightQuery=void 0,t.isSearchByHeightQuery=function(e){return void 0!==e.height},t.isSearchBySentFromOrToQuery=function(e){return void 0!==e.sentFromOrTo},t.isSearchByTagsQuery=function(e){return void 0!==e.tags}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.BlockIdFlag=t.Tendermint34Client=t.tendermint34=t.VoteType=t.SubscriptionEventType=t.Method=t.broadcastTxSyncSuccess=t.broadcastTxCommitSuccess=t.WebsocketClient=t.HttpClient=t.toSeconds=t.toRfc3339WithNanoseconds=t.fromSeconds=t.fromRfc3339WithNanoseconds=t.DateTime=t.rawSecp256k1PubkeyToRawAddress=t.rawEd25519PubkeyToRawAddress=t.pubkeyToRawAddress=t.pubkeyToAddress=void 0;var a=n(559);Object.defineProperty(t,"pubkeyToAddress",{enumerable:!0,get:function(){return a.pubkeyToAddress}}),Object.defineProperty(t,"pubkeyToRawAddress",{enumerable:!0,get:function(){return a.pubkeyToRawAddress}}),Object.defineProperty(t,"rawEd25519PubkeyToRawAddress",{enumerable:!0,get:function(){return a.rawEd25519PubkeyToRawAddress}}),Object.defineProperty(t,"rawSecp256k1PubkeyToRawAddress",{enumerable:!0,get:function(){return a.rawSecp256k1PubkeyToRawAddress}});var s=n(230);Object.defineProperty(t,"DateTime",{enumerable:!0,get:function(){return s.DateTime}}),Object.defineProperty(t,"fromRfc3339WithNanoseconds",{enumerable:!0,get:function(){return s.fromRfc3339WithNanoseconds}}),Object.defineProperty(t,"fromSeconds",{enumerable:!0,get:function(){return s.fromSeconds}}),Object.defineProperty(t,"toRfc3339WithNanoseconds",{enumerable:!0,get:function(){return s.toRfc3339WithNanoseconds}}),Object.defineProperty(t,"toSeconds",{enumerable:!0,get:function(){return s.toSeconds}});var c=n(231);Object.defineProperty(t,"HttpClient",{enumerable:!0,get:function(){return c.HttpClient}}),Object.defineProperty(t,"WebsocketClient",{enumerable:!0,get:function(){return c.WebsocketClient}});var u=n(112);Object.defineProperty(t,"broadcastTxCommitSuccess",{enumerable:!0,get:function(){return u.broadcastTxCommitSuccess}}),Object.defineProperty(t,"broadcastTxSyncSuccess",{enumerable:!0,get:function(){return u.broadcastTxSyncSuccess}}),Object.defineProperty(t,"Method",{enumerable:!0,get:function(){return u.Method}}),Object.defineProperty(t,"SubscriptionEventType",{enumerable:!0,get:function(){return u.SubscriptionEventType}}),Object.defineProperty(t,"VoteType",{enumerable:!0,get:function(){return u.VoteType}}),t.tendermint34=i(n(112));var d=n(112);Object.defineProperty(t,"Tendermint34Client",{enumerable:!0,get:function(){return d.Tendermint34Client}});var l=n(247);Object.defineProperty(t,"BlockIdFlag",{enumerable:!0,get:function(){return l.BlockIdFlag}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DateTime=t.toSeconds=t.fromSeconds=t.toRfc3339WithNanoseconds=t.fromRfc3339WithNanoseconds=void 0;const r=n(5),o=n(11);function i(e){const t=(0,r.fromRfc3339)(e),n=e.match(/\.(\d+)Z$/),o=n?n[1].slice(3):"";return t.nanoseconds=parseInt(o.padEnd(6,"0"),10),t}function a(e){var t,n;const r=e.toISOString(),o=null!==(n=null===(t=e.nanoseconds)||void 0===t?void 0:t.toString())&&void 0!==n?n:"";return`${r.slice(0,-1)}${o.padStart(6,"0")}Z`}t.fromRfc3339WithNanoseconds=i,t.toRfc3339WithNanoseconds=a,t.fromSeconds=function(e,t=0){const n=new o.Uint32(t).toNumber();if(n>999999999)throw new Error("Nano seconds must not exceed 999999999");const r=new Date(1e3*e+Math.floor(n/1e6));return r.nanoseconds=n%1e6,r},t.toSeconds=function(e){var t;return{seconds:Math.floor(e.getTime()/1e3),nanos:e.getTime()%1e3*1e6+(null!==(t=e.nanoseconds)&&void 0!==t?t:0)}};t.DateTime=class{static decode(e){return i(e)}static encode(e){return a(e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebsocketClient=t.instanceOfRpcStreamingClient=t.HttpClient=void 0;var r=n(560);Object.defineProperty(t,"HttpClient",{enumerable:!0,get:function(){return r.HttpClient}});var o=n(111);Object.defineProperty(t,"instanceOfRpcStreamingClient",{enumerable:!0,get:function(){return o.instanceOfRpcStreamingClient}});var i=n(584);Object.defineProperty(t,"WebsocketClient",{enumerable:!0,get:function(){return i.WebsocketClient}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.jsonRpcCode=t.isJsonRpcSuccessResponse=t.isJsonRpcErrorResponse=t.parseJsonRpcSuccessResponse=t.parseJsonRpcResponse=t.parseJsonRpcRequest=t.parseJsonRpcId=t.parseJsonRpcErrorResponse=t.JsonRpcClient=t.makeJsonRpcId=void 0;var r=n(561);Object.defineProperty(t,"makeJsonRpcId",{enumerable:!0,get:function(){return r.makeJsonRpcId}});var o=n(562);Object.defineProperty(t,"JsonRpcClient",{enumerable:!0,get:function(){return o.JsonRpcClient}});var i=n(563);Object.defineProperty(t,"parseJsonRpcErrorResponse",{enumerable:!0,get:function(){return i.parseJsonRpcErrorResponse}}),Object.defineProperty(t,"parseJsonRpcId",{enumerable:!0,get:function(){return i.parseJsonRpcId}}),Object.defineProperty(t,"parseJsonRpcRequest",{enumerable:!0,get:function(){return i.parseJsonRpcRequest}}),Object.defineProperty(t,"parseJsonRpcResponse",{enumerable:!0,get:function(){return i.parseJsonRpcResponse}}),Object.defineProperty(t,"parseJsonRpcSuccessResponse",{enumerable:!0,get:function(){return i.parseJsonRpcSuccessResponse}});var a=n(233);Object.defineProperty(t,"isJsonRpcErrorResponse",{enumerable:!0,get:function(){return a.isJsonRpcErrorResponse}}),Object.defineProperty(t,"isJsonRpcSuccessResponse",{enumerable:!0,get:function(){return a.isJsonRpcSuccessResponse}}),Object.defineProperty(t,"jsonRpcCode",{enumerable:!0,get:function(){return a.jsonRpcCode}})},function(e,t,n){"use strict";function r(e){return"object"==typeof e.error}Object.defineProperty(t,"__esModule",{value:!0}),t.jsonRpcCode=t.isJsonRpcSuccessResponse=t.isJsonRpcErrorResponse=void 0,t.isJsonRpcErrorResponse=r,t.isJsonRpcSuccessResponse=function(e){return!r(e)},t.jsonRpcCode={parseError:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internalError:-32603,serverError:{default:-32e3}}},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;rthis.eventProducerListener=e,stop:()=>this.eventProducerListener=void 0};this.events=o.Stream.create(s),this.connectionStatusProducer=new r.DefaultValueProducer(a.Unconnected),this.connectionStatus=new r.ValueAndUpdates(this.connectionStatusProducer),this.socket=new i.StreamingSocket(this.url,this.timeout),this.socket.events.subscribe({next:e=>{if(!this.eventProducerListener)throw new Error("No event producer listener set");this.eventProducerListener.next(e)},error:()=>this.connectionStatusProducer.update(a.Disconnected)})}connect(){this.connectionStatusProducer.update(a.Connecting),this.socket.connected.then(async()=>(this.connectionStatusProducer.update(a.Connected),this.processQueue()),()=>this.connectionStatusProducer.update(a.Disconnected)),this.socket.connect()}disconnect(){this.connectionStatusProducer.update(a.Disconnected),this.socket.disconnect()}reconnect(){this.socket=new i.StreamingSocket(this.url,this.timeout),this.socket.events.subscribe({next:e=>{if(!this.eventProducerListener)throw new Error("No event producer listener set");this.eventProducerListener.next(e)},error:()=>this.connectionStatusProducer.update(a.Disconnected)}),this.socket.connected.then(()=>{this.reconnectedHandler&&this.reconnectedHandler()}),this.connect()}getQueueLength(){return this.queue.length}queueRequest(e){this.queue.push(e),this.processQueue()}async processQueue(){if(this.isProcessingQueue||this.connectionStatus.value!==a.Connected)return;let e;for(this.isProcessingQueue=!0;e=this.queue.shift();)try{await this.socket.send(e),this.isProcessingQueue=!1}catch(t){return this.queue.unshift(e),void(this.isProcessingQueue=!1)}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StreamingSocket=void 0;const r=n(37),o=n(244);t.StreamingSocket=class{constructor(e,t=1e4){this.socket=new o.SocketWrapper(e,e=>{this.eventProducerListener&&this.eventProducerListener.next(e)},e=>{this.eventProducerListener&&this.eventProducerListener.error(e)},()=>{},e=>{this.eventProducerListener&&(e.wasClean?this.eventProducerListener.complete():this.eventProducerListener.error("Socket was closed unclean"))},t),this.connected=this.socket.connected;const n={start:e=>this.eventProducerListener=e,stop:()=>this.eventProducerListener=void 0};this.events=r.Stream.create(n)}connect(){this.socket.connect()}disconnect(){this.socket.disconnect()}async send(e){return this.socket.send(e)}}},function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SocketWrapper=void 0;const o=r(n(586));t.SocketWrapper=class{constructor(e,t,n,r,o,i=1e4){this.closed=!1,this.connected=new Promise((e,t)=>{this.connectedResolver=e,this.connectedRejecter=t}),this.url=e,this.messageHandler=t,this.errorHandler=n,this.openHandler=r,this.closeHandler=o,this.timeout=i}connect(){const e=new o.default(this.url);e.onerror=e=>{this.clearTimeout(),this.errorHandler&&this.errorHandler(e)},e.onmessage=e=>{this.messageHandler({type:e.type,data:e.data})},e.onopen=e=>{this.clearTimeout(),this.connectedResolver(),this.openHandler&&this.openHandler()},e.onclose=e=>{this.closed=!0,this.closeHandler&&this.closeHandler(e)};const t=Date.now();this.timeoutId=setTimeout(()=>{e.onmessage=()=>0,e.onerror=()=>0,e.onopen=()=>0,e.onclose=()=>0,e.close(),this.socket=void 0;const n=Math.floor(Date.now()-t);this.connectedRejecter(`Connection attempt timed out after ${n} ms`)},this.timeout),this.socket=e}disconnect(){if(!this.socket)throw new Error("Socket undefined. This must be called after connecting.");switch(this.clearTimeout(),this.socket.readyState){case o.default.OPEN:this.socket.close(1e3);break;case o.default.CLOSED:break;case o.default.CONNECTING:this.socket.onopen=()=>0,this.socket.onclose=()=>0,this.socket.onerror=()=>0,this.socket.onmessage=()=>0,this.socket=void 0,this.closeHandler&&this.closeHandler({wasClean:!1,code:4001});break;case o.default.CLOSING:break;default:throw new Error("Unknown readyState: "+this.socket.readyState)}}async send(t){return new Promise((n,r)=>{if(!this.socket)throw new Error("Socket undefined. This must be called after connecting.");if(this.closed)throw new Error("Socket was closed, so no data can be sent anymore.");if(this.socket.readyState!==o.default.OPEN)throw new Error("Websocket is not open");void 0!==e&&void 0!==e.versions&&void 0!==e.versions.node?this.socket.send(t,e=>e?r(e):n()):(this.socket.send(t),n())})}clearTimeout(){if(!this.timeoutId)throw new Error("Timeout ID not set. This should not happen and usually means connect() was not called.");clearTimeout(this.timeoutId)}}}).call(this,n(6))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createJsonRpcRequest=void 0;function r(){return parseInt(Array.from({length:12}).map(()=>"123456789"[Math.floor(Math.random()*"123456789".length)]).join(""),10)}t.createJsonRpcRequest=function(e,t){const n=t?{...t}:{};return{jsonrpc:"2.0",id:r(),method:e,params:n}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hashBlock=t.hashTx=void 0;const r=n(20),o=n(114);function i(e){switch(e.length){case 0:throw new Error("Cannot hash empty tree");case 1:return function(e){const t=new r.Sha256(Uint8Array.from([0]));return t.update(e),t.digest()}(e[0]);default:{const t=function(e){if(e<1)throw new Error("Cannot split an empty tree");const t=2**Math.floor(Math.log2(e));return t((0,s.assert)(t.balance),null!==e?(0,r.addCoins)(e,t.balance):t.balance),null)}async getDelegation(e,t){var n;let r;try{r=null===(n=(await this.forceGetQueryClient().staking.delegation(e,t)).delegationResponse)||void 0===n?void 0:n.balance}catch(e){if(!e.toString().includes("key not found"))throw e}return r||null}async getTx(e){var t;return null!==(t=(await this.txsQuery(`tx.hash='${e}'`))[0])&&void 0!==t?t:null}async searchTx(e,t={}){const n=t.minHeight||0,r=t.maxHeight||Number.MAX_SAFE_INTEGER;if(r=${n} AND tx.height<=${r}`}let i;if((0,l.isSearchByHeightQuery)(e))i=e.height>=n&&e.height<=r?await this.txsQuery("tx.height="+e.height):[];else if((0,l.isSearchBySentFromOrToQuery)(e)){const t=o(`message.module='bank' AND transfer.sender='${e.sentFromOrTo}'`),n=o(`message.module='bank' AND transfer.recipient='${e.sentFromOrTo}'`),[r,a]=await Promise.all([t,n].map(e=>this.txsQuery(e))),s=r.map(e=>e.hash);i=[...r,...a.filter(e=>!s.includes(e.hash))]}else{if(!(0,l.isSearchByTagsQuery)(e))throw new Error("Unknown query type");{const t=o(e.tags.map(e=>`${e.key}='${e.value}'`).join(" AND "));i=await this.txsQuery(t)}}return i.filter(e=>e.height>=n&&e.height<=r)}disconnect(){this.tmClient&&this.tmClient.disconnect()}async broadcastTx(e,t=6e4,n=3e3){let r=!1;const i=setTimeout(()=>{r=!0},t),a=async e=>{if(r)throw new f(`Transaction with ID ${e} was submitted but was not yet found on the chain. You might want to check later. There was a wait of ${t/1e3} seconds.`,e);await(0,s.sleep)(n);const o=await this.getTx(e);return o?{code:o.code,height:o.height,rawLog:o.rawLog,transactionHash:e,gasUsed:o.gasUsed,gasWanted:o.gasWanted}:a(e)},c=await this.forceGetTmClient().broadcastTxSync({tx:e});if(c.code)return Promise.reject(new Error(`Broadcasting transaction failed with code ${c.code} (codespace: ${c.codeSpace}). Log: ${c.log}`));const u=(0,o.toHex)(c.hash).toUpperCase();return new Promise((e,t)=>a(u).then(t=>{clearTimeout(i),e(t)},e=>{clearTimeout(i),t(e)}))}async txsQuery(e){return(await this.forceGetTmClient().txSearchAll({query:e})).txs.map(e=>({height:e.height,hash:(0,o.toHex)(e.hash).toUpperCase(),code:e.result.code,rawLog:e.result.log||"",tx:e.tx,gasUsed:e.result.gasUsed,gasWanted:e.result.gasWanted}))}}t.StargateClient=A},function(e,t,n){e.exports=n(593)},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){c.headers[e]=r.merge(i)})),e.exports=c}).call(this,n(6))},function(e,t,n){"use strict";var r=n(15),o=n(599),i=n(251),a=n(601),s=n(604),c=n(605),u=n(255);e.exports=function(e){return new Promise((function(t,d){var l=e.data,f=e.headers;r.isFormData(l)&&delete f["Content-Type"];var h=new XMLHttpRequest;if(e.auth){var p=e.auth.username||"",A=e.auth.password||"";f.Authorization="Basic "+btoa(p+":"+A)}var g=a(e.baseURL,e.url);if(h.open(e.method.toUpperCase(),i(g,e.params,e.paramsSerializer),!0),h.timeout=e.timeout,h.onreadystatechange=function(){if(h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in h?s(h.getAllResponseHeaders()):null,r={data:e.responseType&&"text"!==e.responseType?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:e,request:h};o(t,d,r),h=null}},h.onabort=function(){h&&(d(u("Request aborted",e,"ECONNABORTED",h)),h=null)},h.onerror=function(){d(u("Network Error",e,null,h)),h=null},h.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),d(u(t,e,"ECONNABORTED",h)),h=null},r.isStandardBrowserEnv()){var m=n(606),v=(e.withCredentials||c(g))&&e.xsrfCookieName?m.read(e.xsrfCookieName):void 0;v&&(f[e.xsrfHeaderName]=v)}if("setRequestHeader"in h&&r.forEach(f,(function(e,t){void 0===l&&"content-type"===t.toLowerCase()?delete f[t]:h.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(h.withCredentials=!!e.withCredentials),e.responseType)try{h.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&h.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){h&&(h.abort(),d(e),h=null)})),void 0===l&&(l=null),h.send(l)}))}},function(e,t,n){"use strict";var r=n(600);e.exports=function(e,t,n,o,i){var a=new Error(e);return r(a,t,n,o,i)}},function(e,t,n){"use strict";var r=n(15);e.exports=function(e,t){t=t||{};var n={},o=["url","method","params","data"],i=["headers","auth","proxy"],a=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];r.forEach(o,(function(e){void 0!==t[e]&&(n[e]=t[e])})),r.forEach(i,(function(o){r.isObject(t[o])?n[o]=r.deepMerge(e[o],t[o]):void 0!==t[o]?n[o]=t[o]:r.isObject(e[o])?n[o]=r.deepMerge(e[o]):void 0!==e[o]&&(n[o]=e[o])})),r.forEach(a,(function(r){void 0!==t[r]?n[r]=t[r]:void 0!==e[r]&&(n[r]=e[r])}));var s=o.concat(i).concat(a),c=Object.keys(t).filter((function(e){return-1===s.indexOf(e)}));return r.forEach(c,(function(r){void 0!==t[r]?n[r]=t[r]:void 0!==e[r]&&(n[r]=e[r])})),n}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){"use strict";n.r(t);n(34),n(207);var r=n(72),o=n(115),i=n.n(o),a=n(116),s=n.n(a),c=n(16),u=n.n(c);const{SigningCosmosClient:d}=n(73);window.jQuery=u.a,window.$=u.a,u()(document).ready((function(){u()('input[name="get_chain"]').click((function(){u()(this).is(":checked")&&i.a.addKeplrChain(u()(this).val()).then((function(e){!async function(e){u()("#address").last().html(e.accounts[0].address),u()("#viewDenom").last().html(e.foundChain.coinLookup.viewDenom),u()("#inputAddress").val(e.accounts[0].address)}(e),console.log(e)}),(function(e){console.log(e)}))}))})),u()(document).ready((function(){u()("form").submit((async function(e){let t=document.sendForm.recipient.value,n=document.sendForm.amount.value,r=document.sendForm.get_chain.value,o=document.sendForm.order_id.value,i=document.sendForm.memo.value;s.a.sendByChain(r,t,n,o,i,u.a),e.preventDefault()}))})),t.default={initConfig:r.default,initsend:s(),initKeplr:i()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayContentEquals=void 0,t.arrayContentEquals=function(e,t){if(e.length!==t.length)return!1;for(let n=0;nsetTimeout(t,e))}},function(e,t,n){"use strict";(function(e){function n(e){return"object"==typeof e&&null!==e}Object.defineProperty(t,"__esModule",{value:!0}),t.isUint8Array=t.isNonNullObject=void 0,t.isNonNullObject=n,t.isUint8Array=function(t){return!!n(t)&&("[object Uint8Array]"===Object.prototype.toString.call(t)&&(void 0===e||void 0===e.isBuffer||!e.isBuffer(t)))}}).call(this,n(7).Buffer)},function(e,t){ +/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const r=n(453);t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");const o=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));t.bytesToHex=function(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let n=0;n{},t.asyncLoop=async function(e,n,r){let o=Date.now();for(let i=0;i=0&&ee instanceof Uint8Array))throw new Error("Uint8Array list expected");if(1===e.length)return e[0];const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);for(let t=0,r=0;te().update(a(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,n)=>e(n).update(a(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(r.crypto.web)return r.crypto.web.getRandomValues(new Uint8Array(e));if(r.crypto.node)return new Uint8Array(r.crypto.node.randomBytes(e).buffer);throw new Error("The environment doesn't have randomBytes function")}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.NO_IL=t.NO=t.MemoryStream=t.Stream=void 0;var i=n(484),a=n(486),s=i.default(a.getPolyfill()),c={};function u(){}function d(e){for(var t=e.length,n=Array(t),r=0;r=this.max&&t._n(e)},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),B=function(){function e(e,t){this.out=e,this.op=t}return e.prototype._n=function(){this.op.end()},e.prototype._e=function(e){this.out._e(e)},e.prototype._c=function(){this.op.end()},e}(),C=function(){function e(e,t){this.type="endWhen",this.ins=t,this.out=c,this.o=e,this.oil=f}return e.prototype._start=function(e){this.out=e,this.o._add(this.oil=new B(e,this)),this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.o._remove(this.oil),this.out=c,this.oil=f},e.prototype.end=function(){var e=this.out;e!==c&&e._c()},e.prototype._n=function(e){var t=this.out;t!==c&&t._n(e)},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){this.end()},e}(),k=function(){function e(e,t){this.type="filter",this.ins=t,this.out=c,this.f=e}return e.prototype._start=function(e){this.out=e,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c},e.prototype._n=function(e){var t=this.out;if(t!==c){var n=l(this,e,t);n!==c&&n&&t._n(e)}},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),S=function(){function e(e,t){this.out=e,this.op=t}return e.prototype._n=function(e){this.out._n(e)},e.prototype._e=function(e){this.out._e(e)},e.prototype._c=function(){this.op.inner=c,this.op.less()},e}(),O=function(){function e(e){this.type="flatten",this.ins=e,this.out=c,this.open=!0,this.inner=c,this.il=f}return e.prototype._start=function(e){this.out=e,this.open=!0,this.inner=c,this.il=f,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.inner!==c&&this.inner._remove(this.il),this.out=c,this.open=!0,this.inner=c,this.il=f},e.prototype.less=function(){var e=this.out;e!==c&&(this.open||this.inner!==c||e._c())},e.prototype._n=function(e){var t=this.out;if(t!==c){var n=this.inner,r=this.il;n!==c&&r!==f&&n._remove(r),(this.inner=e)._add(this.il=new S(t,this))}},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){this.open=!1,this.less()},e}(),Q=function(){function e(e,t,n){var r=this;this.type="fold",this.ins=n,this.out=c,this.f=function(t){return e(r.acc,t)},this.acc=this.seed=t}return e.prototype._start=function(e){this.out=e,this.acc=this.seed,e._n(this.acc),this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c,this.acc=this.seed},e.prototype._n=function(e){var t=this.out;if(t!==c){var n=l(this,e,t);n!==c&&t._n(this.acc=n)}},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),P=function(){function e(e){this.type="last",this.ins=e,this.out=c,this.has=!1,this.val=c}return e.prototype._start=function(e){this.out=e,this.has=!1,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c,this.val=c},e.prototype._n=function(e){this.has=!0,this.val=e},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&(this.has?(e._n(this.val),e._c()):e._e(new Error("last() failed because input stream completed")))},e}(),R=function(){function e(e,t){this.type="map",this.ins=t,this.out=c,this.f=e}return e.prototype._start=function(e){this.out=e,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c},e.prototype._n=function(e){var t=this.out;if(t!==c){var n=l(this,e,t);n!==c&&t._n(n)}},e.prototype._e=function(e){var t=this.out;t!==c&&t._e(e)},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),M=function(){function e(e){this.type="remember",this.ins=e,this.out=c}return e.prototype._start=function(e){this.out=e,this.ins._add(e)},e.prototype._stop=function(){this.ins._remove(this.out),this.out=c},e}(),x=function(){function e(e,t){this.type="replaceError",this.ins=t,this.out=c,this.f=e}return e.prototype._start=function(e){this.out=e,this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c},e.prototype._n=function(e){var t=this.out;t!==c&&t._n(e)},e.prototype._e=function(e){var t=this.out;if(t!==c)try{this.ins._remove(this),(this.ins=this.f(e))._add(this)}catch(e){t._e(e)}},e.prototype._c=function(){var e=this.out;e!==c&&e._c()},e}(),D=function(){function e(e,t){this.type="startWith",this.ins=e,this.out=c,this.val=t}return e.prototype._start=function(e){this.out=e,this.out._n(this.val),this.ins._add(e)},e.prototype._stop=function(){this.ins._remove(this.out),this.out=c},e}(),N=function(){function e(e,t){this.type="take",this.ins=t,this.out=c,this.max=e,this.taken=0}return e.prototype._start=function(e){this.out=e,this.taken=0,this.max<=0?e._c():this.ins._add(this)},e.prototype._stop=function(){this.ins._remove(this),this.out=c},e.prototype._n=function(e){var t=this.out;if(t!==c){var n=++this.taken;n1))if(this._stopID!==c)clearTimeout(this._stopID),this._stopID=c;else{var r=this._prod;r!==c&&r._start(this)}},e.prototype._remove=function(e){var t=this,n=this._target;if(n)return n._remove(e);var r=this._ils,o=r.indexOf(e);o>-1&&(r.splice(o,1),this._prod!==c&&r.length<=0?(this._err=c,this._stopID=setTimeout((function(){return t._stopNow()}))):1===r.length&&this._pruneCycles())},e.prototype._pruneCycles=function(){this._hasNoSinks(this,[])&&this._remove(this._ils[0])},e.prototype._hasNoSinks=function(e,t){if(-1!==t.indexOf(e))return!0;if(e.out===this)return!0;if(e.out&&e.out!==c)return this._hasNoSinks(e.out,t.concat(e));if(e._ils){for(var n=0,r=e._ils.length;n1)this._has&&e._n(this._v);else if(this._stopID!==c)this._has&&e._n(this._v),clearTimeout(this._stopID),this._stopID=c;else if(this._has)e._n(this._v);else{var r=this._prod;r!==c&&r._start(this)}},t.prototype._stopNow=function(){this._has=!1,e.prototype._stopNow.call(this)},t.prototype._x=function(){this._has=!1,e.prototype._x.call(this)},t.prototype.map=function(e){return this._map(e)},t.prototype.mapTo=function(t){return e.prototype.mapTo.call(this,t)},t.prototype.take=function(t){return e.prototype.take.call(this,t)},t.prototype.endWhen=function(t){return e.prototype.endWhen.call(this,t)},t.prototype.replaceError=function(t){return e.prototype.replaceError.call(this,t)},t.prototype.remember=function(){return this},t.prototype.debug=function(t){return e.prototype.debug.call(this,t)},t}(T);t.MemoryStream=j;var U=T;t.default=U},function(e,t,n){"use strict";var r=n(2),o=n(75),i=n(56),a=n(57),s=n(24);function c(e){s.call(this,"digest"),this._hash=e}r(c,s),c.prototype._update=function(e){this._hash.update(e)},c.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new o:"rmd160"===e||"ripemd160"===e?new i:new c(a(e))}},function(e,t,n){"use strict";var r={};function o(e,t,n){n||(n=Error);var o=function(e){var n,r;function o(n,r,o){return e.call(this,function(e,n,r){return"string"==typeof t?t:t(e,n,r)}(n,r,o))||this}return r=e,(n=o).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,o}(n);o.prototype.name=n.name,o.prototype.code=e,r[e]=o}function i(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return String(e)})),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}o("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),o("ERR_INVALID_ARG_TYPE",(function(e,t,n){var r,o,a,s;if("string"==typeof t&&(o="not ",t.substr(!a||a<0?0:+a,o.length)===o)?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))s="The ".concat(e," ").concat(r," ").concat(i(t,"type"));else{var c=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(c," ").concat(r," ").concat(i(t,"type"))}return s+=". Received type ".concat(typeof n)}),TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=r},function(e,t,n){"use strict";(function(t){var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=u;var o=n(123),i=n(127);n(2)(u,o);for(var a=r(i.prototype),s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,o=(n-r)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},o.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=o},function(e,t,n){"use strict";var r={};function o(e,t,n){n||(n=Error);var o=function(e){var n,r;function o(n,r,o){return e.call(this,function(e,n,r){return"string"==typeof t?t:t(e,n,r)}(n,r,o))||this}return r=e,(n=o).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,o}(n);o.prototype.name=n.name,o.prototype.code=e,r[e]=o}function i(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return String(e)})),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}o("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),o("ERR_INVALID_ARG_TYPE",(function(e,t,n){var r,o,a,s;if("string"==typeof t&&(o="not ",t.substr(!a||a<0?0:+a,o.length)===o)?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))s="The ".concat(e," ").concat(r," ").concat(i(t,"type"));else{var c=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(c," ").concat(r," ").concat(i(t,"type"))}return s+=". Received type ".concat(typeof n)}),TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=r},function(e,t,n){"use strict";(function(t){var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=u;var o=n(156),i=n(160);n(2)(u,o);for(var a=r(i.prototype),s=0;s=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-n,this.endian);for(var o=0;o>>24&255,r[o++]=e>>>16&255,r[o++]=e>>>8&255,r[o++]=255&e}else for(r[o++]=255&e,r[o++]=e>>>8&255,r[o++]=e>>>16&255,r[o++]=e>>>24&255,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,i=8;i>>3){case 1:a.signatures.push(t.SignatureDescriptor.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},l);return r.signatures=(null!==(n=e.signatures)&&void 0!==n?n:[]).map(e=>t.SignatureDescriptor.fromJSON(e)),r},toJSON(e){const n={};return e.signatures?n.signatures=e.signatures.map(e=>e?t.SignatureDescriptor.toJSON(e):void 0):n.signatures=[],n},fromPartial(e){var n;const r=Object.assign({},l);return r.signatures=(null===(n=e.signatures)||void 0===n?void 0:n.map(e=>t.SignatureDescriptor.fromPartial(e)))||[],r}};const f={sequence:o.default.UZERO};t.SignatureDescriptor={encode:(e,n=i.default.Writer.create())=>(void 0!==e.publicKey&&a.Any.encode(e.publicKey,n.uint32(10).fork()).ldelim(),void 0!==e.data&&t.SignatureDescriptor_Data.encode(e.data,n.uint32(18).fork()).ldelim(),e.sequence.isZero()||n.uint32(24).uint64(e.sequence),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const s=Object.assign({},f);for(;r.pos>>3){case 1:s.publicKey=a.Any.decode(r,r.uint32());break;case 2:s.data=t.SignatureDescriptor_Data.decode(r,r.uint32());break;case 3:s.sequence=r.uint64();break;default:r.skipType(7&e)}}return s},fromJSON(e){const n=Object.assign({},f);return n.publicKey=void 0!==e.publicKey&&null!==e.publicKey?a.Any.fromJSON(e.publicKey):void 0,n.data=void 0!==e.data&&null!==e.data?t.SignatureDescriptor_Data.fromJSON(e.data):void 0,n.sequence=void 0!==e.sequence&&null!==e.sequence?o.default.fromString(e.sequence):o.default.UZERO,n},toJSON(e){const n={};return void 0!==e.publicKey&&(n.publicKey=e.publicKey?a.Any.toJSON(e.publicKey):void 0),void 0!==e.data&&(n.data=e.data?t.SignatureDescriptor_Data.toJSON(e.data):void 0),void 0!==e.sequence&&(n.sequence=(e.sequence||o.default.UZERO).toString()),n},fromPartial(e){const n=Object.assign({},f);return n.publicKey=void 0!==e.publicKey&&null!==e.publicKey?a.Any.fromPartial(e.publicKey):void 0,n.data=void 0!==e.data&&null!==e.data?t.SignatureDescriptor_Data.fromPartial(e.data):void 0,n.sequence=void 0!==e.sequence&&null!==e.sequence?o.default.fromValue(e.sequence):o.default.UZERO,n}};const h={};t.SignatureDescriptor_Data={encode:(e,n=i.default.Writer.create())=>(void 0!==e.single&&t.SignatureDescriptor_Data_Single.encode(e.single,n.uint32(10).fork()).ldelim(),void 0!==e.multi&&t.SignatureDescriptor_Data_Multi.encode(e.multi,n.uint32(18).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},h);for(;r.pos>>3){case 1:a.single=t.SignatureDescriptor_Data_Single.decode(r,r.uint32());break;case 2:a.multi=t.SignatureDescriptor_Data_Multi.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},h);return n.single=void 0!==e.single&&null!==e.single?t.SignatureDescriptor_Data_Single.fromJSON(e.single):void 0,n.multi=void 0!==e.multi&&null!==e.multi?t.SignatureDescriptor_Data_Multi.fromJSON(e.multi):void 0,n},toJSON(e){const n={};return void 0!==e.single&&(n.single=e.single?t.SignatureDescriptor_Data_Single.toJSON(e.single):void 0),void 0!==e.multi&&(n.multi=e.multi?t.SignatureDescriptor_Data_Multi.toJSON(e.multi):void 0),n},fromPartial(e){const n=Object.assign({},h);return n.single=void 0!==e.single&&null!==e.single?t.SignatureDescriptor_Data_Single.fromPartial(e.single):void 0,n.multi=void 0!==e.multi&&null!==e.multi?t.SignatureDescriptor_Data_Multi.fromPartial(e.multi):void 0,n}};const p={mode:0};t.SignatureDescriptor_Data_Single={encode:(e,t=i.default.Writer.create())=>(0!==e.mode&&t.uint32(8).int32(e.mode),0!==e.signature.length&&t.uint32(18).bytes(e.signature),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},p);for(o.signature=new Uint8Array;n.pos>>3){case 1:o.mode=n.int32();break;case 2:o.signature=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},p);return t.mode=void 0!==e.mode&&null!==e.mode?u(e.mode):0,t.signature=void 0!==e.signature&&null!==e.signature?function(e){const t=m(e),n=new Uint8Array(t.length);for(let e=0;e>>3){case 1:a.bitarray=s.CompactBitArray.decode(r,r.uint32());break;case 2:a.signatures.push(t.SignatureDescriptor_Data.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},A);return r.bitarray=void 0!==e.bitarray&&null!==e.bitarray?s.CompactBitArray.fromJSON(e.bitarray):void 0,r.signatures=(null!==(n=e.signatures)&&void 0!==n?n:[]).map(e=>t.SignatureDescriptor_Data.fromJSON(e)),r},toJSON(e){const n={};return void 0!==e.bitarray&&(n.bitarray=e.bitarray?s.CompactBitArray.toJSON(e.bitarray):void 0),e.signatures?n.signatures=e.signatures.map(e=>e?t.SignatureDescriptor_Data.toJSON(e):void 0):n.signatures=[],n},fromPartial(e){var n;const r=Object.assign({},A);return r.bitarray=void 0!==e.bitarray&&null!==e.bitarray?s.CompactBitArray.fromPartial(e.bitarray):void 0,r.signatures=(null===(n=e.signatures)||void 0===n?void 0:n.map(e=>t.SignatureDescriptor_Data.fromPartial(e)))||[],r}};var g=(()=>{if(void 0!==g)return g;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw"Unable to locate global object"})();const m=g.atob||(e=>g.Buffer.from(e,"base64").toString("binary"));const v=g.btoa||(e=>g.Buffer.from(e,"binary").toString("base64"));i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())}).call(this,n(3))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stakingTypes=t.isMsgUndelegateEncodeObject=t.isMsgDelegateEncodeObject=t.isAminoMsgUndelegate=t.isAminoMsgEditValidator=t.isAminoMsgDelegate=t.isAminoMsgCreateValidator=t.isAminoMsgBeginRedelegate=t.createStakingAminoConverters=t.setupSlashingExtension=t.isAminoMsgUnjail=t.createSlashingAminoConverters=t.setupMintExtension=t.setupIbcExtension=t.isMsgTransferEncodeObject=t.ibcTypes=t.isAminoMsgTransfer=t.createIbcAminoConverters=t.setupGovExtension=t.isMsgVoteEncodeObject=t.isMsgSubmitProposalEncodeObject=t.isMsgDepositEncodeObject=t.govTypes=t.isAminoMsgVote=t.isAminoMsgSubmitProposal=t.isAminoMsgDeposit=t.createGovAminoConverters=t.feegrantTypes=t.createFreegrantAminoConverters=t.isAminoMsgSubmitEvidence=t.createEvidenceAminoConverters=t.setupDistributionExtension=t.isMsgWithdrawDelegatorRewardEncodeObject=t.distributionTypes=t.isAminoMsgWithdrawValidatorCommission=t.isAminoMsgWithdrawDelegatorReward=t.isAminoMsgSetWithdrawAddress=t.isAminoMsgFundCommunityPool=t.createDistributionAminoConverters=t.isAminoMsgVerifyInvariant=t.createCrysisAminoConverters=t.setupBankExtension=t.isMsgSendEncodeObject=t.bankTypes=t.isAminoMsgSend=t.isAminoMsgMultiSend=t.createBankAminoConverters=t.authzTypes=t.createAuthzAminoConverters=t.setupAuthExtension=void 0,t.vestingTypes=t.createVestingAminoConverters=t.setupTxExtension=t.setupStakingExtension=void 0;var r=n(476);Object.defineProperty(t,"setupAuthExtension",{enumerable:!0,get:function(){return r.setupAuthExtension}});var o=n(502);Object.defineProperty(t,"createAuthzAminoConverters",{enumerable:!0,get:function(){return o.createAuthzAminoConverters}});var i=n(503);Object.defineProperty(t,"authzTypes",{enumerable:!0,get:function(){return i.authzTypes}});var a=n(506);Object.defineProperty(t,"createBankAminoConverters",{enumerable:!0,get:function(){return a.createBankAminoConverters}}),Object.defineProperty(t,"isAminoMsgMultiSend",{enumerable:!0,get:function(){return a.isAminoMsgMultiSend}}),Object.defineProperty(t,"isAminoMsgSend",{enumerable:!0,get:function(){return a.isAminoMsgSend}});var s=n(507);Object.defineProperty(t,"bankTypes",{enumerable:!0,get:function(){return s.bankTypes}}),Object.defineProperty(t,"isMsgSendEncodeObject",{enumerable:!0,get:function(){return s.isMsgSendEncodeObject}});var c=n(508);Object.defineProperty(t,"setupBankExtension",{enumerable:!0,get:function(){return c.setupBankExtension}});var u=n(510);Object.defineProperty(t,"createCrysisAminoConverters",{enumerable:!0,get:function(){return u.createCrysisAminoConverters}}),Object.defineProperty(t,"isAminoMsgVerifyInvariant",{enumerable:!0,get:function(){return u.isAminoMsgVerifyInvariant}});var d=n(511);Object.defineProperty(t,"createDistributionAminoConverters",{enumerable:!0,get:function(){return d.createDistributionAminoConverters}}),Object.defineProperty(t,"isAminoMsgFundCommunityPool",{enumerable:!0,get:function(){return d.isAminoMsgFundCommunityPool}}),Object.defineProperty(t,"isAminoMsgSetWithdrawAddress",{enumerable:!0,get:function(){return d.isAminoMsgSetWithdrawAddress}}),Object.defineProperty(t,"isAminoMsgWithdrawDelegatorReward",{enumerable:!0,get:function(){return d.isAminoMsgWithdrawDelegatorReward}}),Object.defineProperty(t,"isAminoMsgWithdrawValidatorCommission",{enumerable:!0,get:function(){return d.isAminoMsgWithdrawValidatorCommission}});var l=n(512);Object.defineProperty(t,"distributionTypes",{enumerable:!0,get:function(){return l.distributionTypes}}),Object.defineProperty(t,"isMsgWithdrawDelegatorRewardEncodeObject",{enumerable:!0,get:function(){return l.isMsgWithdrawDelegatorRewardEncodeObject}});var f=n(513);Object.defineProperty(t,"setupDistributionExtension",{enumerable:!0,get:function(){return f.setupDistributionExtension}});var h=n(516);Object.defineProperty(t,"createEvidenceAminoConverters",{enumerable:!0,get:function(){return h.createEvidenceAminoConverters}}),Object.defineProperty(t,"isAminoMsgSubmitEvidence",{enumerable:!0,get:function(){return h.isAminoMsgSubmitEvidence}});var p=n(517);Object.defineProperty(t,"createFreegrantAminoConverters",{enumerable:!0,get:function(){return p.createFreegrantAminoConverters}});var A=n(518);Object.defineProperty(t,"feegrantTypes",{enumerable:!0,get:function(){return A.feegrantTypes}});var g=n(520);Object.defineProperty(t,"createGovAminoConverters",{enumerable:!0,get:function(){return g.createGovAminoConverters}}),Object.defineProperty(t,"isAminoMsgDeposit",{enumerable:!0,get:function(){return g.isAminoMsgDeposit}}),Object.defineProperty(t,"isAminoMsgSubmitProposal",{enumerable:!0,get:function(){return g.isAminoMsgSubmitProposal}}),Object.defineProperty(t,"isAminoMsgVote",{enumerable:!0,get:function(){return g.isAminoMsgVote}});var m=n(521);Object.defineProperty(t,"govTypes",{enumerable:!0,get:function(){return m.govTypes}}),Object.defineProperty(t,"isMsgDepositEncodeObject",{enumerable:!0,get:function(){return m.isMsgDepositEncodeObject}}),Object.defineProperty(t,"isMsgSubmitProposalEncodeObject",{enumerable:!0,get:function(){return m.isMsgSubmitProposalEncodeObject}}),Object.defineProperty(t,"isMsgVoteEncodeObject",{enumerable:!0,get:function(){return m.isMsgVoteEncodeObject}});var v=n(523);Object.defineProperty(t,"setupGovExtension",{enumerable:!0,get:function(){return v.setupGovExtension}});var y=n(525);Object.defineProperty(t,"createIbcAminoConverters",{enumerable:!0,get:function(){return y.createIbcAminoConverters}}),Object.defineProperty(t,"isAminoMsgTransfer",{enumerable:!0,get:function(){return y.isAminoMsgTransfer}});var b=n(526);Object.defineProperty(t,"ibcTypes",{enumerable:!0,get:function(){return b.ibcTypes}}),Object.defineProperty(t,"isMsgTransferEncodeObject",{enumerable:!0,get:function(){return b.isMsgTransferEncodeObject}});var I=n(530);Object.defineProperty(t,"setupIbcExtension",{enumerable:!0,get:function(){return I.setupIbcExtension}});var w=n(538);Object.defineProperty(t,"setupMintExtension",{enumerable:!0,get:function(){return w.setupMintExtension}});var E=n(541);Object.defineProperty(t,"createSlashingAminoConverters",{enumerable:!0,get:function(){return E.createSlashingAminoConverters}}),Object.defineProperty(t,"isAminoMsgUnjail",{enumerable:!0,get:function(){return E.isAminoMsgUnjail}});var _=n(542);Object.defineProperty(t,"setupSlashingExtension",{enumerable:!0,get:function(){return _.setupSlashingExtension}});var B=n(545);Object.defineProperty(t,"createStakingAminoConverters",{enumerable:!0,get:function(){return B.createStakingAminoConverters}}),Object.defineProperty(t,"isAminoMsgBeginRedelegate",{enumerable:!0,get:function(){return B.isAminoMsgBeginRedelegate}}),Object.defineProperty(t,"isAminoMsgCreateValidator",{enumerable:!0,get:function(){return B.isAminoMsgCreateValidator}}),Object.defineProperty(t,"isAminoMsgDelegate",{enumerable:!0,get:function(){return B.isAminoMsgDelegate}}),Object.defineProperty(t,"isAminoMsgEditValidator",{enumerable:!0,get:function(){return B.isAminoMsgEditValidator}}),Object.defineProperty(t,"isAminoMsgUndelegate",{enumerable:!0,get:function(){return B.isAminoMsgUndelegate}});var C=n(546);Object.defineProperty(t,"isMsgDelegateEncodeObject",{enumerable:!0,get:function(){return C.isMsgDelegateEncodeObject}}),Object.defineProperty(t,"isMsgUndelegateEncodeObject",{enumerable:!0,get:function(){return C.isMsgUndelegateEncodeObject}}),Object.defineProperty(t,"stakingTypes",{enumerable:!0,get:function(){return C.stakingTypes}});var k=n(547);Object.defineProperty(t,"setupStakingExtension",{enumerable:!0,get:function(){return k.setupStakingExtension}});var S=n(549);Object.defineProperty(t,"setupTxExtension",{enumerable:!0,get:function(){return S.setupTxExtension}});var O=n(554);Object.defineProperty(t,"createVestingAminoConverters",{enumerable:!0,get:function(){return O.createVestingAminoConverters}});var Q=n(555);Object.defineProperty(t,"vestingTypes",{enumerable:!0,get:function(){return Q.vestingTypes}})},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Duration=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1));t.protobufPackage="google.protobuf";const a={seconds:o.default.ZERO,nanos:0};t.Duration={encode:(e,t=i.default.Writer.create())=>(e.seconds.isZero()||t.uint32(8).int64(e.seconds),0!==e.nanos&&t.uint32(16).int32(e.nanos),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},a);for(;n.pos>>3){case 1:o.seconds=n.int64();break;case 2:o.nanos=n.int32();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},a);return t.seconds=void 0!==e.seconds&&null!==e.seconds?o.default.fromString(e.seconds):o.default.ZERO,t.nanos=void 0!==e.nanos&&null!==e.nanos?Number(e.nanos):0,t},toJSON(e){const t={};return void 0!==e.seconds&&(t.seconds=(e.seconds||o.default.ZERO).toString()),void 0!==e.nanos&&(t.nanos=e.nanos),t},fromPartial(e){var t;const n=Object.assign({},a);return n.seconds=void 0!==e.seconds&&null!==e.seconds?o.default.fromValue(e.seconds):o.default.ZERO,n.nanos=null!==(t=e.nanos)&&void 0!==t?t:0,n}},i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())},function(e,t,n){"use strict";var r=n(7).Buffer,o=n(2),i=n(122),a=new Array(16),s=[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],c=[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],u=[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],d=[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],l=[0,1518500249,1859775393,2400959708,2840853838],f=[1352829926,1548603684,1836072691,2053994217,0];function h(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<>>32-t}function A(e,t,n,r,o,i,a,s){return p(e+(t^n^r)+i+a|0,s)+o|0}function g(e,t,n,r,o,i,a,s){return p(e+(t&n|~t&r)+i+a|0,s)+o|0}function m(e,t,n,r,o,i,a,s){return p(e+((t|~n)^r)+i+a|0,s)+o|0}function v(e,t,n,r,o,i,a,s){return p(e+(t&r|n&~r)+i+a|0,s)+o|0}function y(e,t,n,r,o,i,a,s){return p(e+(t^(n|~r))+i+a|0,s)+o|0}o(h,i),h.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var n=0|this._a,r=0|this._b,o=0|this._c,i=0|this._d,h=0|this._e,b=0|this._a,I=0|this._b,w=0|this._c,E=0|this._d,_=0|this._e,B=0;B<80;B+=1){var C,k;B<16?(C=A(n,r,o,i,h,e[s[B]],l[0],u[B]),k=y(b,I,w,E,_,e[c[B]],f[0],d[B])):B<32?(C=g(n,r,o,i,h,e[s[B]],l[1],u[B]),k=v(b,I,w,E,_,e[c[B]],f[1],d[B])):B<48?(C=m(n,r,o,i,h,e[s[B]],l[2],u[B]),k=m(b,I,w,E,_,e[c[B]],f[2],d[B])):B<64?(C=v(n,r,o,i,h,e[s[B]],l[3],u[B]),k=g(b,I,w,E,_,e[c[B]],f[3],d[B])):(C=y(n,r,o,i,h,e[s[B]],l[4],u[B]),k=A(b,I,w,E,_,e[c[B]],f[4],d[B])),n=h,h=i,i=p(o,10),o=r,r=C,b=_,_=E,E=p(w,10),w=I,I=k}var S=this._b+o+E|0;this._b=this._c+i+_|0,this._c=this._d+h+b|0,this._d=this._e+n+I|0,this._e=this._a+r+w|0,this._a=S},h.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=r.alloc?r.alloc(20):new r(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=h},function(e,t,n){(t=e.exports=function(e){e=e.toLowerCase();var n=t[e];if(!n)throw new Error(e+" is not supported (we accept pull requests)");return new n}).sha=n(280),t.sha1=n(281),t.sha224=n(282),t.sha256=n(129),t.sha384=n(283),t.sha512=n(130)},function(e,t,n){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,r,o){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,n)}));case 3:return t.nextTick((function(){e.call(null,n,r)}));case 4:return t.nextTick((function(){e.call(null,n,r,o)}));default:for(i=new Array(s-1),a=0;a=0;r--){var o=e[r];"."===o?e.splice(r,1):".."===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r=-1&&!o;i--){var a=i>=0?arguments[i]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(t=a+"/"+t,o="/"===a.charAt(0))}return(o?"/":"")+(t=n(r(t.split("/"),(function(e){return!!e})),!o).join("/"))||"."},t.normalize=function(e){var i=t.isAbsolute(e),a="/"===o(e,-1);return(e=n(r(e.split("/"),(function(e){return!!e})),!i).join("/"))||i||(e="."),e&&a&&(e+="/"),(i?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var o=r(e.split("/")),i=r(n.split("/")),a=Math.min(o.length,i.length),s=a,c=0;c=1;--i)if(47===(t=e.charCodeAt(i))){if(!o){r=i;break}}else o=!1;return-1===r?n?"/":".":n&&1===r?"/":e.slice(0,r)},t.basename=function(e,t){var n=function(e){"string"!=typeof e&&(e+="");var t,n=0,r=-1,o=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!o){n=t+1;break}}else-1===r&&(o=!1,r=t+1);return-1===r?"":e.slice(n,r)}(e);return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,n=0,r=-1,o=!0,i=0,a=e.length-1;a>=0;--a){var s=e.charCodeAt(a);if(47!==s)-1===r&&(o=!1,r=a+1),46===s?-1===t?t=a:1!==i&&(i=1):-1!==t&&(i=-1);else if(!o){n=a+1;break}}return-1===t||-1===r||0===i||1===i&&t===r-1&&t===n+1?"":e.slice(t,r)};var o="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(this,n(6))},function(e,t,n){var r=n(4).Buffer;function o(e){r.isBuffer(e)||(e=r.from(e));for(var t=e.length/4|0,n=new Array(t),o=0;o>>24]^d[p>>>16&255]^l[A>>>8&255]^f[255&g]^t[m++],a=u[p>>>24]^d[A>>>16&255]^l[g>>>8&255]^f[255&h]^t[m++],s=u[A>>>24]^d[g>>>16&255]^l[h>>>8&255]^f[255&p]^t[m++],c=u[g>>>24]^d[h>>>16&255]^l[p>>>8&255]^f[255&A]^t[m++],h=i,p=a,A=s,g=c;return i=(r[h>>>24]<<24|r[p>>>16&255]<<16|r[A>>>8&255]<<8|r[255&g])^t[m++],a=(r[p>>>24]<<24|r[A>>>16&255]<<16|r[g>>>8&255]<<8|r[255&h])^t[m++],s=(r[A>>>24]<<24|r[g>>>16&255]<<16|r[h>>>8&255]<<8|r[255&p])^t[m++],c=(r[g>>>24]<<24|r[h>>>16&255]<<16|r[p>>>8&255]<<8|r[255&A])^t[m++],[i>>>=0,a>>>=0,s>>>=0,c>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var n=[],r=[],o=[[],[],[],[]],i=[[],[],[],[]],a=0,s=0,c=0;c<256;++c){var u=s^s<<1^s<<2^s<<3^s<<4;u=u>>>8^255&u^99,n[a]=u,r[u]=a;var d=e[a],l=e[d],f=e[l],h=257*e[u]^16843008*u;o[0][a]=h<<24|h>>>8,o[1][a]=h<<16|h>>>16,o[2][a]=h<<8|h>>>24,o[3][a]=h,h=16843009*f^65537*l^257*d^16843008*a,i[0][u]=h<<24|h>>>8,i[1][u]=h<<16|h>>>16,i[2][u]=h<<8|h>>>24,i[3][u]=h,0===a?a=s=1:(a=d^e[e[e[f^d]]],s^=e[e[s]])}return{SBOX:n,INV_SBOX:r,SUB_MIX:o,INV_SUB_MIX:i}}();function u(e){this._key=o(e),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var e=this._key,t=e.length,n=t+6,r=4*(n+1),o=[],i=0;i>>24,a=c.SBOX[a>>>24]<<24|c.SBOX[a>>>16&255]<<16|c.SBOX[a>>>8&255]<<8|c.SBOX[255&a],a^=s[i/t|0]<<24):t>6&&i%t==4&&(a=c.SBOX[a>>>24]<<24|c.SBOX[a>>>16&255]<<16|c.SBOX[a>>>8&255]<<8|c.SBOX[255&a]),o[i]=o[i-t]^a}for(var u=[],d=0;d>>24]]^c.INV_SUB_MIX[1][c.SBOX[f>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[f>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&f]]}this._nRounds=n,this._keySchedule=o,this._invKeySchedule=u},u.prototype.encryptBlockRaw=function(e){return a(e=o(e),this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},u.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),n=r.allocUnsafe(16);return n.writeUInt32BE(t[0],0),n.writeUInt32BE(t[1],4),n.writeUInt32BE(t[2],8),n.writeUInt32BE(t[3],12),n},u.prototype.decryptBlock=function(e){var t=(e=o(e))[1];e[1]=e[3],e[3]=t;var n=a(e,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),i=r.allocUnsafe(16);return i.writeUInt32BE(n[0],0),i.writeUInt32BE(n[3],4),i.writeUInt32BE(n[2],8),i.writeUInt32BE(n[1],12),i},u.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},e.exports.AES=u},function(e,t,n){var r=n(4).Buffer,o=n(75);e.exports=function(e,t,n,i){if(r.isBuffer(e)||(e=r.from(e,"binary")),t&&(r.isBuffer(t)||(t=r.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=n/8,s=r.alloc(a),c=r.alloc(i||0),u=r.alloc(0);a>0||i>0;){var d=new o;d.update(u),d.update(e),t&&d.update(t),u=d.digest();var l=0;if(a>0){var f=s.length-a;l=Math.min(a,u.length),u.copy(s,f,0,l),a-=l}if(l0){var h=c.length-i,p=Math.min(i,u.length-l);u.copy(c,h,l,l+p),i-=p}}return u.fill(0),{key:s,iv:c}}},function(e,t,n){"use strict";var r=n(8),o=n(18),i=o.getNAF,a=o.getJSF,s=o.assert;function c(e,t){this.type=e,this.p=new r(t.p,16),this.red=t.prime?r.red(t.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=t.n&&new r(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){s(e.precomputed);var n=e._getDoubles(),r=i(t,1,this._bitLength),o=(1<=a;d--)c=(c<<1)+r[d];u.push(c)}for(var l=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=o;h>0;h--){for(a=0;a=0;u--){for(var d=0;u>=0&&0===a[u];u--)d++;if(u>=0&&d++,c=c.dblp(d),u<0)break;var l=a[u];s(0!==l),c="affine"===e.type?l>0?c.mixedAdd(o[l-1>>1]):c.mixedAdd(o[-l-1>>1].neg()):l>0?c.add(o[l-1>>1]):c.add(o[-l-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,n,r,o){var s,c,u,d=this._wnafT1,l=this._wnafT2,f=this._wnafT3,h=0;for(s=0;s=1;s-=2){var A=s-1,g=s;if(1===d[A]&&1===d[g]){var m=[t[A],null,null,t[g]];0===t[A].y.cmp(t[g].y)?(m[1]=t[A].add(t[g]),m[2]=t[A].toJ().mixedAdd(t[g].neg())):0===t[A].y.cmp(t[g].y.redNeg())?(m[1]=t[A].toJ().mixedAdd(t[g]),m[2]=t[A].add(t[g].neg())):(m[1]=t[A].toJ().mixedAdd(t[g]),m[2]=t[A].toJ().mixedAdd(t[g].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],y=a(n[A],n[g]);for(h=Math.max(y[0].length,h),f[A]=new Array(h),f[g]=new Array(h),c=0;c=0;s--){for(var _=0;s>=0;){var B=!0;for(c=0;c=0&&_++,w=w.dblp(_),s<0)break;for(c=0;c0?u=l[c][C-1>>1]:C<0&&(u=l[c][-C-1>>1].neg()),w="affine"===u.type?w.mixedAdd(u):w.add(u))}}for(s=0;s=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,o=0;oObject.assign(Object.assign({},t),{[n]:i(e[n])}),{})}function a(e){return JSON.stringify(i(e))}t.sortedJsonStringify=a,t.makeSignDoc=function(e,t,n,r,i,a){return{chain_id:n,account_number:o.Uint53.fromString(i.toString()).toString(),sequence:o.Uint53.fromString(a.toString()).toString(),fee:t,msgs:e,memo:r}},t.serializeSignDoc=function(e){return r.toUtf8(a(e))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pubkeyToAddress=t.pubkeyToRawAddress=t.rawSecp256k1PubkeyToRawAddress=t.rawEd25519PubkeyToRawAddress=void 0;const r=n(20),o=n(5),i=n(102),a=n(69);function s(e){if(32!==e.length)throw new Error("Invalid Ed25519 pubkey length: "+e.length);return(0,r.sha256)(e).slice(0,20)}function c(e){if(33!==e.length)throw new Error("Invalid Secp256k1 pubkey length (compressed): "+e.length);return(0,r.ripemd160)((0,r.sha256)(e))}function u(e){if((0,a.isSecp256k1Pubkey)(e)){return c((0,o.fromBase64)(e.value))}if((0,a.isEd25519Pubkey)(e)){return s((0,o.fromBase64)(e.value))}if((0,a.isMultisigThresholdPubkey)(e)){const t=(0,i.encodeAminoPubkey)(e);return(0,r.sha256)(t).slice(0,20)}throw new Error("Unsupported public key type")}t.rawEd25519PubkeyToRawAddress=s,t.rawSecp256k1PubkeyToRawAddress=c,t.pubkeyToRawAddress=u,t.pubkeyToAddress=function(e,t){return(0,o.toBech32)(t,u(e))}},function(e,t,n){"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Wrong positive integer: "+e)}function o(e){if("boolean"!=typeof e)throw new Error("Expected boolean, not "+e)}function i(e,...t){if(!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function a(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function s(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function c(e,t){i(e);const n=t.outputLen;if(e.length>>3){case 1:r.key=e.bytes();break;case 2:r.value=e.bytes();break;case 3:r.leaf=d.ics23.LeafOp.decode(e,e.uint32());break;case 4:r.path&&r.path.length||(r.path=[]),r.path.push(d.ics23.InnerOp.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.key&&e.hasOwnProperty("key")&&!(e.key&&"number"==typeof e.key.length||u.isString(e.key)))return"key: buffer expected";if(null!=e.value&&e.hasOwnProperty("value")&&!(e.value&&"number"==typeof e.value.length||u.isString(e.value)))return"value: buffer expected";if(null!=e.leaf&&e.hasOwnProperty("leaf")&&(n=d.ics23.LeafOp.verify(e.leaf)))return"leaf."+n;if(null!=e.path&&e.hasOwnProperty("path")){if(!Array.isArray(e.path))return"path: array expected";for(var t=0;t>>3){case 1:r.key=e.bytes();break;case 2:r.left=d.ics23.ExistenceProof.decode(e,e.uint32());break;case 3:r.right=d.ics23.ExistenceProof.decode(e,e.uint32());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.key&&e.hasOwnProperty("key")&&!(e.key&&"number"==typeof e.key.length||u.isString(e.key))?"key: buffer expected":null!=e.left&&e.hasOwnProperty("left")&&(t=d.ics23.ExistenceProof.verify(e.left))?"left."+t:null!=e.right&&e.hasOwnProperty("right")&&(t=d.ics23.ExistenceProof.verify(e.right))?"right."+t:null;var t},e.fromObject=function(e){if(e instanceof d.ics23.NonExistenceProof)return e;var t=new d.ics23.NonExistenceProof;if(null!=e.key&&("string"==typeof e.key?u.base64.decode(e.key,t.key=u.newBuffer(u.base64.length(e.key)),0):e.key.length&&(t.key=e.key)),null!=e.left){if("object"!=typeof e.left)throw TypeError(".ics23.NonExistenceProof.left: object expected");t.left=d.ics23.ExistenceProof.fromObject(e.left)}if(null!=e.right){if("object"!=typeof e.right)throw TypeError(".ics23.NonExistenceProof.right: object expected");t.right=d.ics23.ExistenceProof.fromObject(e.right)}return t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(t.bytes===String?n.key="":(n.key=[],t.bytes!==Array&&(n.key=u.newBuffer(n.key))),n.left=null,n.right=null),null!=e.key&&e.hasOwnProperty("key")&&(n.key=t.bytes===String?u.base64.encode(e.key,0,e.key.length):t.bytes===Array?Array.prototype.slice.call(e.key):e.key),null!=e.left&&e.hasOwnProperty("left")&&(n.left=d.ics23.ExistenceProof.toObject(e.left,t)),null!=e.right&&e.hasOwnProperty("right")&&(n.right=d.ics23.ExistenceProof.toObject(e.right,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.CommitmentProof=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 1:r.exist=d.ics23.ExistenceProof.decode(e,e.uint32());break;case 2:r.nonexist=d.ics23.NonExistenceProof.decode(e,e.uint32());break;case 3:r.batch=d.ics23.BatchProof.decode(e,e.uint32());break;case 4:r.compressed=d.ics23.CompressedBatchProof.decode(e,e.uint32());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.exist&&e.hasOwnProperty("exist")&&(t.proof=1,n=d.ics23.ExistenceProof.verify(e.exist)))return"exist."+n;if(null!=e.nonexist&&e.hasOwnProperty("nonexist")){if(1===t.proof)return"proof: multiple values";if(t.proof=1,n=d.ics23.NonExistenceProof.verify(e.nonexist))return"nonexist."+n}if(null!=e.batch&&e.hasOwnProperty("batch")){if(1===t.proof)return"proof: multiple values";if(t.proof=1,n=d.ics23.BatchProof.verify(e.batch))return"batch."+n}if(null!=e.compressed&&e.hasOwnProperty("compressed")){if(1===t.proof)return"proof: multiple values";var n;if(t.proof=1,n=d.ics23.CompressedBatchProof.verify(e.compressed))return"compressed."+n}return null},e.fromObject=function(e){if(e instanceof d.ics23.CommitmentProof)return e;var t=new d.ics23.CommitmentProof;if(null!=e.exist){if("object"!=typeof e.exist)throw TypeError(".ics23.CommitmentProof.exist: object expected");t.exist=d.ics23.ExistenceProof.fromObject(e.exist)}if(null!=e.nonexist){if("object"!=typeof e.nonexist)throw TypeError(".ics23.CommitmentProof.nonexist: object expected");t.nonexist=d.ics23.NonExistenceProof.fromObject(e.nonexist)}if(null!=e.batch){if("object"!=typeof e.batch)throw TypeError(".ics23.CommitmentProof.batch: object expected");t.batch=d.ics23.BatchProof.fromObject(e.batch)}if(null!=e.compressed){if("object"!=typeof e.compressed)throw TypeError(".ics23.CommitmentProof.compressed: object expected");t.compressed=d.ics23.CompressedBatchProof.fromObject(e.compressed)}return t},e.toObject=function(e,t){t||(t={});var n={};return null!=e.exist&&e.hasOwnProperty("exist")&&(n.exist=d.ics23.ExistenceProof.toObject(e.exist,t),t.oneofs&&(n.proof="exist")),null!=e.nonexist&&e.hasOwnProperty("nonexist")&&(n.nonexist=d.ics23.NonExistenceProof.toObject(e.nonexist,t),t.oneofs&&(n.proof="nonexist")),null!=e.batch&&e.hasOwnProperty("batch")&&(n.batch=d.ics23.BatchProof.toObject(e.batch,t),t.oneofs&&(n.proof="batch")),null!=e.compressed&&e.hasOwnProperty("compressed")&&(n.compressed=d.ics23.CompressedBatchProof.toObject(e.compressed,t),t.oneofs&&(n.proof="compressed")),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.LeafOp=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 1:r.hash=e.int32();break;case 2:r.prehashKey=e.int32();break;case 3:r.prehashValue=e.int32();break;case 4:r.length=e.int32();break;case 5:r.prefix=e.bytes();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.hash&&e.hasOwnProperty("hash"))switch(e.hash){default:return"hash: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:}if(null!=e.prehashKey&&e.hasOwnProperty("prehashKey"))switch(e.prehashKey){default:return"prehashKey: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:}if(null!=e.prehashValue&&e.hasOwnProperty("prehashValue"))switch(e.prehashValue){default:return"prehashValue: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:}if(null!=e.length&&e.hasOwnProperty("length"))switch(e.length){default:return"length: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:}return null!=e.prefix&&e.hasOwnProperty("prefix")&&!(e.prefix&&"number"==typeof e.prefix.length||u.isString(e.prefix))?"prefix: buffer expected":null},e.fromObject=function(e){if(e instanceof d.ics23.LeafOp)return e;var t=new d.ics23.LeafOp;switch(e.hash){case"NO_HASH":case 0:t.hash=0;break;case"SHA256":case 1:t.hash=1;break;case"SHA512":case 2:t.hash=2;break;case"KECCAK":case 3:t.hash=3;break;case"RIPEMD160":case 4:t.hash=4;break;case"BITCOIN":case 5:t.hash=5;break;case"SHA512_256":case 6:t.hash=6}switch(e.prehashKey){case"NO_HASH":case 0:t.prehashKey=0;break;case"SHA256":case 1:t.prehashKey=1;break;case"SHA512":case 2:t.prehashKey=2;break;case"KECCAK":case 3:t.prehashKey=3;break;case"RIPEMD160":case 4:t.prehashKey=4;break;case"BITCOIN":case 5:t.prehashKey=5;break;case"SHA512_256":case 6:t.prehashKey=6}switch(e.prehashValue){case"NO_HASH":case 0:t.prehashValue=0;break;case"SHA256":case 1:t.prehashValue=1;break;case"SHA512":case 2:t.prehashValue=2;break;case"KECCAK":case 3:t.prehashValue=3;break;case"RIPEMD160":case 4:t.prehashValue=4;break;case"BITCOIN":case 5:t.prehashValue=5;break;case"SHA512_256":case 6:t.prehashValue=6}switch(e.length){case"NO_PREFIX":case 0:t.length=0;break;case"VAR_PROTO":case 1:t.length=1;break;case"VAR_RLP":case 2:t.length=2;break;case"FIXED32_BIG":case 3:t.length=3;break;case"FIXED32_LITTLE":case 4:t.length=4;break;case"FIXED64_BIG":case 5:t.length=5;break;case"FIXED64_LITTLE":case 6:t.length=6;break;case"REQUIRE_32_BYTES":case 7:t.length=7;break;case"REQUIRE_64_BYTES":case 8:t.length=8}return null!=e.prefix&&("string"==typeof e.prefix?u.base64.decode(e.prefix,t.prefix=u.newBuffer(u.base64.length(e.prefix)),0):e.prefix.length&&(t.prefix=e.prefix)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.hash=t.enums===String?"NO_HASH":0,n.prehashKey=t.enums===String?"NO_HASH":0,n.prehashValue=t.enums===String?"NO_HASH":0,n.length=t.enums===String?"NO_PREFIX":0,t.bytes===String?n.prefix="":(n.prefix=[],t.bytes!==Array&&(n.prefix=u.newBuffer(n.prefix)))),null!=e.hash&&e.hasOwnProperty("hash")&&(n.hash=t.enums===String?d.ics23.HashOp[e.hash]:e.hash),null!=e.prehashKey&&e.hasOwnProperty("prehashKey")&&(n.prehashKey=t.enums===String?d.ics23.HashOp[e.prehashKey]:e.prehashKey),null!=e.prehashValue&&e.hasOwnProperty("prehashValue")&&(n.prehashValue=t.enums===String?d.ics23.HashOp[e.prehashValue]:e.prehashValue),null!=e.length&&e.hasOwnProperty("length")&&(n.length=t.enums===String?d.ics23.LengthOp[e.length]:e.length),null!=e.prefix&&e.hasOwnProperty("prefix")&&(n.prefix=t.bytes===String?u.base64.encode(e.prefix,0,e.prefix.length):t.bytes===Array?Array.prototype.slice.call(e.prefix):e.prefix),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.InnerOp=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 1:r.hash=e.int32();break;case 2:r.prefix=e.bytes();break;case 3:r.suffix=e.bytes();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.hash&&e.hasOwnProperty("hash"))switch(e.hash){default:return"hash: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:}return null!=e.prefix&&e.hasOwnProperty("prefix")&&!(e.prefix&&"number"==typeof e.prefix.length||u.isString(e.prefix))?"prefix: buffer expected":null!=e.suffix&&e.hasOwnProperty("suffix")&&!(e.suffix&&"number"==typeof e.suffix.length||u.isString(e.suffix))?"suffix: buffer expected":null},e.fromObject=function(e){if(e instanceof d.ics23.InnerOp)return e;var t=new d.ics23.InnerOp;switch(e.hash){case"NO_HASH":case 0:t.hash=0;break;case"SHA256":case 1:t.hash=1;break;case"SHA512":case 2:t.hash=2;break;case"KECCAK":case 3:t.hash=3;break;case"RIPEMD160":case 4:t.hash=4;break;case"BITCOIN":case 5:t.hash=5;break;case"SHA512_256":case 6:t.hash=6}return null!=e.prefix&&("string"==typeof e.prefix?u.base64.decode(e.prefix,t.prefix=u.newBuffer(u.base64.length(e.prefix)),0):e.prefix.length&&(t.prefix=e.prefix)),null!=e.suffix&&("string"==typeof e.suffix?u.base64.decode(e.suffix,t.suffix=u.newBuffer(u.base64.length(e.suffix)),0):e.suffix.length&&(t.suffix=e.suffix)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.hash=t.enums===String?"NO_HASH":0,t.bytes===String?n.prefix="":(n.prefix=[],t.bytes!==Array&&(n.prefix=u.newBuffer(n.prefix))),t.bytes===String?n.suffix="":(n.suffix=[],t.bytes!==Array&&(n.suffix=u.newBuffer(n.suffix)))),null!=e.hash&&e.hasOwnProperty("hash")&&(n.hash=t.enums===String?d.ics23.HashOp[e.hash]:e.hash),null!=e.prefix&&e.hasOwnProperty("prefix")&&(n.prefix=t.bytes===String?u.base64.encode(e.prefix,0,e.prefix.length):t.bytes===Array?Array.prototype.slice.call(e.prefix):e.prefix),null!=e.suffix&&e.hasOwnProperty("suffix")&&(n.suffix=t.bytes===String?u.base64.encode(e.suffix,0,e.suffix.length):t.bytes===Array?Array.prototype.slice.call(e.suffix):e.suffix),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.ProofSpec=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 1:r.leafSpec=d.ics23.LeafOp.decode(e,e.uint32());break;case 2:r.innerSpec=d.ics23.InnerSpec.decode(e,e.uint32());break;case 3:r.maxDepth=e.int32();break;case 4:r.minDepth=e.int32();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.leafSpec&&e.hasOwnProperty("leafSpec")&&(t=d.ics23.LeafOp.verify(e.leafSpec))?"leafSpec."+t:null!=e.innerSpec&&e.hasOwnProperty("innerSpec")&&(t=d.ics23.InnerSpec.verify(e.innerSpec))?"innerSpec."+t:null!=e.maxDepth&&e.hasOwnProperty("maxDepth")&&!u.isInteger(e.maxDepth)?"maxDepth: integer expected":null!=e.minDepth&&e.hasOwnProperty("minDepth")&&!u.isInteger(e.minDepth)?"minDepth: integer expected":null;var t},e.fromObject=function(e){if(e instanceof d.ics23.ProofSpec)return e;var t=new d.ics23.ProofSpec;if(null!=e.leafSpec){if("object"!=typeof e.leafSpec)throw TypeError(".ics23.ProofSpec.leafSpec: object expected");t.leafSpec=d.ics23.LeafOp.fromObject(e.leafSpec)}if(null!=e.innerSpec){if("object"!=typeof e.innerSpec)throw TypeError(".ics23.ProofSpec.innerSpec: object expected");t.innerSpec=d.ics23.InnerSpec.fromObject(e.innerSpec)}return null!=e.maxDepth&&(t.maxDepth=0|e.maxDepth),null!=e.minDepth&&(t.minDepth=0|e.minDepth),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.leafSpec=null,n.innerSpec=null,n.maxDepth=0,n.minDepth=0),null!=e.leafSpec&&e.hasOwnProperty("leafSpec")&&(n.leafSpec=d.ics23.LeafOp.toObject(e.leafSpec,t)),null!=e.innerSpec&&e.hasOwnProperty("innerSpec")&&(n.innerSpec=d.ics23.InnerSpec.toObject(e.innerSpec,t)),null!=e.maxDepth&&e.hasOwnProperty("maxDepth")&&(n.maxDepth=e.maxDepth),null!=e.minDepth&&e.hasOwnProperty("minDepth")&&(n.minDepth=e.minDepth),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.InnerSpec=function(){function e(e){if(this.childOrder=[],e)for(var t=Object.keys(e),n=0;n>>3){case 1:if(r.childOrder&&r.childOrder.length||(r.childOrder=[]),2==(7&o))for(var i=e.uint32()+e.pos;e.pos>>3){case 1:r.entries&&r.entries.length||(r.entries=[]),r.entries.push(d.ics23.BatchEntry.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.entries&&e.hasOwnProperty("entries")){if(!Array.isArray(e.entries))return"entries: array expected";for(var t=0;t>>3){case 1:r.exist=d.ics23.ExistenceProof.decode(e,e.uint32());break;case 2:r.nonexist=d.ics23.NonExistenceProof.decode(e,e.uint32());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.exist&&e.hasOwnProperty("exist")&&(t.proof=1,n=d.ics23.ExistenceProof.verify(e.exist)))return"exist."+n;if(null!=e.nonexist&&e.hasOwnProperty("nonexist")){if(1===t.proof)return"proof: multiple values";var n;if(t.proof=1,n=d.ics23.NonExistenceProof.verify(e.nonexist))return"nonexist."+n}return null},e.fromObject=function(e){if(e instanceof d.ics23.BatchEntry)return e;var t=new d.ics23.BatchEntry;if(null!=e.exist){if("object"!=typeof e.exist)throw TypeError(".ics23.BatchEntry.exist: object expected");t.exist=d.ics23.ExistenceProof.fromObject(e.exist)}if(null!=e.nonexist){if("object"!=typeof e.nonexist)throw TypeError(".ics23.BatchEntry.nonexist: object expected");t.nonexist=d.ics23.NonExistenceProof.fromObject(e.nonexist)}return t},e.toObject=function(e,t){t||(t={});var n={};return null!=e.exist&&e.hasOwnProperty("exist")&&(n.exist=d.ics23.ExistenceProof.toObject(e.exist,t),t.oneofs&&(n.proof="exist")),null!=e.nonexist&&e.hasOwnProperty("nonexist")&&(n.nonexist=d.ics23.NonExistenceProof.toObject(e.nonexist,t),t.oneofs&&(n.proof="nonexist")),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.CompressedBatchProof=function(){function e(e){if(this.entries=[],this.lookupInners=[],e)for(var t=Object.keys(e),n=0;n>>3){case 1:r.entries&&r.entries.length||(r.entries=[]),r.entries.push(d.ics23.CompressedBatchEntry.decode(e,e.uint32()));break;case 2:r.lookupInners&&r.lookupInners.length||(r.lookupInners=[]),r.lookupInners.push(d.ics23.InnerOp.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.entries&&e.hasOwnProperty("entries")){if(!Array.isArray(e.entries))return"entries: array expected";for(var t=0;t>>3){case 1:r.exist=d.ics23.CompressedExistenceProof.decode(e,e.uint32());break;case 2:r.nonexist=d.ics23.CompressedNonExistenceProof.decode(e,e.uint32());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.exist&&e.hasOwnProperty("exist")&&(t.proof=1,n=d.ics23.CompressedExistenceProof.verify(e.exist)))return"exist."+n;if(null!=e.nonexist&&e.hasOwnProperty("nonexist")){if(1===t.proof)return"proof: multiple values";var n;if(t.proof=1,n=d.ics23.CompressedNonExistenceProof.verify(e.nonexist))return"nonexist."+n}return null},e.fromObject=function(e){if(e instanceof d.ics23.CompressedBatchEntry)return e;var t=new d.ics23.CompressedBatchEntry;if(null!=e.exist){if("object"!=typeof e.exist)throw TypeError(".ics23.CompressedBatchEntry.exist: object expected");t.exist=d.ics23.CompressedExistenceProof.fromObject(e.exist)}if(null!=e.nonexist){if("object"!=typeof e.nonexist)throw TypeError(".ics23.CompressedBatchEntry.nonexist: object expected");t.nonexist=d.ics23.CompressedNonExistenceProof.fromObject(e.nonexist)}return t},e.toObject=function(e,t){t||(t={});var n={};return null!=e.exist&&e.hasOwnProperty("exist")&&(n.exist=d.ics23.CompressedExistenceProof.toObject(e.exist,t),t.oneofs&&(n.proof="exist")),null!=e.nonexist&&e.hasOwnProperty("nonexist")&&(n.nonexist=d.ics23.CompressedNonExistenceProof.toObject(e.nonexist,t),t.oneofs&&(n.proof="nonexist")),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.CompressedExistenceProof=function(){function e(e){if(this.path=[],e)for(var t=Object.keys(e),n=0;n>>3){case 1:r.key=e.bytes();break;case 2:r.value=e.bytes();break;case 3:r.leaf=d.ics23.LeafOp.decode(e,e.uint32());break;case 4:if(r.path&&r.path.length||(r.path=[]),2==(7&o))for(var i=e.uint32()+e.pos;e.pos>>3){case 1:r.key=e.bytes();break;case 2:r.left=d.ics23.CompressedExistenceProof.decode(e,e.uint32());break;case 3:r.right=d.ics23.CompressedExistenceProof.decode(e,e.uint32());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.key&&e.hasOwnProperty("key")&&!(e.key&&"number"==typeof e.key.length||u.isString(e.key))?"key: buffer expected":null!=e.left&&e.hasOwnProperty("left")&&(t=d.ics23.CompressedExistenceProof.verify(e.left))?"left."+t:null!=e.right&&e.hasOwnProperty("right")&&(t=d.ics23.CompressedExistenceProof.verify(e.right))?"right."+t:null;var t},e.fromObject=function(e){if(e instanceof d.ics23.CompressedNonExistenceProof)return e;var t=new d.ics23.CompressedNonExistenceProof;if(null!=e.key&&("string"==typeof e.key?u.base64.decode(e.key,t.key=u.newBuffer(u.base64.length(e.key)),0):e.key.length&&(t.key=e.key)),null!=e.left){if("object"!=typeof e.left)throw TypeError(".ics23.CompressedNonExistenceProof.left: object expected");t.left=d.ics23.CompressedExistenceProof.fromObject(e.left)}if(null!=e.right){if("object"!=typeof e.right)throw TypeError(".ics23.CompressedNonExistenceProof.right: object expected");t.right=d.ics23.CompressedExistenceProof.fromObject(e.right)}return t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(t.bytes===String?n.key="":(n.key=[],t.bytes!==Array&&(n.key=u.newBuffer(n.key))),n.left=null,n.right=null),null!=e.key&&e.hasOwnProperty("key")&&(n.key=t.bytes===String?u.base64.encode(e.key,0,e.key.length):t.bytes===Array?Array.prototype.slice.call(e.key):e.key),null!=e.left&&e.hasOwnProperty("left")&&(n.left=d.ics23.CompressedExistenceProof.toObject(e.left,t)),null!=e.right&&e.hasOwnProperty("right")&&(n.right=d.ics23.CompressedExistenceProof.toObject(e.right,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i),e.exports=d},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.ValueAndUpdates=t.toListPromise=t.fromListPromise=t.firstEvent=t.dropDuplicates=t.DefaultValueProducer=t.concat=void 0;var i=n(483);Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return i.concat}});var a=n(496);Object.defineProperty(t,"DefaultValueProducer",{enumerable:!0,get:function(){return a.DefaultValueProducer}});var s=n(497);Object.defineProperty(t,"dropDuplicates",{enumerable:!0,get:function(){return s.dropDuplicates}});var c=n(498);Object.defineProperty(t,"firstEvent",{enumerable:!0,get:function(){return c.firstEvent}}),Object.defineProperty(t,"fromListPromise",{enumerable:!0,get:function(){return c.fromListPromise}}),Object.defineProperty(t,"toListPromise",{enumerable:!0,get:function(){return c.toListPromise}}),o(n(499),t);var u=n(500);Object.defineProperty(t,"ValueAndUpdates",{enumerable:!0,get:function(){return u.ValueAndUpdates}})},function(e,t,n){"use strict";n.r(t);const r=n(249);let o=[];!async function(){r.get("https://store-api.bitcanna.io").then((function(e){e.data.forEach((function(e){o.push(e)}))})).catch((function(e){console.log(e)}))}(),t.default=o},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Secp256k1HdWallet=t.extractKdfConfiguration=t.executeKdf=t.makeCosmoshubPath=t.pubkeyType=t.makeStdTx=t.isWrappedStdTx=t.isStdTx=t.SigningCosmosClient=t.decodeSignature=t.encodeSecp256k1Signature=t.findSequenceForSignedTx=t.encodeSecp256k1Pubkey=t.encodeBech32Pubkey=t.encodeAminoPubkey=t.decodeBech32Pubkey=t.decodeAminoPubkey=t.isMsgSend=t.isMsgDelegate=t.uint64ToString=t.uint64ToNumber=t.setupSupplyExtension=t.setupStakingExtension=t.setupSlashingExtension=t.setupMintExtension=t.setupGovExtension=t.setupDistributionExtension=t.setupBankExtension=t.setupAuthExtension=t.normalizePubkey=t.normalizeLcdApiArray=t.LcdClient=t.BroadcastMode=t.GasPrice=t.buildFeeTable=t.serializeSignDoc=t.makeSignDoc=t.isSearchByTagsQuery=t.isSearchBySentFromOrToQuery=t.isSearchByIdQuery=t.isSearchByHeightQuery=t.isBroadcastTxSuccess=t.isBroadcastTxFailure=t.CosmosClient=t.assertIsBroadcastTxSuccess=t.parseCoins=t.coins=t.coin=t.rawSecp256k1PubkeyToAddress=t.pubkeyToAddress=t.logs=void 0;const a=i(n(117));t.logs=a;var s=n(119);Object.defineProperty(t,"pubkeyToAddress",{enumerable:!0,get:function(){return s.pubkeyToAddress}}),Object.defineProperty(t,"rawSecp256k1PubkeyToAddress",{enumerable:!0,get:function(){return s.rawSecp256k1PubkeyToAddress}});var c=n(179);Object.defineProperty(t,"coin",{enumerable:!0,get:function(){return c.coin}}),Object.defineProperty(t,"coins",{enumerable:!0,get:function(){return c.coins}}),Object.defineProperty(t,"parseCoins",{enumerable:!0,get:function(){return c.parseCoins}});var u=n(180);Object.defineProperty(t,"assertIsBroadcastTxSuccess",{enumerable:!0,get:function(){return u.assertIsBroadcastTxSuccess}}),Object.defineProperty(t,"CosmosClient",{enumerable:!0,get:function(){return u.CosmosClient}}),Object.defineProperty(t,"isBroadcastTxFailure",{enumerable:!0,get:function(){return u.isBroadcastTxFailure}}),Object.defineProperty(t,"isBroadcastTxSuccess",{enumerable:!0,get:function(){return u.isBroadcastTxSuccess}}),Object.defineProperty(t,"isSearchByHeightQuery",{enumerable:!0,get:function(){return u.isSearchByHeightQuery}}),Object.defineProperty(t,"isSearchByIdQuery",{enumerable:!0,get:function(){return u.isSearchByIdQuery}}),Object.defineProperty(t,"isSearchBySentFromOrToQuery",{enumerable:!0,get:function(){return u.isSearchBySentFromOrToQuery}}),Object.defineProperty(t,"isSearchByTagsQuery",{enumerable:!0,get:function(){return u.isSearchByTagsQuery}});var d=n(66);Object.defineProperty(t,"makeSignDoc",{enumerable:!0,get:function(){return d.makeSignDoc}}),Object.defineProperty(t,"serializeSignDoc",{enumerable:!0,get:function(){return d.serializeSignDoc}});var l=n(190);Object.defineProperty(t,"buildFeeTable",{enumerable:!0,get:function(){return l.buildFeeTable}}),Object.defineProperty(t,"GasPrice",{enumerable:!0,get:function(){return l.GasPrice}});var f=n(93);Object.defineProperty(t,"BroadcastMode",{enumerable:!0,get:function(){return f.BroadcastMode}}),Object.defineProperty(t,"LcdClient",{enumerable:!0,get:function(){return f.LcdClient}}),Object.defineProperty(t,"normalizeLcdApiArray",{enumerable:!0,get:function(){return f.normalizeLcdApiArray}}),Object.defineProperty(t,"normalizePubkey",{enumerable:!0,get:function(){return f.normalizePubkey}}),Object.defineProperty(t,"setupAuthExtension",{enumerable:!0,get:function(){return f.setupAuthExtension}}),Object.defineProperty(t,"setupBankExtension",{enumerable:!0,get:function(){return f.setupBankExtension}}),Object.defineProperty(t,"setupDistributionExtension",{enumerable:!0,get:function(){return f.setupDistributionExtension}}),Object.defineProperty(t,"setupGovExtension",{enumerable:!0,get:function(){return f.setupGovExtension}}),Object.defineProperty(t,"setupMintExtension",{enumerable:!0,get:function(){return f.setupMintExtension}}),Object.defineProperty(t,"setupSlashingExtension",{enumerable:!0,get:function(){return f.setupSlashingExtension}}),Object.defineProperty(t,"setupStakingExtension",{enumerable:!0,get:function(){return f.setupStakingExtension}}),Object.defineProperty(t,"setupSupplyExtension",{enumerable:!0,get:function(){return f.setupSupplyExtension}}),Object.defineProperty(t,"uint64ToNumber",{enumerable:!0,get:function(){return f.uint64ToNumber}}),Object.defineProperty(t,"uint64ToString",{enumerable:!0,get:function(){return f.uint64ToString}});var h=n(415);Object.defineProperty(t,"isMsgDelegate",{enumerable:!0,get:function(){return h.isMsgDelegate}}),Object.defineProperty(t,"isMsgSend",{enumerable:!0,get:function(){return h.isMsgSend}});var p=n(95);Object.defineProperty(t,"decodeAminoPubkey",{enumerable:!0,get:function(){return p.decodeAminoPubkey}}),Object.defineProperty(t,"decodeBech32Pubkey",{enumerable:!0,get:function(){return p.decodeBech32Pubkey}}),Object.defineProperty(t,"encodeAminoPubkey",{enumerable:!0,get:function(){return p.encodeAminoPubkey}}),Object.defineProperty(t,"encodeBech32Pubkey",{enumerable:!0,get:function(){return p.encodeBech32Pubkey}}),Object.defineProperty(t,"encodeSecp256k1Pubkey",{enumerable:!0,get:function(){return p.encodeSecp256k1Pubkey}});var A=n(416);Object.defineProperty(t,"findSequenceForSignedTx",{enumerable:!0,get:function(){return A.findSequenceForSignedTx}});var g=n(96);Object.defineProperty(t,"encodeSecp256k1Signature",{enumerable:!0,get:function(){return g.encodeSecp256k1Signature}}),Object.defineProperty(t,"decodeSignature",{enumerable:!0,get:function(){return g.decodeSignature}});var m=n(417);Object.defineProperty(t,"SigningCosmosClient",{enumerable:!0,get:function(){return m.SigningCosmosClient}});var v=n(191);Object.defineProperty(t,"isStdTx",{enumerable:!0,get:function(){return v.isStdTx}}),Object.defineProperty(t,"isWrappedStdTx",{enumerable:!0,get:function(){return v.isWrappedStdTx}}),Object.defineProperty(t,"makeStdTx",{enumerable:!0,get:function(){return v.makeStdTx}});var y=n(65);Object.defineProperty(t,"pubkeyType",{enumerable:!0,get:function(){return y.pubkeyType}});var b=n(192);Object.defineProperty(t,"makeCosmoshubPath",{enumerable:!0,get:function(){return b.makeCosmoshubPath}}),Object.defineProperty(t,"executeKdf",{enumerable:!0,get:function(){return b.executeKdf}});var I=n(418);Object.defineProperty(t,"extractKdfConfiguration",{enumerable:!0,get:function(){return I.extractKdfConfiguration}}),Object.defineProperty(t,"Secp256k1HdWallet",{enumerable:!0,get:function(){return I.Secp256k1HdWallet}})},function(e,t,n){"use strict";t.byteLength=function(e){var t=u(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=u(e),a=r[0],s=r[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),d=0,l=s>0?a-4:a;for(n=0;n>16&255,c[d++]=t>>8&255,c[d++]=255&t;2===s&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,c[d++]=255&t);1===s&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,c[d++]=t>>8&255,c[d++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,s=n-o;as?s:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,c=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function d(e,t,n){for(var o,i,a=[],s=t;s>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t,n){"use strict";var r=n(2),o=n(122),i=n(4).Buffer,a=new Array(16);function s(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<>>32-t}function u(e,t,n,r,o,i,a){return c(e+(t&n|~t&r)+o+i|0,a)+t|0}function d(e,t,n,r,o,i,a){return c(e+(t&r|n&~r)+o+i|0,a)+t|0}function l(e,t,n,r,o,i,a){return c(e+(t^n^r)+o+i|0,a)+t|0}function f(e,t,n,r,o,i,a){return c(e+(n^(t|~r))+o+i|0,a)+t|0}r(s,o),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var n=this._a,r=this._b,o=this._c,i=this._d;n=u(n,r,o,i,e[0],3614090360,7),i=u(i,n,r,o,e[1],3905402710,12),o=u(o,i,n,r,e[2],606105819,17),r=u(r,o,i,n,e[3],3250441966,22),n=u(n,r,o,i,e[4],4118548399,7),i=u(i,n,r,o,e[5],1200080426,12),o=u(o,i,n,r,e[6],2821735955,17),r=u(r,o,i,n,e[7],4249261313,22),n=u(n,r,o,i,e[8],1770035416,7),i=u(i,n,r,o,e[9],2336552879,12),o=u(o,i,n,r,e[10],4294925233,17),r=u(r,o,i,n,e[11],2304563134,22),n=u(n,r,o,i,e[12],1804603682,7),i=u(i,n,r,o,e[13],4254626195,12),o=u(o,i,n,r,e[14],2792965006,17),n=d(n,r=u(r,o,i,n,e[15],1236535329,22),o,i,e[1],4129170786,5),i=d(i,n,r,o,e[6],3225465664,9),o=d(o,i,n,r,e[11],643717713,14),r=d(r,o,i,n,e[0],3921069994,20),n=d(n,r,o,i,e[5],3593408605,5),i=d(i,n,r,o,e[10],38016083,9),o=d(o,i,n,r,e[15],3634488961,14),r=d(r,o,i,n,e[4],3889429448,20),n=d(n,r,o,i,e[9],568446438,5),i=d(i,n,r,o,e[14],3275163606,9),o=d(o,i,n,r,e[3],4107603335,14),r=d(r,o,i,n,e[8],1163531501,20),n=d(n,r,o,i,e[13],2850285829,5),i=d(i,n,r,o,e[2],4243563512,9),o=d(o,i,n,r,e[7],1735328473,14),n=l(n,r=d(r,o,i,n,e[12],2368359562,20),o,i,e[5],4294588738,4),i=l(i,n,r,o,e[8],2272392833,11),o=l(o,i,n,r,e[11],1839030562,16),r=l(r,o,i,n,e[14],4259657740,23),n=l(n,r,o,i,e[1],2763975236,4),i=l(i,n,r,o,e[4],1272893353,11),o=l(o,i,n,r,e[7],4139469664,16),r=l(r,o,i,n,e[10],3200236656,23),n=l(n,r,o,i,e[13],681279174,4),i=l(i,n,r,o,e[0],3936430074,11),o=l(o,i,n,r,e[3],3572445317,16),r=l(r,o,i,n,e[6],76029189,23),n=l(n,r,o,i,e[9],3654602809,4),i=l(i,n,r,o,e[12],3873151461,11),o=l(o,i,n,r,e[15],530742520,16),n=f(n,r=l(r,o,i,n,e[2],3299628645,23),o,i,e[0],4096336452,6),i=f(i,n,r,o,e[7],1126891415,10),o=f(o,i,n,r,e[14],2878612391,15),r=f(r,o,i,n,e[5],4237533241,21),n=f(n,r,o,i,e[12],1700485571,6),i=f(i,n,r,o,e[3],2399980690,10),o=f(o,i,n,r,e[10],4293915773,15),r=f(r,o,i,n,e[1],2240044497,21),n=f(n,r,o,i,e[8],1873313359,6),i=f(i,n,r,o,e[15],4264355552,10),o=f(o,i,n,r,e[6],2734768916,15),r=f(r,o,i,n,e[13],1309151649,21),n=f(n,r,o,i,e[4],4149444226,6),i=f(i,n,r,o,e[11],3174756917,10),o=f(o,i,n,r,e[2],718787259,15),r=f(r,o,i,n,e[9],3951481745,21),this._a=this._a+n|0,this._b=this._b+r|0,this._c=this._c+o|0,this._d=this._d+i|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 e=i.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},function(e,t,n){(function(t){function n(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,n(3))},function(e,t,n){"use strict";var r=n(39).codes.ERR_STREAM_PREMATURE_CLOSE;function o(){}e.exports=function e(t,n,i){if("function"==typeof n)return e(t,null,n);n||(n={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),o=0;o-1?r:i.nextTick;v.WritableState=m;var u=Object.create(n(47));u.inherits=n(2);var d={deprecate:n(76)},l=n(132),f=n(79).Buffer,h=o.Uint8Array||function(){};var p,A=n(133);function g(){}function m(e,t){s=s||n(31),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var o=e.highWaterMark,u=e.writableHighWaterMark,d=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(u||0===u)?u:d,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 l=!1===e.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,o){--t.pendingcb,n?(i.nextTick(o,r),i.nextTick(_,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(o(r),e._writableState.errorEmitted=!0,e.emit("error",r),_(e,t))}(e,n,r,t,o);else{var a=w(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||I(e,n),r?c(b,e,n,a,o):b(e,n,a,o)}}(t,e)},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(e){if(s=s||n(31),!(p.call(v,this)||this instanceof s))return new v(e);this._writableState=new m(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function y(e,t,n,r,o,i,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function b(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),_(e,t)}function I(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,o=new Array(r),i=t.corkedRequestsFree;i.entry=n;for(var s=0,c=!0;n;)o[s]=n,n.isBuf||(c=!1),n=n.next,s+=1;o.allBuffers=c,y(e,t,!0,t.length,o,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;n;){var u=n.chunk,d=n.encoding,l=n.callback;if(y(e,t,!1,t.objectMode?1:u.length,u,d,l),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function w(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),_(e,t)}))}function _(e,t){var n=w(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(E,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}u.inherits(v,l),m.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(m.prototype,"buffer",{get:d.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===v&&(e&&e._writableState instanceof m)}})):p=function(e){return e instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(e,t,n){var r,o=this._writableState,a=!1,s=!o.objectMode&&(r=e,f.isBuffer(r)||r instanceof h);return s&&!f.isBuffer(e)&&(e=function(e){return f.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=g),o.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),i.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var o=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),i.nextTick(r,a),o=!1),o}(this,o,e,n))&&(o.pendingcb++,a=function(e,t,n,r,o,i){if(!n){var a=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=f.from(t,n));return t}(t,r,o);r!==a&&(n=!0,o="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var c=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,_(e,t),n&&(t.finished?i.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),v.prototype.destroy=A.destroy,v.prototype._undestroy=A.undestroy,v.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(6),n(288).setImmediate,n(3))},function(e,t,n){"use strict";var r=n(17);function o(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}e.exports=o,o.prototype._init=function(){},o.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},o.prototype._buffer=function(e,t){for(var n=Math.min(this.buffer.length-this.bufferOff,e.length-t),r=0;r0;r--)t+=this._buffer(e,t),n+=this._flushBuffer(o,n);return t+=this._buffer(e,t),o},o.prototype.final=function(e){var t,n;return e&&(t=this.update(e)),n="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(n):n},o.prototype._pad=function(e,t){if(0===t)return!1;for(;t=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function a(e,n){var o=function(e){var t=i(e);return{blinder:t.toRed(r.mont(e.modulus)).redPow(new r(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(n),a=n.modulus.byteLength(),s=new r(e).mul(o.blinder).umod(n.modulus),c=s.toRed(r.mont(n.prime1)),u=s.toRed(r.mont(n.prime2)),d=n.coefficient,l=n.prime1,f=n.prime2,h=c.redPow(n.exponent1).fromRed(),p=u.redPow(n.exponent2).fromRed(),A=h.isub(p).imul(d).umod(l).imul(f);return p.iadd(A).imul(o.unblinder).umod(n.modulus).toArrayLike(t,"be",a)}a.getr=i,e.exports=a}).call(this,n(7).Buffer)},function(e,t,n){"use strict";var r,o=t,i=n(88),a=n(163),s=n(18).assert;function c(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(e,t){Object.defineProperty(o,e,{configurable:!0,enumerable:!0,get:function(){var n=new c(t);return Object.defineProperty(o,e,{configurable:!0,enumerable:!0,value:n}),n}})}o.PresetCurve=c,u("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:i.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("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:i.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("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:i.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("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:i.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"]}),u("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:i.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"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["9"]}),u("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:i.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=n(356)}catch(e){r=void 0}u("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:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},function(e,t,n){var r=t;r.utils=n(23),r.common=n(51),r.sha=n(350),r.ripemd=n(354),r.hmac=n(355),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},function(e,t,n){"use strict";(function(t){var r,o=n(7),i=o.Buffer,a={};for(r in o)o.hasOwnProperty(r)&&"SlowBuffer"!==r&&"Buffer"!==r&&(a[r]=o[r]);var s=a.Buffer={};for(r in i)i.hasOwnProperty(r)&&"allocUnsafe"!==r&&"allocUnsafeSlow"!==r&&(s[r]=i[r]);if(a.Buffer.prototype=i.prototype,s.from&&s.from!==Uint8Array.from||(s.from=function(e,t,n){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return i(e,t,n)}),s.alloc||(s.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=i(e);return t&&0!==t.length?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r}),!a.kStringMaxLength)try{a.kStringMaxLength=t.binding("buffer").kStringMaxLength}catch(e){}a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),e.exports=a}).call(this,n(6))},function(e,t,n){"use strict";const r=n(91).Reporter,o=n(52).EncoderBuffer,i=n(52).DecoderBuffer,a=n(17),s=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],c=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s);function u(e,t,n){const r={};this._baseState=r,r.name=n,r.enc=e,r.parent=t||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}e.exports=u;const d=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];u.prototype.clone=function(){const e=this._baseState,t={};d.forEach((function(n){t[n]=e[n]}));const n=new this.constructor(t.parent);return n._baseState=t,n},u.prototype._wrap=function(){const e=this._baseState;c.forEach((function(t){this[t]=function(){const n=new this.constructor(this);return e.children.push(n),n[t].apply(n,arguments)}}),this)},u.prototype._init=function(e){const t=this._baseState;a(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),a.equal(t.children.length,1,"Root node can have only one child")},u.prototype._useArgs=function(e){const t=this._baseState,n=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==n.length&&(a(null===t.children),t.children=n,n.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(a(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;const t={};return Object.keys(e).forEach((function(n){n==(0|n)&&(n|=0);const r=e[n];t[r]=n})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){u.prototype[e]=function(){const t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),s.forEach((function(e){u.prototype[e]=function(){const t=this._baseState,n=Array.prototype.slice.call(arguments);return a(null===t.tag),t.tag=e,this._useArgs(n),this}})),u.prototype.use=function(e){a(e);const t=this._baseState;return a(null===t.use),t.use=e,this},u.prototype.optional=function(){return this._baseState.optional=!0,this},u.prototype.def=function(e){const t=this._baseState;return a(null===t.default),t.default=e,t.optional=!0,this},u.prototype.explicit=function(e){const t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.explicit=e,this},u.prototype.implicit=function(e){const t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.implicit=e,this},u.prototype.obj=function(){const e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},u.prototype.key=function(e){const t=this._baseState;return a(null===t.key),t.key=e,this},u.prototype.any=function(){return this._baseState.any=!0,this},u.prototype.choice=function(e){const t=this._baseState;return a(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},u.prototype.contains=function(e){const t=this._baseState;return a(null===t.use),t.contains=e,this},u.prototype._decode=function(e,t){const n=this._baseState;if(null===n.parent)return e.wrapResult(n.children[0]._decode(e,t));let r,o=n.default,a=!0,s=null;if(null!==n.key&&(s=e.enterKey(n.key)),n.optional){let r=null;if(null!==n.explicit?r=n.explicit:null!==n.implicit?r=n.implicit:null!==n.tag&&(r=n.tag),null!==r||n.any){if(a=this._peekTag(e,r,n.any),e.isError(a))return a}else{const r=e.save();try{null===n.choice?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),a=!0}catch(e){a=!1}e.restore(r)}}if(n.obj&&a&&(r=e.enterObject()),a){if(null!==n.explicit){const t=this._decodeTag(e,n.explicit);if(e.isError(t))return t;e=t}const r=e.offset;if(null===n.use&&null===n.choice){let t;n.any&&(t=e.save());const r=this._decodeTag(e,null!==n.implicit?n.implicit:n.tag,n.any);if(e.isError(r))return r;n.any?o=e.raw(t):e=r}if(t&&t.track&&null!==n.tag&&t.track(e.path(),r,e.length,"tagged"),t&&t.track&&null!==n.tag&&t.track(e.path(),e.offset,e.length,"content"),n.any||(o=null===n.choice?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t)),e.isError(o))return o;if(n.any||null!==n.choice||null===n.children||n.children.forEach((function(n){n._decode(e,t)})),n.contains&&("octstr"===n.tag||"bitstr"===n.tag)){const r=new i(o);o=this._getUse(n.contains,e._reporterState.obj)._decode(r,t)}}return n.obj&&a&&(o=e.leaveObject(r)),null===n.key||null===o&&!0!==a?null!==s&&e.exitKey(s):e.leaveKey(s,n.key,o),o},u.prototype._decodeGeneric=function(e,t,n){const r=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,r.args[0],n):/str$/.test(e)?this._decodeStr(t,e,n):"objid"===e&&r.args?this._decodeObjid(t,r.args[0],r.args[1],n):"objid"===e?this._decodeObjid(t,null,null,n):"gentime"===e||"utctime"===e?this._decodeTime(t,e,n):"null_"===e?this._decodeNull(t,n):"bool"===e?this._decodeBool(t,n):"objDesc"===e?this._decodeStr(t,e,n):"int"===e||"enum"===e?this._decodeInt(t,r.args&&r.args[0],n):null!==r.use?this._getUse(r.use,t._reporterState.obj)._decode(t,n):t.error("unknown tag: "+e)},u.prototype._getUse=function(e,t){const n=this._baseState;return n.useDecoder=this._use(e,t),a(null===n.useDecoder._baseState.parent),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder},u.prototype._decodeChoice=function(e,t){const n=this._baseState;let r=null,o=!1;return Object.keys(n.choice).some((function(i){const a=e.save(),s=n.choice[i];try{const n=s._decode(e,t);if(e.isError(n))return!1;r={type:i,value:n},o=!0}catch(t){return e.restore(a),!1}return!0}),this),o?r:e.error("Choice not matched")},u.prototype._createEncoderBuffer=function(e){return new o(e,this.reporter)},u.prototype._encode=function(e,t,n){const r=this._baseState;if(null!==r.default&&r.default===e)return;const o=this._encodeValue(e,t,n);return void 0===o||this._skipDefault(o,t,n)?void 0:o},u.prototype._encodeValue=function(e,t,n){const o=this._baseState;if(null===o.parent)return o.children[0]._encode(e,t||new r);let i=null;if(this.reporter=t,o.optional&&void 0===e){if(null===o.default)return;e=o.default}let a=null,s=!1;if(o.any)i=this._createEncoderBuffer(e);else if(o.choice)i=this._encodeChoice(e,t);else if(o.contains)a=this._getUse(o.contains,n)._encode(e,t),s=!0;else if(o.children)a=o.children.map((function(n){if("null_"===n._baseState.tag)return n._encode(null,t,e);if(null===n._baseState.key)return t.error("Child should have a key");const r=t.enterKey(n._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");const o=n._encode(e[n._baseState.key],t,e);return t.leaveKey(r),o}),this).filter((function(e){return e})),a=this._createEncoderBuffer(a);else if("seqof"===o.tag||"setof"===o.tag){if(!o.args||1!==o.args.length)return t.error("Too many args for : "+o.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");const n=this.clone();n._baseState.implicit=null,a=this._createEncoderBuffer(e.map((function(n){const r=this._baseState;return this._getUse(r.args[0],e)._encode(n,t)}),n))}else null!==o.use?i=this._getUse(o.use,n)._encode(e,t):(a=this._encodePrimitive(o.tag,e),s=!0);if(!o.any&&null===o.choice){const e=null!==o.implicit?o.implicit:o.tag,n=null===o.implicit?"universal":"context";null===e?null===o.use&&t.error("Tag could be omitted only for .use()"):null===o.use&&(i=this._encodeComposite(e,s,n,a))}return null!==o.explicit&&(i=this._encodeComposite(o.explicit,!1,"context",i)),i},u.prototype._encodeChoice=function(e,t){const n=this._baseState,r=n.choice[e.type];return r||a(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),r._encode(e.value,t)},u.prototype._encodePrimitive=function(e,t){const n=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&n.args)return this._encodeObjid(t,n.reverseArgs[0],n.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,n.args&&n.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},u.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},u.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},function(e,t,n){"use strict";const r=n(2);function o(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function i(e,t){this.path=e,this.rethrow(t)}t.Reporter=o,o.prototype.isError=function(e){return e instanceof i},o.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},o.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},o.prototype.enterKey=function(e){return this._reporterState.path.push(e)},o.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},o.prototype.leaveKey=function(e,t,n){const r=this._reporterState;this.exitKey(e),null!==r.obj&&(r.obj[t]=n)},o.prototype.path=function(){return this._reporterState.path.join("/")},o.prototype.enterObject=function(){const e=this._reporterState,t=e.obj;return e.obj={},t},o.prototype.leaveObject=function(e){const t=this._reporterState,n=t.obj;return t.obj=e,n},o.prototype.error=function(e){let t;const n=this._reporterState,r=e instanceof i;if(t=r?e:new i(n.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!n.options.partial)throw t;return r||n.errors.push(t),t},o.prototype.wrapResult=function(e){const t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},r(i,Error),i.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,i),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},function(e,t,n){"use strict";function r(e){const t={};return Object.keys(e).forEach((function(n){(0|n)==n&&(n|=0);const r=e[n];t[r]=n})),t}t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=r(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=r(t.tag)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint64ToString=t.uint64ToNumber=t.normalizePubkey=t.normalizeLcdApiArray=t.LcdClient=t.BroadcastMode=t.setupSupplyExtension=t.setupStakingExtension=t.setupSlashingExtension=t.setupMintExtension=t.setupGovExtension=t.setupDistributionExtension=t.setupBankExtension=t.setupAuthExtension=void 0;var r=n(386);Object.defineProperty(t,"setupAuthExtension",{enumerable:!0,get:function(){return r.setupAuthExtension}});var o=n(387);Object.defineProperty(t,"setupBankExtension",{enumerable:!0,get:function(){return o.setupBankExtension}});var i=n(388);Object.defineProperty(t,"setupDistributionExtension",{enumerable:!0,get:function(){return i.setupDistributionExtension}});var a=n(389);Object.defineProperty(t,"setupGovExtension",{enumerable:!0,get:function(){return a.setupGovExtension}});var s=n(390);Object.defineProperty(t,"setupMintExtension",{enumerable:!0,get:function(){return s.setupMintExtension}});var c=n(391);Object.defineProperty(t,"setupSlashingExtension",{enumerable:!0,get:function(){return c.setupSlashingExtension}});var u=n(392);Object.defineProperty(t,"setupStakingExtension",{enumerable:!0,get:function(){return u.setupStakingExtension}});var d=n(393);Object.defineProperty(t,"setupSupplyExtension",{enumerable:!0,get:function(){return d.setupSupplyExtension}});var l=n(181);Object.defineProperty(t,"BroadcastMode",{enumerable:!0,get:function(){return l.BroadcastMode}});var f=n(394);Object.defineProperty(t,"LcdClient",{enumerable:!0,get:function(){return f.LcdClient}}),Object.defineProperty(t,"normalizeLcdApiArray",{enumerable:!0,get:function(){return f.normalizeLcdApiArray}});var h=n(414);Object.defineProperty(t,"normalizePubkey",{enumerable:!0,get:function(){return h.normalizePubkey}}),Object.defineProperty(t,"uint64ToNumber",{enumerable:!0,get:function(){return h.uint64ToNumber}}),Object.defineProperty(t,"uint64ToString",{enumerable:!0,get:function(){return h.uint64ToString}})},function(e,t,n){"use strict";(function(t){var r=n(13),o=n(401),i=n(184),a={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(c=n(185)),c),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(s(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,n=t&&t.silentJSONParsing,o=t&&t.forcedJSONParsing,a=!n&&"json"===this.responseType;if(a||o&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw i(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){u.headers[e]=r.merge(a)})),e.exports=u}).call(this,n(6))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodeBech32Pubkey=t.encodeAminoPubkey=t.decodeBech32Pubkey=t.decodeAminoPubkey=t.encodeSecp256k1Pubkey=void 0;const r=n(22),o=n(45),i=n(65);t.encodeSecp256k1Pubkey=function(e){if(33!==e.length||2!==e[0]&&3!==e[0])throw new Error("Public key must be compressed secp256k1, i.e. 33 bytes starting with 0x02 or 0x03");return{type:i.pubkeyType.secp256k1,value:r.toBase64(e)}};const a=r.fromHex("eb5ae98721"),s=r.fromHex("1624de6420"),c=r.fromHex("0dfb1005"),u=a.length;function d(e){const t=e.slice(0,u),n=e.slice(u);if(o.arrayContentEquals(t,a)){if(33!==n.length)throw new Error("Invalid rest data length. Expected 33 bytes (compressed secp256k1 pubkey).");return{type:i.pubkeyType.secp256k1,value:r.toBase64(n)}}if(o.arrayContentEquals(t,s)){if(32!==n.length)throw new Error("Invalid rest data length. Expected 32 bytes (Ed25519 pubkey).");return{type:i.pubkeyType.ed25519,value:r.toBase64(n)}}if(o.arrayContentEquals(t,c)){if(32!==n.length)throw new Error("Invalid rest data length. Expected 32 bytes (Sr25519 pubkey).");return{type:i.pubkeyType.sr25519,value:r.toBase64(n)}}throw new Error("Unsupported Pubkey type. Amino prefix: "+r.toHex(t))}function l(e){let t;switch(e.type){case i.pubkeyType.secp256k1:t=a;break;case i.pubkeyType.ed25519:t=s;break;default:throw new Error("Unsupported pubkey type")}return new Uint8Array([...t,...r.fromBase64(e.value)])}t.decodeAminoPubkey=d,t.decodeBech32Pubkey=function(e){const{data:t}=r.Bech32.decode(e);return d(t)},t.encodeAminoPubkey=l,t.encodeBech32Pubkey=function(e,t){return r.Bech32.encode(t,l(e))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeSignature=t.encodeSecp256k1Signature=void 0;const r=n(22),o=n(95),i=n(65);t.encodeSecp256k1Signature=function(e,t){if(64!==t.length)throw new Error("Signature must be 64 bytes long. Cosmos SDK uses a 2x32 byte fixed length encoding for the secp256k1 signature integers r and s.");return{pub_key:o.encodeSecp256k1Pubkey(e),signature:r.toBase64(t)}},t.decodeSignature=function(e){switch(e.pub_key.type){case i.pubkeyType.secp256k1:return{pubkey:r.fromBase64(e.pub_key.value),signature:r.fromBase64(e.signature)};default:throw new Error("Unsupported pubkey type")}}},function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompactBitArray=t.MultiSignature=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1));t.protobufPackage="cosmos.crypto.multisig.v1beta1";const a={};t.MultiSignature={encode(e,t=i.default.Writer.create()){for(const n of e.signatures)t.uint32(10).bytes(n);return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},a);for(o.signatures=[];n.pos>>3){case 1:o.signatures.push(n.bytes());break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},a);return n.signatures=(null!==(t=e.signatures)&&void 0!==t?t:[]).map(e=>d(e)),n},toJSON(e){const t={};return e.signatures?t.signatures=e.signatures.map(e=>f(void 0!==e?e:new Uint8Array)):t.signatures=[],t},fromPartial(e){var t;const n=Object.assign({},a);return n.signatures=(null===(t=e.signatures)||void 0===t?void 0:t.map(e=>e))||[],n}};const s={extraBitsStored:0};t.CompactBitArray={encode:(e,t=i.default.Writer.create())=>(0!==e.extraBitsStored&&t.uint32(8).uint32(e.extraBitsStored),0!==e.elems.length&&t.uint32(18).bytes(e.elems),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},s);for(o.elems=new Uint8Array;n.pos>>3){case 1:o.extraBitsStored=n.uint32();break;case 2:o.elems=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},s);return t.extraBitsStored=void 0!==e.extraBitsStored&&null!==e.extraBitsStored?Number(e.extraBitsStored):0,t.elems=void 0!==e.elems&&null!==e.elems?d(e.elems):new Uint8Array,t},toJSON(e){const t={};return void 0!==e.extraBitsStored&&(t.extraBitsStored=e.extraBitsStored),void 0!==e.elems&&(t.elems=f(void 0!==e.elems?e.elems:new Uint8Array)),t},fromPartial(e){var t,n;const r=Object.assign({},s);return r.extraBitsStored=null!==(t=e.extraBitsStored)&&void 0!==t?t:0,r.elems=null!==(n=e.elems)&&void 0!==n?n:new Uint8Array,r}};var c=(()=>{if(void 0!==c)return c;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw"Unable to locate global object"})();const u=c.atob||(e=>c.Buffer.from(e,"base64").toString("binary"));function d(e){const t=u(e),n=new Uint8Array(t.length);for(let e=0;ec.Buffer.from(e,"binary").toString("base64"));function f(e){const t=[];for(const n of e)t.push(String.fromCharCode(n));return l(t.join(""))}i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())}).call(this,n(3))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha384=t.sha512_256=t.sha512=t.SHA512=void 0;const r=n(99),o=n(196),i=n(36),[a,s]=o.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),c=new Uint32Array(80),u=new Uint32Array(80);class d extends r.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:n,Bl:r,Ch:o,Cl:i,Dh:a,Dl:s,Eh:c,El:u,Fh:d,Fl:l,Gh:f,Gl:h,Hh:p,Hl:A}=this;return[e,t,n,r,o,i,a,s,c,u,d,l,f,h,p,A]}set(e,t,n,r,o,i,a,s,c,u,d,l,f,h,p,A){this.Ah=0|e,this.Al=0|t,this.Bh=0|n,this.Bl=0|r,this.Ch=0|o,this.Cl=0|i,this.Dh=0|a,this.Dl=0|s,this.Eh=0|c,this.El=0|u,this.Fh=0|d,this.Fl=0|l,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|A}process(e,t){for(let n=0;n<16;n++,t+=4)c[n]=e.getUint32(t),u[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|c[e-15],n=0|u[e-15],r=o.default.rotrSH(t,n,1)^o.default.rotrSH(t,n,8)^o.default.shrSH(t,n,7),i=o.default.rotrSL(t,n,1)^o.default.rotrSL(t,n,8)^o.default.shrSL(t,n,7),a=0|c[e-2],s=0|u[e-2],d=o.default.rotrSH(a,s,19)^o.default.rotrBH(a,s,61)^o.default.shrSH(a,s,6),l=o.default.rotrSL(a,s,19)^o.default.rotrBL(a,s,61)^o.default.shrSL(a,s,6),f=o.default.add4L(i,l,u[e-7],u[e-16]),h=o.default.add4H(f,r,d,c[e-7],c[e-16]);c[e]=0|h,u[e]=0|f}let{Ah:n,Al:r,Bh:i,Bl:d,Ch:l,Cl:f,Dh:h,Dl:p,Eh:A,El:g,Fh:m,Fl:v,Gh:y,Gl:b,Hh:I,Hl:w}=this;for(let e=0;e<80;e++){const t=o.default.rotrSH(A,g,14)^o.default.rotrSH(A,g,18)^o.default.rotrBH(A,g,41),E=o.default.rotrSL(A,g,14)^o.default.rotrSL(A,g,18)^o.default.rotrBL(A,g,41),_=A&m^~A&y,B=g&v^~g&b,C=o.default.add5L(w,E,B,s[e],u[e]),k=o.default.add5H(C,I,t,_,a[e],c[e]),S=0|C,O=o.default.rotrSH(n,r,28)^o.default.rotrBH(n,r,34)^o.default.rotrBH(n,r,39),Q=o.default.rotrSL(n,r,28)^o.default.rotrBL(n,r,34)^o.default.rotrBL(n,r,39),P=n&i^n&l^i&l,R=r&d^r&f^d&f;I=0|y,w=0|b,y=0|m,b=0|v,m=0|A,v=0|g,({h:A,l:g}=o.default.add(0|h,0|p,0|k,0|S)),h=0|l,p=0|f,l=0|i,f=0|d,i=0|n,d=0|r;const M=o.default.add3L(S,Q,R);n=o.default.add3H(M,k,O,P),r=0|M}({h:n,l:r}=o.default.add(0|this.Ah,0|this.Al,0|n,0|r)),({h:i,l:d}=o.default.add(0|this.Bh,0|this.Bl,0|i,0|d)),({h:l,l:f}=o.default.add(0|this.Ch,0|this.Cl,0|l,0|f)),({h:h,l:p}=o.default.add(0|this.Dh,0|this.Dl,0|h,0|p)),({h:A,l:g}=o.default.add(0|this.Eh,0|this.El,0|A,0|g)),({h:m,l:v}=o.default.add(0|this.Fh,0|this.Fl,0|m,0|v)),({h:y,l:b}=o.default.add(0|this.Gh,0|this.Gl,0|y,0|b)),({h:I,l:w}=o.default.add(0|this.Hh,0|this.Hl,0|I,0|w)),this.set(n,r,i,d,l,f,h,p,A,g,m,v,y,b,I,w)}roundClean(){c.fill(0),u.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}t.SHA512=d;class l extends d{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class f extends d{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}t.sha512=(0,i.wrapConstructor)(()=>new d),t.sha512_256=(0,i.wrapConstructor)(()=>new l),t.sha384=(0,i.wrapConstructor)(()=>new f)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;const r=n(68),o=n(36);class i extends o.Hash{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,o.createView)(this.buffer)}update(e){r.default.exists(this);const{view:t,buffer:n,blockLen:i}=this,a=(e=(0,o.toBytes)(e)).length;for(let r=0;ri-s&&(this.process(n,0),s=0);for(let e=s;e>o&i),s=Number(n&i),c=r?4:0,u=r?0:4;e.setUint32(t+c,a,r),e.setUint32(t+u,s,r)}(n,i-8,BigInt(8*this.length),a),this.process(n,0);const c=(0,o.createView)(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const d=this.get(),l=u/4;if(l>d.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e0;){if(18!=t.shift())throw new Error("Invalid multisig data. Expecting 0x12 prefix before participant pubkey length.");const[e,n]=f(t);if(t.splice(0,n),t.length127)throw new Error("Decoding numbers > 127 is not supported here. Please tell those lazy CosmJS maintainers to port the binary.Varint implementation from the Go standard library and write some tests.");return[e[0],1]}function h(e){const t=o.Uint53.fromString(e.toString()).toNumber();if(t>127)throw new Error("Encoding numbers > 127 is not supported here. Please tell those lazy CosmJS maintainers to port the binary.PutUvarint implementation from the Go standard library and write some tests.");return[t]}function p(e){if((0,a.isMultisigThresholdPubkey)(e)){const t=Array.from(d);t.push(8),t.push(...h(e.value.threshold));for(const n of e.value.pubkeys.map(e=>p(e)))t.push(18),t.push(...h(n.length)),t.push(...n);return new Uint8Array(t)}if((0,a.isEd25519Pubkey)(e))return new Uint8Array([...c,...(0,r.fromBase64)(e.value)]);if((0,a.isSecp256k1Pubkey)(e))return new Uint8Array([...s,...(0,r.fromBase64)(e.value)]);throw new Error("Unsupported pubkey type")}t.decodeAminoPubkey=l,t.decodeBech32Pubkey=function(e){const{data:t}=(0,r.fromBech32)(e);return l(t)},t.encodeAminoPubkey=p,t.encodeBech32Pubkey=function(e,t){return(0,r.toBech32)(t,p(e))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeSignature=t.encodeSecp256k1Signature=void 0;const r=n(5),o=n(102),i=n(69);t.encodeSecp256k1Signature=function(e,t){if(64!==t.length)throw new Error("Signature must be 64 bytes long. Cosmos SDK uses a 2x32 byte fixed length encoding for the secp256k1 signature integers r and s.");return{pub_key:(0,o.encodeSecp256k1Pubkey)(e),signature:(0,r.toBase64)(t)}},t.decodeSignature=function(e){switch(e.pub_key.type){case i.pubkeyType.secp256k1:return{pubkey:(0,r.fromBase64)(e.pub_key.value),signature:(0,r.fromBase64)(e.signature)};default:throw new Error("Unsupported pubkey type")}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeSignDoc=t.makeSignDoc=t.sortedJsonStringify=void 0;const r=n(5),o=n(11);function i(e){if("object"!=typeof e||null===e)return e;if(Array.isArray(e))return e.map(i);const t=Object.keys(e).sort(),n={};return t.forEach(t=>{n[t]=i(e[t])}),n}function a(e){return JSON.stringify(i(e))}t.sortedJsonStringify=a,t.makeSignDoc=function(e,t,n,r,i,a){return{chain_id:n,account_number:o.Uint53.fromString(i.toString()).toString(),sequence:o.Uint53.fromString(a.toString()).toString(),fee:t,msgs:e,memo:r||""}},t.serializeSignDoc=function(e){return(0,r.toUtf8)(a(e))}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.makeSignBytes=t.makeSignDoc=t.makeAuthInfoBytes=void 0;const o=n(53),i=n(25),a=r(n(0));function s(e,t){return e.map(({pubkey:e,sequence:n})=>({publicKey:e,modeInfo:{single:{mode:t}},sequence:a.default.fromNumber(n)}))}t.makeAuthInfoBytes=function(e,t,n,r=o.SignMode.SIGN_MODE_DIRECT){const c={signerInfos:s(e,r),fee:{amount:[...t],gasLimit:a.default.fromNumber(n)}};return i.AuthInfo.encode(i.AuthInfo.fromPartial(c)).finish()},t.makeSignDoc=function(e,t,n,r){return{bodyBytes:e,authInfoBytes:t,chainId:n,accountNumber:a.default.fromNumber(r)}},t.makeSignBytes=function({accountNumber:e,authInfoBytes:t,bodyBytes:n,chainId:r}){const o=i.SignDoc.fromPartial({accountNumber:e,authInfoBytes:t,bodyBytes:n,chainId:r});return i.SignDoc.encode(o).finish()}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Params=t.ModuleAccount=t.BaseAccount=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(9);t.protobufPackage="cosmos.auth.v1beta1";const s={address:"",accountNumber:o.default.UZERO,sequence:o.default.UZERO};t.BaseAccount={encode:(e,t=i.default.Writer.create())=>(""!==e.address&&t.uint32(10).string(e.address),void 0!==e.pubKey&&a.Any.encode(e.pubKey,t.uint32(18).fork()).ldelim(),e.accountNumber.isZero()||t.uint32(24).uint64(e.accountNumber),e.sequence.isZero()||t.uint32(32).uint64(e.sequence),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},s);for(;n.pos>>3){case 1:o.address=n.string();break;case 2:o.pubKey=a.Any.decode(n,n.uint32());break;case 3:o.accountNumber=n.uint64();break;case 4:o.sequence=n.uint64();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},s);return t.address=void 0!==e.address&&null!==e.address?String(e.address):"",t.pubKey=void 0!==e.pubKey&&null!==e.pubKey?a.Any.fromJSON(e.pubKey):void 0,t.accountNumber=void 0!==e.accountNumber&&null!==e.accountNumber?o.default.fromString(e.accountNumber):o.default.UZERO,t.sequence=void 0!==e.sequence&&null!==e.sequence?o.default.fromString(e.sequence):o.default.UZERO,t},toJSON(e){const t={};return void 0!==e.address&&(t.address=e.address),void 0!==e.pubKey&&(t.pubKey=e.pubKey?a.Any.toJSON(e.pubKey):void 0),void 0!==e.accountNumber&&(t.accountNumber=(e.accountNumber||o.default.UZERO).toString()),void 0!==e.sequence&&(t.sequence=(e.sequence||o.default.UZERO).toString()),t},fromPartial(e){var t;const n=Object.assign({},s);return n.address=null!==(t=e.address)&&void 0!==t?t:"",n.pubKey=void 0!==e.pubKey&&null!==e.pubKey?a.Any.fromPartial(e.pubKey):void 0,n.accountNumber=void 0!==e.accountNumber&&null!==e.accountNumber?o.default.fromValue(e.accountNumber):o.default.UZERO,n.sequence=void 0!==e.sequence&&null!==e.sequence?o.default.fromValue(e.sequence):o.default.UZERO,n}};const c={name:"",permissions:""};t.ModuleAccount={encode(e,n=i.default.Writer.create()){void 0!==e.baseAccount&&t.BaseAccount.encode(e.baseAccount,n.uint32(10).fork()).ldelim(),""!==e.name&&n.uint32(18).string(e.name);for(const t of e.permissions)n.uint32(26).string(t);return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},c);for(a.permissions=[];r.pos>>3){case 1:a.baseAccount=t.BaseAccount.decode(r,r.uint32());break;case 2:a.name=r.string();break;case 3:a.permissions.push(r.string());break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},c);return r.baseAccount=void 0!==e.baseAccount&&null!==e.baseAccount?t.BaseAccount.fromJSON(e.baseAccount):void 0,r.name=void 0!==e.name&&null!==e.name?String(e.name):"",r.permissions=(null!==(n=e.permissions)&&void 0!==n?n:[]).map(e=>String(e)),r},toJSON(e){const n={};return void 0!==e.baseAccount&&(n.baseAccount=e.baseAccount?t.BaseAccount.toJSON(e.baseAccount):void 0),void 0!==e.name&&(n.name=e.name),e.permissions?n.permissions=e.permissions.map(e=>e):n.permissions=[],n},fromPartial(e){var n,r;const o=Object.assign({},c);return o.baseAccount=void 0!==e.baseAccount&&null!==e.baseAccount?t.BaseAccount.fromPartial(e.baseAccount):void 0,o.name=null!==(n=e.name)&&void 0!==n?n:"",o.permissions=(null===(r=e.permissions)||void 0===r?void 0:r.map(e=>e))||[],o}};const u={maxMemoCharacters:o.default.UZERO,txSigLimit:o.default.UZERO,txSizeCostPerByte:o.default.UZERO,sigVerifyCostEd25519:o.default.UZERO,sigVerifyCostSecp256k1:o.default.UZERO};t.Params={encode:(e,t=i.default.Writer.create())=>(e.maxMemoCharacters.isZero()||t.uint32(8).uint64(e.maxMemoCharacters),e.txSigLimit.isZero()||t.uint32(16).uint64(e.txSigLimit),e.txSizeCostPerByte.isZero()||t.uint32(24).uint64(e.txSizeCostPerByte),e.sigVerifyCostEd25519.isZero()||t.uint32(32).uint64(e.sigVerifyCostEd25519),e.sigVerifyCostSecp256k1.isZero()||t.uint32(40).uint64(e.sigVerifyCostSecp256k1),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},u);for(;n.pos>>3){case 1:o.maxMemoCharacters=n.uint64();break;case 2:o.txSigLimit=n.uint64();break;case 3:o.txSizeCostPerByte=n.uint64();break;case 4:o.sigVerifyCostEd25519=n.uint64();break;case 5:o.sigVerifyCostSecp256k1=n.uint64();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},u);return t.maxMemoCharacters=void 0!==e.maxMemoCharacters&&null!==e.maxMemoCharacters?o.default.fromString(e.maxMemoCharacters):o.default.UZERO,t.txSigLimit=void 0!==e.txSigLimit&&null!==e.txSigLimit?o.default.fromString(e.txSigLimit):o.default.UZERO,t.txSizeCostPerByte=void 0!==e.txSizeCostPerByte&&null!==e.txSizeCostPerByte?o.default.fromString(e.txSizeCostPerByte):o.default.UZERO,t.sigVerifyCostEd25519=void 0!==e.sigVerifyCostEd25519&&null!==e.sigVerifyCostEd25519?o.default.fromString(e.sigVerifyCostEd25519):o.default.UZERO,t.sigVerifyCostSecp256k1=void 0!==e.sigVerifyCostSecp256k1&&null!==e.sigVerifyCostSecp256k1?o.default.fromString(e.sigVerifyCostSecp256k1):o.default.UZERO,t},toJSON(e){const t={};return void 0!==e.maxMemoCharacters&&(t.maxMemoCharacters=(e.maxMemoCharacters||o.default.UZERO).toString()),void 0!==e.txSigLimit&&(t.txSigLimit=(e.txSigLimit||o.default.UZERO).toString()),void 0!==e.txSizeCostPerByte&&(t.txSizeCostPerByte=(e.txSizeCostPerByte||o.default.UZERO).toString()),void 0!==e.sigVerifyCostEd25519&&(t.sigVerifyCostEd25519=(e.sigVerifyCostEd25519||o.default.UZERO).toString()),void 0!==e.sigVerifyCostSecp256k1&&(t.sigVerifyCostSecp256k1=(e.sigVerifyCostSecp256k1||o.default.UZERO).toString()),t},fromPartial(e){const t=Object.assign({},u);return t.maxMemoCharacters=void 0!==e.maxMemoCharacters&&null!==e.maxMemoCharacters?o.default.fromValue(e.maxMemoCharacters):o.default.UZERO,t.txSigLimit=void 0!==e.txSigLimit&&null!==e.txSigLimit?o.default.fromValue(e.txSigLimit):o.default.UZERO,t.txSizeCostPerByte=void 0!==e.txSizeCostPerByte&&null!==e.txSizeCostPerByte?o.default.fromValue(e.txSizeCostPerByte):o.default.UZERO,t.sigVerifyCostEd25519=void 0!==e.sigVerifyCostEd25519&&null!==e.sigVerifyCostEd25519?o.default.fromValue(e.sigVerifyCostEd25519):o.default.UZERO,t.sigVerifyCostSecp256k1=void 0!==e.sigVerifyCostSecp256k1&&null!==e.sigVerifyCostSecp256k1?o.default.fromValue(e.sigVerifyCostSecp256k1):o.default.UZERO,t}},i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())},function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TallyParams=t.VotingParams=t.DepositParams=t.Vote=t.TallyResult=t.Proposal=t.Deposit=t.TextProposal=t.WeightedVoteOption=t.proposalStatusToJSON=t.proposalStatusFromJSON=t.ProposalStatus=t.voteOptionToJSON=t.voteOptionFromJSON=t.VoteOption=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(9),s=n(27),c=n(55),u=n(10);var d,l;function f(e){switch(e){case 0:case"VOTE_OPTION_UNSPECIFIED":return d.VOTE_OPTION_UNSPECIFIED;case 1:case"VOTE_OPTION_YES":return d.VOTE_OPTION_YES;case 2:case"VOTE_OPTION_ABSTAIN":return d.VOTE_OPTION_ABSTAIN;case 3:case"VOTE_OPTION_NO":return d.VOTE_OPTION_NO;case 4:case"VOTE_OPTION_NO_WITH_VETO":return d.VOTE_OPTION_NO_WITH_VETO;case-1:case"UNRECOGNIZED":default:return d.UNRECOGNIZED}}function h(e){switch(e){case d.VOTE_OPTION_UNSPECIFIED:return"VOTE_OPTION_UNSPECIFIED";case d.VOTE_OPTION_YES:return"VOTE_OPTION_YES";case d.VOTE_OPTION_ABSTAIN:return"VOTE_OPTION_ABSTAIN";case d.VOTE_OPTION_NO:return"VOTE_OPTION_NO";case d.VOTE_OPTION_NO_WITH_VETO:return"VOTE_OPTION_NO_WITH_VETO";default:return"UNKNOWN"}}function p(e){switch(e){case 0:case"PROPOSAL_STATUS_UNSPECIFIED":return l.PROPOSAL_STATUS_UNSPECIFIED;case 1:case"PROPOSAL_STATUS_DEPOSIT_PERIOD":return l.PROPOSAL_STATUS_DEPOSIT_PERIOD;case 2:case"PROPOSAL_STATUS_VOTING_PERIOD":return l.PROPOSAL_STATUS_VOTING_PERIOD;case 3:case"PROPOSAL_STATUS_PASSED":return l.PROPOSAL_STATUS_PASSED;case 4:case"PROPOSAL_STATUS_REJECTED":return l.PROPOSAL_STATUS_REJECTED;case 5:case"PROPOSAL_STATUS_FAILED":return l.PROPOSAL_STATUS_FAILED;case-1:case"UNRECOGNIZED":default:return l.UNRECOGNIZED}}function A(e){switch(e){case l.PROPOSAL_STATUS_UNSPECIFIED:return"PROPOSAL_STATUS_UNSPECIFIED";case l.PROPOSAL_STATUS_DEPOSIT_PERIOD:return"PROPOSAL_STATUS_DEPOSIT_PERIOD";case l.PROPOSAL_STATUS_VOTING_PERIOD:return"PROPOSAL_STATUS_VOTING_PERIOD";case l.PROPOSAL_STATUS_PASSED:return"PROPOSAL_STATUS_PASSED";case l.PROPOSAL_STATUS_REJECTED:return"PROPOSAL_STATUS_REJECTED";case l.PROPOSAL_STATUS_FAILED:return"PROPOSAL_STATUS_FAILED";default:return"UNKNOWN"}}t.protobufPackage="cosmos.gov.v1beta1",function(e){e[e.VOTE_OPTION_UNSPECIFIED=0]="VOTE_OPTION_UNSPECIFIED",e[e.VOTE_OPTION_YES=1]="VOTE_OPTION_YES",e[e.VOTE_OPTION_ABSTAIN=2]="VOTE_OPTION_ABSTAIN",e[e.VOTE_OPTION_NO=3]="VOTE_OPTION_NO",e[e.VOTE_OPTION_NO_WITH_VETO=4]="VOTE_OPTION_NO_WITH_VETO",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(d=t.VoteOption||(t.VoteOption={})),t.voteOptionFromJSON=f,t.voteOptionToJSON=h,function(e){e[e.PROPOSAL_STATUS_UNSPECIFIED=0]="PROPOSAL_STATUS_UNSPECIFIED",e[e.PROPOSAL_STATUS_DEPOSIT_PERIOD=1]="PROPOSAL_STATUS_DEPOSIT_PERIOD",e[e.PROPOSAL_STATUS_VOTING_PERIOD=2]="PROPOSAL_STATUS_VOTING_PERIOD",e[e.PROPOSAL_STATUS_PASSED=3]="PROPOSAL_STATUS_PASSED",e[e.PROPOSAL_STATUS_REJECTED=4]="PROPOSAL_STATUS_REJECTED",e[e.PROPOSAL_STATUS_FAILED=5]="PROPOSAL_STATUS_FAILED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(l=t.ProposalStatus||(t.ProposalStatus={})),t.proposalStatusFromJSON=p,t.proposalStatusToJSON=A;const g={option:0,weight:""};t.WeightedVoteOption={encode:(e,t=i.default.Writer.create())=>(0!==e.option&&t.uint32(8).int32(e.option),""!==e.weight&&t.uint32(18).string(e.weight),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},g);for(;n.pos>>3){case 1:o.option=n.int32();break;case 2:o.weight=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},g);return t.option=void 0!==e.option&&null!==e.option?f(e.option):0,t.weight=void 0!==e.weight&&null!==e.weight?String(e.weight):"",t},toJSON(e){const t={};return void 0!==e.option&&(t.option=h(e.option)),void 0!==e.weight&&(t.weight=e.weight),t},fromPartial(e){var t,n;const r=Object.assign({},g);return r.option=null!==(t=e.option)&&void 0!==t?t:0,r.weight=null!==(n=e.weight)&&void 0!==n?n:"",r}};const m={title:"",description:""};t.TextProposal={encode:(e,t=i.default.Writer.create())=>(""!==e.title&&t.uint32(10).string(e.title),""!==e.description&&t.uint32(18).string(e.description),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},m);for(;n.pos>>3){case 1:o.title=n.string();break;case 2:o.description=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},m);return t.title=void 0!==e.title&&null!==e.title?String(e.title):"",t.description=void 0!==e.description&&null!==e.description?String(e.description):"",t},toJSON(e){const t={};return void 0!==e.title&&(t.title=e.title),void 0!==e.description&&(t.description=e.description),t},fromPartial(e){var t,n;const r=Object.assign({},m);return r.title=null!==(t=e.title)&&void 0!==t?t:"",r.description=null!==(n=e.description)&&void 0!==n?n:"",r}};const v={proposalId:o.default.UZERO,depositor:""};t.Deposit={encode(e,t=i.default.Writer.create()){e.proposalId.isZero()||t.uint32(8).uint64(e.proposalId),""!==e.depositor&&t.uint32(18).string(e.depositor);for(const n of e.amount)u.Coin.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},v);for(o.amount=[];n.pos>>3){case 1:o.proposalId=n.uint64();break;case 2:o.depositor=n.string();break;case 3:o.amount.push(u.Coin.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},v);return n.proposalId=void 0!==e.proposalId&&null!==e.proposalId?o.default.fromString(e.proposalId):o.default.UZERO,n.depositor=void 0!==e.depositor&&null!==e.depositor?String(e.depositor):"",n.amount=(null!==(t=e.amount)&&void 0!==t?t:[]).map(e=>u.Coin.fromJSON(e)),n},toJSON(e){const t={};return void 0!==e.proposalId&&(t.proposalId=(e.proposalId||o.default.UZERO).toString()),void 0!==e.depositor&&(t.depositor=e.depositor),e.amount?t.amount=e.amount.map(e=>e?u.Coin.toJSON(e):void 0):t.amount=[],t},fromPartial(e){var t,n;const r=Object.assign({},v);return r.proposalId=void 0!==e.proposalId&&null!==e.proposalId?o.default.fromValue(e.proposalId):o.default.UZERO,r.depositor=null!==(t=e.depositor)&&void 0!==t?t:"",r.amount=(null===(n=e.amount)||void 0===n?void 0:n.map(e=>u.Coin.fromPartial(e)))||[],r}};const y={proposalId:o.default.UZERO,status:0};t.Proposal={encode(e,n=i.default.Writer.create()){e.proposalId.isZero()||n.uint32(8).uint64(e.proposalId),void 0!==e.content&&a.Any.encode(e.content,n.uint32(18).fork()).ldelim(),0!==e.status&&n.uint32(24).int32(e.status),void 0!==e.finalTallyResult&&t.TallyResult.encode(e.finalTallyResult,n.uint32(34).fork()).ldelim(),void 0!==e.submitTime&&s.Timestamp.encode(e.submitTime,n.uint32(42).fork()).ldelim(),void 0!==e.depositEndTime&&s.Timestamp.encode(e.depositEndTime,n.uint32(50).fork()).ldelim();for(const t of e.totalDeposit)u.Coin.encode(t,n.uint32(58).fork()).ldelim();return void 0!==e.votingStartTime&&s.Timestamp.encode(e.votingStartTime,n.uint32(66).fork()).ldelim(),void 0!==e.votingEndTime&&s.Timestamp.encode(e.votingEndTime,n.uint32(74).fork()).ldelim(),n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const c=Object.assign({},y);for(c.totalDeposit=[];r.pos>>3){case 1:c.proposalId=r.uint64();break;case 2:c.content=a.Any.decode(r,r.uint32());break;case 3:c.status=r.int32();break;case 4:c.finalTallyResult=t.TallyResult.decode(r,r.uint32());break;case 5:c.submitTime=s.Timestamp.decode(r,r.uint32());break;case 6:c.depositEndTime=s.Timestamp.decode(r,r.uint32());break;case 7:c.totalDeposit.push(u.Coin.decode(r,r.uint32()));break;case 8:c.votingStartTime=s.Timestamp.decode(r,r.uint32());break;case 9:c.votingEndTime=s.Timestamp.decode(r,r.uint32());break;default:r.skipType(7&e)}}return c},fromJSON(e){var n;const r=Object.assign({},y);return r.proposalId=void 0!==e.proposalId&&null!==e.proposalId?o.default.fromString(e.proposalId):o.default.UZERO,r.content=void 0!==e.content&&null!==e.content?a.Any.fromJSON(e.content):void 0,r.status=void 0!==e.status&&null!==e.status?p(e.status):0,r.finalTallyResult=void 0!==e.finalTallyResult&&null!==e.finalTallyResult?t.TallyResult.fromJSON(e.finalTallyResult):void 0,r.submitTime=void 0!==e.submitTime&&null!==e.submitTime?R(e.submitTime):void 0,r.depositEndTime=void 0!==e.depositEndTime&&null!==e.depositEndTime?R(e.depositEndTime):void 0,r.totalDeposit=(null!==(n=e.totalDeposit)&&void 0!==n?n:[]).map(e=>u.Coin.fromJSON(e)),r.votingStartTime=void 0!==e.votingStartTime&&null!==e.votingStartTime?R(e.votingStartTime):void 0,r.votingEndTime=void 0!==e.votingEndTime&&null!==e.votingEndTime?R(e.votingEndTime):void 0,r},toJSON(e){const n={};return void 0!==e.proposalId&&(n.proposalId=(e.proposalId||o.default.UZERO).toString()),void 0!==e.content&&(n.content=e.content?a.Any.toJSON(e.content):void 0),void 0!==e.status&&(n.status=A(e.status)),void 0!==e.finalTallyResult&&(n.finalTallyResult=e.finalTallyResult?t.TallyResult.toJSON(e.finalTallyResult):void 0),void 0!==e.submitTime&&(n.submitTime=P(e.submitTime).toISOString()),void 0!==e.depositEndTime&&(n.depositEndTime=P(e.depositEndTime).toISOString()),e.totalDeposit?n.totalDeposit=e.totalDeposit.map(e=>e?u.Coin.toJSON(e):void 0):n.totalDeposit=[],void 0!==e.votingStartTime&&(n.votingStartTime=P(e.votingStartTime).toISOString()),void 0!==e.votingEndTime&&(n.votingEndTime=P(e.votingEndTime).toISOString()),n},fromPartial(e){var n,r;const i=Object.assign({},y);return i.proposalId=void 0!==e.proposalId&&null!==e.proposalId?o.default.fromValue(e.proposalId):o.default.UZERO,i.content=void 0!==e.content&&null!==e.content?a.Any.fromPartial(e.content):void 0,i.status=null!==(n=e.status)&&void 0!==n?n:0,i.finalTallyResult=void 0!==e.finalTallyResult&&null!==e.finalTallyResult?t.TallyResult.fromPartial(e.finalTallyResult):void 0,i.submitTime=void 0!==e.submitTime&&null!==e.submitTime?s.Timestamp.fromPartial(e.submitTime):void 0,i.depositEndTime=void 0!==e.depositEndTime&&null!==e.depositEndTime?s.Timestamp.fromPartial(e.depositEndTime):void 0,i.totalDeposit=(null===(r=e.totalDeposit)||void 0===r?void 0:r.map(e=>u.Coin.fromPartial(e)))||[],i.votingStartTime=void 0!==e.votingStartTime&&null!==e.votingStartTime?s.Timestamp.fromPartial(e.votingStartTime):void 0,i.votingEndTime=void 0!==e.votingEndTime&&null!==e.votingEndTime?s.Timestamp.fromPartial(e.votingEndTime):void 0,i}};const b={yes:"",abstain:"",no:"",noWithVeto:""};t.TallyResult={encode:(e,t=i.default.Writer.create())=>(""!==e.yes&&t.uint32(10).string(e.yes),""!==e.abstain&&t.uint32(18).string(e.abstain),""!==e.no&&t.uint32(26).string(e.no),""!==e.noWithVeto&&t.uint32(34).string(e.noWithVeto),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},b);for(;n.pos>>3){case 1:o.yes=n.string();break;case 2:o.abstain=n.string();break;case 3:o.no=n.string();break;case 4:o.noWithVeto=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},b);return t.yes=void 0!==e.yes&&null!==e.yes?String(e.yes):"",t.abstain=void 0!==e.abstain&&null!==e.abstain?String(e.abstain):"",t.no=void 0!==e.no&&null!==e.no?String(e.no):"",t.noWithVeto=void 0!==e.noWithVeto&&null!==e.noWithVeto?String(e.noWithVeto):"",t},toJSON(e){const t={};return void 0!==e.yes&&(t.yes=e.yes),void 0!==e.abstain&&(t.abstain=e.abstain),void 0!==e.no&&(t.no=e.no),void 0!==e.noWithVeto&&(t.noWithVeto=e.noWithVeto),t},fromPartial(e){var t,n,r,o;const i=Object.assign({},b);return i.yes=null!==(t=e.yes)&&void 0!==t?t:"",i.abstain=null!==(n=e.abstain)&&void 0!==n?n:"",i.no=null!==(r=e.no)&&void 0!==r?r:"",i.noWithVeto=null!==(o=e.noWithVeto)&&void 0!==o?o:"",i}};const I={proposalId:o.default.UZERO,voter:"",option:0};t.Vote={encode(e,n=i.default.Writer.create()){e.proposalId.isZero()||n.uint32(8).uint64(e.proposalId),""!==e.voter&&n.uint32(18).string(e.voter),0!==e.option&&n.uint32(24).int32(e.option);for(const r of e.options)t.WeightedVoteOption.encode(r,n.uint32(34).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},I);for(a.options=[];r.pos>>3){case 1:a.proposalId=r.uint64();break;case 2:a.voter=r.string();break;case 3:a.option=r.int32();break;case 4:a.options.push(t.WeightedVoteOption.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},I);return r.proposalId=void 0!==e.proposalId&&null!==e.proposalId?o.default.fromString(e.proposalId):o.default.UZERO,r.voter=void 0!==e.voter&&null!==e.voter?String(e.voter):"",r.option=void 0!==e.option&&null!==e.option?f(e.option):0,r.options=(null!==(n=e.options)&&void 0!==n?n:[]).map(e=>t.WeightedVoteOption.fromJSON(e)),r},toJSON(e){const n={};return void 0!==e.proposalId&&(n.proposalId=(e.proposalId||o.default.UZERO).toString()),void 0!==e.voter&&(n.voter=e.voter),void 0!==e.option&&(n.option=h(e.option)),e.options?n.options=e.options.map(e=>e?t.WeightedVoteOption.toJSON(e):void 0):n.options=[],n},fromPartial(e){var n,r,i;const a=Object.assign({},I);return a.proposalId=void 0!==e.proposalId&&null!==e.proposalId?o.default.fromValue(e.proposalId):o.default.UZERO,a.voter=null!==(n=e.voter)&&void 0!==n?n:"",a.option=null!==(r=e.option)&&void 0!==r?r:0,a.options=(null===(i=e.options)||void 0===i?void 0:i.map(e=>t.WeightedVoteOption.fromPartial(e)))||[],a}};const w={};t.DepositParams={encode(e,t=i.default.Writer.create()){for(const n of e.minDeposit)u.Coin.encode(n,t.uint32(10).fork()).ldelim();return void 0!==e.maxDepositPeriod&&c.Duration.encode(e.maxDepositPeriod,t.uint32(18).fork()).ldelim(),t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},w);for(o.minDeposit=[];n.pos>>3){case 1:o.minDeposit.push(u.Coin.decode(n,n.uint32()));break;case 2:o.maxDepositPeriod=c.Duration.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},w);return n.minDeposit=(null!==(t=e.minDeposit)&&void 0!==t?t:[]).map(e=>u.Coin.fromJSON(e)),n.maxDepositPeriod=void 0!==e.maxDepositPeriod&&null!==e.maxDepositPeriod?c.Duration.fromJSON(e.maxDepositPeriod):void 0,n},toJSON(e){const t={};return e.minDeposit?t.minDeposit=e.minDeposit.map(e=>e?u.Coin.toJSON(e):void 0):t.minDeposit=[],void 0!==e.maxDepositPeriod&&(t.maxDepositPeriod=e.maxDepositPeriod?c.Duration.toJSON(e.maxDepositPeriod):void 0),t},fromPartial(e){var t;const n=Object.assign({},w);return n.minDeposit=(null===(t=e.minDeposit)||void 0===t?void 0:t.map(e=>u.Coin.fromPartial(e)))||[],n.maxDepositPeriod=void 0!==e.maxDepositPeriod&&null!==e.maxDepositPeriod?c.Duration.fromPartial(e.maxDepositPeriod):void 0,n}};const E={};t.VotingParams={encode:(e,t=i.default.Writer.create())=>(void 0!==e.votingPeriod&&c.Duration.encode(e.votingPeriod,t.uint32(10).fork()).ldelim(),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},E);for(;n.pos>>3){case 1:o.votingPeriod=c.Duration.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},E);return t.votingPeriod=void 0!==e.votingPeriod&&null!==e.votingPeriod?c.Duration.fromJSON(e.votingPeriod):void 0,t},toJSON(e){const t={};return void 0!==e.votingPeriod&&(t.votingPeriod=e.votingPeriod?c.Duration.toJSON(e.votingPeriod):void 0),t},fromPartial(e){const t=Object.assign({},E);return t.votingPeriod=void 0!==e.votingPeriod&&null!==e.votingPeriod?c.Duration.fromPartial(e.votingPeriod):void 0,t}};const _={};t.TallyParams={encode:(e,t=i.default.Writer.create())=>(0!==e.quorum.length&&t.uint32(10).bytes(e.quorum),0!==e.threshold.length&&t.uint32(18).bytes(e.threshold),0!==e.vetoThreshold.length&&t.uint32(26).bytes(e.vetoThreshold),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},_);for(o.quorum=new Uint8Array,o.threshold=new Uint8Array,o.vetoThreshold=new Uint8Array;n.pos>>3){case 1:o.quorum=n.bytes();break;case 2:o.threshold=n.bytes();break;case 3:o.vetoThreshold=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},_);return t.quorum=void 0!==e.quorum&&null!==e.quorum?k(e.quorum):new Uint8Array,t.threshold=void 0!==e.threshold&&null!==e.threshold?k(e.threshold):new Uint8Array,t.vetoThreshold=void 0!==e.vetoThreshold&&null!==e.vetoThreshold?k(e.vetoThreshold):new Uint8Array,t},toJSON(e){const t={};return void 0!==e.quorum&&(t.quorum=O(void 0!==e.quorum?e.quorum:new Uint8Array)),void 0!==e.threshold&&(t.threshold=O(void 0!==e.threshold?e.threshold:new Uint8Array)),void 0!==e.vetoThreshold&&(t.vetoThreshold=O(void 0!==e.vetoThreshold?e.vetoThreshold:new Uint8Array)),t},fromPartial(e){var t,n,r;const o=Object.assign({},_);return o.quorum=null!==(t=e.quorum)&&void 0!==t?t:new Uint8Array,o.threshold=null!==(n=e.threshold)&&void 0!==n?n:new Uint8Array,o.vetoThreshold=null!==(r=e.vetoThreshold)&&void 0!==r?r:new Uint8Array,o}};var B=(()=>{if(void 0!==B)return B;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw"Unable to locate global object"})();const C=B.atob||(e=>B.Buffer.from(e,"base64").toString("binary"));function k(e){const t=C(e),n=new Uint8Array(t.length);for(let e=0;eB.Buffer.from(e,"binary").toString("base64"));function O(e){const t=[];for(const n of e)t.push(String.fromCharCode(n));return S(t.join(""))}function Q(e){var t;return{seconds:(t=e.getTime()/1e3,o.default.fromNumber(t)),nanos:e.getTime()%1e3*1e6}}function P(e){let t=1e3*e.seconds.toNumber();return t+=e.nanos/1e6,new Date(t)}function R(e){return e instanceof Date?Q(e):"string"==typeof e?Q(new Date(e)):s.Timestamp.fromJSON(e)}i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())}).call(this,n(3))},function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Acknowledgement=t.PacketState=t.Packet=t.Counterparty=t.IdentifiedChannel=t.Channel=t.orderToJSON=t.orderFromJSON=t.Order=t.stateToJSON=t.stateFromJSON=t.State=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(28);var s,c;function u(e){switch(e){case 0:case"STATE_UNINITIALIZED_UNSPECIFIED":return s.STATE_UNINITIALIZED_UNSPECIFIED;case 1:case"STATE_INIT":return s.STATE_INIT;case 2:case"STATE_TRYOPEN":return s.STATE_TRYOPEN;case 3:case"STATE_OPEN":return s.STATE_OPEN;case 4:case"STATE_CLOSED":return s.STATE_CLOSED;case-1:case"UNRECOGNIZED":default:return s.UNRECOGNIZED}}function d(e){switch(e){case s.STATE_UNINITIALIZED_UNSPECIFIED:return"STATE_UNINITIALIZED_UNSPECIFIED";case s.STATE_INIT:return"STATE_INIT";case s.STATE_TRYOPEN:return"STATE_TRYOPEN";case s.STATE_OPEN:return"STATE_OPEN";case s.STATE_CLOSED:return"STATE_CLOSED";default:return"UNKNOWN"}}function l(e){switch(e){case 0:case"ORDER_NONE_UNSPECIFIED":return c.ORDER_NONE_UNSPECIFIED;case 1:case"ORDER_UNORDERED":return c.ORDER_UNORDERED;case 2:case"ORDER_ORDERED":return c.ORDER_ORDERED;case-1:case"UNRECOGNIZED":default:return c.UNRECOGNIZED}}function f(e){switch(e){case c.ORDER_NONE_UNSPECIFIED:return"ORDER_NONE_UNSPECIFIED";case c.ORDER_UNORDERED:return"ORDER_UNORDERED";case c.ORDER_ORDERED:return"ORDER_ORDERED";default:return"UNKNOWN"}}t.protobufPackage="ibc.core.channel.v1",function(e){e[e.STATE_UNINITIALIZED_UNSPECIFIED=0]="STATE_UNINITIALIZED_UNSPECIFIED",e[e.STATE_INIT=1]="STATE_INIT",e[e.STATE_TRYOPEN=2]="STATE_TRYOPEN",e[e.STATE_OPEN=3]="STATE_OPEN",e[e.STATE_CLOSED=4]="STATE_CLOSED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(s=t.State||(t.State={})),t.stateFromJSON=u,t.stateToJSON=d,function(e){e[e.ORDER_NONE_UNSPECIFIED=0]="ORDER_NONE_UNSPECIFIED",e[e.ORDER_UNORDERED=1]="ORDER_UNORDERED",e[e.ORDER_ORDERED=2]="ORDER_ORDERED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(c=t.Order||(t.Order={})),t.orderFromJSON=l,t.orderToJSON=f;const h={state:0,ordering:0,connectionHops:"",version:""};t.Channel={encode(e,n=i.default.Writer.create()){0!==e.state&&n.uint32(8).int32(e.state),0!==e.ordering&&n.uint32(16).int32(e.ordering),void 0!==e.counterparty&&t.Counterparty.encode(e.counterparty,n.uint32(26).fork()).ldelim();for(const t of e.connectionHops)n.uint32(34).string(t);return""!==e.version&&n.uint32(42).string(e.version),n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},h);for(a.connectionHops=[];r.pos>>3){case 1:a.state=r.int32();break;case 2:a.ordering=r.int32();break;case 3:a.counterparty=t.Counterparty.decode(r,r.uint32());break;case 4:a.connectionHops.push(r.string());break;case 5:a.version=r.string();break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},h);return r.state=void 0!==e.state&&null!==e.state?u(e.state):0,r.ordering=void 0!==e.ordering&&null!==e.ordering?l(e.ordering):0,r.counterparty=void 0!==e.counterparty&&null!==e.counterparty?t.Counterparty.fromJSON(e.counterparty):void 0,r.connectionHops=(null!==(n=e.connectionHops)&&void 0!==n?n:[]).map(e=>String(e)),r.version=void 0!==e.version&&null!==e.version?String(e.version):"",r},toJSON(e){const n={};return void 0!==e.state&&(n.state=d(e.state)),void 0!==e.ordering&&(n.ordering=f(e.ordering)),void 0!==e.counterparty&&(n.counterparty=e.counterparty?t.Counterparty.toJSON(e.counterparty):void 0),e.connectionHops?n.connectionHops=e.connectionHops.map(e=>e):n.connectionHops=[],void 0!==e.version&&(n.version=e.version),n},fromPartial(e){var n,r,o,i;const a=Object.assign({},h);return a.state=null!==(n=e.state)&&void 0!==n?n:0,a.ordering=null!==(r=e.ordering)&&void 0!==r?r:0,a.counterparty=void 0!==e.counterparty&&null!==e.counterparty?t.Counterparty.fromPartial(e.counterparty):void 0,a.connectionHops=(null===(o=e.connectionHops)||void 0===o?void 0:o.map(e=>e))||[],a.version=null!==(i=e.version)&&void 0!==i?i:"",a}};const p={state:0,ordering:0,connectionHops:"",version:"",portId:"",channelId:""};t.IdentifiedChannel={encode(e,n=i.default.Writer.create()){0!==e.state&&n.uint32(8).int32(e.state),0!==e.ordering&&n.uint32(16).int32(e.ordering),void 0!==e.counterparty&&t.Counterparty.encode(e.counterparty,n.uint32(26).fork()).ldelim();for(const t of e.connectionHops)n.uint32(34).string(t);return""!==e.version&&n.uint32(42).string(e.version),""!==e.portId&&n.uint32(50).string(e.portId),""!==e.channelId&&n.uint32(58).string(e.channelId),n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},p);for(a.connectionHops=[];r.pos>>3){case 1:a.state=r.int32();break;case 2:a.ordering=r.int32();break;case 3:a.counterparty=t.Counterparty.decode(r,r.uint32());break;case 4:a.connectionHops.push(r.string());break;case 5:a.version=r.string();break;case 6:a.portId=r.string();break;case 7:a.channelId=r.string();break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},p);return r.state=void 0!==e.state&&null!==e.state?u(e.state):0,r.ordering=void 0!==e.ordering&&null!==e.ordering?l(e.ordering):0,r.counterparty=void 0!==e.counterparty&&null!==e.counterparty?t.Counterparty.fromJSON(e.counterparty):void 0,r.connectionHops=(null!==(n=e.connectionHops)&&void 0!==n?n:[]).map(e=>String(e)),r.version=void 0!==e.version&&null!==e.version?String(e.version):"",r.portId=void 0!==e.portId&&null!==e.portId?String(e.portId):"",r.channelId=void 0!==e.channelId&&null!==e.channelId?String(e.channelId):"",r},toJSON(e){const n={};return void 0!==e.state&&(n.state=d(e.state)),void 0!==e.ordering&&(n.ordering=f(e.ordering)),void 0!==e.counterparty&&(n.counterparty=e.counterparty?t.Counterparty.toJSON(e.counterparty):void 0),e.connectionHops?n.connectionHops=e.connectionHops.map(e=>e):n.connectionHops=[],void 0!==e.version&&(n.version=e.version),void 0!==e.portId&&(n.portId=e.portId),void 0!==e.channelId&&(n.channelId=e.channelId),n},fromPartial(e){var n,r,o,i,a,s;const c=Object.assign({},p);return c.state=null!==(n=e.state)&&void 0!==n?n:0,c.ordering=null!==(r=e.ordering)&&void 0!==r?r:0,c.counterparty=void 0!==e.counterparty&&null!==e.counterparty?t.Counterparty.fromPartial(e.counterparty):void 0,c.connectionHops=(null===(o=e.connectionHops)||void 0===o?void 0:o.map(e=>e))||[],c.version=null!==(i=e.version)&&void 0!==i?i:"",c.portId=null!==(a=e.portId)&&void 0!==a?a:"",c.channelId=null!==(s=e.channelId)&&void 0!==s?s:"",c}};const A={portId:"",channelId:""};t.Counterparty={encode:(e,t=i.default.Writer.create())=>(""!==e.portId&&t.uint32(10).string(e.portId),""!==e.channelId&&t.uint32(18).string(e.channelId),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},A);for(;n.pos>>3){case 1:o.portId=n.string();break;case 2:o.channelId=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},A);return t.portId=void 0!==e.portId&&null!==e.portId?String(e.portId):"",t.channelId=void 0!==e.channelId&&null!==e.channelId?String(e.channelId):"",t},toJSON(e){const t={};return void 0!==e.portId&&(t.portId=e.portId),void 0!==e.channelId&&(t.channelId=e.channelId),t},fromPartial(e){var t,n;const r=Object.assign({},A);return r.portId=null!==(t=e.portId)&&void 0!==t?t:"",r.channelId=null!==(n=e.channelId)&&void 0!==n?n:"",r}};const g={sequence:o.default.UZERO,sourcePort:"",sourceChannel:"",destinationPort:"",destinationChannel:"",timeoutTimestamp:o.default.UZERO};t.Packet={encode:(e,t=i.default.Writer.create())=>(e.sequence.isZero()||t.uint32(8).uint64(e.sequence),""!==e.sourcePort&&t.uint32(18).string(e.sourcePort),""!==e.sourceChannel&&t.uint32(26).string(e.sourceChannel),""!==e.destinationPort&&t.uint32(34).string(e.destinationPort),""!==e.destinationChannel&&t.uint32(42).string(e.destinationChannel),0!==e.data.length&&t.uint32(50).bytes(e.data),void 0!==e.timeoutHeight&&a.Height.encode(e.timeoutHeight,t.uint32(58).fork()).ldelim(),e.timeoutTimestamp.isZero()||t.uint32(64).uint64(e.timeoutTimestamp),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},g);for(o.data=new Uint8Array;n.pos>>3){case 1:o.sequence=n.uint64();break;case 2:o.sourcePort=n.string();break;case 3:o.sourceChannel=n.string();break;case 4:o.destinationPort=n.string();break;case 5:o.destinationChannel=n.string();break;case 6:o.data=n.bytes();break;case 7:o.timeoutHeight=a.Height.decode(n,n.uint32());break;case 8:o.timeoutTimestamp=n.uint64();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},g);return t.sequence=void 0!==e.sequence&&null!==e.sequence?o.default.fromString(e.sequence):o.default.UZERO,t.sourcePort=void 0!==e.sourcePort&&null!==e.sourcePort?String(e.sourcePort):"",t.sourceChannel=void 0!==e.sourceChannel&&null!==e.sourceChannel?String(e.sourceChannel):"",t.destinationPort=void 0!==e.destinationPort&&null!==e.destinationPort?String(e.destinationPort):"",t.destinationChannel=void 0!==e.destinationChannel&&null!==e.destinationChannel?String(e.destinationChannel):"",t.data=void 0!==e.data&&null!==e.data?I(e.data):new Uint8Array,t.timeoutHeight=void 0!==e.timeoutHeight&&null!==e.timeoutHeight?a.Height.fromJSON(e.timeoutHeight):void 0,t.timeoutTimestamp=void 0!==e.timeoutTimestamp&&null!==e.timeoutTimestamp?o.default.fromString(e.timeoutTimestamp):o.default.UZERO,t},toJSON(e){const t={};return void 0!==e.sequence&&(t.sequence=(e.sequence||o.default.UZERO).toString()),void 0!==e.sourcePort&&(t.sourcePort=e.sourcePort),void 0!==e.sourceChannel&&(t.sourceChannel=e.sourceChannel),void 0!==e.destinationPort&&(t.destinationPort=e.destinationPort),void 0!==e.destinationChannel&&(t.destinationChannel=e.destinationChannel),void 0!==e.data&&(t.data=E(void 0!==e.data?e.data:new Uint8Array)),void 0!==e.timeoutHeight&&(t.timeoutHeight=e.timeoutHeight?a.Height.toJSON(e.timeoutHeight):void 0),void 0!==e.timeoutTimestamp&&(t.timeoutTimestamp=(e.timeoutTimestamp||o.default.UZERO).toString()),t},fromPartial(e){var t,n,r,i,s;const c=Object.assign({},g);return c.sequence=void 0!==e.sequence&&null!==e.sequence?o.default.fromValue(e.sequence):o.default.UZERO,c.sourcePort=null!==(t=e.sourcePort)&&void 0!==t?t:"",c.sourceChannel=null!==(n=e.sourceChannel)&&void 0!==n?n:"",c.destinationPort=null!==(r=e.destinationPort)&&void 0!==r?r:"",c.destinationChannel=null!==(i=e.destinationChannel)&&void 0!==i?i:"",c.data=null!==(s=e.data)&&void 0!==s?s:new Uint8Array,c.timeoutHeight=void 0!==e.timeoutHeight&&null!==e.timeoutHeight?a.Height.fromPartial(e.timeoutHeight):void 0,c.timeoutTimestamp=void 0!==e.timeoutTimestamp&&null!==e.timeoutTimestamp?o.default.fromValue(e.timeoutTimestamp):o.default.UZERO,c}};const m={portId:"",channelId:"",sequence:o.default.UZERO};t.PacketState={encode:(e,t=i.default.Writer.create())=>(""!==e.portId&&t.uint32(10).string(e.portId),""!==e.channelId&&t.uint32(18).string(e.channelId),e.sequence.isZero()||t.uint32(24).uint64(e.sequence),0!==e.data.length&&t.uint32(34).bytes(e.data),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},m);for(o.data=new Uint8Array;n.pos>>3){case 1:o.portId=n.string();break;case 2:o.channelId=n.string();break;case 3:o.sequence=n.uint64();break;case 4:o.data=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},m);return t.portId=void 0!==e.portId&&null!==e.portId?String(e.portId):"",t.channelId=void 0!==e.channelId&&null!==e.channelId?String(e.channelId):"",t.sequence=void 0!==e.sequence&&null!==e.sequence?o.default.fromString(e.sequence):o.default.UZERO,t.data=void 0!==e.data&&null!==e.data?I(e.data):new Uint8Array,t},toJSON(e){const t={};return void 0!==e.portId&&(t.portId=e.portId),void 0!==e.channelId&&(t.channelId=e.channelId),void 0!==e.sequence&&(t.sequence=(e.sequence||o.default.UZERO).toString()),void 0!==e.data&&(t.data=E(void 0!==e.data?e.data:new Uint8Array)),t},fromPartial(e){var t,n,r;const i=Object.assign({},m);return i.portId=null!==(t=e.portId)&&void 0!==t?t:"",i.channelId=null!==(n=e.channelId)&&void 0!==n?n:"",i.sequence=void 0!==e.sequence&&null!==e.sequence?o.default.fromValue(e.sequence):o.default.UZERO,i.data=null!==(r=e.data)&&void 0!==r?r:new Uint8Array,i}};const v={};t.Acknowledgement={encode:(e,t=i.default.Writer.create())=>(void 0!==e.result&&t.uint32(170).bytes(e.result),void 0!==e.error&&t.uint32(178).string(e.error),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},v);for(;n.pos>>3){case 21:o.result=n.bytes();break;case 22:o.error=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},v);return t.result=void 0!==e.result&&null!==e.result?I(e.result):void 0,t.error=void 0!==e.error&&null!==e.error?String(e.error):void 0,t},toJSON(e){const t={};return void 0!==e.result&&(t.result=void 0!==e.result?E(e.result):void 0),void 0!==e.error&&(t.error=e.error),t},fromPartial(e){var t,n;const r=Object.assign({},v);return r.result=null!==(t=e.result)&&void 0!==t?t:void 0,r.error=null!==(n=e.error)&&void 0!==n?n:void 0,r}};var y=(()=>{if(void 0!==y)return y;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw"Unable to locate global object"})();const b=y.atob||(e=>y.Buffer.from(e,"base64").toString("binary"));function I(e){const t=b(e),n=new Uint8Array(t.length);for(let e=0;ey.Buffer.from(e,"binary").toString("base64"));function E(e){const t=[];for(const n of e)t.push(String.fromCharCode(n));return w(t.join(""))}i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())}).call(this,n(3))},function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TxProof=t.BlockMeta=t.LightBlock=t.SignedHeader=t.Proposal=t.CommitSig=t.Commit=t.Vote=t.Data=t.Header=t.BlockID=t.Part=t.PartSetHeader=t.signedMsgTypeToJSON=t.signedMsgTypeFromJSON=t.SignedMsgType=t.blockIDFlagToJSON=t.blockIDFlagFromJSON=t.BlockIDFlag=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(223),s=n(537),c=n(27),u=n(224);var d,l;function f(e){switch(e){case 0:case"BLOCK_ID_FLAG_UNKNOWN":return d.BLOCK_ID_FLAG_UNKNOWN;case 1:case"BLOCK_ID_FLAG_ABSENT":return d.BLOCK_ID_FLAG_ABSENT;case 2:case"BLOCK_ID_FLAG_COMMIT":return d.BLOCK_ID_FLAG_COMMIT;case 3:case"BLOCK_ID_FLAG_NIL":return d.BLOCK_ID_FLAG_NIL;case-1:case"UNRECOGNIZED":default:return d.UNRECOGNIZED}}function h(e){switch(e){case d.BLOCK_ID_FLAG_UNKNOWN:return"BLOCK_ID_FLAG_UNKNOWN";case d.BLOCK_ID_FLAG_ABSENT:return"BLOCK_ID_FLAG_ABSENT";case d.BLOCK_ID_FLAG_COMMIT:return"BLOCK_ID_FLAG_COMMIT";case d.BLOCK_ID_FLAG_NIL:return"BLOCK_ID_FLAG_NIL";default:return"UNKNOWN"}}function p(e){switch(e){case 0:case"SIGNED_MSG_TYPE_UNKNOWN":return l.SIGNED_MSG_TYPE_UNKNOWN;case 1:case"SIGNED_MSG_TYPE_PREVOTE":return l.SIGNED_MSG_TYPE_PREVOTE;case 2:case"SIGNED_MSG_TYPE_PRECOMMIT":return l.SIGNED_MSG_TYPE_PRECOMMIT;case 32:case"SIGNED_MSG_TYPE_PROPOSAL":return l.SIGNED_MSG_TYPE_PROPOSAL;case-1:case"UNRECOGNIZED":default:return l.UNRECOGNIZED}}function A(e){switch(e){case l.SIGNED_MSG_TYPE_UNKNOWN:return"SIGNED_MSG_TYPE_UNKNOWN";case l.SIGNED_MSG_TYPE_PREVOTE:return"SIGNED_MSG_TYPE_PREVOTE";case l.SIGNED_MSG_TYPE_PRECOMMIT:return"SIGNED_MSG_TYPE_PRECOMMIT";case l.SIGNED_MSG_TYPE_PROPOSAL:return"SIGNED_MSG_TYPE_PROPOSAL";default:return"UNKNOWN"}}t.protobufPackage="tendermint.types",function(e){e[e.BLOCK_ID_FLAG_UNKNOWN=0]="BLOCK_ID_FLAG_UNKNOWN",e[e.BLOCK_ID_FLAG_ABSENT=1]="BLOCK_ID_FLAG_ABSENT",e[e.BLOCK_ID_FLAG_COMMIT=2]="BLOCK_ID_FLAG_COMMIT",e[e.BLOCK_ID_FLAG_NIL=3]="BLOCK_ID_FLAG_NIL",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(d=t.BlockIDFlag||(t.BlockIDFlag={})),t.blockIDFlagFromJSON=f,t.blockIDFlagToJSON=h,function(e){e[e.SIGNED_MSG_TYPE_UNKNOWN=0]="SIGNED_MSG_TYPE_UNKNOWN",e[e.SIGNED_MSG_TYPE_PREVOTE=1]="SIGNED_MSG_TYPE_PREVOTE",e[e.SIGNED_MSG_TYPE_PRECOMMIT=2]="SIGNED_MSG_TYPE_PRECOMMIT",e[e.SIGNED_MSG_TYPE_PROPOSAL=32]="SIGNED_MSG_TYPE_PROPOSAL",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(l=t.SignedMsgType||(t.SignedMsgType={})),t.signedMsgTypeFromJSON=p,t.signedMsgTypeToJSON=A;const g={total:0};t.PartSetHeader={encode:(e,t=i.default.Writer.create())=>(0!==e.total&&t.uint32(8).uint32(e.total),0!==e.hash.length&&t.uint32(18).bytes(e.hash),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},g);for(o.hash=new Uint8Array;n.pos>>3){case 1:o.total=n.uint32();break;case 2:o.hash=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},g);return t.total=void 0!==e.total&&null!==e.total?Number(e.total):0,t.hash=void 0!==e.hash&&null!==e.hash?P(e.hash):new Uint8Array,t},toJSON(e){const t={};return void 0!==e.total&&(t.total=e.total),void 0!==e.hash&&(t.hash=M(void 0!==e.hash?e.hash:new Uint8Array)),t},fromPartial(e){var t,n;const r=Object.assign({},g);return r.total=null!==(t=e.total)&&void 0!==t?t:0,r.hash=null!==(n=e.hash)&&void 0!==n?n:new Uint8Array,r}};const m={index:0};t.Part={encode:(e,t=i.default.Writer.create())=>(0!==e.index&&t.uint32(8).uint32(e.index),0!==e.bytes.length&&t.uint32(18).bytes(e.bytes),void 0!==e.proof&&a.Proof.encode(e.proof,t.uint32(26).fork()).ldelim(),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},m);for(o.bytes=new Uint8Array;n.pos>>3){case 1:o.index=n.uint32();break;case 2:o.bytes=n.bytes();break;case 3:o.proof=a.Proof.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},m);return t.index=void 0!==e.index&&null!==e.index?Number(e.index):0,t.bytes=void 0!==e.bytes&&null!==e.bytes?P(e.bytes):new Uint8Array,t.proof=void 0!==e.proof&&null!==e.proof?a.Proof.fromJSON(e.proof):void 0,t},toJSON(e){const t={};return void 0!==e.index&&(t.index=e.index),void 0!==e.bytes&&(t.bytes=M(void 0!==e.bytes?e.bytes:new Uint8Array)),void 0!==e.proof&&(t.proof=e.proof?a.Proof.toJSON(e.proof):void 0),t},fromPartial(e){var t,n;const r=Object.assign({},m);return r.index=null!==(t=e.index)&&void 0!==t?t:0,r.bytes=null!==(n=e.bytes)&&void 0!==n?n:new Uint8Array,r.proof=void 0!==e.proof&&null!==e.proof?a.Proof.fromPartial(e.proof):void 0,r}};const v={};t.BlockID={encode:(e,n=i.default.Writer.create())=>(0!==e.hash.length&&n.uint32(10).bytes(e.hash),void 0!==e.partSetHeader&&t.PartSetHeader.encode(e.partSetHeader,n.uint32(18).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},v);for(a.hash=new Uint8Array;r.pos>>3){case 1:a.hash=r.bytes();break;case 2:a.partSetHeader=t.PartSetHeader.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},v);return n.hash=void 0!==e.hash&&null!==e.hash?P(e.hash):new Uint8Array,n.partSetHeader=void 0!==e.partSetHeader&&null!==e.partSetHeader?t.PartSetHeader.fromJSON(e.partSetHeader):void 0,n},toJSON(e){const n={};return void 0!==e.hash&&(n.hash=M(void 0!==e.hash?e.hash:new Uint8Array)),void 0!==e.partSetHeader&&(n.partSetHeader=e.partSetHeader?t.PartSetHeader.toJSON(e.partSetHeader):void 0),n},fromPartial(e){var n;const r=Object.assign({},v);return r.hash=null!==(n=e.hash)&&void 0!==n?n:new Uint8Array,r.partSetHeader=void 0!==e.partSetHeader&&null!==e.partSetHeader?t.PartSetHeader.fromPartial(e.partSetHeader):void 0,r}};const y={chainId:"",height:o.default.ZERO};t.Header={encode:(e,n=i.default.Writer.create())=>(void 0!==e.version&&s.Consensus.encode(e.version,n.uint32(10).fork()).ldelim(),""!==e.chainId&&n.uint32(18).string(e.chainId),e.height.isZero()||n.uint32(24).int64(e.height),void 0!==e.time&&c.Timestamp.encode(e.time,n.uint32(34).fork()).ldelim(),void 0!==e.lastBlockId&&t.BlockID.encode(e.lastBlockId,n.uint32(42).fork()).ldelim(),0!==e.lastCommitHash.length&&n.uint32(50).bytes(e.lastCommitHash),0!==e.dataHash.length&&n.uint32(58).bytes(e.dataHash),0!==e.validatorsHash.length&&n.uint32(66).bytes(e.validatorsHash),0!==e.nextValidatorsHash.length&&n.uint32(74).bytes(e.nextValidatorsHash),0!==e.consensusHash.length&&n.uint32(82).bytes(e.consensusHash),0!==e.appHash.length&&n.uint32(90).bytes(e.appHash),0!==e.lastResultsHash.length&&n.uint32(98).bytes(e.lastResultsHash),0!==e.evidenceHash.length&&n.uint32(106).bytes(e.evidenceHash),0!==e.proposerAddress.length&&n.uint32(114).bytes(e.proposerAddress),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},y);for(a.lastCommitHash=new Uint8Array,a.dataHash=new Uint8Array,a.validatorsHash=new Uint8Array,a.nextValidatorsHash=new Uint8Array,a.consensusHash=new Uint8Array,a.appHash=new Uint8Array,a.lastResultsHash=new Uint8Array,a.evidenceHash=new Uint8Array,a.proposerAddress=new Uint8Array;r.pos>>3){case 1:a.version=s.Consensus.decode(r,r.uint32());break;case 2:a.chainId=r.string();break;case 3:a.height=r.int64();break;case 4:a.time=c.Timestamp.decode(r,r.uint32());break;case 5:a.lastBlockId=t.BlockID.decode(r,r.uint32());break;case 6:a.lastCommitHash=r.bytes();break;case 7:a.dataHash=r.bytes();break;case 8:a.validatorsHash=r.bytes();break;case 9:a.nextValidatorsHash=r.bytes();break;case 10:a.consensusHash=r.bytes();break;case 11:a.appHash=r.bytes();break;case 12:a.lastResultsHash=r.bytes();break;case 13:a.evidenceHash=r.bytes();break;case 14:a.proposerAddress=r.bytes();break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},y);return n.version=void 0!==e.version&&null!==e.version?s.Consensus.fromJSON(e.version):void 0,n.chainId=void 0!==e.chainId&&null!==e.chainId?String(e.chainId):"",n.height=void 0!==e.height&&null!==e.height?o.default.fromString(e.height):o.default.ZERO,n.time=void 0!==e.time&&null!==e.time?N(e.time):void 0,n.lastBlockId=void 0!==e.lastBlockId&&null!==e.lastBlockId?t.BlockID.fromJSON(e.lastBlockId):void 0,n.lastCommitHash=void 0!==e.lastCommitHash&&null!==e.lastCommitHash?P(e.lastCommitHash):new Uint8Array,n.dataHash=void 0!==e.dataHash&&null!==e.dataHash?P(e.dataHash):new Uint8Array,n.validatorsHash=void 0!==e.validatorsHash&&null!==e.validatorsHash?P(e.validatorsHash):new Uint8Array,n.nextValidatorsHash=void 0!==e.nextValidatorsHash&&null!==e.nextValidatorsHash?P(e.nextValidatorsHash):new Uint8Array,n.consensusHash=void 0!==e.consensusHash&&null!==e.consensusHash?P(e.consensusHash):new Uint8Array,n.appHash=void 0!==e.appHash&&null!==e.appHash?P(e.appHash):new Uint8Array,n.lastResultsHash=void 0!==e.lastResultsHash&&null!==e.lastResultsHash?P(e.lastResultsHash):new Uint8Array,n.evidenceHash=void 0!==e.evidenceHash&&null!==e.evidenceHash?P(e.evidenceHash):new Uint8Array,n.proposerAddress=void 0!==e.proposerAddress&&null!==e.proposerAddress?P(e.proposerAddress):new Uint8Array,n},toJSON(e){const n={};return void 0!==e.version&&(n.version=e.version?s.Consensus.toJSON(e.version):void 0),void 0!==e.chainId&&(n.chainId=e.chainId),void 0!==e.height&&(n.height=(e.height||o.default.ZERO).toString()),void 0!==e.time&&(n.time=D(e.time).toISOString()),void 0!==e.lastBlockId&&(n.lastBlockId=e.lastBlockId?t.BlockID.toJSON(e.lastBlockId):void 0),void 0!==e.lastCommitHash&&(n.lastCommitHash=M(void 0!==e.lastCommitHash?e.lastCommitHash:new Uint8Array)),void 0!==e.dataHash&&(n.dataHash=M(void 0!==e.dataHash?e.dataHash:new Uint8Array)),void 0!==e.validatorsHash&&(n.validatorsHash=M(void 0!==e.validatorsHash?e.validatorsHash:new Uint8Array)),void 0!==e.nextValidatorsHash&&(n.nextValidatorsHash=M(void 0!==e.nextValidatorsHash?e.nextValidatorsHash:new Uint8Array)),void 0!==e.consensusHash&&(n.consensusHash=M(void 0!==e.consensusHash?e.consensusHash:new Uint8Array)),void 0!==e.appHash&&(n.appHash=M(void 0!==e.appHash?e.appHash:new Uint8Array)),void 0!==e.lastResultsHash&&(n.lastResultsHash=M(void 0!==e.lastResultsHash?e.lastResultsHash:new Uint8Array)),void 0!==e.evidenceHash&&(n.evidenceHash=M(void 0!==e.evidenceHash?e.evidenceHash:new Uint8Array)),void 0!==e.proposerAddress&&(n.proposerAddress=M(void 0!==e.proposerAddress?e.proposerAddress:new Uint8Array)),n},fromPartial(e){var n,r,i,a,u,d,l,f,h,p;const A=Object.assign({},y);return A.version=void 0!==e.version&&null!==e.version?s.Consensus.fromPartial(e.version):void 0,A.chainId=null!==(n=e.chainId)&&void 0!==n?n:"",A.height=void 0!==e.height&&null!==e.height?o.default.fromValue(e.height):o.default.ZERO,A.time=void 0!==e.time&&null!==e.time?c.Timestamp.fromPartial(e.time):void 0,A.lastBlockId=void 0!==e.lastBlockId&&null!==e.lastBlockId?t.BlockID.fromPartial(e.lastBlockId):void 0,A.lastCommitHash=null!==(r=e.lastCommitHash)&&void 0!==r?r:new Uint8Array,A.dataHash=null!==(i=e.dataHash)&&void 0!==i?i:new Uint8Array,A.validatorsHash=null!==(a=e.validatorsHash)&&void 0!==a?a:new Uint8Array,A.nextValidatorsHash=null!==(u=e.nextValidatorsHash)&&void 0!==u?u:new Uint8Array,A.consensusHash=null!==(d=e.consensusHash)&&void 0!==d?d:new Uint8Array,A.appHash=null!==(l=e.appHash)&&void 0!==l?l:new Uint8Array,A.lastResultsHash=null!==(f=e.lastResultsHash)&&void 0!==f?f:new Uint8Array,A.evidenceHash=null!==(h=e.evidenceHash)&&void 0!==h?h:new Uint8Array,A.proposerAddress=null!==(p=e.proposerAddress)&&void 0!==p?p:new Uint8Array,A}};const b={};t.Data={encode(e,t=i.default.Writer.create()){for(const n of e.txs)t.uint32(10).bytes(n);return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},b);for(o.txs=[];n.pos>>3){case 1:o.txs.push(n.bytes());break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},b);return n.txs=(null!==(t=e.txs)&&void 0!==t?t:[]).map(e=>P(e)),n},toJSON(e){const t={};return e.txs?t.txs=e.txs.map(e=>M(void 0!==e?e:new Uint8Array)):t.txs=[],t},fromPartial(e){var t;const n=Object.assign({},b);return n.txs=(null===(t=e.txs)||void 0===t?void 0:t.map(e=>e))||[],n}};const I={type:0,height:o.default.ZERO,round:0,validatorIndex:0};t.Vote={encode:(e,n=i.default.Writer.create())=>(0!==e.type&&n.uint32(8).int32(e.type),e.height.isZero()||n.uint32(16).int64(e.height),0!==e.round&&n.uint32(24).int32(e.round),void 0!==e.blockId&&t.BlockID.encode(e.blockId,n.uint32(34).fork()).ldelim(),void 0!==e.timestamp&&c.Timestamp.encode(e.timestamp,n.uint32(42).fork()).ldelim(),0!==e.validatorAddress.length&&n.uint32(50).bytes(e.validatorAddress),0!==e.validatorIndex&&n.uint32(56).int32(e.validatorIndex),0!==e.signature.length&&n.uint32(66).bytes(e.signature),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},I);for(a.validatorAddress=new Uint8Array,a.signature=new Uint8Array;r.pos>>3){case 1:a.type=r.int32();break;case 2:a.height=r.int64();break;case 3:a.round=r.int32();break;case 4:a.blockId=t.BlockID.decode(r,r.uint32());break;case 5:a.timestamp=c.Timestamp.decode(r,r.uint32());break;case 6:a.validatorAddress=r.bytes();break;case 7:a.validatorIndex=r.int32();break;case 8:a.signature=r.bytes();break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},I);return n.type=void 0!==e.type&&null!==e.type?p(e.type):0,n.height=void 0!==e.height&&null!==e.height?o.default.fromString(e.height):o.default.ZERO,n.round=void 0!==e.round&&null!==e.round?Number(e.round):0,n.blockId=void 0!==e.blockId&&null!==e.blockId?t.BlockID.fromJSON(e.blockId):void 0,n.timestamp=void 0!==e.timestamp&&null!==e.timestamp?N(e.timestamp):void 0,n.validatorAddress=void 0!==e.validatorAddress&&null!==e.validatorAddress?P(e.validatorAddress):new Uint8Array,n.validatorIndex=void 0!==e.validatorIndex&&null!==e.validatorIndex?Number(e.validatorIndex):0,n.signature=void 0!==e.signature&&null!==e.signature?P(e.signature):new Uint8Array,n},toJSON(e){const n={};return void 0!==e.type&&(n.type=A(e.type)),void 0!==e.height&&(n.height=(e.height||o.default.ZERO).toString()),void 0!==e.round&&(n.round=e.round),void 0!==e.blockId&&(n.blockId=e.blockId?t.BlockID.toJSON(e.blockId):void 0),void 0!==e.timestamp&&(n.timestamp=D(e.timestamp).toISOString()),void 0!==e.validatorAddress&&(n.validatorAddress=M(void 0!==e.validatorAddress?e.validatorAddress:new Uint8Array)),void 0!==e.validatorIndex&&(n.validatorIndex=e.validatorIndex),void 0!==e.signature&&(n.signature=M(void 0!==e.signature?e.signature:new Uint8Array)),n},fromPartial(e){var n,r,i,a,s;const u=Object.assign({},I);return u.type=null!==(n=e.type)&&void 0!==n?n:0,u.height=void 0!==e.height&&null!==e.height?o.default.fromValue(e.height):o.default.ZERO,u.round=null!==(r=e.round)&&void 0!==r?r:0,u.blockId=void 0!==e.blockId&&null!==e.blockId?t.BlockID.fromPartial(e.blockId):void 0,u.timestamp=void 0!==e.timestamp&&null!==e.timestamp?c.Timestamp.fromPartial(e.timestamp):void 0,u.validatorAddress=null!==(i=e.validatorAddress)&&void 0!==i?i:new Uint8Array,u.validatorIndex=null!==(a=e.validatorIndex)&&void 0!==a?a:0,u.signature=null!==(s=e.signature)&&void 0!==s?s:new Uint8Array,u}};const w={height:o.default.ZERO,round:0};t.Commit={encode(e,n=i.default.Writer.create()){e.height.isZero()||n.uint32(8).int64(e.height),0!==e.round&&n.uint32(16).int32(e.round),void 0!==e.blockId&&t.BlockID.encode(e.blockId,n.uint32(26).fork()).ldelim();for(const r of e.signatures)t.CommitSig.encode(r,n.uint32(34).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},w);for(a.signatures=[];r.pos>>3){case 1:a.height=r.int64();break;case 2:a.round=r.int32();break;case 3:a.blockId=t.BlockID.decode(r,r.uint32());break;case 4:a.signatures.push(t.CommitSig.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},w);return r.height=void 0!==e.height&&null!==e.height?o.default.fromString(e.height):o.default.ZERO,r.round=void 0!==e.round&&null!==e.round?Number(e.round):0,r.blockId=void 0!==e.blockId&&null!==e.blockId?t.BlockID.fromJSON(e.blockId):void 0,r.signatures=(null!==(n=e.signatures)&&void 0!==n?n:[]).map(e=>t.CommitSig.fromJSON(e)),r},toJSON(e){const n={};return void 0!==e.height&&(n.height=(e.height||o.default.ZERO).toString()),void 0!==e.round&&(n.round=e.round),void 0!==e.blockId&&(n.blockId=e.blockId?t.BlockID.toJSON(e.blockId):void 0),e.signatures?n.signatures=e.signatures.map(e=>e?t.CommitSig.toJSON(e):void 0):n.signatures=[],n},fromPartial(e){var n,r;const i=Object.assign({},w);return i.height=void 0!==e.height&&null!==e.height?o.default.fromValue(e.height):o.default.ZERO,i.round=null!==(n=e.round)&&void 0!==n?n:0,i.blockId=void 0!==e.blockId&&null!==e.blockId?t.BlockID.fromPartial(e.blockId):void 0,i.signatures=(null===(r=e.signatures)||void 0===r?void 0:r.map(e=>t.CommitSig.fromPartial(e)))||[],i}};const E={blockIdFlag:0};t.CommitSig={encode:(e,t=i.default.Writer.create())=>(0!==e.blockIdFlag&&t.uint32(8).int32(e.blockIdFlag),0!==e.validatorAddress.length&&t.uint32(18).bytes(e.validatorAddress),void 0!==e.timestamp&&c.Timestamp.encode(e.timestamp,t.uint32(26).fork()).ldelim(),0!==e.signature.length&&t.uint32(34).bytes(e.signature),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},E);for(o.validatorAddress=new Uint8Array,o.signature=new Uint8Array;n.pos>>3){case 1:o.blockIdFlag=n.int32();break;case 2:o.validatorAddress=n.bytes();break;case 3:o.timestamp=c.Timestamp.decode(n,n.uint32());break;case 4:o.signature=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},E);return t.blockIdFlag=void 0!==e.blockIdFlag&&null!==e.blockIdFlag?f(e.blockIdFlag):0,t.validatorAddress=void 0!==e.validatorAddress&&null!==e.validatorAddress?P(e.validatorAddress):new Uint8Array,t.timestamp=void 0!==e.timestamp&&null!==e.timestamp?N(e.timestamp):void 0,t.signature=void 0!==e.signature&&null!==e.signature?P(e.signature):new Uint8Array,t},toJSON(e){const t={};return void 0!==e.blockIdFlag&&(t.blockIdFlag=h(e.blockIdFlag)),void 0!==e.validatorAddress&&(t.validatorAddress=M(void 0!==e.validatorAddress?e.validatorAddress:new Uint8Array)),void 0!==e.timestamp&&(t.timestamp=D(e.timestamp).toISOString()),void 0!==e.signature&&(t.signature=M(void 0!==e.signature?e.signature:new Uint8Array)),t},fromPartial(e){var t,n,r;const o=Object.assign({},E);return o.blockIdFlag=null!==(t=e.blockIdFlag)&&void 0!==t?t:0,o.validatorAddress=null!==(n=e.validatorAddress)&&void 0!==n?n:new Uint8Array,o.timestamp=void 0!==e.timestamp&&null!==e.timestamp?c.Timestamp.fromPartial(e.timestamp):void 0,o.signature=null!==(r=e.signature)&&void 0!==r?r:new Uint8Array,o}};const _={type:0,height:o.default.ZERO,round:0,polRound:0};t.Proposal={encode:(e,n=i.default.Writer.create())=>(0!==e.type&&n.uint32(8).int32(e.type),e.height.isZero()||n.uint32(16).int64(e.height),0!==e.round&&n.uint32(24).int32(e.round),0!==e.polRound&&n.uint32(32).int32(e.polRound),void 0!==e.blockId&&t.BlockID.encode(e.blockId,n.uint32(42).fork()).ldelim(),void 0!==e.timestamp&&c.Timestamp.encode(e.timestamp,n.uint32(50).fork()).ldelim(),0!==e.signature.length&&n.uint32(58).bytes(e.signature),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},_);for(a.signature=new Uint8Array;r.pos>>3){case 1:a.type=r.int32();break;case 2:a.height=r.int64();break;case 3:a.round=r.int32();break;case 4:a.polRound=r.int32();break;case 5:a.blockId=t.BlockID.decode(r,r.uint32());break;case 6:a.timestamp=c.Timestamp.decode(r,r.uint32());break;case 7:a.signature=r.bytes();break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},_);return n.type=void 0!==e.type&&null!==e.type?p(e.type):0,n.height=void 0!==e.height&&null!==e.height?o.default.fromString(e.height):o.default.ZERO,n.round=void 0!==e.round&&null!==e.round?Number(e.round):0,n.polRound=void 0!==e.polRound&&null!==e.polRound?Number(e.polRound):0,n.blockId=void 0!==e.blockId&&null!==e.blockId?t.BlockID.fromJSON(e.blockId):void 0,n.timestamp=void 0!==e.timestamp&&null!==e.timestamp?N(e.timestamp):void 0,n.signature=void 0!==e.signature&&null!==e.signature?P(e.signature):new Uint8Array,n},toJSON(e){const n={};return void 0!==e.type&&(n.type=A(e.type)),void 0!==e.height&&(n.height=(e.height||o.default.ZERO).toString()),void 0!==e.round&&(n.round=e.round),void 0!==e.polRound&&(n.polRound=e.polRound),void 0!==e.blockId&&(n.blockId=e.blockId?t.BlockID.toJSON(e.blockId):void 0),void 0!==e.timestamp&&(n.timestamp=D(e.timestamp).toISOString()),void 0!==e.signature&&(n.signature=M(void 0!==e.signature?e.signature:new Uint8Array)),n},fromPartial(e){var n,r,i,a;const s=Object.assign({},_);return s.type=null!==(n=e.type)&&void 0!==n?n:0,s.height=void 0!==e.height&&null!==e.height?o.default.fromValue(e.height):o.default.ZERO,s.round=null!==(r=e.round)&&void 0!==r?r:0,s.polRound=null!==(i=e.polRound)&&void 0!==i?i:0,s.blockId=void 0!==e.blockId&&null!==e.blockId?t.BlockID.fromPartial(e.blockId):void 0,s.timestamp=void 0!==e.timestamp&&null!==e.timestamp?c.Timestamp.fromPartial(e.timestamp):void 0,s.signature=null!==(a=e.signature)&&void 0!==a?a:new Uint8Array,s}};const B={};t.SignedHeader={encode:(e,n=i.default.Writer.create())=>(void 0!==e.header&&t.Header.encode(e.header,n.uint32(10).fork()).ldelim(),void 0!==e.commit&&t.Commit.encode(e.commit,n.uint32(18).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},B);for(;r.pos>>3){case 1:a.header=t.Header.decode(r,r.uint32());break;case 2:a.commit=t.Commit.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},B);return n.header=void 0!==e.header&&null!==e.header?t.Header.fromJSON(e.header):void 0,n.commit=void 0!==e.commit&&null!==e.commit?t.Commit.fromJSON(e.commit):void 0,n},toJSON(e){const n={};return void 0!==e.header&&(n.header=e.header?t.Header.toJSON(e.header):void 0),void 0!==e.commit&&(n.commit=e.commit?t.Commit.toJSON(e.commit):void 0),n},fromPartial(e){const n=Object.assign({},B);return n.header=void 0!==e.header&&null!==e.header?t.Header.fromPartial(e.header):void 0,n.commit=void 0!==e.commit&&null!==e.commit?t.Commit.fromPartial(e.commit):void 0,n}};const C={};t.LightBlock={encode:(e,n=i.default.Writer.create())=>(void 0!==e.signedHeader&&t.SignedHeader.encode(e.signedHeader,n.uint32(10).fork()).ldelim(),void 0!==e.validatorSet&&u.ValidatorSet.encode(e.validatorSet,n.uint32(18).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},C);for(;r.pos>>3){case 1:a.signedHeader=t.SignedHeader.decode(r,r.uint32());break;case 2:a.validatorSet=u.ValidatorSet.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},C);return n.signedHeader=void 0!==e.signedHeader&&null!==e.signedHeader?t.SignedHeader.fromJSON(e.signedHeader):void 0,n.validatorSet=void 0!==e.validatorSet&&null!==e.validatorSet?u.ValidatorSet.fromJSON(e.validatorSet):void 0,n},toJSON(e){const n={};return void 0!==e.signedHeader&&(n.signedHeader=e.signedHeader?t.SignedHeader.toJSON(e.signedHeader):void 0),void 0!==e.validatorSet&&(n.validatorSet=e.validatorSet?u.ValidatorSet.toJSON(e.validatorSet):void 0),n},fromPartial(e){const n=Object.assign({},C);return n.signedHeader=void 0!==e.signedHeader&&null!==e.signedHeader?t.SignedHeader.fromPartial(e.signedHeader):void 0,n.validatorSet=void 0!==e.validatorSet&&null!==e.validatorSet?u.ValidatorSet.fromPartial(e.validatorSet):void 0,n}};const k={blockSize:o.default.ZERO,numTxs:o.default.ZERO};t.BlockMeta={encode:(e,n=i.default.Writer.create())=>(void 0!==e.blockId&&t.BlockID.encode(e.blockId,n.uint32(10).fork()).ldelim(),e.blockSize.isZero()||n.uint32(16).int64(e.blockSize),void 0!==e.header&&t.Header.encode(e.header,n.uint32(26).fork()).ldelim(),e.numTxs.isZero()||n.uint32(32).int64(e.numTxs),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},k);for(;r.pos>>3){case 1:a.blockId=t.BlockID.decode(r,r.uint32());break;case 2:a.blockSize=r.int64();break;case 3:a.header=t.Header.decode(r,r.uint32());break;case 4:a.numTxs=r.int64();break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},k);return n.blockId=void 0!==e.blockId&&null!==e.blockId?t.BlockID.fromJSON(e.blockId):void 0,n.blockSize=void 0!==e.blockSize&&null!==e.blockSize?o.default.fromString(e.blockSize):o.default.ZERO,n.header=void 0!==e.header&&null!==e.header?t.Header.fromJSON(e.header):void 0,n.numTxs=void 0!==e.numTxs&&null!==e.numTxs?o.default.fromString(e.numTxs):o.default.ZERO,n},toJSON(e){const n={};return void 0!==e.blockId&&(n.blockId=e.blockId?t.BlockID.toJSON(e.blockId):void 0),void 0!==e.blockSize&&(n.blockSize=(e.blockSize||o.default.ZERO).toString()),void 0!==e.header&&(n.header=e.header?t.Header.toJSON(e.header):void 0),void 0!==e.numTxs&&(n.numTxs=(e.numTxs||o.default.ZERO).toString()),n},fromPartial(e){const n=Object.assign({},k);return n.blockId=void 0!==e.blockId&&null!==e.blockId?t.BlockID.fromPartial(e.blockId):void 0,n.blockSize=void 0!==e.blockSize&&null!==e.blockSize?o.default.fromValue(e.blockSize):o.default.ZERO,n.header=void 0!==e.header&&null!==e.header?t.Header.fromPartial(e.header):void 0,n.numTxs=void 0!==e.numTxs&&null!==e.numTxs?o.default.fromValue(e.numTxs):o.default.ZERO,n}};const S={};t.TxProof={encode:(e,t=i.default.Writer.create())=>(0!==e.rootHash.length&&t.uint32(10).bytes(e.rootHash),0!==e.data.length&&t.uint32(18).bytes(e.data),void 0!==e.proof&&a.Proof.encode(e.proof,t.uint32(26).fork()).ldelim(),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},S);for(o.rootHash=new Uint8Array,o.data=new Uint8Array;n.pos>>3){case 1:o.rootHash=n.bytes();break;case 2:o.data=n.bytes();break;case 3:o.proof=a.Proof.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},S);return t.rootHash=void 0!==e.rootHash&&null!==e.rootHash?P(e.rootHash):new Uint8Array,t.data=void 0!==e.data&&null!==e.data?P(e.data):new Uint8Array,t.proof=void 0!==e.proof&&null!==e.proof?a.Proof.fromJSON(e.proof):void 0,t},toJSON(e){const t={};return void 0!==e.rootHash&&(t.rootHash=M(void 0!==e.rootHash?e.rootHash:new Uint8Array)),void 0!==e.data&&(t.data=M(void 0!==e.data?e.data:new Uint8Array)),void 0!==e.proof&&(t.proof=e.proof?a.Proof.toJSON(e.proof):void 0),t},fromPartial(e){var t,n;const r=Object.assign({},S);return r.rootHash=null!==(t=e.rootHash)&&void 0!==t?t:new Uint8Array,r.data=null!==(n=e.data)&&void 0!==n?n:new Uint8Array,r.proof=void 0!==e.proof&&null!==e.proof?a.Proof.fromPartial(e.proof):void 0,r}};var O=(()=>{if(void 0!==O)return O;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw"Unable to locate global object"})();const Q=O.atob||(e=>O.Buffer.from(e,"base64").toString("binary"));function P(e){const t=Q(e),n=new Uint8Array(t.length);for(let e=0;eO.Buffer.from(e,"binary").toString("base64"));function M(e){const t=[];for(const n of e)t.push(String.fromCharCode(n));return R(t.join(""))}function x(e){var t;return{seconds:(t=e.getTime()/1e3,o.default.fromNumber(t)),nanos:e.getTime()%1e3*1e6}}function D(e){let t=1e3*e.seconds.toNumber();return t+=e.nanos/1e6,new Date(t)}function N(e){return e instanceof Date?x(e):"string"==typeof e?x(new Date(e)):c.Timestamp.fromJSON(e)}i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())}).call(this,n(3))},function(e,t,n){"use strict";(function(t){var r=n(14),o=n(571),i=n(236),a={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(c=n(237)),c),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(s(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,n=t&&t.silentJSONParsing,o=t&&t.forcedJSONParsing,a=!n&&"json"===this.responseType;if(a||o&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw i(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){u.headers[e]=r.merge(a)})),e.exports=u}).call(this,n(6))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasProtocol=t.instanceOfRpcStreamingClient=void 0,t.instanceOfRpcStreamingClient=function(e){return"function"==typeof e.listen},t.hasProtocol=function(e){return-1!==e.search("://")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Tendermint34Client=t.VoteType=t.broadcastTxSyncSuccess=t.broadcastTxCommitSuccess=t.SubscriptionEventType=t.Method=void 0;var r=n(113);Object.defineProperty(t,"Method",{enumerable:!0,get:function(){return r.Method}}),Object.defineProperty(t,"SubscriptionEventType",{enumerable:!0,get:function(){return r.SubscriptionEventType}});var o=n(588);Object.defineProperty(t,"broadcastTxCommitSuccess",{enumerable:!0,get:function(){return o.broadcastTxCommitSuccess}}),Object.defineProperty(t,"broadcastTxSyncSuccess",{enumerable:!0,get:function(){return o.broadcastTxSyncSuccess}}),Object.defineProperty(t,"VoteType",{enumerable:!0,get:function(){return o.VoteType}});var i=n(589);Object.defineProperty(t,"Tendermint34Client",{enumerable:!0,get:function(){return i.Tendermint34Client}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildQuery=t.SubscriptionEventType=t.Method=void 0,function(e){e.AbciInfo="abci_info",e.AbciQuery="abci_query",e.Block="block",e.Blockchain="blockchain",e.BlockResults="block_results",e.BlockSearch="block_search",e.BroadcastTxAsync="broadcast_tx_async",e.BroadcastTxSync="broadcast_tx_sync",e.BroadcastTxCommit="broadcast_tx_commit",e.Commit="commit",e.Genesis="genesis",e.Health="health",e.NumUnconfirmedTxs="num_unconfirmed_txs",e.Status="status",e.Subscribe="subscribe",e.Tx="tx",e.TxSearch="tx_search",e.Validators="validators",e.Unsubscribe="unsubscribe"}(t.Method||(t.Method={})),function(e){e.NewBlock="NewBlock",e.NewBlockHeader="NewBlockHeader",e.Tx="Tx"}(t.SubscriptionEventType||(t.SubscriptionEventType={})),t.buildQuery=function(e){return[...(e.tags?e.tags:[]).map(e=>`${e.key}='${e.value}'`),...e.raw?[e.raw]:[]].join(" AND ")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodeBlockId=t.encodeVersion=t.encodeBytes=t.encodeTime=t.encodeInt=t.encodeString=t.Integer=t.dictionaryToStringMap=t.may=t.optional=t.assertNotEmpty=t.assertObject=t.assertArray=t.assertNumber=t.assertString=t.assertBoolean=t.assertSet=void 0;const r=n(5),o=n(11);function i(e){if(void 0===e)throw new Error("Value must not be undefined");if(null===e)throw new Error("Value must not be null");return e}t.assertSet=i,t.assertBoolean=function(e){if(i(e),"boolean"!=typeof e)throw new Error("Value must be a boolean");return e},t.assertString=function(e){if(i(e),"string"!=typeof e)throw new Error("Value must be a string");return e},t.assertNumber=function(e){if(i(e),"number"!=typeof e)throw new Error("Value must be a number");return e},t.assertArray=function(e){if(i(e),!Array.isArray(e))throw new Error("Value must be a an array");return e},t.assertObject=function(e){if(i(e),"object"!=typeof e)throw new Error("Value must be an object");if("[object Object]"!==Object.prototype.toString.call(e))throw new Error("Value must be a simple object");return e},t.assertNotEmpty=function(e){if(i(e),"number"==typeof e&&0===e)throw new Error("must provide a non-zero value");if(0===e.length)throw new Error("must provide a non-empty value");return e},t.optional=function(e,t){return null==e?t:e},t.may=function(e,t){return null==t?void 0:e(t)},t.dictionaryToStringMap=function(e){const t=new Map;for(const n of Object.keys(e)){const r=e[n];if("string"!=typeof r)throw new Error("Found dictionary value of type other than string");t.set(n,r)}return t};function a(e){return e>=128?Uint8Array.from([255&e|128,...a(e>>7)]):Uint8Array.from([255&e])}t.Integer=class{static parse(e){return("number"==typeof e?new o.Int53(e):o.Int53.fromString(e)).toNumber()}static encode(e){return new o.Int53(e).toString()}},t.encodeString=function(e){const t=(0,r.toUtf8)(e);return Uint8Array.from([t.length,...t])},t.encodeInt=a,t.encodeTime=function(e){const t=e.getTime(),n=Math.floor(t/1e3),r=n?[8,...a(n)]:new Uint8Array,o=(e.nanoseconds||0)+t%1e3*1e6,i=o?[16,...a(o)]:new Uint8Array;return Uint8Array.from([...r,...i])},t.encodeBytes=function(e){if(e.length>=128)throw new Error("Not implemented for byte arrays of length 128 or more");return e.length?Uint8Array.from([e.length,...e]):new Uint8Array},t.encodeVersion=function(e){const t=e.block?Uint8Array.from([8,...a(e.block)]):new Uint8Array,n=e.app?Uint8Array.from([16,...a(e.app)]):new Uint8Array;return Uint8Array.from([...t,...n])},t.encodeBlockId=function(e){return Uint8Array.from([10,e.hash.length,...e.hash,18,e.parts.hash.length+4,8,e.parts.total,18,e.parts.hash.length,...e.parts.hash])}},function(e,t,n){const r=n(72),{SigningCosmosClient:o}=n(73);t.addKeplrChain=async function(e){let t=r.default.find(t=>t.name===e);if(window.getOfflineSigner&&window.keplr)if(window.keplr.experimentalSuggestChain)try{await window.keplr.experimentalSuggestChain({chainId:t.chainId,chainName:t.name,rpc:t.rpcURL,rest:t.apiURL,stakeCurrency:{coinDenom:t.coinLookup.viewDenom,coinMinimalDenom:t.coinLookup.chainDenom,coinDecimals:6},bip44:{coinType:118},bech32Config:{bech32PrefixAccAddr:t.coinLookup.addressPrefix,bech32PrefixAccPub:t.coinLookup.addressPrefix+"pub",bech32PrefixValAddr:t.coinLookup.addressPrefix+"valoper",bech32PrefixValPub:t.coinLookup.addressPrefix+"valoperpub",bech32PrefixConsAddr:t.coinLookup.addressPrefix+"valcons",bech32PrefixConsPub:t.coinLookup.addressPrefix+"valconspub"},currencies:[{coinDenom:t.coinLookup.viewDenom,coinMinimalDenom:t.coinLookup.chainDenom,coinDecimals:6}],feeCurrencies:[{coinDenom:t.coinLookup.viewDenom,coinMinimalDenom:t.coinLookup.chainDenom,coinDecimals:6}],coinType:118,gasPriceStep:{low:.01,average:.025,high:.04}})}catch{alert("Failed to suggest the chain")}else alert("Please use the recent version of keplr extension");else alert("Please install keplr extension");const n=t.chainId;await window.keplr.enable(n);const i=window.getOfflineSigner(n);window.keplr.defaultOptions={sign:{preferNoSetMemo:!0,preferNoSetFee:!0,disableBalanceCheck:!1}};const a=await i.getAccounts();new o(t.rpcURL,a[0].address,i);return{accounts:a,foundChain:t}},t.getCount=function(){return 1}},function(e,t,n){const r=n(72),{SigningCosmosClient:o}=n(73),{assertIsBroadcastTxSuccess:i,SigningStargateClient:a}=n(207),s=n(249);t.sendByChain=async function(e,t,n,o,i,c,u){let d=r.default.find(t=>t.name===e);if(n=parseFloat(n),isNaN(n))return alert("Invalid amount"),!1;n*=1e6,n=Math.floor(n),(async()=>{const e=d.chainId;await window.keplr.enable(e);const r=await window.getOfflineSignerAuto(e),l=await r.getAccounts();let f="";try{await s.get(d.rpcURL);f=d.rpcURL}catch(e){f=d.rpcRegistryURL}const h=await a.connectWithSigner(f,r),p={denom:d.coinLookup.chainDenom,amount:n.toString()},A={amount:[{denom:d.coinLookup.chainDenom,amount:"5000"}],gas:"200000"};try{const e=await h.sendTokens(l[0].address,t,[p],A,i);if(void 0!==e.code&&0!==e.code)alert("Failed to send tx: "+e.log||!1);else{u("#spinner").hide("slow"),u("#AcceptedTx").show(),u("#returnResult").html(e.transactionHash);var g="/api-cosmos/?tx_hash="+e.transactionHash+"&order_id="+o;s.get(g).then((function(t){console.log(t),u("#returnResultStore").html(t.data.message),u("#sendForm").hide(),u("#viewFinalTx").show(),u("#checkAdresse").show(),u("#waitingcheckAdresse").hide(),u("#checkAdresse").css("color","#31BF91"),u("#checkAmount").show(),u("#waitingcheckAmount").hide(),u(".woocommerce-thankyou-order-received").css("border-color","#20c005"),u(".woocommerce-thankyou-order-received").css("color","#20c005"),u(".woocommerce-thankyou-order-received").html("Payment accepted"),u("#validateTx").hide("slow"),u("#finalUrlTx").attr("href","https://www.mintscan.io/"+d.mintscanId+"/txs/"+e.transactionHash),u("#viewFinalTx").show(1e3),u("#timer").hide(),"true"===c&&setTimeout((function(){window.location.href="/my-account/view-order/"+o+"/"}),5e3)})).catch((function(e){console.log(e)}))}}catch(e){console.error(e),u("#keplrError").html(e),u("#spinner").hide(),u("#cancelTx").show()}})()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findAttribute=t.parseLogs=t.parseLog=t.parseEvent=t.parseAttribute=void 0;const r=n(45);function o(e){if(!r.isNonNullObject(e))throw new Error("Attribute must be a non-null object");const{key:t,value:n}=e;if("string"!=typeof t||!t)throw new Error("Attribute's key must be a non-empty string");if("string"!=typeof n&&void 0!==n)throw new Error("Attribute's value must be a string or unset");return{key:t,value:n||""}}function i(e){if(!r.isNonNullObject(e))throw new Error("Event must be a non-null object");const{type:t,attributes:n}=e;if("string"!=typeof t||""===t)throw new Error("Event type must be a non-empty string");if(!Array.isArray(n))throw new Error("Event's attributes must be an array");return{type:t,attributes:n.map(o)}}function a(e){if(!r.isNonNullObject(e))throw new Error("Log must be a non-null object");const{msg_index:t,log:n,events:o}=e;if("number"!=typeof t)throw new Error("Log's msg_index must be a number");if("string"!=typeof n)throw new Error("Log's log must be a string");if(!Array.isArray(o))throw new Error("Log's events must be an array");return{msg_index:t,log:n,events:o.map(i)}}t.parseAttribute=o,t.parseEvent=i,t.parseLog=a,t.parseLogs=function(e){if(!Array.isArray(e))throw new Error("Logs must be an array");return e.map(a)},t.findAttribute=function(e,t,n){var r;const o=e.find(()=>!0),i=null===(r=null==o?void 0:o.events.find(e=>e.type===t))||void 0===r?void 0:r.attributes.find(e=>e.key===n);if(!i)throw new Error(`Could not find attribute '${n}' in first event of type '${t}' in first log.`);return i}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pubkeyToAddress=t.rawSecp256k1PubkeyToAddress=void 0;const r=n(46),o=n(22),i=n(65);function a(e,t){if(33!==e.length)throw new Error("Invalid Secp256k1 pubkey length (compressed): "+e.length);const n=r.sha256(e),i=r.ripemd160(n);return o.Bech32.encode(t,i)}t.rawSecp256k1PubkeyToAddress=a,t.pubkeyToAddress=function(e,t){const n=o.fromBase64(e.value);switch(e.type){case i.pubkeyType.secp256k1:return a(n,t);case i.pubkeyType.ed25519:{if(32!==n.length)throw new Error("Invalid Ed25519 pubkey length: "+n.length);const e=r.sha256(n);return o.Bech32.encode(t,e.slice(0,20))}case i.pubkeyType.sr25519:{if(32!==n.length)throw new Error("Invalid Sr25519 pubkey length: "+n.length);const e=r.sha256(n);return o.Bech32.encode(t,e.slice(0,20))}default:throw new Error("Unrecognized public key algorithm")}}},function(e,t,n){"use strict";for(var r="qpzry9x8gf2tvdw0s3jn54khce6mua7l",o={},i=0;i>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function c(e){for(var t=1,n=0;n126)return"Invalid prefix ("+e+")";t=s(t)^r>>5}for(t=s(t),n=0;nt)return"Exceeds length limit";var n=e.toLowerCase(),r=e.toUpperCase();if(e!==n&&e!==r)return"Mixed-case string "+e;var i=(e=n).lastIndexOf("1");if(-1===i)return"No separator character for "+e;if(0===i)return"Missing prefix for "+e;var a=e.slice(0,i),u=e.slice(i+1);if(u.length<6)return"Data too short";var d=c(a);if("string"==typeof d)return d;for(var l=[],f=0;f=u.length||l.push(p)}return 1!==d?"Invalid checksum for "+e:{prefix:a,words:l}}function d(e,t,n,r){for(var o=0,i=0,a=(1<=n;)i-=n,s.push(o>>i&a);if(r)i>0&&s.push(o<=t)return"Excess padding";if(o<n)throw new TypeError("Exceeds length limit");var o=c(e=e.toLowerCase());if("string"==typeof o)throw new Error(o);for(var i=e+"1",a=0;a>5!=0)throw new Error("Non 5-bit word");o=s(o)^u,i+=r.charAt(u)}for(a=0;a<6;++a)o=s(o);for(o^=1,a=0;a<6;++a){i+=r.charAt(o>>5*(5-a)&31)}return i},toWordsUnsafe:function(e){var t=d(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=d(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=d(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=d(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const r=n(38),o=n(59),i=n(32),a=n(140);let s=a._default;const c="A wordlist is required but a default could not be found.\nPlease pass a 2048 word array explicitly.";function u(e){return(e||"").normalize("NFKD")}function d(e,t,n){for(;e.lengthd(e.toString(2),"0",8)).join("")}function h(e){const t=8*e.length/32,n=r("sha256").update(e).digest();return f(Array.from(n)).slice(0,t)}function p(e){return"mnemonic"+(e||"")}function A(t,n){if(!(n=n||s))throw new Error(c);const r=u(t).split(" ");if(r.length%3!=0)throw new Error("Invalid mnemonic");const o=r.map(e=>{const t=n.indexOf(e);if(-1===t)throw new Error("Invalid mnemonic");return d(t.toString(2),"0",11)}).join(""),i=32*Math.floor(o.length/33),a=o.slice(0,i),f=o.slice(i),p=a.match(/(.{1,8})/g).map(l);if(p.length<16)throw new Error("Invalid entropy");if(p.length>32)throw new Error("Invalid entropy");if(p.length%4!=0)throw new Error("Invalid entropy");const A=e.from(p);if(h(A)!==f)throw new Error("Invalid mnemonic checksum");return A.toString("hex")}function g(t,n){if(e.isBuffer(t)||(t=e.from(t,"hex")),!(n=n||s))throw new Error(c);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=(f(Array.from(t))+h(t)).match(/(.{1,11})/g).map(e=>{const t=l(e);return n[t]});return"あいこくしん"===n[0]?r.join(" "):r.join(" ")}t.mnemonicToSeedSync=function(t,n){const r=e.from(u(t),"utf8"),i=e.from(p(u(n)),"utf8");return o.pbkdf2Sync(r,i,2048,64,"sha512")},t.mnemonicToSeed=function(t,n){return Promise.resolve().then(()=>function(e,t,n,r,i){return Promise.resolve().then(()=>new Promise((a,s)=>{o.pbkdf2(e,t,n,r,i,(e,t)=>e?s(e):a(t))}))}(e.from(u(t),"utf8"),e.from(p(u(n)),"utf8"),2048,64,"sha512"))},t.mnemonicToEntropy=A,t.entropyToMnemonic=g,t.generateMnemonic=function(e,t,n){if((e=e||128)%32!=0)throw new TypeError("Invalid entropy");return g((t=t||i)(e/8),n)},t.validateMnemonic=function(e,t){try{A(e,t)}catch(e){return!1}return!0},t.setDefaultWordlist=function(e){const t=a.wordlists[e];if(!t)throw new Error('Could not find wordlist for language "'+e+'"');s=t},t.getDefaultWordlist=function(){if(!s)throw new Error("No Default Wordlist set");return Object.keys(a.wordlists).filter(e=>"JA"!==e&&"EN"!==e&&a.wordlists[e].every((e,t)=>e===s[t]))[0]};var m=n(140);t.wordlists=m.wordlists}).call(this,n(7).Buffer)},function(e,t,n){"use strict";var r=n(4).Buffer,o=n(272).Transform;function i(e){o.call(this),this._block=r.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}n(2)(i,o),i.prototype._transform=function(e,t,n){var r=null;try{this.update(e,t)}catch(e){r=e}n(r)},i.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},i.prototype.update=function(e,t){if(function(e,t){if(!r.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");r.isBuffer(e)||(e=r.from(e,t));for(var n=this._block,o=0;this._blockOffset+e.length-o>=this._blockSize;){for(var i=this._blockOffset;i0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},i.prototype._update=function(){throw new Error("_update is not implemented")},i.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var n=0;n<4;++n)this._length[n]=0;return t},i.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=i},function(e,t,n){"use strict";(function(t,r){var o;e.exports=B,B.ReadableState=_;n(29).EventEmitter;var i=function(e,t){return e.listeners(t).length},a=n(124),s=n(7).Buffer,c=t.Uint8Array||function(){};var u,d=n(273);u=d&&d.debuglog?d.debuglog("stream"):function(){};var l,f,h,p=n(274),A=n(125),g=n(126).getHighWaterMark,m=n(39).codes,v=m.ERR_INVALID_ARG_TYPE,y=m.ERR_STREAM_PUSH_AFTER_EOF,b=m.ERR_METHOD_NOT_IMPLEMENTED,I=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(2)(B,a);var w=A.errorOrDestroy,E=["error","close","destroy","pause","resume"];function _(e,t,r){o=o||n(40),e=e||{},"boolean"!=typeof r&&(r=t instanceof o),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",r),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!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=n(30).StringDecoder),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function B(e){if(o=o||n(40),!(this instanceof B))return new B(e);var t=this instanceof o;this._readableState=new _(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function C(e,t,n,r,o){u("readableAddChunk",t);var i,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(u("onEofChunk"),t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,Q(e)))}(e,a);else if(o||(i=function(e,t){var n;r=t,s.isBuffer(r)||r instanceof c||"string"==typeof t||void 0===t||e.objectMode||(n=new v("chunk",["string","Buffer","Uint8Array"],t));var r;return n}(a,t)),i)w(e,i);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),r)a.endEmitted?w(e,new I):k(e,a,t,!0);else if(a.ended)w(e,new y);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?k(e,a,t,!1):P(e,a)):k(e,a,t,!1)}else r||(a.reading=!1,P(e,a));return!a.ended&&(a.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(Q,e))}function Q(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,N(e)}function P(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function x(e){u("readable nexttick read 0"),e.read(0)}function D(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),N(e),t.flowing&&!t.reading&&e.read(0)}function N(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function T(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function j(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(U,t,e))}function U(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function H(e,t){for(var n=0,r=e.length;n=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?j(this):O(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&j(this),null;var r,o=t.needReadable;return u("need readable",o),(0===t.length||t.length-e0?T(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&j(this)),null!==r&&this.emit("data",r),r},B.prototype._read=function(e){w(this,new b("_read()"))},B.prototype.pipe=function(e,t){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,u("pipe count=%d opts=%j",o.pipesCount,t);var a=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:g;function s(t,r){u("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,u("cleanup"),e.removeListener("close",p),e.removeListener("finish",A),e.removeListener("drain",d),e.removeListener("error",h),e.removeListener("unpipe",s),n.removeListener("end",c),n.removeListener("end",g),n.removeListener("data",f),l=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||d())}function c(){u("onend"),e.end()}o.endEmitted?r.nextTick(a):n.once("end",a),e.on("unpipe",s);var d=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,N(e))}}(n);e.on("drain",d);var l=!1;function f(t){u("ondata");var r=e.write(t);u("dest.write",r),!1===r&&((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==H(o.pipes,e))&&!l&&(u("false write response, pause",o.awaitDrain),o.awaitDrain++),n.pause())}function h(t){u("onerror",t),g(),e.removeListener("error",h),0===i(e,"error")&&w(e,t)}function p(){e.removeListener("finish",A),g()}function A(){u("onfinish"),e.removeListener("close",p),g()}function g(){u("unpipe"),n.unpipe(e)}return n.on("data",f),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",h),e.once("close",p),e.once("finish",A),e.emit("pipe",n),o.flowing||(u("pipe resume"),n.resume()),e},B.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==o.flowing&&this.resume()):"readable"===e&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,u("on readable",o.length,o.reading),o.length?O(this):o.reading||r.nextTick(x,this))),n},B.prototype.addListener=B.prototype.on,B.prototype.removeListener=function(e,t){var n=a.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(M,this),n},B.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(M,this),t},B.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(D,e,t))}(this,e)),e.paused=!1,this},B.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},B.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var o in e.on("end",(function(){if(u("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(o){(u("wrapped data"),n.decoder&&(o=n.decoder.write(o)),n.objectMode&&null==o)||(n.objectMode||o&&o.length)&&(t.push(o)||(r=!0,e.pause()))})),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var i=0;i-1))throw new I(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(B.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(B.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),B.prototype._write=function(e,t,n){n(new A("_write()"))},B.prototype._writev=null,B.prototype.end=function(e,t,n){var o=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),o.corked&&(o.corked=1,this.uncork()),o.ending||function(e,t,n){t.ending=!0,P(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,o,n),this},Object.defineProperty(B.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(B.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),B.prototype.destroy=l.destroy,B.prototype._undestroy=l.undestroy,B.prototype._destroy=function(e,t){t(e)}}).call(this,n(3),n(6))},function(e,t,n){"use strict";e.exports=d;var r=n(39).codes,o=r.ERR_METHOD_NOT_IMPLEMENTED,i=r.ERR_MULTIPLE_CALLBACK,a=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=r.ERR_TRANSFORM_WITH_LENGTH_0,c=n(40);function u(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new i);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function f(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}r(c,o),c.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},c.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,o=0|this._b,i=0|this._c,s=0|this._d,c=0|this._e,p=0|this._f,A=0|this._g,g=0|this._h,m=0;m<16;++m)n[m]=e.readInt32BE(4*m);for(;m<64;++m)n[m]=0|(((t=n[m-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+n[m-7]+h(n[m-15])+n[m-16];for(var v=0;v<64;++v){var y=g+f(c)+u(c,p,A)+a[v]+n[v]|0,b=l(r)+d(r,o,i)|0;g=A,A=p,p=c,c=s+y|0,s=i,i=o,o=r,r=y+b|0}this._a=r+this._a|0,this._b=o+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0,this._f=p+this._f|0,this._g=A+this._g|0,this._h=g+this._h|0},c.prototype._hash=function(){var e=i.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=c},function(e,t,n){var r=n(2),o=n(41),i=n(4).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 c(){this.init(),this._w=s,o.call(this,128,112)}function u(e,t,n){return n^e&(t^n)}function d(e,t,n){return e&t|n&(e|t)}function l(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function f(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function A(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function g(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function m(e,t){return e>>>0>>0?1:0}r(c,o),c.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},c.prototype._update=function(e){for(var t=this._w,n=0|this._ah,r=0|this._bh,o=0|this._ch,i=0|this._dh,s=0|this._eh,c=0|this._fh,v=0|this._gh,y=0|this._hh,b=0|this._al,I=0|this._bl,w=0|this._cl,E=0|this._dl,_=0|this._el,B=0|this._fl,C=0|this._gl,k=0|this._hl,S=0;S<32;S+=2)t[S]=e.readInt32BE(4*S),t[S+1]=e.readInt32BE(4*S+4);for(;S<160;S+=2){var O=t[S-30],Q=t[S-30+1],P=h(O,Q),R=p(Q,O),M=A(O=t[S-4],Q=t[S-4+1]),x=g(Q,O),D=t[S-14],N=t[S-14+1],T=t[S-32],j=t[S-32+1],U=R+N|0,H=P+D+m(U,R)|0;H=(H=H+M+m(U=U+x|0,x)|0)+T+m(U=U+j|0,j)|0,t[S]=H,t[S+1]=U}for(var J=0;J<160;J+=2){H=t[J],U=t[J+1];var F=d(n,r,o),L=d(b,I,w),q=l(n,b),G=l(b,n),V=f(s,_),z=f(_,s),Y=a[J],K=a[J+1],W=u(s,c,v),Z=u(_,B,C),X=k+z|0,$=y+V+m(X,k)|0;$=($=($=$+W+m(X=X+Z|0,Z)|0)+Y+m(X=X+K|0,K)|0)+H+m(X=X+U|0,U)|0;var ee=G+L|0,te=q+F+m(ee,G)|0;y=v,k=C,v=c,C=B,c=s,B=_,s=i+$+m(_=E+X|0,E)|0,i=o,E=w,o=r,w=I,r=n,I=b,n=$+te+m(b=X+ee|0,X)|0}this._al=this._al+b|0,this._bl=this._bl+I|0,this._cl=this._cl+w|0,this._dl=this._dl+E|0,this._el=this._el+_|0,this._fl=this._fl+B|0,this._gl=this._gl+C|0,this._hl=this._hl+k|0,this._ah=this._ah+n+m(this._al,b)|0,this._bh=this._bh+r+m(this._bl,I)|0,this._ch=this._ch+o+m(this._cl,w)|0,this._dh=this._dh+i+m(this._dl,E)|0,this._eh=this._eh+s+m(this._el,_)|0,this._fh=this._fh+c+m(this._fl,B)|0,this._gh=this._gh+v+m(this._gl,C)|0,this._hh=this._hh+y+m(this._hl,k)|0},c.prototype._hash=function(){var e=i.allocUnsafe(64);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=c},function(e,t,n){"use strict";(function(t,r){var o=n(58);e.exports=y;var i,a=n(118);y.ReadableState=v;n(29).EventEmitter;var s=function(e,t){return e.listeners(t).length},c=n(132),u=n(79).Buffer,d=t.Uint8Array||function(){};var l=Object.create(n(47));l.inherits=n(2);var f=n(285),h=void 0;h=f&&f.debuglog?f.debuglog("stream"):function(){};var p,A=n(286),g=n(133);l.inherits(y,c);var m=["error","close","destroy","pause","resume"];function v(e,t){e=e||{};var r=t instanceof(i=i||n(31));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var o=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new A,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=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=n(30).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function y(e){if(i=i||n(31),!(this instanceof y))return new y(e);this._readableState=new v(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),c.call(this)}function b(e,t,n,r,o){var i,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,E(e)}(e,a)):(o||(i=function(e,t){var n;r=t,u.isBuffer(r)||r instanceof d||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(a,t)),i?e.emit("error",i):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):I(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?I(e,a,t,!1):B(e,a)):I(e,a,t,!1))):r||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?o.nextTick(_,e):_(e))}function _(e){h("emit readable"),e.emit("readable"),O(e)}function B(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(C,e,t))}function C(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;ei.length?i.length:e;if(a===i.length?o+=i:o+=i.slice(0,e),0===(e-=a)){a===i.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(a));break}++r}return t.length-=r,o}(e,t):function(e,t){var n=u.allocUnsafe(e),r=t.head,o=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(n,n.length-e,0,a),0===(e-=a)){a===i.length?(++o,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(a));break}++o}return t.length-=o,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function P(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,o.nextTick(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function M(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):E(this),null;if(0===(e=w(e,t))&&t.ended)return 0===t.length&&P(this),null;var r,o=t.needReadable;return h("need readable",o),(0===t.length||t.length-e0?Q(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&P(this)),null!==r&&this.emit("data",r),r},y.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},y.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,h("pipe count=%d opts=%j",i.pipesCount,t);var c=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?d:y;function u(t,r){h("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),e.removeListener("close",m),e.removeListener("finish",v),e.removeListener("drain",l),e.removeListener("error",g),e.removeListener("unpipe",u),n.removeListener("end",d),n.removeListener("end",y),n.removeListener("data",A),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function d(){h("onend"),e.end()}i.endEmitted?o.nextTick(c):n.once("end",c),e.on("unpipe",u);var l=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,O(e))}}(n);e.on("drain",l);var f=!1;var p=!1;function A(t){h("ondata"),p=!1,!1!==e.write(t)||p||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==M(i.pipes,e))&&!f&&(h("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,p=!0),n.pause())}function g(t){h("onerror",t),y(),e.removeListener("error",g),0===s(e,"error")&&e.emit("error",t)}function m(){e.removeListener("finish",v),y()}function v(){h("onfinish"),e.removeListener("close",m),y()}function y(){h("unpipe"),n.unpipe(e)}return n.on("data",A),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",g),e.once("close",m),e.once("finish",v),e.emit("pipe",n),i.flowing||(h("pipe resume"),n.resume()),e},y.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;in||t!=t)throw new TypeError("Bad key length")}},function(e,t,n){(function(t,n){var r;if(t.process&&t.process.browser)r="utf-8";else if(t.process&&t.process.version){r=parseInt(n.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else r="utf-8";e.exports=r}).call(this,n(3),n(6))},function(e,t,n){var r=n(138),o=n(56),i=n(57),a=n(4).Buffer,s=n(135),c=n(136),u=n(139),d=a.alloc(128),l={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function f(e,t,n){var s=function(e){function t(t){return i(e).update(t).digest()}return"rmd160"===e||"ripemd160"===e?function(e){return(new o).update(e).digest()}:"md5"===e?r:t}(e),c="sha512"===e||"sha384"===e?128:64;t.length>c?t=s(t):t.length(new e).update(t).digest();let r=t;if(r.length>n&&(r=this.hash(r)),r.length92^e),this.iKeyPad=r.map(e=>54^e),this.messageHasher=new e,this.blockSize=n,this.update(this.iKeyPad)}update(e){return this.messageHasher.update(e),this}digest(){const e=this.messageHasher.digest();return this.hash(new Uint8Array([...this.oKeyPad,...e]))}}},function(e,t,n){var r,o,i,a,s;s="object"==typeof(a=this).sodium&&"function"==typeof a.sodium.onload?a.sodium.onload:null,o=[t,n(311)],void 0!==(i="function"==typeof(r=function(e,t){"use strict";var n,r=t.ready.then((function(){function r(){if(0!==n._sodium_init())throw new Error("libsodium was not correctly initialized.");for(var t=["crypto_aead_chacha20poly1305_decrypt","crypto_aead_chacha20poly1305_decrypt_detached","crypto_aead_chacha20poly1305_encrypt","crypto_aead_chacha20poly1305_encrypt_detached","crypto_aead_chacha20poly1305_ietf_decrypt","crypto_aead_chacha20poly1305_ietf_decrypt_detached","crypto_aead_chacha20poly1305_ietf_encrypt","crypto_aead_chacha20poly1305_ietf_encrypt_detached","crypto_aead_chacha20poly1305_ietf_keygen","crypto_aead_chacha20poly1305_keygen","crypto_aead_xchacha20poly1305_ietf_decrypt","crypto_aead_xchacha20poly1305_ietf_decrypt_detached","crypto_aead_xchacha20poly1305_ietf_encrypt","crypto_aead_xchacha20poly1305_ietf_encrypt_detached","crypto_aead_xchacha20poly1305_ietf_keygen","crypto_auth","crypto_auth_hmacsha256","crypto_auth_hmacsha256_final","crypto_auth_hmacsha256_init","crypto_auth_hmacsha256_keygen","crypto_auth_hmacsha256_update","crypto_auth_hmacsha256_verify","crypto_auth_hmacsha512","crypto_auth_hmacsha512_final","crypto_auth_hmacsha512_init","crypto_auth_hmacsha512_keygen","crypto_auth_hmacsha512_update","crypto_auth_hmacsha512_verify","crypto_auth_keygen","crypto_auth_verify","crypto_box_beforenm","crypto_box_curve25519xchacha20poly1305_keypair","crypto_box_curve25519xchacha20poly1305_seal","crypto_box_curve25519xchacha20poly1305_seal_open","crypto_box_detached","crypto_box_easy","crypto_box_easy_afternm","crypto_box_keypair","crypto_box_open_detached","crypto_box_open_easy","crypto_box_open_easy_afternm","crypto_box_seal","crypto_box_seal_open","crypto_box_seed_keypair","crypto_core_ed25519_add","crypto_core_ed25519_from_hash","crypto_core_ed25519_from_uniform","crypto_core_ed25519_is_valid_point","crypto_core_ed25519_random","crypto_core_ed25519_scalar_add","crypto_core_ed25519_scalar_complement","crypto_core_ed25519_scalar_invert","crypto_core_ed25519_scalar_mul","crypto_core_ed25519_scalar_negate","crypto_core_ed25519_scalar_random","crypto_core_ed25519_scalar_reduce","crypto_core_ed25519_scalar_sub","crypto_core_ed25519_sub","crypto_core_hchacha20","crypto_core_hsalsa20","crypto_core_ristretto255_add","crypto_core_ristretto255_from_hash","crypto_core_ristretto255_is_valid_point","crypto_core_ristretto255_random","crypto_core_ristretto255_scalar_add","crypto_core_ristretto255_scalar_complement","crypto_core_ristretto255_scalar_invert","crypto_core_ristretto255_scalar_mul","crypto_core_ristretto255_scalar_negate","crypto_core_ristretto255_scalar_random","crypto_core_ristretto255_scalar_reduce","crypto_core_ristretto255_scalar_sub","crypto_core_ristretto255_sub","crypto_generichash","crypto_generichash_blake2b_salt_personal","crypto_generichash_final","crypto_generichash_init","crypto_generichash_keygen","crypto_generichash_update","crypto_hash","crypto_hash_sha256","crypto_hash_sha256_final","crypto_hash_sha256_init","crypto_hash_sha256_update","crypto_hash_sha512","crypto_hash_sha512_final","crypto_hash_sha512_init","crypto_hash_sha512_update","crypto_kdf_derive_from_key","crypto_kdf_keygen","crypto_kx_client_session_keys","crypto_kx_keypair","crypto_kx_seed_keypair","crypto_kx_server_session_keys","crypto_onetimeauth","crypto_onetimeauth_final","crypto_onetimeauth_init","crypto_onetimeauth_keygen","crypto_onetimeauth_update","crypto_onetimeauth_verify","crypto_pwhash","crypto_pwhash_scryptsalsa208sha256","crypto_pwhash_scryptsalsa208sha256_ll","crypto_pwhash_scryptsalsa208sha256_str","crypto_pwhash_scryptsalsa208sha256_str_verify","crypto_pwhash_str","crypto_pwhash_str_needs_rehash","crypto_pwhash_str_verify","crypto_scalarmult","crypto_scalarmult_base","crypto_scalarmult_ed25519","crypto_scalarmult_ed25519_base","crypto_scalarmult_ed25519_base_noclamp","crypto_scalarmult_ed25519_noclamp","crypto_scalarmult_ristretto255","crypto_scalarmult_ristretto255_base","crypto_secretbox_detached","crypto_secretbox_easy","crypto_secretbox_keygen","crypto_secretbox_open_detached","crypto_secretbox_open_easy","crypto_secretstream_xchacha20poly1305_init_pull","crypto_secretstream_xchacha20poly1305_init_push","crypto_secretstream_xchacha20poly1305_keygen","crypto_secretstream_xchacha20poly1305_pull","crypto_secretstream_xchacha20poly1305_push","crypto_secretstream_xchacha20poly1305_rekey","crypto_shorthash","crypto_shorthash_keygen","crypto_shorthash_siphashx24","crypto_sign","crypto_sign_detached","crypto_sign_ed25519_pk_to_curve25519","crypto_sign_ed25519_sk_to_curve25519","crypto_sign_ed25519_sk_to_pk","crypto_sign_ed25519_sk_to_seed","crypto_sign_final_create","crypto_sign_final_verify","crypto_sign_init","crypto_sign_keypair","crypto_sign_open","crypto_sign_seed_keypair","crypto_sign_update","crypto_sign_verify_detached","crypto_stream_chacha20","crypto_stream_chacha20_ietf_xor","crypto_stream_chacha20_ietf_xor_ic","crypto_stream_chacha20_keygen","crypto_stream_chacha20_xor","crypto_stream_chacha20_xor_ic","crypto_stream_keygen","crypto_stream_xchacha20_keygen","crypto_stream_xchacha20_xor","crypto_stream_xchacha20_xor_ic","randombytes_buf","randombytes_buf_deterministic","randombytes_close","randombytes_random","randombytes_set_implementation","randombytes_stir","randombytes_uniform","sodium_version_string"],r=[I,w,E,_,B,C,k,S,O,Q,P,R,M,x,D,N,T,j,U,H,J,F,L,q,G,V,z,Y,K,W,Z,X,$,ee,te,ne,re,oe,ie,ae,se,ce,ue,de,le,fe,he,pe,Ae,ge,me,ve,ye,be,Ie,we,Ee,_e,Be,Ce,ke,Se,Oe,Qe,Pe,Re,Me,xe,De,Ne,Te,je,Ue,He,Je,Fe,Le,qe,Ge,Ve,ze,Ye,Ke,We,Ze,Xe,$e,et,tt,nt,rt,ot,it,at,st,ct,ut,dt,lt,ft,ht,pt,At,gt,mt,vt,yt,bt,It,wt,Et,_t,Bt,Ct,kt,St,Ot,Qt,Pt,Rt,Mt,xt,Dt,Nt,Tt,jt,Ut,Ht,Jt,Ft,Lt,qt,Gt,Vt,zt,Yt,Kt,Wt,Zt,Xt,$t,en,tn,nn,rn,on,an,sn,cn,un,dn,ln,fn,hn,pn,An,gn,mn,vn,yn,bn,In],o=0;o=240?(d=4,c=!0):l>=224?(d=3,c=!0):l>=192?(d=2,c=!0):l<128&&(d=1,c=!0)}while(!c);for(var f=d-(s.length-u),h=0;h>8&-39)<<8|87+(t=e[i]>>>4)+(t-10>>8&-39),o+=String.fromCharCode(255&r)+String.fromCharCode(r>>>8);return o}var s={ORIGINAL:1,ORIGINAL_NO_PADDING:3,URLSAFE:5,URLSAFE_NO_PADDING:7};function c(e){if(null==e)return s.URLSAFE_NO_PADDING;if(e!==s.ORIGINAL&&e!==s.ORIGINAL_NO_PADDING&&e!==s.URLSAFE&&e!=s.URLSAFE_NO_PADDING)throw new Error("unsupported base64 variant");return e}function u(e,t){t=c(t),e=b(o,e,"input");var r,o=[],a=0|Math.floor(e.length/3),s=e.length-3*a,u=4*a+(0!==s?0==(2&t)?4:2+(s>>>1):0),d=new h(u+1),l=p(e);return o.push(l),o.push(d.address),0===n._sodium_bin2base64(d.address,d.length,l,e.length,t)&&m(o,"conversion failed"),d.length=u,r=i(d.to_Uint8Array()),g(o),r}function d(e,t){var n=t||"uint8array";if(!l(n))throw new Error(n+" output format is not available");if(e instanceof h){if("uint8array"===n)return e.to_Uint8Array();if("text"===n)return i(e.to_Uint8Array());if("hex"===n)return a(e.to_Uint8Array());if("base64"===n)return u(e.to_Uint8Array(),s.URLSAFE_NO_PADDING);throw new Error('What is output format "'+n+'"?')}if("object"==typeof e){for(var r=Object.keys(e),o={},c=0;c>>24>>>8,c,l);var w=d(m,a);return g(s),w}function nt(e){var t=[];f(e);var r=new h(0|n._crypto_kdf_keybytes()),o=r.address;t.push(o),n._crypto_kdf_keygen(o);var i=d(r,e);return g(t),i}function rt(e,t,r,o){var i=[];f(o),e=b(i,e,"clientPublicKey");var a,s=0|n._crypto_kx_publickeybytes();e.length!==s&&v(i,"invalid clientPublicKey length"),a=p(e),i.push(a),t=b(i,t,"clientSecretKey");var c,u=0|n._crypto_kx_secretkeybytes();t.length!==u&&v(i,"invalid clientSecretKey length"),c=p(t),i.push(c),r=b(i,r,"serverPublicKey");var l,A=0|n._crypto_kx_publickeybytes();r.length!==A&&v(i,"invalid serverPublicKey length"),l=p(r),i.push(l);var y=new h(0|n._crypto_kx_sessionkeybytes()),I=y.address;i.push(I);var w=new h(0|n._crypto_kx_sessionkeybytes()),E=w.address;if(i.push(E),0==(0|n._crypto_kx_client_session_keys(I,E,a,c,l))){var _=d({sharedRx:y,sharedTx:w},o);return g(i),_}m(i,"invalid usage")}function ot(e){var t=[];f(e);var r=new h(0|n._crypto_kx_publickeybytes()),o=r.address;t.push(o);var i=new h(0|n._crypto_kx_secretkeybytes()),a=i.address;if(t.push(a),0==(0|n._crypto_kx_keypair(o,a))){var s={publicKey:d(r,e),privateKey:d(i,e),keyType:"x25519"};return g(t),s}m(t,"internal error")}function it(e,t){var r=[];f(t),e=b(r,e,"seed");var o,i=0|n._crypto_kx_seedbytes();e.length!==i&&v(r,"invalid seed length"),o=p(e),r.push(o);var a=new h(0|n._crypto_kx_publickeybytes()),s=a.address;r.push(s);var c=new h(0|n._crypto_kx_secretkeybytes()),u=c.address;if(r.push(u),0==(0|n._crypto_kx_seed_keypair(s,u,o))){var l={publicKey:d(a,t),privateKey:d(c,t),keyType:"x25519"};return g(r),l}m(r,"internal error")}function at(e,t,r,o){var i=[];f(o),e=b(i,e,"serverPublicKey");var a,s=0|n._crypto_kx_publickeybytes();e.length!==s&&v(i,"invalid serverPublicKey length"),a=p(e),i.push(a),t=b(i,t,"serverSecretKey");var c,u=0|n._crypto_kx_secretkeybytes();t.length!==u&&v(i,"invalid serverSecretKey length"),c=p(t),i.push(c),r=b(i,r,"clientPublicKey");var l,A=0|n._crypto_kx_publickeybytes();r.length!==A&&v(i,"invalid clientPublicKey length"),l=p(r),i.push(l);var y=new h(0|n._crypto_kx_sessionkeybytes()),I=y.address;i.push(I);var w=new h(0|n._crypto_kx_sessionkeybytes()),E=w.address;if(i.push(E),0==(0|n._crypto_kx_server_session_keys(I,E,a,c,l))){var _=d({sharedRx:y,sharedTx:w},o);return g(i),_}m(i,"invalid usage")}function st(e,t,r){var o=[];f(r);var i=p(e=b(o,e,"message")),a=e.length;o.push(i),t=b(o,t,"key");var s,c=0|n._crypto_onetimeauth_keybytes();t.length!==c&&v(o,"invalid key length"),s=p(t),o.push(s);var u=new h(0|n._crypto_onetimeauth_bytes()),l=u.address;if(o.push(l),0==(0|n._crypto_onetimeauth(l,i,a,0,s))){var A=d(u,r);return g(o),A}m(o,"invalid usage")}function ct(e,t){var r=[];f(t),y(r,e,"state_address");var o=new h(0|n._crypto_onetimeauth_bytes()),i=o.address;if(r.push(i),0==(0|n._crypto_onetimeauth_final(e,i))){var a=(n._free(e),d(o,t));return g(r),a}m(r,"invalid usage")}function ut(e,t){var r=[];f(t);var o=null;null!=e&&(o=p(e=b(r,e,"key")),e.length,r.push(o));var i=new h(144).address;if(0==(0|n._crypto_onetimeauth_init(i,o))){var a=i;return g(r),a}m(r,"invalid usage")}function dt(e){var t=[];f(e);var r=new h(0|n._crypto_onetimeauth_keybytes()),o=r.address;t.push(o),n._crypto_onetimeauth_keygen(o);var i=d(r,e);return g(t),i}function lt(e,t,r){var o=[];f(r),y(o,e,"state_address");var i=p(t=b(o,t,"message_chunk")),a=t.length;o.push(i),0!=(0|n._crypto_onetimeauth_update(e,i,a))&&m(o,"invalid usage"),g(o)}function ft(e,t,r){var o=[];e=b(o,e,"hash");var i,a=0|n._crypto_onetimeauth_bytes();e.length!==a&&v(o,"invalid hash length"),i=p(e),o.push(i);var s=p(t=b(o,t,"message")),c=t.length;o.push(s),r=b(o,r,"key");var u,d=0|n._crypto_onetimeauth_keybytes();r.length!==d&&v(o,"invalid key length"),u=p(r),o.push(u);var l=0==(0|n._crypto_onetimeauth_verify(i,s,c,0,u));return g(o),l}function ht(e,t,r,o,i,a,s){var c=[];f(s),y(c,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&v(c,"keyLength must be an unsigned integer");var u=p(t=b(c,t,"password")),l=t.length;c.push(u),r=b(c,r,"salt");var A,I=0|n._crypto_pwhash_saltbytes();r.length!==I&&v(c,"invalid salt length"),A=p(r),c.push(A),y(c,o,"opsLimit"),("number"!=typeof o||(0|o)!==o||o<0)&&v(c,"opsLimit must be an unsigned integer"),y(c,i,"memLimit"),("number"!=typeof i||(0|i)!==i||i<0)&&v(c,"memLimit must be an unsigned integer"),y(c,a,"algorithm"),("number"!=typeof a||(0|a)!==a||a<0)&&v(c,"algorithm must be an unsigned integer");var w=new h(0|e),E=w.address;if(c.push(E),0==(0|n._crypto_pwhash(E,e,0,u,l,0,A,o,0,i,a))){var _=d(w,s);return g(c),_}m(c,"invalid usage")}function pt(e,t,r,o,i,a){var s=[];f(a),y(s,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&v(s,"keyLength must be an unsigned integer");var c=p(t=b(s,t,"password")),u=t.length;s.push(c),r=b(s,r,"salt");var l,A=0|n._crypto_pwhash_scryptsalsa208sha256_saltbytes();r.length!==A&&v(s,"invalid salt length"),l=p(r),s.push(l),y(s,o,"opsLimit"),("number"!=typeof o||(0|o)!==o||o<0)&&v(s,"opsLimit must be an unsigned integer"),y(s,i,"memLimit"),("number"!=typeof i||(0|i)!==i||i<0)&&v(s,"memLimit must be an unsigned integer");var I=new h(0|e),w=I.address;if(s.push(w),0==(0|n._crypto_pwhash_scryptsalsa208sha256(w,e,0,c,u,0,l,o,0,i))){var E=d(I,a);return g(s),E}m(s,"invalid usage")}function At(e,t,r,o,i,a,s){var c=[];f(s);var u=p(e=b(c,e,"password")),l=e.length;c.push(u);var A=p(t=b(c,t,"salt")),I=t.length;c.push(A),y(c,r,"opsLimit"),("number"!=typeof r||(0|r)!==r||r<0)&&v(c,"opsLimit must be an unsigned integer"),y(c,o,"r"),("number"!=typeof o||(0|o)!==o||o<0)&&v(c,"r must be an unsigned integer"),y(c,i,"p"),("number"!=typeof i||(0|i)!==i||i<0)&&v(c,"p must be an unsigned integer"),y(c,a,"keyLength"),("number"!=typeof a||(0|a)!==a||a<0)&&v(c,"keyLength must be an unsigned integer");var w=new h(0|a),E=w.address;if(c.push(E),0==(0|n._crypto_pwhash_scryptsalsa208sha256_ll(u,l,A,I,r,0,o,i,E,a))){var _=d(w,s);return g(c),_}m(c,"invalid usage")}function gt(e,t,r,o){var i=[];f(o);var a=p(e=b(i,e,"password")),s=e.length;i.push(a),y(i,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&v(i,"opsLimit must be an unsigned integer"),y(i,r,"memLimit"),("number"!=typeof r||(0|r)!==r||r<0)&&v(i,"memLimit must be an unsigned integer");var c=new h(0|n._crypto_pwhash_scryptsalsa208sha256_strbytes()).address;if(i.push(c),0==(0|n._crypto_pwhash_scryptsalsa208sha256_str(c,a,s,0,t,0,r))){var u=n.UTF8ToString(c);return g(i),u}m(i,"invalid usage")}function mt(e,t,r){var i=[];f(r),"string"!=typeof e&&v(i,"hashed_password must be a string"),e=o(e+"\0"),null!=s&&e.length-1!==s&&v(i,"invalid hashed_password length");var a=p(e),s=e.length-1;i.push(a);var c=p(t=b(i,t,"password")),u=t.length;i.push(c);var d=0==(0|n._crypto_pwhash_scryptsalsa208sha256_str_verify(a,c,u,0));return g(i),d}function vt(e,t,r,o){var i=[];f(o);var a=p(e=b(i,e,"password")),s=e.length;i.push(a),y(i,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&v(i,"opsLimit must be an unsigned integer"),y(i,r,"memLimit"),("number"!=typeof r||(0|r)!==r||r<0)&&v(i,"memLimit must be an unsigned integer");var c=new h(0|n._crypto_pwhash_strbytes()).address;if(i.push(c),0==(0|n._crypto_pwhash_str(c,a,s,0,t,0,r))){var u=n.UTF8ToString(c);return g(i),u}m(i,"invalid usage")}function yt(e,t,r,i){var a=[];f(i),"string"!=typeof e&&v(a,"hashed_password must be a string"),e=o(e+"\0"),null!=c&&e.length-1!==c&&v(a,"invalid hashed_password length");var s=p(e),c=e.length-1;a.push(s),y(a,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&v(a,"opsLimit must be an unsigned integer"),y(a,r,"memLimit"),("number"!=typeof r||(0|r)!==r||r<0)&&v(a,"memLimit must be an unsigned integer");var u=0!=(0|n._crypto_pwhash_str_needs_rehash(s,t,0,r));return g(a),u}function bt(e,t,r){var i=[];f(r),"string"!=typeof e&&v(i,"hashed_password must be a string"),e=o(e+"\0"),null!=s&&e.length-1!==s&&v(i,"invalid hashed_password length");var a=p(e),s=e.length-1;i.push(a);var c=p(t=b(i,t,"password")),u=t.length;i.push(c);var d=0==(0|n._crypto_pwhash_str_verify(a,c,u,0));return g(i),d}function It(e,t,r){var o=[];f(r),e=b(o,e,"privateKey");var i,a=0|n._crypto_scalarmult_scalarbytes();e.length!==a&&v(o,"invalid privateKey length"),i=p(e),o.push(i),t=b(o,t,"publicKey");var s,c=0|n._crypto_scalarmult_bytes();t.length!==c&&v(o,"invalid publicKey length"),s=p(t),o.push(s);var u=new h(0|n._crypto_scalarmult_bytes()),l=u.address;if(o.push(l),0==(0|n._crypto_scalarmult(l,i,s))){var A=d(u,r);return g(o),A}m(o,"weak public key")}function wt(e,t){var r=[];f(t),e=b(r,e,"privateKey");var o,i=0|n._crypto_scalarmult_scalarbytes();e.length!==i&&v(r,"invalid privateKey length"),o=p(e),r.push(o);var a=new h(0|n._crypto_scalarmult_bytes()),s=a.address;if(r.push(s),0==(0|n._crypto_scalarmult_base(s,o))){var c=d(a,t);return g(r),c}m(r,"unknown error")}function Et(e,t,r){var o=[];f(r),e=b(o,e,"n");var i,a=0|n._crypto_scalarmult_ed25519_scalarbytes();e.length!==a&&v(o,"invalid n length"),i=p(e),o.push(i),t=b(o,t,"p");var s,c=0|n._crypto_scalarmult_ed25519_bytes();t.length!==c&&v(o,"invalid p length"),s=p(t),o.push(s);var u=new h(0|n._crypto_scalarmult_ed25519_bytes()),l=u.address;if(o.push(l),0==(0|n._crypto_scalarmult_ed25519(l,i,s))){var A=d(u,r);return g(o),A}m(o,"invalid point or scalar is 0")}function _t(e,t){var r=[];f(t),e=b(r,e,"scalar");var o,i=0|n._crypto_scalarmult_ed25519_scalarbytes();e.length!==i&&v(r,"invalid scalar length"),o=p(e),r.push(o);var a=new h(0|n._crypto_scalarmult_ed25519_bytes()),s=a.address;if(r.push(s),0==(0|n._crypto_scalarmult_ed25519_base(s,o))){var c=d(a,t);return g(r),c}m(r,"scalar is 0")}function Bt(e,t){var r=[];f(t),e=b(r,e,"scalar");var o,i=0|n._crypto_scalarmult_ed25519_scalarbytes();e.length!==i&&v(r,"invalid scalar length"),o=p(e),r.push(o);var a=new h(0|n._crypto_scalarmult_ed25519_bytes()),s=a.address;if(r.push(s),0==(0|n._crypto_scalarmult_ed25519_base_noclamp(s,o))){var c=d(a,t);return g(r),c}m(r,"scalar is 0")}function Ct(e,t,r){var o=[];f(r),e=b(o,e,"n");var i,a=0|n._crypto_scalarmult_ed25519_scalarbytes();e.length!==a&&v(o,"invalid n length"),i=p(e),o.push(i),t=b(o,t,"p");var s,c=0|n._crypto_scalarmult_ed25519_bytes();t.length!==c&&v(o,"invalid p length"),s=p(t),o.push(s);var u=new h(0|n._crypto_scalarmult_ed25519_bytes()),l=u.address;if(o.push(l),0==(0|n._crypto_scalarmult_ed25519_noclamp(l,i,s))){var A=d(u,r);return g(o),A}m(o,"invalid point or scalar is 0")}function kt(e,t,r){var o=[];f(r),e=b(o,e,"scalar");var i,a=0|n._crypto_scalarmult_ristretto255_scalarbytes();e.length!==a&&v(o,"invalid scalar length"),i=p(e),o.push(i),t=b(o,t,"element");var s,c=0|n._crypto_scalarmult_ristretto255_bytes();t.length!==c&&v(o,"invalid element length"),s=p(t),o.push(s);var u=new h(0|n._crypto_scalarmult_ristretto255_bytes()),l=u.address;if(o.push(l),0==(0|n._crypto_scalarmult_ristretto255(l,i,s))){var A=d(u,r);return g(o),A}m(o,"result is identity element")}function St(e,t){var r=[];f(t),e=b(r,e,"scalar");var o,i=0|n._crypto_core_ristretto255_scalarbytes();e.length!==i&&v(r,"invalid scalar length"),o=p(e),r.push(o);var a=new h(0|n._crypto_core_ristretto255_bytes()),s=a.address;if(r.push(s),0==(0|n._crypto_scalarmult_ristretto255_base(s,o))){var c=d(a,t);return g(r),c}m(r,"scalar is 0")}function Ot(e,t,r,o){var i=[];f(o);var a=p(e=b(i,e,"message")),s=e.length;i.push(a),t=b(i,t,"nonce");var c,u=0|n._crypto_secretbox_noncebytes();t.length!==u&&v(i,"invalid nonce length"),c=p(t),i.push(c),r=b(i,r,"key");var l,A=0|n._crypto_secretbox_keybytes();r.length!==A&&v(i,"invalid key length"),l=p(r),i.push(l);var y=new h(0|s),I=y.address;i.push(I);var w=new h(0|n._crypto_secretbox_macbytes()),E=w.address;if(i.push(E),0==(0|n._crypto_secretbox_detached(I,E,a,s,0,c,l))){var _=d({mac:w,cipher:y},o);return g(i),_}m(i,"invalid usage")}function Qt(e,t,r,o){var i=[];f(o);var a=p(e=b(i,e,"message")),s=e.length;i.push(a),t=b(i,t,"nonce");var c,u=0|n._crypto_secretbox_noncebytes();t.length!==u&&v(i,"invalid nonce length"),c=p(t),i.push(c),r=b(i,r,"key");var l,A=0|n._crypto_secretbox_keybytes();r.length!==A&&v(i,"invalid key length"),l=p(r),i.push(l);var y=new h(s+n._crypto_secretbox_macbytes()|0),I=y.address;if(i.push(I),0==(0|n._crypto_secretbox_easy(I,a,s,0,c,l))){var w=d(y,o);return g(i),w}m(i,"invalid usage")}function Pt(e){var t=[];f(e);var r=new h(0|n._crypto_secretbox_keybytes()),o=r.address;t.push(o),n._crypto_secretbox_keygen(o);var i=d(r,e);return g(t),i}function Rt(e,t,r,o,i){var a=[];f(i);var s=p(e=b(a,e,"ciphertext")),c=e.length;a.push(s),t=b(a,t,"mac");var u,l=0|n._crypto_secretbox_macbytes();t.length!==l&&v(a,"invalid mac length"),u=p(t),a.push(u),r=b(a,r,"nonce");var A,y=0|n._crypto_secretbox_noncebytes();r.length!==y&&v(a,"invalid nonce length"),A=p(r),a.push(A),o=b(a,o,"key");var I,w=0|n._crypto_secretbox_keybytes();o.length!==w&&v(a,"invalid key length"),I=p(o),a.push(I);var E=new h(0|c),_=E.address;if(a.push(_),0==(0|n._crypto_secretbox_open_detached(_,s,u,c,0,A,I))){var B=d(E,i);return g(a),B}m(a,"wrong secret key for the given ciphertext")}function Mt(e,t,r,o){var i=[];f(o),e=b(i,e,"ciphertext");var a,s=n._crypto_secretbox_macbytes(),c=e.length;c>>0;return g([]),t}function vn(e,t){var r=[];f(t);for(var o=n._malloc(24),i=0;i<6;i++)n.setValue(o+4*i,n.Runtime.addFunction(e[["implementation_name","random","stir","uniform","buf","close"][i]]),"i32");0!=(0|n._randombytes_set_implementation(o))&&m(r,"unsupported implementation"),g(r)}function yn(e){f(e),n._randombytes_stir()}function bn(e,t){var r=[];f(t),y(r,e,"upper_bound"),("number"!=typeof e||(0|e)!==e||e<0)&&v(r,"upper_bound must be an unsigned integer");var o=n._randombytes_uniform(e)>>>0;return g(r),o}function In(){var e=n._sodium_version_string(),t=n.UTF8ToString(e);return g([]),t}return h.prototype.to_Uint8Array=function(){var e=new Uint8Array(this.length);return e.set(n.HEAPU8.subarray(this.address,this.address+this.length)),e},e.add=function(e,t){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can added");var n=e.length,r=0,o=0;if(t.length!=e.length)throw new TypeError("Arguments must have the same length");for(o=0;o>=8,r+=e[o]+t[o],e[o]=255&r},e.base64_variants=s,e.compare=function(e,t){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be compared");if(e.length!==t.length)throw new TypeError("Only instances of identical length can be compared");for(var n=0,r=1,o=e.length;o-- >0;)n|=t[o]-e[o]>>8&r,r&=(t[o]^e[o])-1>>8;return n+n+r-1},e.from_base64=function(e,t){t=c(t);var r,o=[],i=new h(3*(e=b(o,e,"input")).length/4),a=p(e),s=A(4),u=A(4);return o.push(a),o.push(i.address),o.push(i.result_bin_len_p),o.push(i.b64_end_p),0!==n._sodium_base642bin(i.address,i.length,a,e.length,0,s,u,t)&&m(o,"invalid input"),n.getValue(u,"i32")-a!==e.length&&m(o,"incomplete input"),i.length=n.getValue(s,"i32"),r=i.to_Uint8Array(),g(o),r},e.from_hex=function(e){var t,r=[],o=new h((e=b(r,e,"input")).length/2),i=p(e),a=A(4);return r.push(i),r.push(o.address),r.push(o.hex_end_p),0!==n._sodium_hex2bin(o.address,o.length,i,e.length,0,0,a)&&m(r,"invalid input"),n.getValue(a,"i32")-i!==e.length&&m(r,"incomplete input"),t=o.to_Uint8Array(),g(r),t},e.from_string=o,e.increment=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be incremented");for(var t=256,n=0,r=e.length;n>=8,t+=e[n],e[n]=255&t},e.is_zero=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be checked");for(var t=0,n=0,r=e.length;n 0");var r,o=[],i=A(4),a=1,s=0,c=0|e.length,u=new h(c+t);o.push(i),o.push(u.address);for(var d=u.address,l=u.address+c+t;d>>48|c>>>32|c>>>16|c))-1>>16);return 0!==n._sodium_pad(i,u.address,e.length,t,u.length)&&m(o,"internal error"),u.length=n.getValue(i,"i32"),r=u.to_Uint8Array(),g(o),r},e.unpad=function(e,t){if(!(e instanceof Uint8Array))throw new TypeError("buffer must be a Uint8Array");if((t|=0)<=0)throw new Error("block size must be > 0");var r=[],o=p(e),i=A(4);return r.push(o),r.push(i),0!==n._sodium_unpad(i,o,e.length,t)&&m(r,"unsupported/invalid padding"),e=(e=new Uint8Array(e)).subarray(0,n.getValue(i,"i32")),g(r),e},e.ready=r,e.symbols=function(){return Object.keys(e).sort()},e.to_base64=u,e.to_hex=a,e.to_string=i,e})?r.apply(t,o):r)&&(e.exports=i),s&&a.sodium.ready.then((function(){s(a.sodium)}))},function(e,t){},function(e,t,n){"use strict";var r=n(2),o=n(312),i=n(24),a=n(4).Buffer,s=n(138),c=n(56),u=n(57),d=a.alloc(128);function l(e,t){i.call(this,"digest"),"string"==typeof t&&(t=a.from(t));var n="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=t,t.length>n)?t=("rmd160"===e?new c:u(e)).update(t).digest():t.length>>0},t.writeUInt32BE=function(e,t,n){e[0+n]=t>>>24,e[1+n]=t>>>16&255,e[2+n]=t>>>8&255,e[3+n]=255&t},t.ip=function(e,t,n,r){for(var o=0,i=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)o<<=1,o|=t>>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)i<<=1,i|=t>>>s+a&1;for(s=1;s<=25;s+=8)i<<=1,i|=e>>>s+a&1}n[r+0]=o>>>0,n[r+1]=i>>>0},t.rip=function(e,t,n,r){for(var o=0,i=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)i<<=1,i|=t>>>s+a&1,i<<=1,i|=e>>>s+a&1;n[r+0]=o>>>0,n[r+1]=i>>>0},t.pc1=function(e,t,n,r){for(var o=0,i=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1}for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1;n[r+0]=o>>>0,n[r+1]=i>>>0},t.r28shl=function(e,t){return e<>>28-t};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,n,o){for(var i=0,a=0,s=r.length>>>1,c=0;c>>r[c]&1;for(c=s;c>>r[c]&1;n[o+0]=i>>>0,n[o+1]=a>>>0},t.expand=function(e,t,n){var r=0,o=0;r=(1&e)<<5|e>>>27;for(var i=23;i>=15;i-=4)r<<=6,r|=e>>>i&63;for(i=11;i>=3;i-=4)o|=e>>>i&63,o<<=6;o|=(31&e)<<1|e>>>31,t[n+0]=r>>>0,t[n+1]=o>>>0};var o=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var n=0,r=0;r<4;r++){n<<=4,n|=o[64*r+(e>>>18-6*r&63)]}for(r=0;r<4;r++){n<<=4,n|=o[256+64*r+(t>>>18-6*r&63)]}return n>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,n=0;n>>i[n]&1;return t>>>0},t.padSplit=function(e,t,n){for(var r=e.toString(2);r.length>>1];n=i.r28shl(n,s),o=i.r28shl(o,s),i.pc2(n,o,e.keys,a)}},c.prototype._update=function(e,t,n,r){var o=this._desState,a=i.readUInt32BE(e,t),s=i.readUInt32BE(e,t+4);i.ip(a,s,o.tmp,0),a=o.tmp[0],s=o.tmp[1],"encrypt"===this.type?this._encrypt(o,a,s,o.tmp,0):this._decrypt(o,a,s,o.tmp,0),a=o.tmp[0],s=o.tmp[1],i.writeUInt32BE(n,a,r),i.writeUInt32BE(n,s,r+4)},c.prototype._pad=function(e,t){for(var n=e.length-t,r=t;r>>0,a=f}i.rip(s,a,r,o)},c.prototype._decrypt=function(e,t,n,r,o){for(var a=n,s=t,c=e.keys.length-2;c>=0;c-=2){var u=e.keys[c],d=e.keys[c+1];i.expand(a,e.tmp,0),u^=e.tmp[0],d^=e.tmp[1];var l=i.substitute(u,d),f=a;a=(s^i.permute(l))>>>0,s=f}i.rip(a,s,r,o)}},function(e,t,n){var r=n(49),o=n(4).Buffer,i=n(150);function a(e){var t=e._cipher.encryptBlockRaw(e._prev);return i(e._prev),t}t.encrypt=function(e,t){var n=Math.ceil(t.length/16),i=e._cache.length;e._cache=o.concat([e._cache,o.allocUnsafe(16*n)]);for(var s=0;se;)n.ishrn(1);if(n.isEven()&&n.iadd(s),n.testn(1)||n.iadd(c),t.cmp(c)){if(!t.cmp(u))for(;n.mod(d).cmp(l);)n.iadd(h)}else for(;n.mod(i).cmp(f);)n.iadd(h);if(g(p=n.shrn(1))&&g(n)&&m(p)&&m(n)&&a.test(p)&&a.test(n))return n}}},function(e,t,n){var r=n(8),o=n(84);function i(e){this.rand=e||new o.Rand}e.exports=i,i.create=function(e){return new i(e)},i.prototype._randbelow=function(e){var t=e.bitLength(),n=Math.ceil(t/8);do{var o=new r(this.rand.generate(n))}while(o.cmp(e)>=0);return o},i.prototype._randrange=function(e,t){var n=t.sub(e);return e.add(this._randbelow(n))},i.prototype.test=function(e,t,n){var o=e.bitLength(),i=r.mont(e),a=new r(1).toRed(i);t||(t=Math.max(1,o/48|0));for(var s=e.subn(1),c=0;!s.testn(c);c++);for(var u=e.shrn(c),d=s.toRed(i);t>0;t--){var l=this._randrange(new r(2),s);n&&n(l);var f=l.toRed(i).redPow(u);if(0!==f.cmp(a)&&0!==f.cmp(d)){for(var h=1;h0;t--){var d=this._randrange(new r(2),a),l=e.gcd(d);if(0!==l.cmpn(1))return l;var f=d.toRed(o).redPow(c);if(0!==f.cmp(i)&&0!==f.cmp(u)){for(var h=1;h0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),r)a.endEmitted?w(e,new I):k(e,a,t,!0);else if(a.ended)w(e,new y);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?k(e,a,t,!1):P(e,a)):k(e,a,t,!1)}else r||(a.reading=!1,P(e,a));return!a.ended&&(a.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(Q,e))}function Q(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,N(e)}function P(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function x(e){u("readable nexttick read 0"),e.read(0)}function D(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),N(e),t.flowing&&!t.reading&&e.read(0)}function N(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function T(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function j(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(U,t,e))}function U(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function H(e,t){for(var n=0,r=e.length;n=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?j(this):O(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&j(this),null;var r,o=t.needReadable;return u("need readable",o),(0===t.length||t.length-e0?T(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&j(this)),null!==r&&this.emit("data",r),r},B.prototype._read=function(e){w(this,new b("_read()"))},B.prototype.pipe=function(e,t){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,u("pipe count=%d opts=%j",o.pipesCount,t);var a=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:g;function s(t,r){u("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,u("cleanup"),e.removeListener("close",p),e.removeListener("finish",A),e.removeListener("drain",d),e.removeListener("error",h),e.removeListener("unpipe",s),n.removeListener("end",c),n.removeListener("end",g),n.removeListener("data",f),l=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||d())}function c(){u("onend"),e.end()}o.endEmitted?r.nextTick(a):n.once("end",a),e.on("unpipe",s);var d=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,N(e))}}(n);e.on("drain",d);var l=!1;function f(t){u("ondata");var r=e.write(t);u("dest.write",r),!1===r&&((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==H(o.pipes,e))&&!l&&(u("false write response, pause",o.awaitDrain),o.awaitDrain++),n.pause())}function h(t){u("onerror",t),g(),e.removeListener("error",h),0===i(e,"error")&&w(e,t)}function p(){e.removeListener("finish",A),g()}function A(){u("onfinish"),e.removeListener("close",p),g()}function g(){u("unpipe"),n.unpipe(e)}return n.on("data",f),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",h),e.once("close",p),e.once("finish",A),e.emit("pipe",n),o.flowing||(u("pipe resume"),n.resume()),e},B.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==o.flowing&&this.resume()):"readable"===e&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,u("on readable",o.length,o.reading),o.length?O(this):o.reading||r.nextTick(x,this))),n},B.prototype.addListener=B.prototype.on,B.prototype.removeListener=function(e,t){var n=a.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(M,this),n},B.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(M,this),t},B.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(D,e,t))}(this,e)),e.paused=!1,this},B.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},B.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var o in e.on("end",(function(){if(u("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(o){(u("wrapped data"),n.decoder&&(o=n.decoder.write(o)),n.objectMode&&null==o)||(n.objectMode||o&&o.length)&&(t.push(o)||(r=!0,e.pause()))})),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var i=0;i-1))throw new I(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(B.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(B.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),B.prototype._write=function(e,t,n){n(new A("_write()"))},B.prototype._writev=null,B.prototype.end=function(e,t,n){var o=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),o.corked&&(o.corked=1,this.uncork()),o.ending||function(e,t,n){t.ending=!0,P(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,o,n),this},Object.defineProperty(B.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(B.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),B.prototype.destroy=l.destroy,B.prototype._undestroy=l.undestroy,B.prototype._destroy=function(e,t){t(e)}}).call(this,n(3),n(6))},function(e,t,n){"use strict";e.exports=d;var r=n(42).codes,o=r.ERR_METHOD_NOT_IMPLEMENTED,i=r.ERR_MULTIPLE_CALLBACK,a=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=r.ERR_TRANSFORM_WITH_LENGTH_0,c=n(43);function u(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new i);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length>8,a=255&o;i?n.push(i,a):n.push(a)}return n},r.zero2=o,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}},function(e,t,n){"use strict";var r=t;r.base=n(63),r.short=n(347),r.mont=n(348),r.edwards=n(349)},function(e,t,n){"use strict";var r=n(23).rotr32;function o(e,t,n){return e&t^~e&n}function i(e,t,n){return e&t^e&n^t&n}function a(e,t,n){return e^t^n}t.ft_1=function(e,t,n,r){return 0===e?o(t,n,r):1===e||3===e?a(t,n,r):2===e?i(t,n,r):void 0},t.ch32=o,t.maj32=i,t.p32=a,t.s0_256=function(e){return r(e,2)^r(e,13)^r(e,22)},t.s1_256=function(e){return r(e,6)^r(e,11)^r(e,25)},t.g0_256=function(e){return r(e,7)^r(e,18)^e>>>3},t.g1_256=function(e){return r(e,17)^r(e,19)^e>>>10}},function(e,t,n){"use strict";var r=n(23),o=n(51),i=n(164),a=n(17),s=r.sum32,c=r.sum32_4,u=r.sum32_5,d=i.ch32,l=i.maj32,f=i.s0_256,h=i.s1_256,p=i.g0_256,A=i.g1_256,g=o.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;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}r.inherits(v,g),e.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function c(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function u(e,t,n,o){for(var i=0,a=0,s=Math.min(e.length,n),c=t;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===n)for(o=0,i=0;o>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)o=c(e,t,r)<=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,o=1;o<=67108863;o*=t)r++;r--,o=o/t|0;for(var i=e.length-n,a=i%r,s=Math.min(i,i-a)+n,c=0,d=n;d1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?""}var f=["","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"],h=[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],p=[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];i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,i=0,a=0;a>>24-o&16777215,(o+=2)>=26&&(o-=26,a--),n=0!==i||a!==this.length-1?f[6-c.length]+c+n:c+n}for(0!==i&&(n=i.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=h[e],d=p[e];n="";var l=this.clone();for(l.negative=0;!l.isZero();){var A=l.modrn(d).toString(e);n=(l=l.idivn(d)).isZero()?A+n:f[u-A.length]+A+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},a&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function A(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,c=a/67108864|0;n.words[0]=s;for(var u=1;u>>26,l=67108863&c,f=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=f;h++){var p=u-h|0;d+=(a=(o=0|e.words[p])*(i=0|t.words[h])+l)/67108864|0,l=67108863&a}n.words[u]=0|l,c=0|d}return 0!==c?n.words[u]=0|c:n.length--,n._strip()}i.prototype.toArrayLike=function(e,t,n){this._strip();var o=this.byteLength(),i=n||Math.max(1,o);r(o<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,o),a},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,o=0,i=0;o>8&255),n>16&255),6===i?(n>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===i?(n>=0&&(e[n--]=a>>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var o=0;o0&&(this.words[o]=~this.words[o]&67108863>>26-n),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var o=0,i=0;i>>26;for(;0!==o&&i>>26;if(this.length=n.length,0!==o)this.words[this.length]=o,this.length++;else if(n!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,h=0|a[1],p=8191&h,A=h>>>13,g=0|a[2],m=8191&g,v=g>>>13,y=0|a[3],b=8191&y,I=y>>>13,w=0|a[4],E=8191&w,_=w>>>13,B=0|a[5],C=8191&B,k=B>>>13,S=0|a[6],O=8191&S,Q=S>>>13,P=0|a[7],R=8191&P,M=P>>>13,x=0|a[8],D=8191&x,N=x>>>13,T=0|a[9],j=8191&T,U=T>>>13,H=0|s[0],J=8191&H,F=H>>>13,L=0|s[1],q=8191&L,G=L>>>13,V=0|s[2],z=8191&V,Y=V>>>13,K=0|s[3],W=8191&K,Z=K>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],ne=8191&te,re=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,de=0|s[8],le=8191&de,fe=de>>>13,he=0|s[9],pe=8191&he,Ae=he>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(u+(r=Math.imul(l,J))|0)+((8191&(o=(o=Math.imul(l,F))+Math.imul(f,J)|0))<<13)|0;u=((i=Math.imul(f,F))+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(p,J),o=(o=Math.imul(p,F))+Math.imul(A,J)|0,i=Math.imul(A,F);var me=(u+(r=r+Math.imul(l,q)|0)|0)+((8191&(o=(o=o+Math.imul(l,G)|0)+Math.imul(f,q)|0))<<13)|0;u=((i=i+Math.imul(f,G)|0)+(o>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,J),o=(o=Math.imul(m,F))+Math.imul(v,J)|0,i=Math.imul(v,F),r=r+Math.imul(p,q)|0,o=(o=o+Math.imul(p,G)|0)+Math.imul(A,q)|0,i=i+Math.imul(A,G)|0;var ve=(u+(r=r+Math.imul(l,z)|0)|0)+((8191&(o=(o=o+Math.imul(l,Y)|0)+Math.imul(f,z)|0))<<13)|0;u=((i=i+Math.imul(f,Y)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(b,J),o=(o=Math.imul(b,F))+Math.imul(I,J)|0,i=Math.imul(I,F),r=r+Math.imul(m,q)|0,o=(o=o+Math.imul(m,G)|0)+Math.imul(v,q)|0,i=i+Math.imul(v,G)|0,r=r+Math.imul(p,z)|0,o=(o=o+Math.imul(p,Y)|0)+Math.imul(A,z)|0,i=i+Math.imul(A,Y)|0;var ye=(u+(r=r+Math.imul(l,W)|0)|0)+((8191&(o=(o=o+Math.imul(l,Z)|0)+Math.imul(f,W)|0))<<13)|0;u=((i=i+Math.imul(f,Z)|0)+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(E,J),o=(o=Math.imul(E,F))+Math.imul(_,J)|0,i=Math.imul(_,F),r=r+Math.imul(b,q)|0,o=(o=o+Math.imul(b,G)|0)+Math.imul(I,q)|0,i=i+Math.imul(I,G)|0,r=r+Math.imul(m,z)|0,o=(o=o+Math.imul(m,Y)|0)+Math.imul(v,z)|0,i=i+Math.imul(v,Y)|0,r=r+Math.imul(p,W)|0,o=(o=o+Math.imul(p,Z)|0)+Math.imul(A,W)|0,i=i+Math.imul(A,Z)|0;var be=(u+(r=r+Math.imul(l,$)|0)|0)+((8191&(o=(o=o+Math.imul(l,ee)|0)+Math.imul(f,$)|0))<<13)|0;u=((i=i+Math.imul(f,ee)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(C,J),o=(o=Math.imul(C,F))+Math.imul(k,J)|0,i=Math.imul(k,F),r=r+Math.imul(E,q)|0,o=(o=o+Math.imul(E,G)|0)+Math.imul(_,q)|0,i=i+Math.imul(_,G)|0,r=r+Math.imul(b,z)|0,o=(o=o+Math.imul(b,Y)|0)+Math.imul(I,z)|0,i=i+Math.imul(I,Y)|0,r=r+Math.imul(m,W)|0,o=(o=o+Math.imul(m,Z)|0)+Math.imul(v,W)|0,i=i+Math.imul(v,Z)|0,r=r+Math.imul(p,$)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(A,$)|0,i=i+Math.imul(A,ee)|0;var Ie=(u+(r=r+Math.imul(l,ne)|0)|0)+((8191&(o=(o=o+Math.imul(l,re)|0)+Math.imul(f,ne)|0))<<13)|0;u=((i=i+Math.imul(f,re)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(O,J),o=(o=Math.imul(O,F))+Math.imul(Q,J)|0,i=Math.imul(Q,F),r=r+Math.imul(C,q)|0,o=(o=o+Math.imul(C,G)|0)+Math.imul(k,q)|0,i=i+Math.imul(k,G)|0,r=r+Math.imul(E,z)|0,o=(o=o+Math.imul(E,Y)|0)+Math.imul(_,z)|0,i=i+Math.imul(_,Y)|0,r=r+Math.imul(b,W)|0,o=(o=o+Math.imul(b,Z)|0)+Math.imul(I,W)|0,i=i+Math.imul(I,Z)|0,r=r+Math.imul(m,$)|0,o=(o=o+Math.imul(m,ee)|0)+Math.imul(v,$)|0,i=i+Math.imul(v,ee)|0,r=r+Math.imul(p,ne)|0,o=(o=o+Math.imul(p,re)|0)+Math.imul(A,ne)|0,i=i+Math.imul(A,re)|0;var we=(u+(r=r+Math.imul(l,ie)|0)|0)+((8191&(o=(o=o+Math.imul(l,ae)|0)+Math.imul(f,ie)|0))<<13)|0;u=((i=i+Math.imul(f,ae)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(R,J),o=(o=Math.imul(R,F))+Math.imul(M,J)|0,i=Math.imul(M,F),r=r+Math.imul(O,q)|0,o=(o=o+Math.imul(O,G)|0)+Math.imul(Q,q)|0,i=i+Math.imul(Q,G)|0,r=r+Math.imul(C,z)|0,o=(o=o+Math.imul(C,Y)|0)+Math.imul(k,z)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(E,W)|0,o=(o=o+Math.imul(E,Z)|0)+Math.imul(_,W)|0,i=i+Math.imul(_,Z)|0,r=r+Math.imul(b,$)|0,o=(o=o+Math.imul(b,ee)|0)+Math.imul(I,$)|0,i=i+Math.imul(I,ee)|0,r=r+Math.imul(m,ne)|0,o=(o=o+Math.imul(m,re)|0)+Math.imul(v,ne)|0,i=i+Math.imul(v,re)|0,r=r+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,ae)|0;var Ee=(u+(r=r+Math.imul(l,ce)|0)|0)+((8191&(o=(o=o+Math.imul(l,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((i=i+Math.imul(f,ue)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(D,J),o=(o=Math.imul(D,F))+Math.imul(N,J)|0,i=Math.imul(N,F),r=r+Math.imul(R,q)|0,o=(o=o+Math.imul(R,G)|0)+Math.imul(M,q)|0,i=i+Math.imul(M,G)|0,r=r+Math.imul(O,z)|0,o=(o=o+Math.imul(O,Y)|0)+Math.imul(Q,z)|0,i=i+Math.imul(Q,Y)|0,r=r+Math.imul(C,W)|0,o=(o=o+Math.imul(C,Z)|0)+Math.imul(k,W)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(E,$)|0,o=(o=o+Math.imul(E,ee)|0)+Math.imul(_,$)|0,i=i+Math.imul(_,ee)|0,r=r+Math.imul(b,ne)|0,o=(o=o+Math.imul(b,re)|0)+Math.imul(I,ne)|0,i=i+Math.imul(I,re)|0,r=r+Math.imul(m,ie)|0,o=(o=o+Math.imul(m,ae)|0)+Math.imul(v,ie)|0,i=i+Math.imul(v,ae)|0,r=r+Math.imul(p,ce)|0,o=(o=o+Math.imul(p,ue)|0)+Math.imul(A,ce)|0,i=i+Math.imul(A,ue)|0;var _e=(u+(r=r+Math.imul(l,le)|0)|0)+((8191&(o=(o=o+Math.imul(l,fe)|0)+Math.imul(f,le)|0))<<13)|0;u=((i=i+Math.imul(f,fe)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(j,J),o=(o=Math.imul(j,F))+Math.imul(U,J)|0,i=Math.imul(U,F),r=r+Math.imul(D,q)|0,o=(o=o+Math.imul(D,G)|0)+Math.imul(N,q)|0,i=i+Math.imul(N,G)|0,r=r+Math.imul(R,z)|0,o=(o=o+Math.imul(R,Y)|0)+Math.imul(M,z)|0,i=i+Math.imul(M,Y)|0,r=r+Math.imul(O,W)|0,o=(o=o+Math.imul(O,Z)|0)+Math.imul(Q,W)|0,i=i+Math.imul(Q,Z)|0,r=r+Math.imul(C,$)|0,o=(o=o+Math.imul(C,ee)|0)+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(E,ne)|0,o=(o=o+Math.imul(E,re)|0)+Math.imul(_,ne)|0,i=i+Math.imul(_,re)|0,r=r+Math.imul(b,ie)|0,o=(o=o+Math.imul(b,ae)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,ae)|0,r=r+Math.imul(m,ce)|0,o=(o=o+Math.imul(m,ue)|0)+Math.imul(v,ce)|0,i=i+Math.imul(v,ue)|0,r=r+Math.imul(p,le)|0,o=(o=o+Math.imul(p,fe)|0)+Math.imul(A,le)|0,i=i+Math.imul(A,fe)|0;var Be=(u+(r=r+Math.imul(l,pe)|0)|0)+((8191&(o=(o=o+Math.imul(l,Ae)|0)+Math.imul(f,pe)|0))<<13)|0;u=((i=i+Math.imul(f,Ae)|0)+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,q),o=(o=Math.imul(j,G))+Math.imul(U,q)|0,i=Math.imul(U,G),r=r+Math.imul(D,z)|0,o=(o=o+Math.imul(D,Y)|0)+Math.imul(N,z)|0,i=i+Math.imul(N,Y)|0,r=r+Math.imul(R,W)|0,o=(o=o+Math.imul(R,Z)|0)+Math.imul(M,W)|0,i=i+Math.imul(M,Z)|0,r=r+Math.imul(O,$)|0,o=(o=o+Math.imul(O,ee)|0)+Math.imul(Q,$)|0,i=i+Math.imul(Q,ee)|0,r=r+Math.imul(C,ne)|0,o=(o=o+Math.imul(C,re)|0)+Math.imul(k,ne)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(E,ie)|0,o=(o=o+Math.imul(E,ae)|0)+Math.imul(_,ie)|0,i=i+Math.imul(_,ae)|0,r=r+Math.imul(b,ce)|0,o=(o=o+Math.imul(b,ue)|0)+Math.imul(I,ce)|0,i=i+Math.imul(I,ue)|0,r=r+Math.imul(m,le)|0,o=(o=o+Math.imul(m,fe)|0)+Math.imul(v,le)|0,i=i+Math.imul(v,fe)|0;var Ce=(u+(r=r+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,Ae)|0)+Math.imul(A,pe)|0))<<13)|0;u=((i=i+Math.imul(A,Ae)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,z),o=(o=Math.imul(j,Y))+Math.imul(U,z)|0,i=Math.imul(U,Y),r=r+Math.imul(D,W)|0,o=(o=o+Math.imul(D,Z)|0)+Math.imul(N,W)|0,i=i+Math.imul(N,Z)|0,r=r+Math.imul(R,$)|0,o=(o=o+Math.imul(R,ee)|0)+Math.imul(M,$)|0,i=i+Math.imul(M,ee)|0,r=r+Math.imul(O,ne)|0,o=(o=o+Math.imul(O,re)|0)+Math.imul(Q,ne)|0,i=i+Math.imul(Q,re)|0,r=r+Math.imul(C,ie)|0,o=(o=o+Math.imul(C,ae)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,ae)|0,r=r+Math.imul(E,ce)|0,o=(o=o+Math.imul(E,ue)|0)+Math.imul(_,ce)|0,i=i+Math.imul(_,ue)|0,r=r+Math.imul(b,le)|0,o=(o=o+Math.imul(b,fe)|0)+Math.imul(I,le)|0,i=i+Math.imul(I,fe)|0;var ke=(u+(r=r+Math.imul(m,pe)|0)|0)+((8191&(o=(o=o+Math.imul(m,Ae)|0)+Math.imul(v,pe)|0))<<13)|0;u=((i=i+Math.imul(v,Ae)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,W),o=(o=Math.imul(j,Z))+Math.imul(U,W)|0,i=Math.imul(U,Z),r=r+Math.imul(D,$)|0,o=(o=o+Math.imul(D,ee)|0)+Math.imul(N,$)|0,i=i+Math.imul(N,ee)|0,r=r+Math.imul(R,ne)|0,o=(o=o+Math.imul(R,re)|0)+Math.imul(M,ne)|0,i=i+Math.imul(M,re)|0,r=r+Math.imul(O,ie)|0,o=(o=o+Math.imul(O,ae)|0)+Math.imul(Q,ie)|0,i=i+Math.imul(Q,ae)|0,r=r+Math.imul(C,ce)|0,o=(o=o+Math.imul(C,ue)|0)+Math.imul(k,ce)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(E,le)|0,o=(o=o+Math.imul(E,fe)|0)+Math.imul(_,le)|0,i=i+Math.imul(_,fe)|0;var Se=(u+(r=r+Math.imul(b,pe)|0)|0)+((8191&(o=(o=o+Math.imul(b,Ae)|0)+Math.imul(I,pe)|0))<<13)|0;u=((i=i+Math.imul(I,Ae)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,$),o=(o=Math.imul(j,ee))+Math.imul(U,$)|0,i=Math.imul(U,ee),r=r+Math.imul(D,ne)|0,o=(o=o+Math.imul(D,re)|0)+Math.imul(N,ne)|0,i=i+Math.imul(N,re)|0,r=r+Math.imul(R,ie)|0,o=(o=o+Math.imul(R,ae)|0)+Math.imul(M,ie)|0,i=i+Math.imul(M,ae)|0,r=r+Math.imul(O,ce)|0,o=(o=o+Math.imul(O,ue)|0)+Math.imul(Q,ce)|0,i=i+Math.imul(Q,ue)|0,r=r+Math.imul(C,le)|0,o=(o=o+Math.imul(C,fe)|0)+Math.imul(k,le)|0,i=i+Math.imul(k,fe)|0;var Oe=(u+(r=r+Math.imul(E,pe)|0)|0)+((8191&(o=(o=o+Math.imul(E,Ae)|0)+Math.imul(_,pe)|0))<<13)|0;u=((i=i+Math.imul(_,Ae)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(j,ne),o=(o=Math.imul(j,re))+Math.imul(U,ne)|0,i=Math.imul(U,re),r=r+Math.imul(D,ie)|0,o=(o=o+Math.imul(D,ae)|0)+Math.imul(N,ie)|0,i=i+Math.imul(N,ae)|0,r=r+Math.imul(R,ce)|0,o=(o=o+Math.imul(R,ue)|0)+Math.imul(M,ce)|0,i=i+Math.imul(M,ue)|0,r=r+Math.imul(O,le)|0,o=(o=o+Math.imul(O,fe)|0)+Math.imul(Q,le)|0,i=i+Math.imul(Q,fe)|0;var Qe=(u+(r=r+Math.imul(C,pe)|0)|0)+((8191&(o=(o=o+Math.imul(C,Ae)|0)+Math.imul(k,pe)|0))<<13)|0;u=((i=i+Math.imul(k,Ae)|0)+(o>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,r=Math.imul(j,ie),o=(o=Math.imul(j,ae))+Math.imul(U,ie)|0,i=Math.imul(U,ae),r=r+Math.imul(D,ce)|0,o=(o=o+Math.imul(D,ue)|0)+Math.imul(N,ce)|0,i=i+Math.imul(N,ue)|0,r=r+Math.imul(R,le)|0,o=(o=o+Math.imul(R,fe)|0)+Math.imul(M,le)|0,i=i+Math.imul(M,fe)|0;var Pe=(u+(r=r+Math.imul(O,pe)|0)|0)+((8191&(o=(o=o+Math.imul(O,Ae)|0)+Math.imul(Q,pe)|0))<<13)|0;u=((i=i+Math.imul(Q,Ae)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(j,ce),o=(o=Math.imul(j,ue))+Math.imul(U,ce)|0,i=Math.imul(U,ue),r=r+Math.imul(D,le)|0,o=(o=o+Math.imul(D,fe)|0)+Math.imul(N,le)|0,i=i+Math.imul(N,fe)|0;var Re=(u+(r=r+Math.imul(R,pe)|0)|0)+((8191&(o=(o=o+Math.imul(R,Ae)|0)+Math.imul(M,pe)|0))<<13)|0;u=((i=i+Math.imul(M,Ae)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,le),o=(o=Math.imul(j,fe))+Math.imul(U,le)|0,i=Math.imul(U,fe);var Me=(u+(r=r+Math.imul(D,pe)|0)|0)+((8191&(o=(o=o+Math.imul(D,Ae)|0)+Math.imul(N,pe)|0))<<13)|0;u=((i=i+Math.imul(N,Ae)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863;var xe=(u+(r=Math.imul(j,pe))|0)+((8191&(o=(o=Math.imul(j,Ae))+Math.imul(U,pe)|0))<<13)|0;return u=((i=Math.imul(U,Ae))+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,c[0]=ge,c[1]=me,c[2]=ve,c[3]=ye,c[4]=be,c[5]=Ie,c[6]=we,c[7]=Ee,c[8]=_e,c[9]=Be,c[10]=Ce,c[11]=ke,c[12]=Se,c[13]=Oe,c[14]=Qe,c[15]=Pe,c[16]=Re,c[17]=Me,c[18]=xe,0!==u&&(c[19]=u,n.length++),n};function m(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,o=0,i=0;i>>26)|0)>>>26,a&=67108863}n.words[i]=s,r=a,a=o}return 0!==r?n.words[i]=r:n.length--,n._strip()}function v(e,t,n){return m(e,t,n)}function y(e,t){this.x=e,this.y=t}Math.imul||(g=A),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):n<63?A(this,e,t):n<1024?m(this,e,t):v(this,e,t)},y.prototype.makeRBT=function(e){for(var t=new Array(e),n=i.prototype._countBits(e)-1,r=0;r>=1;return r},y.prototype.permute=function(e,t,n,r,o,i){for(var a=0;a>>=1)o++;return 1<>>=13,n[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,n+=i/67108864|0,n+=a>>>26,this.words[o]=67108863&a}return 0!==n&&(this.words[o]=n,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>o&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,n=e%26,o=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<a)for(this.length-=a,u=0;u=0&&(0!==d||u>=o);u--){var l=0|this.words[u];this.words[u]=d<<26-i|l>>>i,d=l&s}return c&&0!==d&&(c.words[c.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,o=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var o=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[o+n]=67108863&i}for(;o>26,this.words[o+n]=67108863&i;if(0===s)return this._strip();for(r(-1===s),s=0,o=0;o>26,this.words[o]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!==(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,c=r.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;l--){var f=67108864*(0|r.words[o.length+l])+(0|r.words[o.length+l-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(o,f,l);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(o,1,l),r.isZero()||(r.negative^=1);s&&(s.words[l]=f)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),o=e.andln(1),i=n.cmp(r);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,o=0,i=this.length-1;i>=0;i--)o=(n*o+(0|this.words[i]))%e;return t?-o:o},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,o=this.length-1;o>=0;o--){var i=(0|this.words[o])+67108864*n;this.words[o]=i/e|0,n=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var d=n.clone(),l=t.clone();!t.isZero();){for(var f=0,h=1;0==(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(d),a.isub(l)),o.iushrn(1),a.iushrn(1);for(var p=0,A=1;0==(n.words[0]&A)&&p<26;++p,A<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(d),c.isub(l)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,d=1;0==(t.words[0]&d)&&u<26;++u,d<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var l=0,f=1;0==(n.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(n.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var o=t.cmp(n);if(o<0){var i=t;t=n,n=i}else if(0===o||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,o=1<>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:oe.length)return 1;if(this.length=0;n--){var r=0|this.words[n],o=0|e.words[n];if(r!==o){ro&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new C(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function I(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){I.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){I.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){I.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function B(){I.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function C(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){C.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}I.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},I.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},I.prototype.split=function(e,t){e.iushrn(this.n,0,t)},I.prototype.imulK=function(e){return e.imul(this.k)},o(w,I),w.prototype.split=function(e,t){for(var n=Math.min(e.length,9),r=0;r>>22,o=i}o>>>=22,e.words[r-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=o,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new E;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new B}return b[e]=t,t},C.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},C.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},C.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(d(e,e.umod(this.m)._forceRed(this)),e)},C.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},C.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},C.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},C.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},C.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},C.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},C.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},C.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},C.prototype.isqr=function(e){return this.imul(e,e.clone())},C.prototype.sqr=function(e){return this.mul(e,e)},C.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new i(2*d*d).toRed(this);0!==this.pow(d,u).cmp(c);)d.redIAdd(c);for(var l=this.pow(d,o),f=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var A=h,g=0;0!==A.cmp(s);g++)A=A.redSqr();r(g=0;r--){for(var u=t.words[r],d=c-1;d>=0;d--){var l=u>>d&1;o!==n[0]&&(o=this.sqr(o)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===r&&0===d)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}c=26}return o},C.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},C.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new k(e)},o(k,C),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(50)(e))},function(e,t,n){"use strict";const r=t;r.bignum=n(8),r.define=n(366).define,r.base=n(369),r.constants=n(370),r.decoders=n(171),r.encoders=n(169)},function(e,t,n){"use strict";const r=t;r.der=n(170),r.pem=n(367)},function(e,t,n){"use strict";const r=n(2),o=n(89).Buffer,i=n(90),a=n(92);function s(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new c,this.tree._init(e.body)}function c(e){i.call(this,"der",e)}function u(e){return e<10?"0"+e:e}e.exports=s,s.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},r(c,i),c.prototype._encodeComposite=function(e,t,n,r){const i=function(e,t,n,r){let o;"seqof"===e?e="seq":"setof"===e&&(e="set");if(a.tagByName.hasOwnProperty(e))o=a.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return r.error("Unknown tag: "+e);o=e}if(o>=31)return r.error("Multi-octet tag encoding unsupported");t||(o|=32);return o|=a.tagClassByName[n||"universal"]<<6,o}(e,t,n,this.reporter);if(r.length<128){const e=o.alloc(2);return e[0]=i,e[1]=r.length,this._createEncoderBuffer([e,r])}let s=1;for(let e=r.length;e>=256;e>>=8)s++;const c=o.alloc(2+s);c[0]=i,c[1]=128|s;for(let e=1+s,t=r.length;t>0;e--,t>>=8)c[e]=255&t;return this._createEncoderBuffer([c,r])},c.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){const t=o.alloc(2*e.length);for(let n=0;n=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let r=0;for(let t=0;t=128;n>>=7)r++}const i=o.alloc(r);let a=i.length-1;for(let t=e.length-1;t>=0;t--){let n=e[t];for(i[a--]=127&n;(n>>=7)>0;)i[a--]=128|127&n}return this._createEncoderBuffer(i)},c.prototype._encodeTime=function(e,t){let n;const r=new Date(e);return"gentime"===t?n=[u(r.getUTCFullYear()),u(r.getUTCMonth()+1),u(r.getUTCDate()),u(r.getUTCHours()),u(r.getUTCMinutes()),u(r.getUTCSeconds()),"Z"].join(""):"utctime"===t?n=[u(r.getUTCFullYear()%100),u(r.getUTCMonth()+1),u(r.getUTCDate()),u(r.getUTCHours()),u(r.getUTCMinutes()),u(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!o.isBuffer(e)){const t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=o.from(t)}if(o.isBuffer(e)){let t=e.length;0===e.length&&t++;const n=o.alloc(t);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let n=1;for(let t=e;t>=256;t>>=8)n++;const r=new Array(n);for(let t=r.length-1;t>=0;t--)r[t]=255&e,e>>=8;return 128&r[0]&&r.unshift(0),this._createEncoderBuffer(o.from(r))},c.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},c.prototype._skipDefault=function(e,t,n){const r=this._baseState;let o;if(null===r.default)return!1;const i=e.join();if(void 0===r.defaultBuffer&&(r.defaultBuffer=this._encodeValue(r.default,t,n).join()),i.length!==r.defaultBuffer.length)return!1;for(o=0;o>6],o=0==(32&n);if(31==(31&n)){let r=n;for(n=0;128==(128&r);){if(r=e.readUInt8(t),e.isError(r))return r;n<<=7,n|=127&r}}else n&=31;return{cls:r,primitive:o,tag:n,tagStr:s.tag[n]}}function l(e,t,n){let r=e.readUInt8(n);if(e.isError(r))return r;if(!t&&128===r)return null;if(0==(128&r))return r;const o=127&r;if(o>4)return e.error("length octect is too long");r=0;for(let t=0;t32||0===e.length||0===e[0])throw new Error("Unsigned integer r must be encoded as unpadded big endian.");if(t.length>32||0===t.length||0===t[0])throw new Error("Unsigned integer s must be encoded as unpadded big endian.");this.data={r:e,s:t}}static fromFixedLength(e){if(64!==e.length)throw new Error(`Got invalid data length: ${e.length}. Expected 2x 32 bytes for the pair (r, s)`);return new o(r(e.slice(0,32)),r(e.slice(32,64)))}static fromDer(e){let t=0;if(48!==e[t++])throw new Error("Prefix 0x30 expected");const n=e[t++];if(e.length-t!==n)throw new Error("Data length mismatch detected");if(2!==e[t++])throw new Error("INTEGER tag expected");const i=e[t++];if(i>=128)throw new Error("Decoding length values above 127 not supported");const a=e.slice(t,t+i);t+=i;if(2!==e[t++])throw new Error("INTEGER tag expected");const s=e[t++];if(s>=128)throw new Error("Decoding length values above 127 not supported");const c=e.slice(t,t+s);return t+=s,new o(r(a),r(c))}r(e){if(void 0===e)return this.data.r;{const t=e-this.data.r.length;if(t<0)throw new Error("Length too small to hold parameter r");const n=new Uint8Array(t);return new Uint8Array([...n,...this.data.r])}}s(e){if(void 0===e)return this.data.s;{const t=e-this.data.s.length;if(t<0)throw new Error("Length too small to hold parameter s");const n=new Uint8Array(t);return new Uint8Array([...n,...this.data.s])}}toFixedLength(){return new Uint8Array([...this.r(32),...this.s(32)])}toDer(){const e=this.data.r[0]>=128?new Uint8Array([0,...this.data.r]):this.data.r,t=this.data.s[0]>=128?new Uint8Array([0,...this.data.s]):this.data.s,n=e.length,r=t.length,o=new Uint8Array([2,n,...e,2,r,...t]);return new Uint8Array([48,o.length,...o])}}t.Secp256k1Signature=o;class i extends o{constructor(e,t,n){if(super(e,t),!Number.isInteger(n))throw new Error("The recovery parameter must be an integer.");if(n<0||n>4)throw new Error("The recovery parameter must be one of 0, 1, 2, 3.");this.recovery=n}static fromFixedLength(e){if(65!==e.length)throw new Error(`Got invalid data length ${e.length}. Expected 32 + 32 + 1`);return new i(r(e.slice(0,32)),r(e.slice(32,64)),e[64])}toFixedLength(){return new Uint8Array([...this.r(32),...this.s(32),this.recovery])}}t.ExtendedSecp256k1Signature=i},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.sha512=t.Sha512=t.sha256=t.Sha256=t.sha1=t.Sha1=void 0;const o=r(n(57));class i{constructor(e){this.blockSize=64,this.impl=o.default("sha1"),e&&this.update(e)}update(e){return this.impl.update(e),this}digest(){return new Uint8Array(this.impl.digest())}}t.Sha1=i,t.sha1=function(e){return new i(e).digest()};class a{constructor(e){this.blockSize=64,this.impl=o.default("sha256"),e&&this.update(e)}update(e){return this.impl.update(e),this}digest(){return new Uint8Array(this.impl.digest())}}t.Sha256=a,t.sha256=function(e){return new a(e).digest()};class s{constructor(e){this.blockSize=128,this.impl=o.default("sha512"),e&&this.update(e)}update(e){return this.impl.update(e),this}digest(){return new Uint8Array(this.impl.digest())}}t.Sha512=s,t.sha512=function(e){return new s(e).digest()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseCoins=t.coins=t.coin=void 0;const r=n(44);function o(e,t){return{amount:new r.Uint53(e).toString(),denom:t}}t.coin=o,t.coins=function(e,t){return[o(e,t)]},t.parseCoins=function(e){return e.replace(/\s/g,"").split(",").filter(Boolean).map(e=>{const t=e.match(/^([0-9]+)([a-zA-Z]+)/);if(!t)throw new Error("Got an invalid coin string");return{amount:r.Uint64.fromString(t[1]).toString(),denom:t[2]}})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CosmosClient=t.isSearchByTagsQuery=t.isSearchBySentFromOrToQuery=t.isSearchByHeightQuery=t.isSearchByIdQuery=t.assertIsBroadcastTxSuccess=t.isBroadcastTxSuccess=t.isBroadcastTxFailure=void 0;const r=n(46),o=n(22),i=n(44),a=n(93),s=n(117);function c(e){return!!e.code}function u(e){return void 0!==e.id}function d(e){return void 0!==e.height}function l(e){return void 0!==e.sentFromOrTo}function f(e){return void 0!==e.tags}t.isBroadcastTxFailure=c,t.isBroadcastTxSuccess=function(e){return!c(e)},t.assertIsBroadcastTxSuccess=function(e){if(c(e))throw new Error(`Error when broadcasting tx ${e.transactionHash} at height ${e.height}. Code: ${e.code}; Raw log: ${e.rawLog}`)},t.isSearchByIdQuery=u,t.isSearchByHeightQuery=d,t.isSearchBySentFromOrToQuery=l,t.isSearchByTagsQuery=f;t.CosmosClient=class{constructor(e,t=a.BroadcastMode.Block){this.lcdClient=a.LcdClient.withExtensions({apiUrl:e,broadcastMode:t},a.setupAuthExtension)}async getChainId(){if(!this.chainId){const e=(await this.lcdClient.nodeInfo()).node_info.network;if(!e)throw new Error("Chain ID must not be empty");this.chainId=e}return this.chainId}async getHeight(){if(this.anyValidAddress){const{height:e}=await this.lcdClient.auth.account(this.anyValidAddress);return parseInt(e,10)}{const e=await this.lcdClient.blocksLatest();return parseInt(e.block.header.height,10)}}async getIdentifier(e){const t=await this.lcdClient.encodeTx(e),n=r.sha256(o.fromBase64(t.tx));return o.toHex(n).toUpperCase()}async getSequence(e){const t=await this.getAccount(e);if(!t)throw new Error("Account does not exist on chain. Send some tokens there before trying to query sequence.");return{accountNumber:t.accountNumber,sequence:t.sequence}}async getAccount(e){const t=(await this.lcdClient.auth.account(e)).result.value;return""===t.address?void 0:(this.anyValidAddress=t.address,{address:t.address,balance:t.coins,pubkey:a.normalizePubkey(t.public_key)||void 0,accountNumber:a.uint64ToNumber(t.account_number),sequence:a.uint64ToNumber(t.sequence)})}async getBlock(e){const t=void 0!==e?await this.lcdClient.blocks(e):await this.lcdClient.blocksLatest();return{id:t.block_id.hash,header:{version:t.block.header.version,time:t.block.header.time,height:parseInt(t.block.header.height,10),chainId:t.block.header.chain_id},txs:(t.block.data.txs||[]).map(o.fromBase64)}}async searchTx(e,t={}){const n=t.minHeight||0,r=t.maxHeight||Number.MAX_SAFE_INTEGER;if(re.hash);i=[...r,...a.filter(e=>!s.includes(e.hash))]}else{if(!f(e))throw new Error("Unknown query type");{const t=o(e.tags.map(e=>`${e.key}=${e.value}`).join("&"));i=await this.txsQuery(t)}}return i.filter(e=>e.height>=n&&e.height<=r)}async broadcastTx(e){const t=await this.lcdClient.broadcastTx(e);if(!t.txhash.match(/^([0-9A-F][0-9A-F])+$/))throw new Error("Received ill-formatted txhash. Must be non-empty upper-case hex");return void 0!==t.code?{height:i.Uint53.fromString(t.height).toNumber(),transactionHash:t.txhash,code:t.code,rawLog:t.raw_log||""}:{logs:t.logs?s.parseLogs(t.logs):[],rawLog:t.raw_log||"",transactionHash:t.txhash,data:t.data?o.fromHex(t.data):void 0}}async txsQuery(e){const t=await this.lcdClient.txsQuery(e+"&limit=100");if(parseInt(t.page_total,10)>1)throw new Error(`Found more results on the backend than we can process currently. Results: ${t.total_count}, supported: 100`);return t.txs.map(e=>({height:parseInt(e.height,10),hash:e.txhash,code:e.code||0,rawLog:e.raw_log,logs:s.parseLogs(e.logs||[]),tx:e.tx,timestamp:e.timestamp}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BroadcastMode=void 0,function(e){e.Block="block",e.Sync="sync",e.Async="async"}(t.BroadcastMode||(t.BroadcastMode={}))},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r.+?)(?[a-z]+)$/);if(!t)throw new Error("Invalid gas price string");const{amount:n,denom:o}=t.groups;if(o.length<3||o.length>127)throw new Error("Gas price denomination must be between 3 and 127 characters");const a=r.Decimal.fromUserInput(n,18);return new i(a,o)}}function a(e,{denom:t,amount:n}){const i=Math.ceil(n.multiply(new r.Uint53(e)).toFloatApproximation());return{amount:o.coins(i,t),gas:e.toString()}}t.GasPrice=i,t.buildFeeTable=function(e,t,n){return Object.entries(t).reduce((t,[r,o])=>Object.assign(Object.assign({},t),{[r]:a(n[r]||o,e)}),{})}},function(e,t,n){"use strict";function r(e){const{memo:t,msg:n,fee:r,signatures:o}=e;return"string"==typeof t&&Array.isArray(n)&&"object"==typeof r&&Array.isArray(o)}Object.defineProperty(t,"__esModule",{value:!0}),t.isWrappedStdTx=t.makeStdTx=t.isStdTx=void 0,t.isStdTx=r,t.makeStdTx=function(e,t){return{msg:e.msgs,fee:e.fee,memo:e.memo,signatures:Array.isArray(t)?t:[t]}},t.isWrappedStdTx=function(e){return"cosmos-sdk/StdTx"===e.type&&r(e.value)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decrypt=t.encrypt=t.supportedAlgorithms=t.executeKdf=t.cosmjsSalt=t.makeCosmoshubPath=void 0;const r=n(46),o=n(22);t.makeCosmoshubPath=function(e){return[r.Slip10RawIndex.hardened(44),r.Slip10RawIndex.hardened(118),r.Slip10RawIndex.hardened(0),r.Slip10RawIndex.normal(0),r.Slip10RawIndex.normal(e)]},t.cosmjsSalt=o.toAscii("The CosmJS salt."),t.executeKdf=async function(e,n){switch(n.algorithm){case"argon2id":{const o=n.params;if(!r.isArgon2idOptions(o))throw new Error("Invalid format of argon2id params");return r.Argon2id.execute(e,t.cosmjsSalt,o)}default:throw new Error("Unsupported KDF algorithm")}},t.supportedAlgorithms={xchacha20poly1305Ietf:"xchacha20poly1305-ietf"},t.encrypt=async function(e,n,o){switch(o.algorithm){case t.supportedAlgorithms.xchacha20poly1305Ietf:{const t=r.Random.getBytes(r.xchacha20NonceLength);return new Uint8Array([...t,...await r.Xchacha20poly1305Ietf.encrypt(e,n,t)])}default:throw new Error(`Unsupported encryption algorithm: '${o.algorithm}'`)}},t.decrypt=async function(e,n,o){switch(o.algorithm){case t.supportedAlgorithms.xchacha20poly1305Ietf:{const t=e.slice(0,r.xchacha20NonceLength);return r.Xchacha20poly1305Ietf.decrypt(e.slice(r.xchacha20NonceLength),n,t)}default:throw new Error(`Unsupported encryption algorithm: '${o.algorithm}'`)}}},function(e,t,n){(function(e){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:n(421).Buffer}catch(e){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function c(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function u(e,t,n,o){for(var i=0,a=0,s=Math.min(e.length,n),c=t;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===n)for(o=0,i=0;o>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)o=c(e,t,r)<=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,o=1;o<=67108863;o*=t)r++;r--,o=o/t|0;for(var i=e.length-n,a=i%r,s=Math.min(i,i-a)+n,c=0,d=n;d1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?""}var f=["","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"],h=[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],p=[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];i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,i=0,a=0;a>>24-o&16777215,(o+=2)>=26&&(o-=26,a--),n=0!==i||a!==this.length-1?f[6-c.length]+c+n:c+n}for(0!==i&&(n=i.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=h[e],d=p[e];n="";var l=this.clone();for(l.negative=0;!l.isZero();){var A=l.modrn(d).toString(e);n=(l=l.idivn(d)).isZero()?A+n:f[u-A.length]+A+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},a&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function A(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,c=a/67108864|0;n.words[0]=s;for(var u=1;u>>26,l=67108863&c,f=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=f;h++){var p=u-h|0;d+=(a=(o=0|e.words[p])*(i=0|t.words[h])+l)/67108864|0,l=67108863&a}n.words[u]=0|l,c=0|d}return 0!==c?n.words[u]=0|c:n.length--,n._strip()}i.prototype.toArrayLike=function(e,t,n){this._strip();var o=this.byteLength(),i=n||Math.max(1,o);r(o<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,o),a},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,o=0,i=0;o>8&255),n>16&255),6===i?(n>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===i?(n>=0&&(e[n--]=a>>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var o=0;o0&&(this.words[o]=~this.words[o]&67108863>>26-n),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var o=0,i=0;i>>26;for(;0!==o&&i>>26;if(this.length=n.length,0!==o)this.words[this.length]=o,this.length++;else if(n!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,h=0|a[1],p=8191&h,A=h>>>13,g=0|a[2],m=8191&g,v=g>>>13,y=0|a[3],b=8191&y,I=y>>>13,w=0|a[4],E=8191&w,_=w>>>13,B=0|a[5],C=8191&B,k=B>>>13,S=0|a[6],O=8191&S,Q=S>>>13,P=0|a[7],R=8191&P,M=P>>>13,x=0|a[8],D=8191&x,N=x>>>13,T=0|a[9],j=8191&T,U=T>>>13,H=0|s[0],J=8191&H,F=H>>>13,L=0|s[1],q=8191&L,G=L>>>13,V=0|s[2],z=8191&V,Y=V>>>13,K=0|s[3],W=8191&K,Z=K>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],ne=8191&te,re=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,de=0|s[8],le=8191&de,fe=de>>>13,he=0|s[9],pe=8191&he,Ae=he>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(u+(r=Math.imul(l,J))|0)+((8191&(o=(o=Math.imul(l,F))+Math.imul(f,J)|0))<<13)|0;u=((i=Math.imul(f,F))+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(p,J),o=(o=Math.imul(p,F))+Math.imul(A,J)|0,i=Math.imul(A,F);var me=(u+(r=r+Math.imul(l,q)|0)|0)+((8191&(o=(o=o+Math.imul(l,G)|0)+Math.imul(f,q)|0))<<13)|0;u=((i=i+Math.imul(f,G)|0)+(o>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,J),o=(o=Math.imul(m,F))+Math.imul(v,J)|0,i=Math.imul(v,F),r=r+Math.imul(p,q)|0,o=(o=o+Math.imul(p,G)|0)+Math.imul(A,q)|0,i=i+Math.imul(A,G)|0;var ve=(u+(r=r+Math.imul(l,z)|0)|0)+((8191&(o=(o=o+Math.imul(l,Y)|0)+Math.imul(f,z)|0))<<13)|0;u=((i=i+Math.imul(f,Y)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(b,J),o=(o=Math.imul(b,F))+Math.imul(I,J)|0,i=Math.imul(I,F),r=r+Math.imul(m,q)|0,o=(o=o+Math.imul(m,G)|0)+Math.imul(v,q)|0,i=i+Math.imul(v,G)|0,r=r+Math.imul(p,z)|0,o=(o=o+Math.imul(p,Y)|0)+Math.imul(A,z)|0,i=i+Math.imul(A,Y)|0;var ye=(u+(r=r+Math.imul(l,W)|0)|0)+((8191&(o=(o=o+Math.imul(l,Z)|0)+Math.imul(f,W)|0))<<13)|0;u=((i=i+Math.imul(f,Z)|0)+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(E,J),o=(o=Math.imul(E,F))+Math.imul(_,J)|0,i=Math.imul(_,F),r=r+Math.imul(b,q)|0,o=(o=o+Math.imul(b,G)|0)+Math.imul(I,q)|0,i=i+Math.imul(I,G)|0,r=r+Math.imul(m,z)|0,o=(o=o+Math.imul(m,Y)|0)+Math.imul(v,z)|0,i=i+Math.imul(v,Y)|0,r=r+Math.imul(p,W)|0,o=(o=o+Math.imul(p,Z)|0)+Math.imul(A,W)|0,i=i+Math.imul(A,Z)|0;var be=(u+(r=r+Math.imul(l,$)|0)|0)+((8191&(o=(o=o+Math.imul(l,ee)|0)+Math.imul(f,$)|0))<<13)|0;u=((i=i+Math.imul(f,ee)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(C,J),o=(o=Math.imul(C,F))+Math.imul(k,J)|0,i=Math.imul(k,F),r=r+Math.imul(E,q)|0,o=(o=o+Math.imul(E,G)|0)+Math.imul(_,q)|0,i=i+Math.imul(_,G)|0,r=r+Math.imul(b,z)|0,o=(o=o+Math.imul(b,Y)|0)+Math.imul(I,z)|0,i=i+Math.imul(I,Y)|0,r=r+Math.imul(m,W)|0,o=(o=o+Math.imul(m,Z)|0)+Math.imul(v,W)|0,i=i+Math.imul(v,Z)|0,r=r+Math.imul(p,$)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(A,$)|0,i=i+Math.imul(A,ee)|0;var Ie=(u+(r=r+Math.imul(l,ne)|0)|0)+((8191&(o=(o=o+Math.imul(l,re)|0)+Math.imul(f,ne)|0))<<13)|0;u=((i=i+Math.imul(f,re)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(O,J),o=(o=Math.imul(O,F))+Math.imul(Q,J)|0,i=Math.imul(Q,F),r=r+Math.imul(C,q)|0,o=(o=o+Math.imul(C,G)|0)+Math.imul(k,q)|0,i=i+Math.imul(k,G)|0,r=r+Math.imul(E,z)|0,o=(o=o+Math.imul(E,Y)|0)+Math.imul(_,z)|0,i=i+Math.imul(_,Y)|0,r=r+Math.imul(b,W)|0,o=(o=o+Math.imul(b,Z)|0)+Math.imul(I,W)|0,i=i+Math.imul(I,Z)|0,r=r+Math.imul(m,$)|0,o=(o=o+Math.imul(m,ee)|0)+Math.imul(v,$)|0,i=i+Math.imul(v,ee)|0,r=r+Math.imul(p,ne)|0,o=(o=o+Math.imul(p,re)|0)+Math.imul(A,ne)|0,i=i+Math.imul(A,re)|0;var we=(u+(r=r+Math.imul(l,ie)|0)|0)+((8191&(o=(o=o+Math.imul(l,ae)|0)+Math.imul(f,ie)|0))<<13)|0;u=((i=i+Math.imul(f,ae)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(R,J),o=(o=Math.imul(R,F))+Math.imul(M,J)|0,i=Math.imul(M,F),r=r+Math.imul(O,q)|0,o=(o=o+Math.imul(O,G)|0)+Math.imul(Q,q)|0,i=i+Math.imul(Q,G)|0,r=r+Math.imul(C,z)|0,o=(o=o+Math.imul(C,Y)|0)+Math.imul(k,z)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(E,W)|0,o=(o=o+Math.imul(E,Z)|0)+Math.imul(_,W)|0,i=i+Math.imul(_,Z)|0,r=r+Math.imul(b,$)|0,o=(o=o+Math.imul(b,ee)|0)+Math.imul(I,$)|0,i=i+Math.imul(I,ee)|0,r=r+Math.imul(m,ne)|0,o=(o=o+Math.imul(m,re)|0)+Math.imul(v,ne)|0,i=i+Math.imul(v,re)|0,r=r+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,ae)|0;var Ee=(u+(r=r+Math.imul(l,ce)|0)|0)+((8191&(o=(o=o+Math.imul(l,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((i=i+Math.imul(f,ue)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(D,J),o=(o=Math.imul(D,F))+Math.imul(N,J)|0,i=Math.imul(N,F),r=r+Math.imul(R,q)|0,o=(o=o+Math.imul(R,G)|0)+Math.imul(M,q)|0,i=i+Math.imul(M,G)|0,r=r+Math.imul(O,z)|0,o=(o=o+Math.imul(O,Y)|0)+Math.imul(Q,z)|0,i=i+Math.imul(Q,Y)|0,r=r+Math.imul(C,W)|0,o=(o=o+Math.imul(C,Z)|0)+Math.imul(k,W)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(E,$)|0,o=(o=o+Math.imul(E,ee)|0)+Math.imul(_,$)|0,i=i+Math.imul(_,ee)|0,r=r+Math.imul(b,ne)|0,o=(o=o+Math.imul(b,re)|0)+Math.imul(I,ne)|0,i=i+Math.imul(I,re)|0,r=r+Math.imul(m,ie)|0,o=(o=o+Math.imul(m,ae)|0)+Math.imul(v,ie)|0,i=i+Math.imul(v,ae)|0,r=r+Math.imul(p,ce)|0,o=(o=o+Math.imul(p,ue)|0)+Math.imul(A,ce)|0,i=i+Math.imul(A,ue)|0;var _e=(u+(r=r+Math.imul(l,le)|0)|0)+((8191&(o=(o=o+Math.imul(l,fe)|0)+Math.imul(f,le)|0))<<13)|0;u=((i=i+Math.imul(f,fe)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(j,J),o=(o=Math.imul(j,F))+Math.imul(U,J)|0,i=Math.imul(U,F),r=r+Math.imul(D,q)|0,o=(o=o+Math.imul(D,G)|0)+Math.imul(N,q)|0,i=i+Math.imul(N,G)|0,r=r+Math.imul(R,z)|0,o=(o=o+Math.imul(R,Y)|0)+Math.imul(M,z)|0,i=i+Math.imul(M,Y)|0,r=r+Math.imul(O,W)|0,o=(o=o+Math.imul(O,Z)|0)+Math.imul(Q,W)|0,i=i+Math.imul(Q,Z)|0,r=r+Math.imul(C,$)|0,o=(o=o+Math.imul(C,ee)|0)+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(E,ne)|0,o=(o=o+Math.imul(E,re)|0)+Math.imul(_,ne)|0,i=i+Math.imul(_,re)|0,r=r+Math.imul(b,ie)|0,o=(o=o+Math.imul(b,ae)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,ae)|0,r=r+Math.imul(m,ce)|0,o=(o=o+Math.imul(m,ue)|0)+Math.imul(v,ce)|0,i=i+Math.imul(v,ue)|0,r=r+Math.imul(p,le)|0,o=(o=o+Math.imul(p,fe)|0)+Math.imul(A,le)|0,i=i+Math.imul(A,fe)|0;var Be=(u+(r=r+Math.imul(l,pe)|0)|0)+((8191&(o=(o=o+Math.imul(l,Ae)|0)+Math.imul(f,pe)|0))<<13)|0;u=((i=i+Math.imul(f,Ae)|0)+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,q),o=(o=Math.imul(j,G))+Math.imul(U,q)|0,i=Math.imul(U,G),r=r+Math.imul(D,z)|0,o=(o=o+Math.imul(D,Y)|0)+Math.imul(N,z)|0,i=i+Math.imul(N,Y)|0,r=r+Math.imul(R,W)|0,o=(o=o+Math.imul(R,Z)|0)+Math.imul(M,W)|0,i=i+Math.imul(M,Z)|0,r=r+Math.imul(O,$)|0,o=(o=o+Math.imul(O,ee)|0)+Math.imul(Q,$)|0,i=i+Math.imul(Q,ee)|0,r=r+Math.imul(C,ne)|0,o=(o=o+Math.imul(C,re)|0)+Math.imul(k,ne)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(E,ie)|0,o=(o=o+Math.imul(E,ae)|0)+Math.imul(_,ie)|0,i=i+Math.imul(_,ae)|0,r=r+Math.imul(b,ce)|0,o=(o=o+Math.imul(b,ue)|0)+Math.imul(I,ce)|0,i=i+Math.imul(I,ue)|0,r=r+Math.imul(m,le)|0,o=(o=o+Math.imul(m,fe)|0)+Math.imul(v,le)|0,i=i+Math.imul(v,fe)|0;var Ce=(u+(r=r+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,Ae)|0)+Math.imul(A,pe)|0))<<13)|0;u=((i=i+Math.imul(A,Ae)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,z),o=(o=Math.imul(j,Y))+Math.imul(U,z)|0,i=Math.imul(U,Y),r=r+Math.imul(D,W)|0,o=(o=o+Math.imul(D,Z)|0)+Math.imul(N,W)|0,i=i+Math.imul(N,Z)|0,r=r+Math.imul(R,$)|0,o=(o=o+Math.imul(R,ee)|0)+Math.imul(M,$)|0,i=i+Math.imul(M,ee)|0,r=r+Math.imul(O,ne)|0,o=(o=o+Math.imul(O,re)|0)+Math.imul(Q,ne)|0,i=i+Math.imul(Q,re)|0,r=r+Math.imul(C,ie)|0,o=(o=o+Math.imul(C,ae)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,ae)|0,r=r+Math.imul(E,ce)|0,o=(o=o+Math.imul(E,ue)|0)+Math.imul(_,ce)|0,i=i+Math.imul(_,ue)|0,r=r+Math.imul(b,le)|0,o=(o=o+Math.imul(b,fe)|0)+Math.imul(I,le)|0,i=i+Math.imul(I,fe)|0;var ke=(u+(r=r+Math.imul(m,pe)|0)|0)+((8191&(o=(o=o+Math.imul(m,Ae)|0)+Math.imul(v,pe)|0))<<13)|0;u=((i=i+Math.imul(v,Ae)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,W),o=(o=Math.imul(j,Z))+Math.imul(U,W)|0,i=Math.imul(U,Z),r=r+Math.imul(D,$)|0,o=(o=o+Math.imul(D,ee)|0)+Math.imul(N,$)|0,i=i+Math.imul(N,ee)|0,r=r+Math.imul(R,ne)|0,o=(o=o+Math.imul(R,re)|0)+Math.imul(M,ne)|0,i=i+Math.imul(M,re)|0,r=r+Math.imul(O,ie)|0,o=(o=o+Math.imul(O,ae)|0)+Math.imul(Q,ie)|0,i=i+Math.imul(Q,ae)|0,r=r+Math.imul(C,ce)|0,o=(o=o+Math.imul(C,ue)|0)+Math.imul(k,ce)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(E,le)|0,o=(o=o+Math.imul(E,fe)|0)+Math.imul(_,le)|0,i=i+Math.imul(_,fe)|0;var Se=(u+(r=r+Math.imul(b,pe)|0)|0)+((8191&(o=(o=o+Math.imul(b,Ae)|0)+Math.imul(I,pe)|0))<<13)|0;u=((i=i+Math.imul(I,Ae)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,$),o=(o=Math.imul(j,ee))+Math.imul(U,$)|0,i=Math.imul(U,ee),r=r+Math.imul(D,ne)|0,o=(o=o+Math.imul(D,re)|0)+Math.imul(N,ne)|0,i=i+Math.imul(N,re)|0,r=r+Math.imul(R,ie)|0,o=(o=o+Math.imul(R,ae)|0)+Math.imul(M,ie)|0,i=i+Math.imul(M,ae)|0,r=r+Math.imul(O,ce)|0,o=(o=o+Math.imul(O,ue)|0)+Math.imul(Q,ce)|0,i=i+Math.imul(Q,ue)|0,r=r+Math.imul(C,le)|0,o=(o=o+Math.imul(C,fe)|0)+Math.imul(k,le)|0,i=i+Math.imul(k,fe)|0;var Oe=(u+(r=r+Math.imul(E,pe)|0)|0)+((8191&(o=(o=o+Math.imul(E,Ae)|0)+Math.imul(_,pe)|0))<<13)|0;u=((i=i+Math.imul(_,Ae)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(j,ne),o=(o=Math.imul(j,re))+Math.imul(U,ne)|0,i=Math.imul(U,re),r=r+Math.imul(D,ie)|0,o=(o=o+Math.imul(D,ae)|0)+Math.imul(N,ie)|0,i=i+Math.imul(N,ae)|0,r=r+Math.imul(R,ce)|0,o=(o=o+Math.imul(R,ue)|0)+Math.imul(M,ce)|0,i=i+Math.imul(M,ue)|0,r=r+Math.imul(O,le)|0,o=(o=o+Math.imul(O,fe)|0)+Math.imul(Q,le)|0,i=i+Math.imul(Q,fe)|0;var Qe=(u+(r=r+Math.imul(C,pe)|0)|0)+((8191&(o=(o=o+Math.imul(C,Ae)|0)+Math.imul(k,pe)|0))<<13)|0;u=((i=i+Math.imul(k,Ae)|0)+(o>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,r=Math.imul(j,ie),o=(o=Math.imul(j,ae))+Math.imul(U,ie)|0,i=Math.imul(U,ae),r=r+Math.imul(D,ce)|0,o=(o=o+Math.imul(D,ue)|0)+Math.imul(N,ce)|0,i=i+Math.imul(N,ue)|0,r=r+Math.imul(R,le)|0,o=(o=o+Math.imul(R,fe)|0)+Math.imul(M,le)|0,i=i+Math.imul(M,fe)|0;var Pe=(u+(r=r+Math.imul(O,pe)|0)|0)+((8191&(o=(o=o+Math.imul(O,Ae)|0)+Math.imul(Q,pe)|0))<<13)|0;u=((i=i+Math.imul(Q,Ae)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(j,ce),o=(o=Math.imul(j,ue))+Math.imul(U,ce)|0,i=Math.imul(U,ue),r=r+Math.imul(D,le)|0,o=(o=o+Math.imul(D,fe)|0)+Math.imul(N,le)|0,i=i+Math.imul(N,fe)|0;var Re=(u+(r=r+Math.imul(R,pe)|0)|0)+((8191&(o=(o=o+Math.imul(R,Ae)|0)+Math.imul(M,pe)|0))<<13)|0;u=((i=i+Math.imul(M,Ae)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,le),o=(o=Math.imul(j,fe))+Math.imul(U,le)|0,i=Math.imul(U,fe);var Me=(u+(r=r+Math.imul(D,pe)|0)|0)+((8191&(o=(o=o+Math.imul(D,Ae)|0)+Math.imul(N,pe)|0))<<13)|0;u=((i=i+Math.imul(N,Ae)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863;var xe=(u+(r=Math.imul(j,pe))|0)+((8191&(o=(o=Math.imul(j,Ae))+Math.imul(U,pe)|0))<<13)|0;return u=((i=Math.imul(U,Ae))+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,c[0]=ge,c[1]=me,c[2]=ve,c[3]=ye,c[4]=be,c[5]=Ie,c[6]=we,c[7]=Ee,c[8]=_e,c[9]=Be,c[10]=Ce,c[11]=ke,c[12]=Se,c[13]=Oe,c[14]=Qe,c[15]=Pe,c[16]=Re,c[17]=Me,c[18]=xe,0!==u&&(c[19]=u,n.length++),n};function m(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,o=0,i=0;i>>26)|0)>>>26,a&=67108863}n.words[i]=s,r=a,a=o}return 0!==r?n.words[i]=r:n.length--,n._strip()}function v(e,t,n){return m(e,t,n)}function y(e,t){this.x=e,this.y=t}Math.imul||(g=A),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):n<63?A(this,e,t):n<1024?m(this,e,t):v(this,e,t)},y.prototype.makeRBT=function(e){for(var t=new Array(e),n=i.prototype._countBits(e)-1,r=0;r>=1;return r},y.prototype.permute=function(e,t,n,r,o,i){for(var a=0;a>>=1)o++;return 1<>>=13,n[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,n+=i/67108864|0,n+=a>>>26,this.words[o]=67108863&a}return 0!==n&&(this.words[o]=n,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>o&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,n=e%26,o=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<a)for(this.length-=a,u=0;u=0&&(0!==d||u>=o);u--){var l=0|this.words[u];this.words[u]=d<<26-i|l>>>i,d=l&s}return c&&0!==d&&(c.words[c.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,o=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var o=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[o+n]=67108863&i}for(;o>26,this.words[o+n]=67108863&i;if(0===s)return this._strip();for(r(-1===s),s=0,o=0;o>26,this.words[o]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!==(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,c=r.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;l--){var f=67108864*(0|r.words[o.length+l])+(0|r.words[o.length+l-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(o,f,l);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(o,1,l),r.isZero()||(r.negative^=1);s&&(s.words[l]=f)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),o=e.andln(1),i=n.cmp(r);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,o=0,i=this.length-1;i>=0;i--)o=(n*o+(0|this.words[i]))%e;return t?-o:o},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,o=this.length-1;o>=0;o--){var i=(0|this.words[o])+67108864*n;this.words[o]=i/e|0,n=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var d=n.clone(),l=t.clone();!t.isZero();){for(var f=0,h=1;0==(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(d),a.isub(l)),o.iushrn(1),a.iushrn(1);for(var p=0,A=1;0==(n.words[0]&A)&&p<26;++p,A<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(d),c.isub(l)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,d=1;0==(t.words[0]&d)&&u<26;++u,d<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var l=0,f=1;0==(n.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(n.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var o=t.cmp(n);if(o<0){var i=t;t=n,n=i}else if(0===o||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,o=1<>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:oe.length)return 1;if(this.length=0;n--){var r=0|this.words[n],o=0|e.words[n];if(r!==o){ro&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new C(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function I(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){I.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){I.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){I.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function B(){I.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function C(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){C.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}I.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},I.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},I.prototype.split=function(e,t){e.iushrn(this.n,0,t)},I.prototype.imulK=function(e){return e.imul(this.k)},o(w,I),w.prototype.split=function(e,t){for(var n=Math.min(e.length,9),r=0;r>>22,o=i}o>>>=22,e.words[r-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=o,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new E;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new B}return b[e]=t,t},C.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},C.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},C.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(d(e,e.umod(this.m)._forceRed(this)),e)},C.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},C.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},C.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},C.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},C.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},C.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},C.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},C.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},C.prototype.isqr=function(e){return this.imul(e,e.clone())},C.prototype.sqr=function(e){return this.mul(e,e)},C.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new i(2*d*d).toRed(this);0!==this.pow(d,u).cmp(c);)d.redIAdd(c);for(var l=this.pow(d,o),f=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var A=h,g=0;0!==A.cmp(s);g++)A=A.redSqr();r(g=0;r--){for(var u=t.words[r],d=c-1;d>=0;d--){var l=u>>d&1;o!==n[0]&&(o=this.sqr(o)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===r&&0===d)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}c=26}return o},C.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},C.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new k(e)},o(k,C),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(50)(e))},function(e,t,n){"use strict";e.exports=l;var r,o=n(35),i=o.LongBits,a=o.base64,s=o.utf8;function c(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function u(){}function d(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var f=function(){return o.Buffer?function(){return(l.create=function(){return new r})()}:function(){return new l}};function h(e,t,n){t[n]=255&e}function p(e,t){this.len=e,this.next=void 0,this.val=t}function A(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function g(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}l.create=f(),l.alloc=function(e){return new o.Array(e)},o.Array!==Array&&(l.alloc=o.pool(l.alloc,o.Array.prototype.subarray)),l.prototype._push=function(e,t,n){return this.tail=this.tail.next=new c(e,t,n),this.len+=t,this},p.prototype=Object.create(c.prototype),p.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(A,10,i.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=i.from(e);return this._push(A,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(A,t.length(),t)},l.prototype.bool=function(e){return this._push(h,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=i.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(o.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(o.float.writeDoubleLE,8,e)};var m=o.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r>>0;if(!t)return this._push(h,1,0);if(o.isString(e)){var n=l.alloc(t=a.length(e));a.decode(e,n,0),e=n}return this.uint32(t)._push(m,t,e)},l.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(h,1,0)},l.prototype.fork=function(){return this.states=new d(this),this.head=this.tail=new c(u,0,0),this.len=0,this},l.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},l._configure=function(e){r=e,l.create=f(),r._configure()}},function(e,t,n){"use strict";e.exports=c;var r,o=n(35),i=o.LongBits,a=o.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var u,d="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},l=function(){return o.Buffer?function(e){return(c.create=function(e){return o.Buffer.isBuffer(e)?new r(e):d(e)})(e)}:d};function f(){var e=new i(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw s(this,8);return new i(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}c.create=l(),c.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,c.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return u}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return h(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|h(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw s(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},c.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){r=e,c.create=l(),r._configure();var t=o.Long?"toLong":"toNumber";o.merge(c.prototype,{int64:function(){return f.call(this)[t](!1)},uint64:function(){return f.call(this)[t](!0)},sint64:function(){return f.call(this).zzDecode()[t](!1)},fixed64:function(){return p.call(this)[t](!0)},sfixed64:function(){return p.call(this)[t](!1)}})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.add=t.toBig=t.split=t.fromBig=void 0;const r=BigInt(2**32-1),o=BigInt(32);function i(e,t=!1){return t?{h:Number(e&r),l:Number(e>>o&r)}:{h:0|Number(e>>o&r),l:0|Number(e&r)}}function a(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let o=0;oBigInt(e>>>0)<>>0);function s(e,t,n,r){const o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:0|o}}t.add=s;const c={fromBig:i,split:a,toBig:t.toBig,shrSH:(e,t,n)=>e>>>n,shrSL:(e,t,n)=>e<<32-n|t>>>n,rotrSH:(e,t,n)=>e>>>n|t<<32-n,rotrSL:(e,t,n)=>e<<32-n|t>>>n,rotrBH:(e,t,n)=>e<<64-n|t>>>n-32,rotrBL:(e,t,n)=>e>>>n-32|t<<64-n,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,n)=>e<>>32-n,rotlSL:(e,t,n)=>t<>>32-n,rotlBH:(e,t,n)=>t<>>64-n,rotlBL:(e,t,n)=>e<>>64-n,add:s,add3L:(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),add3H:(e,t,n,r)=>t+n+r+(e/2**32|0)|0,add4L:(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),add4H:(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0,add5H:(e,t,n,r,o,i)=>t+n+r+o+i+(e/2**32|0)|0,add5L:(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0)};t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=void 0;const r=n(99),o=n(36),i=(e,t,n)=>e&t^e&n^t&n,a=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),s=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint32Array(64);class u extends r.SHA2{constructor(){super(64,32,8,!1),this.A=0|s[0],this.B=0|s[1],this.C=0|s[2],this.D=0|s[3],this.E=0|s[4],this.F=0|s[5],this.G=0|s[6],this.H=0|s[7]}get(){const{A:e,B:t,C:n,D:r,E:o,F:i,G:a,H:s}=this;return[e,t,n,r,o,i,a,s]}set(e,t,n,r,o,i,a,s){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|r,this.E=0|o,this.F=0|i,this.G=0|a,this.H=0|s}process(e,t){for(let n=0;n<16;n++,t+=4)c[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=c[e-15],n=c[e-2],r=(0,o.rotr)(t,7)^(0,o.rotr)(t,18)^t>>>3,i=(0,o.rotr)(n,17)^(0,o.rotr)(n,19)^n>>>10;c[e]=i+c[e-7]+r+c[e-16]|0}let{A:n,B:r,C:s,D:u,E:d,F:l,G:f,H:h}=this;for(let e=0;e<64;e++){const t=h+((0,o.rotr)(d,6)^(0,o.rotr)(d,11)^(0,o.rotr)(d,25))+((p=d)&l^~p&f)+a[e]+c[e]|0,A=((0,o.rotr)(n,2)^(0,o.rotr)(n,13)^(0,o.rotr)(n,22))+i(n,r,s)|0;h=f,f=l,l=d,d=u+t|0,u=s,s=r,r=n,n=t+A|0}var p;n=n+this.A|0,r=r+this.B|0,s=s+this.C|0,u=u+this.D|0,d=d+this.E|0,l=l+this.F|0,f=f+this.G|0,h=h+this.H|0,this.set(n,r,s,u,d,l,f,h)}roundClean(){c.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}t.sha256=(0,o.wrapConstructor)(()=>new u)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hmac=void 0;t.Hmac=class{constructor(e,t){const n=(new e).blockSize;this.hash=t=>(new e).update(t).digest();let r=t;if(r.length>n&&(r=this.hash(r)),r.length92^e),this.iKeyPad=r.map(e=>54^e),this.messageHasher=new e,this.blockSize=n,this.update(this.iKeyPad)}update(e){return this.messageHasher.update(e),this}digest(){const e=this.messageHasher.digest();return this.hash(new Uint8Array([...this.oKeyPad,...e]))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=t.RIPEMD160=void 0;const r=n(99),o=n(36),i=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),a=Uint8Array.from({length:16},(e,t)=>t),s=a.map(e=>(9*e+5)%16);let c=[a],u=[s];for(let e=0;e<4;e++)for(let t of[c,u])t.push(t[e].map(e=>i[e]));const d=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>new Uint8Array(e)),l=c.map((e,t)=>e.map(e=>d[t][e])),f=u.map((e,t)=>e.map(e=>d[t][e])),h=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),p=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),A=(e,t)=>e<>>32-t;function g(e,t,n,r){return 0===e?t^n^r:1===e?t&n|~t&r:2===e?(t|~n)^r:3===e?t&r|n&~r:t^(n|~r)}const m=new Uint32Array(16);class v extends r.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:n,h3:r,h4:o}=this;return[e,t,n,r,o]}set(e,t,n,r,o){this.h0=0|e,this.h1=0|t,this.h2=0|n,this.h3=0|r,this.h4=0|o}process(e,t){for(let n=0;n<16;n++,t+=4)m[n]=e.getUint32(t,!0);let n=0|this.h0,r=n,o=0|this.h1,i=o,a=0|this.h2,s=a,d=0|this.h3,v=d,y=0|this.h4,b=y;for(let e=0;e<5;e++){const t=4-e,I=h[e],w=p[e],E=c[e],_=u[e],B=l[e],C=f[e];for(let t=0;t<16;t++){const r=A(n+g(e,o,a,d)+m[E[t]]+I,B[t])+y|0;n=y,y=d,d=0|A(a,10),a=o,o=r}for(let e=0;e<16;e++){const n=A(r+g(t,i,s,v)+m[_[e]]+w,C[e])+b|0;r=b,b=v,v=0|A(s,10),s=i,i=n}}this.set(this.h1+a+v|0,this.h2+d+b|0,this.h3+y+r|0,this.h4+n+i|0,this.h0+o+s|0)}roundClean(){m.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}t.RIPEMD160=v,t.ripemd160=(0,o.wrapConstructor)(()=>new v)},function(e,t,n){(function(e){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:n(460).Buffer}catch(e){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function c(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function u(e,t,n,o){for(var i=0,a=0,s=Math.min(e.length,n),c=t;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===n)for(o=0,i=0;o>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)o=c(e,t,r)<=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,o=1;o<=67108863;o*=t)r++;r--,o=o/t|0;for(var i=e.length-n,a=i%r,s=Math.min(i,i-a)+n,c=0,d=n;d1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){i.prototype.inspect=l}else i.prototype.inspect=l;function l(){return(this.red?""}var f=["","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"],h=[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],p=[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];i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,i=0,a=0;a>>24-o&16777215,(o+=2)>=26&&(o-=26,a--),n=0!==i||a!==this.length-1?f[6-c.length]+c+n:c+n}for(0!==i&&(n=i.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=h[e],d=p[e];n="";var l=this.clone();for(l.negative=0;!l.isZero();){var A=l.modrn(d).toString(e);n=(l=l.idivn(d)).isZero()?A+n:f[u-A.length]+A+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},a&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function A(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,c=a/67108864|0;n.words[0]=s;for(var u=1;u>>26,l=67108863&c,f=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=f;h++){var p=u-h|0;d+=(a=(o=0|e.words[p])*(i=0|t.words[h])+l)/67108864|0,l=67108863&a}n.words[u]=0|l,c=0|d}return 0!==c?n.words[u]=0|c:n.length--,n._strip()}i.prototype.toArrayLike=function(e,t,n){this._strip();var o=this.byteLength(),i=n||Math.max(1,o);r(o<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,o),a},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,o=0,i=0;o>8&255),n>16&255),6===i?(n>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(n=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===i?(n>=0&&(e[n--]=a>>24&255),r=0,i=0):(r=a>>>24,i+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var o=0;o0&&(this.words[o]=~this.words[o]&67108863>>26-n),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,r=e):(n=e,r=this);for(var o=0,i=0;i>>26;for(;0!==o&&i>>26;if(this.length=n.length,0!==o)this.words[this.length]=o,this.length++;else if(n!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==i&&a>26,this.words[a]=67108863&t;if(0===i&&a>>13,h=0|a[1],p=8191&h,A=h>>>13,g=0|a[2],m=8191&g,v=g>>>13,y=0|a[3],b=8191&y,I=y>>>13,w=0|a[4],E=8191&w,_=w>>>13,B=0|a[5],C=8191&B,k=B>>>13,S=0|a[6],O=8191&S,Q=S>>>13,P=0|a[7],R=8191&P,M=P>>>13,x=0|a[8],D=8191&x,N=x>>>13,T=0|a[9],j=8191&T,U=T>>>13,H=0|s[0],J=8191&H,F=H>>>13,L=0|s[1],q=8191&L,G=L>>>13,V=0|s[2],z=8191&V,Y=V>>>13,K=0|s[3],W=8191&K,Z=K>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],ne=8191&te,re=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,de=0|s[8],le=8191&de,fe=de>>>13,he=0|s[9],pe=8191&he,Ae=he>>>13;n.negative=e.negative^t.negative,n.length=19;var ge=(u+(r=Math.imul(l,J))|0)+((8191&(o=(o=Math.imul(l,F))+Math.imul(f,J)|0))<<13)|0;u=((i=Math.imul(f,F))+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(p,J),o=(o=Math.imul(p,F))+Math.imul(A,J)|0,i=Math.imul(A,F);var me=(u+(r=r+Math.imul(l,q)|0)|0)+((8191&(o=(o=o+Math.imul(l,G)|0)+Math.imul(f,q)|0))<<13)|0;u=((i=i+Math.imul(f,G)|0)+(o>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,J),o=(o=Math.imul(m,F))+Math.imul(v,J)|0,i=Math.imul(v,F),r=r+Math.imul(p,q)|0,o=(o=o+Math.imul(p,G)|0)+Math.imul(A,q)|0,i=i+Math.imul(A,G)|0;var ve=(u+(r=r+Math.imul(l,z)|0)|0)+((8191&(o=(o=o+Math.imul(l,Y)|0)+Math.imul(f,z)|0))<<13)|0;u=((i=i+Math.imul(f,Y)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(b,J),o=(o=Math.imul(b,F))+Math.imul(I,J)|0,i=Math.imul(I,F),r=r+Math.imul(m,q)|0,o=(o=o+Math.imul(m,G)|0)+Math.imul(v,q)|0,i=i+Math.imul(v,G)|0,r=r+Math.imul(p,z)|0,o=(o=o+Math.imul(p,Y)|0)+Math.imul(A,z)|0,i=i+Math.imul(A,Y)|0;var ye=(u+(r=r+Math.imul(l,W)|0)|0)+((8191&(o=(o=o+Math.imul(l,Z)|0)+Math.imul(f,W)|0))<<13)|0;u=((i=i+Math.imul(f,Z)|0)+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(E,J),o=(o=Math.imul(E,F))+Math.imul(_,J)|0,i=Math.imul(_,F),r=r+Math.imul(b,q)|0,o=(o=o+Math.imul(b,G)|0)+Math.imul(I,q)|0,i=i+Math.imul(I,G)|0,r=r+Math.imul(m,z)|0,o=(o=o+Math.imul(m,Y)|0)+Math.imul(v,z)|0,i=i+Math.imul(v,Y)|0,r=r+Math.imul(p,W)|0,o=(o=o+Math.imul(p,Z)|0)+Math.imul(A,W)|0,i=i+Math.imul(A,Z)|0;var be=(u+(r=r+Math.imul(l,$)|0)|0)+((8191&(o=(o=o+Math.imul(l,ee)|0)+Math.imul(f,$)|0))<<13)|0;u=((i=i+Math.imul(f,ee)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(C,J),o=(o=Math.imul(C,F))+Math.imul(k,J)|0,i=Math.imul(k,F),r=r+Math.imul(E,q)|0,o=(o=o+Math.imul(E,G)|0)+Math.imul(_,q)|0,i=i+Math.imul(_,G)|0,r=r+Math.imul(b,z)|0,o=(o=o+Math.imul(b,Y)|0)+Math.imul(I,z)|0,i=i+Math.imul(I,Y)|0,r=r+Math.imul(m,W)|0,o=(o=o+Math.imul(m,Z)|0)+Math.imul(v,W)|0,i=i+Math.imul(v,Z)|0,r=r+Math.imul(p,$)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(A,$)|0,i=i+Math.imul(A,ee)|0;var Ie=(u+(r=r+Math.imul(l,ne)|0)|0)+((8191&(o=(o=o+Math.imul(l,re)|0)+Math.imul(f,ne)|0))<<13)|0;u=((i=i+Math.imul(f,re)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(O,J),o=(o=Math.imul(O,F))+Math.imul(Q,J)|0,i=Math.imul(Q,F),r=r+Math.imul(C,q)|0,o=(o=o+Math.imul(C,G)|0)+Math.imul(k,q)|0,i=i+Math.imul(k,G)|0,r=r+Math.imul(E,z)|0,o=(o=o+Math.imul(E,Y)|0)+Math.imul(_,z)|0,i=i+Math.imul(_,Y)|0,r=r+Math.imul(b,W)|0,o=(o=o+Math.imul(b,Z)|0)+Math.imul(I,W)|0,i=i+Math.imul(I,Z)|0,r=r+Math.imul(m,$)|0,o=(o=o+Math.imul(m,ee)|0)+Math.imul(v,$)|0,i=i+Math.imul(v,ee)|0,r=r+Math.imul(p,ne)|0,o=(o=o+Math.imul(p,re)|0)+Math.imul(A,ne)|0,i=i+Math.imul(A,re)|0;var we=(u+(r=r+Math.imul(l,ie)|0)|0)+((8191&(o=(o=o+Math.imul(l,ae)|0)+Math.imul(f,ie)|0))<<13)|0;u=((i=i+Math.imul(f,ae)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(R,J),o=(o=Math.imul(R,F))+Math.imul(M,J)|0,i=Math.imul(M,F),r=r+Math.imul(O,q)|0,o=(o=o+Math.imul(O,G)|0)+Math.imul(Q,q)|0,i=i+Math.imul(Q,G)|0,r=r+Math.imul(C,z)|0,o=(o=o+Math.imul(C,Y)|0)+Math.imul(k,z)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(E,W)|0,o=(o=o+Math.imul(E,Z)|0)+Math.imul(_,W)|0,i=i+Math.imul(_,Z)|0,r=r+Math.imul(b,$)|0,o=(o=o+Math.imul(b,ee)|0)+Math.imul(I,$)|0,i=i+Math.imul(I,ee)|0,r=r+Math.imul(m,ne)|0,o=(o=o+Math.imul(m,re)|0)+Math.imul(v,ne)|0,i=i+Math.imul(v,re)|0,r=r+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,ae)|0;var Ee=(u+(r=r+Math.imul(l,ce)|0)|0)+((8191&(o=(o=o+Math.imul(l,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((i=i+Math.imul(f,ue)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(D,J),o=(o=Math.imul(D,F))+Math.imul(N,J)|0,i=Math.imul(N,F),r=r+Math.imul(R,q)|0,o=(o=o+Math.imul(R,G)|0)+Math.imul(M,q)|0,i=i+Math.imul(M,G)|0,r=r+Math.imul(O,z)|0,o=(o=o+Math.imul(O,Y)|0)+Math.imul(Q,z)|0,i=i+Math.imul(Q,Y)|0,r=r+Math.imul(C,W)|0,o=(o=o+Math.imul(C,Z)|0)+Math.imul(k,W)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(E,$)|0,o=(o=o+Math.imul(E,ee)|0)+Math.imul(_,$)|0,i=i+Math.imul(_,ee)|0,r=r+Math.imul(b,ne)|0,o=(o=o+Math.imul(b,re)|0)+Math.imul(I,ne)|0,i=i+Math.imul(I,re)|0,r=r+Math.imul(m,ie)|0,o=(o=o+Math.imul(m,ae)|0)+Math.imul(v,ie)|0,i=i+Math.imul(v,ae)|0,r=r+Math.imul(p,ce)|0,o=(o=o+Math.imul(p,ue)|0)+Math.imul(A,ce)|0,i=i+Math.imul(A,ue)|0;var _e=(u+(r=r+Math.imul(l,le)|0)|0)+((8191&(o=(o=o+Math.imul(l,fe)|0)+Math.imul(f,le)|0))<<13)|0;u=((i=i+Math.imul(f,fe)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(j,J),o=(o=Math.imul(j,F))+Math.imul(U,J)|0,i=Math.imul(U,F),r=r+Math.imul(D,q)|0,o=(o=o+Math.imul(D,G)|0)+Math.imul(N,q)|0,i=i+Math.imul(N,G)|0,r=r+Math.imul(R,z)|0,o=(o=o+Math.imul(R,Y)|0)+Math.imul(M,z)|0,i=i+Math.imul(M,Y)|0,r=r+Math.imul(O,W)|0,o=(o=o+Math.imul(O,Z)|0)+Math.imul(Q,W)|0,i=i+Math.imul(Q,Z)|0,r=r+Math.imul(C,$)|0,o=(o=o+Math.imul(C,ee)|0)+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(E,ne)|0,o=(o=o+Math.imul(E,re)|0)+Math.imul(_,ne)|0,i=i+Math.imul(_,re)|0,r=r+Math.imul(b,ie)|0,o=(o=o+Math.imul(b,ae)|0)+Math.imul(I,ie)|0,i=i+Math.imul(I,ae)|0,r=r+Math.imul(m,ce)|0,o=(o=o+Math.imul(m,ue)|0)+Math.imul(v,ce)|0,i=i+Math.imul(v,ue)|0,r=r+Math.imul(p,le)|0,o=(o=o+Math.imul(p,fe)|0)+Math.imul(A,le)|0,i=i+Math.imul(A,fe)|0;var Be=(u+(r=r+Math.imul(l,pe)|0)|0)+((8191&(o=(o=o+Math.imul(l,Ae)|0)+Math.imul(f,pe)|0))<<13)|0;u=((i=i+Math.imul(f,Ae)|0)+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,q),o=(o=Math.imul(j,G))+Math.imul(U,q)|0,i=Math.imul(U,G),r=r+Math.imul(D,z)|0,o=(o=o+Math.imul(D,Y)|0)+Math.imul(N,z)|0,i=i+Math.imul(N,Y)|0,r=r+Math.imul(R,W)|0,o=(o=o+Math.imul(R,Z)|0)+Math.imul(M,W)|0,i=i+Math.imul(M,Z)|0,r=r+Math.imul(O,$)|0,o=(o=o+Math.imul(O,ee)|0)+Math.imul(Q,$)|0,i=i+Math.imul(Q,ee)|0,r=r+Math.imul(C,ne)|0,o=(o=o+Math.imul(C,re)|0)+Math.imul(k,ne)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(E,ie)|0,o=(o=o+Math.imul(E,ae)|0)+Math.imul(_,ie)|0,i=i+Math.imul(_,ae)|0,r=r+Math.imul(b,ce)|0,o=(o=o+Math.imul(b,ue)|0)+Math.imul(I,ce)|0,i=i+Math.imul(I,ue)|0,r=r+Math.imul(m,le)|0,o=(o=o+Math.imul(m,fe)|0)+Math.imul(v,le)|0,i=i+Math.imul(v,fe)|0;var Ce=(u+(r=r+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,Ae)|0)+Math.imul(A,pe)|0))<<13)|0;u=((i=i+Math.imul(A,Ae)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,z),o=(o=Math.imul(j,Y))+Math.imul(U,z)|0,i=Math.imul(U,Y),r=r+Math.imul(D,W)|0,o=(o=o+Math.imul(D,Z)|0)+Math.imul(N,W)|0,i=i+Math.imul(N,Z)|0,r=r+Math.imul(R,$)|0,o=(o=o+Math.imul(R,ee)|0)+Math.imul(M,$)|0,i=i+Math.imul(M,ee)|0,r=r+Math.imul(O,ne)|0,o=(o=o+Math.imul(O,re)|0)+Math.imul(Q,ne)|0,i=i+Math.imul(Q,re)|0,r=r+Math.imul(C,ie)|0,o=(o=o+Math.imul(C,ae)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,ae)|0,r=r+Math.imul(E,ce)|0,o=(o=o+Math.imul(E,ue)|0)+Math.imul(_,ce)|0,i=i+Math.imul(_,ue)|0,r=r+Math.imul(b,le)|0,o=(o=o+Math.imul(b,fe)|0)+Math.imul(I,le)|0,i=i+Math.imul(I,fe)|0;var ke=(u+(r=r+Math.imul(m,pe)|0)|0)+((8191&(o=(o=o+Math.imul(m,Ae)|0)+Math.imul(v,pe)|0))<<13)|0;u=((i=i+Math.imul(v,Ae)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,W),o=(o=Math.imul(j,Z))+Math.imul(U,W)|0,i=Math.imul(U,Z),r=r+Math.imul(D,$)|0,o=(o=o+Math.imul(D,ee)|0)+Math.imul(N,$)|0,i=i+Math.imul(N,ee)|0,r=r+Math.imul(R,ne)|0,o=(o=o+Math.imul(R,re)|0)+Math.imul(M,ne)|0,i=i+Math.imul(M,re)|0,r=r+Math.imul(O,ie)|0,o=(o=o+Math.imul(O,ae)|0)+Math.imul(Q,ie)|0,i=i+Math.imul(Q,ae)|0,r=r+Math.imul(C,ce)|0,o=(o=o+Math.imul(C,ue)|0)+Math.imul(k,ce)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(E,le)|0,o=(o=o+Math.imul(E,fe)|0)+Math.imul(_,le)|0,i=i+Math.imul(_,fe)|0;var Se=(u+(r=r+Math.imul(b,pe)|0)|0)+((8191&(o=(o=o+Math.imul(b,Ae)|0)+Math.imul(I,pe)|0))<<13)|0;u=((i=i+Math.imul(I,Ae)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,$),o=(o=Math.imul(j,ee))+Math.imul(U,$)|0,i=Math.imul(U,ee),r=r+Math.imul(D,ne)|0,o=(o=o+Math.imul(D,re)|0)+Math.imul(N,ne)|0,i=i+Math.imul(N,re)|0,r=r+Math.imul(R,ie)|0,o=(o=o+Math.imul(R,ae)|0)+Math.imul(M,ie)|0,i=i+Math.imul(M,ae)|0,r=r+Math.imul(O,ce)|0,o=(o=o+Math.imul(O,ue)|0)+Math.imul(Q,ce)|0,i=i+Math.imul(Q,ue)|0,r=r+Math.imul(C,le)|0,o=(o=o+Math.imul(C,fe)|0)+Math.imul(k,le)|0,i=i+Math.imul(k,fe)|0;var Oe=(u+(r=r+Math.imul(E,pe)|0)|0)+((8191&(o=(o=o+Math.imul(E,Ae)|0)+Math.imul(_,pe)|0))<<13)|0;u=((i=i+Math.imul(_,Ae)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(j,ne),o=(o=Math.imul(j,re))+Math.imul(U,ne)|0,i=Math.imul(U,re),r=r+Math.imul(D,ie)|0,o=(o=o+Math.imul(D,ae)|0)+Math.imul(N,ie)|0,i=i+Math.imul(N,ae)|0,r=r+Math.imul(R,ce)|0,o=(o=o+Math.imul(R,ue)|0)+Math.imul(M,ce)|0,i=i+Math.imul(M,ue)|0,r=r+Math.imul(O,le)|0,o=(o=o+Math.imul(O,fe)|0)+Math.imul(Q,le)|0,i=i+Math.imul(Q,fe)|0;var Qe=(u+(r=r+Math.imul(C,pe)|0)|0)+((8191&(o=(o=o+Math.imul(C,Ae)|0)+Math.imul(k,pe)|0))<<13)|0;u=((i=i+Math.imul(k,Ae)|0)+(o>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,r=Math.imul(j,ie),o=(o=Math.imul(j,ae))+Math.imul(U,ie)|0,i=Math.imul(U,ae),r=r+Math.imul(D,ce)|0,o=(o=o+Math.imul(D,ue)|0)+Math.imul(N,ce)|0,i=i+Math.imul(N,ue)|0,r=r+Math.imul(R,le)|0,o=(o=o+Math.imul(R,fe)|0)+Math.imul(M,le)|0,i=i+Math.imul(M,fe)|0;var Pe=(u+(r=r+Math.imul(O,pe)|0)|0)+((8191&(o=(o=o+Math.imul(O,Ae)|0)+Math.imul(Q,pe)|0))<<13)|0;u=((i=i+Math.imul(Q,Ae)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(j,ce),o=(o=Math.imul(j,ue))+Math.imul(U,ce)|0,i=Math.imul(U,ue),r=r+Math.imul(D,le)|0,o=(o=o+Math.imul(D,fe)|0)+Math.imul(N,le)|0,i=i+Math.imul(N,fe)|0;var Re=(u+(r=r+Math.imul(R,pe)|0)|0)+((8191&(o=(o=o+Math.imul(R,Ae)|0)+Math.imul(M,pe)|0))<<13)|0;u=((i=i+Math.imul(M,Ae)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,le),o=(o=Math.imul(j,fe))+Math.imul(U,le)|0,i=Math.imul(U,fe);var Me=(u+(r=r+Math.imul(D,pe)|0)|0)+((8191&(o=(o=o+Math.imul(D,Ae)|0)+Math.imul(N,pe)|0))<<13)|0;u=((i=i+Math.imul(N,Ae)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863;var xe=(u+(r=Math.imul(j,pe))|0)+((8191&(o=(o=Math.imul(j,Ae))+Math.imul(U,pe)|0))<<13)|0;return u=((i=Math.imul(U,Ae))+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,c[0]=ge,c[1]=me,c[2]=ve,c[3]=ye,c[4]=be,c[5]=Ie,c[6]=we,c[7]=Ee,c[8]=_e,c[9]=Be,c[10]=Ce,c[11]=ke,c[12]=Se,c[13]=Oe,c[14]=Qe,c[15]=Pe,c[16]=Re,c[17]=Me,c[18]=xe,0!==u&&(c[19]=u,n.length++),n};function m(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,o=0,i=0;i>>26)|0)>>>26,a&=67108863}n.words[i]=s,r=a,a=o}return 0!==r?n.words[i]=r:n.length--,n._strip()}function v(e,t,n){return m(e,t,n)}function y(e,t){this.x=e,this.y=t}Math.imul||(g=A),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):n<63?A(this,e,t):n<1024?m(this,e,t):v(this,e,t)},y.prototype.makeRBT=function(e){for(var t=new Array(e),n=i.prototype._countBits(e)-1,r=0;r>=1;return r},y.prototype.permute=function(e,t,n,r,o,i){for(var a=0;a>>=1)o++;return 1<>>=13,n[2*a+1]=8191&i,i>>>=13;for(a=2*t;a>=26,n+=i/67108864|0,n+=a>>>26,this.words[o]=67108863&a}return 0!==n&&(this.words[o]=n,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>o&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r=0);var t,n=e%26,o=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<a)for(this.length-=a,u=0;u=0&&(0!==d||u>=o);u--){var l=0|this.words[u];this.words[u]=d<<26-i|l>>>i,d=l&s}return c&&0!==d&&(c.words[c.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,o=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var o=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[o+n]=67108863&i}for(;o>26,this.words[o+n]=67108863&i;if(0===s)return this._strip();for(r(-1===s),s=0,o=0;o>26,this.words[o]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!==(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,c=r.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;l--){var f=67108864*(0|r.words[o.length+l])+(0|r.words[o.length+l-1]);for(f=Math.min(f/a|0,67108863),r._ishlnsubmul(o,f,l);0!==r.negative;)f--,r.negative=0,r._ishlnsubmul(o,1,l),r.isZero()||(r.negative^=1);s&&(s.words[l]=f)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),o=e.andln(1),i=n.cmp(r);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,o=0,i=this.length-1;i>=0;i--)o=(n*o+(0|this.words[i]))%e;return t?-o:o},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,o=this.length-1;o>=0;o--){var i=(0|this.words[o])+67108864*n;this.words[o]=i/e|0,n=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var d=n.clone(),l=t.clone();!t.isZero();){for(var f=0,h=1;0==(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(d),a.isub(l)),o.iushrn(1),a.iushrn(1);for(var p=0,A=1;0==(n.words[0]&A)&&p<26;++p,A<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(d),c.isub(l)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,d=1;0==(t.words[0]&d)&&u<26;++u,d<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var l=0,f=1;0==(n.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(n.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var o=t.cmp(n);if(o<0){var i=t;t=n,n=i}else if(0===o||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,o=1<>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:oe.length)return 1;if(this.length=0;n--){var r=0|this.words[n],o=0|e.words[n];if(r!==o){ro&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new C(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function I(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){I.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){I.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){I.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function B(){I.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function C(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){C.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}I.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},I.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},I.prototype.split=function(e,t){e.iushrn(this.n,0,t)},I.prototype.imulK=function(e){return e.imul(this.k)},o(w,I),w.prototype.split=function(e,t){for(var n=Math.min(e.length,9),r=0;r>>22,o=i}o>>>=22,e.words[r-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=o,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new E;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new B}return b[e]=t,t},C.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},C.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},C.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(d(e,e.umod(this.m)._forceRed(this)),e)},C.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},C.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},C.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},C.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},C.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},C.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},C.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},C.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},C.prototype.isqr=function(e){return this.imul(e,e.clone())},C.prototype.sqr=function(e){return this.mul(e,e)},C.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new i(2*d*d).toRed(this);0!==this.pow(d,u).cmp(c);)d.redIAdd(c);for(var l=this.pow(d,o),f=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var A=h,g=0;0!==A.cmp(s);g++)A=A.redSqr();r(g=0;r--){for(var u=t.words[r],d=c-1;d>=0;d--){var l=u>>d&1;o!==n[0]&&(o=this.sqr(o)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===r&&0===d)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}c=26}return o},C.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},C.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new k(e)},o(k,C),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(50)(e))},function(e,t,n){"use strict";function r(e){let t=0;for(const n of e){if(0!==n)break;t++}return e.slice(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedSecp256k1Signature=t.Secp256k1Signature=void 0;class o{constructor(e,t){if(e.length>32||0===e.length||0===e[0])throw new Error("Unsigned integer r must be encoded as unpadded big endian.");if(t.length>32||0===t.length||0===t[0])throw new Error("Unsigned integer s must be encoded as unpadded big endian.");this.data={r:e,s:t}}static fromFixedLength(e){if(64!==e.length)throw new Error(`Got invalid data length: ${e.length}. Expected 2x 32 bytes for the pair (r, s)`);return new o(r(e.slice(0,32)),r(e.slice(32,64)))}static fromDer(e){let t=0;if(48!==e[t++])throw new Error("Prefix 0x30 expected");const n=e[t++];if(e.length-t!==n)throw new Error("Data length mismatch detected");if(2!==e[t++])throw new Error("INTEGER tag expected");const i=e[t++];if(i>=128)throw new Error("Decoding length values above 127 not supported");const a=e.slice(t,t+i);t+=i;if(2!==e[t++])throw new Error("INTEGER tag expected");const s=e[t++];if(s>=128)throw new Error("Decoding length values above 127 not supported");const c=e.slice(t,t+s);return t+=s,new o(r(a),r(c))}r(e){if(void 0===e)return this.data.r;{const t=e-this.data.r.length;if(t<0)throw new Error("Length too small to hold parameter r");const n=new Uint8Array(t);return new Uint8Array([...n,...this.data.r])}}s(e){if(void 0===e)return this.data.s;{const t=e-this.data.s.length;if(t<0)throw new Error("Length too small to hold parameter s");const n=new Uint8Array(t);return new Uint8Array([...n,...this.data.s])}}toFixedLength(){return new Uint8Array([...this.r(32),...this.s(32)])}toDer(){const e=this.data.r[0]>=128?new Uint8Array([0,...this.data.r]):this.data.r,t=this.data.s[0]>=128?new Uint8Array([0,...this.data.s]):this.data.s,n=e.length,r=t.length,o=new Uint8Array([2,n,...e,2,r,...t]);return new Uint8Array([48,o.length,...o])}}t.Secp256k1Signature=o;class i extends o{constructor(e,t,n){if(super(e,t),!Number.isInteger(n))throw new Error("The recovery parameter must be an integer.");if(n<0||n>4)throw new Error("The recovery parameter must be one of 0, 1, 2, 3.");this.recovery=n}static fromFixedLength(e){if(65!==e.length)throw new Error(`Got invalid data length ${e.length}. Expected 32 + 32 + 1`);return new i(r(e.slice(0,32)),r(e.slice(32,64)),e[64])}toFixedLength(){return new Uint8Array([...this.r(32),...this.s(32),this.recovery])}}t.ExtendedSecp256k1Signature=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeCosmoshubPath=void 0;const r=n(20);t.makeCosmoshubPath=function(e){return[r.Slip10RawIndex.hardened(44),r.Slip10RawIndex.hardened(118),r.Slip10RawIndex.hardened(0),r.Slip10RawIndex.normal(0),r.Slip10RawIndex.normal(e)]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decrypt=t.encrypt=t.supportedAlgorithms=t.executeKdf=t.cosmjsSalt=void 0;const r=n(20),o=n(5);t.cosmjsSalt=(0,o.toAscii)("The CosmJS salt."),t.executeKdf=async function(e,n){switch(n.algorithm){case"argon2id":{const o=n.params;if(!(0,r.isArgon2idOptions)(o))throw new Error("Invalid format of argon2id params");return r.Argon2id.execute(e,t.cosmjsSalt,o)}default:throw new Error("Unsupported KDF algorithm")}},t.supportedAlgorithms={xchacha20poly1305Ietf:"xchacha20poly1305-ietf"},t.encrypt=async function(e,n,o){switch(o.algorithm){case t.supportedAlgorithms.xchacha20poly1305Ietf:{const t=r.Random.getBytes(r.xchacha20NonceLength);return new Uint8Array([...t,...await r.Xchacha20poly1305Ietf.encrypt(e,n,t)])}default:throw new Error(`Unsupported encryption algorithm: '${o.algorithm}'`)}},t.decrypt=async function(e,n,o){switch(o.algorithm){case t.supportedAlgorithms.xchacha20poly1305Ietf:{const t=e.slice(0,r.xchacha20NonceLength);return r.Xchacha20poly1305Ietf.decrypt(e.slice(r.xchacha20NonceLength),n,t)}default:throw new Error(`Unsupported encryption algorithm: '${o.algorithm}'`)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decrypt=t.encrypt=t.supportedAlgorithms=t.executeKdf=t.cosmjsSalt=void 0;const r=n(20),o=n(5);t.cosmjsSalt=(0,o.toAscii)("The CosmJS salt."),t.executeKdf=async function(e,n){switch(n.algorithm){case"argon2id":{const o=n.params;if(!(0,r.isArgon2idOptions)(o))throw new Error("Invalid format of argon2id params");return r.Argon2id.execute(e,t.cosmjsSalt,o)}default:throw new Error("Unsupported KDF algorithm")}},t.supportedAlgorithms={xchacha20poly1305Ietf:"xchacha20poly1305-ietf"},t.encrypt=async function(e,n,o){switch(o.algorithm){case t.supportedAlgorithms.xchacha20poly1305Ietf:{const t=r.Random.getBytes(r.xchacha20NonceLength);return new Uint8Array([...t,...await r.Xchacha20poly1305Ietf.encrypt(e,n,t)])}default:throw new Error(`Unsupported encryption algorithm: '${o.algorithm}'`)}},t.decrypt=async function(e,n,o){switch(o.algorithm){case t.supportedAlgorithms.xchacha20poly1305Ietf:{const t=e.slice(0,r.xchacha20NonceLength);return r.Xchacha20poly1305Ietf.decrypt(e.slice(r.xchacha20NonceLength),n,t)}default:throw new Error(`Unsupported encryption algorithm: '${o.algorithm}'`)}}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MsgClientImpl=t.MsgMultiSendResponse=t.MsgMultiSend=t.MsgSendResponse=t.MsgSend=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(10),s=n(206);t.protobufPackage="cosmos.bank.v1beta1";const c={fromAddress:"",toAddress:""};t.MsgSend={encode(e,t=i.default.Writer.create()){""!==e.fromAddress&&t.uint32(10).string(e.fromAddress),""!==e.toAddress&&t.uint32(18).string(e.toAddress);for(const n of e.amount)a.Coin.encode(n,t.uint32(26).fork()).ldelim();return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},c);for(o.amount=[];n.pos>>3){case 1:o.fromAddress=n.string();break;case 2:o.toAddress=n.string();break;case 3:o.amount.push(a.Coin.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},c);return n.fromAddress=void 0!==e.fromAddress&&null!==e.fromAddress?String(e.fromAddress):"",n.toAddress=void 0!==e.toAddress&&null!==e.toAddress?String(e.toAddress):"",n.amount=(null!==(t=e.amount)&&void 0!==t?t:[]).map(e=>a.Coin.fromJSON(e)),n},toJSON(e){const t={};return void 0!==e.fromAddress&&(t.fromAddress=e.fromAddress),void 0!==e.toAddress&&(t.toAddress=e.toAddress),e.amount?t.amount=e.amount.map(e=>e?a.Coin.toJSON(e):void 0):t.amount=[],t},fromPartial(e){var t,n,r;const o=Object.assign({},c);return o.fromAddress=null!==(t=e.fromAddress)&&void 0!==t?t:"",o.toAddress=null!==(n=e.toAddress)&&void 0!==n?n:"",o.amount=(null===(r=e.amount)||void 0===r?void 0:r.map(e=>a.Coin.fromPartial(e)))||[],o}};const u={};t.MsgSendResponse={encode:(e,t=i.default.Writer.create())=>t,decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},u);for(;n.posObject.assign({},u),toJSON:e=>({}),fromPartial:e=>Object.assign({},u)};const d={};t.MsgMultiSend={encode(e,t=i.default.Writer.create()){for(const n of e.inputs)s.Input.encode(n,t.uint32(10).fork()).ldelim();for(const n of e.outputs)s.Output.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},d);for(o.inputs=[],o.outputs=[];n.pos>>3){case 1:o.inputs.push(s.Input.decode(n,n.uint32()));break;case 2:o.outputs.push(s.Output.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o},fromJSON(e){var t,n;const r=Object.assign({},d);return r.inputs=(null!==(t=e.inputs)&&void 0!==t?t:[]).map(e=>s.Input.fromJSON(e)),r.outputs=(null!==(n=e.outputs)&&void 0!==n?n:[]).map(e=>s.Output.fromJSON(e)),r},toJSON(e){const t={};return e.inputs?t.inputs=e.inputs.map(e=>e?s.Input.toJSON(e):void 0):t.inputs=[],e.outputs?t.outputs=e.outputs.map(e=>e?s.Output.toJSON(e):void 0):t.outputs=[],t},fromPartial(e){var t,n;const r=Object.assign({},d);return r.inputs=(null===(t=e.inputs)||void 0===t?void 0:t.map(e=>s.Input.fromPartial(e)))||[],r.outputs=(null===(n=e.outputs)||void 0===n?void 0:n.map(e=>s.Output.fromPartial(e)))||[],r}};const l={};t.MsgMultiSendResponse={encode:(e,t=i.default.Writer.create())=>t,decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},l);for(;n.posObject.assign({},l),toJSON:e=>({}),fromPartial:e=>Object.assign({},l)};t.MsgClientImpl=class{constructor(e){this.rpc=e,this.Send=this.Send.bind(this),this.MultiSend=this.MultiSend.bind(this)}Send(e){const n=t.MsgSend.encode(e).finish();return this.rpc.request("cosmos.bank.v1beta1.Msg","Send",n).then(e=>t.MsgSendResponse.decode(new i.default.Reader(e)))}MultiSend(e){const n=t.MsgMultiSend.encode(e).finish();return this.rpc.request("cosmos.bank.v1beta1.Msg","MultiSend",n).then(e=>t.MsgMultiSendResponse.decode(new i.default.Reader(e)))}},i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=t.DenomUnit=t.Supply=t.Output=t.Input=t.SendEnabled=t.Params=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(10);t.protobufPackage="cosmos.bank.v1beta1";const s={defaultSendEnabled:!1};t.Params={encode(e,n=i.default.Writer.create()){for(const r of e.sendEnabled)t.SendEnabled.encode(r,n.uint32(10).fork()).ldelim();return!0===e.defaultSendEnabled&&n.uint32(16).bool(e.defaultSendEnabled),n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},s);for(a.sendEnabled=[];r.pos>>3){case 1:a.sendEnabled.push(t.SendEnabled.decode(r,r.uint32()));break;case 2:a.defaultSendEnabled=r.bool();break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},s);return r.sendEnabled=(null!==(n=e.sendEnabled)&&void 0!==n?n:[]).map(e=>t.SendEnabled.fromJSON(e)),r.defaultSendEnabled=void 0!==e.defaultSendEnabled&&null!==e.defaultSendEnabled&&Boolean(e.defaultSendEnabled),r},toJSON(e){const n={};return e.sendEnabled?n.sendEnabled=e.sendEnabled.map(e=>e?t.SendEnabled.toJSON(e):void 0):n.sendEnabled=[],void 0!==e.defaultSendEnabled&&(n.defaultSendEnabled=e.defaultSendEnabled),n},fromPartial(e){var n,r;const o=Object.assign({},s);return o.sendEnabled=(null===(n=e.sendEnabled)||void 0===n?void 0:n.map(e=>t.SendEnabled.fromPartial(e)))||[],o.defaultSendEnabled=null!==(r=e.defaultSendEnabled)&&void 0!==r&&r,o}};const c={denom:"",enabled:!1};t.SendEnabled={encode:(e,t=i.default.Writer.create())=>(""!==e.denom&&t.uint32(10).string(e.denom),!0===e.enabled&&t.uint32(16).bool(e.enabled),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},c);for(;n.pos>>3){case 1:o.denom=n.string();break;case 2:o.enabled=n.bool();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},c);return t.denom=void 0!==e.denom&&null!==e.denom?String(e.denom):"",t.enabled=void 0!==e.enabled&&null!==e.enabled&&Boolean(e.enabled),t},toJSON(e){const t={};return void 0!==e.denom&&(t.denom=e.denom),void 0!==e.enabled&&(t.enabled=e.enabled),t},fromPartial(e){var t,n;const r=Object.assign({},c);return r.denom=null!==(t=e.denom)&&void 0!==t?t:"",r.enabled=null!==(n=e.enabled)&&void 0!==n&&n,r}};const u={address:""};t.Input={encode(e,t=i.default.Writer.create()){""!==e.address&&t.uint32(10).string(e.address);for(const n of e.coins)a.Coin.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},u);for(o.coins=[];n.pos>>3){case 1:o.address=n.string();break;case 2:o.coins.push(a.Coin.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},u);return n.address=void 0!==e.address&&null!==e.address?String(e.address):"",n.coins=(null!==(t=e.coins)&&void 0!==t?t:[]).map(e=>a.Coin.fromJSON(e)),n},toJSON(e){const t={};return void 0!==e.address&&(t.address=e.address),e.coins?t.coins=e.coins.map(e=>e?a.Coin.toJSON(e):void 0):t.coins=[],t},fromPartial(e){var t,n;const r=Object.assign({},u);return r.address=null!==(t=e.address)&&void 0!==t?t:"",r.coins=(null===(n=e.coins)||void 0===n?void 0:n.map(e=>a.Coin.fromPartial(e)))||[],r}};const d={address:""};t.Output={encode(e,t=i.default.Writer.create()){""!==e.address&&t.uint32(10).string(e.address);for(const n of e.coins)a.Coin.encode(n,t.uint32(18).fork()).ldelim();return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},d);for(o.coins=[];n.pos>>3){case 1:o.address=n.string();break;case 2:o.coins.push(a.Coin.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},d);return n.address=void 0!==e.address&&null!==e.address?String(e.address):"",n.coins=(null!==(t=e.coins)&&void 0!==t?t:[]).map(e=>a.Coin.fromJSON(e)),n},toJSON(e){const t={};return void 0!==e.address&&(t.address=e.address),e.coins?t.coins=e.coins.map(e=>e?a.Coin.toJSON(e):void 0):t.coins=[],t},fromPartial(e){var t,n;const r=Object.assign({},d);return r.address=null!==(t=e.address)&&void 0!==t?t:"",r.coins=(null===(n=e.coins)||void 0===n?void 0:n.map(e=>a.Coin.fromPartial(e)))||[],r}};const l={};t.Supply={encode(e,t=i.default.Writer.create()){for(const n of e.total)a.Coin.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},l);for(o.total=[];n.pos>>3){case 1:o.total.push(a.Coin.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},l);return n.total=(null!==(t=e.total)&&void 0!==t?t:[]).map(e=>a.Coin.fromJSON(e)),n},toJSON(e){const t={};return e.total?t.total=e.total.map(e=>e?a.Coin.toJSON(e):void 0):t.total=[],t},fromPartial(e){var t;const n=Object.assign({},l);return n.total=(null===(t=e.total)||void 0===t?void 0:t.map(e=>a.Coin.fromPartial(e)))||[],n}};const f={denom:"",exponent:0,aliases:""};t.DenomUnit={encode(e,t=i.default.Writer.create()){""!==e.denom&&t.uint32(10).string(e.denom),0!==e.exponent&&t.uint32(16).uint32(e.exponent);for(const n of e.aliases)t.uint32(26).string(n);return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},f);for(o.aliases=[];n.pos>>3){case 1:o.denom=n.string();break;case 2:o.exponent=n.uint32();break;case 3:o.aliases.push(n.string());break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},f);return n.denom=void 0!==e.denom&&null!==e.denom?String(e.denom):"",n.exponent=void 0!==e.exponent&&null!==e.exponent?Number(e.exponent):0,n.aliases=(null!==(t=e.aliases)&&void 0!==t?t:[]).map(e=>String(e)),n},toJSON(e){const t={};return void 0!==e.denom&&(t.denom=e.denom),void 0!==e.exponent&&(t.exponent=e.exponent),e.aliases?t.aliases=e.aliases.map(e=>e):t.aliases=[],t},fromPartial(e){var t,n,r;const o=Object.assign({},f);return o.denom=null!==(t=e.denom)&&void 0!==t?t:"",o.exponent=null!==(n=e.exponent)&&void 0!==n?n:0,o.aliases=(null===(r=e.aliases)||void 0===r?void 0:r.map(e=>e))||[],o}};const h={description:"",base:"",display:"",name:"",symbol:""};t.Metadata={encode(e,n=i.default.Writer.create()){""!==e.description&&n.uint32(10).string(e.description);for(const r of e.denomUnits)t.DenomUnit.encode(r,n.uint32(18).fork()).ldelim();return""!==e.base&&n.uint32(26).string(e.base),""!==e.display&&n.uint32(34).string(e.display),""!==e.name&&n.uint32(42).string(e.name),""!==e.symbol&&n.uint32(50).string(e.symbol),n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},h);for(a.denomUnits=[];r.pos>>3){case 1:a.description=r.string();break;case 2:a.denomUnits.push(t.DenomUnit.decode(r,r.uint32()));break;case 3:a.base=r.string();break;case 4:a.display=r.string();break;case 5:a.name=r.string();break;case 6:a.symbol=r.string();break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},h);return r.description=void 0!==e.description&&null!==e.description?String(e.description):"",r.denomUnits=(null!==(n=e.denomUnits)&&void 0!==n?n:[]).map(e=>t.DenomUnit.fromJSON(e)),r.base=void 0!==e.base&&null!==e.base?String(e.base):"",r.display=void 0!==e.display&&null!==e.display?String(e.display):"",r.name=void 0!==e.name&&null!==e.name?String(e.name):"",r.symbol=void 0!==e.symbol&&null!==e.symbol?String(e.symbol):"",r},toJSON(e){const n={};return void 0!==e.description&&(n.description=e.description),e.denomUnits?n.denomUnits=e.denomUnits.map(e=>e?t.DenomUnit.toJSON(e):void 0):n.denomUnits=[],void 0!==e.base&&(n.base=e.base),void 0!==e.display&&(n.display=e.display),void 0!==e.name&&(n.name=e.name),void 0!==e.symbol&&(n.symbol=e.symbol),n},fromPartial(e){var n,r,o,i,a,s;const c=Object.assign({},h);return c.description=null!==(n=e.description)&&void 0!==n?n:"",c.denomUnits=(null===(r=e.denomUnits)||void 0===r?void 0:r.map(e=>t.DenomUnit.fromPartial(e)))||[],c.base=null!==(o=e.base)&&void 0!==o?o:"",c.display=null!==(i=e.display)&&void 0!==i?i:"",c.name=null!==(a=e.name)&&void 0!==a?a:"",c.symbol=null!==(s=e.symbol)&&void 0!==s?s:"",c}},i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.QueryClient=t.decodeCosmosSdkDecFromProto=t.createProtobufRpcClient=t.createPagination=t.makeMultisignedTx=t.createStakingAminoConverters=t.createIbcAminoConverters=t.createGovAminoConverters=t.createFreegrantAminoConverters=t.createDistributionAminoConverters=t.createBankAminoConverters=t.createAuthzAminoConverters=t.setupTxExtension=t.setupStakingExtension=t.setupMintExtension=t.setupIbcExtension=t.setupGovExtension=t.setupDistributionExtension=t.setupBankExtension=t.setupAuthExtension=t.isMsgWithdrawDelegatorRewardEncodeObject=t.isMsgVoteEncodeObject=t.isMsgUndelegateEncodeObject=t.isMsgTransferEncodeObject=t.isMsgSubmitProposalEncodeObject=t.isMsgSendEncodeObject=t.isMsgDepositEncodeObject=t.isMsgDelegateEncodeObject=t.isAminoMsgWithdrawValidatorCommission=t.isAminoMsgWithdrawDelegatorReward=t.isAminoMsgVote=t.isAminoMsgVerifyInvariant=t.isAminoMsgUnjail=t.isAminoMsgUndelegate=t.isAminoMsgSubmitProposal=t.isAminoMsgSubmitEvidence=t.isAminoMsgSetWithdrawAddress=t.isAminoMsgSend=t.isAminoMsgMultiSend=t.isAminoMsgFundCommunityPool=t.isAminoMsgEditValidator=t.isAminoMsgDeposit=t.isAminoMsgDelegate=t.isAminoMsgCreateValidator=t.isAminoMsgBeginRedelegate=t.logs=t.GasPrice=t.calculateFee=t.AminoTypes=t.accountFromAny=void 0,t.parseCoins=t.makeCosmoshubPath=t.coins=t.coin=t.TimeoutError=t.StargateClient=t.isDeliverTxSuccess=t.isDeliverTxFailure=t.assertIsDeliverTxSuccess=t.assertIsDeliverTxFailure=t.SigningStargateClient=t.defaultRegistryTypes=t.isSearchByTagsQuery=t.isSearchBySentFromOrToQuery=t.isSearchByHeightQuery=void 0;var a=n(208);Object.defineProperty(t,"accountFromAny",{enumerable:!0,get:function(){return a.accountFromAny}});var s=n(209);Object.defineProperty(t,"AminoTypes",{enumerable:!0,get:function(){return s.AminoTypes}});var c=n(210);Object.defineProperty(t,"calculateFee",{enumerable:!0,get:function(){return c.calculateFee}}),Object.defineProperty(t,"GasPrice",{enumerable:!0,get:function(){return c.GasPrice}}),t.logs=i(n(475));var u=n(54);Object.defineProperty(t,"isAminoMsgBeginRedelegate",{enumerable:!0,get:function(){return u.isAminoMsgBeginRedelegate}}),Object.defineProperty(t,"isAminoMsgCreateValidator",{enumerable:!0,get:function(){return u.isAminoMsgCreateValidator}}),Object.defineProperty(t,"isAminoMsgDelegate",{enumerable:!0,get:function(){return u.isAminoMsgDelegate}}),Object.defineProperty(t,"isAminoMsgDeposit",{enumerable:!0,get:function(){return u.isAminoMsgDeposit}}),Object.defineProperty(t,"isAminoMsgEditValidator",{enumerable:!0,get:function(){return u.isAminoMsgEditValidator}}),Object.defineProperty(t,"isAminoMsgFundCommunityPool",{enumerable:!0,get:function(){return u.isAminoMsgFundCommunityPool}}),Object.defineProperty(t,"isAminoMsgMultiSend",{enumerable:!0,get:function(){return u.isAminoMsgMultiSend}}),Object.defineProperty(t,"isAminoMsgSend",{enumerable:!0,get:function(){return u.isAminoMsgSend}}),Object.defineProperty(t,"isAminoMsgSetWithdrawAddress",{enumerable:!0,get:function(){return u.isAminoMsgSetWithdrawAddress}}),Object.defineProperty(t,"isAminoMsgSubmitEvidence",{enumerable:!0,get:function(){return u.isAminoMsgSubmitEvidence}}),Object.defineProperty(t,"isAminoMsgSubmitProposal",{enumerable:!0,get:function(){return u.isAminoMsgSubmitProposal}}),Object.defineProperty(t,"isAminoMsgUndelegate",{enumerable:!0,get:function(){return u.isAminoMsgUndelegate}}),Object.defineProperty(t,"isAminoMsgUnjail",{enumerable:!0,get:function(){return u.isAminoMsgUnjail}}),Object.defineProperty(t,"isAminoMsgVerifyInvariant",{enumerable:!0,get:function(){return u.isAminoMsgVerifyInvariant}}),Object.defineProperty(t,"isAminoMsgVote",{enumerable:!0,get:function(){return u.isAminoMsgVote}}),Object.defineProperty(t,"isAminoMsgWithdrawDelegatorReward",{enumerable:!0,get:function(){return u.isAminoMsgWithdrawDelegatorReward}}),Object.defineProperty(t,"isAminoMsgWithdrawValidatorCommission",{enumerable:!0,get:function(){return u.isAminoMsgWithdrawValidatorCommission}}),Object.defineProperty(t,"isMsgDelegateEncodeObject",{enumerable:!0,get:function(){return u.isMsgDelegateEncodeObject}}),Object.defineProperty(t,"isMsgDepositEncodeObject",{enumerable:!0,get:function(){return u.isMsgDepositEncodeObject}}),Object.defineProperty(t,"isMsgSendEncodeObject",{enumerable:!0,get:function(){return u.isMsgSendEncodeObject}}),Object.defineProperty(t,"isMsgSubmitProposalEncodeObject",{enumerable:!0,get:function(){return u.isMsgSubmitProposalEncodeObject}}),Object.defineProperty(t,"isMsgTransferEncodeObject",{enumerable:!0,get:function(){return u.isMsgTransferEncodeObject}}),Object.defineProperty(t,"isMsgUndelegateEncodeObject",{enumerable:!0,get:function(){return u.isMsgUndelegateEncodeObject}}),Object.defineProperty(t,"isMsgVoteEncodeObject",{enumerable:!0,get:function(){return u.isMsgVoteEncodeObject}}),Object.defineProperty(t,"isMsgWithdrawDelegatorRewardEncodeObject",{enumerable:!0,get:function(){return u.isMsgWithdrawDelegatorRewardEncodeObject}}),Object.defineProperty(t,"setupAuthExtension",{enumerable:!0,get:function(){return u.setupAuthExtension}}),Object.defineProperty(t,"setupBankExtension",{enumerable:!0,get:function(){return u.setupBankExtension}}),Object.defineProperty(t,"setupDistributionExtension",{enumerable:!0,get:function(){return u.setupDistributionExtension}}),Object.defineProperty(t,"setupGovExtension",{enumerable:!0,get:function(){return u.setupGovExtension}}),Object.defineProperty(t,"setupIbcExtension",{enumerable:!0,get:function(){return u.setupIbcExtension}}),Object.defineProperty(t,"setupMintExtension",{enumerable:!0,get:function(){return u.setupMintExtension}}),Object.defineProperty(t,"setupStakingExtension",{enumerable:!0,get:function(){return u.setupStakingExtension}}),Object.defineProperty(t,"setupTxExtension",{enumerable:!0,get:function(){return u.setupTxExtension}});var d=n(54);Object.defineProperty(t,"createAuthzAminoConverters",{enumerable:!0,get:function(){return d.createAuthzAminoConverters}}),Object.defineProperty(t,"createBankAminoConverters",{enumerable:!0,get:function(){return d.createBankAminoConverters}}),Object.defineProperty(t,"createDistributionAminoConverters",{enumerable:!0,get:function(){return d.createDistributionAminoConverters}}),Object.defineProperty(t,"createFreegrantAminoConverters",{enumerable:!0,get:function(){return d.createFreegrantAminoConverters}}),Object.defineProperty(t,"createGovAminoConverters",{enumerable:!0,get:function(){return d.createGovAminoConverters}}),Object.defineProperty(t,"createIbcAminoConverters",{enumerable:!0,get:function(){return d.createIbcAminoConverters}}),Object.defineProperty(t,"createStakingAminoConverters",{enumerable:!0,get:function(){return d.createStakingAminoConverters}});var l=n(557);Object.defineProperty(t,"makeMultisignedTx",{enumerable:!0,get:function(){return l.makeMultisignedTx}});var f=n(21);Object.defineProperty(t,"createPagination",{enumerable:!0,get:function(){return f.createPagination}}),Object.defineProperty(t,"createProtobufRpcClient",{enumerable:!0,get:function(){return f.createProtobufRpcClient}}),Object.defineProperty(t,"decodeCosmosSdkDecFromProto",{enumerable:!0,get:function(){return f.decodeCosmosSdkDecFromProto}}),Object.defineProperty(t,"QueryClient",{enumerable:!0,get:function(){return f.QueryClient}});var h=n(228);Object.defineProperty(t,"isSearchByHeightQuery",{enumerable:!0,get:function(){return h.isSearchByHeightQuery}}),Object.defineProperty(t,"isSearchBySentFromOrToQuery",{enumerable:!0,get:function(){return h.isSearchBySentFromOrToQuery}}),Object.defineProperty(t,"isSearchByTagsQuery",{enumerable:!0,get:function(){return h.isSearchByTagsQuery}});var p=n(558);Object.defineProperty(t,"defaultRegistryTypes",{enumerable:!0,get:function(){return p.defaultRegistryTypes}}),Object.defineProperty(t,"SigningStargateClient",{enumerable:!0,get:function(){return p.SigningStargateClient}});var A=n(248);Object.defineProperty(t,"assertIsDeliverTxFailure",{enumerable:!0,get:function(){return A.assertIsDeliverTxFailure}}),Object.defineProperty(t,"assertIsDeliverTxSuccess",{enumerable:!0,get:function(){return A.assertIsDeliverTxSuccess}}),Object.defineProperty(t,"isDeliverTxFailure",{enumerable:!0,get:function(){return A.isDeliverTxFailure}}),Object.defineProperty(t,"isDeliverTxSuccess",{enumerable:!0,get:function(){return A.isDeliverTxSuccess}}),Object.defineProperty(t,"StargateClient",{enumerable:!0,get:function(){return A.StargateClient}}),Object.defineProperty(t,"TimeoutError",{enumerable:!0,get:function(){return A.TimeoutError}});var g=n(34);Object.defineProperty(t,"coin",{enumerable:!0,get:function(){return g.coin}}),Object.defineProperty(t,"coins",{enumerable:!0,get:function(){return g.coins}}),Object.defineProperty(t,"makeCosmoshubPath",{enumerable:!0,get:function(){return g.makeCosmoshubPath}}),Object.defineProperty(t,"parseCoins",{enumerable:!0,get:function(){return g.parseCoins}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.accountFromAny=void 0;const r=n(11),o=n(34),i=n(12),a=n(106),s=n(474);function c(e){return r.Uint64.fromString(e.toString())}function u(e){const{address:t,pubKey:n,accountNumber:r,sequence:i}=e;return{address:t,pubkey:(0,o.decodePubkey)(n),accountNumber:c(r).toNumber(),sequence:c(i).toNumber()}}t.accountFromAny=function(e){var t,n,r,o,c,d,l;const{typeUrl:f,value:h}=e;switch(f){case"/cosmos.auth.v1beta1.BaseAccount":return u(a.BaseAccount.decode(h));case"/cosmos.auth.v1beta1.ModuleAccount":{const e=a.ModuleAccount.decode(h).baseAccount;return(0,i.assert)(e),u(e)}case"/cosmos.vesting.v1beta1.BaseVestingAccount":{const e=null===(t=s.BaseVestingAccount.decode(h))||void 0===t?void 0:t.baseAccount;return(0,i.assert)(e),u(e)}case"/cosmos.vesting.v1beta1.ContinuousVestingAccount":{const e=null===(r=null===(n=s.ContinuousVestingAccount.decode(h))||void 0===n?void 0:n.baseVestingAccount)||void 0===r?void 0:r.baseAccount;return(0,i.assert)(e),u(e)}case"/cosmos.vesting.v1beta1.DelayedVestingAccount":{const e=null===(c=null===(o=s.DelayedVestingAccount.decode(h))||void 0===o?void 0:o.baseVestingAccount)||void 0===c?void 0:c.baseAccount;return(0,i.assert)(e),u(e)}case"/cosmos.vesting.v1beta1.PeriodicVestingAccount":{const e=null===(l=null===(d=s.PeriodicVestingAccount.decode(h))||void 0===d?void 0:d.baseVestingAccount)||void 0===l?void 0:l.baseAccount;return(0,i.assert)(e),u(e)}default:throw new Error(`Unsupported type: '${f}'`)}}},function(e,t,n){"use strict";function r(e){return"string"!=typeof e[1]}Object.defineProperty(t,"__esModule",{value:!0}),t.AminoTypes=void 0;t.AminoTypes=class{constructor(e){this.register=e}toAmino({typeUrl:e,value:t}){const n=this.register[e];if("not_supported_by_chain"===n)throw new Error(`The message type '${e}' cannot be signed using the Amino JSON sign mode because this is not supported by chain.`);if(!n)throw new Error(`Type URL '${e}' does not exist in the Amino message type register. If you need support for this message type, you can pass in additional entries to the AminoTypes constructor. If you think this message type should be included by default, please open an issue at https://github.com/cosmos/cosmjs/issues.`);return{type:n.aminoType,value:n.toAmino(t)}}fromAmino({type:e,value:t}){const n=Object.entries(this.register).filter(r).filter(([t,{aminoType:n}])=>n===e);switch(n.length){case 0:throw new Error(`Amino type identifier '${e}' does not exist in the Amino message type register. If you need support for this message type, you can pass in additional entries to the AminoTypes constructor. If you think this message type should be included by default, please open an issue at https://github.com/cosmos/cosmjs/issues.`);case 1:{const[e,r]=n[0];return{typeUrl:e,value:r.fromAmino(t)}}default:throw new Error(`Multiple types are registered with Amino type identifier '${e}': '`+n.map(([e,t])=>e).sort().join("', '")+"'. Thus fromAmino cannot be performed.")}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateFee=t.GasPrice=void 0;const r=n(11),o=n(34);class i{constructor(e,t){this.amount=e,this.denom=t}static fromString(e){const t=e.match(/^([0-9.]+)([a-z][a-z0-9]*)$/i);if(!t)throw new Error("Invalid gas price string");const[n,o,a]=t;!function(e){if(e.length<3||e.length>128)throw new Error("Denom must be between 3 and 128 characters")}(a);const s=r.Decimal.fromUserInput(o,18);return new i(s,a)}toString(){return this.amount.toString()+this.denom}}t.GasPrice=i,t.calculateFee=function(e,t){const n="string"==typeof t?i.fromString(t):t,{denom:a,amount:s}=n,c=s.multiply(new r.Uint53(e)).ceil().toString();return{amount:(0,o.coins)(c,a),gas:e.toString()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ensureLeftNeighbor=t.ensureSpec=t.calculateExistenceRoot=t.verifyNonExistence=t.verifyExistence=t.smtSpec=t.tendermintSpec=t.iavlSpec=void 0;const r=n(70),o=n(482),i=n(212);function a(e,t,n,r,o){c(e,t);const a=s(e);(0,i.ensureBytesEqual)(a,n),(0,i.ensureBytesEqual)(r,e.key),(0,i.ensureBytesEqual)(o,e.value)}function s(e){if(!e.key||!e.value)throw new Error("Existence proof needs key and value set");if(!e.leaf)throw new Error("Existence proof must start with a leaf operation");const t=e.path||[];let n=(0,o.applyLeaf)(e.leaf,e.key,e.value);for(const e of t)n=(0,o.applyInner)(e,n);return n}function c(e,t){if(!e.leaf)throw new Error("Existence proof must start with a leaf operation");if(!t.leafSpec)throw new Error("Spec must include leafSpec");if(!t.innerSpec)throw new Error("Spec must include innerSpec");(0,i.ensureLeaf)(e.leaf,t.leafSpec);const n=e.path||[];if(t.minDepth&&n.lengtht.maxDepth)throw new Error("Too many inner nodes "+n.length);for(const e of n)(0,i.ensureInner)(e,t.leafSpec.prefix,t.innerSpec)}function u(e,t){const{minPrefix:n,maxPrefix:r,suffix:o}=p(e,0);for(const e of t)if(!h(e,n,r,o))throw new Error("Step not leftmost")}function d(e,t){const n=e.childOrder.length-1,{minPrefix:r,maxPrefix:o,suffix:i}=p(e,n);for(const e of t)if(!h(e,r,o,i))throw new Error("Step not leftmost")}function l(e,t,n){const r=[...t],o=[...n];let a=r.pop(),s=o.pop();for(;(0,i.bytesEqual)(a.prefix,s.prefix)&&(0,i.bytesEqual)(a.suffix,s.suffix);)a=r.pop(),s=o.pop();if(!function(e,t,n){const r=f(e,t);return f(e,n)===r+1}(e,a,s))throw new Error("Not left neightbor at first divergent step");d(e,r),u(e,o)}function f(e,t){for(let n=0;nn)&&(e.suffix||[]).length===r)}function p(e,t){const n=function(e,t){if(t<0||t>=e.length)throw new Error("Invalid branch: "+t);return e.findIndex(e=>e===t)}(e.childOrder,t),r=n*e.childSize;return{minPrefix:r+e.minPrefixLength,maxPrefix:r+e.maxPrefixLength,suffix:(e.childOrder.length-1-n)*e.childSize}}t.iavlSpec={leafSpec:{prefix:Uint8Array.from([0]),hash:r.ics23.HashOp.SHA256,prehashValue:r.ics23.HashOp.SHA256,prehashKey:r.ics23.HashOp.NO_HASH,length:r.ics23.LengthOp.VAR_PROTO},innerSpec:{childOrder:[0,1],minPrefixLength:4,maxPrefixLength:12,childSize:33,hash:r.ics23.HashOp.SHA256}},t.tendermintSpec={leafSpec:{prefix:Uint8Array.from([0]),hash:r.ics23.HashOp.SHA256,prehashValue:r.ics23.HashOp.SHA256,prehashKey:r.ics23.HashOp.NO_HASH,length:r.ics23.LengthOp.VAR_PROTO},innerSpec:{childOrder:[0,1],minPrefixLength:1,maxPrefixLength:1,childSize:32,hash:r.ics23.HashOp.SHA256}},t.smtSpec={leafSpec:{hash:r.ics23.HashOp.SHA256,prehashKey:r.ics23.HashOp.NO_HASH,prehashValue:r.ics23.HashOp.SHA256,length:r.ics23.LengthOp.NO_PREFIX,prefix:Uint8Array.from([0])},innerSpec:{childOrder:[0,1],childSize:32,minPrefixLength:1,maxPrefixLength:1,emptyChild:new Uint8Array(32),hash:r.ics23.HashOp.SHA256},maxDepth:256},t.verifyExistence=a,t.verifyNonExistence=function(e,t,n,r){let o,s;if(e.left&&(a(e.left,t,n,e.left.key,e.left.value),o=e.left.key),e.right&&(a(e.right,t,n,e.right.key,e.right.value),s=e.right.key),!o&&!s)throw new Error("neither left nor right proof defined");if(o&&(0,i.ensureBytesBefore)(o,r),s&&(0,i.ensureBytesBefore)(r,s),!t.innerSpec)throw new Error("no inner spec");o?s?l(t.innerSpec,e.left.path,e.right.path):d(t.innerSpec,e.left.path):u(t.innerSpec,e.right.path)},t.calculateExistenceRoot=s,t.ensureSpec=c,t.ensureLeftNeighbor=l},function(e,t,n){"use strict";function r(e,t){if(e.length!==t.length)throw new Error(`Different lengths ${e.length} vs ${t.length}`);for(let n=0;nt[r])return!1}return e.length(n.maxPrefixLength||0)+r)throw new Error(`Prefix too long: ${e.prefix.length} bytes`)},t.ensureBytesEqual=r,t.bytesEqual=function(e,t){if(e.length!==t.length)return!1;for(let n=0;n2?arguments[2]:{},i=r(t);o&&(i=a.call(i,Object.getOwnPropertySymbols(t)));for(var s=0;s=0&&"[object Function]"===r.call(e.callee)),n}},function(e,t,n){"use strict";var r=n(493);e.exports=Function.prototype.bind||r},function(e,t,n){"use strict";"undefined"!=typeof self?e.exports=self:"undefined"!=typeof window?e.exports=window:e.exports=Function("return this")()},function(e,t,n){"use strict";(function(t){var r=n(216);e.exports=function(){return"object"==typeof t&&t&&t.Math===Math&&t.Array===Array?t:r}}).call(this,n(3))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MsgClientImpl=t.MsgFundCommunityPoolResponse=t.MsgFundCommunityPool=t.MsgWithdrawValidatorCommissionResponse=t.MsgWithdrawValidatorCommission=t.MsgWithdrawDelegatorRewardResponse=t.MsgWithdrawDelegatorReward=t.MsgSetWithdrawAddressResponse=t.MsgSetWithdrawAddress=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(10);t.protobufPackage="cosmos.distribution.v1beta1";const s={delegatorAddress:"",withdrawAddress:""};t.MsgSetWithdrawAddress={encode:(e,t=i.default.Writer.create())=>(""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.withdrawAddress&&t.uint32(18).string(e.withdrawAddress),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},s);for(;n.pos>>3){case 1:o.delegatorAddress=n.string();break;case 2:o.withdrawAddress=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},s);return t.delegatorAddress=void 0!==e.delegatorAddress&&null!==e.delegatorAddress?String(e.delegatorAddress):"",t.withdrawAddress=void 0!==e.withdrawAddress&&null!==e.withdrawAddress?String(e.withdrawAddress):"",t},toJSON(e){const t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.withdrawAddress&&(t.withdrawAddress=e.withdrawAddress),t},fromPartial(e){var t,n;const r=Object.assign({},s);return r.delegatorAddress=null!==(t=e.delegatorAddress)&&void 0!==t?t:"",r.withdrawAddress=null!==(n=e.withdrawAddress)&&void 0!==n?n:"",r}};const c={};t.MsgSetWithdrawAddressResponse={encode:(e,t=i.default.Writer.create())=>t,decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},c);for(;n.posObject.assign({},c),toJSON:e=>({}),fromPartial:e=>Object.assign({},c)};const u={delegatorAddress:"",validatorAddress:""};t.MsgWithdrawDelegatorReward={encode:(e,t=i.default.Writer.create())=>(""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.validatorAddress&&t.uint32(18).string(e.validatorAddress),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},u);for(;n.pos>>3){case 1:o.delegatorAddress=n.string();break;case 2:o.validatorAddress=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},u);return t.delegatorAddress=void 0!==e.delegatorAddress&&null!==e.delegatorAddress?String(e.delegatorAddress):"",t.validatorAddress=void 0!==e.validatorAddress&&null!==e.validatorAddress?String(e.validatorAddress):"",t},toJSON(e){const t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){var t,n;const r=Object.assign({},u);return r.delegatorAddress=null!==(t=e.delegatorAddress)&&void 0!==t?t:"",r.validatorAddress=null!==(n=e.validatorAddress)&&void 0!==n?n:"",r}};const d={};t.MsgWithdrawDelegatorRewardResponse={encode:(e,t=i.default.Writer.create())=>t,decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},d);for(;n.posObject.assign({},d),toJSON:e=>({}),fromPartial:e=>Object.assign({},d)};const l={validatorAddress:""};t.MsgWithdrawValidatorCommission={encode:(e,t=i.default.Writer.create())=>(""!==e.validatorAddress&&t.uint32(10).string(e.validatorAddress),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},l);for(;n.pos>>3){case 1:o.validatorAddress=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},l);return t.validatorAddress=void 0!==e.validatorAddress&&null!==e.validatorAddress?String(e.validatorAddress):"",t},toJSON(e){const t={};return void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){var t;const n=Object.assign({},l);return n.validatorAddress=null!==(t=e.validatorAddress)&&void 0!==t?t:"",n}};const f={};t.MsgWithdrawValidatorCommissionResponse={encode:(e,t=i.default.Writer.create())=>t,decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},f);for(;n.posObject.assign({},f),toJSON:e=>({}),fromPartial:e=>Object.assign({},f)};const h={depositor:""};t.MsgFundCommunityPool={encode(e,t=i.default.Writer.create()){for(const n of e.amount)a.Coin.encode(n,t.uint32(10).fork()).ldelim();return""!==e.depositor&&t.uint32(18).string(e.depositor),t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},h);for(o.amount=[];n.pos>>3){case 1:o.amount.push(a.Coin.decode(n,n.uint32()));break;case 2:o.depositor=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},h);return n.amount=(null!==(t=e.amount)&&void 0!==t?t:[]).map(e=>a.Coin.fromJSON(e)),n.depositor=void 0!==e.depositor&&null!==e.depositor?String(e.depositor):"",n},toJSON(e){const t={};return e.amount?t.amount=e.amount.map(e=>e?a.Coin.toJSON(e):void 0):t.amount=[],void 0!==e.depositor&&(t.depositor=e.depositor),t},fromPartial(e){var t,n;const r=Object.assign({},h);return r.amount=(null===(t=e.amount)||void 0===t?void 0:t.map(e=>a.Coin.fromPartial(e)))||[],r.depositor=null!==(n=e.depositor)&&void 0!==n?n:"",r}};const p={};t.MsgFundCommunityPoolResponse={encode:(e,t=i.default.Writer.create())=>t,decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},p);for(;n.posObject.assign({},p),toJSON:e=>({}),fromPartial:e=>Object.assign({},p)};t.MsgClientImpl=class{constructor(e){this.rpc=e,this.SetWithdrawAddress=this.SetWithdrawAddress.bind(this),this.WithdrawDelegatorReward=this.WithdrawDelegatorReward.bind(this),this.WithdrawValidatorCommission=this.WithdrawValidatorCommission.bind(this),this.FundCommunityPool=this.FundCommunityPool.bind(this)}SetWithdrawAddress(e){const n=t.MsgSetWithdrawAddress.encode(e).finish();return this.rpc.request("cosmos.distribution.v1beta1.Msg","SetWithdrawAddress",n).then(e=>t.MsgSetWithdrawAddressResponse.decode(new i.default.Reader(e)))}WithdrawDelegatorReward(e){const n=t.MsgWithdrawDelegatorReward.encode(e).finish();return this.rpc.request("cosmos.distribution.v1beta1.Msg","WithdrawDelegatorReward",n).then(e=>t.MsgWithdrawDelegatorRewardResponse.decode(new i.default.Reader(e)))}WithdrawValidatorCommission(e){const n=t.MsgWithdrawValidatorCommission.encode(e).finish();return this.rpc.request("cosmos.distribution.v1beta1.Msg","WithdrawValidatorCommission",n).then(e=>t.MsgWithdrawValidatorCommissionResponse.decode(new i.default.Reader(e)))}FundCommunityPool(e){const n=t.MsgFundCommunityPool.encode(e).finish();return this.rpc.request("cosmos.distribution.v1beta1.Msg","FundCommunityPool",n).then(e=>t.MsgFundCommunityPoolResponse.decode(new i.default.Reader(e)))}},i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MsgClientImpl=t.MsgTransferResponse=t.MsgTransfer=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(10),s=n(28);t.protobufPackage="ibc.applications.transfer.v1";const c={sourcePort:"",sourceChannel:"",sender:"",receiver:"",timeoutTimestamp:o.default.UZERO};t.MsgTransfer={encode:(e,t=i.default.Writer.create())=>(""!==e.sourcePort&&t.uint32(10).string(e.sourcePort),""!==e.sourceChannel&&t.uint32(18).string(e.sourceChannel),void 0!==e.token&&a.Coin.encode(e.token,t.uint32(26).fork()).ldelim(),""!==e.sender&&t.uint32(34).string(e.sender),""!==e.receiver&&t.uint32(42).string(e.receiver),void 0!==e.timeoutHeight&&s.Height.encode(e.timeoutHeight,t.uint32(50).fork()).ldelim(),e.timeoutTimestamp.isZero()||t.uint32(56).uint64(e.timeoutTimestamp),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},c);for(;n.pos>>3){case 1:o.sourcePort=n.string();break;case 2:o.sourceChannel=n.string();break;case 3:o.token=a.Coin.decode(n,n.uint32());break;case 4:o.sender=n.string();break;case 5:o.receiver=n.string();break;case 6:o.timeoutHeight=s.Height.decode(n,n.uint32());break;case 7:o.timeoutTimestamp=n.uint64();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},c);return t.sourcePort=void 0!==e.sourcePort&&null!==e.sourcePort?String(e.sourcePort):"",t.sourceChannel=void 0!==e.sourceChannel&&null!==e.sourceChannel?String(e.sourceChannel):"",t.token=void 0!==e.token&&null!==e.token?a.Coin.fromJSON(e.token):void 0,t.sender=void 0!==e.sender&&null!==e.sender?String(e.sender):"",t.receiver=void 0!==e.receiver&&null!==e.receiver?String(e.receiver):"",t.timeoutHeight=void 0!==e.timeoutHeight&&null!==e.timeoutHeight?s.Height.fromJSON(e.timeoutHeight):void 0,t.timeoutTimestamp=void 0!==e.timeoutTimestamp&&null!==e.timeoutTimestamp?o.default.fromString(e.timeoutTimestamp):o.default.UZERO,t},toJSON(e){const t={};return void 0!==e.sourcePort&&(t.sourcePort=e.sourcePort),void 0!==e.sourceChannel&&(t.sourceChannel=e.sourceChannel),void 0!==e.token&&(t.token=e.token?a.Coin.toJSON(e.token):void 0),void 0!==e.sender&&(t.sender=e.sender),void 0!==e.receiver&&(t.receiver=e.receiver),void 0!==e.timeoutHeight&&(t.timeoutHeight=e.timeoutHeight?s.Height.toJSON(e.timeoutHeight):void 0),void 0!==e.timeoutTimestamp&&(t.timeoutTimestamp=(e.timeoutTimestamp||o.default.UZERO).toString()),t},fromPartial(e){var t,n,r,i;const u=Object.assign({},c);return u.sourcePort=null!==(t=e.sourcePort)&&void 0!==t?t:"",u.sourceChannel=null!==(n=e.sourceChannel)&&void 0!==n?n:"",u.token=void 0!==e.token&&null!==e.token?a.Coin.fromPartial(e.token):void 0,u.sender=null!==(r=e.sender)&&void 0!==r?r:"",u.receiver=null!==(i=e.receiver)&&void 0!==i?i:"",u.timeoutHeight=void 0!==e.timeoutHeight&&null!==e.timeoutHeight?s.Height.fromPartial(e.timeoutHeight):void 0,u.timeoutTimestamp=void 0!==e.timeoutTimestamp&&null!==e.timeoutTimestamp?o.default.fromValue(e.timeoutTimestamp):o.default.UZERO,u}};const u={};t.MsgTransferResponse={encode:(e,t=i.default.Writer.create())=>t,decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},u);for(;n.posObject.assign({},u),toJSON:e=>({}),fromPartial:e=>Object.assign({},u)};t.MsgClientImpl=class{constructor(e){this.rpc=e,this.Transfer=this.Transfer.bind(this)}Transfer(e){const n=t.MsgTransfer.encode(e).finish();return this.rpc.request("ibc.applications.transfer.v1.Msg","Transfer",n).then(e=>t.MsgTransferResponse.decode(new i.default.Reader(e)))}},i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Version=t.ConnectionPaths=t.ClientPaths=t.Counterparty=t.IdentifiedConnection=t.ConnectionEnd=t.stateToJSON=t.stateFromJSON=t.State=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(221);var s;function c(e){switch(e){case 0:case"STATE_UNINITIALIZED_UNSPECIFIED":return s.STATE_UNINITIALIZED_UNSPECIFIED;case 1:case"STATE_INIT":return s.STATE_INIT;case 2:case"STATE_TRYOPEN":return s.STATE_TRYOPEN;case 3:case"STATE_OPEN":return s.STATE_OPEN;case-1:case"UNRECOGNIZED":default:return s.UNRECOGNIZED}}function u(e){switch(e){case s.STATE_UNINITIALIZED_UNSPECIFIED:return"STATE_UNINITIALIZED_UNSPECIFIED";case s.STATE_INIT:return"STATE_INIT";case s.STATE_TRYOPEN:return"STATE_TRYOPEN";case s.STATE_OPEN:return"STATE_OPEN";default:return"UNKNOWN"}}t.protobufPackage="ibc.core.connection.v1",function(e){e[e.STATE_UNINITIALIZED_UNSPECIFIED=0]="STATE_UNINITIALIZED_UNSPECIFIED",e[e.STATE_INIT=1]="STATE_INIT",e[e.STATE_TRYOPEN=2]="STATE_TRYOPEN",e[e.STATE_OPEN=3]="STATE_OPEN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(s=t.State||(t.State={})),t.stateFromJSON=c,t.stateToJSON=u;const d={clientId:"",state:0,delayPeriod:o.default.UZERO};t.ConnectionEnd={encode(e,n=i.default.Writer.create()){""!==e.clientId&&n.uint32(10).string(e.clientId);for(const r of e.versions)t.Version.encode(r,n.uint32(18).fork()).ldelim();return 0!==e.state&&n.uint32(24).int32(e.state),void 0!==e.counterparty&&t.Counterparty.encode(e.counterparty,n.uint32(34).fork()).ldelim(),e.delayPeriod.isZero()||n.uint32(40).uint64(e.delayPeriod),n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},d);for(a.versions=[];r.pos>>3){case 1:a.clientId=r.string();break;case 2:a.versions.push(t.Version.decode(r,r.uint32()));break;case 3:a.state=r.int32();break;case 4:a.counterparty=t.Counterparty.decode(r,r.uint32());break;case 5:a.delayPeriod=r.uint64();break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},d);return r.clientId=void 0!==e.clientId&&null!==e.clientId?String(e.clientId):"",r.versions=(null!==(n=e.versions)&&void 0!==n?n:[]).map(e=>t.Version.fromJSON(e)),r.state=void 0!==e.state&&null!==e.state?c(e.state):0,r.counterparty=void 0!==e.counterparty&&null!==e.counterparty?t.Counterparty.fromJSON(e.counterparty):void 0,r.delayPeriod=void 0!==e.delayPeriod&&null!==e.delayPeriod?o.default.fromString(e.delayPeriod):o.default.UZERO,r},toJSON(e){const n={};return void 0!==e.clientId&&(n.clientId=e.clientId),e.versions?n.versions=e.versions.map(e=>e?t.Version.toJSON(e):void 0):n.versions=[],void 0!==e.state&&(n.state=u(e.state)),void 0!==e.counterparty&&(n.counterparty=e.counterparty?t.Counterparty.toJSON(e.counterparty):void 0),void 0!==e.delayPeriod&&(n.delayPeriod=(e.delayPeriod||o.default.UZERO).toString()),n},fromPartial(e){var n,r,i;const a=Object.assign({},d);return a.clientId=null!==(n=e.clientId)&&void 0!==n?n:"",a.versions=(null===(r=e.versions)||void 0===r?void 0:r.map(e=>t.Version.fromPartial(e)))||[],a.state=null!==(i=e.state)&&void 0!==i?i:0,a.counterparty=void 0!==e.counterparty&&null!==e.counterparty?t.Counterparty.fromPartial(e.counterparty):void 0,a.delayPeriod=void 0!==e.delayPeriod&&null!==e.delayPeriod?o.default.fromValue(e.delayPeriod):o.default.UZERO,a}};const l={id:"",clientId:"",state:0,delayPeriod:o.default.UZERO};t.IdentifiedConnection={encode(e,n=i.default.Writer.create()){""!==e.id&&n.uint32(10).string(e.id),""!==e.clientId&&n.uint32(18).string(e.clientId);for(const r of e.versions)t.Version.encode(r,n.uint32(26).fork()).ldelim();return 0!==e.state&&n.uint32(32).int32(e.state),void 0!==e.counterparty&&t.Counterparty.encode(e.counterparty,n.uint32(42).fork()).ldelim(),e.delayPeriod.isZero()||n.uint32(48).uint64(e.delayPeriod),n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},l);for(a.versions=[];r.pos>>3){case 1:a.id=r.string();break;case 2:a.clientId=r.string();break;case 3:a.versions.push(t.Version.decode(r,r.uint32()));break;case 4:a.state=r.int32();break;case 5:a.counterparty=t.Counterparty.decode(r,r.uint32());break;case 6:a.delayPeriod=r.uint64();break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},l);return r.id=void 0!==e.id&&null!==e.id?String(e.id):"",r.clientId=void 0!==e.clientId&&null!==e.clientId?String(e.clientId):"",r.versions=(null!==(n=e.versions)&&void 0!==n?n:[]).map(e=>t.Version.fromJSON(e)),r.state=void 0!==e.state&&null!==e.state?c(e.state):0,r.counterparty=void 0!==e.counterparty&&null!==e.counterparty?t.Counterparty.fromJSON(e.counterparty):void 0,r.delayPeriod=void 0!==e.delayPeriod&&null!==e.delayPeriod?o.default.fromString(e.delayPeriod):o.default.UZERO,r},toJSON(e){const n={};return void 0!==e.id&&(n.id=e.id),void 0!==e.clientId&&(n.clientId=e.clientId),e.versions?n.versions=e.versions.map(e=>e?t.Version.toJSON(e):void 0):n.versions=[],void 0!==e.state&&(n.state=u(e.state)),void 0!==e.counterparty&&(n.counterparty=e.counterparty?t.Counterparty.toJSON(e.counterparty):void 0),void 0!==e.delayPeriod&&(n.delayPeriod=(e.delayPeriod||o.default.UZERO).toString()),n},fromPartial(e){var n,r,i,a;const s=Object.assign({},l);return s.id=null!==(n=e.id)&&void 0!==n?n:"",s.clientId=null!==(r=e.clientId)&&void 0!==r?r:"",s.versions=(null===(i=e.versions)||void 0===i?void 0:i.map(e=>t.Version.fromPartial(e)))||[],s.state=null!==(a=e.state)&&void 0!==a?a:0,s.counterparty=void 0!==e.counterparty&&null!==e.counterparty?t.Counterparty.fromPartial(e.counterparty):void 0,s.delayPeriod=void 0!==e.delayPeriod&&null!==e.delayPeriod?o.default.fromValue(e.delayPeriod):o.default.UZERO,s}};const f={clientId:"",connectionId:""};t.Counterparty={encode:(e,t=i.default.Writer.create())=>(""!==e.clientId&&t.uint32(10).string(e.clientId),""!==e.connectionId&&t.uint32(18).string(e.connectionId),void 0!==e.prefix&&a.MerklePrefix.encode(e.prefix,t.uint32(26).fork()).ldelim(),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},f);for(;n.pos>>3){case 1:o.clientId=n.string();break;case 2:o.connectionId=n.string();break;case 3:o.prefix=a.MerklePrefix.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},f);return t.clientId=void 0!==e.clientId&&null!==e.clientId?String(e.clientId):"",t.connectionId=void 0!==e.connectionId&&null!==e.connectionId?String(e.connectionId):"",t.prefix=void 0!==e.prefix&&null!==e.prefix?a.MerklePrefix.fromJSON(e.prefix):void 0,t},toJSON(e){const t={};return void 0!==e.clientId&&(t.clientId=e.clientId),void 0!==e.connectionId&&(t.connectionId=e.connectionId),void 0!==e.prefix&&(t.prefix=e.prefix?a.MerklePrefix.toJSON(e.prefix):void 0),t},fromPartial(e){var t,n;const r=Object.assign({},f);return r.clientId=null!==(t=e.clientId)&&void 0!==t?t:"",r.connectionId=null!==(n=e.connectionId)&&void 0!==n?n:"",r.prefix=void 0!==e.prefix&&null!==e.prefix?a.MerklePrefix.fromPartial(e.prefix):void 0,r}};const h={paths:""};t.ClientPaths={encode(e,t=i.default.Writer.create()){for(const n of e.paths)t.uint32(10).string(n);return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},h);for(o.paths=[];n.pos>>3){case 1:o.paths.push(n.string());break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},h);return n.paths=(null!==(t=e.paths)&&void 0!==t?t:[]).map(e=>String(e)),n},toJSON(e){const t={};return e.paths?t.paths=e.paths.map(e=>e):t.paths=[],t},fromPartial(e){var t;const n=Object.assign({},h);return n.paths=(null===(t=e.paths)||void 0===t?void 0:t.map(e=>e))||[],n}};const p={clientId:"",paths:""};t.ConnectionPaths={encode(e,t=i.default.Writer.create()){""!==e.clientId&&t.uint32(10).string(e.clientId);for(const n of e.paths)t.uint32(18).string(n);return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},p);for(o.paths=[];n.pos>>3){case 1:o.clientId=n.string();break;case 2:o.paths.push(n.string());break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},p);return n.clientId=void 0!==e.clientId&&null!==e.clientId?String(e.clientId):"",n.paths=(null!==(t=e.paths)&&void 0!==t?t:[]).map(e=>String(e)),n},toJSON(e){const t={};return void 0!==e.clientId&&(t.clientId=e.clientId),e.paths?t.paths=e.paths.map(e=>e):t.paths=[],t},fromPartial(e){var t,n;const r=Object.assign({},p);return r.clientId=null!==(t=e.clientId)&&void 0!==t?t:"",r.paths=(null===(n=e.paths)||void 0===n?void 0:n.map(e=>e))||[],r}};const A={identifier:"",features:""};t.Version={encode(e,t=i.default.Writer.create()){""!==e.identifier&&t.uint32(10).string(e.identifier);for(const n of e.features)t.uint32(18).string(n);return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},A);for(o.features=[];n.pos>>3){case 1:o.identifier=n.string();break;case 2:o.features.push(n.string());break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},A);return n.identifier=void 0!==e.identifier&&null!==e.identifier?String(e.identifier):"",n.features=(null!==(t=e.features)&&void 0!==t?t:[]).map(e=>String(e)),n},toJSON(e){const t={};return void 0!==e.identifier&&(t.identifier=e.identifier),e.features?t.features=e.features.map(e=>e):t.features=[],t},fromPartial(e){var t,n;const r=Object.assign({},A);return r.identifier=null!==(t=e.identifier)&&void 0!==t?t:"",r.features=(null===(n=e.features)||void 0===n?void 0:n.map(e=>e))||[],r}},i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())},function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MerkleProof=t.MerklePath=t.MerklePrefix=t.MerkleRoot=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(222);t.protobufPackage="ibc.core.commitment.v1";const s={};t.MerkleRoot={encode:(e,t=i.default.Writer.create())=>(0!==e.hash.length&&t.uint32(10).bytes(e.hash),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},s);for(o.hash=new Uint8Array;n.pos>>3){case 1:o.hash=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},s);return t.hash=void 0!==e.hash&&null!==e.hash?h(e.hash):new Uint8Array,t},toJSON(e){const t={};return void 0!==e.hash&&(t.hash=A(void 0!==e.hash?e.hash:new Uint8Array)),t},fromPartial(e){var t;const n=Object.assign({},s);return n.hash=null!==(t=e.hash)&&void 0!==t?t:new Uint8Array,n}};const c={};t.MerklePrefix={encode:(e,t=i.default.Writer.create())=>(0!==e.keyPrefix.length&&t.uint32(10).bytes(e.keyPrefix),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},c);for(o.keyPrefix=new Uint8Array;n.pos>>3){case 1:o.keyPrefix=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},c);return t.keyPrefix=void 0!==e.keyPrefix&&null!==e.keyPrefix?h(e.keyPrefix):new Uint8Array,t},toJSON(e){const t={};return void 0!==e.keyPrefix&&(t.keyPrefix=A(void 0!==e.keyPrefix?e.keyPrefix:new Uint8Array)),t},fromPartial(e){var t;const n=Object.assign({},c);return n.keyPrefix=null!==(t=e.keyPrefix)&&void 0!==t?t:new Uint8Array,n}};const u={keyPath:""};t.MerklePath={encode(e,t=i.default.Writer.create()){for(const n of e.keyPath)t.uint32(10).string(n);return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},u);for(o.keyPath=[];n.pos>>3){case 1:o.keyPath.push(n.string());break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},u);return n.keyPath=(null!==(t=e.keyPath)&&void 0!==t?t:[]).map(e=>String(e)),n},toJSON(e){const t={};return e.keyPath?t.keyPath=e.keyPath.map(e=>e):t.keyPath=[],t},fromPartial(e){var t;const n=Object.assign({},u);return n.keyPath=(null===(t=e.keyPath)||void 0===t?void 0:t.map(e=>e))||[],n}};const d={};t.MerkleProof={encode(e,t=i.default.Writer.create()){for(const n of e.proofs)a.CommitmentProof.encode(n,t.uint32(10).fork()).ldelim();return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},d);for(o.proofs=[];n.pos>>3){case 1:o.proofs.push(a.CommitmentProof.decode(n,n.uint32()));break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},d);return n.proofs=(null!==(t=e.proofs)&&void 0!==t?t:[]).map(e=>a.CommitmentProof.fromJSON(e)),n},toJSON(e){const t={};return e.proofs?t.proofs=e.proofs.map(e=>e?a.CommitmentProof.toJSON(e):void 0):t.proofs=[],t},fromPartial(e){var t;const n=Object.assign({},d);return n.proofs=(null===(t=e.proofs)||void 0===t?void 0:t.map(e=>a.CommitmentProof.fromPartial(e)))||[],n}};var l=(()=>{if(void 0!==l)return l;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw"Unable to locate global object"})();const f=l.atob||(e=>l.Buffer.from(e,"base64").toString("binary"));function h(e){const t=f(e),n=new Uint8Array(t.length);for(let e=0;el.Buffer.from(e,"binary").toString("base64"));function A(e){const t=[];for(const n of e)t.push(String.fromCharCode(n));return p(t.join(""))}i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())}).call(this,n(3))},function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompressedNonExistenceProof=t.CompressedExistenceProof=t.CompressedBatchEntry=t.CompressedBatchProof=t.BatchEntry=t.BatchProof=t.InnerSpec=t.ProofSpec=t.InnerOp=t.LeafOp=t.CommitmentProof=t.NonExistenceProof=t.ExistenceProof=t.lengthOpToJSON=t.lengthOpFromJSON=t.LengthOp=t.hashOpToJSON=t.hashOpFromJSON=t.HashOp=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1));var a,s;function c(e){switch(e){case 0:case"NO_HASH":return a.NO_HASH;case 1:case"SHA256":return a.SHA256;case 2:case"SHA512":return a.SHA512;case 3:case"KECCAK":return a.KECCAK;case 4:case"RIPEMD160":return a.RIPEMD160;case 5:case"BITCOIN":return a.BITCOIN;case-1:case"UNRECOGNIZED":default:return a.UNRECOGNIZED}}function u(e){switch(e){case a.NO_HASH:return"NO_HASH";case a.SHA256:return"SHA256";case a.SHA512:return"SHA512";case a.KECCAK:return"KECCAK";case a.RIPEMD160:return"RIPEMD160";case a.BITCOIN:return"BITCOIN";default:return"UNKNOWN"}}function d(e){switch(e){case 0:case"NO_PREFIX":return s.NO_PREFIX;case 1:case"VAR_PROTO":return s.VAR_PROTO;case 2:case"VAR_RLP":return s.VAR_RLP;case 3:case"FIXED32_BIG":return s.FIXED32_BIG;case 4:case"FIXED32_LITTLE":return s.FIXED32_LITTLE;case 5:case"FIXED64_BIG":return s.FIXED64_BIG;case 6:case"FIXED64_LITTLE":return s.FIXED64_LITTLE;case 7:case"REQUIRE_32_BYTES":return s.REQUIRE_32_BYTES;case 8:case"REQUIRE_64_BYTES":return s.REQUIRE_64_BYTES;case-1:case"UNRECOGNIZED":default:return s.UNRECOGNIZED}}function l(e){switch(e){case s.NO_PREFIX:return"NO_PREFIX";case s.VAR_PROTO:return"VAR_PROTO";case s.VAR_RLP:return"VAR_RLP";case s.FIXED32_BIG:return"FIXED32_BIG";case s.FIXED32_LITTLE:return"FIXED32_LITTLE";case s.FIXED64_BIG:return"FIXED64_BIG";case s.FIXED64_LITTLE:return"FIXED64_LITTLE";case s.REQUIRE_32_BYTES:return"REQUIRE_32_BYTES";case s.REQUIRE_64_BYTES:return"REQUIRE_64_BYTES";default:return"UNKNOWN"}}t.protobufPackage="ics23",function(e){e[e.NO_HASH=0]="NO_HASH",e[e.SHA256=1]="SHA256",e[e.SHA512=2]="SHA512",e[e.KECCAK=3]="KECCAK",e[e.RIPEMD160=4]="RIPEMD160",e[e.BITCOIN=5]="BITCOIN",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(a=t.HashOp||(t.HashOp={})),t.hashOpFromJSON=c,t.hashOpToJSON=u,function(e){e[e.NO_PREFIX=0]="NO_PREFIX",e[e.VAR_PROTO=1]="VAR_PROTO",e[e.VAR_RLP=2]="VAR_RLP",e[e.FIXED32_BIG=3]="FIXED32_BIG",e[e.FIXED32_LITTLE=4]="FIXED32_LITTLE",e[e.FIXED64_BIG=5]="FIXED64_BIG",e[e.FIXED64_LITTLE=6]="FIXED64_LITTLE",e[e.REQUIRE_32_BYTES=7]="REQUIRE_32_BYTES",e[e.REQUIRE_64_BYTES=8]="REQUIRE_64_BYTES",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(s=t.LengthOp||(t.LengthOp={})),t.lengthOpFromJSON=d,t.lengthOpToJSON=l;const f={};t.ExistenceProof={encode(e,n=i.default.Writer.create()){0!==e.key.length&&n.uint32(10).bytes(e.key),0!==e.value.length&&n.uint32(18).bytes(e.value),void 0!==e.leaf&&t.LeafOp.encode(e.leaf,n.uint32(26).fork()).ldelim();for(const r of e.path)t.InnerOp.encode(r,n.uint32(34).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},f);for(a.path=[],a.key=new Uint8Array,a.value=new Uint8Array;r.pos>>3){case 1:a.key=r.bytes();break;case 2:a.value=r.bytes();break;case 3:a.leaf=t.LeafOp.decode(r,r.uint32());break;case 4:a.path.push(t.InnerOp.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},f);return r.key=void 0!==e.key&&null!==e.key?k(e.key):new Uint8Array,r.value=void 0!==e.value&&null!==e.value?k(e.value):new Uint8Array,r.leaf=void 0!==e.leaf&&null!==e.leaf?t.LeafOp.fromJSON(e.leaf):void 0,r.path=(null!==(n=e.path)&&void 0!==n?n:[]).map(e=>t.InnerOp.fromJSON(e)),r},toJSON(e){const n={};return void 0!==e.key&&(n.key=O(void 0!==e.key?e.key:new Uint8Array)),void 0!==e.value&&(n.value=O(void 0!==e.value?e.value:new Uint8Array)),void 0!==e.leaf&&(n.leaf=e.leaf?t.LeafOp.toJSON(e.leaf):void 0),e.path?n.path=e.path.map(e=>e?t.InnerOp.toJSON(e):void 0):n.path=[],n},fromPartial(e){var n,r,o;const i=Object.assign({},f);return i.key=null!==(n=e.key)&&void 0!==n?n:new Uint8Array,i.value=null!==(r=e.value)&&void 0!==r?r:new Uint8Array,i.leaf=void 0!==e.leaf&&null!==e.leaf?t.LeafOp.fromPartial(e.leaf):void 0,i.path=(null===(o=e.path)||void 0===o?void 0:o.map(e=>t.InnerOp.fromPartial(e)))||[],i}};const h={};t.NonExistenceProof={encode:(e,n=i.default.Writer.create())=>(0!==e.key.length&&n.uint32(10).bytes(e.key),void 0!==e.left&&t.ExistenceProof.encode(e.left,n.uint32(18).fork()).ldelim(),void 0!==e.right&&t.ExistenceProof.encode(e.right,n.uint32(26).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},h);for(a.key=new Uint8Array;r.pos>>3){case 1:a.key=r.bytes();break;case 2:a.left=t.ExistenceProof.decode(r,r.uint32());break;case 3:a.right=t.ExistenceProof.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},h);return n.key=void 0!==e.key&&null!==e.key?k(e.key):new Uint8Array,n.left=void 0!==e.left&&null!==e.left?t.ExistenceProof.fromJSON(e.left):void 0,n.right=void 0!==e.right&&null!==e.right?t.ExistenceProof.fromJSON(e.right):void 0,n},toJSON(e){const n={};return void 0!==e.key&&(n.key=O(void 0!==e.key?e.key:new Uint8Array)),void 0!==e.left&&(n.left=e.left?t.ExistenceProof.toJSON(e.left):void 0),void 0!==e.right&&(n.right=e.right?t.ExistenceProof.toJSON(e.right):void 0),n},fromPartial(e){var n;const r=Object.assign({},h);return r.key=null!==(n=e.key)&&void 0!==n?n:new Uint8Array,r.left=void 0!==e.left&&null!==e.left?t.ExistenceProof.fromPartial(e.left):void 0,r.right=void 0!==e.right&&null!==e.right?t.ExistenceProof.fromPartial(e.right):void 0,r}};const p={};t.CommitmentProof={encode:(e,n=i.default.Writer.create())=>(void 0!==e.exist&&t.ExistenceProof.encode(e.exist,n.uint32(10).fork()).ldelim(),void 0!==e.nonexist&&t.NonExistenceProof.encode(e.nonexist,n.uint32(18).fork()).ldelim(),void 0!==e.batch&&t.BatchProof.encode(e.batch,n.uint32(26).fork()).ldelim(),void 0!==e.compressed&&t.CompressedBatchProof.encode(e.compressed,n.uint32(34).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},p);for(;r.pos>>3){case 1:a.exist=t.ExistenceProof.decode(r,r.uint32());break;case 2:a.nonexist=t.NonExistenceProof.decode(r,r.uint32());break;case 3:a.batch=t.BatchProof.decode(r,r.uint32());break;case 4:a.compressed=t.CompressedBatchProof.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},p);return n.exist=void 0!==e.exist&&null!==e.exist?t.ExistenceProof.fromJSON(e.exist):void 0,n.nonexist=void 0!==e.nonexist&&null!==e.nonexist?t.NonExistenceProof.fromJSON(e.nonexist):void 0,n.batch=void 0!==e.batch&&null!==e.batch?t.BatchProof.fromJSON(e.batch):void 0,n.compressed=void 0!==e.compressed&&null!==e.compressed?t.CompressedBatchProof.fromJSON(e.compressed):void 0,n},toJSON(e){const n={};return void 0!==e.exist&&(n.exist=e.exist?t.ExistenceProof.toJSON(e.exist):void 0),void 0!==e.nonexist&&(n.nonexist=e.nonexist?t.NonExistenceProof.toJSON(e.nonexist):void 0),void 0!==e.batch&&(n.batch=e.batch?t.BatchProof.toJSON(e.batch):void 0),void 0!==e.compressed&&(n.compressed=e.compressed?t.CompressedBatchProof.toJSON(e.compressed):void 0),n},fromPartial(e){const n=Object.assign({},p);return n.exist=void 0!==e.exist&&null!==e.exist?t.ExistenceProof.fromPartial(e.exist):void 0,n.nonexist=void 0!==e.nonexist&&null!==e.nonexist?t.NonExistenceProof.fromPartial(e.nonexist):void 0,n.batch=void 0!==e.batch&&null!==e.batch?t.BatchProof.fromPartial(e.batch):void 0,n.compressed=void 0!==e.compressed&&null!==e.compressed?t.CompressedBatchProof.fromPartial(e.compressed):void 0,n}};const A={hash:0,prehashKey:0,prehashValue:0,length:0};t.LeafOp={encode:(e,t=i.default.Writer.create())=>(0!==e.hash&&t.uint32(8).int32(e.hash),0!==e.prehashKey&&t.uint32(16).int32(e.prehashKey),0!==e.prehashValue&&t.uint32(24).int32(e.prehashValue),0!==e.length&&t.uint32(32).int32(e.length),0!==e.prefix.length&&t.uint32(42).bytes(e.prefix),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},A);for(o.prefix=new Uint8Array;n.pos>>3){case 1:o.hash=n.int32();break;case 2:o.prehashKey=n.int32();break;case 3:o.prehashValue=n.int32();break;case 4:o.length=n.int32();break;case 5:o.prefix=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},A);return t.hash=void 0!==e.hash&&null!==e.hash?c(e.hash):0,t.prehashKey=void 0!==e.prehashKey&&null!==e.prehashKey?c(e.prehashKey):0,t.prehashValue=void 0!==e.prehashValue&&null!==e.prehashValue?c(e.prehashValue):0,t.length=void 0!==e.length&&null!==e.length?d(e.length):0,t.prefix=void 0!==e.prefix&&null!==e.prefix?k(e.prefix):new Uint8Array,t},toJSON(e){const t={};return void 0!==e.hash&&(t.hash=u(e.hash)),void 0!==e.prehashKey&&(t.prehashKey=u(e.prehashKey)),void 0!==e.prehashValue&&(t.prehashValue=u(e.prehashValue)),void 0!==e.length&&(t.length=l(e.length)),void 0!==e.prefix&&(t.prefix=O(void 0!==e.prefix?e.prefix:new Uint8Array)),t},fromPartial(e){var t,n,r,o,i;const a=Object.assign({},A);return a.hash=null!==(t=e.hash)&&void 0!==t?t:0,a.prehashKey=null!==(n=e.prehashKey)&&void 0!==n?n:0,a.prehashValue=null!==(r=e.prehashValue)&&void 0!==r?r:0,a.length=null!==(o=e.length)&&void 0!==o?o:0,a.prefix=null!==(i=e.prefix)&&void 0!==i?i:new Uint8Array,a}};const g={hash:0};t.InnerOp={encode:(e,t=i.default.Writer.create())=>(0!==e.hash&&t.uint32(8).int32(e.hash),0!==e.prefix.length&&t.uint32(18).bytes(e.prefix),0!==e.suffix.length&&t.uint32(26).bytes(e.suffix),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},g);for(o.prefix=new Uint8Array,o.suffix=new Uint8Array;n.pos>>3){case 1:o.hash=n.int32();break;case 2:o.prefix=n.bytes();break;case 3:o.suffix=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},g);return t.hash=void 0!==e.hash&&null!==e.hash?c(e.hash):0,t.prefix=void 0!==e.prefix&&null!==e.prefix?k(e.prefix):new Uint8Array,t.suffix=void 0!==e.suffix&&null!==e.suffix?k(e.suffix):new Uint8Array,t},toJSON(e){const t={};return void 0!==e.hash&&(t.hash=u(e.hash)),void 0!==e.prefix&&(t.prefix=O(void 0!==e.prefix?e.prefix:new Uint8Array)),void 0!==e.suffix&&(t.suffix=O(void 0!==e.suffix?e.suffix:new Uint8Array)),t},fromPartial(e){var t,n,r;const o=Object.assign({},g);return o.hash=null!==(t=e.hash)&&void 0!==t?t:0,o.prefix=null!==(n=e.prefix)&&void 0!==n?n:new Uint8Array,o.suffix=null!==(r=e.suffix)&&void 0!==r?r:new Uint8Array,o}};const m={maxDepth:0,minDepth:0};t.ProofSpec={encode:(e,n=i.default.Writer.create())=>(void 0!==e.leafSpec&&t.LeafOp.encode(e.leafSpec,n.uint32(10).fork()).ldelim(),void 0!==e.innerSpec&&t.InnerSpec.encode(e.innerSpec,n.uint32(18).fork()).ldelim(),0!==e.maxDepth&&n.uint32(24).int32(e.maxDepth),0!==e.minDepth&&n.uint32(32).int32(e.minDepth),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},m);for(;r.pos>>3){case 1:a.leafSpec=t.LeafOp.decode(r,r.uint32());break;case 2:a.innerSpec=t.InnerSpec.decode(r,r.uint32());break;case 3:a.maxDepth=r.int32();break;case 4:a.minDepth=r.int32();break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},m);return n.leafSpec=void 0!==e.leafSpec&&null!==e.leafSpec?t.LeafOp.fromJSON(e.leafSpec):void 0,n.innerSpec=void 0!==e.innerSpec&&null!==e.innerSpec?t.InnerSpec.fromJSON(e.innerSpec):void 0,n.maxDepth=void 0!==e.maxDepth&&null!==e.maxDepth?Number(e.maxDepth):0,n.minDepth=void 0!==e.minDepth&&null!==e.minDepth?Number(e.minDepth):0,n},toJSON(e){const n={};return void 0!==e.leafSpec&&(n.leafSpec=e.leafSpec?t.LeafOp.toJSON(e.leafSpec):void 0),void 0!==e.innerSpec&&(n.innerSpec=e.innerSpec?t.InnerSpec.toJSON(e.innerSpec):void 0),void 0!==e.maxDepth&&(n.maxDepth=e.maxDepth),void 0!==e.minDepth&&(n.minDepth=e.minDepth),n},fromPartial(e){var n,r;const o=Object.assign({},m);return o.leafSpec=void 0!==e.leafSpec&&null!==e.leafSpec?t.LeafOp.fromPartial(e.leafSpec):void 0,o.innerSpec=void 0!==e.innerSpec&&null!==e.innerSpec?t.InnerSpec.fromPartial(e.innerSpec):void 0,o.maxDepth=null!==(n=e.maxDepth)&&void 0!==n?n:0,o.minDepth=null!==(r=e.minDepth)&&void 0!==r?r:0,o}};const v={childOrder:0,childSize:0,minPrefixLength:0,maxPrefixLength:0,hash:0};t.InnerSpec={encode(e,t=i.default.Writer.create()){t.uint32(10).fork();for(const n of e.childOrder)t.int32(n);return t.ldelim(),0!==e.childSize&&t.uint32(16).int32(e.childSize),0!==e.minPrefixLength&&t.uint32(24).int32(e.minPrefixLength),0!==e.maxPrefixLength&&t.uint32(32).int32(e.maxPrefixLength),0!==e.emptyChild.length&&t.uint32(42).bytes(e.emptyChild),0!==e.hash&&t.uint32(48).int32(e.hash),t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},v);for(o.childOrder=[],o.emptyChild=new Uint8Array;n.pos>>3){case 1:if(2==(7&e)){const e=n.uint32()+n.pos;for(;n.posNumber(e)),n.childSize=void 0!==e.childSize&&null!==e.childSize?Number(e.childSize):0,n.minPrefixLength=void 0!==e.minPrefixLength&&null!==e.minPrefixLength?Number(e.minPrefixLength):0,n.maxPrefixLength=void 0!==e.maxPrefixLength&&null!==e.maxPrefixLength?Number(e.maxPrefixLength):0,n.emptyChild=void 0!==e.emptyChild&&null!==e.emptyChild?k(e.emptyChild):new Uint8Array,n.hash=void 0!==e.hash&&null!==e.hash?c(e.hash):0,n},toJSON(e){const t={};return e.childOrder?t.childOrder=e.childOrder.map(e=>e):t.childOrder=[],void 0!==e.childSize&&(t.childSize=e.childSize),void 0!==e.minPrefixLength&&(t.minPrefixLength=e.minPrefixLength),void 0!==e.maxPrefixLength&&(t.maxPrefixLength=e.maxPrefixLength),void 0!==e.emptyChild&&(t.emptyChild=O(void 0!==e.emptyChild?e.emptyChild:new Uint8Array)),void 0!==e.hash&&(t.hash=u(e.hash)),t},fromPartial(e){var t,n,r,o,i,a;const s=Object.assign({},v);return s.childOrder=(null===(t=e.childOrder)||void 0===t?void 0:t.map(e=>e))||[],s.childSize=null!==(n=e.childSize)&&void 0!==n?n:0,s.minPrefixLength=null!==(r=e.minPrefixLength)&&void 0!==r?r:0,s.maxPrefixLength=null!==(o=e.maxPrefixLength)&&void 0!==o?o:0,s.emptyChild=null!==(i=e.emptyChild)&&void 0!==i?i:new Uint8Array,s.hash=null!==(a=e.hash)&&void 0!==a?a:0,s}};const y={};t.BatchProof={encode(e,n=i.default.Writer.create()){for(const r of e.entries)t.BatchEntry.encode(r,n.uint32(10).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},y);for(a.entries=[];r.pos>>3){case 1:a.entries.push(t.BatchEntry.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},y);return r.entries=(null!==(n=e.entries)&&void 0!==n?n:[]).map(e=>t.BatchEntry.fromJSON(e)),r},toJSON(e){const n={};return e.entries?n.entries=e.entries.map(e=>e?t.BatchEntry.toJSON(e):void 0):n.entries=[],n},fromPartial(e){var n;const r=Object.assign({},y);return r.entries=(null===(n=e.entries)||void 0===n?void 0:n.map(e=>t.BatchEntry.fromPartial(e)))||[],r}};const b={};t.BatchEntry={encode:(e,n=i.default.Writer.create())=>(void 0!==e.exist&&t.ExistenceProof.encode(e.exist,n.uint32(10).fork()).ldelim(),void 0!==e.nonexist&&t.NonExistenceProof.encode(e.nonexist,n.uint32(18).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},b);for(;r.pos>>3){case 1:a.exist=t.ExistenceProof.decode(r,r.uint32());break;case 2:a.nonexist=t.NonExistenceProof.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},b);return n.exist=void 0!==e.exist&&null!==e.exist?t.ExistenceProof.fromJSON(e.exist):void 0,n.nonexist=void 0!==e.nonexist&&null!==e.nonexist?t.NonExistenceProof.fromJSON(e.nonexist):void 0,n},toJSON(e){const n={};return void 0!==e.exist&&(n.exist=e.exist?t.ExistenceProof.toJSON(e.exist):void 0),void 0!==e.nonexist&&(n.nonexist=e.nonexist?t.NonExistenceProof.toJSON(e.nonexist):void 0),n},fromPartial(e){const n=Object.assign({},b);return n.exist=void 0!==e.exist&&null!==e.exist?t.ExistenceProof.fromPartial(e.exist):void 0,n.nonexist=void 0!==e.nonexist&&null!==e.nonexist?t.NonExistenceProof.fromPartial(e.nonexist):void 0,n}};const I={};t.CompressedBatchProof={encode(e,n=i.default.Writer.create()){for(const r of e.entries)t.CompressedBatchEntry.encode(r,n.uint32(10).fork()).ldelim();for(const r of e.lookupInners)t.InnerOp.encode(r,n.uint32(18).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},I);for(a.entries=[],a.lookupInners=[];r.pos>>3){case 1:a.entries.push(t.CompressedBatchEntry.decode(r,r.uint32()));break;case 2:a.lookupInners.push(t.InnerOp.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n,r;const o=Object.assign({},I);return o.entries=(null!==(n=e.entries)&&void 0!==n?n:[]).map(e=>t.CompressedBatchEntry.fromJSON(e)),o.lookupInners=(null!==(r=e.lookupInners)&&void 0!==r?r:[]).map(e=>t.InnerOp.fromJSON(e)),o},toJSON(e){const n={};return e.entries?n.entries=e.entries.map(e=>e?t.CompressedBatchEntry.toJSON(e):void 0):n.entries=[],e.lookupInners?n.lookupInners=e.lookupInners.map(e=>e?t.InnerOp.toJSON(e):void 0):n.lookupInners=[],n},fromPartial(e){var n,r;const o=Object.assign({},I);return o.entries=(null===(n=e.entries)||void 0===n?void 0:n.map(e=>t.CompressedBatchEntry.fromPartial(e)))||[],o.lookupInners=(null===(r=e.lookupInners)||void 0===r?void 0:r.map(e=>t.InnerOp.fromPartial(e)))||[],o}};const w={};t.CompressedBatchEntry={encode:(e,n=i.default.Writer.create())=>(void 0!==e.exist&&t.CompressedExistenceProof.encode(e.exist,n.uint32(10).fork()).ldelim(),void 0!==e.nonexist&&t.CompressedNonExistenceProof.encode(e.nonexist,n.uint32(18).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},w);for(;r.pos>>3){case 1:a.exist=t.CompressedExistenceProof.decode(r,r.uint32());break;case 2:a.nonexist=t.CompressedNonExistenceProof.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},w);return n.exist=void 0!==e.exist&&null!==e.exist?t.CompressedExistenceProof.fromJSON(e.exist):void 0,n.nonexist=void 0!==e.nonexist&&null!==e.nonexist?t.CompressedNonExistenceProof.fromJSON(e.nonexist):void 0,n},toJSON(e){const n={};return void 0!==e.exist&&(n.exist=e.exist?t.CompressedExistenceProof.toJSON(e.exist):void 0),void 0!==e.nonexist&&(n.nonexist=e.nonexist?t.CompressedNonExistenceProof.toJSON(e.nonexist):void 0),n},fromPartial(e){const n=Object.assign({},w);return n.exist=void 0!==e.exist&&null!==e.exist?t.CompressedExistenceProof.fromPartial(e.exist):void 0,n.nonexist=void 0!==e.nonexist&&null!==e.nonexist?t.CompressedNonExistenceProof.fromPartial(e.nonexist):void 0,n}};const E={path:0};t.CompressedExistenceProof={encode(e,n=i.default.Writer.create()){0!==e.key.length&&n.uint32(10).bytes(e.key),0!==e.value.length&&n.uint32(18).bytes(e.value),void 0!==e.leaf&&t.LeafOp.encode(e.leaf,n.uint32(26).fork()).ldelim(),n.uint32(34).fork();for(const t of e.path)n.int32(t);return n.ldelim(),n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},E);for(a.path=[],a.key=new Uint8Array,a.value=new Uint8Array;r.pos>>3){case 1:a.key=r.bytes();break;case 2:a.value=r.bytes();break;case 3:a.leaf=t.LeafOp.decode(r,r.uint32());break;case 4:if(2==(7&e)){const e=r.uint32()+r.pos;for(;r.posNumber(e)),r},toJSON(e){const n={};return void 0!==e.key&&(n.key=O(void 0!==e.key?e.key:new Uint8Array)),void 0!==e.value&&(n.value=O(void 0!==e.value?e.value:new Uint8Array)),void 0!==e.leaf&&(n.leaf=e.leaf?t.LeafOp.toJSON(e.leaf):void 0),e.path?n.path=e.path.map(e=>e):n.path=[],n},fromPartial(e){var n,r,o;const i=Object.assign({},E);return i.key=null!==(n=e.key)&&void 0!==n?n:new Uint8Array,i.value=null!==(r=e.value)&&void 0!==r?r:new Uint8Array,i.leaf=void 0!==e.leaf&&null!==e.leaf?t.LeafOp.fromPartial(e.leaf):void 0,i.path=(null===(o=e.path)||void 0===o?void 0:o.map(e=>e))||[],i}};const _={};t.CompressedNonExistenceProof={encode:(e,n=i.default.Writer.create())=>(0!==e.key.length&&n.uint32(10).bytes(e.key),void 0!==e.left&&t.CompressedExistenceProof.encode(e.left,n.uint32(18).fork()).ldelim(),void 0!==e.right&&t.CompressedExistenceProof.encode(e.right,n.uint32(26).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},_);for(a.key=new Uint8Array;r.pos>>3){case 1:a.key=r.bytes();break;case 2:a.left=t.CompressedExistenceProof.decode(r,r.uint32());break;case 3:a.right=t.CompressedExistenceProof.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},_);return n.key=void 0!==e.key&&null!==e.key?k(e.key):new Uint8Array,n.left=void 0!==e.left&&null!==e.left?t.CompressedExistenceProof.fromJSON(e.left):void 0,n.right=void 0!==e.right&&null!==e.right?t.CompressedExistenceProof.fromJSON(e.right):void 0,n},toJSON(e){const n={};return void 0!==e.key&&(n.key=O(void 0!==e.key?e.key:new Uint8Array)),void 0!==e.left&&(n.left=e.left?t.CompressedExistenceProof.toJSON(e.left):void 0),void 0!==e.right&&(n.right=e.right?t.CompressedExistenceProof.toJSON(e.right):void 0),n},fromPartial(e){var n;const r=Object.assign({},_);return r.key=null!==(n=e.key)&&void 0!==n?n:new Uint8Array,r.left=void 0!==e.left&&null!==e.left?t.CompressedExistenceProof.fromPartial(e.left):void 0,r.right=void 0!==e.right&&null!==e.right?t.CompressedExistenceProof.fromPartial(e.right):void 0,r}};var B=(()=>{if(void 0!==B)return B;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw"Unable to locate global object"})();const C=B.atob||(e=>B.Buffer.from(e,"base64").toString("binary"));function k(e){const t=C(e),n=new Uint8Array(t.length);for(let e=0;eB.Buffer.from(e,"binary").toString("base64"));function O(e){const t=[];for(const n of e)t.push(String.fromCharCode(n));return S(t.join(""))}i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())}).call(this,n(3))},function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ProofOps=t.ProofOp=t.DominoOp=t.ValueOp=t.Proof=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1));t.protobufPackage="tendermint.crypto";const a={total:o.default.ZERO,index:o.default.ZERO};t.Proof={encode(e,t=i.default.Writer.create()){e.total.isZero()||t.uint32(8).int64(e.total),e.index.isZero()||t.uint32(16).int64(e.index),0!==e.leafHash.length&&t.uint32(26).bytes(e.leafHash);for(const n of e.aunts)t.uint32(34).bytes(n);return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},a);for(o.aunts=[],o.leafHash=new Uint8Array;n.pos>>3){case 1:o.total=n.int64();break;case 2:o.index=n.int64();break;case 3:o.leafHash=n.bytes();break;case 4:o.aunts.push(n.bytes());break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},a);return n.total=void 0!==e.total&&null!==e.total?o.default.fromString(e.total):o.default.ZERO,n.index=void 0!==e.index&&null!==e.index?o.default.fromString(e.index):o.default.ZERO,n.leafHash=void 0!==e.leafHash&&null!==e.leafHash?h(e.leafHash):new Uint8Array,n.aunts=(null!==(t=e.aunts)&&void 0!==t?t:[]).map(e=>h(e)),n},toJSON(e){const t={};return void 0!==e.total&&(t.total=(e.total||o.default.ZERO).toString()),void 0!==e.index&&(t.index=(e.index||o.default.ZERO).toString()),void 0!==e.leafHash&&(t.leafHash=A(void 0!==e.leafHash?e.leafHash:new Uint8Array)),e.aunts?t.aunts=e.aunts.map(e=>A(void 0!==e?e:new Uint8Array)):t.aunts=[],t},fromPartial(e){var t,n;const r=Object.assign({},a);return r.total=void 0!==e.total&&null!==e.total?o.default.fromValue(e.total):o.default.ZERO,r.index=void 0!==e.index&&null!==e.index?o.default.fromValue(e.index):o.default.ZERO,r.leafHash=null!==(t=e.leafHash)&&void 0!==t?t:new Uint8Array,r.aunts=(null===(n=e.aunts)||void 0===n?void 0:n.map(e=>e))||[],r}};const s={};t.ValueOp={encode:(e,n=i.default.Writer.create())=>(0!==e.key.length&&n.uint32(10).bytes(e.key),void 0!==e.proof&&t.Proof.encode(e.proof,n.uint32(18).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},s);for(a.key=new Uint8Array;r.pos>>3){case 1:a.key=r.bytes();break;case 2:a.proof=t.Proof.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},s);return n.key=void 0!==e.key&&null!==e.key?h(e.key):new Uint8Array,n.proof=void 0!==e.proof&&null!==e.proof?t.Proof.fromJSON(e.proof):void 0,n},toJSON(e){const n={};return void 0!==e.key&&(n.key=A(void 0!==e.key?e.key:new Uint8Array)),void 0!==e.proof&&(n.proof=e.proof?t.Proof.toJSON(e.proof):void 0),n},fromPartial(e){var n;const r=Object.assign({},s);return r.key=null!==(n=e.key)&&void 0!==n?n:new Uint8Array,r.proof=void 0!==e.proof&&null!==e.proof?t.Proof.fromPartial(e.proof):void 0,r}};const c={key:"",input:"",output:""};t.DominoOp={encode:(e,t=i.default.Writer.create())=>(""!==e.key&&t.uint32(10).string(e.key),""!==e.input&&t.uint32(18).string(e.input),""!==e.output&&t.uint32(26).string(e.output),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},c);for(;n.pos>>3){case 1:o.key=n.string();break;case 2:o.input=n.string();break;case 3:o.output=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},c);return t.key=void 0!==e.key&&null!==e.key?String(e.key):"",t.input=void 0!==e.input&&null!==e.input?String(e.input):"",t.output=void 0!==e.output&&null!==e.output?String(e.output):"",t},toJSON(e){const t={};return void 0!==e.key&&(t.key=e.key),void 0!==e.input&&(t.input=e.input),void 0!==e.output&&(t.output=e.output),t},fromPartial(e){var t,n,r;const o=Object.assign({},c);return o.key=null!==(t=e.key)&&void 0!==t?t:"",o.input=null!==(n=e.input)&&void 0!==n?n:"",o.output=null!==(r=e.output)&&void 0!==r?r:"",o}};const u={type:""};t.ProofOp={encode:(e,t=i.default.Writer.create())=>(""!==e.type&&t.uint32(10).string(e.type),0!==e.key.length&&t.uint32(18).bytes(e.key),0!==e.data.length&&t.uint32(26).bytes(e.data),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},u);for(o.key=new Uint8Array,o.data=new Uint8Array;n.pos>>3){case 1:o.type=n.string();break;case 2:o.key=n.bytes();break;case 3:o.data=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},u);return t.type=void 0!==e.type&&null!==e.type?String(e.type):"",t.key=void 0!==e.key&&null!==e.key?h(e.key):new Uint8Array,t.data=void 0!==e.data&&null!==e.data?h(e.data):new Uint8Array,t},toJSON(e){const t={};return void 0!==e.type&&(t.type=e.type),void 0!==e.key&&(t.key=A(void 0!==e.key?e.key:new Uint8Array)),void 0!==e.data&&(t.data=A(void 0!==e.data?e.data:new Uint8Array)),t},fromPartial(e){var t,n,r;const o=Object.assign({},u);return o.type=null!==(t=e.type)&&void 0!==t?t:"",o.key=null!==(n=e.key)&&void 0!==n?n:new Uint8Array,o.data=null!==(r=e.data)&&void 0!==r?r:new Uint8Array,o}};const d={};t.ProofOps={encode(e,n=i.default.Writer.create()){for(const r of e.ops)t.ProofOp.encode(r,n.uint32(10).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},d);for(a.ops=[];r.pos>>3){case 1:a.ops.push(t.ProofOp.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},d);return r.ops=(null!==(n=e.ops)&&void 0!==n?n:[]).map(e=>t.ProofOp.fromJSON(e)),r},toJSON(e){const n={};return e.ops?n.ops=e.ops.map(e=>e?t.ProofOp.toJSON(e):void 0):n.ops=[],n},fromPartial(e){var n;const r=Object.assign({},d);return r.ops=(null===(n=e.ops)||void 0===n?void 0:n.map(e=>t.ProofOp.fromPartial(e)))||[],r}};var l=(()=>{if(void 0!==l)return l;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw"Unable to locate global object"})();const f=l.atob||(e=>l.Buffer.from(e,"base64").toString("binary"));function h(e){const t=f(e),n=new Uint8Array(t.length);for(let e=0;el.Buffer.from(e,"binary").toString("base64"));function A(e){const t=[];for(const n of e)t.push(String.fromCharCode(n));return p(t.join(""))}i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())}).call(this,n(3))},function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SimpleValidator=t.Validator=t.ValidatorSet=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(225);t.protobufPackage="tendermint.types";const s={totalVotingPower:o.default.ZERO};t.ValidatorSet={encode(e,n=i.default.Writer.create()){for(const r of e.validators)t.Validator.encode(r,n.uint32(10).fork()).ldelim();return void 0!==e.proposer&&t.Validator.encode(e.proposer,n.uint32(18).fork()).ldelim(),e.totalVotingPower.isZero()||n.uint32(24).int64(e.totalVotingPower),n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},s);for(a.validators=[];r.pos>>3){case 1:a.validators.push(t.Validator.decode(r,r.uint32()));break;case 2:a.proposer=t.Validator.decode(r,r.uint32());break;case 3:a.totalVotingPower=r.int64();break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},s);return r.validators=(null!==(n=e.validators)&&void 0!==n?n:[]).map(e=>t.Validator.fromJSON(e)),r.proposer=void 0!==e.proposer&&null!==e.proposer?t.Validator.fromJSON(e.proposer):void 0,r.totalVotingPower=void 0!==e.totalVotingPower&&null!==e.totalVotingPower?o.default.fromString(e.totalVotingPower):o.default.ZERO,r},toJSON(e){const n={};return e.validators?n.validators=e.validators.map(e=>e?t.Validator.toJSON(e):void 0):n.validators=[],void 0!==e.proposer&&(n.proposer=e.proposer?t.Validator.toJSON(e.proposer):void 0),void 0!==e.totalVotingPower&&(n.totalVotingPower=(e.totalVotingPower||o.default.ZERO).toString()),n},fromPartial(e){var n;const r=Object.assign({},s);return r.validators=(null===(n=e.validators)||void 0===n?void 0:n.map(e=>t.Validator.fromPartial(e)))||[],r.proposer=void 0!==e.proposer&&null!==e.proposer?t.Validator.fromPartial(e.proposer):void 0,r.totalVotingPower=void 0!==e.totalVotingPower&&null!==e.totalVotingPower?o.default.fromValue(e.totalVotingPower):o.default.ZERO,r}};const c={votingPower:o.default.ZERO,proposerPriority:o.default.ZERO};t.Validator={encode:(e,t=i.default.Writer.create())=>(0!==e.address.length&&t.uint32(10).bytes(e.address),void 0!==e.pubKey&&a.PublicKey.encode(e.pubKey,t.uint32(18).fork()).ldelim(),e.votingPower.isZero()||t.uint32(24).int64(e.votingPower),e.proposerPriority.isZero()||t.uint32(32).int64(e.proposerPriority),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},c);for(o.address=new Uint8Array;n.pos>>3){case 1:o.address=n.bytes();break;case 2:o.pubKey=a.PublicKey.decode(n,n.uint32());break;case 3:o.votingPower=n.int64();break;case 4:o.proposerPriority=n.int64();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},c);return t.address=void 0!==e.address&&null!==e.address?function(e){const t=l(e),n=new Uint8Array(t.length);for(let e=0;e(void 0!==e.pubKey&&a.PublicKey.encode(e.pubKey,t.uint32(10).fork()).ldelim(),e.votingPower.isZero()||t.uint32(16).int64(e.votingPower),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},u);for(;n.pos>>3){case 1:o.pubKey=a.PublicKey.decode(n,n.uint32());break;case 2:o.votingPower=n.int64();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},u);return t.pubKey=void 0!==e.pubKey&&null!==e.pubKey?a.PublicKey.fromJSON(e.pubKey):void 0,t.votingPower=void 0!==e.votingPower&&null!==e.votingPower?o.default.fromString(e.votingPower):o.default.ZERO,t},toJSON(e){const t={};return void 0!==e.pubKey&&(t.pubKey=e.pubKey?a.PublicKey.toJSON(e.pubKey):void 0),void 0!==e.votingPower&&(t.votingPower=(e.votingPower||o.default.ZERO).toString()),t},fromPartial(e){const t=Object.assign({},u);return t.pubKey=void 0!==e.pubKey&&null!==e.pubKey?a.PublicKey.fromPartial(e.pubKey):void 0,t.votingPower=void 0!==e.votingPower&&null!==e.votingPower?o.default.fromValue(e.votingPower):o.default.ZERO,t}};var d=(()=>{if(void 0!==d)return d;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw"Unable to locate global object"})();const l=d.atob||(e=>d.Buffer.from(e,"base64").toString("binary"));const f=d.btoa||(e=>d.Buffer.from(e,"binary").toString("base64"));i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())}).call(this,n(3))},function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PublicKey=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1));t.protobufPackage="tendermint.crypto";const a={};t.PublicKey={encode:(e,t=i.default.Writer.create())=>(void 0!==e.ed25519&&t.uint32(10).bytes(e.ed25519),void 0!==e.secp256k1&&t.uint32(18).bytes(e.secp256k1),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},a);for(;n.pos>>3){case 1:o.ed25519=n.bytes();break;case 2:o.secp256k1=n.bytes();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},a);return t.ed25519=void 0!==e.ed25519&&null!==e.ed25519?u(e.ed25519):void 0,t.secp256k1=void 0!==e.secp256k1&&null!==e.secp256k1?u(e.secp256k1):void 0,t},toJSON(e){const t={};return void 0!==e.ed25519&&(t.ed25519=void 0!==e.ed25519?l(e.ed25519):void 0),void 0!==e.secp256k1&&(t.secp256k1=void 0!==e.secp256k1?l(e.secp256k1):void 0),t},fromPartial(e){var t,n;const r=Object.assign({},a);return r.ed25519=null!==(t=e.ed25519)&&void 0!==t?t:void 0,r.secp256k1=null!==(n=e.secp256k1)&&void 0!==n?n:void 0,r}};var s=(()=>{if(void 0!==s)return s;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw"Unable to locate global object"})();const c=s.atob||(e=>s.Buffer.from(e,"base64").toString("binary"));function u(e){const t=c(e),n=new Uint8Array(t.length);for(let e=0;es.Buffer.from(e,"binary").toString("base64"));function l(e){const t=[];for(const n of e)t.push(String.fromCharCode(n));return d(t.join(""))}i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())}).call(this,n(3))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MsgClientImpl=t.MsgUndelegateResponse=t.MsgUndelegate=t.MsgBeginRedelegateResponse=t.MsgBeginRedelegate=t.MsgDelegateResponse=t.MsgDelegate=t.MsgEditValidatorResponse=t.MsgEditValidator=t.MsgCreateValidatorResponse=t.MsgCreateValidator=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(227),s=n(9),c=n(10),u=n(27);t.protobufPackage="cosmos.staking.v1beta1";const d={minSelfDelegation:"",delegatorAddress:"",validatorAddress:""};t.MsgCreateValidator={encode:(e,t=i.default.Writer.create())=>(void 0!==e.description&&a.Description.encode(e.description,t.uint32(10).fork()).ldelim(),void 0!==e.commission&&a.CommissionRates.encode(e.commission,t.uint32(18).fork()).ldelim(),""!==e.minSelfDelegation&&t.uint32(26).string(e.minSelfDelegation),""!==e.delegatorAddress&&t.uint32(34).string(e.delegatorAddress),""!==e.validatorAddress&&t.uint32(42).string(e.validatorAddress),void 0!==e.pubkey&&s.Any.encode(e.pubkey,t.uint32(50).fork()).ldelim(),void 0!==e.value&&c.Coin.encode(e.value,t.uint32(58).fork()).ldelim(),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},d);for(;n.pos>>3){case 1:o.description=a.Description.decode(n,n.uint32());break;case 2:o.commission=a.CommissionRates.decode(n,n.uint32());break;case 3:o.minSelfDelegation=n.string();break;case 4:o.delegatorAddress=n.string();break;case 5:o.validatorAddress=n.string();break;case 6:o.pubkey=s.Any.decode(n,n.uint32());break;case 7:o.value=c.Coin.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},d);return t.description=void 0!==e.description&&null!==e.description?a.Description.fromJSON(e.description):void 0,t.commission=void 0!==e.commission&&null!==e.commission?a.CommissionRates.fromJSON(e.commission):void 0,t.minSelfDelegation=void 0!==e.minSelfDelegation&&null!==e.minSelfDelegation?String(e.minSelfDelegation):"",t.delegatorAddress=void 0!==e.delegatorAddress&&null!==e.delegatorAddress?String(e.delegatorAddress):"",t.validatorAddress=void 0!==e.validatorAddress&&null!==e.validatorAddress?String(e.validatorAddress):"",t.pubkey=void 0!==e.pubkey&&null!==e.pubkey?s.Any.fromJSON(e.pubkey):void 0,t.value=void 0!==e.value&&null!==e.value?c.Coin.fromJSON(e.value):void 0,t},toJSON(e){const t={};return void 0!==e.description&&(t.description=e.description?a.Description.toJSON(e.description):void 0),void 0!==e.commission&&(t.commission=e.commission?a.CommissionRates.toJSON(e.commission):void 0),void 0!==e.minSelfDelegation&&(t.minSelfDelegation=e.minSelfDelegation),void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),void 0!==e.pubkey&&(t.pubkey=e.pubkey?s.Any.toJSON(e.pubkey):void 0),void 0!==e.value&&(t.value=e.value?c.Coin.toJSON(e.value):void 0),t},fromPartial(e){var t,n,r;const o=Object.assign({},d);return o.description=void 0!==e.description&&null!==e.description?a.Description.fromPartial(e.description):void 0,o.commission=void 0!==e.commission&&null!==e.commission?a.CommissionRates.fromPartial(e.commission):void 0,o.minSelfDelegation=null!==(t=e.minSelfDelegation)&&void 0!==t?t:"",o.delegatorAddress=null!==(n=e.delegatorAddress)&&void 0!==n?n:"",o.validatorAddress=null!==(r=e.validatorAddress)&&void 0!==r?r:"",o.pubkey=void 0!==e.pubkey&&null!==e.pubkey?s.Any.fromPartial(e.pubkey):void 0,o.value=void 0!==e.value&&null!==e.value?c.Coin.fromPartial(e.value):void 0,o}};const l={};t.MsgCreateValidatorResponse={encode:(e,t=i.default.Writer.create())=>t,decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},l);for(;n.posObject.assign({},l),toJSON:e=>({}),fromPartial:e=>Object.assign({},l)};const f={validatorAddress:"",commissionRate:"",minSelfDelegation:""};t.MsgEditValidator={encode:(e,t=i.default.Writer.create())=>(void 0!==e.description&&a.Description.encode(e.description,t.uint32(10).fork()).ldelim(),""!==e.validatorAddress&&t.uint32(18).string(e.validatorAddress),""!==e.commissionRate&&t.uint32(26).string(e.commissionRate),""!==e.minSelfDelegation&&t.uint32(34).string(e.minSelfDelegation),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},f);for(;n.pos>>3){case 1:o.description=a.Description.decode(n,n.uint32());break;case 2:o.validatorAddress=n.string();break;case 3:o.commissionRate=n.string();break;case 4:o.minSelfDelegation=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},f);return t.description=void 0!==e.description&&null!==e.description?a.Description.fromJSON(e.description):void 0,t.validatorAddress=void 0!==e.validatorAddress&&null!==e.validatorAddress?String(e.validatorAddress):"",t.commissionRate=void 0!==e.commissionRate&&null!==e.commissionRate?String(e.commissionRate):"",t.minSelfDelegation=void 0!==e.minSelfDelegation&&null!==e.minSelfDelegation?String(e.minSelfDelegation):"",t},toJSON(e){const t={};return void 0!==e.description&&(t.description=e.description?a.Description.toJSON(e.description):void 0),void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),void 0!==e.commissionRate&&(t.commissionRate=e.commissionRate),void 0!==e.minSelfDelegation&&(t.minSelfDelegation=e.minSelfDelegation),t},fromPartial(e){var t,n,r;const o=Object.assign({},f);return o.description=void 0!==e.description&&null!==e.description?a.Description.fromPartial(e.description):void 0,o.validatorAddress=null!==(t=e.validatorAddress)&&void 0!==t?t:"",o.commissionRate=null!==(n=e.commissionRate)&&void 0!==n?n:"",o.minSelfDelegation=null!==(r=e.minSelfDelegation)&&void 0!==r?r:"",o}};const h={};t.MsgEditValidatorResponse={encode:(e,t=i.default.Writer.create())=>t,decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},h);for(;n.posObject.assign({},h),toJSON:e=>({}),fromPartial:e=>Object.assign({},h)};const p={delegatorAddress:"",validatorAddress:""};t.MsgDelegate={encode:(e,t=i.default.Writer.create())=>(""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.validatorAddress&&t.uint32(18).string(e.validatorAddress),void 0!==e.amount&&c.Coin.encode(e.amount,t.uint32(26).fork()).ldelim(),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},p);for(;n.pos>>3){case 1:o.delegatorAddress=n.string();break;case 2:o.validatorAddress=n.string();break;case 3:o.amount=c.Coin.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},p);return t.delegatorAddress=void 0!==e.delegatorAddress&&null!==e.delegatorAddress?String(e.delegatorAddress):"",t.validatorAddress=void 0!==e.validatorAddress&&null!==e.validatorAddress?String(e.validatorAddress):"",t.amount=void 0!==e.amount&&null!==e.amount?c.Coin.fromJSON(e.amount):void 0,t},toJSON(e){const t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),void 0!==e.amount&&(t.amount=e.amount?c.Coin.toJSON(e.amount):void 0),t},fromPartial(e){var t,n;const r=Object.assign({},p);return r.delegatorAddress=null!==(t=e.delegatorAddress)&&void 0!==t?t:"",r.validatorAddress=null!==(n=e.validatorAddress)&&void 0!==n?n:"",r.amount=void 0!==e.amount&&null!==e.amount?c.Coin.fromPartial(e.amount):void 0,r}};const A={};t.MsgDelegateResponse={encode:(e,t=i.default.Writer.create())=>t,decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},A);for(;n.posObject.assign({},A),toJSON:e=>({}),fromPartial:e=>Object.assign({},A)};const g={delegatorAddress:"",validatorSrcAddress:"",validatorDstAddress:""};t.MsgBeginRedelegate={encode:(e,t=i.default.Writer.create())=>(""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.validatorSrcAddress&&t.uint32(18).string(e.validatorSrcAddress),""!==e.validatorDstAddress&&t.uint32(26).string(e.validatorDstAddress),void 0!==e.amount&&c.Coin.encode(e.amount,t.uint32(34).fork()).ldelim(),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},g);for(;n.pos>>3){case 1:o.delegatorAddress=n.string();break;case 2:o.validatorSrcAddress=n.string();break;case 3:o.validatorDstAddress=n.string();break;case 4:o.amount=c.Coin.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},g);return t.delegatorAddress=void 0!==e.delegatorAddress&&null!==e.delegatorAddress?String(e.delegatorAddress):"",t.validatorSrcAddress=void 0!==e.validatorSrcAddress&&null!==e.validatorSrcAddress?String(e.validatorSrcAddress):"",t.validatorDstAddress=void 0!==e.validatorDstAddress&&null!==e.validatorDstAddress?String(e.validatorDstAddress):"",t.amount=void 0!==e.amount&&null!==e.amount?c.Coin.fromJSON(e.amount):void 0,t},toJSON(e){const t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorSrcAddress&&(t.validatorSrcAddress=e.validatorSrcAddress),void 0!==e.validatorDstAddress&&(t.validatorDstAddress=e.validatorDstAddress),void 0!==e.amount&&(t.amount=e.amount?c.Coin.toJSON(e.amount):void 0),t},fromPartial(e){var t,n,r;const o=Object.assign({},g);return o.delegatorAddress=null!==(t=e.delegatorAddress)&&void 0!==t?t:"",o.validatorSrcAddress=null!==(n=e.validatorSrcAddress)&&void 0!==n?n:"",o.validatorDstAddress=null!==(r=e.validatorDstAddress)&&void 0!==r?r:"",o.amount=void 0!==e.amount&&null!==e.amount?c.Coin.fromPartial(e.amount):void 0,o}};const m={};t.MsgBeginRedelegateResponse={encode:(e,t=i.default.Writer.create())=>(void 0!==e.completionTime&&u.Timestamp.encode(e.completionTime,t.uint32(10).fork()).ldelim(),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},m);for(;n.pos>>3){case 1:o.completionTime=u.Timestamp.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},m);return t.completionTime=void 0!==e.completionTime&&null!==e.completionTime?w(e.completionTime):void 0,t},toJSON(e){const t={};return void 0!==e.completionTime&&(t.completionTime=I(e.completionTime).toISOString()),t},fromPartial(e){const t=Object.assign({},m);return t.completionTime=void 0!==e.completionTime&&null!==e.completionTime?u.Timestamp.fromPartial(e.completionTime):void 0,t}};const v={delegatorAddress:"",validatorAddress:""};t.MsgUndelegate={encode:(e,t=i.default.Writer.create())=>(""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.validatorAddress&&t.uint32(18).string(e.validatorAddress),void 0!==e.amount&&c.Coin.encode(e.amount,t.uint32(26).fork()).ldelim(),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},v);for(;n.pos>>3){case 1:o.delegatorAddress=n.string();break;case 2:o.validatorAddress=n.string();break;case 3:o.amount=c.Coin.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},v);return t.delegatorAddress=void 0!==e.delegatorAddress&&null!==e.delegatorAddress?String(e.delegatorAddress):"",t.validatorAddress=void 0!==e.validatorAddress&&null!==e.validatorAddress?String(e.validatorAddress):"",t.amount=void 0!==e.amount&&null!==e.amount?c.Coin.fromJSON(e.amount):void 0,t},toJSON(e){const t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),void 0!==e.amount&&(t.amount=e.amount?c.Coin.toJSON(e.amount):void 0),t},fromPartial(e){var t,n;const r=Object.assign({},v);return r.delegatorAddress=null!==(t=e.delegatorAddress)&&void 0!==t?t:"",r.validatorAddress=null!==(n=e.validatorAddress)&&void 0!==n?n:"",r.amount=void 0!==e.amount&&null!==e.amount?c.Coin.fromPartial(e.amount):void 0,r}};const y={};t.MsgUndelegateResponse={encode:(e,t=i.default.Writer.create())=>(void 0!==e.completionTime&&u.Timestamp.encode(e.completionTime,t.uint32(10).fork()).ldelim(),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},y);for(;n.pos>>3){case 1:o.completionTime=u.Timestamp.decode(n,n.uint32());break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},y);return t.completionTime=void 0!==e.completionTime&&null!==e.completionTime?w(e.completionTime):void 0,t},toJSON(e){const t={};return void 0!==e.completionTime&&(t.completionTime=I(e.completionTime).toISOString()),t},fromPartial(e){const t=Object.assign({},y);return t.completionTime=void 0!==e.completionTime&&null!==e.completionTime?u.Timestamp.fromPartial(e.completionTime):void 0,t}};function b(e){var t;return{seconds:(t=e.getTime()/1e3,o.default.fromNumber(t)),nanos:e.getTime()%1e3*1e6}}function I(e){let t=1e3*e.seconds.toNumber();return t+=e.nanos/1e6,new Date(t)}function w(e){return e instanceof Date?b(e):"string"==typeof e?b(new Date(e)):u.Timestamp.fromJSON(e)}t.MsgClientImpl=class{constructor(e){this.rpc=e,this.CreateValidator=this.CreateValidator.bind(this),this.EditValidator=this.EditValidator.bind(this),this.Delegate=this.Delegate.bind(this),this.BeginRedelegate=this.BeginRedelegate.bind(this),this.Undelegate=this.Undelegate.bind(this)}CreateValidator(e){const n=t.MsgCreateValidator.encode(e).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","CreateValidator",n).then(e=>t.MsgCreateValidatorResponse.decode(new i.default.Reader(e)))}EditValidator(e){const n=t.MsgEditValidator.encode(e).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","EditValidator",n).then(e=>t.MsgEditValidatorResponse.decode(new i.default.Reader(e)))}Delegate(e){const n=t.MsgDelegate.encode(e).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","Delegate",n).then(e=>t.MsgDelegateResponse.decode(new i.default.Reader(e)))}BeginRedelegate(e){const n=t.MsgBeginRedelegate.encode(e).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","BeginRedelegate",n).then(e=>t.MsgBeginRedelegateResponse.decode(new i.default.Reader(e)))}Undelegate(e){const n=t.MsgUndelegate.encode(e).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","Undelegate",n).then(e=>t.MsgUndelegateResponse.decode(new i.default.Reader(e)))}},i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Pool=t.RedelegationResponse=t.RedelegationEntryResponse=t.DelegationResponse=t.Params=t.Redelegation=t.RedelegationEntry=t.UnbondingDelegationEntry=t.UnbondingDelegation=t.Delegation=t.DVVTriplets=t.DVVTriplet=t.DVPairs=t.DVPair=t.ValAddresses=t.Validator=t.Description=t.Commission=t.CommissionRates=t.HistoricalInfo=t.bondStatusToJSON=t.bondStatusFromJSON=t.BondStatus=t.protobufPackage=void 0;const o=r(n(0)),i=r(n(1)),a=n(109),s=n(27),c=n(9),u=n(55),d=n(10);var l;function f(e){switch(e){case 0:case"BOND_STATUS_UNSPECIFIED":return l.BOND_STATUS_UNSPECIFIED;case 1:case"BOND_STATUS_UNBONDED":return l.BOND_STATUS_UNBONDED;case 2:case"BOND_STATUS_UNBONDING":return l.BOND_STATUS_UNBONDING;case 3:case"BOND_STATUS_BONDED":return l.BOND_STATUS_BONDED;case-1:case"UNRECOGNIZED":default:return l.UNRECOGNIZED}}function h(e){switch(e){case l.BOND_STATUS_UNSPECIFIED:return"BOND_STATUS_UNSPECIFIED";case l.BOND_STATUS_UNBONDED:return"BOND_STATUS_UNBONDED";case l.BOND_STATUS_UNBONDING:return"BOND_STATUS_UNBONDING";case l.BOND_STATUS_BONDED:return"BOND_STATUS_BONDED";default:return"UNKNOWN"}}t.protobufPackage="cosmos.staking.v1beta1",function(e){e[e.BOND_STATUS_UNSPECIFIED=0]="BOND_STATUS_UNSPECIFIED",e[e.BOND_STATUS_UNBONDED=1]="BOND_STATUS_UNBONDED",e[e.BOND_STATUS_UNBONDING=2]="BOND_STATUS_UNBONDING",e[e.BOND_STATUS_BONDED=3]="BOND_STATUS_BONDED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"}(l=t.BondStatus||(t.BondStatus={})),t.bondStatusFromJSON=f,t.bondStatusToJSON=h;const p={};t.HistoricalInfo={encode(e,n=i.default.Writer.create()){void 0!==e.header&&a.Header.encode(e.header,n.uint32(10).fork()).ldelim();for(const r of e.valset)t.Validator.encode(r,n.uint32(18).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const s=Object.assign({},p);for(s.valset=[];r.pos>>3){case 1:s.header=a.Header.decode(r,r.uint32());break;case 2:s.valset.push(t.Validator.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return s},fromJSON(e){var n;const r=Object.assign({},p);return r.header=void 0!==e.header&&null!==e.header?a.Header.fromJSON(e.header):void 0,r.valset=(null!==(n=e.valset)&&void 0!==n?n:[]).map(e=>t.Validator.fromJSON(e)),r},toJSON(e){const n={};return void 0!==e.header&&(n.header=e.header?a.Header.toJSON(e.header):void 0),e.valset?n.valset=e.valset.map(e=>e?t.Validator.toJSON(e):void 0):n.valset=[],n},fromPartial(e){var n;const r=Object.assign({},p);return r.header=void 0!==e.header&&null!==e.header?a.Header.fromPartial(e.header):void 0,r.valset=(null===(n=e.valset)||void 0===n?void 0:n.map(e=>t.Validator.fromPartial(e)))||[],r}};const A={rate:"",maxRate:"",maxChangeRate:""};t.CommissionRates={encode:(e,t=i.default.Writer.create())=>(""!==e.rate&&t.uint32(10).string(e.rate),""!==e.maxRate&&t.uint32(18).string(e.maxRate),""!==e.maxChangeRate&&t.uint32(26).string(e.maxChangeRate),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},A);for(;n.pos>>3){case 1:o.rate=n.string();break;case 2:o.maxRate=n.string();break;case 3:o.maxChangeRate=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},A);return t.rate=void 0!==e.rate&&null!==e.rate?String(e.rate):"",t.maxRate=void 0!==e.maxRate&&null!==e.maxRate?String(e.maxRate):"",t.maxChangeRate=void 0!==e.maxChangeRate&&null!==e.maxChangeRate?String(e.maxChangeRate):"",t},toJSON(e){const t={};return void 0!==e.rate&&(t.rate=e.rate),void 0!==e.maxRate&&(t.maxRate=e.maxRate),void 0!==e.maxChangeRate&&(t.maxChangeRate=e.maxChangeRate),t},fromPartial(e){var t,n,r;const o=Object.assign({},A);return o.rate=null!==(t=e.rate)&&void 0!==t?t:"",o.maxRate=null!==(n=e.maxRate)&&void 0!==n?n:"",o.maxChangeRate=null!==(r=e.maxChangeRate)&&void 0!==r?r:"",o}};const g={};t.Commission={encode:(e,n=i.default.Writer.create())=>(void 0!==e.commissionRates&&t.CommissionRates.encode(e.commissionRates,n.uint32(10).fork()).ldelim(),void 0!==e.updateTime&&s.Timestamp.encode(e.updateTime,n.uint32(18).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},g);for(;r.pos>>3){case 1:a.commissionRates=t.CommissionRates.decode(r,r.uint32());break;case 2:a.updateTime=s.Timestamp.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},g);return n.commissionRates=void 0!==e.commissionRates&&null!==e.commissionRates?t.CommissionRates.fromJSON(e.commissionRates):void 0,n.updateTime=void 0!==e.updateTime&&null!==e.updateTime?N(e.updateTime):void 0,n},toJSON(e){const n={};return void 0!==e.commissionRates&&(n.commissionRates=e.commissionRates?t.CommissionRates.toJSON(e.commissionRates):void 0),void 0!==e.updateTime&&(n.updateTime=D(e.updateTime).toISOString()),n},fromPartial(e){const n=Object.assign({},g);return n.commissionRates=void 0!==e.commissionRates&&null!==e.commissionRates?t.CommissionRates.fromPartial(e.commissionRates):void 0,n.updateTime=void 0!==e.updateTime&&null!==e.updateTime?s.Timestamp.fromPartial(e.updateTime):void 0,n}};const m={moniker:"",identity:"",website:"",securityContact:"",details:""};t.Description={encode:(e,t=i.default.Writer.create())=>(""!==e.moniker&&t.uint32(10).string(e.moniker),""!==e.identity&&t.uint32(18).string(e.identity),""!==e.website&&t.uint32(26).string(e.website),""!==e.securityContact&&t.uint32(34).string(e.securityContact),""!==e.details&&t.uint32(42).string(e.details),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},m);for(;n.pos>>3){case 1:o.moniker=n.string();break;case 2:o.identity=n.string();break;case 3:o.website=n.string();break;case 4:o.securityContact=n.string();break;case 5:o.details=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},m);return t.moniker=void 0!==e.moniker&&null!==e.moniker?String(e.moniker):"",t.identity=void 0!==e.identity&&null!==e.identity?String(e.identity):"",t.website=void 0!==e.website&&null!==e.website?String(e.website):"",t.securityContact=void 0!==e.securityContact&&null!==e.securityContact?String(e.securityContact):"",t.details=void 0!==e.details&&null!==e.details?String(e.details):"",t},toJSON(e){const t={};return void 0!==e.moniker&&(t.moniker=e.moniker),void 0!==e.identity&&(t.identity=e.identity),void 0!==e.website&&(t.website=e.website),void 0!==e.securityContact&&(t.securityContact=e.securityContact),void 0!==e.details&&(t.details=e.details),t},fromPartial(e){var t,n,r,o,i;const a=Object.assign({},m);return a.moniker=null!==(t=e.moniker)&&void 0!==t?t:"",a.identity=null!==(n=e.identity)&&void 0!==n?n:"",a.website=null!==(r=e.website)&&void 0!==r?r:"",a.securityContact=null!==(o=e.securityContact)&&void 0!==o?o:"",a.details=null!==(i=e.details)&&void 0!==i?i:"",a}};const v={operatorAddress:"",jailed:!1,status:0,tokens:"",delegatorShares:"",unbondingHeight:o.default.ZERO,minSelfDelegation:""};t.Validator={encode:(e,n=i.default.Writer.create())=>(""!==e.operatorAddress&&n.uint32(10).string(e.operatorAddress),void 0!==e.consensusPubkey&&c.Any.encode(e.consensusPubkey,n.uint32(18).fork()).ldelim(),!0===e.jailed&&n.uint32(24).bool(e.jailed),0!==e.status&&n.uint32(32).int32(e.status),""!==e.tokens&&n.uint32(42).string(e.tokens),""!==e.delegatorShares&&n.uint32(50).string(e.delegatorShares),void 0!==e.description&&t.Description.encode(e.description,n.uint32(58).fork()).ldelim(),e.unbondingHeight.isZero()||n.uint32(64).int64(e.unbondingHeight),void 0!==e.unbondingTime&&s.Timestamp.encode(e.unbondingTime,n.uint32(74).fork()).ldelim(),void 0!==e.commission&&t.Commission.encode(e.commission,n.uint32(82).fork()).ldelim(),""!==e.minSelfDelegation&&n.uint32(90).string(e.minSelfDelegation),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},v);for(;r.pos>>3){case 1:a.operatorAddress=r.string();break;case 2:a.consensusPubkey=c.Any.decode(r,r.uint32());break;case 3:a.jailed=r.bool();break;case 4:a.status=r.int32();break;case 5:a.tokens=r.string();break;case 6:a.delegatorShares=r.string();break;case 7:a.description=t.Description.decode(r,r.uint32());break;case 8:a.unbondingHeight=r.int64();break;case 9:a.unbondingTime=s.Timestamp.decode(r,r.uint32());break;case 10:a.commission=t.Commission.decode(r,r.uint32());break;case 11:a.minSelfDelegation=r.string();break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},v);return n.operatorAddress=void 0!==e.operatorAddress&&null!==e.operatorAddress?String(e.operatorAddress):"",n.consensusPubkey=void 0!==e.consensusPubkey&&null!==e.consensusPubkey?c.Any.fromJSON(e.consensusPubkey):void 0,n.jailed=void 0!==e.jailed&&null!==e.jailed&&Boolean(e.jailed),n.status=void 0!==e.status&&null!==e.status?f(e.status):0,n.tokens=void 0!==e.tokens&&null!==e.tokens?String(e.tokens):"",n.delegatorShares=void 0!==e.delegatorShares&&null!==e.delegatorShares?String(e.delegatorShares):"",n.description=void 0!==e.description&&null!==e.description?t.Description.fromJSON(e.description):void 0,n.unbondingHeight=void 0!==e.unbondingHeight&&null!==e.unbondingHeight?o.default.fromString(e.unbondingHeight):o.default.ZERO,n.unbondingTime=void 0!==e.unbondingTime&&null!==e.unbondingTime?N(e.unbondingTime):void 0,n.commission=void 0!==e.commission&&null!==e.commission?t.Commission.fromJSON(e.commission):void 0,n.minSelfDelegation=void 0!==e.minSelfDelegation&&null!==e.minSelfDelegation?String(e.minSelfDelegation):"",n},toJSON(e){const n={};return void 0!==e.operatorAddress&&(n.operatorAddress=e.operatorAddress),void 0!==e.consensusPubkey&&(n.consensusPubkey=e.consensusPubkey?c.Any.toJSON(e.consensusPubkey):void 0),void 0!==e.jailed&&(n.jailed=e.jailed),void 0!==e.status&&(n.status=h(e.status)),void 0!==e.tokens&&(n.tokens=e.tokens),void 0!==e.delegatorShares&&(n.delegatorShares=e.delegatorShares),void 0!==e.description&&(n.description=e.description?t.Description.toJSON(e.description):void 0),void 0!==e.unbondingHeight&&(n.unbondingHeight=(e.unbondingHeight||o.default.ZERO).toString()),void 0!==e.unbondingTime&&(n.unbondingTime=D(e.unbondingTime).toISOString()),void 0!==e.commission&&(n.commission=e.commission?t.Commission.toJSON(e.commission):void 0),void 0!==e.minSelfDelegation&&(n.minSelfDelegation=e.minSelfDelegation),n},fromPartial(e){var n,r,i,a,u,d;const l=Object.assign({},v);return l.operatorAddress=null!==(n=e.operatorAddress)&&void 0!==n?n:"",l.consensusPubkey=void 0!==e.consensusPubkey&&null!==e.consensusPubkey?c.Any.fromPartial(e.consensusPubkey):void 0,l.jailed=null!==(r=e.jailed)&&void 0!==r&&r,l.status=null!==(i=e.status)&&void 0!==i?i:0,l.tokens=null!==(a=e.tokens)&&void 0!==a?a:"",l.delegatorShares=null!==(u=e.delegatorShares)&&void 0!==u?u:"",l.description=void 0!==e.description&&null!==e.description?t.Description.fromPartial(e.description):void 0,l.unbondingHeight=void 0!==e.unbondingHeight&&null!==e.unbondingHeight?o.default.fromValue(e.unbondingHeight):o.default.ZERO,l.unbondingTime=void 0!==e.unbondingTime&&null!==e.unbondingTime?s.Timestamp.fromPartial(e.unbondingTime):void 0,l.commission=void 0!==e.commission&&null!==e.commission?t.Commission.fromPartial(e.commission):void 0,l.minSelfDelegation=null!==(d=e.minSelfDelegation)&&void 0!==d?d:"",l}};const y={addresses:""};t.ValAddresses={encode(e,t=i.default.Writer.create()){for(const n of e.addresses)t.uint32(10).string(n);return t},decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},y);for(o.addresses=[];n.pos>>3){case 1:o.addresses.push(n.string());break;default:n.skipType(7&e)}}return o},fromJSON(e){var t;const n=Object.assign({},y);return n.addresses=(null!==(t=e.addresses)&&void 0!==t?t:[]).map(e=>String(e)),n},toJSON(e){const t={};return e.addresses?t.addresses=e.addresses.map(e=>e):t.addresses=[],t},fromPartial(e){var t;const n=Object.assign({},y);return n.addresses=(null===(t=e.addresses)||void 0===t?void 0:t.map(e=>e))||[],n}};const b={delegatorAddress:"",validatorAddress:""};t.DVPair={encode:(e,t=i.default.Writer.create())=>(""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.validatorAddress&&t.uint32(18).string(e.validatorAddress),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},b);for(;n.pos>>3){case 1:o.delegatorAddress=n.string();break;case 2:o.validatorAddress=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},b);return t.delegatorAddress=void 0!==e.delegatorAddress&&null!==e.delegatorAddress?String(e.delegatorAddress):"",t.validatorAddress=void 0!==e.validatorAddress&&null!==e.validatorAddress?String(e.validatorAddress):"",t},toJSON(e){const t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),t},fromPartial(e){var t,n;const r=Object.assign({},b);return r.delegatorAddress=null!==(t=e.delegatorAddress)&&void 0!==t?t:"",r.validatorAddress=null!==(n=e.validatorAddress)&&void 0!==n?n:"",r}};const I={};t.DVPairs={encode(e,n=i.default.Writer.create()){for(const r of e.pairs)t.DVPair.encode(r,n.uint32(10).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},I);for(a.pairs=[];r.pos>>3){case 1:a.pairs.push(t.DVPair.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},I);return r.pairs=(null!==(n=e.pairs)&&void 0!==n?n:[]).map(e=>t.DVPair.fromJSON(e)),r},toJSON(e){const n={};return e.pairs?n.pairs=e.pairs.map(e=>e?t.DVPair.toJSON(e):void 0):n.pairs=[],n},fromPartial(e){var n;const r=Object.assign({},I);return r.pairs=(null===(n=e.pairs)||void 0===n?void 0:n.map(e=>t.DVPair.fromPartial(e)))||[],r}};const w={delegatorAddress:"",validatorSrcAddress:"",validatorDstAddress:""};t.DVVTriplet={encode:(e,t=i.default.Writer.create())=>(""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.validatorSrcAddress&&t.uint32(18).string(e.validatorSrcAddress),""!==e.validatorDstAddress&&t.uint32(26).string(e.validatorDstAddress),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},w);for(;n.pos>>3){case 1:o.delegatorAddress=n.string();break;case 2:o.validatorSrcAddress=n.string();break;case 3:o.validatorDstAddress=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},w);return t.delegatorAddress=void 0!==e.delegatorAddress&&null!==e.delegatorAddress?String(e.delegatorAddress):"",t.validatorSrcAddress=void 0!==e.validatorSrcAddress&&null!==e.validatorSrcAddress?String(e.validatorSrcAddress):"",t.validatorDstAddress=void 0!==e.validatorDstAddress&&null!==e.validatorDstAddress?String(e.validatorDstAddress):"",t},toJSON(e){const t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorSrcAddress&&(t.validatorSrcAddress=e.validatorSrcAddress),void 0!==e.validatorDstAddress&&(t.validatorDstAddress=e.validatorDstAddress),t},fromPartial(e){var t,n,r;const o=Object.assign({},w);return o.delegatorAddress=null!==(t=e.delegatorAddress)&&void 0!==t?t:"",o.validatorSrcAddress=null!==(n=e.validatorSrcAddress)&&void 0!==n?n:"",o.validatorDstAddress=null!==(r=e.validatorDstAddress)&&void 0!==r?r:"",o}};const E={};t.DVVTriplets={encode(e,n=i.default.Writer.create()){for(const r of e.triplets)t.DVVTriplet.encode(r,n.uint32(10).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},E);for(a.triplets=[];r.pos>>3){case 1:a.triplets.push(t.DVVTriplet.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},E);return r.triplets=(null!==(n=e.triplets)&&void 0!==n?n:[]).map(e=>t.DVVTriplet.fromJSON(e)),r},toJSON(e){const n={};return e.triplets?n.triplets=e.triplets.map(e=>e?t.DVVTriplet.toJSON(e):void 0):n.triplets=[],n},fromPartial(e){var n;const r=Object.assign({},E);return r.triplets=(null===(n=e.triplets)||void 0===n?void 0:n.map(e=>t.DVVTriplet.fromPartial(e)))||[],r}};const _={delegatorAddress:"",validatorAddress:"",shares:""};t.Delegation={encode:(e,t=i.default.Writer.create())=>(""!==e.delegatorAddress&&t.uint32(10).string(e.delegatorAddress),""!==e.validatorAddress&&t.uint32(18).string(e.validatorAddress),""!==e.shares&&t.uint32(26).string(e.shares),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},_);for(;n.pos>>3){case 1:o.delegatorAddress=n.string();break;case 2:o.validatorAddress=n.string();break;case 3:o.shares=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},_);return t.delegatorAddress=void 0!==e.delegatorAddress&&null!==e.delegatorAddress?String(e.delegatorAddress):"",t.validatorAddress=void 0!==e.validatorAddress&&null!==e.validatorAddress?String(e.validatorAddress):"",t.shares=void 0!==e.shares&&null!==e.shares?String(e.shares):"",t},toJSON(e){const t={};return void 0!==e.delegatorAddress&&(t.delegatorAddress=e.delegatorAddress),void 0!==e.validatorAddress&&(t.validatorAddress=e.validatorAddress),void 0!==e.shares&&(t.shares=e.shares),t},fromPartial(e){var t,n,r;const o=Object.assign({},_);return o.delegatorAddress=null!==(t=e.delegatorAddress)&&void 0!==t?t:"",o.validatorAddress=null!==(n=e.validatorAddress)&&void 0!==n?n:"",o.shares=null!==(r=e.shares)&&void 0!==r?r:"",o}};const B={delegatorAddress:"",validatorAddress:""};t.UnbondingDelegation={encode(e,n=i.default.Writer.create()){""!==e.delegatorAddress&&n.uint32(10).string(e.delegatorAddress),""!==e.validatorAddress&&n.uint32(18).string(e.validatorAddress);for(const r of e.entries)t.UnbondingDelegationEntry.encode(r,n.uint32(26).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},B);for(a.entries=[];r.pos>>3){case 1:a.delegatorAddress=r.string();break;case 2:a.validatorAddress=r.string();break;case 3:a.entries.push(t.UnbondingDelegationEntry.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},B);return r.delegatorAddress=void 0!==e.delegatorAddress&&null!==e.delegatorAddress?String(e.delegatorAddress):"",r.validatorAddress=void 0!==e.validatorAddress&&null!==e.validatorAddress?String(e.validatorAddress):"",r.entries=(null!==(n=e.entries)&&void 0!==n?n:[]).map(e=>t.UnbondingDelegationEntry.fromJSON(e)),r},toJSON(e){const n={};return void 0!==e.delegatorAddress&&(n.delegatorAddress=e.delegatorAddress),void 0!==e.validatorAddress&&(n.validatorAddress=e.validatorAddress),e.entries?n.entries=e.entries.map(e=>e?t.UnbondingDelegationEntry.toJSON(e):void 0):n.entries=[],n},fromPartial(e){var n,r,o;const i=Object.assign({},B);return i.delegatorAddress=null!==(n=e.delegatorAddress)&&void 0!==n?n:"",i.validatorAddress=null!==(r=e.validatorAddress)&&void 0!==r?r:"",i.entries=(null===(o=e.entries)||void 0===o?void 0:o.map(e=>t.UnbondingDelegationEntry.fromPartial(e)))||[],i}};const C={creationHeight:o.default.ZERO,initialBalance:"",balance:""};t.UnbondingDelegationEntry={encode:(e,t=i.default.Writer.create())=>(e.creationHeight.isZero()||t.uint32(8).int64(e.creationHeight),void 0!==e.completionTime&&s.Timestamp.encode(e.completionTime,t.uint32(18).fork()).ldelim(),""!==e.initialBalance&&t.uint32(26).string(e.initialBalance),""!==e.balance&&t.uint32(34).string(e.balance),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},C);for(;n.pos>>3){case 1:o.creationHeight=n.int64();break;case 2:o.completionTime=s.Timestamp.decode(n,n.uint32());break;case 3:o.initialBalance=n.string();break;case 4:o.balance=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},C);return t.creationHeight=void 0!==e.creationHeight&&null!==e.creationHeight?o.default.fromString(e.creationHeight):o.default.ZERO,t.completionTime=void 0!==e.completionTime&&null!==e.completionTime?N(e.completionTime):void 0,t.initialBalance=void 0!==e.initialBalance&&null!==e.initialBalance?String(e.initialBalance):"",t.balance=void 0!==e.balance&&null!==e.balance?String(e.balance):"",t},toJSON(e){const t={};return void 0!==e.creationHeight&&(t.creationHeight=(e.creationHeight||o.default.ZERO).toString()),void 0!==e.completionTime&&(t.completionTime=D(e.completionTime).toISOString()),void 0!==e.initialBalance&&(t.initialBalance=e.initialBalance),void 0!==e.balance&&(t.balance=e.balance),t},fromPartial(e){var t,n;const r=Object.assign({},C);return r.creationHeight=void 0!==e.creationHeight&&null!==e.creationHeight?o.default.fromValue(e.creationHeight):o.default.ZERO,r.completionTime=void 0!==e.completionTime&&null!==e.completionTime?s.Timestamp.fromPartial(e.completionTime):void 0,r.initialBalance=null!==(t=e.initialBalance)&&void 0!==t?t:"",r.balance=null!==(n=e.balance)&&void 0!==n?n:"",r}};const k={creationHeight:o.default.ZERO,initialBalance:"",sharesDst:""};t.RedelegationEntry={encode:(e,t=i.default.Writer.create())=>(e.creationHeight.isZero()||t.uint32(8).int64(e.creationHeight),void 0!==e.completionTime&&s.Timestamp.encode(e.completionTime,t.uint32(18).fork()).ldelim(),""!==e.initialBalance&&t.uint32(26).string(e.initialBalance),""!==e.sharesDst&&t.uint32(34).string(e.sharesDst),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},k);for(;n.pos>>3){case 1:o.creationHeight=n.int64();break;case 2:o.completionTime=s.Timestamp.decode(n,n.uint32());break;case 3:o.initialBalance=n.string();break;case 4:o.sharesDst=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},k);return t.creationHeight=void 0!==e.creationHeight&&null!==e.creationHeight?o.default.fromString(e.creationHeight):o.default.ZERO,t.completionTime=void 0!==e.completionTime&&null!==e.completionTime?N(e.completionTime):void 0,t.initialBalance=void 0!==e.initialBalance&&null!==e.initialBalance?String(e.initialBalance):"",t.sharesDst=void 0!==e.sharesDst&&null!==e.sharesDst?String(e.sharesDst):"",t},toJSON(e){const t={};return void 0!==e.creationHeight&&(t.creationHeight=(e.creationHeight||o.default.ZERO).toString()),void 0!==e.completionTime&&(t.completionTime=D(e.completionTime).toISOString()),void 0!==e.initialBalance&&(t.initialBalance=e.initialBalance),void 0!==e.sharesDst&&(t.sharesDst=e.sharesDst),t},fromPartial(e){var t,n;const r=Object.assign({},k);return r.creationHeight=void 0!==e.creationHeight&&null!==e.creationHeight?o.default.fromValue(e.creationHeight):o.default.ZERO,r.completionTime=void 0!==e.completionTime&&null!==e.completionTime?s.Timestamp.fromPartial(e.completionTime):void 0,r.initialBalance=null!==(t=e.initialBalance)&&void 0!==t?t:"",r.sharesDst=null!==(n=e.sharesDst)&&void 0!==n?n:"",r}};const S={delegatorAddress:"",validatorSrcAddress:"",validatorDstAddress:""};t.Redelegation={encode(e,n=i.default.Writer.create()){""!==e.delegatorAddress&&n.uint32(10).string(e.delegatorAddress),""!==e.validatorSrcAddress&&n.uint32(18).string(e.validatorSrcAddress),""!==e.validatorDstAddress&&n.uint32(26).string(e.validatorDstAddress);for(const r of e.entries)t.RedelegationEntry.encode(r,n.uint32(34).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},S);for(a.entries=[];r.pos>>3){case 1:a.delegatorAddress=r.string();break;case 2:a.validatorSrcAddress=r.string();break;case 3:a.validatorDstAddress=r.string();break;case 4:a.entries.push(t.RedelegationEntry.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},S);return r.delegatorAddress=void 0!==e.delegatorAddress&&null!==e.delegatorAddress?String(e.delegatorAddress):"",r.validatorSrcAddress=void 0!==e.validatorSrcAddress&&null!==e.validatorSrcAddress?String(e.validatorSrcAddress):"",r.validatorDstAddress=void 0!==e.validatorDstAddress&&null!==e.validatorDstAddress?String(e.validatorDstAddress):"",r.entries=(null!==(n=e.entries)&&void 0!==n?n:[]).map(e=>t.RedelegationEntry.fromJSON(e)),r},toJSON(e){const n={};return void 0!==e.delegatorAddress&&(n.delegatorAddress=e.delegatorAddress),void 0!==e.validatorSrcAddress&&(n.validatorSrcAddress=e.validatorSrcAddress),void 0!==e.validatorDstAddress&&(n.validatorDstAddress=e.validatorDstAddress),e.entries?n.entries=e.entries.map(e=>e?t.RedelegationEntry.toJSON(e):void 0):n.entries=[],n},fromPartial(e){var n,r,o,i;const a=Object.assign({},S);return a.delegatorAddress=null!==(n=e.delegatorAddress)&&void 0!==n?n:"",a.validatorSrcAddress=null!==(r=e.validatorSrcAddress)&&void 0!==r?r:"",a.validatorDstAddress=null!==(o=e.validatorDstAddress)&&void 0!==o?o:"",a.entries=(null===(i=e.entries)||void 0===i?void 0:i.map(e=>t.RedelegationEntry.fromPartial(e)))||[],a}};const O={maxValidators:0,maxEntries:0,historicalEntries:0,bondDenom:""};t.Params={encode:(e,t=i.default.Writer.create())=>(void 0!==e.unbondingTime&&u.Duration.encode(e.unbondingTime,t.uint32(10).fork()).ldelim(),0!==e.maxValidators&&t.uint32(16).uint32(e.maxValidators),0!==e.maxEntries&&t.uint32(24).uint32(e.maxEntries),0!==e.historicalEntries&&t.uint32(32).uint32(e.historicalEntries),""!==e.bondDenom&&t.uint32(42).string(e.bondDenom),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},O);for(;n.pos>>3){case 1:o.unbondingTime=u.Duration.decode(n,n.uint32());break;case 2:o.maxValidators=n.uint32();break;case 3:o.maxEntries=n.uint32();break;case 4:o.historicalEntries=n.uint32();break;case 5:o.bondDenom=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},O);return t.unbondingTime=void 0!==e.unbondingTime&&null!==e.unbondingTime?u.Duration.fromJSON(e.unbondingTime):void 0,t.maxValidators=void 0!==e.maxValidators&&null!==e.maxValidators?Number(e.maxValidators):0,t.maxEntries=void 0!==e.maxEntries&&null!==e.maxEntries?Number(e.maxEntries):0,t.historicalEntries=void 0!==e.historicalEntries&&null!==e.historicalEntries?Number(e.historicalEntries):0,t.bondDenom=void 0!==e.bondDenom&&null!==e.bondDenom?String(e.bondDenom):"",t},toJSON(e){const t={};return void 0!==e.unbondingTime&&(t.unbondingTime=e.unbondingTime?u.Duration.toJSON(e.unbondingTime):void 0),void 0!==e.maxValidators&&(t.maxValidators=e.maxValidators),void 0!==e.maxEntries&&(t.maxEntries=e.maxEntries),void 0!==e.historicalEntries&&(t.historicalEntries=e.historicalEntries),void 0!==e.bondDenom&&(t.bondDenom=e.bondDenom),t},fromPartial(e){var t,n,r,o;const i=Object.assign({},O);return i.unbondingTime=void 0!==e.unbondingTime&&null!==e.unbondingTime?u.Duration.fromPartial(e.unbondingTime):void 0,i.maxValidators=null!==(t=e.maxValidators)&&void 0!==t?t:0,i.maxEntries=null!==(n=e.maxEntries)&&void 0!==n?n:0,i.historicalEntries=null!==(r=e.historicalEntries)&&void 0!==r?r:0,i.bondDenom=null!==(o=e.bondDenom)&&void 0!==o?o:"",i}};const Q={};t.DelegationResponse={encode:(e,n=i.default.Writer.create())=>(void 0!==e.delegation&&t.Delegation.encode(e.delegation,n.uint32(10).fork()).ldelim(),void 0!==e.balance&&d.Coin.encode(e.balance,n.uint32(18).fork()).ldelim(),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},Q);for(;r.pos>>3){case 1:a.delegation=t.Delegation.decode(r,r.uint32());break;case 2:a.balance=d.Coin.decode(r,r.uint32());break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},Q);return n.delegation=void 0!==e.delegation&&null!==e.delegation?t.Delegation.fromJSON(e.delegation):void 0,n.balance=void 0!==e.balance&&null!==e.balance?d.Coin.fromJSON(e.balance):void 0,n},toJSON(e){const n={};return void 0!==e.delegation&&(n.delegation=e.delegation?t.Delegation.toJSON(e.delegation):void 0),void 0!==e.balance&&(n.balance=e.balance?d.Coin.toJSON(e.balance):void 0),n},fromPartial(e){const n=Object.assign({},Q);return n.delegation=void 0!==e.delegation&&null!==e.delegation?t.Delegation.fromPartial(e.delegation):void 0,n.balance=void 0!==e.balance&&null!==e.balance?d.Coin.fromPartial(e.balance):void 0,n}};const P={balance:""};t.RedelegationEntryResponse={encode:(e,n=i.default.Writer.create())=>(void 0!==e.redelegationEntry&&t.RedelegationEntry.encode(e.redelegationEntry,n.uint32(10).fork()).ldelim(),""!==e.balance&&n.uint32(34).string(e.balance),n),decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},P);for(;r.pos>>3){case 1:a.redelegationEntry=t.RedelegationEntry.decode(r,r.uint32());break;case 4:a.balance=r.string();break;default:r.skipType(7&e)}}return a},fromJSON(e){const n=Object.assign({},P);return n.redelegationEntry=void 0!==e.redelegationEntry&&null!==e.redelegationEntry?t.RedelegationEntry.fromJSON(e.redelegationEntry):void 0,n.balance=void 0!==e.balance&&null!==e.balance?String(e.balance):"",n},toJSON(e){const n={};return void 0!==e.redelegationEntry&&(n.redelegationEntry=e.redelegationEntry?t.RedelegationEntry.toJSON(e.redelegationEntry):void 0),void 0!==e.balance&&(n.balance=e.balance),n},fromPartial(e){var n;const r=Object.assign({},P);return r.redelegationEntry=void 0!==e.redelegationEntry&&null!==e.redelegationEntry?t.RedelegationEntry.fromPartial(e.redelegationEntry):void 0,r.balance=null!==(n=e.balance)&&void 0!==n?n:"",r}};const R={};t.RedelegationResponse={encode(e,n=i.default.Writer.create()){void 0!==e.redelegation&&t.Redelegation.encode(e.redelegation,n.uint32(10).fork()).ldelim();for(const r of e.entries)t.RedelegationEntryResponse.encode(r,n.uint32(18).fork()).ldelim();return n},decode(e,n){const r=e instanceof i.default.Reader?e:new i.default.Reader(e);let o=void 0===n?r.len:r.pos+n;const a=Object.assign({},R);for(a.entries=[];r.pos>>3){case 1:a.redelegation=t.Redelegation.decode(r,r.uint32());break;case 2:a.entries.push(t.RedelegationEntryResponse.decode(r,r.uint32()));break;default:r.skipType(7&e)}}return a},fromJSON(e){var n;const r=Object.assign({},R);return r.redelegation=void 0!==e.redelegation&&null!==e.redelegation?t.Redelegation.fromJSON(e.redelegation):void 0,r.entries=(null!==(n=e.entries)&&void 0!==n?n:[]).map(e=>t.RedelegationEntryResponse.fromJSON(e)),r},toJSON(e){const n={};return void 0!==e.redelegation&&(n.redelegation=e.redelegation?t.Redelegation.toJSON(e.redelegation):void 0),e.entries?n.entries=e.entries.map(e=>e?t.RedelegationEntryResponse.toJSON(e):void 0):n.entries=[],n},fromPartial(e){var n;const r=Object.assign({},R);return r.redelegation=void 0!==e.redelegation&&null!==e.redelegation?t.Redelegation.fromPartial(e.redelegation):void 0,r.entries=(null===(n=e.entries)||void 0===n?void 0:n.map(e=>t.RedelegationEntryResponse.fromPartial(e)))||[],r}};const M={notBondedTokens:"",bondedTokens:""};function x(e){var t;return{seconds:(t=e.getTime()/1e3,o.default.fromNumber(t)),nanos:e.getTime()%1e3*1e6}}function D(e){let t=1e3*e.seconds.toNumber();return t+=e.nanos/1e6,new Date(t)}function N(e){return e instanceof Date?x(e):"string"==typeof e?x(new Date(e)):s.Timestamp.fromJSON(e)}t.Pool={encode:(e,t=i.default.Writer.create())=>(""!==e.notBondedTokens&&t.uint32(10).string(e.notBondedTokens),""!==e.bondedTokens&&t.uint32(18).string(e.bondedTokens),t),decode(e,t){const n=e instanceof i.default.Reader?e:new i.default.Reader(e);let r=void 0===t?n.len:n.pos+t;const o=Object.assign({},M);for(;n.pos>>3){case 1:o.notBondedTokens=n.string();break;case 2:o.bondedTokens=n.string();break;default:n.skipType(7&e)}}return o},fromJSON(e){const t=Object.assign({},M);return t.notBondedTokens=void 0!==e.notBondedTokens&&null!==e.notBondedTokens?String(e.notBondedTokens):"",t.bondedTokens=void 0!==e.bondedTokens&&null!==e.bondedTokens?String(e.bondedTokens):"",t},toJSON(e){const t={};return void 0!==e.notBondedTokens&&(t.notBondedTokens=e.notBondedTokens),void 0!==e.bondedTokens&&(t.bondedTokens=e.bondedTokens),t},fromPartial(e){var t,n;const r=Object.assign({},M);return r.notBondedTokens=null!==(t=e.notBondedTokens)&&void 0!==t?t:"",r.bondedTokens=null!==(n=e.bondedTokens)&&void 0!==n?n:"",r}},i.default.util.Long!==o.default&&(i.default.util.Long=o.default,i.default.configure())},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSearchByTagsQuery=t.isSearchBySentFromOrToQuery=t.isSearchByHeightQuery=void 0,t.isSearchByHeightQuery=function(e){return void 0!==e.height},t.isSearchBySentFromOrToQuery=function(e){return void 0!==e.sentFromOrTo},t.isSearchByTagsQuery=function(e){return void 0!==e.tags}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.BlockIdFlag=t.Tendermint34Client=t.tendermint34=t.VoteType=t.SubscriptionEventType=t.Method=t.broadcastTxSyncSuccess=t.broadcastTxCommitSuccess=t.WebsocketClient=t.HttpClient=t.toSeconds=t.toRfc3339WithNanoseconds=t.fromSeconds=t.fromRfc3339WithNanoseconds=t.DateTime=t.rawSecp256k1PubkeyToRawAddress=t.rawEd25519PubkeyToRawAddress=t.pubkeyToRawAddress=t.pubkeyToAddress=void 0;var a=n(559);Object.defineProperty(t,"pubkeyToAddress",{enumerable:!0,get:function(){return a.pubkeyToAddress}}),Object.defineProperty(t,"pubkeyToRawAddress",{enumerable:!0,get:function(){return a.pubkeyToRawAddress}}),Object.defineProperty(t,"rawEd25519PubkeyToRawAddress",{enumerable:!0,get:function(){return a.rawEd25519PubkeyToRawAddress}}),Object.defineProperty(t,"rawSecp256k1PubkeyToRawAddress",{enumerable:!0,get:function(){return a.rawSecp256k1PubkeyToRawAddress}});var s=n(230);Object.defineProperty(t,"DateTime",{enumerable:!0,get:function(){return s.DateTime}}),Object.defineProperty(t,"fromRfc3339WithNanoseconds",{enumerable:!0,get:function(){return s.fromRfc3339WithNanoseconds}}),Object.defineProperty(t,"fromSeconds",{enumerable:!0,get:function(){return s.fromSeconds}}),Object.defineProperty(t,"toRfc3339WithNanoseconds",{enumerable:!0,get:function(){return s.toRfc3339WithNanoseconds}}),Object.defineProperty(t,"toSeconds",{enumerable:!0,get:function(){return s.toSeconds}});var c=n(231);Object.defineProperty(t,"HttpClient",{enumerable:!0,get:function(){return c.HttpClient}}),Object.defineProperty(t,"WebsocketClient",{enumerable:!0,get:function(){return c.WebsocketClient}});var u=n(112);Object.defineProperty(t,"broadcastTxCommitSuccess",{enumerable:!0,get:function(){return u.broadcastTxCommitSuccess}}),Object.defineProperty(t,"broadcastTxSyncSuccess",{enumerable:!0,get:function(){return u.broadcastTxSyncSuccess}}),Object.defineProperty(t,"Method",{enumerable:!0,get:function(){return u.Method}}),Object.defineProperty(t,"SubscriptionEventType",{enumerable:!0,get:function(){return u.SubscriptionEventType}}),Object.defineProperty(t,"VoteType",{enumerable:!0,get:function(){return u.VoteType}}),t.tendermint34=i(n(112));var d=n(112);Object.defineProperty(t,"Tendermint34Client",{enumerable:!0,get:function(){return d.Tendermint34Client}});var l=n(247);Object.defineProperty(t,"BlockIdFlag",{enumerable:!0,get:function(){return l.BlockIdFlag}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DateTime=t.toSeconds=t.fromSeconds=t.toRfc3339WithNanoseconds=t.fromRfc3339WithNanoseconds=void 0;const r=n(5),o=n(11);function i(e){const t=(0,r.fromRfc3339)(e),n=e.match(/\.(\d+)Z$/),o=n?n[1].slice(3):"";return t.nanoseconds=parseInt(o.padEnd(6,"0"),10),t}function a(e){var t,n;const r=e.toISOString(),o=null!==(n=null===(t=e.nanoseconds)||void 0===t?void 0:t.toString())&&void 0!==n?n:"";return`${r.slice(0,-1)}${o.padStart(6,"0")}Z`}t.fromRfc3339WithNanoseconds=i,t.toRfc3339WithNanoseconds=a,t.fromSeconds=function(e,t=0){const n=new o.Uint32(t).toNumber();if(n>999999999)throw new Error("Nano seconds must not exceed 999999999");const r=new Date(1e3*e+Math.floor(n/1e6));return r.nanoseconds=n%1e6,r},t.toSeconds=function(e){var t;return{seconds:Math.floor(e.getTime()/1e3),nanos:e.getTime()%1e3*1e6+(null!==(t=e.nanoseconds)&&void 0!==t?t:0)}};t.DateTime=class{static decode(e){return i(e)}static encode(e){return a(e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebsocketClient=t.instanceOfRpcStreamingClient=t.HttpClient=void 0;var r=n(560);Object.defineProperty(t,"HttpClient",{enumerable:!0,get:function(){return r.HttpClient}});var o=n(111);Object.defineProperty(t,"instanceOfRpcStreamingClient",{enumerable:!0,get:function(){return o.instanceOfRpcStreamingClient}});var i=n(584);Object.defineProperty(t,"WebsocketClient",{enumerable:!0,get:function(){return i.WebsocketClient}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.jsonRpcCode=t.isJsonRpcSuccessResponse=t.isJsonRpcErrorResponse=t.parseJsonRpcSuccessResponse=t.parseJsonRpcResponse=t.parseJsonRpcRequest=t.parseJsonRpcId=t.parseJsonRpcErrorResponse=t.JsonRpcClient=t.makeJsonRpcId=void 0;var r=n(561);Object.defineProperty(t,"makeJsonRpcId",{enumerable:!0,get:function(){return r.makeJsonRpcId}});var o=n(562);Object.defineProperty(t,"JsonRpcClient",{enumerable:!0,get:function(){return o.JsonRpcClient}});var i=n(563);Object.defineProperty(t,"parseJsonRpcErrorResponse",{enumerable:!0,get:function(){return i.parseJsonRpcErrorResponse}}),Object.defineProperty(t,"parseJsonRpcId",{enumerable:!0,get:function(){return i.parseJsonRpcId}}),Object.defineProperty(t,"parseJsonRpcRequest",{enumerable:!0,get:function(){return i.parseJsonRpcRequest}}),Object.defineProperty(t,"parseJsonRpcResponse",{enumerable:!0,get:function(){return i.parseJsonRpcResponse}}),Object.defineProperty(t,"parseJsonRpcSuccessResponse",{enumerable:!0,get:function(){return i.parseJsonRpcSuccessResponse}});var a=n(233);Object.defineProperty(t,"isJsonRpcErrorResponse",{enumerable:!0,get:function(){return a.isJsonRpcErrorResponse}}),Object.defineProperty(t,"isJsonRpcSuccessResponse",{enumerable:!0,get:function(){return a.isJsonRpcSuccessResponse}}),Object.defineProperty(t,"jsonRpcCode",{enumerable:!0,get:function(){return a.jsonRpcCode}})},function(e,t,n){"use strict";function r(e){return"object"==typeof e.error}Object.defineProperty(t,"__esModule",{value:!0}),t.jsonRpcCode=t.isJsonRpcSuccessResponse=t.isJsonRpcErrorResponse=void 0,t.isJsonRpcErrorResponse=r,t.isJsonRpcSuccessResponse=function(e){return!r(e)},t.jsonRpcCode={parseError:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internalError:-32603,serverError:{default:-32e3}}},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;rthis.eventProducerListener=e,stop:()=>this.eventProducerListener=void 0};this.events=o.Stream.create(s),this.connectionStatusProducer=new r.DefaultValueProducer(a.Unconnected),this.connectionStatus=new r.ValueAndUpdates(this.connectionStatusProducer),this.socket=new i.StreamingSocket(this.url,this.timeout),this.socket.events.subscribe({next:e=>{if(!this.eventProducerListener)throw new Error("No event producer listener set");this.eventProducerListener.next(e)},error:()=>this.connectionStatusProducer.update(a.Disconnected)})}connect(){this.connectionStatusProducer.update(a.Connecting),this.socket.connected.then(async()=>(this.connectionStatusProducer.update(a.Connected),this.processQueue()),()=>this.connectionStatusProducer.update(a.Disconnected)),this.socket.connect()}disconnect(){this.connectionStatusProducer.update(a.Disconnected),this.socket.disconnect()}reconnect(){this.socket=new i.StreamingSocket(this.url,this.timeout),this.socket.events.subscribe({next:e=>{if(!this.eventProducerListener)throw new Error("No event producer listener set");this.eventProducerListener.next(e)},error:()=>this.connectionStatusProducer.update(a.Disconnected)}),this.socket.connected.then(()=>{this.reconnectedHandler&&this.reconnectedHandler()}),this.connect()}getQueueLength(){return this.queue.length}queueRequest(e){this.queue.push(e),this.processQueue()}async processQueue(){if(this.isProcessingQueue||this.connectionStatus.value!==a.Connected)return;let e;for(this.isProcessingQueue=!0;e=this.queue.shift();)try{await this.socket.send(e),this.isProcessingQueue=!1}catch(t){return this.queue.unshift(e),void(this.isProcessingQueue=!1)}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StreamingSocket=void 0;const r=n(37),o=n(244);t.StreamingSocket=class{constructor(e,t=1e4){this.socket=new o.SocketWrapper(e,e=>{this.eventProducerListener&&this.eventProducerListener.next(e)},e=>{this.eventProducerListener&&this.eventProducerListener.error(e)},()=>{},e=>{this.eventProducerListener&&(e.wasClean?this.eventProducerListener.complete():this.eventProducerListener.error("Socket was closed unclean"))},t),this.connected=this.socket.connected;const n={start:e=>this.eventProducerListener=e,stop:()=>this.eventProducerListener=void 0};this.events=r.Stream.create(n)}connect(){this.socket.connect()}disconnect(){this.socket.disconnect()}async send(e){return this.socket.send(e)}}},function(e,t,n){"use strict";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SocketWrapper=void 0;const o=r(n(586));t.SocketWrapper=class{constructor(e,t,n,r,o,i=1e4){this.closed=!1,this.connected=new Promise((e,t)=>{this.connectedResolver=e,this.connectedRejecter=t}),this.url=e,this.messageHandler=t,this.errorHandler=n,this.openHandler=r,this.closeHandler=o,this.timeout=i}connect(){const e=new o.default(this.url);e.onerror=e=>{this.clearTimeout(),this.errorHandler&&this.errorHandler(e)},e.onmessage=e=>{this.messageHandler({type:e.type,data:e.data})},e.onopen=e=>{this.clearTimeout(),this.connectedResolver(),this.openHandler&&this.openHandler()},e.onclose=e=>{this.closed=!0,this.closeHandler&&this.closeHandler(e)};const t=Date.now();this.timeoutId=setTimeout(()=>{e.onmessage=()=>0,e.onerror=()=>0,e.onopen=()=>0,e.onclose=()=>0,e.close(),this.socket=void 0;const n=Math.floor(Date.now()-t);this.connectedRejecter(`Connection attempt timed out after ${n} ms`)},this.timeout),this.socket=e}disconnect(){if(!this.socket)throw new Error("Socket undefined. This must be called after connecting.");switch(this.clearTimeout(),this.socket.readyState){case o.default.OPEN:this.socket.close(1e3);break;case o.default.CLOSED:break;case o.default.CONNECTING:this.socket.onopen=()=>0,this.socket.onclose=()=>0,this.socket.onerror=()=>0,this.socket.onmessage=()=>0,this.socket=void 0,this.closeHandler&&this.closeHandler({wasClean:!1,code:4001});break;case o.default.CLOSING:break;default:throw new Error("Unknown readyState: "+this.socket.readyState)}}async send(t){return new Promise((n,r)=>{if(!this.socket)throw new Error("Socket undefined. This must be called after connecting.");if(this.closed)throw new Error("Socket was closed, so no data can be sent anymore.");if(this.socket.readyState!==o.default.OPEN)throw new Error("Websocket is not open");void 0!==e&&void 0!==e.versions&&void 0!==e.versions.node?this.socket.send(t,e=>e?r(e):n()):(this.socket.send(t),n())})}clearTimeout(){if(!this.timeoutId)throw new Error("Timeout ID not set. This should not happen and usually means connect() was not called.");clearTimeout(this.timeoutId)}}}).call(this,n(6))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createJsonRpcRequest=void 0;function r(){return parseInt(Array.from({length:12}).map(()=>"123456789"[Math.floor(Math.random()*"123456789".length)]).join(""),10)}t.createJsonRpcRequest=function(e,t){const n=t?{...t}:{};return{jsonrpc:"2.0",id:r(),method:e,params:n}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hashBlock=t.hashTx=void 0;const r=n(20),o=n(114);function i(e){switch(e.length){case 0:throw new Error("Cannot hash empty tree");case 1:return function(e){const t=new r.Sha256(Uint8Array.from([0]));return t.update(e),t.digest()}(e[0]);default:{const t=function(e){if(e<1)throw new Error("Cannot split an empty tree");const t=2**Math.floor(Math.log2(e));return t((0,s.assert)(t.balance),null!==e?(0,r.addCoins)(e,t.balance):t.balance),null)}async getDelegation(e,t){var n;let r;try{r=null===(n=(await this.forceGetQueryClient().staking.delegation(e,t)).delegationResponse)||void 0===n?void 0:n.balance}catch(e){if(!e.toString().includes("key not found"))throw e}return r||null}async getTx(e){var t;return null!==(t=(await this.txsQuery(`tx.hash='${e}'`))[0])&&void 0!==t?t:null}async searchTx(e,t={}){const n=t.minHeight||0,r=t.maxHeight||Number.MAX_SAFE_INTEGER;if(r=${n} AND tx.height<=${r}`}let i;if((0,l.isSearchByHeightQuery)(e))i=e.height>=n&&e.height<=r?await this.txsQuery("tx.height="+e.height):[];else if((0,l.isSearchBySentFromOrToQuery)(e)){const t=o(`message.module='bank' AND transfer.sender='${e.sentFromOrTo}'`),n=o(`message.module='bank' AND transfer.recipient='${e.sentFromOrTo}'`),[r,a]=await Promise.all([t,n].map(e=>this.txsQuery(e))),s=r.map(e=>e.hash);i=[...r,...a.filter(e=>!s.includes(e.hash))]}else{if(!(0,l.isSearchByTagsQuery)(e))throw new Error("Unknown query type");{const t=o(e.tags.map(e=>`${e.key}='${e.value}'`).join(" AND "));i=await this.txsQuery(t)}}return i.filter(e=>e.height>=n&&e.height<=r)}disconnect(){this.tmClient&&this.tmClient.disconnect()}async broadcastTx(e,t=6e4,n=3e3){let r=!1;const i=setTimeout(()=>{r=!0},t),a=async e=>{if(r)throw new f(`Transaction with ID ${e} was submitted but was not yet found on the chain. You might want to check later. There was a wait of ${t/1e3} seconds.`,e);await(0,s.sleep)(n);const o=await this.getTx(e);return o?{code:o.code,height:o.height,rawLog:o.rawLog,transactionHash:e,gasUsed:o.gasUsed,gasWanted:o.gasWanted}:a(e)},c=await this.forceGetTmClient().broadcastTxSync({tx:e});if(c.code)return Promise.reject(new Error(`Broadcasting transaction failed with code ${c.code} (codespace: ${c.codeSpace}). Log: ${c.log}`));const u=(0,o.toHex)(c.hash).toUpperCase();return new Promise((e,t)=>a(u).then(t=>{clearTimeout(i),e(t)},e=>{clearTimeout(i),t(e)}))}async txsQuery(e){return(await this.forceGetTmClient().txSearchAll({query:e})).txs.map(e=>({height:e.height,hash:(0,o.toHex)(e.hash).toUpperCase(),code:e.result.code,rawLog:e.result.log||"",tx:e.tx,gasUsed:e.result.gasUsed,gasWanted:e.result.gasWanted}))}}t.StargateClient=A},function(e,t,n){e.exports=n(593)},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){c.headers[e]=r.merge(i)})),e.exports=c}).call(this,n(6))},function(e,t,n){"use strict";var r=n(15),o=n(599),i=n(251),a=n(601),s=n(604),c=n(605),u=n(255);e.exports=function(e){return new Promise((function(t,d){var l=e.data,f=e.headers;r.isFormData(l)&&delete f["Content-Type"];var h=new XMLHttpRequest;if(e.auth){var p=e.auth.username||"",A=e.auth.password||"";f.Authorization="Basic "+btoa(p+":"+A)}var g=a(e.baseURL,e.url);if(h.open(e.method.toUpperCase(),i(g,e.params,e.paramsSerializer),!0),h.timeout=e.timeout,h.onreadystatechange=function(){if(h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in h?s(h.getAllResponseHeaders()):null,r={data:e.responseType&&"text"!==e.responseType?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:e,request:h};o(t,d,r),h=null}},h.onabort=function(){h&&(d(u("Request aborted",e,"ECONNABORTED",h)),h=null)},h.onerror=function(){d(u("Network Error",e,null,h)),h=null},h.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),d(u(t,e,"ECONNABORTED",h)),h=null},r.isStandardBrowserEnv()){var m=n(606),v=(e.withCredentials||c(g))&&e.xsrfCookieName?m.read(e.xsrfCookieName):void 0;v&&(f[e.xsrfHeaderName]=v)}if("setRequestHeader"in h&&r.forEach(f,(function(e,t){void 0===l&&"content-type"===t.toLowerCase()?delete f[t]:h.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(h.withCredentials=!!e.withCredentials),e.responseType)try{h.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&h.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){h&&(h.abort(),d(e),h=null)})),void 0===l&&(l=null),h.send(l)}))}},function(e,t,n){"use strict";var r=n(600);e.exports=function(e,t,n,o,i){var a=new Error(e);return r(a,t,n,o,i)}},function(e,t,n){"use strict";var r=n(15);e.exports=function(e,t){t=t||{};var n={},o=["url","method","params","data"],i=["headers","auth","proxy"],a=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];r.forEach(o,(function(e){void 0!==t[e]&&(n[e]=t[e])})),r.forEach(i,(function(o){r.isObject(t[o])?n[o]=r.deepMerge(e[o],t[o]):void 0!==t[o]?n[o]=t[o]:r.isObject(e[o])?n[o]=r.deepMerge(e[o]):void 0!==e[o]&&(n[o]=e[o])})),r.forEach(a,(function(r){void 0!==t[r]?n[r]=t[r]:void 0!==e[r]&&(n[r]=e[r])}));var s=o.concat(i).concat(a),c=Object.keys(t).filter((function(e){return-1===s.indexOf(e)}));return r.forEach(c,(function(r){void 0!==t[r]?n[r]=t[r]:void 0!==e[r]&&(n[r]=e[r])})),n}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){"use strict";n.r(t);n(34),n(207);var r=n(72),o=n(115),i=n.n(o),a=n(116),s=n.n(a),c=n(16),u=n.n(c);const{SigningCosmosClient:d}=n(73);window.jQuery=u.a,window.$=u.a,u()(document).ready((function(){u()('input[name="get_chain"]').click((function(){u()(this).is(":checked")&&i.a.addKeplrChain(u()(this).val()).then((function(e){!async function(e){u()("#address").last().html(e.accounts[0].address),u()("#viewDenom").last().html(e.foundChain.coinLookup.viewDenom),u()("#inputAddress").val(e.accounts[0].address)}(e),console.log(e)}),(function(e){console.log(e)}))}))})),u()(document).ready((function(){u()("form").submit((async function(e){let t=document.sendForm.recipient.value,n=document.sendForm.amount.value,r=document.sendForm.get_chain.value,o=document.sendForm.order_id.value,i=document.sendForm.memo.value;s.a.sendByChain(r,t,n,o,i,u.a),e.preventDefault()}))})),t.default={initConfig:r.default,initsend:s(),initKeplr:i()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayContentEquals=void 0,t.arrayContentEquals=function(e,t){if(e.length!==t.length)return!1;for(let n=0;nsetTimeout(t,e))}},function(e,t,n){"use strict";(function(e){function n(e){return"object"==typeof e&&null!==e}Object.defineProperty(t,"__esModule",{value:!0}),t.isUint8Array=t.isNonNullObject=void 0,t.isNonNullObject=n,t.isUint8Array=function(t){return!!n(t)&&("[object Uint8Array]"===Object.prototype.toString.call(t)&&(void 0===e||void 0===e.isBuffer||!e.isBuffer(t)))}}).call(this,n(7).Buffer)},function(e,t){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,c=(1<>1,d=-7,l=n?o-1:0,f=n?-1:1,h=e[t+l];for(l+=f,i=h&(1<<-d)-1,h>>=-d,d+=s;d>0;i=256*i+e[t+l],l+=f,d-=8);for(a=i&(1<<-d)-1,i>>=-d,d+=r;d>0;a=256*a+e[t+l],l+=f,d-=8);if(0===i)i=1-u;else{if(i===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=u}return(h?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,c,u=8*i-o-1,d=(1<>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,A=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=d):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+l>=1?f/c:f*Math.pow(2,1-l))*c>=2&&(a++,c/=2),a+l>=d?(s=0,a=d):a+l>=1?(s=(t*c-1)*Math.pow(2,o),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=p,s/=256,o-=8);for(a=a<0;e[n+h]=255&a,h+=p,a/=256,u-=8);e[n+h-p]|=128*A}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Bip39=void 0;const a=n(22),s=i(n(121)),c=n(59),u=i(n(306)),d=n(141);t.Bip39=class{static encode(e){if(-1===[16,20,24,28,32].indexOf(e.length))throw new Error("invalid input length");return new d.EnglishMnemonic(s.entropyToMnemonic(a.toHex(e)))}static decode(e){return a.fromHex(s.mnemonicToEntropy(e.toString()))}static async mnemonicToSeed(e,t){const n=a.toUtf8(u.nfkd(e.toString())),r="mnemonic"+(t?u.nfkd(t):""),o=a.toUtf8(r);return this.pbkdf2(n,o,2048,64,"sha512")}static async pbkdf2(e,t,n,r,o){return new Promise((i,a)=>{c.pbkdf2(e,t,n,r,o,(e,t)=>{e?a(e):i(new Uint8Array(t))})})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromAscii=t.toAscii=void 0,t.toAscii=function(e){return Uint8Array.from(e.split("").map(e=>{const t=e.charCodeAt(0);if(t<32||t>126)throw new Error("Cannot encode character that is out of printable ASCII range: "+t);return t}))},t.fromAscii=function(e){return(t=Array.from(e),t.map(e=>{if(e<32||e>126)throw new Error("Cannot decode character that is out of printable ASCII range: "+e);return String.fromCharCode(e)})).join("");var t}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.fromBase64=t.toBase64=void 0;const a=i(n(74));t.toBase64=function(e){return a.fromByteArray(e)},t.fromBase64=function(e){if(!e.match(/^[a-zA-Z0-9+/]*={0,2}$/))throw new Error("Invalid base64 string format");return a.toByteArray(e)}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Bech32=void 0;const a=i(n(120));t.Bech32=class{static encode(e,t,n){return a.encode(e,a.toWords(t),n)}static decode(e,t=1/0){const n=a.decode(e,t);return{prefix:n.prefix,data:new Uint8Array(a.fromWords(n.words))}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromHex=t.toHex=void 0,t.toHex=function(e){let t="";for(const n of e)t+=("0"+n.toString(16)).slice(-2);return t},t.fromHex=function(e){if(e.length%2!=0)throw new Error("hex string length must be a multiple of 2");const t=[];for(let n=0;n0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,n,r,o=a.allocUnsafe(e>>>0),i=this.head,s=0;i;)t=i.data,n=o,r=s,a.prototype.copy.call(t,n,r),s+=i.data.length,i=i.next;return o}},{key:"consume",value:function(e,t){var n;return eo.length?o.length:e;if(i===o.length?r+=o:r+=o.slice(0,e),0==(e-=i)){i===o.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=o.slice(i));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var o=n.data,i=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,i),0==(e-=i)){i===o.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(i));break}++r}return this.length-=r,t}},{key:c,value:function(e,t){return s(this,function(e){for(var t=1;t0,(function(e){r||(r=e),e&&a.forEach(u),i||(a.forEach(u),o(r))}))}));return t.reduce(d)}},function(e,t,n){var r=n(2),o=n(41),i=n(4).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,o.call(this,64,56)}function u(e){return e<<30|e>>>2}function d(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}r(c,o),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,o=0|this._b,i=0|this._c,s=0|this._d,c=0|this._e,l=0;l<16;++l)n[l]=e.readInt32BE(4*l);for(;l<80;++l)n[l]=n[l-3]^n[l-8]^n[l-14]^n[l-16];for(var f=0;f<80;++f){var h=~~(f/20),p=0|((t=r)<<5|t>>>27)+d(h,o,i,s)+c+n[f]+a[h];c=s,s=i,i=u(o),o=r,r=p}this._a=r+this._a|0,this._b=o+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=c},function(e,t,n){var r=n(2),o=n(41),i=n(4).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,o.call(this,64,56)}function u(e){return e<<5|e>>>27}function d(e){return e<<30|e>>>2}function l(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}r(c,o),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,n=this._w,r=0|this._a,o=0|this._b,i=0|this._c,s=0|this._d,c=0|this._e,f=0;f<16;++f)n[f]=e.readInt32BE(4*f);for(;f<80;++f)n[f]=(t=n[f-3]^n[f-8]^n[f-14]^n[f-16])<<1|t>>>31;for(var h=0;h<80;++h){var p=~~(h/20),A=u(r)+l(p,o,i,s)+c+n[h]+a[p]|0;c=s,s=i,i=d(o),o=r,r=A}this._a=r+this._a|0,this._b=o+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=c},function(e,t,n){var r=n(2),o=n(129),i=n(41),a=n(4).Buffer,s=new Array(64);function c(){this.init(),this._w=s,i.call(this,64,56)}r(c,o),c.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},c.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=c},function(e,t,n){var r=n(2),o=n(130),i=n(41),a=n(4).Buffer,s=new Array(160);function c(){this.init(),this._w=s,i.call(this,128,112)}r(c,o),c.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},c.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=c},function(e,t,n){e.exports=o;var r=n(29).EventEmitter;function o(){r.call(this)}n(2)(o,r),o.Readable=n(78),o.Writable=n(291),o.Duplex=n(292),o.Transform=n(293),o.PassThrough=n(294),o.Stream=o,o.prototype.pipe=function(e,t){var n=this;function o(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",o),e.on("drain",i),e._isStdio||t&&!1===t.end||(n.on("end",s),n.on("close",c));var a=!1;function s(){a||(a=!0,e.end())}function c(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(d(),0===r.listenerCount(this,"error"))throw e}function d(){n.removeListener("data",o),e.removeListener("drain",i),n.removeListener("end",s),n.removeListener("close",c),n.removeListener("error",u),e.removeListener("error",u),n.removeListener("end",d),n.removeListener("close",d),e.removeListener("close",d)}return n.on("error",u),e.on("error",u),n.on("end",d),n.on("close",d),e.on("close",d),e.emit("pipe",n),e}},function(e,t){},function(e,t,n){"use strict";var r=n(79).Buffer,o=n(287);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,o,i=r.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,n=i,o=s,t.copy(n,o),s+=a.data.length,a=a.next;return i},e}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var e=o.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(289),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(3))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,s,c=1,u={},d=!1,l=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){i.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(o=l.documentElement,r=function(e){var t=l.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(p,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n>8&255]>10&&(o[t]=r),r},function(e,t,n){return n?e(t,n):new r(t,null)},function(e,t,n){var o;if(t<4352||4371<=t&&t<44032||55204=55296&&e<=56319},r.isLowSurrogate=function(e){return e>=56320&&e<=57343},r.prototype.prepFeature=function(){this.feature||(this.feature=r.fromCharCode(this.codepoint,!0).feature)},r.prototype.toString=function(){if(this.codepoint<65536)return String.fromCharCode(this.codepoint);var e=this.codepoint-65536;return String.fromCharCode(Math.floor(e/1024)+55296,e%1024+56320)},r.prototype.getDecomp=function(){return this.prepFeature(),this.feature[0]||null},r.prototype.isCompatibility=function(){return this.prepFeature(),!!this.feature[1]&&256&this.feature[1]},r.prototype.isExclude=function(){return this.prepFeature(),!!this.feature[1]&&512&this.feature[1]},r.prototype.getCanonicalClass=function(){return this.prepFeature(),this.feature[1]?255&this.feature[1]:0},r.prototype.getComposite=function(e){if(this.prepFeature(),!this.feature[2])return null;var t=this.feature[2][e.codepoint];return t?r.fromCharCode(t):null};var c=function(e){this.str=e,this.cursor=0};c.prototype.next=function(){if(this.str&&this.cursor0;--n){if(this.resBuf[n-1].getCanonicalClass()<=e)break}this.resBuf.splice(n,0,t)}while(0!==e);return this.resBuf.shift()};var l=function(e){this.it=e,this.procBuf=[],this.resBuf=[],this.lastClass=null};l.prototype.next=function(){for(;0===this.resBuf.length;){var e=this.it.next();if(!e){this.resBuf=this.procBuf,this.procBuf=[];break}if(0===this.procBuf.length)this.lastClass=e.getCanonicalClass(),this.procBuf.push(e);else{var t=this.procBuf[0].getComposite(e),n=e.getCanonicalClass();t&&(this.lastClass element.name === getChainId); //console.log(foundChain) @@ -29,8 +29,17 @@ exports.sendByChain = async function(getChainId, recipient, amount, orderId, mem const offlineSigner = await window.getOfflineSignerAuto(chainId); const accounts = await offlineSigner.getAccounts(); + // Failover RPC + let finalRpc = '' + try { + let failOver = await axios.get(foundChain.rpcURL) + finalRpc = foundChain.rpcURL + } catch (e) { + finalRpc = foundChain.rpcRegistryURL + } + const client = await SigningStargateClient.connectWithSigner( - foundChain.rpcURL, + finalRpc, offlineSigner ) @@ -48,18 +57,13 @@ exports.sendByChain = async function(getChainId, recipient, amount, orderId, mem try { const result = await client.sendTokens(accounts[0].address, recipient, [amountFinal], fee, memo) - assertIsBroadcastTxSuccess(result) - //console.log(result) if (result.code !== undefined && result.code !== 0) { alert("Failed to send tx: " + result.log || result.rawLog); } else { $("#spinner").hide('slow'); $("#AcceptedTx").show(); - //alert("Succeed to send tx"); $("#returnResult").html( result.transactionHash ); - //console.log(order_id); - - // var returnUrl = '/index.php?fc=module&module=cosmospay&controller=validation&check&tx_hash='+result.transactionHash + var returnUrl = '/api-cosmos/?tx_hash='+result.transactionHash+'&order_id='+orderId axios.get(returnUrl) @@ -67,8 +71,7 @@ exports.sendByChain = async function(getChainId, recipient, amount, orderId, mem console.log(response); $("#returnResultStore").html( response.data.message ); $("#sendForm").hide(); - $("#viewFinalTx").show(); - + $("#viewFinalTx").show(); $("#checkAdresse").show(); $("#waitingcheckAdresse").hide(); $("#checkAdresse").css("color", "#31BF91"); @@ -82,10 +85,14 @@ exports.sendByChain = async function(getChainId, recipient, amount, orderId, mem $("#finalUrlTx").attr("href", "https://www.mintscan.io/" + foundChain.mintscanId + "/txs/"+result.transactionHash) $("#viewFinalTx").show(1000); $("#timer").hide(); - + if (isLogged === 'true') { + setTimeout(function() { + window.location.href = "/my-account/view-order/" + orderId + "/"; + }, 5000); + } }) .catch(function (error) { - // console.log(error); + console.log(error); }); } } catch (e) {