@caspay/sdk 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/caspay.min.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +9 -2
package/dist/caspay.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).CasPay=t()}(this,function(){"use strict";const e="1.1.
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).CasPay=t()}(this,function(){"use strict";const e="1.1.1";class t{constructor(e){if(this.apiKey=e.apiKey,this.merchantId=e.merchantId,this.baseUrl=e.baseUrl||"https://caspay.link/api",!this.apiKey)throw new Error("CasPay SDK: apiKey is required");if(!this.merchantId)throw new Error("CasPay SDK: merchantId is required")}async request(t,r,n){const o=`${this.baseUrl}${r}`;try{const r=await fetch(o,{method:t,headers:{"Content-Type":"application/json","X-CasPay-Key":this.apiKey,"X-CasPay-SDK-Version":e,"User-Agent":`CasPay-SDK-JS/${e}`},body:n?JSON.stringify(n):void 0}),i=await r.json();if(!r.ok){throw{error:i.error||"Request failed",code:i.code||"UNKNOWN_ERROR",status:r.status}}return i}catch(e){if(e.error&&e.code)throw e;throw{error:e.message||"Network error",code:"NETWORK_ERROR",status:0}}}getMerchantId(){return this.merchantId}getBaseUrl(){return this.baseUrl}}var r={exports:{}};
|
|
2
2
|
/*! For license information please see lib.web.js.LICENSE.txt */!function(e){var t;self,t=()=>(()=>{var e={6667:(e,t,r)=>{r.d(t,{r:()=>n});const n="bignumber/5.7.0"},7457:(e,t,r)=>{r.d(t,{Os:()=>v,YR:()=>d,gH:()=>p,ii:()=>w});var n=r(9404),o=r.n(n),i=r(8905),a=r(7720),s=r(6667),u=o().BN;const c=new a.Vy(s.r),f={},l=9007199254740991;function d(e){return null!=e&&(p.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||(0,i.isHexString)(e)||"bigint"==typeof e||(0,i.isBytes)(e))}let h=!1;class p{constructor(e,t){e!==f&&c.throwError("cannot call constructor directly; use BigNumber.from",a.Vy.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return m(b(this).fromTwos(e))}toTwos(e){return m(b(this).toTwos(e))}abs(){return"-"===this._hex[0]?p.from(this._hex.substring(1)):this}add(e){return m(b(this).add(b(e)))}sub(e){return m(b(this).sub(b(e)))}div(e){return p.from(e).isZero()&&g("division-by-zero","div"),m(b(this).div(b(e)))}mul(e){return m(b(this).mul(b(e)))}mod(e){const t=b(e);return t.isNeg()&&g("division-by-zero","mod"),m(b(this).umod(t))}pow(e){const t=b(e);return t.isNeg()&&g("negative-power","pow"),m(b(this).pow(t))}and(e){const t=b(e);return(this.isNegative()||t.isNeg())&&g("unbound-bitwise-result","and"),m(b(this).and(t))}or(e){const t=b(e);return(this.isNegative()||t.isNeg())&&g("unbound-bitwise-result","or"),m(b(this).or(t))}xor(e){const t=b(e);return(this.isNegative()||t.isNeg())&&g("unbound-bitwise-result","xor"),m(b(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&g("negative-width","mask"),m(b(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&g("negative-width","shl"),m(b(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&g("negative-width","shr"),m(b(this).shrn(e))}eq(e){return b(this).eq(b(e))}lt(e){return b(this).lt(b(e))}lte(e){return b(this).lte(b(e))}gt(e){return b(this).gt(b(e))}gte(e){return b(this).gte(b(e))}isNegative(){return"-"===this._hex[0]}isZero(){return b(this).isZero()}toNumber(){try{return b(this).toNumber()}catch(e){g("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return c.throwError("this platform does not support BigInt",a.Vy.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?h||(h=!0,c.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?c.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",a.Vy.errors.UNEXPECTED_ARGUMENT,{}):c.throwError("BigNumber.toString does not accept parameters",a.Vy.errors.UNEXPECTED_ARGUMENT,{})),b(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof p)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new p(f,y(e)):e.match(/^-?[0-9]+$/)?new p(f,y(new u(e))):c.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&g("underflow","BigNumber.from",e),(e>=l||e<=-l)&&g("overflow","BigNumber.from",e),p.from(String(e));const t=e;if("bigint"==typeof t)return p.from(t.toString());if((0,i.isBytes)(t))return p.from((0,i.hexlify)(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return p.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&((0,i.isHexString)(e)||"-"===e[0]&&(0,i.isHexString)(e.substring(1))))return p.from(e)}return c.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function y(e){if("string"!=typeof e)return y(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&c.throwArgumentError("invalid hex","value",e),"0x00"===(e=y(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function m(e){return p.from(y(e))}function b(e){const t=p.from(e).toHexString();return"-"===t[0]?new u("-"+t.substring(3),16):new u(t.substring(2),16)}function g(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),c.throwError(e,a.Vy.errors.NUMERIC_FAULT,n)}function v(e){return new u(e,36).toString(16)}function w(e){return new u(e,16).toString(36)}},6077:(e,t,r)=>{r.r(t),r.d(t,{BigNumber:()=>n.gH,FixedFormat:()=>m,FixedNumber:()=>b,_base16To36:()=>n.ii,_base36To16:()=>n.Os,formatFixed:()=>p,parseFixed:()=>y});var n=r(7457),o=r(8905),i=r(7720),a=r(6667);const s=new i.Vy(a.r),u={},c=n.gH.from(0),f=n.gH.from(-1);function l(e,t,r,n){const o={fault:t,operation:r};return void 0!==n&&(o.value=n),s.throwError(e,i.Vy.errors.NUMERIC_FAULT,o)}let d="0";for(;d.length<256;)d+=d;function h(e){if("number"!=typeof e)try{e=n.gH.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+d.substring(0,e):s.throwArgumentError("invalid decimal size","decimals",e)}function p(e,t){null==t&&(t=0);const r=h(t),o=(e=n.gH.from(e)).lt(c);o&&(e=e.mul(f));let i=e.mod(r).toString();for(;i.length<r.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const a=e.div(r).toString();return e=1===r.length?a:a+"."+i,o&&(e="-"+e),e}function y(e,t){null==t&&(t=0);const r=h(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||s.throwArgumentError("invalid decimal value","value",e);const o="-"===e.substring(0,1);o&&(e=e.substring(1)),"."===e&&s.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&s.throwArgumentError("too many decimal points","value",e);let a=i[0],u=i[1];for(a||(a="0"),u||(u="0");"0"===u[u.length-1];)u=u.substring(0,u.length-1);for(u.length>r.length-1&&l("fractional component exceeds decimals","underflow","parseFixed"),""===u&&(u="0");u.length<r.length-1;)u+="0";const c=n.gH.from(a),d=n.gH.from(u);let p=c.mul(r).add(d);return o&&(p=p.mul(f)),p}class m{constructor(e,t,r,n){e!==u&&s.throwError("cannot use FixedFormat constructor; use FixedFormat.from",i.Vy.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=r,this.decimals=n,this.name=(t?"":"u")+"fixed"+String(r)+"x"+String(n),this._multiplier=h(n),Object.freeze(this)}static from(e){if(e instanceof m)return e;"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,r=128,n=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const o=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);o||s.throwArgumentError("invalid fixed format","format",e),t="u"!==o[1],r=parseInt(o[2]),n=parseInt(o[3])}else if(e){const o=(t,r,n)=>null==e[t]?n:(typeof e[t]!==r&&s.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=o("signed","boolean",t),r=o("width","number",r),n=o("decimals","number",n)}return r%8&&s.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&s.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new m(u,t,r,n)}}class b{constructor(e,t,r,n){e!==u&&s.throwError("cannot use FixedNumber constructor; use FixedNumber.from",i.Vy.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&s.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=y(this._value,this.format.decimals),r=y(e._value,e.format.decimals);return b.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=y(this._value,this.format.decimals),r=y(e._value,e.format.decimals);return b.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=y(this._value,this.format.decimals),r=y(e._value,e.format.decimals);return b.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=y(this._value,this.format.decimals),r=y(e._value,e.format.decimals);return b.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=b.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(g.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=b.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(g.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&s.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=b.from("1"+d.substring(0,e),this.format),n=v.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&s.throwArgumentError("invalid byte width","width",e);const t=n.gH.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return(0,o.hexZeroPad)(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return b.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||(0,n.YR)(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),b.fromString(p(e,t),m.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=m.from(t),n=y(e,r.decimals);!r.signed&&n.lt(c)&&l("unsigned value cannot be negative","overflow","value",e);let i=null;r.signed?i=n.toTwos(r.width).toHexString():(i=n.toHexString(),i=(0,o.hexZeroPad)(i,r.width/8));const a=p(n,r.decimals);return new b(u,i,a,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=m.from(t);if((0,o.arrayify)(e).length>r.width/8)throw new Error("overflow");let i=n.gH.from(e);r.signed&&(i=i.fromTwos(r.width));const a=i.toTwos((r.signed?0:1)+r.width).toHexString(),s=p(i,r.decimals);return new b(u,a,s,r)}static from(e,t){if("string"==typeof e)return b.fromString(e,t);if((0,o.isBytes)(e))return b.fromBytes(e,t);try{return b.fromValue(e,0,t)}catch(e){if(e.code!==i.Vy.errors.INVALID_ARGUMENT)throw e}return s.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const g=b.from(1),v=b.from("0.5")},8905:(e,t,r)=>{r.r(t),r.d(t,{arrayify:()=>c,concat:()=>f,hexConcat:()=>g,hexDataLength:()=>m,hexDataSlice:()=>b,hexStripZeros:()=>w,hexValue:()=>v,hexZeroPad:()=>S,hexlify:()=>y,isBytes:()=>u,isBytesLike:()=>a,isHexString:()=>h,joinSignature:()=>_,splitSignature:()=>M,stripZeros:()=>l,zeroPad:()=>d});const n=new(r(7720).Vy)("bytes/5.7.0");function o(e){return!!e.toHexString}function i(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return i(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){return h(e)&&!(e.length%2)||u(e)}function s(e){return"number"==typeof e&&e==e&&e%1==0}function u(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!s(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(!s(r)||r<0||r>=256)return!1}return!0}function c(e,t){if(t||(t={}),"number"==typeof e){n.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),i(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),o(e)&&(e=e.toHexString()),h(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":n.throwArgumentError("hex data is odd-length","value",e));const o=[];for(let e=0;e<r.length;e+=2)o.push(parseInt(r.substring(e,e+2),16));return i(new Uint8Array(o))}return u(e)?i(new Uint8Array(e)):n.throwArgumentError("invalid arrayify value","value",e)}function f(e){const t=e.map(e=>c(e)),r=t.reduce((e,t)=>e+t.length,0),n=new Uint8Array(r);return t.reduce((e,t)=>(n.set(t,e),e+t.length),0),i(n)}function l(e){let t=c(e);if(0===t.length)return t;let r=0;for(;r<t.length&&0===t[r];)r++;return r&&(t=t.slice(r)),t}function d(e,t){(e=c(e)).length>t&&n.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),i(r)}function h(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}const p="0123456789abcdef";function y(e,t){if(t||(t={}),"number"==typeof e){n.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=p[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),o(e))return e.toHexString();if(h(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":n.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(u(e)){let t="0x";for(let r=0;r<e.length;r++){let n=e[r];t+=p[(240&n)>>4]+p[15&n]}return t}return n.throwArgumentError("invalid hexlify value","value",e)}function m(e){if("string"!=typeof e)e=y(e);else if(!h(e)||e.length%2)return null;return(e.length-2)/2}function b(e,t,r){return"string"!=typeof e?e=y(e):(!h(e)||e.length%2)&&n.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function g(e){let t="0x";return e.forEach(e=>{t+=y(e).substring(2)}),t}function v(e){const t=w(y(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function w(e){"string"!=typeof e&&(e=y(e)),h(e)||n.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t<e.length&&"0"===e[t];)t++;return"0x"+e.substring(t)}function S(e,t){for("string"!=typeof e?e=y(e):h(e)||n.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&n.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function M(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(a(e)){let r=c(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=y(r.slice(0,32)),t.s=y(r.slice(32,64))):65===r.length?(t.r=y(r.slice(0,32)),t.s=y(r.slice(32,64)),t.v=r[64]):n.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:n.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=y(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const r=d(c(t._vs),32);t._vs=y(r);const o=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=o:t.recoveryParam!==o&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const i=y(r);null==t.s?t.s=i:t.s!==i&&n.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?n.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const r=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==r&&n.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&h(t.r)?t.r=S(t.r,32):n.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&h(t.s)?t.s=S(t.s,32):n.throwArgumentError("signature missing or invalid s","signature",e);const r=c(t.s);r[0]>=128&&n.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const o=y(r);t._vs&&(h(t._vs)||n.throwArgumentError("signature invalid _vs","signature",e),t._vs=S(t._vs,32)),null==t._vs?t._vs=o:t._vs!==o&&n.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function _(e){return y(f([(e=M(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},1551:(e,t,r)=>{r.r(t),r.d(t,{AddressZero:()=>n,EtherSymbol:()=>d,HashZero:()=>l,MaxUint256:()=>f,NegativeOne:()=>i,One:()=>s,Two:()=>u,WeiPerEther:()=>c,Zero:()=>a});const n="0x0000000000000000000000000000000000000000";var o=r(7457);const i=o.gH.from(-1),a=o.gH.from(0),s=o.gH.from(1),u=o.gH.from(2),c=o.gH.from("1000000000000000000"),f=o.gH.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),l="0x0000000000000000000000000000000000000000000000000000000000000000",d="Ξ"},7720:(e,t,r)=>{r.d(t,{Vy:()=>d});let n=!1,o=!1;const i={debug:1,default:2,info:2,warning:3,error:4,off:5};let a=i.default,s=null;const u=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){e.push(t)}}),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var c,f;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(c||(c={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(f||(f={}));const l="0123456789abcdef";class d{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==i[r]&&this.throwArgumentError("invalid log level name","logLevel",e),a>i[r]||console.log.apply(console,t)}debug(...e){this._log(d.levels.DEBUG,e)}info(...e){this._log(d.levels.INFO,e)}warn(...e){this._log(d.levels.WARNING,e)}makeError(e,t,r){if(o)return this.makeError("censored error",t,{});t||(t=d.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach(e=>{const t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e<t.length;e++)r+=l[t[e]>>4],r+=l[15&t[e]];n.push(e+"=Uint8Array(0x"+r+")")}else n.push(e+"="+JSON.stringify(t))}catch(t){n.push(e+"="+JSON.stringify(r[e].toString()))}}),n.push(`code=${t}`),n.push(`version=${this.version}`);const i=e;let a="";switch(t){case f.NUMERIC_FAULT:{a="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":a+="-"+t;break;case"negative-power":case"negative-width":a+="-unsupported";break;case"unbound-bitwise-result":a+="-unbound-result"}break}case f.CALL_EXCEPTION:case f.INSUFFICIENT_FUNDS:case f.MISSING_NEW:case f.NONCE_EXPIRED:case f.REPLACEMENT_UNDERPRICED:case f.TRANSACTION_REPLACED:case f.UNPREDICTABLE_GAS_LIMIT:a=t}a&&(e+=" [ See: https://links.ethers.org/v5-errors-"+a+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const s=new Error(e);return s.reason=i,s.code=t,Object.keys(r).forEach(function(e){s[e]=r[e]}),s}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,d.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){u&&this.throwError("platform missing String.prototype.normalize",d.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:u})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,d.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,d.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",e<t&&this.throwError("missing argument"+r,d.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+r,d.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",d.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",d.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",d.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return s||(s=new d("logger/5.7.0")),s}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",d.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),n){if(!e)return;this.globalLogger().throwError("error censorship permanent",d.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}o=!!e,n=!!t}static setLogLevel(e){const t=i[e.toLowerCase()];null!=t?a=t:d.globalLogger().warn("invalid log level - "+e)}static from(e){return new d(e)}}d.errors=f,d.levels=c},5111:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.utils=t.curve25519=t.getSharedSecret=t.sync=t.verify=t.sign=t.getPublicKey=t.Signature=t.Point=t.RistrettoPoint=t.ExtendedPoint=t.CURVE=void 0;const n=r(3086),o=BigInt(0),i=BigInt(1),a=BigInt(2),s=BigInt(8),u=BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),c=Object.freeze({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),P:BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),l:u,n:u,h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960")});t.CURVE=c;const f=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),l=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),d=(BigInt("6853475219497561581579357271197624642482790079785650197046958215289687604742"),BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235")),h=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),p=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),y=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");class m{constructor(e,t,r,n){this.x=e,this.y=t,this.z=r,this.t=n}static fromAffine(e){if(!(e instanceof _))throw new TypeError("ExtendedPoint#fromAffine: expected Point");return e.equals(_.ZERO)?m.ZERO:new m(e.x,e.y,i,I(e.x*e.y))}static toAffineBatch(e){const t=function(e,t=c.P){const r=new Array(e.length),n=k(e.reduce((e,n,i)=>n===o?e:(r[i]=e,I(e*n,t)),i),t);return e.reduceRight((e,n,i)=>n===o?e:(r[i]=I(e*r[i],t),I(e*n,t)),n),r}(e.map(e=>e.z));return e.map((e,r)=>e.toAffine(t[r]))}static normalizeZ(e){return this.toAffineBatch(e).map(this.fromAffine)}equals(e){g(e);const{x:t,y:r,z:n}=this,{x:o,y:i,z:a}=e,s=I(t*a),u=I(o*n),c=I(r*a),f=I(i*n);return s===u&&c===f}negate(){return new m(I(-this.x),this.y,this.z,I(-this.t))}double(){const{x:e,y:t,z:r}=this,{a:n}=c,o=I(e*e),i=I(t*t),s=I(a*I(r*r)),u=I(n*o),f=e+t,l=I(I(f*f)-o-i),d=u+i,h=d-s,p=u-i,y=I(l*h),b=I(d*p),g=I(l*p),v=I(h*d);return new m(y,b,v,g)}add(e){g(e);const{x:t,y:r,z:n,t:i}=this,{x:s,y:u,z:c,t:f}=e,l=I((r-t)*(u+s)),d=I((r+t)*(u-s)),h=I(d-l);if(h===o)return this.double();const p=I(n*a*f),y=I(i*a*c),b=y+p,v=d+l,w=y-p,S=I(b*h),M=I(v*w),_=I(b*w),A=I(h*v);return new m(S,M,A,_)}subtract(e){return this.add(e.negate())}precomputeWindow(e){const t=1+256/e,r=[];let n=this,o=n;for(let i=0;i<t;i++){o=n,r.push(o);for(let t=1;t<2**(e-1);t++)o=o.add(n),r.push(o);n=o.double()}return r}wNAF(e,t){!t&&this.equals(m.BASE)&&(t=_.BASE);const r=t&&t._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=t&&M.get(t);n||(n=this.precomputeWindow(r),t&&1!==r&&(n=m.normalizeZ(n),M.set(t,n)));let o=m.ZERO,a=m.BASE;const s=1+256/r,u=2**(r-1),c=BigInt(2**r-1),f=2**r,l=BigInt(r);for(let t=0;t<s;t++){const r=t*u;let s=Number(e&c);e>>=l,s>u&&(s-=f,e+=i);const d=r,h=r+Math.abs(s)-1,p=t%2!=0,y=s<0;0===s?a=a.add(b(p,n[d])):o=o.add(b(y,n[h]))}return m.normalizeZ([o,a])[0]}multiply(e,t){return this.wNAF(J(e,c.l),t)}multiplyUnsafe(e){let t=J(e,c.l,!1);const r=m.BASE,n=m.ZERO;if(t===o)return n;if(this.equals(n)||t===i)return this;if(this.equals(r))return this.wNAF(t);let a=n,s=this;for(;t>o;)t&i&&(a=a.add(s)),s=s.double(),t>>=i;return a}isSmallOrder(){return this.multiplyUnsafe(c.h).equals(m.ZERO)}isTorsionFree(){let e=this.multiplyUnsafe(c.l/a).double();return c.l%a&&(e=e.add(this)),e.equals(m.ZERO)}toAffine(e){const{x:t,y:r,z:n}=this,o=this.equals(m.ZERO);null==e&&(e=o?s:k(n));const a=I(t*e),u=I(r*e),c=I(n*e);if(o)return _.ZERO;if(c!==i)throw new Error("invZ was invalid");return new _(a,u)}fromRistrettoBytes(){w()}toRistrettoBytes(){w()}fromRistrettoHash(){w()}}function b(e,t){const r=t.negate();return e?r:t}function g(e){if(!(e instanceof m))throw new TypeError("ExtendedPoint expected")}function v(e){if(!(e instanceof S))throw new TypeError("RistrettoPoint expected")}function w(){throw new Error("Legacy method: switch to RistrettoPoint")}t.ExtendedPoint=m,m.BASE=new m(c.Gx,c.Gy,i,I(c.Gx*c.Gy)),m.ZERO=new m(o,i,i,o);class S{constructor(e){this.ep=e}static calcElligatorRistrettoMap(e){const{d:t}=c,r=I(l*e*e),n=I((r+i)*p);let o=BigInt(-1);const a=I((o-t*r)*I(r+t));let{isValid:s,value:u}=L(n,a),f=I(u*e);B(f)||(f=I(-f)),s||(u=f),s||(o=r);const h=I(o*(r-i)*y-a),b=u*u,g=I((u+u)*a),v=I(h*d),w=I(i-b),S=I(i+b);return new m(I(g*S),I(w*v),I(v*S),I(g*w))}static hashToCurve(e){const t=x((e=z(e,64)).slice(0,32)),r=this.calcElligatorRistrettoMap(t),n=x(e.slice(32,64)),o=this.calcElligatorRistrettoMap(n);return new S(r.add(o))}static fromHex(e){e=z(e,32);const{a:t,d:r}=c,n="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",a=x(e);if(!function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}(P(a),e)||B(a))throw new Error(n);const s=I(a*a),u=I(i+t*s),f=I(i-t*s),l=I(u*u),d=I(f*f),h=I(t*r*l-d),{isValid:p,value:y}=D(I(h*d)),b=I(y*f),g=I(y*b*h);let v=I((a+a)*b);B(v)&&(v=I(-v));const w=I(u*g),M=I(v*w);if(!p||B(M)||w===o)throw new Error(n);return new S(new m(v,w,i,M))}toRawBytes(){let{x:e,y:t,z:r,t:n}=this.ep;const o=I(I(r+t)*I(r-t)),i=I(e*t),a=I(i*i),{value:s}=D(I(o*a)),u=I(s*o),c=I(s*i),f=I(u*c*n);let d;if(B(n*f)){let r=I(t*l),n=I(e*l);e=r,t=n,d=I(u*h)}else d=c;B(e*f)&&(t=I(-t));let p=I((r-t)*d);return B(p)&&(p=I(-p)),P(p)}toHex(){return j(this.toRawBytes())}toString(){return this.toHex()}equals(e){v(e);const t=this.ep,r=e.ep,n=I(t.x*r.y)===I(t.y*r.x),o=I(t.y*r.y)===I(t.x*r.x);return n||o}add(e){return v(e),new S(this.ep.add(e.ep))}subtract(e){return v(e),new S(this.ep.subtract(e.ep))}multiply(e){return new S(this.ep.multiply(e))}multiplyUnsafe(e){return new S(this.ep.multiplyUnsafe(e))}}t.RistrettoPoint=S,S.BASE=new S(m.BASE),S.ZERO=new S(m.ZERO);const M=new WeakMap;class _{constructor(e,t){this.x=e,this.y=t}_setWindowSize(e){this._WINDOW_SIZE=e,M.delete(this)}static fromHex(e,t=!0){const{d:r,P:n}=c,o=(e=z(e,32)).slice();o[31]=-129&e[31];const a=R(o);if(t&&a>=n)throw new Error("Expected 0 < hex < P");if(!t&&a>=f)throw new Error("Expected 0 < hex < 2**256");const s=I(a*a),u=I(s-i),l=I(r*s+i);let{isValid:d,value:h}=L(u,l);if(!d)throw new Error("Point.fromHex: invalid y coordinate");const p=(h&i)===i;return!!(128&e[31])!==p&&(h=I(-h)),new _(h,a)}static async fromPrivateKey(e){return(await Z(e)).point}toRawBytes(){const e=P(this.y);return e[31]|=this.x&i?128:0,e}toHex(){return j(this.toRawBytes())}toX25519(){const{y:e}=this;return P(I((i+e)*k(i-e)))}isTorsionFree(){return m.fromAffine(this).isTorsionFree()}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new _(I(-this.x),this.y)}add(e){return m.fromAffine(this).add(m.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return m.fromAffine(this).multiply(e,this).toAffine()}}t.Point=_,_.BASE=new _(c.Gx,c.Gy),_.ZERO=new _(o,i);class A{constructor(e,t){this.r=e,this.s=t,this.assertValidity()}static fromHex(e){const t=z(e,64),r=_.fromHex(t.slice(0,32),!1),n=R(t.slice(32,64));return new A(r,n)}assertValidity(){const{r:e,s:t}=this;if(!(e instanceof _))throw new Error("Expected Point instance");return J(t,c.l,!1),this}toRawBytes(){const e=new Uint8Array(64);return e.set(this.r.toRawBytes()),e.set(P(this.s),32),e}toHex(){return j(this.toRawBytes())}}function E(...e){if(!e.every(e=>e instanceof Uint8Array))throw new Error("Expected Uint8Array list");if(1===e.length)return e[0];const t=e.reduce((e,t)=>e+t.length,0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const o=e[t];r.set(o,n),n+=o.length}return r}t.Signature=A;const O=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function j(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=O[e[r]];return t}function T(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,o=e.slice(n,n+2),i=Number.parseInt(o,16);if(Number.isNaN(i)||i<0)throw new Error("Invalid byte sequence");t[r]=i}return t}function N(e){return T(e.toString(16).padStart(64,"0"))}function P(e){return N(e).reverse()}function B(e){return(I(e)&i)===i}function R(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");return BigInt("0x"+j(Uint8Array.from(e).reverse()))}const C=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function x(e){return I(R(e)&C)}function I(e,t=c.P){const r=e%t;return r>=o?r:t+r}function k(e,t=c.P){if(e===o||t<=o)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=I(e,t),n=t,a=o,s=i;for(;r!==o;){const e=n%r,t=a-s*(n/r);n=r,r=e,a=s,s=t}if(n!==i)throw new Error("invert: does not exist");return I(a,t)}function H(e,t){const{P:r}=c;let n=e;for(;t-- >o;)n*=n,n%=r;return n}function U(e){const{P:t}=c,r=BigInt(5),n=BigInt(10),o=BigInt(20),s=BigInt(40),u=BigInt(80),f=e*e%t*e%t,l=H(f,a)*f%t,d=H(l,i)*e%t,h=H(d,r)*d%t,p=H(h,n)*h%t,y=H(p,o)*p%t,m=H(y,s)*y%t,b=H(m,u)*m%t,g=H(b,u)*m%t,v=H(g,n)*h%t;return{pow_p_5_8:H(v,a)*e%t,b2:f}}function L(e,t){const r=I(t*t*t),n=I(r*r*t);let o=I(e*r*U(e*n).pow_p_5_8);const i=I(t*o*o),a=o,s=I(o*l),u=i===e,c=i===I(-e),f=i===I(-e*l);return u&&(o=a),(c||f)&&(o=s),B(o)&&(o=I(-o)),{isValid:u||c,value:o}}function D(e){return L(i,e)}function V(e){return I(R(e),c.l)}function z(e,t){const r=e instanceof Uint8Array?Uint8Array.from(e):T(e);if("number"==typeof t&&r.length!==t)throw new Error(`Expected ${t} bytes`);return r}function J(e,t,r=!0){if(!t)throw new TypeError("Specify max value");if("number"==typeof e&&Number.isSafeInteger(e)&&(e=BigInt(e)),"bigint"==typeof e&&e<t)if(r){if(o<e)return e}else if(o<=e)return e;throw new TypeError("Expected valid scalar: 0 < scalar < max")}function K(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function F(e){if(32!==(e="bigint"==typeof e||"number"==typeof e?N(J(e,f)):z(e)).length)throw new Error("Expected 32 bytes");return e}function q(e){const t=K(e.slice(0,32)),r=e.slice(32,64),n=V(t),o=_.BASE.multiply(n),i=o.toRawBytes();return{head:t,prefix:r,scalar:n,point:o,pointBytes:i}}let W;function G(...e){if("function"!=typeof W)throw new Error("utils.sha512Sync must be set to use sync methods");return W(...e)}async function Z(e){return q(await t.utils.sha512(F(e)))}function $(e){return q(G(F(e)))}function X(e,t,r){t=z(t),r instanceof _||(r=_.fromHex(r,!1));const{r:n,s:o}=e instanceof A?e.assertValidity():A.fromHex(e);return{r:n,s:o,SB:m.BASE.multiplyUnsafe(o),pub:r,msg:t}}function Q(e,t,r,n){const o=V(n),i=m.fromAffine(e).multiplyUnsafe(o);return m.fromAffine(t).add(i).subtract(r).multiplyUnsafe(c.h).equals(m.ZERO)}function Y(e,t,r){const n=I(e*(t-r));return[t=I(t-n),r=I(r+n)]}t.getPublicKey=async function(e){return(await Z(e)).pointBytes},t.sign=async function(e,r){e=z(e);const{prefix:n,scalar:o,pointBytes:i}=await Z(r),a=V(await t.utils.sha512(n,e)),s=_.BASE.multiply(a),u=I(a+V(await t.utils.sha512(s.toRawBytes(),i,e))*o,c.l);return new A(s,u).toRawBytes()},t.verify=async function(e,r,n){const{r:o,SB:i,msg:a,pub:s}=X(e,r,n),u=await t.utils.sha512(o.toRawBytes(),s.toRawBytes(),a);return Q(s,o,i,u)},t.sync={getExtendedPublicKey:$,getPublicKey:function(e){return $(e).pointBytes},sign:function(e,t){e=z(e);const{prefix:r,scalar:n,pointBytes:o}=$(t),i=V(G(r,e)),a=_.BASE.multiply(i),s=I(i+V(G(a.toRawBytes(),o,e))*n,c.l);return new A(a,s).toRawBytes()},verify:function(e,t,r){const{r:n,SB:o,msg:i,pub:a}=X(e,t,r),s=G(n.toRawBytes(),a.toRawBytes(),i);return Q(a,n,o,s)}},t.getSharedSecret=async function(e,r){const{head:n}=await Z(e),o=_.fromHex(r).toX25519();return t.curve25519.scalarMult(n,o)},_.BASE._setWindowSize(8),t.curve25519={BASE_POINT_U:"0900000000000000000000000000000000000000000000000000000000000000",scalarMult(e,t){const r=function(e,t){const{P:r}=c,n=J(e,r),a=J(t,r),s=BigInt(121665),u=n;let f,l=i,d=o,h=n,p=i,y=o;for(let e=BigInt(254);e>=o;e--){const t=a>>e&i;y^=t,f=Y(y,l,h),l=f[0],h=f[1],f=Y(y,d,p),d=f[0],p=f[1],y=t;const r=l+d,n=I(r*r),o=l-d,c=I(o*o),m=n-c,b=h+p,g=I((h-p)*r),v=I(b*o),w=g+v,S=g-v;h=I(w*w),p=I(u*I(S*S)),l=I(n*c),d=I(m*(n+I(s*m)))}f=Y(y,l,h),l=f[0],h=f[1],f=Y(y,d,p),d=f[0],p=f[1];const{pow_p_5_8:m,b2:b}=U(d),g=I(H(m,BigInt(3))*b);return I(l*g)}(function(e){const t=z(e,32);return t[31]&=127,R(t)}(t),R(K(z(e,32))));if(r===o)throw new Error("Invalid private or public key received");return P(I(r,c.P))},scalarMultBase:e=>t.curve25519.scalarMult(e,t.curve25519.BASE_POINT_U)};const ee={node:n,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0};t.utils={bytesToHex:j,hexToBytes:T,concatBytes:E,getExtendedPublicKey:Z,mod:I,invert:k,TORSION_SUBGROUP:["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"],hashToPrivateScalar:e=>{if((e=z(e)).length<40||e.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");return I(R(e),c.l-i)+i},randomBytes:(e=32)=>{if(ee.web)return ee.web.getRandomValues(new Uint8Array(e));if(ee.node){const{randomBytes:t}=ee.node;return new Uint8Array(t(e).buffer)}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>t.utils.randomBytes(32),sha512:async(...e)=>{const t=E(...e);if(ee.web){const e=await ee.web.subtle.digest("SHA-512",t.buffer);return new Uint8Array(e)}if(ee.node)return Uint8Array.from(ee.node.createHash("sha512").update(t).digest());throw new Error("The environment doesn't have sha512 function")},precompute(e=8,t=_.BASE){const r=t.equals(_.BASE)?t:new _(t.x,t.y);return r._setWindowSize(e),r.multiply(a),r},sha512Sync:void 0},Object.defineProperties(t.utils,{sha512Sync:{configurable:!1,get:()=>W,set(e){W||(W=e)}}})},7557:(e,t)=>{function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)}function o(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function i(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 a(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 s(e,t){o(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=void 0,t.number=r,t.bool=n,t.bytes=o,t.hash=i,t.exists=a,t.output=s;const u={number:r,bool:n,bytes:o,hash:i,exists:a,output:s};t.default=u},6742:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BLAKE2=t.SIGMA=void 0;const n=r(7557),o=r(9175);t.SIGMA=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3]);class i extends o.Hash{constructor(e,t,r={},i,a,s){if(super(),this.blockLen=e,this.outputLen=t,this.length=0,this.pos=0,this.finished=!1,this.destroyed=!1,n.default.number(e),n.default.number(t),n.default.number(i),t<0||t>i)throw new Error("outputLen bigger than keyLen");if(void 0!==r.key&&(r.key.length<1||r.key.length>i))throw new Error(`key must be up 1..${i} byte long or undefined`);if(void 0!==r.salt&&r.salt.length!==a)throw new Error(`salt must be ${a} byte long or undefined`);if(void 0!==r.personalization&&r.personalization.length!==s)throw new Error(`personalization must be ${s} byte long or undefined`);this.buffer32=(0,o.u32)(this.buffer=new Uint8Array(e))}update(e){n.default.exists(this);const{blockLen:t,buffer:r,buffer32:i}=this,a=(e=(0,o.toBytes)(e)).length,s=e.byteOffset,u=e.buffer;for(let n=0;n<a;){this.pos===t&&(this.compress(i,0,!1),this.pos=0);const o=Math.min(t-this.pos,a-n),c=s+n;if(o!==t||c%4||!(n+o<a))r.set(e.subarray(n,n+o),this.pos),this.pos+=o,this.length+=o,n+=o;else{const e=new Uint32Array(u,c,Math.floor((a-n)/4));for(let r=0;n+t<a;r+=i.length,n+=t)this.length+=t,this.compress(e,r,!1)}}return this}digestInto(e){n.default.exists(this),n.default.output(e,this);const{pos:t,buffer32:r}=this;this.finished=!0,this.buffer.subarray(t).fill(0),this.compress(r,0,!0);const i=(0,o.u32)(e);this.get().forEach((e,t)=>i[t]=e)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){const{buffer:t,length:r,finished:n,destroyed:o,outputLen:i,pos:a}=this;return e||(e=new this.constructor({dkLen:i})),e.set(...this.get()),e.length=r,e.finished=n,e.destroyed=o,e.outputLen=i,e.buffer.set(t),e.pos=a,e}}t.BLAKE2=i},915:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;const n=r(7557),o=r(9175);class i extends o.Hash{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,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){n.default.exists(this);const{view:t,buffer:r,blockLen:i}=this,a=(e=(0,o.toBytes)(e)).length;for(let n=0;n<a;){const s=Math.min(i-this.pos,a-n);if(s!==i)r.set(e.subarray(n,n+s),this.pos),this.pos+=s,n+=s,this.pos===i&&(this.process(t,0),this.pos=0);else{const t=(0,o.createView)(e);for(;i<=a-n;n+=i)this.process(t,n)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){n.default.exists(this),n.default.output(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:i,isLE:a}=this;let{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>i-s&&(this.process(r,0),s=0);for(let e=s;e<i;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const o=BigInt(32),i=BigInt(4294967295),a=Number(r>>o&i),s=Number(r&i),u=n?4:0,c=n?0:4;e.setUint32(t+u,a,n),e.setUint32(t+c,s,n)}(r,i-8,BigInt(8*this.length),a),this.process(r,0);const u=(0,o.createView)(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const f=c/4,l=this.get();if(f>l.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<f;e++)u.setUint32(4*e,l[e],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:o,destroyed:i,pos:a}=this;return e.length=n,e.pos=a,e.finished=o,e.destroyed=i,n%t&&e.buffer.set(r),e}}t.SHA2=i},2318:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.add=t.toBig=t.split=t.fromBig=void 0;const r=BigInt(2**32-1),n=BigInt(32);function o(e,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function i(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:a,l:s}=o(e[i],t);[r[i],n[i]]=[a,s]}return[r,n]}function a(e,t,r,n){const o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:0|o}}t.fromBig=o,t.split=i,t.toBig=(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0),t.add=a;const s={fromBig:o,split:i,toBig:t.toBig,shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,r)=>e<<r|t>>>32-r,rotlSL:(e,t,r)=>t<<r|e>>>32-r,rotlBH:(e,t,r)=>t<<r-32|e>>>64-r,rotlBL:(e,t,r)=>e<<r-32|t>>>64-r,add:a,add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/2**32|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0,add5H:(e,t,r,n,o,i)=>t+r+n+o+i+(e/2**32|0)|0,add5L:(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0)};t.default=s},6719:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.blake2b=void 0;const n=r(6742),o=r(2318),i=r(9175),a=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),s=new Uint32Array(32);function u(e,t,r,n,i,a){const u=i[a],c=i[a+1];let f=s[2*e],l=s[2*e+1],d=s[2*t],h=s[2*t+1],p=s[2*r],y=s[2*r+1],m=s[2*n],b=s[2*n+1],g=o.default.add3L(f,d,u);l=o.default.add3H(g,l,h,c),f=0|g,({Dh:b,Dl:m}={Dh:b^l,Dl:m^f}),({Dh:b,Dl:m}={Dh:o.default.rotr32H(b,m),Dl:o.default.rotr32L(b,m)}),({h:y,l:p}=o.default.add(y,p,b,m)),({Bh:h,Bl:d}={Bh:h^y,Bl:d^p}),({Bh:h,Bl:d}={Bh:o.default.rotrSH(h,d,24),Bl:o.default.rotrSL(h,d,24)}),s[2*e]=f,s[2*e+1]=l,s[2*t]=d,s[2*t+1]=h,s[2*r]=p,s[2*r+1]=y,s[2*n]=m,s[2*n+1]=b}function c(e,t,r,n,i,a){const u=i[a],c=i[a+1];let f=s[2*e],l=s[2*e+1],d=s[2*t],h=s[2*t+1],p=s[2*r],y=s[2*r+1],m=s[2*n],b=s[2*n+1],g=o.default.add3L(f,d,u);l=o.default.add3H(g,l,h,c),f=0|g,({Dh:b,Dl:m}={Dh:b^l,Dl:m^f}),({Dh:b,Dl:m}={Dh:o.default.rotrSH(b,m,16),Dl:o.default.rotrSL(b,m,16)}),({h:y,l:p}=o.default.add(y,p,b,m)),({Bh:h,Bl:d}={Bh:h^y,Bl:d^p}),({Bh:h,Bl:d}={Bh:o.default.rotrBH(h,d,63),Bl:o.default.rotrBL(h,d,63)}),s[2*e]=f,s[2*e+1]=l,s[2*t]=d,s[2*t+1]=h,s[2*r]=p,s[2*r+1]=y,s[2*n]=m,s[2*n+1]=b}class f extends n.BLAKE2{constructor(e={}){super(128,void 0===e.dkLen?64:e.dkLen,e,64,16,16),this.v0l=0|a[0],this.v0h=0|a[1],this.v1l=0|a[2],this.v1h=0|a[3],this.v2l=0|a[4],this.v2h=0|a[5],this.v3l=0|a[6],this.v3h=0|a[7],this.v4l=0|a[8],this.v4h=0|a[9],this.v5l=0|a[10],this.v5h=0|a[11],this.v6l=0|a[12],this.v6h=0|a[13],this.v7l=0|a[14],this.v7h=0|a[15];const t=e.key?e.key.length:0;if(this.v0l^=this.outputLen|t<<8|65536|1<<24,e.salt){const t=(0,i.u32)((0,i.toBytes)(e.salt));this.v4l^=t[0],this.v4h^=t[1],this.v5l^=t[2],this.v5h^=t[3]}if(e.personalization){const t=(0,i.u32)((0,i.toBytes)(e.personalization));this.v6l^=t[0],this.v6h^=t[1],this.v7l^=t[2],this.v7h^=t[3]}if(e.key){const t=new Uint8Array(this.blockLen);t.set((0,i.toBytes)(e.key)),this.update(t)}}get(){let{v0l:e,v0h:t,v1l:r,v1h:n,v2l:o,v2h:i,v3l:a,v3h:s,v4l:u,v4h:c,v5l:f,v5h:l,v6l:d,v6h:h,v7l:p,v7h:y}=this;return[e,t,r,n,o,i,a,s,u,c,f,l,d,h,p,y]}set(e,t,r,n,o,i,a,s,u,c,f,l,d,h,p,y){this.v0l=0|e,this.v0h=0|t,this.v1l=0|r,this.v1h=0|n,this.v2l=0|o,this.v2h=0|i,this.v3l=0|a,this.v3h=0|s,this.v4l=0|u,this.v4h=0|c,this.v5l=0|f,this.v5h=0|l,this.v6l=0|d,this.v6h=0|h,this.v7l=0|p,this.v7h=0|y}compress(e,t,r){this.get().forEach((e,t)=>s[t]=e),s.set(a,16);let{h:i,l:f}=o.default.fromBig(BigInt(this.length));s[24]=a[8]^f,s[25]=a[9]^i,r&&(s[28]=~s[28],s[29]=~s[29]);let l=0;const d=n.SIGMA;for(let r=0;r<12;r++)u(0,4,8,12,e,t+2*d[l++]),c(0,4,8,12,e,t+2*d[l++]),u(1,5,9,13,e,t+2*d[l++]),c(1,5,9,13,e,t+2*d[l++]),u(2,6,10,14,e,t+2*d[l++]),c(2,6,10,14,e,t+2*d[l++]),u(3,7,11,15,e,t+2*d[l++]),c(3,7,11,15,e,t+2*d[l++]),u(0,5,10,15,e,t+2*d[l++]),c(0,5,10,15,e,t+2*d[l++]),u(1,6,11,12,e,t+2*d[l++]),c(1,6,11,12,e,t+2*d[l++]),u(2,7,8,13,e,t+2*d[l++]),c(2,7,8,13,e,t+2*d[l++]),u(3,4,9,14,e,t+2*d[l++]),c(3,4,9,14,e,t+2*d[l++]);this.v0l^=s[0]^s[16],this.v0h^=s[1]^s[17],this.v1l^=s[2]^s[18],this.v1h^=s[3]^s[19],this.v2l^=s[4]^s[20],this.v2h^=s[5]^s[21],this.v3l^=s[6]^s[22],this.v3h^=s[7]^s[23],this.v4l^=s[8]^s[24],this.v4h^=s[9]^s[25],this.v5l^=s[10]^s[26],this.v5h^=s[11]^s[27],this.v6l^=s[12]^s[28],this.v6h^=s[13]^s[29],this.v7l^=s[14]^s[30],this.v7h^=s[15]^s[31],s.fill(0)}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}t.blake2b=(0,i.wrapConstructorWithOpts)(e=>new f(e))},5145:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},9615:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=t.HMAC=void 0;const n=r(7557),o=r(9175);class i extends o.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,n.default.hash(e);const r=(0,o.toBytes)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,a=new Uint8Array(i);a.set(r.length>i?e.create().update(r).digest():r);for(let e=0;e<a.length;e++)a[e]^=54;this.iHash.update(a),this.oHash=e.create();for(let e=0;e<a.length;e++)a[e]^=106;this.oHash.update(a),a.fill(0)}update(e){return n.default.exists(this),this.iHash.update(e),this}digestInto(e){n.default.exists(this),n.default.bytes(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:o,blockLen:i,outputLen:a}=this;return e.finished=n,e.destroyed=o,e.blockLen=i,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.HMAC=i,t.hmac=(e,t,r)=>new i(e,t).update(r).digest(),t.hmac.create=(e,t)=>new i(e,t)},2623:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=void 0;const n=r(915),o=r(9175),i=(e,t,r)=>e&t^e&r^t&r,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]),u=new Uint32Array(64);class c extends n.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:r,D:n,E:o,F:i,G:a,H:s}=this;return[e,t,r,n,o,i,a,s]}set(e,t,r,n,o,i,a,s){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|o,this.F=0|i,this.G=0|a,this.H=0|s}process(e,t){for(let r=0;r<16;r++,t+=4)u[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=u[e-15],r=u[e-2],n=(0,o.rotr)(t,7)^(0,o.rotr)(t,18)^t>>>3,i=(0,o.rotr)(r,17)^(0,o.rotr)(r,19)^r>>>10;u[e]=i+u[e-7]+n+u[e-16]|0}let{A:r,B:n,C:s,D:c,E:f,F:l,G:d,H:h}=this;for(let e=0;e<64;e++){const t=h+((0,o.rotr)(f,6)^(0,o.rotr)(f,11)^(0,o.rotr)(f,25))+((p=f)&l^~p&d)+a[e]+u[e]|0,y=((0,o.rotr)(r,2)^(0,o.rotr)(r,13)^(0,o.rotr)(r,22))+i(r,n,s)|0;h=d,d=l,l=f,f=c+t|0,c=s,s=n,n=r,r=t+y|0}var p;r=r+this.A|0,n=n+this.B|0,s=s+this.C|0,c=c+this.D|0,f=f+this.E|0,l=l+this.F|0,d=d+this.G|0,h=h+this.H|0,this.set(r,n,s,c,f,l,d,h)}roundClean(){u.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class f extends c{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}t.sha256=(0,o.wrapConstructor)(()=>new c),t.sha224=(0,o.wrapConstructor)(()=>new f)},102:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sha384=t.sha512_256=t.sha512_224=t.sha512=t.SHA512=void 0;const n=r(915),o=r(2318),i=r(9175),[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))),u=new Uint32Array(80),c=new Uint32Array(80);class f extends n.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:r,Bl:n,Ch:o,Cl:i,Dh:a,Dl:s,Eh:u,El:c,Fh:f,Fl:l,Gh:d,Gl:h,Hh:p,Hl:y}=this;return[e,t,r,n,o,i,a,s,u,c,f,l,d,h,p,y]}set(e,t,r,n,o,i,a,s,u,c,f,l,d,h,p,y){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|o,this.Cl=0|i,this.Dh=0|a,this.Dl=0|s,this.Eh=0|u,this.El=0|c,this.Fh=0|f,this.Fl=0|l,this.Gh=0|d,this.Gl=0|h,this.Hh=0|p,this.Hl=0|y}process(e,t){for(let r=0;r<16;r++,t+=4)u[r]=e.getUint32(t),c[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|u[e-15],r=0|c[e-15],n=o.default.rotrSH(t,r,1)^o.default.rotrSH(t,r,8)^o.default.shrSH(t,r,7),i=o.default.rotrSL(t,r,1)^o.default.rotrSL(t,r,8)^o.default.shrSL(t,r,7),a=0|u[e-2],s=0|c[e-2],f=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),d=o.default.add4L(i,l,c[e-7],c[e-16]),h=o.default.add4H(d,n,f,u[e-7],u[e-16]);u[e]=0|h,c[e]=0|d}let{Ah:r,Al:n,Bh:i,Bl:f,Ch:l,Cl:d,Dh:h,Dl:p,Eh:y,El:m,Fh:b,Fl:g,Gh:v,Gl:w,Hh:S,Hl:M}=this;for(let e=0;e<80;e++){const t=o.default.rotrSH(y,m,14)^o.default.rotrSH(y,m,18)^o.default.rotrBH(y,m,41),_=o.default.rotrSL(y,m,14)^o.default.rotrSL(y,m,18)^o.default.rotrBL(y,m,41),A=y&b^~y&v,E=m&g^~m&w,O=o.default.add5L(M,_,E,s[e],c[e]),j=o.default.add5H(O,S,t,A,a[e],u[e]),T=0|O,N=o.default.rotrSH(r,n,28)^o.default.rotrBH(r,n,34)^o.default.rotrBH(r,n,39),P=o.default.rotrSL(r,n,28)^o.default.rotrBL(r,n,34)^o.default.rotrBL(r,n,39),B=r&i^r&l^i&l,R=n&f^n&d^f&d;S=0|v,M=0|w,v=0|b,w=0|g,b=0|y,g=0|m,({h:y,l:m}=o.default.add(0|h,0|p,0|j,0|T)),h=0|l,p=0|d,l=0|i,d=0|f,i=0|r,f=0|n;const C=o.default.add3L(T,P,R);r=o.default.add3H(C,j,N,B),n=0|C}({h:r,l:n}=o.default.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:i,l:f}=o.default.add(0|this.Bh,0|this.Bl,0|i,0|f)),({h:l,l:d}=o.default.add(0|this.Ch,0|this.Cl,0|l,0|d)),({h:h,l:p}=o.default.add(0|this.Dh,0|this.Dl,0|h,0|p)),({h:y,l:m}=o.default.add(0|this.Eh,0|this.El,0|y,0|m)),({h:b,l:g}=o.default.add(0|this.Fh,0|this.Fl,0|b,0|g)),({h:v,l:w}=o.default.add(0|this.Gh,0|this.Gl,0|v,0|w)),({h:S,l:M}=o.default.add(0|this.Hh,0|this.Hl,0|S,0|M)),this.set(r,n,i,f,l,d,h,p,y,m,b,g,v,w,S,M)}roundClean(){u.fill(0),c.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=f;class l extends f{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class d extends f{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 h extends f{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 f),t.sha512_224=(0,i.wrapConstructor)(()=>new l),t.sha512_256=(0,i.wrapConstructor)(()=>new d),t.sha384=(0,i.wrapConstructor)(()=>new h)},9175:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=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 n=r(5145),o=e=>e instanceof Uint8Array;if(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),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 i=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function a(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function s(e){if("string"==typeof e&&(e=a(e)),!o(e))throw new Error("expected Uint8Array, got "+typeof e);return e}t.bytesToHex=function(e){if(!o(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=i[e[r]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(t/2);for(let t=0;t<r.length;t++){const n=2*t,o=e.slice(n,n+2),i=Number.parseInt(o,16);if(Number.isNaN(i)||i<0)throw new Error("Invalid byte sequence");r[t]=i}return r},t.nextTick=async()=>{},t.asyncLoop=async function(e,r,n){let o=Date.now();for(let i=0;i<e;i++){n(i);const e=Date.now()-o;e>=0&&e<r||(await(0,t.nextTick)(),o+=e)}},t.utf8ToBytes=a,t.toBytes=s,t.concatBytes=function(...e){const t=new Uint8Array(e.reduce((e,t)=>e+t.length,0));let r=0;return e.forEach(e=>{if(!o(e))throw new Error("Uint8Array expected");t.set(e,r),r+=e.length}),t},t.Hash=class{clone(){return this._cloneInto()}},t.checkOpts=function(e,t){if(void 0!==t&&("object"!=typeof t||(r=t,"[object Object]"!==Object.prototype.toString.call(r)||r.constructor!==Object)))throw new Error("Options should be object or undefined");var r;return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(s(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(s(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(s(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},9598:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.utils=t.schnorr=t.verify=t.signSync=t.sign=t.getSharedSecret=t.recoverPublicKey=t.getPublicKey=t.Signature=t.Point=t.CURVE=void 0;const n=r(4923),o=BigInt(0),i=BigInt(1),a=BigInt(2),s=BigInt(3),u=BigInt(8),c=Object.freeze({a:o,b:BigInt(7),P:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:i,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")});t.CURVE=c;const f=(e,t)=>(e+t/a)/t,l={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar(e){const{n:t}=c,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-i*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=r,s=BigInt("0x100000000000000000000000000000000"),u=f(a*e,t),l=f(-n*e,t);let d=H(e-u*r-l*o,t),h=H(-u*n-l*a,t);const p=d>s,y=h>s;if(p&&(d=t-d),y&&(h=t-h),d>s||h>s)throw new Error("splitScalarEndo: Endomorphism failed, k="+e);return{k1neg:p,k1:d,k2neg:y,k2:h}}},d=32,h=32;function p(e){const{a:t,b:r}=c,n=H(e*e),o=H(n*e);return H(o+t*e+r)}const y=c.a===o;class m extends Error{constructor(e){super(e)}}function b(e){if(!(e instanceof g))throw new TypeError("JacobianPoint expected")}class g{constructor(e,t,r){this.x=e,this.y=t,this.z=r}static fromAffine(e){if(!(e instanceof S))throw new TypeError("JacobianPoint#fromAffine: expected Point");return e.equals(S.ZERO)?g.ZERO:new g(e.x,e.y,i)}static toAffineBatch(e){const t=function(e,t=c.P){const r=new Array(e.length),n=L(e.reduce((e,n,i)=>n===o?e:(r[i]=e,H(e*n,t)),i),t);return e.reduceRight((e,n,i)=>n===o?e:(r[i]=H(e*r[i],t),H(e*n,t)),n),r}(e.map(e=>e.z));return e.map((e,r)=>e.toAffine(t[r]))}static normalizeZ(e){return g.toAffineBatch(e).map(g.fromAffine)}equals(e){b(e);const{x:t,y:r,z:n}=this,{x:o,y:i,z:a}=e,s=H(n*n),u=H(a*a),c=H(t*u),f=H(o*s),l=H(H(r*a)*u),d=H(H(i*n)*s);return c===f&&l===d}negate(){return new g(this.x,H(-this.y),this.z)}double(){const{x:e,y:t,z:r}=this,n=H(e*e),o=H(t*t),i=H(o*o),c=e+o,f=H(a*(H(c*c)-n-i)),l=H(s*n),d=H(l*l),h=H(d-a*f),p=H(l*(f-h)-u*i),y=H(a*t*r);return new g(h,p,y)}add(e){b(e);const{x:t,y:r,z:n}=this,{x:i,y:s,z:u}=e;if(i===o||s===o)return this;if(t===o||r===o)return e;const c=H(n*n),f=H(u*u),l=H(t*f),d=H(i*c),h=H(H(r*u)*f),p=H(H(s*n)*c),y=H(d-l),m=H(p-h);if(y===o)return m===o?this.double():g.ZERO;const v=H(y*y),w=H(y*v),S=H(l*v),M=H(m*m-w-a*S),_=H(m*(S-M)-h*w),A=H(n*u*y);return new g(M,_,A)}subtract(e){return this.add(e.negate())}multiplyUnsafe(e){const t=g.ZERO;if("bigint"==typeof e&&e===o)return t;let r=k(e);if(r===i)return this;if(!y){let e=t,n=this;for(;r>o;)r&i&&(e=e.add(n)),n=n.double(),r>>=i;return e}let{k1neg:n,k1:a,k2neg:s,k2:u}=l.splitScalar(r),c=t,f=t,d=this;for(;a>o||u>o;)a&i&&(c=c.add(d)),u&i&&(f=f.add(d)),d=d.double(),a>>=i,u>>=i;return n&&(c=c.negate()),s&&(f=f.negate()),f=new g(H(f.x*l.beta),f.y,f.z),c.add(f)}precomputeWindow(e){const t=y?128/e+1:256/e+1,r=[];let n=this,o=n;for(let i=0;i<t;i++){o=n,r.push(o);for(let t=1;t<2**(e-1);t++)o=o.add(n),r.push(o);n=o.double()}return r}wNAF(e,t){!t&&this.equals(g.BASE)&&(t=S.BASE);const r=t&&t._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=t&&w.get(t);n||(n=this.precomputeWindow(r),t&&1!==r&&(n=g.normalizeZ(n),w.set(t,n)));let o=g.ZERO,a=g.BASE;const s=1+(y?128/r:256/r),u=2**(r-1),c=BigInt(2**r-1),f=2**r,l=BigInt(r);for(let t=0;t<s;t++){const r=t*u;let s=Number(e&c);e>>=l,s>u&&(s-=f,e+=i);const d=r,h=r+Math.abs(s)-1,p=t%2!=0,y=s<0;0===s?a=a.add(v(p,n[d])):o=o.add(v(y,n[h]))}return{p:o,f:a}}multiply(e,t){let r,n,o=k(e);if(y){const{k1neg:e,k1:i,k2neg:a,k2:s}=l.splitScalar(o);let{p:u,f:c}=this.wNAF(i,t),{p:f,f:d}=this.wNAF(s,t);u=v(e,u),f=v(a,f),f=new g(H(f.x*l.beta),f.y,f.z),r=u.add(f),n=c.add(d)}else{const{p:e,f:i}=this.wNAF(o,t);r=e,n=i}return g.normalizeZ([r,n])[0]}toAffine(e){const{x:t,y:r,z:n}=this,o=this.equals(g.ZERO);null==e&&(e=o?u:L(n));const a=e,s=H(a*a),c=H(s*a),f=H(t*s),l=H(r*c),d=H(n*a);if(o)return S.ZERO;if(d!==i)throw new Error("invZ was invalid");return new S(f,l)}}function v(e,t){const r=t.negate();return e?r:t}g.BASE=new g(c.Gx,c.Gy,i),g.ZERO=new g(o,i,o);const w=new WeakMap;class S{constructor(e,t){this.x=e,this.y=t}_setWindowSize(e){this._WINDOW_SIZE=e,w.delete(this)}hasEvenY(){return this.y%a===o}static fromCompressedHex(e){const t=32===e.length,r=x(t?e:e.subarray(1));if(!F(r))throw new Error("Point is not on curve");let n=function(e){const{P:t}=c,r=BigInt(6),n=BigInt(11),o=BigInt(22),i=BigInt(23),u=BigInt(44),f=BigInt(88),l=e*e*e%t,d=l*l*e%t,h=U(d,s)*d%t,p=U(h,s)*d%t,y=U(p,a)*l%t,m=U(y,n)*y%t,b=U(m,o)*m%t,g=U(b,u)*b%t,v=U(g,f)*g%t,w=U(v,u)*b%t,S=U(w,s)*d%t,M=U(S,i)*m%t,_=U(M,r)*l%t,A=U(_,a);if(A*A%t!==e)throw new Error("Cannot find square root");return A}(p(r));const o=(n&i)===i;t?o&&(n=H(-n)):!(1&~e[0])!==o&&(n=H(-n));const u=new S(r,n);return u.assertValidity(),u}static fromUncompressedHex(e){const t=x(e.subarray(1,33)),r=x(e.subarray(33,65)),n=new S(t,r);return n.assertValidity(),n}static fromHex(e){const t=I(e),r=t.length,n=t[0];if(r===d)return this.fromCompressedHex(t);if(33===r&&(2===n||3===n))return this.fromCompressedHex(t);if(65===r&&4===n)return this.fromUncompressedHex(t);throw new Error(`Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ${r}`)}static fromPrivateKey(e){return S.BASE.multiply(W(e))}static fromSignature(e,t,r){const{r:n,s:o}=Z(t);if(![0,1,2,3].includes(r))throw new Error("Cannot recover: invalid recovery bit");const i=D(I(e)),{n:a}=c,s=2===r||3===r?n+a:n,u=L(s,a),f=H(-i*u,a),l=H(o*u,a),d=1&r?"03":"02",h=S.fromHex(d+N(s)),p=S.BASE.multiplyAndAddUnsafe(h,f,l);if(!p)throw new Error("Cannot recover signature: point at infinify");return p.assertValidity(),p}toRawBytes(e=!1){return C(this.toHex(e))}toHex(e=!1){const t=N(this.x);return e?`${this.hasEvenY()?"02":"03"}${t}`:`04${t}${N(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const e="Point is not on elliptic curve",{x:t,y:r}=this;if(!F(t)||!F(r))throw new Error(e);const n=H(r*r);if(H(n-p(t))!==o)throw new Error(e)}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new S(this.x,H(-this.y))}double(){return g.fromAffine(this).double().toAffine()}add(e){return g.fromAffine(this).add(g.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return g.fromAffine(this).multiply(e,this).toAffine()}multiplyAndAddUnsafe(e,t,r){const n=g.fromAffine(this),a=t===o||t===i||this!==S.BASE?n.multiplyUnsafe(t):n.multiply(t),s=g.fromAffine(e).multiplyUnsafe(r),u=a.add(s);return u.equals(g.ZERO)?void 0:u.toAffine()}}function M(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}function _(e){if(e.length<2||2!==e[0])throw new Error(`Invalid signature integer tag: ${j(e)}`);const t=e[1],r=e.subarray(2,t+2);if(!t||r.length!==t)throw new Error("Invalid signature integer: wrong length");if(0===r[0]&&r[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:x(r),left:e.subarray(t+2)}}t.Point=S,S.BASE=new S(c.Gx,c.Gy),S.ZERO=new S(o,o);class A{constructor(e,t){this.r=e,this.s=t,this.assertValidity()}static fromCompact(e){const t=e instanceof Uint8Array,r="Signature.fromCompact";if("string"!=typeof e&&!t)throw new TypeError(`${r}: Expected string or Uint8Array`);const n=t?j(e):e;if(128!==n.length)throw new Error(`${r}: Expected 64-byte hex`);return new A(R(n.slice(0,64)),R(n.slice(64,128)))}static fromDER(e){const t=e instanceof Uint8Array;if("string"!=typeof e&&!t)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r:r,s:n}=function(e){if(e.length<2||48!=e[0])throw new Error(`Invalid signature tag: ${j(e)}`);if(e[1]!==e.length-2)throw new Error("Invalid signature: incorrect length");const{data:t,left:r}=_(e.subarray(2)),{data:n,left:o}=_(r);if(o.length)throw new Error(`Invalid signature: left bytes after parsing: ${j(o)}`);return{r:t,s:n}}(t?e:C(e));return new A(r,n)}static fromHex(e){return this.fromDER(e)}assertValidity(){const{r:e,s:t}=this;if(!K(e))throw new Error("Invalid Signature: r must be 0 < r < n");if(!K(t))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const e=c.n>>i;return this.s>e}normalizeS(){return this.hasHighS()?new A(this.r,H(-this.s,c.n)):this}toDERRawBytes(){return C(this.toDERHex())}toDERHex(){const e=M(B(this.s)),t=M(B(this.r)),r=e.length/2,n=t.length/2,o=B(r),i=B(n);return`30${B(n+r+4)}02${i}${t}02${o}${e}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return C(this.toCompactHex())}toCompactHex(){return N(this.r)+N(this.s)}}function E(...e){if(!e.every(e=>e 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),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const o=e[t];r.set(o,n),n+=o.length}return r}t.Signature=A;const O=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function j(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");let t="";for(let r=0;r<e.length;r++)t+=O[e[r]];return t}const T=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000");function N(e){if("bigint"!=typeof e)throw new Error("Expected bigint");if(!(o<=e&&e<T))throw new Error("Expected number 0 <= n < 2^256");return e.toString(16).padStart(64,"0")}function P(e){const t=C(N(e));if(32!==t.length)throw new Error("Error: expected 32 bytes");return t}function B(e){const t=e.toString(16);return 1&t.length?`0${t}`:t}function R(e){if("string"!=typeof e)throw new TypeError("hexToNumber: expected string, got "+typeof e);return BigInt(`0x${e}`)}function C(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+e.length);const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,o=e.slice(n,n+2),i=Number.parseInt(o,16);if(Number.isNaN(i)||i<0)throw new Error("Invalid byte sequence");t[r]=i}return t}function x(e){return R(j(e))}function I(e){return e instanceof Uint8Array?Uint8Array.from(e):C(e)}function k(e){if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)return BigInt(e);if("bigint"==typeof e&&K(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function H(e,t=c.P){const r=e%t;return r>=o?r:t+r}function U(e,t){const{P:r}=c;let n=e;for(;t-- >o;)n*=n,n%=r;return n}function L(e,t=c.P){if(e===o||t<=o)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=H(e,t),n=t,a=o,s=i;for(;r!==o;){const e=n%r,t=a-s*(n/r);n=r,r=e,a=s,s=t}if(n!==i)throw new Error("invert: does not exist");return H(a,t)}function D(e,t=!1){const r=function(e){const t=8*e.length-256,r=x(e);return t>0?r>>BigInt(t):r}(e);if(t)return r;const{n:n}=c;return r>=n?r-n:r}let V,z;class J{constructor(e,t){if(this.hashLen=e,this.qByteLen=t,"number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");this.v=new Uint8Array(e).fill(1),this.k=new Uint8Array(e).fill(0),this.counter=0}hmac(...e){return t.utils.hmacSha256(this.k,...e)}hmacSync(...e){return z(this.k,...e)}checkSync(){if("function"!=typeof z)throw new m("hmacSha256Sync needs to be set")}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(e=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),e),this.v=await this.hmac(this.v),0!==e.length&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),e),this.v=await this.hmac(this.v))}reseedSync(e=new Uint8Array){this.checkSync(),this.k=this.hmacSync(this.v,Uint8Array.from([0]),e),this.v=this.hmacSync(this.v),0!==e.length&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),e),this.v=this.hmacSync(this.v))}async generate(){this.incr();let e=0;const t=[];for(;e<this.qByteLen;){this.v=await this.hmac(this.v);const r=this.v.slice();t.push(r),e+=this.v.length}return E(...t)}generateSync(){this.checkSync(),this.incr();let e=0;const t=[];for(;e<this.qByteLen;){this.v=this.hmacSync(this.v);const r=this.v.slice();t.push(r),e+=this.v.length}return E(...t)}}function K(e){return o<e&&e<c.n}function F(e){return o<e&&e<c.P}function q(e,t,r,n=!0){const{n:a}=c,s=D(e,!0);if(!K(s))return;const u=L(s,a),f=S.BASE.multiply(s),l=H(f.x,a);if(l===o)return;const d=H(u*H(t+r*l,a),a);if(d===o)return;let h=new A(l,d),p=(f.x===h.r?0:2)|Number(f.y&i);return n&&h.hasHighS()&&(h=h.normalizeS(),p^=1),{sig:h,recovery:p}}function W(e){let t;if("bigint"==typeof e)t=e;else if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)t=BigInt(e);else if("string"==typeof e){if(64!==e.length)throw new Error("Expected 32 bytes of private key");t=R(e)}else{if(!(e instanceof Uint8Array))throw new TypeError("Expected valid private key");if(e.length!==h)throw new Error("Expected 32 bytes of private key");t=x(e)}if(!K(t))throw new Error("Expected private key: 0 < key < n");return t}function G(e){return e instanceof S?(e.assertValidity(),e):S.fromHex(e)}function Z(e){if(e instanceof A)return e.assertValidity(),e;try{return A.fromDER(e)}catch(t){return A.fromCompact(e)}}function $(e){const t=e instanceof Uint8Array,r="string"==typeof e,n=(t||r)&&e.length;return t?33===n||65===n:r?66===n||130===n:e instanceof S}function X(e){return x(e.length>d?e.slice(0,d):e)}function Q(e){const t=X(e),r=H(t,c.n);return Y(r<o?t:r)}function Y(e){return P(e)}function ee(e,r,n){if(null==e)throw new Error(`sign: expected valid message hash, not "${e}"`);const o=I(e),i=W(r),a=[Y(i),Q(o)];if(null!=n){!0===n&&(n=t.utils.randomBytes(d));const e=I(n);if(e.length!==d)throw new Error("sign: Expected 32 bytes of extra data");a.push(e)}return{seed:E(...a),m:X(o),d:i}}function te(e,t){const{sig:r,recovery:n}=e,{der:o,recovered:i}=Object.assign({canonical:!0,der:!0},t),a=o?r.toDERRawBytes():r.toCompactRawBytes();return i?[a,n]:a}t.getPublicKey=function(e,t=!1){return S.fromPrivateKey(e).toRawBytes(t)},t.recoverPublicKey=function(e,t,r,n=!1){return S.fromSignature(e,t,r).toRawBytes(n)},t.getSharedSecret=function(e,t,r=!1){if($(e))throw new TypeError("getSharedSecret: first arg must be private key");if(!$(t))throw new TypeError("getSharedSecret: second arg must be public key");const n=G(t);return n.assertValidity(),n.multiply(W(e)).toRawBytes(r)},t.sign=async function(e,t,r={}){const{seed:n,m:o,d:i}=ee(e,t,r.extraEntropy),a=new J(32,h);let s;for(await a.reseed(n);!(s=q(await a.generate(),o,i,r.canonical));)await a.reseed();return te(s,r)},t.signSync=function(e,t,r={}){const{seed:n,m:o,d:i}=ee(e,t,r.extraEntropy),a=new J(32,h);let s;for(a.reseedSync(n);!(s=q(a.generateSync(),o,i,r.canonical));)a.reseedSync();return te(s,r)};const re={strict:!0};function ne(e){return H(x(e),c.n)}t.verify=function(e,t,r,n=re){let o;try{o=Z(e),t=I(t)}catch(e){return!1}const{r:i,s:a}=o;if(n.strict&&o.hasHighS())return!1;const s=D(t);let u;try{u=G(r)}catch(e){return!1}const{n:f}=c,l=L(a,f),d=H(s*l,f),h=H(i*l,f),p=S.BASE.multiplyAndAddUnsafe(u,d,h);return!!p&&H(p.x,f)===i};class oe{constructor(e,t){this.r=e,this.s=t,this.assertValidity()}static fromHex(e){const t=I(e);if(64!==t.length)throw new TypeError(`SchnorrSignature.fromHex: expected 64 bytes, not ${t.length}`);const r=x(t.subarray(0,32)),n=x(t.subarray(32,64));return new oe(r,n)}assertValidity(){const{r:e,s:t}=this;if(!F(e)||!K(t))throw new Error("Invalid signature")}toHex(){return N(this.r)+N(this.s)}toRawBytes(){return C(this.toHex())}}class ie{constructor(e,r,n=t.utils.randomBytes()){if(null==e)throw new TypeError(`sign: Expected valid message, not "${e}"`);this.m=I(e);const{x:o,scalar:i}=this.getScalar(W(r));if(this.px=o,this.d=i,this.rand=I(n),32!==this.rand.length)throw new TypeError("sign: Expected 32 bytes of aux randomness")}getScalar(e){const t=S.fromPrivateKey(e),r=t.hasEvenY()?e:c.n-e;return{point:t,scalar:r,x:t.toRawX()}}initNonce(e,t){return P(e^x(t))}finalizeNonce(e){const t=H(x(e),c.n);if(t===o)throw new Error("sign: Creation of signature failed. k is zero");const{point:r,x:n,scalar:i}=this.getScalar(t);return{R:r,rx:n,k:i}}finalizeSig(e,t,r,n){return new oe(e.x,H(t+r*n,c.n)).toRawBytes()}error(){throw new Error("sign: Invalid signature produced")}async calc(){const{m:e,d:r,px:n,rand:o}=this,i=t.utils.taggedHash,a=this.initNonce(r,await i(le.aux,o)),{R:s,rx:u,k:c}=this.finalizeNonce(await i(le.nonce,a,n,e)),f=ne(await i(le.challenge,u,n,e)),l=this.finalizeSig(s,c,f,r);return await ue(l,e,n)||this.error(),l}calcSync(){const{m:e,d:r,px:n,rand:o}=this,i=t.utils.taggedHashSync,a=this.initNonce(r,i(le.aux,o)),{R:s,rx:u,k:c}=this.finalizeNonce(i(le.nonce,a,n,e)),f=ne(i(le.challenge,u,n,e)),l=this.finalizeSig(s,c,f,r);return ce(l,e,n)||this.error(),l}}function ae(e,t,r){const n=e instanceof oe,o=n?e:oe.fromHex(e);return n&&o.assertValidity(),{...o,m:I(t),P:G(r)}}function se(e,t,r,n){const o=S.BASE.multiplyAndAddUnsafe(t,W(r),H(-n,c.n));return!(!o||!o.hasEvenY()||o.x!==e)}async function ue(e,r,n){try{const{r:o,s:i,m:a,P:s}=ae(e,r,n),u=ne(await t.utils.taggedHash(le.challenge,P(o),s.toRawX(),a));return se(o,s,i,u)}catch(e){return!1}}function ce(e,r,n){try{const{r:o,s:i,m:a,P:s}=ae(e,r,n),u=ne(t.utils.taggedHashSync(le.challenge,P(o),s.toRawX(),a));return se(o,s,i,u)}catch(e){if(e instanceof m)throw e;return!1}}t.schnorr={Signature:oe,getPublicKey:function(e){return S.fromPrivateKey(e).toRawX()},sign:async function(e,t,r){return new ie(e,t,r).calc()},verify:ue,signSync:function(e,t,r){return new ie(e,t,r).calcSync()},verifySync:ce},S.BASE._setWindowSize(8);const fe={node:n,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0},le={challenge:"BIP0340/challenge",aux:"BIP0340/aux",nonce:"BIP0340/nonce"},de={};t.utils={bytesToHex:j,hexToBytes:C,concatBytes:E,mod:H,invert:L,isValidPrivateKey(e){try{return W(e),!0}catch(e){return!1}},_bigintTo32Bytes:P,_normalizePrivateKey:W,hashToPrivateKey:e=>{if((e=I(e)).length<40||e.length>1024)throw new Error("Expected valid bytes of private key as per FIPS 186");return P(H(x(e),c.n-i)+i)},randomBytes:(e=32)=>{if(fe.web)return fe.web.getRandomValues(new Uint8Array(e));if(fe.node){const{randomBytes:t}=fe.node;return Uint8Array.from(t(e))}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>t.utils.hashToPrivateKey(t.utils.randomBytes(40)),precompute(e=8,t=S.BASE){const r=t===S.BASE?t:new S(t.x,t.y);return r._setWindowSize(e),r.multiply(s),r},sha256:async(...e)=>{if(fe.web){const t=await fe.web.subtle.digest("SHA-256",E(...e));return new Uint8Array(t)}if(fe.node){const{createHash:t}=fe.node,r=t("sha256");return e.forEach(e=>r.update(e)),Uint8Array.from(r.digest())}throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(e,...t)=>{if(fe.web){const r=await fe.web.subtle.importKey("raw",e,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),n=E(...t),o=await fe.web.subtle.sign("HMAC",r,n);return new Uint8Array(o)}if(fe.node){const{createHmac:r}=fe.node,n=r("sha256",e);return t.forEach(e=>n.update(e)),Uint8Array.from(n.digest())}throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:async(e,...r)=>{let n=de[e];if(void 0===n){const r=await t.utils.sha256(Uint8Array.from(e,e=>e.charCodeAt(0)));n=E(r,r),de[e]=n}return t.utils.sha256(n,...r)},taggedHashSync:(e,...t)=>{if("function"!=typeof V)throw new m("sha256Sync is undefined, you need to set it");let r=de[e];if(void 0===r){const t=V(Uint8Array.from(e,e=>e.charCodeAt(0)));r=E(t,t),de[e]=r}return V(r,...t)},_JacobianPoint:g},Object.defineProperties(t.utils,{sha256Sync:{configurable:!1,get:()=>V,set(e){V||(V=e)}},hmacSha256Sync:{configurable:!1,get:()=>z,set(e){z||(z=e)}}})},7568:(e,t,r)=>{const n=t;n.bignum=r(2344),n.define=r(7363).define,n.base=r(9673),n.constants=r(2153),n.decoders=r(5234),n.encoders=r(4669)},7363:(e,t,r)=>{const n=r(4669),o=r(5234),i=r(6698);function a(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}t.define=function(e,t){return new a(e,t)},a.prototype._createNamed=function(e){const t=this.name;function r(e){this._initNamed(e,t)}return i(r,e),r.prototype._initNamed=function(t,r){e.call(this,t,r)},new r(this)},a.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(o[e])),this.decoders[e]},a.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},a.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(n[e])),this.encoders[e]},a.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},7227:(e,t,r)=>{const n=r(6698),o=r(9220).a,i=r(4774).Buffer;function a(e,t){o.call(this,t),i.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function s(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(e){return s.isEncoderBuffer(e)||(e=new s(e,t)),this.length+=e.length,e},this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=i.byteLength(e);else{if(!i.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}n(a,o),t.t=a,a.isDecoderBuffer=function(e){return e instanceof a||"object"==typeof e&&i.isBuffer(e.base)&&"DecoderBuffer"===e.constructor.name&&"number"==typeof e.offset&&"number"==typeof e.length&&"function"==typeof e.save&&"function"==typeof e.restore&&"function"==typeof e.isEmpty&&"function"==typeof e.readUInt8&&"function"==typeof e.skip&&"function"==typeof e.raw},a.prototype.save=function(){return{offset:this.offset,reporter:o.prototype.save.call(this)}},a.prototype.restore=function(e){const t=new a(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,o.prototype.restore.call(this,e.reporter),t},a.prototype.isEmpty=function(){return this.offset===this.length},a.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},a.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");const r=new a(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},a.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},t.d=s,s.isEncoderBuffer=function(e){return e instanceof s||"object"==typeof e&&"EncoderBuffer"===e.constructor.name&&"number"==typeof e.length&&"function"==typeof e.join},s.prototype.join=function(e,t){return e||(e=i.alloc(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach(function(r){r.join(e,t),t+=r.length}):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):i.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},9673:(e,t,r)=>{const n=t;n.Reporter=r(9220).a,n.DecoderBuffer=r(7227).t,n.EncoderBuffer=r(7227).d,n.Node=r(993)},993:(e,t,r)=>{const n=r(9220).a,o=r(7227).d,i=r(7227).t,a=r(3349),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"],u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s);function c(e,t,r){const n={};this._baseState=n,n.name=r,n.enc=e,n.parent=t||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}e.exports=c;const f=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];c.prototype.clone=function(){const e=this._baseState,t={};f.forEach(function(r){t[r]=e[r]});const r=new this.constructor(t.parent);return r._baseState=t,r},c.prototype._wrap=function(){const e=this._baseState;u.forEach(function(t){this[t]=function(){const r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}},this)},c.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")},c.prototype._useArgs=function(e){const t=this._baseState,r=e.filter(function(e){return e instanceof this.constructor},this);e=e.filter(function(e){return!(e instanceof this.constructor)},this),0!==r.length&&(a(null===t.children),t.children=r,r.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(r){r==(0|r)&&(r|=0);const n=e[r];t[n]=r}),t}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(e){c.prototype[e]=function(){const t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}}),s.forEach(function(e){c.prototype[e]=function(){const t=this._baseState,r=Array.prototype.slice.call(arguments);return a(null===t.tag),t.tag=e,this._useArgs(r),this}}),c.prototype.use=function(e){a(e);const t=this._baseState;return a(null===t.use),t.use=e,this},c.prototype.optional=function(){return this._baseState.optional=!0,this},c.prototype.def=function(e){const t=this._baseState;return a(null===t.default),t.default=e,t.optional=!0,this},c.prototype.explicit=function(e){const t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.explicit=e,this},c.prototype.implicit=function(e){const t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.implicit=e,this},c.prototype.obj=function(){const e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},c.prototype.key=function(e){const t=this._baseState;return a(null===t.key),t.key=e,this},c.prototype.any=function(){return this._baseState.any=!0,this},c.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},c.prototype.contains=function(e){const t=this._baseState;return a(null===t.use),t.contains=e,this},c.prototype._decode=function(e,t){const r=this._baseState;if(null===r.parent)return e.wrapResult(r.children[0]._decode(e,t));let n,o=r.default,a=!0,s=null;if(null!==r.key&&(s=e.enterKey(r.key)),r.optional){let n=null;if(null!==r.explicit?n=r.explicit:null!==r.implicit?n=r.implicit:null!==r.tag&&(n=r.tag),null!==n||r.any){if(a=this._peekTag(e,n,r.any),e.isError(a))return a}else{const n=e.save();try{null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),a=!0}catch(e){a=!1}e.restore(n)}}if(r.obj&&a&&(n=e.enterObject()),a){if(null!==r.explicit){const t=this._decodeTag(e,r.explicit);if(e.isError(t))return t;e=t}const n=e.offset;if(null===r.use&&null===r.choice){let t;r.any&&(t=e.save());const n=this._decodeTag(e,null!==r.implicit?r.implicit:r.tag,r.any);if(e.isError(n))return n;r.any?o=e.raw(t):e=n}if(t&&t.track&&null!==r.tag&&t.track(e.path(),n,e.length,"tagged"),t&&t.track&&null!==r.tag&&t.track(e.path(),e.offset,e.length,"content"),r.any||(o=null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t)),e.isError(o))return o;if(r.any||null!==r.choice||null===r.children||r.children.forEach(function(r){r._decode(e,t)}),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){const n=new i(o);o=this._getUse(r.contains,e._reporterState.obj)._decode(n,t)}}return r.obj&&a&&(o=e.leaveObject(n)),null===r.key||null===o&&!0!==a?null!==s&&e.exitKey(s):e.leaveKey(s,r.key,o),o},c.prototype._decodeGeneric=function(e,t,r){const n=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,n.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&n.args?this._decodeObjid(t,n.args[0],n.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},c.prototype._getUse=function(e,t){const r=this._baseState;return r.useDecoder=this._use(e,t),a(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},c.prototype._decodeChoice=function(e,t){const r=this._baseState;let n=null,o=!1;return Object.keys(r.choice).some(function(i){const a=e.save(),s=r.choice[i];try{const r=s._decode(e,t);if(e.isError(r))return!1;n={type:i,value:r},o=!0}catch(t){return e.restore(a),!1}return!0},this),o?n:e.error("Choice not matched")},c.prototype._createEncoderBuffer=function(e){return new o(e,this.reporter)},c.prototype._encode=function(e,t,r){const n=this._baseState;if(null!==n.default&&n.default===e)return;const o=this._encodeValue(e,t,r);return void 0===o||this._skipDefault(o,t,r)?void 0:o},c.prototype._encodeValue=function(e,t,r){const o=this._baseState;if(null===o.parent)return o.children[0]._encode(e,t||new n);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,r)._encode(e,t),s=!0;else if(o.children)a=o.children.map(function(r){if("null_"===r._baseState.tag)return r._encode(null,t,e);if(null===r._baseState.key)return t.error("Child should have a key");const n=t.enterKey(r._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");const o=r._encode(e[r._baseState.key],t,e);return t.leaveKey(n),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 r=this.clone();r._baseState.implicit=null,a=this._createEncoderBuffer(e.map(function(r){const n=this._baseState;return this._getUse(n.args[0],e)._encode(r,t)},r))}else null!==o.use?i=this._getUse(o.use,r)._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,r=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,r,a))}return null!==o.explicit&&(i=this._encodeComposite(o.explicit,!1,"context",i)),i},c.prototype._encodeChoice=function(e,t){const r=this._baseState,n=r.choice[e.type];return n||a(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(e.value,t)},c.prototype._encodePrimitive=function(e,t){const r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.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,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},c.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},c.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},9220:(e,t,r)=>{const n=r(6698);function o(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function i(e,t){this.path=e,this.rethrow(t)}t.a=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,r){const n=this._reporterState;this.exitKey(e),null!==n.obj&&(n.obj[t]=r)},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,r=t.obj;return t.obj=e,r},o.prototype.error=function(e){let t;const r=this._reporterState,n=e instanceof i;if(t=n?e:new i(r.path.map(function(e){return"["+JSON.stringify(e)+"]"}).join(""),e.message||e,e.stack),!r.options.partial)throw t;return n||r.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},n(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}},4598:(e,t)=>{function r(e){const t={};return Object.keys(e).forEach(function(r){(0|r)==r&&(r|=0);const n=e[r];t[n]=r}),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)},2153:(e,t,r)=>{const n=t;n._reverse=function(e){const t={};return Object.keys(e).forEach(function(r){(0|r)==r&&(r|=0);const n=e[r];t[n]=r}),t},n.der=r(4598)},2010:(e,t,r)=>{const n=r(6698),o=r(2344),i=r(7227).t,a=r(993),s=r(4598);function u(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new c,this.tree._init(e.body)}function c(e){a.call(this,"der",e)}function f(e,t){let r=e.readUInt8(t);if(e.isError(r))return r;const n=s.tagClass[r>>6],o=!(32&r);if(31&~r)r&=31;else{let n=r;for(r=0;!(128&~n);){if(n=e.readUInt8(t),e.isError(n))return n;r<<=7,r|=127&n}}return{cls:n,primitive:o,tag:r,tagStr:s.tag[r]}}function l(e,t,r){let n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&128===n)return null;if(!(128&n))return n;const o=127&n;if(o>4)return e.error("length octect is too long");n=0;for(let t=0;t<o;t++){n<<=8;const t=e.readUInt8(r);if(e.isError(t))return t;n|=t}return n}e.exports=u,u.prototype.decode=function(e,t){return i.isDecoderBuffer(e)||(e=new i(e,t)),this.tree._decode(e,t)},n(c,a),c.prototype._peekTag=function(e,t,r){if(e.isEmpty())return!1;const n=e.save(),o=f(e,'Failed to peek tag: "'+t+'"');return e.isError(o)?o:(e.restore(n),o.tag===t||o.tagStr===t||o.tagStr+"of"===t||r)},c.prototype._decodeTag=function(e,t,r){const n=f(e,'Failed to decode tag of "'+t+'"');if(e.isError(n))return n;let o=l(e,n.primitive,'Failed to get length of "'+t+'"');if(e.isError(o))return o;if(!r&&n.tag!==t&&n.tagStr!==t&&n.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(n.primitive||null!==o)return e.skip(o,'Failed to match body of: "'+t+'"');const i=e.save(),a=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(a)?a:(o=e.offset-i.offset,e.restore(i),e.skip(o,'Failed to match body of: "'+t+'"'))},c.prototype._skipUntilEnd=function(e,t){for(;;){const r=f(e,t);if(e.isError(r))return r;const n=l(e,r.primitive,t);if(e.isError(n))return n;let o;if(o=r.primitive||null!==n?e.skip(n):this._skipUntilEnd(e,t),e.isError(o))return o;if("end"===r.tagStr)break}},c.prototype._decodeList=function(e,t,r,n){const o=[];for(;!e.isEmpty();){const t=this._peekTag(e,"end");if(e.isError(t))return t;const i=r.decode(e,"der",n);if(e.isError(i)&&t)break;o.push(i)}return o},c.prototype._decodeStr=function(e,t){if("bitstr"===t){const t=e.readUInt8();return e.isError(t)?t:{unused:t,data:e.raw()}}if("bmpstr"===t){const t=e.raw();if(t.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");let r="";for(let e=0;e<t.length/2;e++)r+=String.fromCharCode(t.readUInt16BE(2*e));return r}if("numstr"===t){const t=e.raw().toString("ascii");return this._isNumstr(t)?t:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===t)return e.raw();if("objDesc"===t)return e.raw();if("printstr"===t){const t=e.raw().toString("ascii");return this._isPrintstr(t)?t:e.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")},c.prototype._decodeObjid=function(e,t,r){let n;const o=[];let i=0,a=0;for(;!e.isEmpty();)a=e.readUInt8(),i<<=7,i|=127&a,128&a||(o.push(i),i=0);128&a&&o.push(i);const s=o[0]/40|0,u=o[0]%40;if(n=r?o:[s,u].concat(o.slice(1)),t){let e=t[n.join(" ")];void 0===e&&(e=t[n.join(".")]),void 0!==e&&(n=e)}return n},c.prototype._decodeTime=function(e,t){const r=e.raw().toString();let n,o,i,a,s,u;if("gentime"===t)n=0|r.slice(0,4),o=0|r.slice(4,6),i=0|r.slice(6,8),a=0|r.slice(8,10),s=0|r.slice(10,12),u=0|r.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");n=0|r.slice(0,2),o=0|r.slice(2,4),i=0|r.slice(4,6),a=0|r.slice(6,8),s=0|r.slice(8,10),u=0|r.slice(10,12),n=n<70?2e3+n:1900+n}return Date.UTC(n,o-1,i,a,s,u,0)},c.prototype._decodeNull=function(){return null},c.prototype._decodeBool=function(e){const t=e.readUInt8();return e.isError(t)?t:0!==t},c.prototype._decodeInt=function(e,t){const r=e.raw();let n=new o(r);return t&&(n=t[n.toString(10)]||n),n},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree}},5234:(e,t,r)=>{const n=t;n.der=r(2010),n.pem=r(8903)},8903:(e,t,r)=>{const n=r(6698),o=r(4774).Buffer,i=r(2010);function a(e){i.call(this,e),this.enc="pem"}n(a,i),e.exports=a,a.prototype.decode=function(e,t){const r=e.toString().split(/[\r\n]+/g),n=t.label.toUpperCase(),a=/^-----(BEGIN|END) ([^-]+)-----$/;let s=-1,u=-1;for(let e=0;e<r.length;e++){const t=r[e].match(a);if(null!==t&&t[2]===n){if(-1!==s){if("END"!==t[1])break;u=e;break}if("BEGIN"!==t[1])break;s=e}}if(-1===s||-1===u)throw new Error("PEM section not found for: "+n);const c=r.slice(s+1,u).join("");c.replace(/[^a-z0-9+/=]+/gi,"");const f=o.from(c,"base64");return i.prototype.decode.call(this,f,t)}},82:(e,t,r)=>{const n=r(6698),o=r(4774).Buffer,i=r(993),a=r(4598);function s(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new u,this.tree._init(e.body)}function u(e){i.call(this,"der",e)}function c(e){return e<10?"0"+e:e}e.exports=s,s.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},n(u,i),u.prototype._encodeComposite=function(e,t,r,n){const i=function(e,t,r,n){let o;if("seqof"===e?e="seq":"setof"===e&&(e="set"),a.tagByName.hasOwnProperty(e))o=a.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return n.error("Unknown tag: "+e);o=e}return o>=31?n.error("Multi-octet tag encoding unsupported"):(t||(o|=32),o|=a.tagClassByName[r||"universal"]<<6,o)}(e,t,r,this.reporter);if(n.length<128){const e=o.alloc(2);return e[0]=i,e[1]=n.length,this._createEncoderBuffer([e,n])}let s=1;for(let e=n.length;e>=256;e>>=8)s++;const u=o.alloc(2+s);u[0]=i,u[1]=128|s;for(let e=1+s,t=n.length;t>0;e--,t>>=8)u[e]=255&t;return this._createEncoderBuffer([u,n])},u.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 r=0;r<e.length;r++)t.writeUInt16BE(e.charCodeAt(r),2*r);return this._createEncoderBuffer(t)}return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)||"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")},u.prototype._encodeObjid=function(e,t,r){if("string"==typeof e){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s.]+/g);for(let t=0;t<e.length;t++)e[t]|=0}else if(Array.isArray(e)){e=e.slice();for(let t=0;t<e.length;t++)e[t]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!r){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let n=0;for(let t=0;t<e.length;t++){let r=e[t];for(n++;r>=128;r>>=7)n++}const i=o.alloc(n);let a=i.length-1;for(let t=e.length-1;t>=0;t--){let r=e[t];for(i[a--]=127&r;(r>>=7)>0;)i[a--]=128|127&r}return this._createEncoderBuffer(i)},u.prototype._encodeTime=function(e,t){let r;const n=new Date(e);return"gentime"===t?r=[c(n.getUTCFullYear()),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[c(n.getUTCFullYear()%100),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.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 r=o.alloc(t);return e.copy(r),0===e.length&&(r[0]=0),this._createEncoderBuffer(r)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let r=1;for(let t=e;t>=256;t>>=8)r++;const n=new Array(r);for(let t=n.length-1;t>=0;t--)n[t]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(o.from(n))},u.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},u.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},u.prototype._skipDefault=function(e,t,r){const n=this._baseState;let o;if(null===n.default)return!1;const i=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),i.length!==n.defaultBuffer.length)return!1;for(o=0;o<i.length;o++)if(i[o]!==n.defaultBuffer[o])return!1;return!0}},4669:(e,t,r)=>{const n=t;n.der=r(82),n.pem=r(735)},735:(e,t,r)=>{const n=r(6698),o=r(82);function i(e){o.call(this,e),this.enc="pem"}n(i,o),e.exports=i,i.prototype.encode=function(e,t){const r=o.prototype.encode.call(this,e).toString("base64"),n=["-----BEGIN "+t.label+"-----"];for(let e=0;e<r.length;e+=64)n.push(r.slice(e,e+64));return n.push("-----END "+t.label+"-----"),n.join("\n")}},2344:function(e,t,r){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"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:r(8982).Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,r,n){for(var o=0,i=Math.min(e.length,r),a=t;a<i;a++){var s=e.charCodeAt(a)-48;o*=n,o+=s>=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,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<e.length&&(16===t?this._parseHex(e,o,r):(this._parseBase(e,t,o),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var i,a,s=0;if("be"===r)for(o=e.length-1,i=0;o>=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<<s&67108863,this.words[i+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===r)for(o=0,i=0;o<e.length;o+=3)a=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[i]|=a<<s&67108863,this.words[i+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,i=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)o=u(e,t,n)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)o=u(e,t,n)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=t)n++;n--,o=o/t|0;for(var i=e.length-r,a=i%n,s=Math.min(i,i-a)+r,u=0,f=r;f<s;f+=n)u=c(e,f,f+n,t),this.imuln(o),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var l=1;for(u=c(e,f,e.length,t),f=0;f<a;f++)l*=t;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&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?"<BN-R: ":"<BN: ")+this.toString(16)+">"};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"],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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c<n;c++){for(var f=u>>>26,l=67108863&u,d=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=d;h++){var p=c-h|0;f+=(a=(o=0|e.words[p])*(i=0|t.words[h])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var o=0,i=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<o|i)).toString(16);i=s>>>24-o&16777215,(o+=2)>=26&&(o-=26,a--),r=0!==i||a!==this.length-1?f[6-u.length]+u+r:u+r}for(0!==i&&(r=i.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],h=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(h).toString(e);r=(p=p.idivn(h)).isZero()?y+r:f[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!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&&n(!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 n(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,r){var o=this.byteLength(),i=r||Math.max(1,o);n(o<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(i),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[s]=a;for(;s<i;s++)c[s]=0}else{for(s=0;s<i-o;s++)c[s]=0;for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[i-s-1]=a}return c},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},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;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},i.prototype.ior=function(e){return n(!(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.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 r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},i.prototype.iand=function(e){return n(!(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.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,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},i.prototype.ixor=function(e){return n(!(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.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){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var o=0;o<t;o++)this.words[o]=67108863&~this.words[o];return r>0&&(this.words[o]=~this.words[o]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,o=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<o:this.words[r]&~(1<<o),this.strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var o=0,i=0;i<n.length;i++)t=(0|r.words[i])+(0|n.words[i])+o,this.words[i]=67108863&t,o=t>>>26;for(;0!==o&&i<r.length;i++)t=(0|r.words[i])+o,this.words[i]=67108863&t,o=t>>>26;if(this.length=r.length,0!==o)this.words[this.length]=o,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.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 r,n,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)i=(t=(0|r.words[a])-(0|n.words[a])+i)>>26,this.words[a]=67108863&t;for(;0!==i&&a<r.length;a++)i=(t=(0|r.words[a])+i)>>26,this.words[a]=67108863&t;if(0===i&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,o,i,a=e.words,s=t.words,u=r.words,c=0,f=0|a[0],l=8191&f,d=f>>>13,h=0|a[1],p=8191&h,y=h>>>13,m=0|a[2],b=8191&m,g=m>>>13,v=0|a[3],w=8191&v,S=v>>>13,M=0|a[4],_=8191&M,A=M>>>13,E=0|a[5],O=8191&E,j=E>>>13,T=0|a[6],N=8191&T,P=T>>>13,B=0|a[7],R=8191&B,C=B>>>13,x=0|a[8],I=8191&x,k=x>>>13,H=0|a[9],U=8191&H,L=H>>>13,D=0|s[0],V=8191&D,z=D>>>13,J=0|s[1],K=8191&J,F=J>>>13,q=0|s[2],W=8191&q,G=q>>>13,Z=0|s[3],$=8191&Z,X=Z>>>13,Q=0|s[4],Y=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,fe=0|s[8],le=8191&fe,de=fe>>>13,he=0|s[9],pe=8191&he,ye=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(n=Math.imul(l,V))|0)+((8191&(o=(o=Math.imul(l,z))+Math.imul(d,V)|0))<<13)|0;c=((i=Math.imul(d,z))+(o>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,V),o=(o=Math.imul(p,z))+Math.imul(y,V)|0,i=Math.imul(y,z);var be=(c+(n=n+Math.imul(l,K)|0)|0)+((8191&(o=(o=o+Math.imul(l,F)|0)+Math.imul(d,K)|0))<<13)|0;c=((i=i+Math.imul(d,F)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(b,V),o=(o=Math.imul(b,z))+Math.imul(g,V)|0,i=Math.imul(g,z),n=n+Math.imul(p,K)|0,o=(o=o+Math.imul(p,F)|0)+Math.imul(y,K)|0,i=i+Math.imul(y,F)|0;var ge=(c+(n=n+Math.imul(l,W)|0)|0)+((8191&(o=(o=o+Math.imul(l,G)|0)+Math.imul(d,W)|0))<<13)|0;c=((i=i+Math.imul(d,G)|0)+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,V),o=(o=Math.imul(w,z))+Math.imul(S,V)|0,i=Math.imul(S,z),n=n+Math.imul(b,K)|0,o=(o=o+Math.imul(b,F)|0)+Math.imul(g,K)|0,i=i+Math.imul(g,F)|0,n=n+Math.imul(p,W)|0,o=(o=o+Math.imul(p,G)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,G)|0;var ve=(c+(n=n+Math.imul(l,$)|0)|0)+((8191&(o=(o=o+Math.imul(l,X)|0)+Math.imul(d,$)|0))<<13)|0;c=((i=i+Math.imul(d,X)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(_,V),o=(o=Math.imul(_,z))+Math.imul(A,V)|0,i=Math.imul(A,z),n=n+Math.imul(w,K)|0,o=(o=o+Math.imul(w,F)|0)+Math.imul(S,K)|0,i=i+Math.imul(S,F)|0,n=n+Math.imul(b,W)|0,o=(o=o+Math.imul(b,G)|0)+Math.imul(g,W)|0,i=i+Math.imul(g,G)|0,n=n+Math.imul(p,$)|0,o=(o=o+Math.imul(p,X)|0)+Math.imul(y,$)|0,i=i+Math.imul(y,X)|0;var we=(c+(n=n+Math.imul(l,Y)|0)|0)+((8191&(o=(o=o+Math.imul(l,ee)|0)+Math.imul(d,Y)|0))<<13)|0;c=((i=i+Math.imul(d,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(O,V),o=(o=Math.imul(O,z))+Math.imul(j,V)|0,i=Math.imul(j,z),n=n+Math.imul(_,K)|0,o=(o=o+Math.imul(_,F)|0)+Math.imul(A,K)|0,i=i+Math.imul(A,F)|0,n=n+Math.imul(w,W)|0,o=(o=o+Math.imul(w,G)|0)+Math.imul(S,W)|0,i=i+Math.imul(S,G)|0,n=n+Math.imul(b,$)|0,o=(o=o+Math.imul(b,X)|0)+Math.imul(g,$)|0,i=i+Math.imul(g,X)|0,n=n+Math.imul(p,Y)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(y,Y)|0,i=i+Math.imul(y,ee)|0;var Se=(c+(n=n+Math.imul(l,re)|0)|0)+((8191&(o=(o=o+Math.imul(l,ne)|0)+Math.imul(d,re)|0))<<13)|0;c=((i=i+Math.imul(d,ne)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(N,V),o=(o=Math.imul(N,z))+Math.imul(P,V)|0,i=Math.imul(P,z),n=n+Math.imul(O,K)|0,o=(o=o+Math.imul(O,F)|0)+Math.imul(j,K)|0,i=i+Math.imul(j,F)|0,n=n+Math.imul(_,W)|0,o=(o=o+Math.imul(_,G)|0)+Math.imul(A,W)|0,i=i+Math.imul(A,G)|0,n=n+Math.imul(w,$)|0,o=(o=o+Math.imul(w,X)|0)+Math.imul(S,$)|0,i=i+Math.imul(S,X)|0,n=n+Math.imul(b,Y)|0,o=(o=o+Math.imul(b,ee)|0)+Math.imul(g,Y)|0,i=i+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,o=(o=o+Math.imul(p,ne)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ne)|0;var Me=(c+(n=n+Math.imul(l,ie)|0)|0)+((8191&(o=(o=o+Math.imul(l,ae)|0)+Math.imul(d,ie)|0))<<13)|0;c=((i=i+Math.imul(d,ae)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(R,V),o=(o=Math.imul(R,z))+Math.imul(C,V)|0,i=Math.imul(C,z),n=n+Math.imul(N,K)|0,o=(o=o+Math.imul(N,F)|0)+Math.imul(P,K)|0,i=i+Math.imul(P,F)|0,n=n+Math.imul(O,W)|0,o=(o=o+Math.imul(O,G)|0)+Math.imul(j,W)|0,i=i+Math.imul(j,G)|0,n=n+Math.imul(_,$)|0,o=(o=o+Math.imul(_,X)|0)+Math.imul(A,$)|0,i=i+Math.imul(A,X)|0,n=n+Math.imul(w,Y)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(S,Y)|0,i=i+Math.imul(S,ee)|0,n=n+Math.imul(b,re)|0,o=(o=o+Math.imul(b,ne)|0)+Math.imul(g,re)|0,i=i+Math.imul(g,ne)|0,n=n+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,ae)|0;var _e=(c+(n=n+Math.imul(l,ue)|0)|0)+((8191&(o=(o=o+Math.imul(l,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((i=i+Math.imul(d,ce)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(I,V),o=(o=Math.imul(I,z))+Math.imul(k,V)|0,i=Math.imul(k,z),n=n+Math.imul(R,K)|0,o=(o=o+Math.imul(R,F)|0)+Math.imul(C,K)|0,i=i+Math.imul(C,F)|0,n=n+Math.imul(N,W)|0,o=(o=o+Math.imul(N,G)|0)+Math.imul(P,W)|0,i=i+Math.imul(P,G)|0,n=n+Math.imul(O,$)|0,o=(o=o+Math.imul(O,X)|0)+Math.imul(j,$)|0,i=i+Math.imul(j,X)|0,n=n+Math.imul(_,Y)|0,o=(o=o+Math.imul(_,ee)|0)+Math.imul(A,Y)|0,i=i+Math.imul(A,ee)|0,n=n+Math.imul(w,re)|0,o=(o=o+Math.imul(w,ne)|0)+Math.imul(S,re)|0,i=i+Math.imul(S,ne)|0,n=n+Math.imul(b,ie)|0,o=(o=o+Math.imul(b,ae)|0)+Math.imul(g,ie)|0,i=i+Math.imul(g,ae)|0,n=n+Math.imul(p,ue)|0,o=(o=o+Math.imul(p,ce)|0)+Math.imul(y,ue)|0,i=i+Math.imul(y,ce)|0;var Ae=(c+(n=n+Math.imul(l,le)|0)|0)+((8191&(o=(o=o+Math.imul(l,de)|0)+Math.imul(d,le)|0))<<13)|0;c=((i=i+Math.imul(d,de)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,V),o=(o=Math.imul(U,z))+Math.imul(L,V)|0,i=Math.imul(L,z),n=n+Math.imul(I,K)|0,o=(o=o+Math.imul(I,F)|0)+Math.imul(k,K)|0,i=i+Math.imul(k,F)|0,n=n+Math.imul(R,W)|0,o=(o=o+Math.imul(R,G)|0)+Math.imul(C,W)|0,i=i+Math.imul(C,G)|0,n=n+Math.imul(N,$)|0,o=(o=o+Math.imul(N,X)|0)+Math.imul(P,$)|0,i=i+Math.imul(P,X)|0,n=n+Math.imul(O,Y)|0,o=(o=o+Math.imul(O,ee)|0)+Math.imul(j,Y)|0,i=i+Math.imul(j,ee)|0,n=n+Math.imul(_,re)|0,o=(o=o+Math.imul(_,ne)|0)+Math.imul(A,re)|0,i=i+Math.imul(A,ne)|0,n=n+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,ae)|0)+Math.imul(S,ie)|0,i=i+Math.imul(S,ae)|0,n=n+Math.imul(b,ue)|0,o=(o=o+Math.imul(b,ce)|0)+Math.imul(g,ue)|0,i=i+Math.imul(g,ce)|0,n=n+Math.imul(p,le)|0,o=(o=o+Math.imul(p,de)|0)+Math.imul(y,le)|0,i=i+Math.imul(y,de)|0;var Ee=(c+(n=n+Math.imul(l,pe)|0)|0)+((8191&(o=(o=o+Math.imul(l,ye)|0)+Math.imul(d,pe)|0))<<13)|0;c=((i=i+Math.imul(d,ye)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,K),o=(o=Math.imul(U,F))+Math.imul(L,K)|0,i=Math.imul(L,F),n=n+Math.imul(I,W)|0,o=(o=o+Math.imul(I,G)|0)+Math.imul(k,W)|0,i=i+Math.imul(k,G)|0,n=n+Math.imul(R,$)|0,o=(o=o+Math.imul(R,X)|0)+Math.imul(C,$)|0,i=i+Math.imul(C,X)|0,n=n+Math.imul(N,Y)|0,o=(o=o+Math.imul(N,ee)|0)+Math.imul(P,Y)|0,i=i+Math.imul(P,ee)|0,n=n+Math.imul(O,re)|0,o=(o=o+Math.imul(O,ne)|0)+Math.imul(j,re)|0,i=i+Math.imul(j,ne)|0,n=n+Math.imul(_,ie)|0,o=(o=o+Math.imul(_,ae)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,ae)|0,n=n+Math.imul(w,ue)|0,o=(o=o+Math.imul(w,ce)|0)+Math.imul(S,ue)|0,i=i+Math.imul(S,ce)|0,n=n+Math.imul(b,le)|0,o=(o=o+Math.imul(b,de)|0)+Math.imul(g,le)|0,i=i+Math.imul(g,de)|0;var Oe=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;c=((i=i+Math.imul(y,ye)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(U,W),o=(o=Math.imul(U,G))+Math.imul(L,W)|0,i=Math.imul(L,G),n=n+Math.imul(I,$)|0,o=(o=o+Math.imul(I,X)|0)+Math.imul(k,$)|0,i=i+Math.imul(k,X)|0,n=n+Math.imul(R,Y)|0,o=(o=o+Math.imul(R,ee)|0)+Math.imul(C,Y)|0,i=i+Math.imul(C,ee)|0,n=n+Math.imul(N,re)|0,o=(o=o+Math.imul(N,ne)|0)+Math.imul(P,re)|0,i=i+Math.imul(P,ne)|0,n=n+Math.imul(O,ie)|0,o=(o=o+Math.imul(O,ae)|0)+Math.imul(j,ie)|0,i=i+Math.imul(j,ae)|0,n=n+Math.imul(_,ue)|0,o=(o=o+Math.imul(_,ce)|0)+Math.imul(A,ue)|0,i=i+Math.imul(A,ce)|0,n=n+Math.imul(w,le)|0,o=(o=o+Math.imul(w,de)|0)+Math.imul(S,le)|0,i=i+Math.imul(S,de)|0;var je=(c+(n=n+Math.imul(b,pe)|0)|0)+((8191&(o=(o=o+Math.imul(b,ye)|0)+Math.imul(g,pe)|0))<<13)|0;c=((i=i+Math.imul(g,ye)|0)+(o>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(U,$),o=(o=Math.imul(U,X))+Math.imul(L,$)|0,i=Math.imul(L,X),n=n+Math.imul(I,Y)|0,o=(o=o+Math.imul(I,ee)|0)+Math.imul(k,Y)|0,i=i+Math.imul(k,ee)|0,n=n+Math.imul(R,re)|0,o=(o=o+Math.imul(R,ne)|0)+Math.imul(C,re)|0,i=i+Math.imul(C,ne)|0,n=n+Math.imul(N,ie)|0,o=(o=o+Math.imul(N,ae)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,ae)|0,n=n+Math.imul(O,ue)|0,o=(o=o+Math.imul(O,ce)|0)+Math.imul(j,ue)|0,i=i+Math.imul(j,ce)|0,n=n+Math.imul(_,le)|0,o=(o=o+Math.imul(_,de)|0)+Math.imul(A,le)|0,i=i+Math.imul(A,de)|0;var Te=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,ye)|0)+Math.imul(S,pe)|0))<<13)|0;c=((i=i+Math.imul(S,ye)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,Y),o=(o=Math.imul(U,ee))+Math.imul(L,Y)|0,i=Math.imul(L,ee),n=n+Math.imul(I,re)|0,o=(o=o+Math.imul(I,ne)|0)+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,n=n+Math.imul(R,ie)|0,o=(o=o+Math.imul(R,ae)|0)+Math.imul(C,ie)|0,i=i+Math.imul(C,ae)|0,n=n+Math.imul(N,ue)|0,o=(o=o+Math.imul(N,ce)|0)+Math.imul(P,ue)|0,i=i+Math.imul(P,ce)|0,n=n+Math.imul(O,le)|0,o=(o=o+Math.imul(O,de)|0)+Math.imul(j,le)|0,i=i+Math.imul(j,de)|0;var Ne=(c+(n=n+Math.imul(_,pe)|0)|0)+((8191&(o=(o=o+Math.imul(_,ye)|0)+Math.imul(A,pe)|0))<<13)|0;c=((i=i+Math.imul(A,ye)|0)+(o>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(U,re),o=(o=Math.imul(U,ne))+Math.imul(L,re)|0,i=Math.imul(L,ne),n=n+Math.imul(I,ie)|0,o=(o=o+Math.imul(I,ae)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,ae)|0,n=n+Math.imul(R,ue)|0,o=(o=o+Math.imul(R,ce)|0)+Math.imul(C,ue)|0,i=i+Math.imul(C,ce)|0,n=n+Math.imul(N,le)|0,o=(o=o+Math.imul(N,de)|0)+Math.imul(P,le)|0,i=i+Math.imul(P,de)|0;var Pe=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(o=(o=o+Math.imul(O,ye)|0)+Math.imul(j,pe)|0))<<13)|0;c=((i=i+Math.imul(j,ye)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,ie),o=(o=Math.imul(U,ae))+Math.imul(L,ie)|0,i=Math.imul(L,ae),n=n+Math.imul(I,ue)|0,o=(o=o+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,i=i+Math.imul(k,ce)|0,n=n+Math.imul(R,le)|0,o=(o=o+Math.imul(R,de)|0)+Math.imul(C,le)|0,i=i+Math.imul(C,de)|0;var Be=(c+(n=n+Math.imul(N,pe)|0)|0)+((8191&(o=(o=o+Math.imul(N,ye)|0)+Math.imul(P,pe)|0))<<13)|0;c=((i=i+Math.imul(P,ye)|0)+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(U,ue),o=(o=Math.imul(U,ce))+Math.imul(L,ue)|0,i=Math.imul(L,ce),n=n+Math.imul(I,le)|0,o=(o=o+Math.imul(I,de)|0)+Math.imul(k,le)|0,i=i+Math.imul(k,de)|0;var Re=(c+(n=n+Math.imul(R,pe)|0)|0)+((8191&(o=(o=o+Math.imul(R,ye)|0)+Math.imul(C,pe)|0))<<13)|0;c=((i=i+Math.imul(C,ye)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,le),o=(o=Math.imul(U,de))+Math.imul(L,le)|0,i=Math.imul(L,de);var Ce=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(o=(o=o+Math.imul(I,ye)|0)+Math.imul(k,pe)|0))<<13)|0;c=((i=i+Math.imul(k,ye)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var xe=(c+(n=Math.imul(U,pe))|0)+((8191&(o=(o=Math.imul(U,ye))+Math.imul(L,pe)|0))<<13)|0;return c=((i=Math.imul(L,ye))+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,u[0]=me,u[1]=be,u[2]=ge,u[3]=ve,u[4]=we,u[5]=Se,u[6]=Me,u[7]=_e,u[8]=Ae,u[9]=Ee,u[10]=Oe,u[11]=je,u[12]=Te,u[13]=Ne,u[14]=Pe,u[15]=Be,u[16]=Re,u[17]=Ce,u[18]=xe,0!==c&&(u[19]=c,r.length++),r};function y(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(p=h),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,o=0,i=0;i<r.length-1;i++){var a=o;o=0;for(var s=67108863&n,u=Math.min(i,t.length-1),c=Math.max(0,i-e.length+1);c<=u;c++){var f=i-c,l=(0|e.words[f])*(0|t.words[c]),d=67108863&l;s=67108863&(d=d+s|0),o+=(a=(a=a+(l/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[i]=s,n=a,a=o}return 0!==n?r.words[i]=n:r.length--,r.strip()}(this,e,t):y(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,o=0;o<t;o++)n|=(1&e)<<t-o-1,e>>=1;return n},m.prototype.permute=function(e,t,r,n,o,i){for(var a=0;a<i;a++)n[a]=t[e[a]],o[a]=r[e[a]]},m.prototype.transform=function(e,t,r,n,o,i){this.permute(i,e,t,r,n,o);for(var a=1;a<o;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),f=0;f<o;f+=s)for(var l=u,d=c,h=0;h<a;h++){var p=r[f+h],y=n[f+h],m=r[f+h+a],b=n[f+h+a],g=l*m-d*b;b=l*b+d*m,m=g,r[f+h]=p+m,n[f+h]=y+b,r[f+h+a]=p-m,n[f+h+a]=y-b,h!==s&&(g=u*l-c*d,d=u*d+c*l,l=g)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,o=0;for(r=r/2|0;r;r>>>=1)o++;return 1<<o+1+n},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var o=e[n];e[n]=e[r-n-1],e[r-n-1]=o,o=t[n],t[n]=-t[r-n-1],t[r-n-1]=-o}},m.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var o=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&o,r=o<67108864?0:o/67108864|0}return e},m.prototype.convert13b=function(e,t,r,o){for(var i=0,a=0;a<t;a++)i+=0|e[a],r[2*a]=8191&i,i>>>=13,r[2*a+1]=8191&i,i>>>=13;for(a=2*t;a<o;++a)r[a]=0;n(0===i),n(!(-8192&i))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),o=this.makeRBT(n),i=this.stub(n),a=new Array(n),s=new Array(n),u=new Array(n),c=new Array(n),f=new Array(n),l=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,c,n),this.transform(a,i,s,u,n,o),this.transform(c,i,f,l,n,o);for(var h=0;h<n;h++){var p=s[h]*f[h]-u[h]*l[h];u[h]=s[h]*l[h]+u[h]*f[h],s[h]=p}return this.conjugate(s,u,n),this.transform(s,u,d,i,n,o),this.conjugate(d,i,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),y(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var o=(0|this.words[r])*e,i=(67108863&o)+(67108863&t);t>>=26,t+=o/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=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()),r=0;r<t.length;r++){var n=r/26|0,o=r%26;t[r]=(e.words[n]&1<<o)>>>o}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var o=r.sqr();n<t.length;n++,o=o.sqr())0!==t[n]&&(r=r.mul(o));return r},i.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,o=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&i,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}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<o;t++)this.words[t]=0;this.length+=o}return this.strip()},i.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,r){var o;n("number"==typeof e&&e>=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<<i,u=r;if(o-=a,o=Math.max(0,o),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var f=0;for(c=this.length-1;c>=0&&(0!==f||c>=o);c--){var l=0|this.words[c];this.words[c]=f<<26-i|l>>>i,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},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){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,o=1<<t;return!(this.length<=r||!(this.words[r]&o))},i.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var o=67108863^67108863>>>t<<t;this.words[this.length-1]&=o}return this.strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[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(n("number"==typeof e),n(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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var o,i,a=e.length+r;this._expand(a);var s=0;for(o=0;o<e.length;o++){i=(0|this.words[o+r])+s;var u=(0|e.words[o])*t;s=((i-=67108863&u)>>26)-(u/67108864|0),this.words[o+r]=67108863&i}for(;o<this.length-r;o++)s=(i=(0|this.words[o+r])+s)>>26,this.words[o+r]=67108863&i;if(0===s)return this.strip();for(n(-1===s),s=0,o=0;o<this.length;o++)s=(i=-(0|this.words[o])+s)>>26,this.words[o]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!=(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,u=n.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var f=n.clone()._ishlnsubmul(o,1,u);0===f.negative&&(n=f,s&&(s.words[u]=1));for(var l=u-1;l>=0;l--){var d=67108864*(0|n.words[o.length+l])+(0|n.words[o.length+l-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(o,d,l);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(o,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,r){return n(!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(),r&&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}):this.negative&e.negative?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&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 r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),o=e.andln(1),i=r.cmp(n);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){n(e<=67108863);for(var t=(1<<26)%e,r=0,o=this.length-1;o>=0;o--)r=(t*r+(0|this.words[o]))%e;return r},i.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var o=(0|this.words[r])+67108864*t;this.words[r]=o/e|0,t=o%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=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),u=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),l=t.clone();!t.isZero();){for(var d=0,h=1;!(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(f),a.isub(l)),o.iushrn(1),a.iushrn(1);for(var p=0,y=1;!(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s),a.isub(u)):(r.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;!(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,d=1;!(r.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.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(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var o=t.cmp(r);if(o<0){var i=t;t=r,r=i}else if(0===o||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return!(1&this.words[0])},i.prototype.isOdd=function(){return!(1&~this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,o=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=o,this;for(var i=o,a=r;0!==i&&a<this.length;a++){var s=0|this.words[a];i=(s+=i)>>>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,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:o<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],o=0|e.words[r];if(n!==o){n<o?t=-1:n>o&&(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)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(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 g(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 v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(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)}g.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},o(v,g),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),o=0;o<n;o++)t.words[o]=e.words[o];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=i&r,o=10;o<e.length;o++){var a=0|e.words[o];e.words[o-10]=(a&r)<<4|i>>>22,i=a}i>>>=22,e.words[o-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},o(w,g),o(S,g),o(M,g),M.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,o=67108863&n;n>>>=26,e.words[r]=o,t=n}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 v;else if("p224"===e)t=new w;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return b[e]=t,t},_.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,t){n(!(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},_.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},_.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,o),d=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var y=h,m=0;0!==y.cmp(s);m++)y=y.redSqr();n(m<p);var b=this.pow(l,new i(1).iushln(p-m-1));d=d.redMul(b),l=b.redSqr(),h=h.redMul(l),p=m}return d},_.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},_.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var o=r[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],f=u-1;f>=0;f--){var l=c>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==a?(a<<=1,a|=l,(4==++s||0===n&&0===f)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}u=26}return o},_.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},_.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new A(e)},o(A,_),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).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)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).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)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},7526:(e,t)=>{t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=s(e),a=i[0],u=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),f=0,l=u>0?a-4:a;for(r=0;r<l;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[f++]=t>>16&255,c[f++]=t>>8&255,c[f++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[f++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,s=0,c=n-o;s<c;s+=a)i.push(u(e,s,s+a>c?c:s+a));return 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]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},9404:function(e,t,r){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"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:r(7790).Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,r,o){for(var i=0,a=0,s=Math.min(e.length,r),u=t;u<s;u++){var c=e.charCodeAt(u)-48;i*=o,a=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a<o,"Invalid character"),i+=a}return i}function f(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(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,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<e.length&&(16===t?this._parseHex(e,o,r):(this._parseBase(e,t,o),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var i,a,s=0;if("be"===r)for(o=e.length-1,i=0;o>=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<<s&67108863,this.words[i+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===r)for(o=0,i=0;o<e.length;o+=3)a=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[i]|=a<<s&67108863,this.words[i+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,i=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)o=u(e,t,n)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)o=u(e,t,n)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this._strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=t)n++;n--,o=o/t|0;for(var i=e.length-r,a=i%n,s=Math.min(i,i-a)+r,u=0,f=r;f<s;f+=n)u=c(e,f,f+n,t),this.imuln(o),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var l=1;for(u=c(e,f,e.length,t),f=0;f<a;f++)l*=t;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype._move=function(e){f(e,this)},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&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?"<BN-R: ":"<BN: ")+this.toString(16)+">"}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"],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];function y(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c<n;c++){for(var f=u>>>26,l=67108863&u,d=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=d;h++){var p=c-h|0;f+=(a=(o=0|e.words[p])*(i=0|t.words[h])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var o=0,i=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<o|i)).toString(16);i=s>>>24-o&16777215,(o+=2)>=26&&(o-=26,a--),r=0!==i||a!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==i&&(r=i.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],f=p[e];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var y=l.modrn(f).toString(e);r=(l=l.idivn(f)).isZero()?y+r:d[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!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&&n(!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)},i.prototype.toArrayLike=function(e,t,r){this._strip();var o=this.byteLength(),i=r||Math.max(1,o);n(o<=i,"byte array longer than desired length"),n(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 r=0,n=0,o=0,i=0;o<this.length;o++){var a=this.words[o]<<i|n;e[r++]=255&a,r<e.length&&(e[r++]=a>>8&255),r<e.length&&(e[r++]=a>>16&255),6===i?(r<e.length&&(e[r++]=a>>24&255),n=0,i=0):(n=a>>>24,i+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},i.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,o=0,i=0;o<this.length;o++){var a=this.words[o]<<i|n;e[r--]=255&a,r>=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===i?(r>=0&&(e[r--]=a>>24&255),n=0,i=0):(n=a>>>24,i+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},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;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},i.prototype.ior=function(e){return n(!(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.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 r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},i.prototype.iand=function(e){return n(!(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.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,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},i.prototype.ixor=function(e){return n(!(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.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){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var o=0;o<t;o++)this.words[o]=67108863&~this.words[o];return r>0&&(this.words[o]=~this.words[o]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,o=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<o:this.words[r]&~(1<<o),this._strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var o=0,i=0;i<n.length;i++)t=(0|r.words[i])+(0|n.words[i])+o,this.words[i]=67108863&t,o=t>>>26;for(;0!==o&&i<r.length;i++)t=(0|r.words[i])+o,this.words[i]=67108863&t,o=t>>>26;if(this.length=r.length,0!==o)this.words[this.length]=o,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.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 r,n,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)i=(t=(0|r.words[a])-(0|n.words[a])+i)>>26,this.words[a]=67108863&t;for(;0!==i&&a<r.length;a++)i=(t=(0|r.words[a])+i)>>26,this.words[a]=67108863&t;if(0===i&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var n,o,i,a=e.words,s=t.words,u=r.words,c=0,f=0|a[0],l=8191&f,d=f>>>13,h=0|a[1],p=8191&h,y=h>>>13,m=0|a[2],b=8191&m,g=m>>>13,v=0|a[3],w=8191&v,S=v>>>13,M=0|a[4],_=8191&M,A=M>>>13,E=0|a[5],O=8191&E,j=E>>>13,T=0|a[6],N=8191&T,P=T>>>13,B=0|a[7],R=8191&B,C=B>>>13,x=0|a[8],I=8191&x,k=x>>>13,H=0|a[9],U=8191&H,L=H>>>13,D=0|s[0],V=8191&D,z=D>>>13,J=0|s[1],K=8191&J,F=J>>>13,q=0|s[2],W=8191&q,G=q>>>13,Z=0|s[3],$=8191&Z,X=Z>>>13,Q=0|s[4],Y=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,fe=0|s[8],le=8191&fe,de=fe>>>13,he=0|s[9],pe=8191&he,ye=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(n=Math.imul(l,V))|0)+((8191&(o=(o=Math.imul(l,z))+Math.imul(d,V)|0))<<13)|0;c=((i=Math.imul(d,z))+(o>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,V),o=(o=Math.imul(p,z))+Math.imul(y,V)|0,i=Math.imul(y,z);var be=(c+(n=n+Math.imul(l,K)|0)|0)+((8191&(o=(o=o+Math.imul(l,F)|0)+Math.imul(d,K)|0))<<13)|0;c=((i=i+Math.imul(d,F)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(b,V),o=(o=Math.imul(b,z))+Math.imul(g,V)|0,i=Math.imul(g,z),n=n+Math.imul(p,K)|0,o=(o=o+Math.imul(p,F)|0)+Math.imul(y,K)|0,i=i+Math.imul(y,F)|0;var ge=(c+(n=n+Math.imul(l,W)|0)|0)+((8191&(o=(o=o+Math.imul(l,G)|0)+Math.imul(d,W)|0))<<13)|0;c=((i=i+Math.imul(d,G)|0)+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,V),o=(o=Math.imul(w,z))+Math.imul(S,V)|0,i=Math.imul(S,z),n=n+Math.imul(b,K)|0,o=(o=o+Math.imul(b,F)|0)+Math.imul(g,K)|0,i=i+Math.imul(g,F)|0,n=n+Math.imul(p,W)|0,o=(o=o+Math.imul(p,G)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,G)|0;var ve=(c+(n=n+Math.imul(l,$)|0)|0)+((8191&(o=(o=o+Math.imul(l,X)|0)+Math.imul(d,$)|0))<<13)|0;c=((i=i+Math.imul(d,X)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(_,V),o=(o=Math.imul(_,z))+Math.imul(A,V)|0,i=Math.imul(A,z),n=n+Math.imul(w,K)|0,o=(o=o+Math.imul(w,F)|0)+Math.imul(S,K)|0,i=i+Math.imul(S,F)|0,n=n+Math.imul(b,W)|0,o=(o=o+Math.imul(b,G)|0)+Math.imul(g,W)|0,i=i+Math.imul(g,G)|0,n=n+Math.imul(p,$)|0,o=(o=o+Math.imul(p,X)|0)+Math.imul(y,$)|0,i=i+Math.imul(y,X)|0;var we=(c+(n=n+Math.imul(l,Y)|0)|0)+((8191&(o=(o=o+Math.imul(l,ee)|0)+Math.imul(d,Y)|0))<<13)|0;c=((i=i+Math.imul(d,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(O,V),o=(o=Math.imul(O,z))+Math.imul(j,V)|0,i=Math.imul(j,z),n=n+Math.imul(_,K)|0,o=(o=o+Math.imul(_,F)|0)+Math.imul(A,K)|0,i=i+Math.imul(A,F)|0,n=n+Math.imul(w,W)|0,o=(o=o+Math.imul(w,G)|0)+Math.imul(S,W)|0,i=i+Math.imul(S,G)|0,n=n+Math.imul(b,$)|0,o=(o=o+Math.imul(b,X)|0)+Math.imul(g,$)|0,i=i+Math.imul(g,X)|0,n=n+Math.imul(p,Y)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(y,Y)|0,i=i+Math.imul(y,ee)|0;var Se=(c+(n=n+Math.imul(l,re)|0)|0)+((8191&(o=(o=o+Math.imul(l,ne)|0)+Math.imul(d,re)|0))<<13)|0;c=((i=i+Math.imul(d,ne)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(N,V),o=(o=Math.imul(N,z))+Math.imul(P,V)|0,i=Math.imul(P,z),n=n+Math.imul(O,K)|0,o=(o=o+Math.imul(O,F)|0)+Math.imul(j,K)|0,i=i+Math.imul(j,F)|0,n=n+Math.imul(_,W)|0,o=(o=o+Math.imul(_,G)|0)+Math.imul(A,W)|0,i=i+Math.imul(A,G)|0,n=n+Math.imul(w,$)|0,o=(o=o+Math.imul(w,X)|0)+Math.imul(S,$)|0,i=i+Math.imul(S,X)|0,n=n+Math.imul(b,Y)|0,o=(o=o+Math.imul(b,ee)|0)+Math.imul(g,Y)|0,i=i+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,o=(o=o+Math.imul(p,ne)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ne)|0;var Me=(c+(n=n+Math.imul(l,ie)|0)|0)+((8191&(o=(o=o+Math.imul(l,ae)|0)+Math.imul(d,ie)|0))<<13)|0;c=((i=i+Math.imul(d,ae)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(R,V),o=(o=Math.imul(R,z))+Math.imul(C,V)|0,i=Math.imul(C,z),n=n+Math.imul(N,K)|0,o=(o=o+Math.imul(N,F)|0)+Math.imul(P,K)|0,i=i+Math.imul(P,F)|0,n=n+Math.imul(O,W)|0,o=(o=o+Math.imul(O,G)|0)+Math.imul(j,W)|0,i=i+Math.imul(j,G)|0,n=n+Math.imul(_,$)|0,o=(o=o+Math.imul(_,X)|0)+Math.imul(A,$)|0,i=i+Math.imul(A,X)|0,n=n+Math.imul(w,Y)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(S,Y)|0,i=i+Math.imul(S,ee)|0,n=n+Math.imul(b,re)|0,o=(o=o+Math.imul(b,ne)|0)+Math.imul(g,re)|0,i=i+Math.imul(g,ne)|0,n=n+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,ae)|0;var _e=(c+(n=n+Math.imul(l,ue)|0)|0)+((8191&(o=(o=o+Math.imul(l,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((i=i+Math.imul(d,ce)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(I,V),o=(o=Math.imul(I,z))+Math.imul(k,V)|0,i=Math.imul(k,z),n=n+Math.imul(R,K)|0,o=(o=o+Math.imul(R,F)|0)+Math.imul(C,K)|0,i=i+Math.imul(C,F)|0,n=n+Math.imul(N,W)|0,o=(o=o+Math.imul(N,G)|0)+Math.imul(P,W)|0,i=i+Math.imul(P,G)|0,n=n+Math.imul(O,$)|0,o=(o=o+Math.imul(O,X)|0)+Math.imul(j,$)|0,i=i+Math.imul(j,X)|0,n=n+Math.imul(_,Y)|0,o=(o=o+Math.imul(_,ee)|0)+Math.imul(A,Y)|0,i=i+Math.imul(A,ee)|0,n=n+Math.imul(w,re)|0,o=(o=o+Math.imul(w,ne)|0)+Math.imul(S,re)|0,i=i+Math.imul(S,ne)|0,n=n+Math.imul(b,ie)|0,o=(o=o+Math.imul(b,ae)|0)+Math.imul(g,ie)|0,i=i+Math.imul(g,ae)|0,n=n+Math.imul(p,ue)|0,o=(o=o+Math.imul(p,ce)|0)+Math.imul(y,ue)|0,i=i+Math.imul(y,ce)|0;var Ae=(c+(n=n+Math.imul(l,le)|0)|0)+((8191&(o=(o=o+Math.imul(l,de)|0)+Math.imul(d,le)|0))<<13)|0;c=((i=i+Math.imul(d,de)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,V),o=(o=Math.imul(U,z))+Math.imul(L,V)|0,i=Math.imul(L,z),n=n+Math.imul(I,K)|0,o=(o=o+Math.imul(I,F)|0)+Math.imul(k,K)|0,i=i+Math.imul(k,F)|0,n=n+Math.imul(R,W)|0,o=(o=o+Math.imul(R,G)|0)+Math.imul(C,W)|0,i=i+Math.imul(C,G)|0,n=n+Math.imul(N,$)|0,o=(o=o+Math.imul(N,X)|0)+Math.imul(P,$)|0,i=i+Math.imul(P,X)|0,n=n+Math.imul(O,Y)|0,o=(o=o+Math.imul(O,ee)|0)+Math.imul(j,Y)|0,i=i+Math.imul(j,ee)|0,n=n+Math.imul(_,re)|0,o=(o=o+Math.imul(_,ne)|0)+Math.imul(A,re)|0,i=i+Math.imul(A,ne)|0,n=n+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,ae)|0)+Math.imul(S,ie)|0,i=i+Math.imul(S,ae)|0,n=n+Math.imul(b,ue)|0,o=(o=o+Math.imul(b,ce)|0)+Math.imul(g,ue)|0,i=i+Math.imul(g,ce)|0,n=n+Math.imul(p,le)|0,o=(o=o+Math.imul(p,de)|0)+Math.imul(y,le)|0,i=i+Math.imul(y,de)|0;var Ee=(c+(n=n+Math.imul(l,pe)|0)|0)+((8191&(o=(o=o+Math.imul(l,ye)|0)+Math.imul(d,pe)|0))<<13)|0;c=((i=i+Math.imul(d,ye)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,K),o=(o=Math.imul(U,F))+Math.imul(L,K)|0,i=Math.imul(L,F),n=n+Math.imul(I,W)|0,o=(o=o+Math.imul(I,G)|0)+Math.imul(k,W)|0,i=i+Math.imul(k,G)|0,n=n+Math.imul(R,$)|0,o=(o=o+Math.imul(R,X)|0)+Math.imul(C,$)|0,i=i+Math.imul(C,X)|0,n=n+Math.imul(N,Y)|0,o=(o=o+Math.imul(N,ee)|0)+Math.imul(P,Y)|0,i=i+Math.imul(P,ee)|0,n=n+Math.imul(O,re)|0,o=(o=o+Math.imul(O,ne)|0)+Math.imul(j,re)|0,i=i+Math.imul(j,ne)|0,n=n+Math.imul(_,ie)|0,o=(o=o+Math.imul(_,ae)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,ae)|0,n=n+Math.imul(w,ue)|0,o=(o=o+Math.imul(w,ce)|0)+Math.imul(S,ue)|0,i=i+Math.imul(S,ce)|0,n=n+Math.imul(b,le)|0,o=(o=o+Math.imul(b,de)|0)+Math.imul(g,le)|0,i=i+Math.imul(g,de)|0;var Oe=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;c=((i=i+Math.imul(y,ye)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(U,W),o=(o=Math.imul(U,G))+Math.imul(L,W)|0,i=Math.imul(L,G),n=n+Math.imul(I,$)|0,o=(o=o+Math.imul(I,X)|0)+Math.imul(k,$)|0,i=i+Math.imul(k,X)|0,n=n+Math.imul(R,Y)|0,o=(o=o+Math.imul(R,ee)|0)+Math.imul(C,Y)|0,i=i+Math.imul(C,ee)|0,n=n+Math.imul(N,re)|0,o=(o=o+Math.imul(N,ne)|0)+Math.imul(P,re)|0,i=i+Math.imul(P,ne)|0,n=n+Math.imul(O,ie)|0,o=(o=o+Math.imul(O,ae)|0)+Math.imul(j,ie)|0,i=i+Math.imul(j,ae)|0,n=n+Math.imul(_,ue)|0,o=(o=o+Math.imul(_,ce)|0)+Math.imul(A,ue)|0,i=i+Math.imul(A,ce)|0,n=n+Math.imul(w,le)|0,o=(o=o+Math.imul(w,de)|0)+Math.imul(S,le)|0,i=i+Math.imul(S,de)|0;var je=(c+(n=n+Math.imul(b,pe)|0)|0)+((8191&(o=(o=o+Math.imul(b,ye)|0)+Math.imul(g,pe)|0))<<13)|0;c=((i=i+Math.imul(g,ye)|0)+(o>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(U,$),o=(o=Math.imul(U,X))+Math.imul(L,$)|0,i=Math.imul(L,X),n=n+Math.imul(I,Y)|0,o=(o=o+Math.imul(I,ee)|0)+Math.imul(k,Y)|0,i=i+Math.imul(k,ee)|0,n=n+Math.imul(R,re)|0,o=(o=o+Math.imul(R,ne)|0)+Math.imul(C,re)|0,i=i+Math.imul(C,ne)|0,n=n+Math.imul(N,ie)|0,o=(o=o+Math.imul(N,ae)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,ae)|0,n=n+Math.imul(O,ue)|0,o=(o=o+Math.imul(O,ce)|0)+Math.imul(j,ue)|0,i=i+Math.imul(j,ce)|0,n=n+Math.imul(_,le)|0,o=(o=o+Math.imul(_,de)|0)+Math.imul(A,le)|0,i=i+Math.imul(A,de)|0;var Te=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,ye)|0)+Math.imul(S,pe)|0))<<13)|0;c=((i=i+Math.imul(S,ye)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,Y),o=(o=Math.imul(U,ee))+Math.imul(L,Y)|0,i=Math.imul(L,ee),n=n+Math.imul(I,re)|0,o=(o=o+Math.imul(I,ne)|0)+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,n=n+Math.imul(R,ie)|0,o=(o=o+Math.imul(R,ae)|0)+Math.imul(C,ie)|0,i=i+Math.imul(C,ae)|0,n=n+Math.imul(N,ue)|0,o=(o=o+Math.imul(N,ce)|0)+Math.imul(P,ue)|0,i=i+Math.imul(P,ce)|0,n=n+Math.imul(O,le)|0,o=(o=o+Math.imul(O,de)|0)+Math.imul(j,le)|0,i=i+Math.imul(j,de)|0;var Ne=(c+(n=n+Math.imul(_,pe)|0)|0)+((8191&(o=(o=o+Math.imul(_,ye)|0)+Math.imul(A,pe)|0))<<13)|0;c=((i=i+Math.imul(A,ye)|0)+(o>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(U,re),o=(o=Math.imul(U,ne))+Math.imul(L,re)|0,i=Math.imul(L,ne),n=n+Math.imul(I,ie)|0,o=(o=o+Math.imul(I,ae)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,ae)|0,n=n+Math.imul(R,ue)|0,o=(o=o+Math.imul(R,ce)|0)+Math.imul(C,ue)|0,i=i+Math.imul(C,ce)|0,n=n+Math.imul(N,le)|0,o=(o=o+Math.imul(N,de)|0)+Math.imul(P,le)|0,i=i+Math.imul(P,de)|0;var Pe=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(o=(o=o+Math.imul(O,ye)|0)+Math.imul(j,pe)|0))<<13)|0;c=((i=i+Math.imul(j,ye)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,ie),o=(o=Math.imul(U,ae))+Math.imul(L,ie)|0,i=Math.imul(L,ae),n=n+Math.imul(I,ue)|0,o=(o=o+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,i=i+Math.imul(k,ce)|0,n=n+Math.imul(R,le)|0,o=(o=o+Math.imul(R,de)|0)+Math.imul(C,le)|0,i=i+Math.imul(C,de)|0;var Be=(c+(n=n+Math.imul(N,pe)|0)|0)+((8191&(o=(o=o+Math.imul(N,ye)|0)+Math.imul(P,pe)|0))<<13)|0;c=((i=i+Math.imul(P,ye)|0)+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(U,ue),o=(o=Math.imul(U,ce))+Math.imul(L,ue)|0,i=Math.imul(L,ce),n=n+Math.imul(I,le)|0,o=(o=o+Math.imul(I,de)|0)+Math.imul(k,le)|0,i=i+Math.imul(k,de)|0;var Re=(c+(n=n+Math.imul(R,pe)|0)|0)+((8191&(o=(o=o+Math.imul(R,ye)|0)+Math.imul(C,pe)|0))<<13)|0;c=((i=i+Math.imul(C,ye)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,le),o=(o=Math.imul(U,de))+Math.imul(L,le)|0,i=Math.imul(L,de);var Ce=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(o=(o=o+Math.imul(I,ye)|0)+Math.imul(k,pe)|0))<<13)|0;c=((i=i+Math.imul(k,ye)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var xe=(c+(n=Math.imul(U,pe))|0)+((8191&(o=(o=Math.imul(U,ye))+Math.imul(L,pe)|0))<<13)|0;return c=((i=Math.imul(L,ye))+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,u[0]=me,u[1]=be,u[2]=ge,u[3]=ve,u[4]=we,u[5]=Se,u[6]=Me,u[7]=_e,u[8]=Ae,u[9]=Ee,u[10]=Oe,u[11]=je,u[12]=Te,u[13]=Ne,u[14]=Pe,u[15]=Be,u[16]=Re,u[17]=Ce,u[18]=xe,0!==c&&(u[19]=c,r.length++),r};function b(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,o=0,i=0;i<r.length-1;i++){var a=o;o=0;for(var s=67108863&n,u=Math.min(i,t.length-1),c=Math.max(0,i-e.length+1);c<=u;c++){var f=i-c,l=(0|e.words[f])*(0|t.words[c]),d=67108863&l;s=67108863&(d=d+s|0),o+=(a=(a=a+(l/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[i]=s,n=a,a=o}return 0!==n?r.words[i]=n:r.length--,r._strip()}function g(e,t,r){return b(e,t,r)}Math.imul||(m=y),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?y(this,e,t):r<1024?b(this,e,t):g(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),g(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,o=0;o<this.length;o++){var i=(0|this.words[o])*e,a=(67108863&i)+(67108863&r);r>>=26,r+=i/67108864|0,r+=a>>>26,this.words[o]=67108863&a}return 0!==r&&(this.words[o]=r,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()),r=0;r<t.length;r++){var n=r/26|0,o=r%26;t[r]=e.words[n]>>>o&1}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var o=r.sqr();n<t.length;n++,o=o.sqr())0!==t[n]&&(r=r.mul(o));return r},i.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,o=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&i,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}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<o;t++)this.words[t]=0;this.length+=o}return this._strip()},i.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,r){var o;n("number"==typeof e&&e>=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<<i,u=r;if(o-=a,o=Math.max(0,o),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var f=0;for(c=this.length-1;c>=0&&(0!==f||c>=o);c--){var l=0|this.words[c];this.words[c]=f<<26-i|l>>>i,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},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){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,o=1<<t;return!(this.length<=r||!(this.words[r]&o))},i.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var o=67108863^67108863>>>t<<t;this.words[this.length-1]&=o}return this._strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[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(n("number"==typeof e),n(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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var o,i,a=e.length+r;this._expand(a);var s=0;for(o=0;o<e.length;o++){i=(0|this.words[o+r])+s;var u=(0|e.words[o])*t;s=((i-=67108863&u)>>26)-(u/67108864|0),this.words[o+r]=67108863&i}for(;o<this.length-r;o++)s=(i=(0|this.words[o+r])+s)>>26,this.words[o+r]=67108863&i;if(0===s)return this._strip();for(n(-1===s),s=0,o=0;o<this.length;o++)s=(i=-(0|this.words[o])+s)>>26,this.words[o]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!=(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,u=n.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var f=n.clone()._ishlnsubmul(o,1,u);0===f.negative&&(n=f,s&&(s.words[u]=1));for(var l=u-1;l>=0;l--){var d=67108864*(0|n.words[o.length+l])+(0|n.words[o.length+l-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(o,d,l);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(o,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=d)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,r){return n(!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(),r&&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}):this.negative&e.negative?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&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 r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),o=e.andln(1),i=r.cmp(n);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),n(e<=67108863);for(var r=(1<<26)%e,o=0,i=this.length-1;i>=0;i--)o=(r*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),n(e<=67108863);for(var r=0,o=this.length-1;o>=0;o--){var i=(0|this.words[o])+67108864*r;this.words[o]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=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),u=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),l=t.clone();!t.isZero();){for(var d=0,h=1;!(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(f),a.isub(l)),o.iushrn(1),a.iushrn(1);for(var p=0,y=1;!(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s),a.isub(u)):(r.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;!(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,d=1;!(r.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.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(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var o=t.cmp(r);if(o<0){var i=t;t=r,r=i}else if(0===o||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return!(1&this.words[0])},i.prototype.isOdd=function(){return!(1&~this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,o=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=o,this;for(var i=o,a=r;0!==i&&a<this.length;a++){var s=0|this.words[a];i=(s+=i)>>>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,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:o<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],o=0|e.words[r];if(n!==o){n<o?t=-1:n>o&&(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 n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(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 S(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){w.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 n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function O(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)}w.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},o(S,w),S.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),o=0;o<n;o++)t.words[o]=e.words[o];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=i&r,o=10;o<e.length;o++){var a=0|e.words[o];e.words[o-10]=(a&r)<<4|i>>>22,i=a}i>>>=22,e.words[o-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},S.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},o(M,w),o(_,w),o(A,w),A.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,o=67108863&n;n>>>=26,e.words[r]=o,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new S;else if("p224"===e)t=new M;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return v[e]=t,t},E.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){n(!(e.negative|t.negative),"red works only with positives"),n(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):(f(e,e.umod(this.m)._forceRed(this)),e)},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 r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},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(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,o),d=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var y=h,m=0;0!==y.cmp(s);m++)y=y.redSqr();n(m<p);var b=this.pow(l,new i(1).iushln(p-m-1));d=d.redMul(b),l=b.redSqr(),h=h.redMul(l),p=m}return d},E.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},E.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var o=r[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],f=u-1;f>=0;f--){var l=c>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==a?(a<<=1,a|=l,(4==++s||0===n&&0===f)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}u=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 O(e)},o(O,E),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},O.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).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)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).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)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},5037:(e,t,r)=>{var n;function o(e){this.rand=e}if(e.exports=function(e){return n||(n=new o(null)),n.generate(e)},e.exports.Rand=o,o.prototype.generate=function(e){return this._rand(e)},o.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?o.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?o.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(o.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var i=r(3776);if("function"!=typeof i.randomBytes)throw new Error("Not supported");o.prototype._rand=function(e){return i.randomBytes(e)}}catch(e){}},8287:(e,t,r)=>{const n=r(7526),o=r(251),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=s(r);const o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const o=function(e){if(u.isBuffer(e)){const t=0|p(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||$(e.length)?s(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return f(e),s(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),r=s(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function p(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(e).length;default:if(o)return n?-1:q(e).length;t=(""+t).toLowerCase(),o=!0}}function m(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,r);case"utf8":case"utf-8":return O(this,t,r);case"ascii":return T(this,t,r);case"latin1":case"binary":return N(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),$(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,o){let i,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let n=-1;for(i=r;i<s;i++)if(c(e,i)===c(t,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===u)return n*a}else-1!==n&&(i-=i-n),n=-1}else for(r+u>s&&(r=s-u),i=r;i>=0;i--){let r=!0;for(let n=0;n<u;n++)if(c(e,i+n)!==c(t,n)){r=!1;break}if(r)return i}return-1}function w(e,t,r,n){r=Number(r)||0;const o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;const i=t.length;let a;for(n>i/2&&(n=i/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if($(n))return a;e[r+a]=n}return a}function S(e,t,r,n){return G(q(t,e.length-r),e,r,n)}function M(e,t,r,n){return G(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function _(e,t,r,n){return G(W(t),e,r,n)}function A(e,t,r,n){return G(function(e,t){let r,n,o;const i=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function E(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function O(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o<r;){const t=e[o];let i=null,a=t>239?4:t>223?3:t>191?2:1;if(o+a<=r){let r,n,s,u;switch(a){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(i=u));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(i=u));break;case 4:r=e[o+1],n=e[o+2],s=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(i=u))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(e){const t=e.length;if(t<=j)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=j));return r}(n)}t.kMaxLength=a,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return f(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}(e,t,r)},u.allocUnsafe=function(e){return l(e)},u.allocUnsafeSlow=function(e){return l(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(Z(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),Z(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let o=0;for(r=0;r<e.length;++r){let t=e[r];if(Z(t,Uint8Array))o+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)b(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?O(this,0,e):m.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,o){if(Z(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(i,a),c=this.slice(n,o),f=e.slice(t,r);for(let e=0;e<s;++e)if(c[e]!==f[e]){i=c[e],a=f[e];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":case"latin1":case"binary":return M(this,e,t,r);case"base64":return _(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const j=4096;function T(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function N(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function P(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=t;n<r;++n)o+=X[e[n]];return o}function B(e,t,r){const n=e.slice(t,r);let o="";for(let e=0;e<n.length-1;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}function R(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function C(e,t,r,n,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function x(e,t,r,n,o){z(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function I(e,t,r,n,o){z(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function k(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function H(e,t,r,n,i){return t=+t,r>>>=0,i||k(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,i){return t=+t,r>>>=0,i||k(e,0,r,8),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(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),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=Q(function(e){J(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))}),u.prototype.readBigUInt64BE=Q(function(e){J(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)}),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=Q(function(e){J(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),u.prototype.readBigInt64BE=Q(function(e){J(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||R(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||C(this,e,t,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||C(this,e,t,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=Q(function(e,t=0){return x(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=Q(function(e,t=0){return I(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}let o=0,i=1,a=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}let o=r-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=Q(function(e,t=0){return x(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=Q(function(e,t=0){return I(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeFloatLE=function(e,t,r){return H(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return H(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{const i=u.isBuffer(e)?e:u.from(e,n),a=i.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=i[o%a]}return this};const L={};function D(e,t,r){L[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function V(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function z(e,t,r,n,o,i){if(e>r||e<t){const r="bigint"==typeof t?"n":"";let n;throw n=0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(i+1)}${r}`:`>= -(2${r} ** ${8*(i+1)-1}${r}) and < 2 ** ${8*(i+1)-1}${r}`,new L.ERR_OUT_OF_RANGE("value",n,e)}!function(e,t,r){J(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||K(t,e.length-(r+1))}(n,o,i)}function J(e,t){if("number"!=typeof e)throw new L.ERR_INVALID_ARG_TYPE(t,"number",e)}function K(e,t,r){if(Math.floor(e)!==e)throw J(e,r),new L.ERR_OUT_OF_RANGE("offset","an integer",e);if(t<0)throw new L.ERR_BUFFER_OUT_OF_BOUNDS;throw new L.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,e)}D("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),D("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),D("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=V(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=V(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);const F=/[^+/0-9A-Za-z-_]/g;function q(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function W(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function $(e){return e!=e}const X=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function Q(e){return"undefined"==typeof BigInt?Y:e}function Y(){throw new Error("BigInt not supported")}},6866:e=>{e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},3144:(e,t,r)=>{var n=r(6743),o=r(1002),i=r(76),a=r(7119);e.exports=a||n.call(i,o)},2205:(e,t,r)=>{var n=r(6743),o=r(1002),i=r(3144);e.exports=function(){return i(n,o,arguments)}},1002:e=>{e.exports=Function.prototype.apply},76:e=>{e.exports=Function.prototype.call},3126:(e,t,r)=>{var n=r(6743),o=r(9675),i=r(76),a=r(3144);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new o("a function is required");return a(n,i,e)}},7119:e=>{e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},8075:(e,t,r)=>{var n=r(453),o=r(487),i=o(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o(r):r}},487:(e,t,r)=>{var n=r(6897),o=r(655),i=r(3126),a=r(2205);e.exports=function(e){var t=i(arguments),r=e.length-(arguments.length-1);return n(t,1+(r>0?r:0),!0)},o?o(e.exports,"apply",{value:a}):e.exports.apply=a},6556:(e,t,r)=>{var n=r(453),o=r(3126),i=o([n("%String.prototype.indexOf%")]);e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o([r]):r}},41:(e,t,r)=>{var n=r(655),o=r(8068),i=r(9675),a=r(5795);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new i("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,f=arguments.length>6&&arguments[6],l=!!a&&a(e,t);if(n)n(e,t,{configurable:null===c&&l?l.configurable:!c,enumerable:null===s&&l?l.enumerable:!s,value:r,writable:null===u&&l?l.writable:!u});else{if(!f&&(s||u||c))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},7176:(e,t,r)=>{var n,o=r(3126),i=r(5795);try{n=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var a=!!n&&i&&i(Object.prototype,"__proto__"),s=Object,u=s.getPrototypeOf;e.exports=a&&"function"==typeof a.get?o([a.get]):"function"==typeof u&&function(e){return u(null==e?e:s(e))}},6729:(e,t,r)=>{var n=t;n.version=r(9255).rE,n.utils=r(7011),n.rand=r(5037),n.curve=r(894),n.curves=r(480),n.ec=r(7447),n.eddsa=r(8650)},6677:(e,t,r)=>{var n=r(8490),o=r(7011),i=o.getNAF,a=o.getJSF,s=o.assert;function u(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){s(e.precomputed);var r=e._getDoubles(),n=i(t,1,this._bitLength),o=(1<<r.step+1)-(r.step%2==0?2:1);o/=3;var a,u,c=[];for(a=0;a<n.length;a+=r.step){u=0;for(var f=a+r.step-1;f>=a;f--)u=(u<<1)+n[f];c.push(u)}for(var l=this.jpoint(null,null,null),d=this.jpoint(null,null,null),h=o;h>0;h--){for(a=0;a<c.length;a++)(u=c[a])===h?d=d.mixedAdd(r.points[a]):u===-h&&(d=d.mixedAdd(r.points[a].neg()));l=l.add(d)}return l.toP()},u.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var o=n.points,a=i(t,r,this._bitLength),u=this.jpoint(null,null,null),c=a.length-1;c>=0;c--){for(var f=0;c>=0&&0===a[c];c--)f++;if(c>=0&&f++,u=u.dblp(f),c<0)break;var l=a[c];s(0!==l),u="affine"===e.type?l>0?u.mixedAdd(o[l-1>>1]):u.mixedAdd(o[-l-1>>1].neg()):l>0?u.add(o[l-1>>1]):u.add(o[-l-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,n,o){var s,u,c,f=this._wnafT1,l=this._wnafT2,d=this._wnafT3,h=0;for(s=0;s<n;s++){var p=(c=t[s])._getNAFPoints(e);f[s]=p.wnd,l[s]=p.points}for(s=n-1;s>=1;s-=2){var y=s-1,m=s;if(1===f[y]&&1===f[m]){var b=[t[y],null,null,t[m]];0===t[y].y.cmp(t[m].y)?(b[1]=t[y].add(t[m]),b[2]=t[y].toJ().mixedAdd(t[m].neg())):0===t[y].y.cmp(t[m].y.redNeg())?(b[1]=t[y].toJ().mixedAdd(t[m]),b[2]=t[y].add(t[m].neg())):(b[1]=t[y].toJ().mixedAdd(t[m]),b[2]=t[y].toJ().mixedAdd(t[m].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],v=a(r[y],r[m]);for(h=Math.max(v[0].length,h),d[y]=new Array(h),d[m]=new Array(h),u=0;u<h;u++){var w=0|v[0][u],S=0|v[1][u];d[y][u]=g[3*(w+1)+(S+1)],d[m][u]=0,l[y]=b}}else d[y]=i(r[y],f[y],this._bitLength),d[m]=i(r[m],f[m],this._bitLength),h=Math.max(d[y].length,h),h=Math.max(d[m].length,h)}var M=this.jpoint(null,null,null),_=this._wnafT4;for(s=h;s>=0;s--){for(var A=0;s>=0;){var E=!0;for(u=0;u<n;u++)_[u]=0|d[u][s],0!==_[u]&&(E=!1);if(!E)break;A++,s--}if(s>=0&&A++,M=M.dblp(A),s<0)break;for(u=0;u<n;u++){var O=_[u];0!==O&&(O>0?c=l[u][O-1>>1]:O<0&&(c=l[u][-O-1>>1].neg()),M="affine"===c.type?M.mixedAdd(c):M.add(c))}}for(s=0;s<n;s++)l[s]=null;return o?M:M.toP()},u.BasePoint=c,c.prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(e,t){e=o.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?s(e[e.length-1]%2==0):7===e[0]&&s(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(e){return this.encode(e,!0)},c.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},c.prototype.encode=function(e,t){return o.encode(this._encode(t),e)},c.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},c.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,o=0;o<t;o+=e){for(var i=0;i<e;i++)n=n.dbl();r.push(n)}return{step:e,points:r}},c.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),o=1;o<r;o++)t[o]=t[o-1].add(n);return{wnd:e,points:t}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},1298:(e,t,r)=>{var n=r(7011),o=r(8490),i=r(6698),a=r(6677),s=n.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new o(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new o(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new o(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,r,n,i){a.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new o(t,16),this.y=new o(r,16),this.z=n?new o(n,16):this.curve.one,this.t=i&&new o(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}i(u,a),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},u.prototype.pointFromX=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(i.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var u=s.fromRed().isOdd();return(t&&!u||!t&&u)&&(s=s.redNeg()),this.point(e,s)},u.prototype.pointFromY=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(i.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),o=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(o)},i(c,a.BasePoint),u.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},u.prototype.point=function(e,t,r,n){return new c(this,e,t,r,n)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),o=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),i=n.redAdd(t),a=i.redSub(r),s=n.redSub(t),u=o.redMul(a),c=i.redMul(s),f=o.redMul(s),l=a.redMul(i);return this.curve.point(u,c,l,f)},c.prototype._projDbl=function(){var e,t,r,n,o,i,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(s)).redAdd(u);this.zOne?(e=a.redSub(s).redSub(u).redMul(c.redSub(this.curve.two)),t=c.redMul(n.redSub(u)),r=c.redSqr().redSub(c).redSub(c)):(o=this.z.redSqr(),i=c.redSub(o).redISub(o),e=a.redSub(s).redISub(u).redMul(i),t=c.redMul(n.redSub(u)),r=c.redMul(i))}else n=s.redAdd(u),o=this.curve._mulC(this.z).redSqr(),i=n.redSub(o).redSub(o),e=this.curve._mulC(a.redISub(n)).redMul(i),t=this.curve._mulC(n).redMul(s.redISub(u)),r=n.redMul(i);return this.curve.point(e,t,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),o=this.z.redMul(e.z.redAdd(e.z)),i=r.redSub(t),a=o.redSub(n),s=o.redAdd(n),u=r.redAdd(t),c=i.redMul(a),f=s.redMul(u),l=i.redMul(u),d=a.redMul(s);return this.curve.point(c,f,d,l)},c.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),o=n.redSqr(),i=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(i).redMul(a),u=o.redSub(s),c=o.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(a),l=n.redMul(u).redMul(f);return this.curve.twisted?(t=n.redMul(c).redMul(a.redSub(this.curve._mulA(i))),r=u.redMul(c)):(t=n.redMul(c).redMul(a.redSub(i)),r=this.curve._mulC(u).redMul(c)),this.curve.point(l,t,r)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},894:(e,t,r)=>{var n=t;n.base=r(6677),n.short=r(9188),n.mont=r(370),n.edwards=r(1298)},370:(e,t,r)=>{var n=r(8490),o=r(6698),i=r(6677),a=r(7011);function s(e){i.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){i.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(s,i),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},o(u,i.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},s.prototype.point=function(e,t){return new u(this,e,t)},s.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),o=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,o)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),o=e.x.redAdd(e.z),i=e.x.redSub(e.z).redMul(r),a=o.redMul(n),s=t.z.redMul(i.redAdd(a).redSqr()),u=t.x.redMul(i.redISub(a).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),o=[];0!==t.cmpn(0);t.iushrn(1))o.push(t.andln(1));for(var i=o.length-1;i>=0;i--)0===o[i]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},9188:(e,t,r)=>{var n=r(7011),o=r(8490),i=r(6698),a=r(6677),s=n.assert;function u(e){a.call(this,"short",e),this.a=new o(e.a,16).toRed(this.red),this.b=new o(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,n){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new o(t,16),this.y=new o(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function f(e,t,r,n){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new o(0)):(this.x=new o(t,16),this.y=new o(r,16),this.z=new o(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}i(u,a),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new o(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new o(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?r=i[0]:(r=i[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new o(e.a,16),b:new o(e.b,16)}}):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:o.mont(e),r=new o(2).toRed(t).redInvm(),n=r.redNeg(),i=new o(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,n,i,a,s,u,c,f,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),p=new o(1),y=new o(0),m=new o(0),b=new o(1),g=0;0!==d.cmpn(0);){var v=h.div(d);c=h.sub(v.mul(d)),f=m.sub(v.mul(p));var w=b.sub(v.mul(y));if(!n&&c.cmp(l)<0)t=u.neg(),r=p,n=c.neg(),i=f;else if(n&&2==++g)break;u=c,h=d,d=c,m=p,p=f,b=y,y=w}a=c.neg(),s=f;var S=n.sqr().add(i.sqr());return a.sqr().add(s.sqr()).cmp(S)>=0&&(a=t,s=r),n.negative&&(n=n.neg(),i=i.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:i},{a:a,b:s}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],o=n.b.mul(e).divRound(this.n),i=r.b.neg().mul(e).divRound(this.n),a=o.mul(r.a),s=i.mul(n.a),u=o.mul(r.b),c=i.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),o=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(o).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,o=this._endoWnafT2,i=0;i<e.length;i++){var a=this._endoSplit(t[i]),s=e[i],u=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),n[2*i]=s,n[2*i+1]=u,o[2*i]=a.k1,o[2*i+1]=a.k2}for(var c=this._wnafMulAdd(1,n,o,2*i,r),f=0;f<2*i;f++)n[f]=null,o[f]=null;return c},i(c,a.BasePoint),u.prototype.point=function(e,t,r){return new c(this,e,t,r)},u.prototype.pointFromJSON=function(e,t){return c.fromJSON(this,e,t)},c.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},c.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},c.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function o(t){return e.point(t[0],t[1],r)}var i=t[2];return n.precomputed={beta:null,doubles:i.doubles&&{step:i.doubles.step,points:[n].concat(i.doubles.points.map(o))},naf:i.naf&&{wnd:i.naf.wnd,points:[n].concat(i.naf.points.map(o))}},n},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),o=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),i=o.redSqr().redISub(this.x.redAdd(this.x)),a=o.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new o(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o):this.curve._wnafMulAdd(1,n,o,2)},c.prototype.jmulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o,!0):this.curve._wnafMulAdd(1,n,o,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},i(f,a.BasePoint),u.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),o=e.x.redMul(r),i=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(o),u=i.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),f=c.redMul(s),l=n.redMul(c),d=u.redSqr().redIAdd(f).redISub(l).redISub(l),h=u.redMul(l.redISub(d)).redISub(i.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,h,p)},f.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),o=this.y,i=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=o.redSub(i);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),f=r.redMul(u),l=s.redSqr().redIAdd(c).redISub(f).redISub(f),d=s.redMul(f.redISub(l)).redISub(o.redMul(c)),h=this.z.redMul(a);return this.curve.jpoint(l,d,h)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,o=this.curve.tinv,i=this.x,a=this.y,s=this.z,u=s.redSqr().redSqr(),c=a.redAdd(a);for(t=0;t<e;t++){var f=i.redSqr(),l=c.redSqr(),d=l.redSqr(),h=f.redAdd(f).redIAdd(f).redIAdd(n.redMul(u)),p=i.redMul(l),y=h.redSqr().redISub(p.redAdd(p)),m=p.redISub(y),b=h.redMul(m);b=b.redIAdd(b).redISub(d);var g=c.redMul(s);t+1<e&&(u=u.redMul(d)),i=y,s=g,c=b}return this.curve.jpoint(i,c.redMul(o),s)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},f.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),a=this.x.redAdd(o).redSqr().redISub(n).redISub(i);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),u=s.redSqr().redISub(a).redISub(a),c=i.redIAdd(i);c=(c=c.redIAdd(c)).redIAdd(c),e=u,t=s.redMul(a.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),l=this.y.redSqr(),d=l.redSqr(),h=this.x.redAdd(l).redSqr().redISub(f).redISub(d);h=h.redIAdd(h);var p=f.redAdd(f).redIAdd(f),y=p.redSqr(),m=d.redIAdd(d);m=(m=m.redIAdd(m)).redIAdd(m),e=y.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},f.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),a=this.x.redAdd(o).redSqr().redISub(n).redISub(i);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=s.redSqr().redISub(a).redISub(a);e=u;var c=i.redIAdd(i);c=(c=c.redIAdd(c)).redIAdd(c),t=s.redMul(a.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),l=this.y.redSqr(),d=this.x.redMul(l),h=this.x.redSub(f).redMul(this.x.redAdd(f));h=h.redAdd(h).redIAdd(h);var p=d.redIAdd(d),y=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(y),r=this.y.redAdd(this.z).redSqr().redISub(l).redISub(f);var m=l.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=h.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},f.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,o=n.redSqr().redSqr(),i=t.redSqr(),a=r.redSqr(),s=i.redAdd(i).redIAdd(i).redIAdd(e.redMul(o)),u=t.redAdd(t),c=(u=u.redIAdd(u)).redMul(a),f=s.redSqr().redISub(c.redAdd(c)),l=c.redISub(f),d=a.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=s.redMul(l).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(f,h,p)},f.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),o=e.redAdd(e).redIAdd(e),i=o.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(i)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=o.redIAdd(a).redSqr().redISub(i).redISub(s).redISub(u),f=t.redMul(c);f=(f=f.redIAdd(f)).redIAdd(f);var l=this.x.redMul(s).redISub(f);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.y.redMul(c.redMul(u.redISub(c)).redISub(a.redMul(s)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(l,d,h)},f.prototype.mul=function(e,t){return e=new o(e,t),this.curve._wnafMul(this,e)},f.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),o=r.redMul(e.z);return 0===this.y.redMul(o).redISub(e.y.redMul(n)).cmpn(0)},f.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),o=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(o),0===this.x.cmp(r))return!0}},f.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},480:(e,t,r)=>{var n,o=t,i=r(7952),a=r(894),s=r(7011).assert;function u(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 c(e,t){Object.defineProperty(o,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(o,e,{configurable:!0,enumerable:!0,value:r}),r}})}o.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:i.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:i.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:i.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash: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"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash: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"]}),c("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"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(4011)}catch(e){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},7447:(e,t,r)=>{var n=r(8490),o=r(2723),i=r(7011),a=r(480),s=r(5037),u=i.assert,c=r(1200),f=r(8545);function l(e){if(!(this instanceof l))return new l(e);"string"==typeof e&&(u(Object.prototype.hasOwnProperty.call(a,e),"Unknown curve "+e),e=a[e]),e instanceof a.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=l,l.prototype.keyPair=function(e){return new c(this,e)},l.prototype.keyFromPrivate=function(e,t){return c.fromPrivate(this,e,t)},l.prototype.keyFromPublic=function(e,t){return c.fromPublic(this,e,t)},l.prototype.genKeyPair=function(e){e||(e={});for(var t=new o({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||s(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new n(2));;){var a=new n(t.generate(r));if(!(a.cmp(i)>0))return a.iaddn(1),this.keyFromPrivate(a)}},l.prototype._truncateToN=function(e,t,r){var o;if(n.isBN(e)||"number"==typeof e)o=(e=new n(e,16)).byteLength();else if("object"==typeof e)o=e.length,e=new n(e,16);else{var i=e.toString();o=i.length+1>>>1,e=new n(i,16)}"number"!=typeof r&&(r=8*o);var a=r-this.n.bitLength();return a>0&&(e=e.ushrn(a)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},l.prototype.sign=function(e,t,r,i){if("object"==typeof r&&(i=r,r=null),i||(i={}),"string"!=typeof e&&"number"!=typeof e&&!n.isBN(e)){u("object"==typeof e&&e&&"number"==typeof e.length,"Expected message to be an array-like, a hex string, or a BN instance"),u(e.length>>>0===e.length);for(var a=0;a<e.length;a++)u((255&e[a])===e[a])}t=this.keyFromPrivate(t,r),e=this._truncateToN(e,!1,i.msgBitLength),u(!e.isNeg(),"Can not sign a negative message");var s=this.n.byteLength(),c=t.getPrivate().toArray("be",s),l=e.toArray("be",s);u(new n(l).eq(e),"Can not sign message");for(var d=new o({hash:this.hash,entropy:c,nonce:l,pers:i.pers,persEnc:i.persEnc||"utf8"}),h=this.n.sub(new n(1)),p=0;;p++){var y=i.k?i.k(p):new n(d.generate(this.n.byteLength()));if(!((y=this._truncateToN(y,!0)).cmpn(1)<=0||y.cmp(h)>=0)){var m=this.g.mul(y);if(!m.isInfinity()){var b=m.getX(),g=b.umod(this.n);if(0!==g.cmpn(0)){var v=y.invm(this.n).mul(g.mul(t.getPrivate()).iadd(e));if(0!==(v=v.umod(this.n)).cmpn(0)){var w=(m.getY().isOdd()?1:0)|(0!==b.cmp(g)?2:0);return i.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),w^=1),new f({r:g,s:v,recoveryParam:w})}}}}}},l.prototype.verify=function(e,t,r,n,o){o||(o={}),e=this._truncateToN(e,!1,o.msgBitLength),r=this.keyFromPublic(r,n);var i=(t=new f(t,"hex")).r,a=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),c=u.mul(e).umod(this.n),l=u.mul(i).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),l)).isInfinity()&&s.eqXToP(i):!(s=this.g.mulAdd(c,r.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(i)},l.prototype.recoverPubKey=function(e,t,r,o){u((3&r)===r,"The recovery param is more than two bits"),t=new f(t,o);var i=this.n,a=new n(e),s=t.r,c=t.s,l=1&r,d=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");s=d?this.curve.pointFromX(s.add(this.curve.n),l):this.curve.pointFromX(s,l);var h=t.r.invm(i),p=i.sub(a).mul(h).umod(i),y=c.mul(h).umod(i);return this.g.mulAdd(p,s,y)},l.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new f(t,n)).recoveryParam)return t.recoveryParam;for(var o=0;o<4;o++){var i;try{i=this.recoverPubKey(e,t,o)}catch(e){continue}if(i.eq(r))return o}throw new Error("Unable to find valid recovery factor")}},1200:(e,t,r)=>{var n=r(8490),o=r(7011).assert;function i(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=i,i.fromPublic=function(e,t,r){return t instanceof i?t:new i(e,{pub:t,pubEnc:r})},i.fromPrivate=function(e,t,r){return t instanceof i?t:new i(e,{priv:t,privEnc:r})},i.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},i.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},i.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},i.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},i.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?o(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||o(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},i.prototype.derive=function(e){return e.validate()||o(e.validate(),"public point not validated"),e.mul(this.priv).getX()},i.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},i.prototype.verify=function(e,t,r){return this.ec.verify(e,t,this,void 0,r)},i.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},8545:(e,t,r)=>{var n=r(8490),o=r(7011),i=o.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function u(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;if(0===e[t.place])return!1;for(var o=0,i=0,a=t.place;i<n;i++,a++)o<<=8,o|=e[a],o>>>=0;return!(o<=127)&&(t.place=a,o)}function c(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function f(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=o.toArray(e,t);var r=new s;if(48!==e[r.place++])return!1;var i=u(e,r);if(!1===i)return!1;if(i+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var a=u(e,r);if(!1===a)return!1;if(128&e[r.place])return!1;var c=e.slice(r.place,a+r.place);if(r.place+=a,2!==e[r.place++])return!1;var f=u(e,r);if(!1===f)return!1;if(e.length!==f+r.place)return!1;if(128&e[r.place])return!1;var l=e.slice(r.place,f+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}return this.r=new n(c),this.s=new n(l),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,t.length),(n=n.concat(t)).push(2),f(n,r.length);var i=n.concat(r),a=[48];return f(a,i.length),a=a.concat(i),o.encode(a,e)}},8650:(e,t,r)=>{var n=r(7952),o=r(480),i=r(7011),a=i.assert,s=i.parseBytes,u=r(6661),c=r(220);function f(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=o[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=f,f.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),o=this.g.mul(n),i=this.encodePoint(o),a=this.hashInt(i,r.pubBytes(),e).mul(r.priv()),u=n.add(a).umod(this.curve.n);return this.makeSignature({R:o,S:u,Rencoded:i})},f.prototype.verify=function(e,t,r){if(e=s(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var n=this.keyFromPublic(r),o=this.hashInt(t.Rencoded(),n.pubBytes(),e),i=this.g.mul(t.S());return t.R().add(n.pub().mul(o)).eq(i)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return i.intFromLE(e.digest()).umod(this.curve.n)},f.prototype.keyFromPublic=function(e){return u.fromPublic(this,e)},f.prototype.keyFromSecret=function(e){return u.fromSecret(this,e)},f.prototype.makeSignature=function(e){return e instanceof c?e:new c(this,e)},f.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},f.prototype.decodePoint=function(e){var t=(e=i.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=!!(128&e[t]),o=i.intFromLE(r);return this.curve.pointFromY(o,n)},f.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},f.prototype.decodeInt=function(e){return i.intFromLE(e)},f.prototype.isPoint=function(e){return e instanceof this.pointClass}},6661:(e,t,r)=>{var n=r(7011),o=n.assert,i=n.parseBytes,a=n.cachedProperty;function s(e,t){this.eddsa=e,this._secret=i(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=i(t.pub)}s.fromPublic=function(e,t){return t instanceof s?t:new s(e,{pub:t})},s.fromSecret=function(e,t){return t instanceof s?t:new s(e,{secret:t})},s.prototype.secret=function(){return this._secret},a(s,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),a(s,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),a(s,"privBytes",function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n}),a(s,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),a(s,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),a(s,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),s.prototype.sign=function(e){return o(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},s.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},s.prototype.getSecret=function(e){return o(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},s.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=s},220:(e,t,r)=>{var n=r(8490),o=r(7011),i=o.assert,a=o.cachedProperty,s=o.parseBytes;function u(e,t){this.eddsa=e,"object"!=typeof t&&(t=s(t)),Array.isArray(t)&&(i(t.length===2*e.encodingLength,"Signature has invalid size"),t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),i(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}a(u,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),a(u,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),a(u,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),a(u,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return o.encode(this.toBytes(),"hex").toUpperCase()},e.exports=u},4011:e=>{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},7011:(e,t,r)=>{var n=t,o=r(8490),i=r(3349),a=r(4367);n.assert=i,n.toArray=a.toArray,n.zero2=a.zero2,n.toHex=a.toHex,n.encode=a.encode,n.getNAF=function(e,t,r){var n,o=new Array(Math.max(e.bitLength(),r)+1);for(n=0;n<o.length;n+=1)o[n]=0;var i=1<<t+1,a=e.clone();for(n=0;n<o.length;n++){var s,u=a.andln(i-1);a.isOdd()?(s=u>(i>>1)-1?(i>>1)-u:u,a.isubn(s)):s=0,o[n]=s,a.iushrn(1)}return o},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,o=0,i=0;e.cmpn(-o)>0||t.cmpn(-i)>0;){var a,s,u=e.andln(3)+o&3,c=t.andln(3)+i&3;3===u&&(u=-1),3===c&&(c=-1),a=1&u?3!=(n=e.andln(7)+o&7)&&5!==n||2!==c?u:-u:0,r[0].push(a),s=1&c?3!=(n=t.andln(7)+i&7)&&5!==n||2!==u?c:-c:0,r[1].push(s),2*o===a+1&&(o=1-o),2*i===s+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new o(e,"hex","le")}},8490:function(e,t,r){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"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:r(9368).Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,r,n){for(var o=0,i=Math.min(e.length,r),a=t;a<i;a++){var s=e.charCodeAt(a)-48;o*=n,o+=s>=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,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<e.length&&(16===t?this._parseHex(e,o,r):(this._parseBase(e,t,o),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var i,a,s=0;if("be"===r)for(o=e.length-1,i=0;o>=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<<s&67108863,this.words[i+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===r)for(o=0,i=0;o<e.length;o+=3)a=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[i]|=a<<s&67108863,this.words[i+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,i=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)o=u(e,t,n)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)o=u(e,t,n)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=t)n++;n--,o=o/t|0;for(var i=e.length-r,a=i%n,s=Math.min(i,i-a)+r,u=0,f=r;f<s;f+=n)u=c(e,f,f+n,t),this.imuln(o),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var l=1;for(u=c(e,f,e.length,t),f=0;f<a;f++)l*=t;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&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?"<BN-R: ":"<BN: ")+this.toString(16)+">"};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"],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],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c<n;c++){for(var f=u>>>26,l=67108863&u,d=Math.min(c,t.length-1),h=Math.max(0,c-e.length+1);h<=d;h++){var p=c-h|0;f+=(a=(o=0|e.words[p])*(i=0|t.words[h])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var o=0,i=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<o|i)).toString(16);i=s>>>24-o&16777215,(o+=2)>=26&&(o-=26,a--),r=0!==i||a!==this.length-1?f[6-u.length]+u+r:u+r}for(0!==i&&(r=i.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],h=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(h).toString(e);r=(p=p.idivn(h)).isZero()?y+r:f[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!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&&n(!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 n(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,r){var o=this.byteLength(),i=r||Math.max(1,o);n(o<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(i),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[s]=a;for(;s<i;s++)c[s]=0}else{for(s=0;s<i-o;s++)c[s]=0;for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[i-s-1]=a}return c},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},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;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},i.prototype.ior=function(e){return n(!(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.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 r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},i.prototype.iand=function(e){return n(!(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.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,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},i.prototype.ixor=function(e){return n(!(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.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){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var o=0;o<t;o++)this.words[o]=67108863&~this.words[o];return r>0&&(this.words[o]=~this.words[o]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,o=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<o:this.words[r]&~(1<<o),this.strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var o=0,i=0;i<n.length;i++)t=(0|r.words[i])+(0|n.words[i])+o,this.words[i]=67108863&t,o=t>>>26;for(;0!==o&&i<r.length;i++)t=(0|r.words[i])+o,this.words[i]=67108863&t,o=t>>>26;if(this.length=r.length,0!==o)this.words[this.length]=o,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.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 r,n,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)i=(t=(0|r.words[a])-(0|n.words[a])+i)>>26,this.words[a]=67108863&t;for(;0!==i&&a<r.length;a++)i=(t=(0|r.words[a])+i)>>26,this.words[a]=67108863&t;if(0===i&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,o,i,a=e.words,s=t.words,u=r.words,c=0,f=0|a[0],l=8191&f,d=f>>>13,h=0|a[1],p=8191&h,y=h>>>13,m=0|a[2],b=8191&m,g=m>>>13,v=0|a[3],w=8191&v,S=v>>>13,M=0|a[4],_=8191&M,A=M>>>13,E=0|a[5],O=8191&E,j=E>>>13,T=0|a[6],N=8191&T,P=T>>>13,B=0|a[7],R=8191&B,C=B>>>13,x=0|a[8],I=8191&x,k=x>>>13,H=0|a[9],U=8191&H,L=H>>>13,D=0|s[0],V=8191&D,z=D>>>13,J=0|s[1],K=8191&J,F=J>>>13,q=0|s[2],W=8191&q,G=q>>>13,Z=0|s[3],$=8191&Z,X=Z>>>13,Q=0|s[4],Y=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,fe=0|s[8],le=8191&fe,de=fe>>>13,he=0|s[9],pe=8191&he,ye=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(n=Math.imul(l,V))|0)+((8191&(o=(o=Math.imul(l,z))+Math.imul(d,V)|0))<<13)|0;c=((i=Math.imul(d,z))+(o>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,V),o=(o=Math.imul(p,z))+Math.imul(y,V)|0,i=Math.imul(y,z);var be=(c+(n=n+Math.imul(l,K)|0)|0)+((8191&(o=(o=o+Math.imul(l,F)|0)+Math.imul(d,K)|0))<<13)|0;c=((i=i+Math.imul(d,F)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(b,V),o=(o=Math.imul(b,z))+Math.imul(g,V)|0,i=Math.imul(g,z),n=n+Math.imul(p,K)|0,o=(o=o+Math.imul(p,F)|0)+Math.imul(y,K)|0,i=i+Math.imul(y,F)|0;var ge=(c+(n=n+Math.imul(l,W)|0)|0)+((8191&(o=(o=o+Math.imul(l,G)|0)+Math.imul(d,W)|0))<<13)|0;c=((i=i+Math.imul(d,G)|0)+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,V),o=(o=Math.imul(w,z))+Math.imul(S,V)|0,i=Math.imul(S,z),n=n+Math.imul(b,K)|0,o=(o=o+Math.imul(b,F)|0)+Math.imul(g,K)|0,i=i+Math.imul(g,F)|0,n=n+Math.imul(p,W)|0,o=(o=o+Math.imul(p,G)|0)+Math.imul(y,W)|0,i=i+Math.imul(y,G)|0;var ve=(c+(n=n+Math.imul(l,$)|0)|0)+((8191&(o=(o=o+Math.imul(l,X)|0)+Math.imul(d,$)|0))<<13)|0;c=((i=i+Math.imul(d,X)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(_,V),o=(o=Math.imul(_,z))+Math.imul(A,V)|0,i=Math.imul(A,z),n=n+Math.imul(w,K)|0,o=(o=o+Math.imul(w,F)|0)+Math.imul(S,K)|0,i=i+Math.imul(S,F)|0,n=n+Math.imul(b,W)|0,o=(o=o+Math.imul(b,G)|0)+Math.imul(g,W)|0,i=i+Math.imul(g,G)|0,n=n+Math.imul(p,$)|0,o=(o=o+Math.imul(p,X)|0)+Math.imul(y,$)|0,i=i+Math.imul(y,X)|0;var we=(c+(n=n+Math.imul(l,Y)|0)|0)+((8191&(o=(o=o+Math.imul(l,ee)|0)+Math.imul(d,Y)|0))<<13)|0;c=((i=i+Math.imul(d,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(O,V),o=(o=Math.imul(O,z))+Math.imul(j,V)|0,i=Math.imul(j,z),n=n+Math.imul(_,K)|0,o=(o=o+Math.imul(_,F)|0)+Math.imul(A,K)|0,i=i+Math.imul(A,F)|0,n=n+Math.imul(w,W)|0,o=(o=o+Math.imul(w,G)|0)+Math.imul(S,W)|0,i=i+Math.imul(S,G)|0,n=n+Math.imul(b,$)|0,o=(o=o+Math.imul(b,X)|0)+Math.imul(g,$)|0,i=i+Math.imul(g,X)|0,n=n+Math.imul(p,Y)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(y,Y)|0,i=i+Math.imul(y,ee)|0;var Se=(c+(n=n+Math.imul(l,re)|0)|0)+((8191&(o=(o=o+Math.imul(l,ne)|0)+Math.imul(d,re)|0))<<13)|0;c=((i=i+Math.imul(d,ne)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(N,V),o=(o=Math.imul(N,z))+Math.imul(P,V)|0,i=Math.imul(P,z),n=n+Math.imul(O,K)|0,o=(o=o+Math.imul(O,F)|0)+Math.imul(j,K)|0,i=i+Math.imul(j,F)|0,n=n+Math.imul(_,W)|0,o=(o=o+Math.imul(_,G)|0)+Math.imul(A,W)|0,i=i+Math.imul(A,G)|0,n=n+Math.imul(w,$)|0,o=(o=o+Math.imul(w,X)|0)+Math.imul(S,$)|0,i=i+Math.imul(S,X)|0,n=n+Math.imul(b,Y)|0,o=(o=o+Math.imul(b,ee)|0)+Math.imul(g,Y)|0,i=i+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,o=(o=o+Math.imul(p,ne)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ne)|0;var Me=(c+(n=n+Math.imul(l,ie)|0)|0)+((8191&(o=(o=o+Math.imul(l,ae)|0)+Math.imul(d,ie)|0))<<13)|0;c=((i=i+Math.imul(d,ae)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(R,V),o=(o=Math.imul(R,z))+Math.imul(C,V)|0,i=Math.imul(C,z),n=n+Math.imul(N,K)|0,o=(o=o+Math.imul(N,F)|0)+Math.imul(P,K)|0,i=i+Math.imul(P,F)|0,n=n+Math.imul(O,W)|0,o=(o=o+Math.imul(O,G)|0)+Math.imul(j,W)|0,i=i+Math.imul(j,G)|0,n=n+Math.imul(_,$)|0,o=(o=o+Math.imul(_,X)|0)+Math.imul(A,$)|0,i=i+Math.imul(A,X)|0,n=n+Math.imul(w,Y)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(S,Y)|0,i=i+Math.imul(S,ee)|0,n=n+Math.imul(b,re)|0,o=(o=o+Math.imul(b,ne)|0)+Math.imul(g,re)|0,i=i+Math.imul(g,ne)|0,n=n+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,ae)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,ae)|0;var _e=(c+(n=n+Math.imul(l,ue)|0)|0)+((8191&(o=(o=o+Math.imul(l,ce)|0)+Math.imul(d,ue)|0))<<13)|0;c=((i=i+Math.imul(d,ce)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(I,V),o=(o=Math.imul(I,z))+Math.imul(k,V)|0,i=Math.imul(k,z),n=n+Math.imul(R,K)|0,o=(o=o+Math.imul(R,F)|0)+Math.imul(C,K)|0,i=i+Math.imul(C,F)|0,n=n+Math.imul(N,W)|0,o=(o=o+Math.imul(N,G)|0)+Math.imul(P,W)|0,i=i+Math.imul(P,G)|0,n=n+Math.imul(O,$)|0,o=(o=o+Math.imul(O,X)|0)+Math.imul(j,$)|0,i=i+Math.imul(j,X)|0,n=n+Math.imul(_,Y)|0,o=(o=o+Math.imul(_,ee)|0)+Math.imul(A,Y)|0,i=i+Math.imul(A,ee)|0,n=n+Math.imul(w,re)|0,o=(o=o+Math.imul(w,ne)|0)+Math.imul(S,re)|0,i=i+Math.imul(S,ne)|0,n=n+Math.imul(b,ie)|0,o=(o=o+Math.imul(b,ae)|0)+Math.imul(g,ie)|0,i=i+Math.imul(g,ae)|0,n=n+Math.imul(p,ue)|0,o=(o=o+Math.imul(p,ce)|0)+Math.imul(y,ue)|0,i=i+Math.imul(y,ce)|0;var Ae=(c+(n=n+Math.imul(l,le)|0)|0)+((8191&(o=(o=o+Math.imul(l,de)|0)+Math.imul(d,le)|0))<<13)|0;c=((i=i+Math.imul(d,de)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,V),o=(o=Math.imul(U,z))+Math.imul(L,V)|0,i=Math.imul(L,z),n=n+Math.imul(I,K)|0,o=(o=o+Math.imul(I,F)|0)+Math.imul(k,K)|0,i=i+Math.imul(k,F)|0,n=n+Math.imul(R,W)|0,o=(o=o+Math.imul(R,G)|0)+Math.imul(C,W)|0,i=i+Math.imul(C,G)|0,n=n+Math.imul(N,$)|0,o=(o=o+Math.imul(N,X)|0)+Math.imul(P,$)|0,i=i+Math.imul(P,X)|0,n=n+Math.imul(O,Y)|0,o=(o=o+Math.imul(O,ee)|0)+Math.imul(j,Y)|0,i=i+Math.imul(j,ee)|0,n=n+Math.imul(_,re)|0,o=(o=o+Math.imul(_,ne)|0)+Math.imul(A,re)|0,i=i+Math.imul(A,ne)|0,n=n+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,ae)|0)+Math.imul(S,ie)|0,i=i+Math.imul(S,ae)|0,n=n+Math.imul(b,ue)|0,o=(o=o+Math.imul(b,ce)|0)+Math.imul(g,ue)|0,i=i+Math.imul(g,ce)|0,n=n+Math.imul(p,le)|0,o=(o=o+Math.imul(p,de)|0)+Math.imul(y,le)|0,i=i+Math.imul(y,de)|0;var Ee=(c+(n=n+Math.imul(l,pe)|0)|0)+((8191&(o=(o=o+Math.imul(l,ye)|0)+Math.imul(d,pe)|0))<<13)|0;c=((i=i+Math.imul(d,ye)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,K),o=(o=Math.imul(U,F))+Math.imul(L,K)|0,i=Math.imul(L,F),n=n+Math.imul(I,W)|0,o=(o=o+Math.imul(I,G)|0)+Math.imul(k,W)|0,i=i+Math.imul(k,G)|0,n=n+Math.imul(R,$)|0,o=(o=o+Math.imul(R,X)|0)+Math.imul(C,$)|0,i=i+Math.imul(C,X)|0,n=n+Math.imul(N,Y)|0,o=(o=o+Math.imul(N,ee)|0)+Math.imul(P,Y)|0,i=i+Math.imul(P,ee)|0,n=n+Math.imul(O,re)|0,o=(o=o+Math.imul(O,ne)|0)+Math.imul(j,re)|0,i=i+Math.imul(j,ne)|0,n=n+Math.imul(_,ie)|0,o=(o=o+Math.imul(_,ae)|0)+Math.imul(A,ie)|0,i=i+Math.imul(A,ae)|0,n=n+Math.imul(w,ue)|0,o=(o=o+Math.imul(w,ce)|0)+Math.imul(S,ue)|0,i=i+Math.imul(S,ce)|0,n=n+Math.imul(b,le)|0,o=(o=o+Math.imul(b,de)|0)+Math.imul(g,le)|0,i=i+Math.imul(g,de)|0;var Oe=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;c=((i=i+Math.imul(y,ye)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(U,W),o=(o=Math.imul(U,G))+Math.imul(L,W)|0,i=Math.imul(L,G),n=n+Math.imul(I,$)|0,o=(o=o+Math.imul(I,X)|0)+Math.imul(k,$)|0,i=i+Math.imul(k,X)|0,n=n+Math.imul(R,Y)|0,o=(o=o+Math.imul(R,ee)|0)+Math.imul(C,Y)|0,i=i+Math.imul(C,ee)|0,n=n+Math.imul(N,re)|0,o=(o=o+Math.imul(N,ne)|0)+Math.imul(P,re)|0,i=i+Math.imul(P,ne)|0,n=n+Math.imul(O,ie)|0,o=(o=o+Math.imul(O,ae)|0)+Math.imul(j,ie)|0,i=i+Math.imul(j,ae)|0,n=n+Math.imul(_,ue)|0,o=(o=o+Math.imul(_,ce)|0)+Math.imul(A,ue)|0,i=i+Math.imul(A,ce)|0,n=n+Math.imul(w,le)|0,o=(o=o+Math.imul(w,de)|0)+Math.imul(S,le)|0,i=i+Math.imul(S,de)|0;var je=(c+(n=n+Math.imul(b,pe)|0)|0)+((8191&(o=(o=o+Math.imul(b,ye)|0)+Math.imul(g,pe)|0))<<13)|0;c=((i=i+Math.imul(g,ye)|0)+(o>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(U,$),o=(o=Math.imul(U,X))+Math.imul(L,$)|0,i=Math.imul(L,X),n=n+Math.imul(I,Y)|0,o=(o=o+Math.imul(I,ee)|0)+Math.imul(k,Y)|0,i=i+Math.imul(k,ee)|0,n=n+Math.imul(R,re)|0,o=(o=o+Math.imul(R,ne)|0)+Math.imul(C,re)|0,i=i+Math.imul(C,ne)|0,n=n+Math.imul(N,ie)|0,o=(o=o+Math.imul(N,ae)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,ae)|0,n=n+Math.imul(O,ue)|0,o=(o=o+Math.imul(O,ce)|0)+Math.imul(j,ue)|0,i=i+Math.imul(j,ce)|0,n=n+Math.imul(_,le)|0,o=(o=o+Math.imul(_,de)|0)+Math.imul(A,le)|0,i=i+Math.imul(A,de)|0;var Te=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,ye)|0)+Math.imul(S,pe)|0))<<13)|0;c=((i=i+Math.imul(S,ye)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,Y),o=(o=Math.imul(U,ee))+Math.imul(L,Y)|0,i=Math.imul(L,ee),n=n+Math.imul(I,re)|0,o=(o=o+Math.imul(I,ne)|0)+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,n=n+Math.imul(R,ie)|0,o=(o=o+Math.imul(R,ae)|0)+Math.imul(C,ie)|0,i=i+Math.imul(C,ae)|0,n=n+Math.imul(N,ue)|0,o=(o=o+Math.imul(N,ce)|0)+Math.imul(P,ue)|0,i=i+Math.imul(P,ce)|0,n=n+Math.imul(O,le)|0,o=(o=o+Math.imul(O,de)|0)+Math.imul(j,le)|0,i=i+Math.imul(j,de)|0;var Ne=(c+(n=n+Math.imul(_,pe)|0)|0)+((8191&(o=(o=o+Math.imul(_,ye)|0)+Math.imul(A,pe)|0))<<13)|0;c=((i=i+Math.imul(A,ye)|0)+(o>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(U,re),o=(o=Math.imul(U,ne))+Math.imul(L,re)|0,i=Math.imul(L,ne),n=n+Math.imul(I,ie)|0,o=(o=o+Math.imul(I,ae)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,ae)|0,n=n+Math.imul(R,ue)|0,o=(o=o+Math.imul(R,ce)|0)+Math.imul(C,ue)|0,i=i+Math.imul(C,ce)|0,n=n+Math.imul(N,le)|0,o=(o=o+Math.imul(N,de)|0)+Math.imul(P,le)|0,i=i+Math.imul(P,de)|0;var Pe=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(o=(o=o+Math.imul(O,ye)|0)+Math.imul(j,pe)|0))<<13)|0;c=((i=i+Math.imul(j,ye)|0)+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,ie),o=(o=Math.imul(U,ae))+Math.imul(L,ie)|0,i=Math.imul(L,ae),n=n+Math.imul(I,ue)|0,o=(o=o+Math.imul(I,ce)|0)+Math.imul(k,ue)|0,i=i+Math.imul(k,ce)|0,n=n+Math.imul(R,le)|0,o=(o=o+Math.imul(R,de)|0)+Math.imul(C,le)|0,i=i+Math.imul(C,de)|0;var Be=(c+(n=n+Math.imul(N,pe)|0)|0)+((8191&(o=(o=o+Math.imul(N,ye)|0)+Math.imul(P,pe)|0))<<13)|0;c=((i=i+Math.imul(P,ye)|0)+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(U,ue),o=(o=Math.imul(U,ce))+Math.imul(L,ue)|0,i=Math.imul(L,ce),n=n+Math.imul(I,le)|0,o=(o=o+Math.imul(I,de)|0)+Math.imul(k,le)|0,i=i+Math.imul(k,de)|0;var Re=(c+(n=n+Math.imul(R,pe)|0)|0)+((8191&(o=(o=o+Math.imul(R,ye)|0)+Math.imul(C,pe)|0))<<13)|0;c=((i=i+Math.imul(C,ye)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,le),o=(o=Math.imul(U,de))+Math.imul(L,le)|0,i=Math.imul(L,de);var Ce=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(o=(o=o+Math.imul(I,ye)|0)+Math.imul(k,pe)|0))<<13)|0;c=((i=i+Math.imul(k,ye)|0)+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863;var xe=(c+(n=Math.imul(U,pe))|0)+((8191&(o=(o=Math.imul(U,ye))+Math.imul(L,pe)|0))<<13)|0;return c=((i=Math.imul(L,ye))+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,u[0]=me,u[1]=be,u[2]=ge,u[3]=ve,u[4]=we,u[5]=Se,u[6]=Me,u[7]=_e,u[8]=Ae,u[9]=Ee,u[10]=Oe,u[11]=je,u[12]=Te,u[13]=Ne,u[14]=Pe,u[15]=Be,u[16]=Re,u[17]=Ce,u[18]=xe,0!==c&&(u[19]=c,r.length++),r};function y(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(p=h),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,o=0,i=0;i<r.length-1;i++){var a=o;o=0;for(var s=67108863&n,u=Math.min(i,t.length-1),c=Math.max(0,i-e.length+1);c<=u;c++){var f=i-c,l=(0|e.words[f])*(0|t.words[c]),d=67108863&l;s=67108863&(d=d+s|0),o+=(a=(a=a+(l/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}r.words[i]=s,n=a,a=o}return 0!==n?r.words[i]=n:r.length--,r.strip()}(this,e,t):y(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,o=0;o<t;o++)n|=(1&e)<<t-o-1,e>>=1;return n},m.prototype.permute=function(e,t,r,n,o,i){for(var a=0;a<i;a++)n[a]=t[e[a]],o[a]=r[e[a]]},m.prototype.transform=function(e,t,r,n,o,i){this.permute(i,e,t,r,n,o);for(var a=1;a<o;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),f=0;f<o;f+=s)for(var l=u,d=c,h=0;h<a;h++){var p=r[f+h],y=n[f+h],m=r[f+h+a],b=n[f+h+a],g=l*m-d*b;b=l*b+d*m,m=g,r[f+h]=p+m,n[f+h]=y+b,r[f+h+a]=p-m,n[f+h+a]=y-b,h!==s&&(g=u*l-c*d,d=u*d+c*l,l=g)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,o=0;for(r=r/2|0;r;r>>>=1)o++;return 1<<o+1+n},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var o=e[n];e[n]=e[r-n-1],e[r-n-1]=o,o=t[n],t[n]=-t[r-n-1],t[r-n-1]=-o}},m.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var o=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&o,r=o<67108864?0:o/67108864|0}return e},m.prototype.convert13b=function(e,t,r,o){for(var i=0,a=0;a<t;a++)i+=0|e[a],r[2*a]=8191&i,i>>>=13,r[2*a+1]=8191&i,i>>>=13;for(a=2*t;a<o;++a)r[a]=0;n(0===i),n(!(-8192&i))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),o=this.makeRBT(n),i=this.stub(n),a=new Array(n),s=new Array(n),u=new Array(n),c=new Array(n),f=new Array(n),l=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,c,n),this.transform(a,i,s,u,n,o),this.transform(c,i,f,l,n,o);for(var h=0;h<n;h++){var p=s[h]*f[h]-u[h]*l[h];u[h]=s[h]*l[h]+u[h]*f[h],s[h]=p}return this.conjugate(s,u,n),this.transform(s,u,d,i,n,o),this.conjugate(d,i,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),y(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var o=(0|this.words[r])*e,i=(67108863&o)+(67108863&t);t>>=26,t+=o/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=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()),r=0;r<t.length;r++){var n=r/26|0,o=r%26;t[r]=(e.words[n]&1<<o)>>>o}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var o=r.sqr();n<t.length;n++,o=o.sqr())0!==t[n]&&(r=r.mul(o));return r},i.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,o=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&i,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}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<o;t++)this.words[t]=0;this.length+=o}return this.strip()},i.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,r){var o;n("number"==typeof e&&e>=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<<i,u=r;if(o-=a,o=Math.max(0,o),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var f=0;for(c=this.length-1;c>=0&&(0!==f||c>=o);c--){var l=0|this.words[c];this.words[c]=f<<26-i|l>>>i,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},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){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,o=1<<t;return!(this.length<=r||!(this.words[r]&o))},i.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var o=67108863^67108863>>>t<<t;this.words[this.length-1]&=o}return this.strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[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(n("number"==typeof e),n(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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var o,i,a=e.length+r;this._expand(a);var s=0;for(o=0;o<e.length;o++){i=(0|this.words[o+r])+s;var u=(0|e.words[o])*t;s=((i-=67108863&u)>>26)-(u/67108864|0),this.words[o+r]=67108863&i}for(;o<this.length-r;o++)s=(i=(0|this.words[o+r])+s)>>26,this.words[o+r]=67108863&i;if(0===s)return this.strip();for(n(-1===s),s=0,o=0;o<this.length;o++)s=(i=-(0|this.words[o])+s)>>26,this.words[o]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!=(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,u=n.length-o.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var f=n.clone()._ishlnsubmul(o,1,u);0===f.negative&&(n=f,s&&(s.words[u]=1));for(var l=u-1;l>=0;l--){var d=67108864*(0|n.words[o.length+l])+(0|n.words[o.length+l-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(o,d,l);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(o,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,r){return n(!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(),r&&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}):this.negative&e.negative?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&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 r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),o=e.andln(1),i=r.cmp(n);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){n(e<=67108863);for(var t=(1<<26)%e,r=0,o=this.length-1;o>=0;o--)r=(t*r+(0|this.words[o]))%e;return r},i.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var o=(0|this.words[r])+67108864*t;this.words[r]=o/e|0,t=o%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=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),u=new i(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),l=t.clone();!t.isZero();){for(var d=0,h=1;!(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(f),a.isub(l)),o.iushrn(1),a.iushrn(1);for(var p=0,y=1;!(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s),a.isub(u)):(r.isub(t),s.isub(o),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;!(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,d=1;!(r.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.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(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var o=t.cmp(r);if(o<0){var i=t;t=r,r=i}else if(0===o||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return!(1&this.words[0])},i.prototype.isOdd=function(){return!(1&~this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,o=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=o,this;for(var i=o,a=r;0!==i&&a<this.length;a++){var s=0|this.words[a];i=(s+=i)>>>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,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:o<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],o=0|e.words[r];if(n!==o){n<o?t=-1:n>o&&(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)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(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 g(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 v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(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)}g.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},o(v,g),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),o=0;o<n;o++)t.words[o]=e.words[o];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=i&r,o=10;o<e.length;o++){var a=0|e.words[o];e.words[o-10]=(a&r)<<4|i>>>22,i=a}i>>>=22,e.words[o-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},o(w,g),o(S,g),o(M,g),M.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,o=67108863&n;n>>>=26,e.words[r]=o,t=n}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 v;else if("p224"===e)t=new w;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new M}return b[e]=t,t},_.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,t){n(!(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},_.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},_.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);n(!o.isZero());var s=new i(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,o),d=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var y=h,m=0;0!==y.cmp(s);m++)y=y.redSqr();n(m<p);var b=this.pow(l,new i(1).iushln(p-m-1));d=d.redMul(b),l=b.redSqr(),h=h.redMul(l),p=m}return d},_.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},_.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var o=r[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],f=u-1;f>=0;f--){var l=c>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==l||0!==a?(a<<=1,a|=l,(4==++s||0===n&&0===f)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}u=26}return o},_.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},_.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new A(e)},o(A,_),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).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)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).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)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},655:e=>{var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},1237:e=>{e.exports=EvalError},9383:e=>{e.exports=Error},9290:e=>{e.exports=RangeError},9538:e=>{e.exports=ReferenceError},8068:e=>{e.exports=SyntaxError},9675:e=>{e.exports=TypeError},5345:e=>{e.exports=URIError},9612:e=>{e.exports=Object},7007:e=>{var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise(function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}y(e,t,i,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,o)})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var o,i,a,c;if(s(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),a=i[t]),void 0===a)a=i[t]=r,++e._eventsCount;else if("function"==typeof a?a=i[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(o=u(e))>0&&a.length>o&&!a.warned){a.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=a.length,c=f,console&&console.warn&&console.warn(c)}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 l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=f.bind(n);return o.listener=r,n.wrapFn=o,o}function d(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):p(o,o.length)}function h(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function o(i){n.once&&e.removeEventListener(t,o),r(i)})}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return u(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var c=u.length,f=p(u,c);for(r=0;r<c;++r)n(f[r],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return s(t),this.on(e,l(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,l(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,o,i,a;if(s(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){a=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return d(this,e,!0)},i.prototype.rawListeners=function(e){return d(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},i.prototype.listenerCount=h,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},1731:(e,t,r)=>{var n=r(5606),o=r(8287).Buffer,i=r(8835).parse,a=r(7007),s=r(1083),u=r(1568),c=r(537),f=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","servername","checkServerIdentity"],l=[239,187,191],d=262144,h=/^(cookie|authorization)$/i;function p(e,t){var r=p.CONNECTING,a=t&&t.headers,c=!1;Object.defineProperty(this,"readyState",{get:function(){return r}}),Object.defineProperty(this,"url",{get:function(){return e}});var b,g=this;function v(t){r!==p.CLOSED&&(r=p.CONNECTING,O("error",new y("error",{message:t})),A&&(e=A,A=null,c=!1),setTimeout(function(){r!==p.CONNECTING||g.connectionInProgress||(g.connectionInProgress=!0,E())},g.reconnectInterval))}g.reconnectInterval=1e3,g.connectionInProgress=!1;var w="";a&&a["Last-Event-ID"]&&(w=a["Last-Event-ID"],delete a["Last-Event-ID"]);var S=!1,M="",_="",A=null;function E(){var m=i(e),M="https:"===m.protocol;if(m.headers={"Cache-Control":"no-cache",Accept:"text/event-stream"},w&&(m.headers["Last-Event-ID"]=w),a){var _=c?function(e){var t={};for(var r in e)h.test(r)||(t[r]=e[r]);return t}(a):a;for(var T in _){var N=_[T];N&&(m.headers[T]=N)}}if(m.rejectUnauthorized=!(t&&!t.rejectUnauthorized),t&&void 0!==t.createConnection&&(m.createConnection=t.createConnection),t&&t.proxy){var P=i(t.proxy);M="https:"===P.protocol,m.protocol=M?"https:":"http:",m.path=e,m.headers.Host=m.host,m.hostname=P.hostname,m.host=P.host,m.port=P.port}if(t&&t.https)for(var B in t.https)if(-1!==f.indexOf(B)){var R=t.https[B];void 0!==R&&(m[B]=R)}t&&void 0!==t.withCredentials&&(m.withCredentials=t.withCredentials),b=(M?s:u).request(m,function(t){if(g.connectionInProgress=!1,500===t.statusCode||502===t.statusCode||503===t.statusCode||504===t.statusCode)return O("error",new y("error",{status:t.statusCode,message:t.statusMessage})),void v();if(301===t.statusCode||302===t.statusCode||307===t.statusCode){var i=t.headers.location;if(!i)return void O("error",new y("error",{status:t.statusCode,message:t.statusMessage}));var a=new URL(e).origin,s=new URL(i).origin;return c=a!==s,307===t.statusCode&&(A=e),e=i,void n.nextTick(E)}if(200!==t.statusCode)return O("error",new y("error",{status:t.statusCode,message:t.statusMessage})),g.close();var u,f;r=p.OPEN,t.on("close",function(){t.removeAllListeners("close"),t.removeAllListeners("end"),v()}),t.on("end",function(){t.removeAllListeners("close"),t.removeAllListeners("end"),v()}),O("open",new y("open"));var h=0,m=-1,b=0,w=0;t.on("data",function(e){u?(e.length>u.length-w&&((b=2*u.length+e.length)>d&&(b=u.length+e.length+d),f=o.alloc(b),u.copy(f,0,0,w),u=f),e.copy(u,w),w+=e.length):(function(e){return l.every(function(t,r){return e[r]===t})}(u=e)&&(u=u.slice(l.length)),w=u.length);for(var t=0,r=w;t<r;){S&&(10===u[t]&&++t,S=!1);for(var n,i=-1,a=m,s=h;i<0&&s<r;++s)58===(n=u[s])?a<0&&(a=s-t):13===n?(S=!0,i=s-t):10===n&&(i=s-t);if(i<0){h=r-t,m=a;break}h=0,m=-1,j(u,t,a,i),t+=i+1}t===r?(u=void 0,w=0):t>0&&(u=u.slice(t,w),w=u.length)})}),b.on("error",function(e){g.connectionInProgress=!1,v(e.message)}),b.setNoDelay&&b.setNoDelay(!0),b.end()}function O(){g.listeners(arguments[0]).length>0&&g.emit.apply(g,arguments)}function j(t,r,n,o){if(0===o){if(M.length>0){var i=_||"message";O(i,new m(i,{data:M.slice(0,-1),lastEventId:w,origin:new URL(e).origin})),M=""}_=void 0}else if(n>0){var a,s=n<0,u=t.slice(r,r+(s?o:n)).toString();r+=a=s?o:32!==t[r+n+1]?n+1:n+2;var c=o-a,f=t.slice(r,r+c).toString();if("data"===u)M+=f+"\n";else if("event"===u)_=f;else if("id"===u)w=f;else if("retry"===u){var l=parseInt(f,10);Number.isNaN(l)||(g.reconnectInterval=l)}}}E(),this._close=function(){r!==p.CLOSED&&(r=p.CLOSED,b.abort&&b.abort(),b.xhr&&b.xhr.abort&&b.xhr.abort())}}function y(e,t){if(Object.defineProperty(this,"type",{writable:!1,value:e,enumerable:!0}),t)for(var r in t)t.hasOwnProperty(r)&&Object.defineProperty(this,r,{writable:!1,value:t[r],enumerable:!0})}function m(e,t){for(var r in Object.defineProperty(this,"type",{writable:!1,value:e,enumerable:!0}),t)t.hasOwnProperty(r)&&Object.defineProperty(this,r,{writable:!1,value:t[r],enumerable:!0})}e.exports=p,c.inherits(p,a.EventEmitter),p.prototype.constructor=p,["open","error","message"].forEach(function(e){Object.defineProperty(p.prototype,"on"+e,{get:function(){var t=this.listeners(e)[0];return t?t._listener?t._listener:t:void 0},set:function(t){this.removeAllListeners(e),this.addEventListener(e,t)}})}),Object.defineProperty(p,"CONNECTING",{enumerable:!0,value:0}),Object.defineProperty(p,"OPEN",{enumerable:!0,value:1}),Object.defineProperty(p,"CLOSED",{enumerable:!0,value:2}),p.prototype.CONNECTING=0,p.prototype.OPEN=1,p.prototype.CLOSED=2,p.prototype.close=function(){this._close()},p.prototype.addEventListener=function(e,t){"function"==typeof t&&(t._listener=t,this.on(e,t))},p.prototype.dispatchEvent=function(e){if(!e.type)throw new Error("UNSPECIFIED_EVENT_TYPE_ERR");this.emit(e.type,e.detail)},p.prototype.removeEventListener=function(e,t){"function"==typeof t&&(t._listener=void 0,this.removeListener(e,t))}},2682:(e,t,r)=>{var n=r(9600),o=Object.prototype.toString,i=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var a,s;arguments.length>=3&&(a=r),s=e,"[object Array]"===o.call(s)?function(e,t,r){for(var n=0,o=e.length;n<o;n++)i.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,a):"string"==typeof e?function(e,t,r){for(var n=0,o=e.length;n<o;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)}(e,t,a):function(e,t,r){for(var n in e)i.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,a)}},9353:e=>{var t=Object.prototype.toString,r=Math.max,n=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var o=0;o<t.length;o+=1)r[o+e.length]=t[o];return r};e.exports=function(e){var o=this;if("function"!=typeof o||"[object Function]"!==t.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var i,a=function(e){for(var t=[],r=1,n=0;r<e.length;r+=1,n+=1)t[n]=e[r];return t}(arguments),s=r(0,o.length-a.length),u=[],c=0;c<s;c++)u[c]="$"+c;if(i=Function("binder","return function ("+function(e){for(var t="",r=0;r<e.length;r+=1)t+=e[r],r+1<e.length&&(t+=",");return t}(u)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof i){var t=o.apply(this,n(a,arguments));return Object(t)===t?t:this}return o.apply(e,n(a,arguments))}),o.prototype){var f=function(){};f.prototype=o.prototype,i.prototype=new f,f.prototype=null}return i}},6743:(e,t,r)=>{var n=r(9353);e.exports=Function.prototype.bind||n},453:(e,t,r)=>{var n,o=r(9612),i=r(9383),a=r(1237),s=r(9290),u=r(9538),c=r(8068),f=r(9675),l=r(5345),d=r(1514),h=r(8968),p=r(6188),y=r(8002),m=r(5880),b=r(414),g=r(3093),v=Function,w=function(e){try{return v('"use strict"; return ('+e+").constructor;")()}catch(e){}},S=r(5795),M=r(655),_=function(){throw new f},A=S?function(){try{return _}catch(e){try{return S(arguments,"callee").get}catch(e){return _}}}():_,E=r(4039)(),O=r(3628),j=r(1064),T=r(8648),N=r(1002),P=r(76),B={},R="undefined"!=typeof Uint8Array&&O?O(Uint8Array):n,C={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":E&&O?O([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":B,"%AsyncGenerator%":B,"%AsyncGeneratorFunction%":B,"%AsyncIteratorPrototype%":B,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":"undefined"==typeof Float16Array?n:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":B,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":E&&O?O(O([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&E&&O?O((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":S,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":s,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&E&&O?O((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E&&O?O(""[Symbol.iterator]()):n,"%Symbol%":E?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":A,"%TypedArray%":R,"%TypeError%":f,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet,"%Function.prototype.call%":P,"%Function.prototype.apply%":N,"%Object.defineProperty%":M,"%Object.getPrototypeOf%":j,"%Math.abs%":d,"%Math.floor%":h,"%Math.max%":p,"%Math.min%":y,"%Math.pow%":m,"%Math.round%":b,"%Math.sign%":g,"%Reflect.getPrototypeOf%":T};if(O)try{null.error}catch(e){var x=O(O(e));C["%Error.prototype%"]=x}var I=function e(t){var r;if("%AsyncFunction%"===t)r=w("async function () {}");else if("%GeneratorFunction%"===t)r=w("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=w("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&O&&(r=O(o.prototype))}return C[t]=r,r},k={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},H=r(6743),U=r(9957),L=H.call(P,Array.prototype.concat),D=H.call(N,Array.prototype.splice),V=H.call(P,String.prototype.replace),z=H.call(P,String.prototype.slice),J=H.call(P,RegExp.prototype.exec),K=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,F=/\\(\\)?/g,q=function(e,t){var r,n=e;if(U(k,n)&&(n="%"+(r=k[n])[0]+"%"),U(C,n)){var o=C[n];if(o===B&&(o=I(n)),void 0===o&&!t)throw new f("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new c("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new f("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new f('"allowMissing" argument must be a boolean');if(null===J(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=z(e,0,1),r=z(e,-1);if("%"===t&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return V(e,K,function(e,t,r,o){n[n.length]=r?V(o,F,"$1"):t||e}),n}(e),n=r.length>0?r[0]:"",o=q("%"+n+"%",t),i=o.name,a=o.value,s=!1,u=o.alias;u&&(n=u[0],D(r,L([0,1],u)));for(var l=1,d=!0;l<r.length;l+=1){var h=r[l],p=z(h,0,1),y=z(h,-1);if(('"'===p||"'"===p||"`"===p||'"'===y||"'"===y||"`"===y)&&p!==y)throw new c("property names with quotes must have matching quotes");if("constructor"!==h&&d||(s=!0),U(C,i="%"+(n+="."+h)+"%"))a=C[i];else if(null!=a){if(!(h in a)){if(!t)throw new f("base intrinsic for "+e+" exists, but the property is not available.");return}if(S&&l+1>=r.length){var m=S(a,h);a=(d=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[h]}else d=U(a,h),a=a[h];d&&!s&&(C[i]=a)}}return a}},1064:(e,t,r)=>{var n=r(9612);e.exports=n.getPrototypeOf||null},8648:e=>{e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},3628:(e,t,r)=>{var n=r(8648),o=r(1064),i=r(7176);e.exports=n?function(e){return n(e)}:o?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return o(e)}:i?function(e){return i(e)}:null},6549:e=>{e.exports=Object.getOwnPropertyDescriptor},5795:(e,t,r)=>{var n=r(6549);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},592:(e,t,r)=>{var n=r(655),o=function(){return!!n};o.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=o},4039:(e,t,r)=>{var n="undefined"!=typeof Symbol&&Symbol,o=r(1333);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},1333:e=>{e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},9092:(e,t,r)=>{var n=r(1333);e.exports=function(){return n()&&!!Symbol.toStringTag}},7952:(e,t,r)=>{var n=t;n.utils=r(7426),n.common=r(6166),n.sha=r(6229),n.ripemd=r(6784),n.hmac=r(8948),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},6166:(e,t,r)=>{var n=r(7426),o=r(3349);function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=i,i.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var o=0;o<e.length;o+=this._delta32)this._update(e,o,o+this._delta32)}return this},i.prototype.digest=function(e){return this.update(this._pad()),o(null===this.pending),this._digest(e)},i.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var o=1;o<r;o++)n[o]=0;if(e<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)n[o++]=0;n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=e>>>24&255,n[o++]=e>>>16&255,n[o++]=e>>>8&255,n[o++]=255&e}else for(n[o++]=255&e,n[o++]=e>>>8&255,n[o++]=e>>>16&255,n[o++]=e>>>24&255,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,i=8;i<this.padLength;i++)n[o++]=0;return n}},8948:(e,t,r)=>{var n=r(7426),o=r(3349);function i(e,t,r){if(!(this instanceof i))return new i(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=i,i.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),o(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},i.prototype.update=function(e,t){return this.inner.update(e,t),this},i.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},6784:(e,t,r)=>{var n=r(7426),o=r(6166),i=n.rotl32,a=n.sum32,s=n.sum32_3,u=n.sum32_4,c=o.BlockHash;function f(){if(!(this instanceof f))return new f;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function l(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function d(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function h(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(f,c),t.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],o=this.h[2],c=this.h[3],f=this.h[4],g=r,v=n,w=o,S=c,M=f,_=0;_<80;_++){var A=a(i(u(r,l(_,n,o,c),e[p[_]+t],d(_)),m[_]),f);r=f,f=c,c=i(o,10),o=n,n=A,A=a(i(u(g,l(79-_,v,w,S),e[y[_]+t],h(_)),b[_]),M),g=M,M=S,S=i(w,10),w=v,v=A}A=s(this.h[1],o,S),this.h[1]=s(this.h[2],c,M),this.h[2]=s(this.h[3],f,g),this.h[3]=s(this.h[4],r,v),this.h[4]=s(this.h[0],n,w),this.h[0]=A},f.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[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],y=[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],m=[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],b=[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]},6229:(e,t,r)=>{t.sha1=r(3917),t.sha224=r(7714),t.sha256=r(2287),t.sha384=r(1911),t.sha512=r(7766)},3917:(e,t,r)=>{var n=r(7426),o=r(6166),i=r(6225),a=n.rotl32,s=n.sum32,u=n.sum32_5,c=i.ft_1,f=o.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,f),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=a(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var o=this.h[0],i=this.h[1],f=this.h[2],d=this.h[3],h=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),y=u(a(o,5),c(p,i,f,d),h,r[n],l[p]);h=d,d=f,f=a(i,30),i=o,o=y}this.h[0]=s(this.h[0],o),this.h[1]=s(this.h[1],i),this.h[2]=s(this.h[2],f),this.h[3]=s(this.h[3],d),this.h[4]=s(this.h[4],h)},d.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},7714:(e,t,r)=>{var n=r(7426),o=r(2287);function i(){if(!(this instanceof i))return new i;o.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(i,o),e.exports=i,i.blockSize=512,i.outSize=224,i.hmacStrength=192,i.padLength=64,i.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},2287:(e,t,r)=>{var n=r(7426),o=r(6166),i=r(6225),a=r(3349),s=n.sum32,u=n.sum32_4,c=n.sum32_5,f=i.ch32,l=i.maj32,d=i.s0_256,h=i.s1_256,p=i.g0_256,y=i.g1_256,m=o.BlockHash,b=[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 g(){if(!(this instanceof g))return new g;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=b,this.W=new Array(64)}n.inherits(g,m),e.exports=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=u(y(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var o=this.h[0],i=this.h[1],m=this.h[2],b=this.h[3],g=this.h[4],v=this.h[5],w=this.h[6],S=this.h[7];for(a(this.k.length===r.length),n=0;n<r.length;n++){var M=c(S,h(g),f(g,v,w),this.k[n],r[n]),_=s(d(o),l(o,i,m));S=w,w=v,v=g,g=s(b,M),b=m,m=i,i=o,o=s(M,_)}this.h[0]=s(this.h[0],o),this.h[1]=s(this.h[1],i),this.h[2]=s(this.h[2],m),this.h[3]=s(this.h[3],b),this.h[4]=s(this.h[4],g),this.h[5]=s(this.h[5],v),this.h[6]=s(this.h[6],w),this.h[7]=s(this.h[7],S)},g.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},1911:(e,t,r)=>{var n=r(7426),o=r(7766);function i(){if(!(this instanceof i))return new i;o.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(i,o),e.exports=i,i.blockSize=1024,i.outSize=384,i.hmacStrength=192,i.padLength=128,i.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},7766:(e,t,r)=>{var n=r(7426),o=r(6166),i=r(3349),a=n.rotr64_hi,s=n.rotr64_lo,u=n.shr64_hi,c=n.shr64_lo,f=n.sum64,l=n.sum64_hi,d=n.sum64_lo,h=n.sum64_4_hi,p=n.sum64_4_lo,y=n.sum64_5_hi,m=n.sum64_5_lo,b=o.BlockHash,g=[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];function v(){if(!(this instanceof v))return new v;b.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=g,this.W=new Array(160)}function w(e,t,r,n,o){var i=e&r^~e&o;return i<0&&(i+=4294967296),i}function S(e,t,r,n,o,i){var a=t&n^~t&i;return a<0&&(a+=4294967296),a}function M(e,t,r,n,o){var i=e&r^e&o^r&o;return i<0&&(i+=4294967296),i}function _(e,t,r,n,o,i){var a=t&n^t&i^n&i;return a<0&&(a+=4294967296),a}function A(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function E(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function O(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function j(e,t){var r=a(e,t,1)^a(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function T(e,t){var r=s(e,t,1)^s(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function N(e,t){var r=s(e,t,19)^s(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(v,b),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var o=(m=r[n-4],b=r[n-3],g=void 0,(g=a(m,b,19)^a(b,m,29)^u(m,b,6))<0&&(g+=4294967296),g),i=N(r[n-4],r[n-3]),s=r[n-14],c=r[n-13],f=j(r[n-30],r[n-29]),l=T(r[n-30],r[n-29]),d=r[n-32],y=r[n-31];r[n]=h(o,i,s,c,f,l,d,y),r[n+1]=p(o,i,s,c,f,l,d,y)}var m,b,g},v.prototype._update=function(e,t){this._prepareBlock(e,t);var r,n,o,s=this.W,u=this.h[0],c=this.h[1],h=this.h[2],p=this.h[3],b=this.h[4],g=this.h[5],v=this.h[6],j=this.h[7],T=this.h[8],N=this.h[9],P=this.h[10],B=this.h[11],R=this.h[12],C=this.h[13],x=this.h[14],I=this.h[15];i(this.k.length===s.length);for(var k=0;k<s.length;k+=2){var H=x,U=I,L=(o=void 0,(o=a(r=T,n=N,14)^a(r,n,18)^a(n,r,9))<0&&(o+=4294967296),o),D=O(T,N),V=w(T,0,P,0,R),z=S(0,N,0,B,0,C),J=this.k[k],K=this.k[k+1],F=s[k],q=s[k+1],W=y(H,U,L,D,V,z,J,K,F,q),G=m(H,U,L,D,V,z,J,K,F,q);H=A(u,c),U=E(u,c),L=M(u,0,h,0,b),D=_(0,c,0,p,0,g);var Z=l(H,U,L,D),$=d(H,U,L,D);x=R,I=C,R=P,C=B,P=T,B=N,T=l(v,j,W,G),N=d(j,j,W,G),v=b,j=g,b=h,g=p,h=u,p=c,u=l(W,G,Z,$),c=d(W,G,Z,$)}f(this.h,0,u,c),f(this.h,2,h,p),f(this.h,4,b,g),f(this.h,6,v,j),f(this.h,8,T,N),f(this.h,10,P,B),f(this.h,12,R,C),f(this.h,14,x,I)},v.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},6225:(e,t,r)=>{var n=r(7426).rotr32;function o(e,t,r){return e&t^~e&r}function i(e,t,r){return e&t^e&r^t&r}function a(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?o(t,r,n):1===e||3===e?a(t,r,n):2===e?i(t,r,n):void 0},t.ch32=o,t.maj32=i,t.p32=a,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},7426:(e,t,r)=>{var n=r(3349),o=r(6698);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 u(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 r=[];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<e.length;o+=2)r.push(parseInt(e[o]+e[o+1],16))}else for(var n=0,o=0;o<e.length;o++){var a=e.charCodeAt(o);a<128?r[n++]=a:a<2048?(r[n++]=a>>6|192,r[n++]=63&a|128):i(e,o)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++o)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(o=0;o<e.length;o++)r[o]=0|e[o];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=s(e[r].toString(16));return t},t.htonl=a,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var o=e[n];"little"===t&&(o=a(o)),r+=u(o.toString(16))}return r},t.zero2=s,t.zero8=u,t.join32=function(e,t,r,o){var i=r-t;n(i%4==0);for(var a=new Array(i/4),s=0,u=t;s<a.length;s++,u+=4){var c;c="big"===o?e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]:e[u+3]<<24|e[u+2]<<16|e[u+1]<<8|e[u],a[s]=c>>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,o=0;n<e.length;n++,o+=4){var i=e[n];"big"===t?(r[o]=i>>>24,r[o+1]=i>>>16&255,r[o+2]=i>>>8&255,r[o+3]=255&i):(r[o+3]=i>>>24,r[o+2]=i>>>16&255,r[o+1]=i>>>8&255,r[o]=255&i)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,o){return e+t+r+n+o>>>0},t.sum64=function(e,t,r,n){var o=e[t],i=n+e[t+1]>>>0,a=(i<n?1:0)+r+o;e[t]=a>>>0,e[t+1]=i},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,o,i,a,s){var u=0,c=t;return u+=(c=c+n>>>0)<t?1:0,u+=(c=c+i>>>0)<i?1:0,e+r+o+a+(u+=(c=c+s>>>0)<s?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,o,i,a,s){return t+n+i+s>>>0},t.sum64_5_hi=function(e,t,r,n,o,i,a,s,u,c){var f=0,l=t;return f+=(l=l+n>>>0)<t?1:0,f+=(l=l+i>>>0)<i?1:0,f+=(l=l+s>>>0)<s?1:0,e+r+o+a+u+(f+=(l=l+c>>>0)<c?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,o,i,a,s,u,c){return t+n+i+s+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},9957:(e,t,r)=>{var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(6743);e.exports=i.call(n,o)},2723:(e,t,r)=>{var n=r(7952),o=r(4367),i=r(3349);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=o.toArray(e.entropy,e.entropyEnc||"hex"),r=o.toArray(e.nonce,e.nonceEnc||"hex"),n=o.toArray(e.pers,e.persEnc||"hex");i(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=a,a.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},a.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},a.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},a.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=o.toArray(e,t),r=o.toArray(r,n),i(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=o.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var a=i.slice(0,e);return this._update(r),this._reseed++,o.encode(a,t)}},1083:(e,t,r)=>{var n=r(1568),o=r(8835),i=e.exports;for(var a in n)n.hasOwnProperty(a)&&(i[a]=n[a]);function s(e){if("string"==typeof e&&(e=o.parse(e)),e.protocol||(e.protocol="https:"),"https:"!==e.protocol)throw new Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}i.request=function(e,t){return e=s(e),n.request.call(this,e,t)},i.get=function(e,t){return e=s(e),n.get.call(this,e,t)}},6123:(e,t,r)=>{var n;!function(){var o={y:function(e){return 1===e?"χρόνος":"χρόνια"},mo:function(e){return 1===e?"μήνας":"μήνες"},w:function(e){return 1===e?"εβδομάδα":"εβδομάδες"},d:function(e){return 1===e?"μέρα":"μέρες"},h:function(e){return 1===e?"ώρα":"ώρες"},m:function(e){return 1===e?"λεπτό":"λεπτά"},s:function(e){return 1===e?"δευτερόλεπτο":"δευτερόλεπτα"},ms:function(e){return 1===e?"χιλιοστό του δευτερολέπτου":"χιλιοστά του δευτερολέπτου"},decimal:","},i={ar:{y:function(e){return 1===e?"سنة":"سنوات"},mo:function(e){return 1===e?"شهر":"أشهر"},w:function(e){return 1===e?"أسبوع":"أسابيع"},d:function(e){return 1===e?"يوم":"أيام"},h:function(e){return 1===e?"ساعة":"ساعات"},m:function(e){return e>2&&e<11?"دقائق":"دقيقة"},s:function(e){return 1===e?"ثانية":"ثواني"},ms:function(e){return 1===e?"جزء من الثانية":"أجزاء من الثانية"},decimal:","},bg:{y:function(e){return["години","година","години"][l(e)]},mo:function(e){return["месеца","месец","месеца"][l(e)]},w:function(e){return["седмици","седмица","седмици"][l(e)]},d:function(e){return["дни","ден","дни"][l(e)]},h:function(e){return["часа","час","часа"][l(e)]},m:function(e){return["минути","минута","минути"][l(e)]},s:function(e){return["секунди","секунда","секунди"][l(e)]},ms:function(e){return["милисекунди","милисекунда","милисекунди"][l(e)]},decimal:","},ca:{y:function(e){return"any"+(1===e?"":"s")},mo:function(e){return"mes"+(1===e?"":"os")},w:function(e){return"setman"+(1===e?"a":"es")},d:function(e){return"di"+(1===e?"a":"es")},h:function(e){return"hor"+(1===e?"a":"es")},m:function(e){return"minut"+(1===e?"":"s")},s:function(e){return"segon"+(1===e?"":"s")},ms:function(e){return"milisegon"+(1===e?"":"s")},decimal:","},cs:{y:function(e){return["rok","roku","roky","let"][d(e)]},mo:function(e){return["měsíc","měsíce","měsíce","měsíců"][d(e)]},w:function(e){return["týden","týdne","týdny","týdnů"][d(e)]},d:function(e){return["den","dne","dny","dní"][d(e)]},h:function(e){return["hodina","hodiny","hodiny","hodin"][d(e)]},m:function(e){return["minuta","minuty","minuty","minut"][d(e)]},s:function(e){return["sekunda","sekundy","sekundy","sekund"][d(e)]},ms:function(e){return["milisekunda","milisekundy","milisekundy","milisekund"][d(e)]},decimal:","},da:{y:"år",mo:function(e){return"måned"+(1===e?"":"er")},w:function(e){return"uge"+(1===e?"":"r")},d:function(e){return"dag"+(1===e?"":"e")},h:function(e){return"time"+(1===e?"":"r")},m:function(e){return"minut"+(1===e?"":"ter")},s:function(e){return"sekund"+(1===e?"":"er")},ms:function(e){return"millisekund"+(1===e?"":"er")},decimal:","},de:{y:function(e){return"Jahr"+(1===e?"":"e")},mo:function(e){return"Monat"+(1===e?"":"e")},w:function(e){return"Woche"+(1===e?"":"n")},d:function(e){return"Tag"+(1===e?"":"e")},h:function(e){return"Stunde"+(1===e?"":"n")},m:function(e){return"Minute"+(1===e?"":"n")},s:function(e){return"Sekunde"+(1===e?"":"n")},ms:function(e){return"Millisekunde"+(1===e?"":"n")},decimal:","},el:o,en:{y:function(e){return"year"+(1===e?"":"s")},mo:function(e){return"month"+(1===e?"":"s")},w:function(e){return"week"+(1===e?"":"s")},d:function(e){return"day"+(1===e?"":"s")},h:function(e){return"hour"+(1===e?"":"s")},m:function(e){return"minute"+(1===e?"":"s")},s:function(e){return"second"+(1===e?"":"s")},ms:function(e){return"millisecond"+(1===e?"":"s")},decimal:"."},es:{y:function(e){return"año"+(1===e?"":"s")},mo:function(e){return"mes"+(1===e?"":"es")},w:function(e){return"semana"+(1===e?"":"s")},d:function(e){return"día"+(1===e?"":"s")},h:function(e){return"hora"+(1===e?"":"s")},m:function(e){return"minuto"+(1===e?"":"s")},s:function(e){return"segundo"+(1===e?"":"s")},ms:function(e){return"milisegundo"+(1===e?"":"s")},decimal:","},et:{y:function(e){return"aasta"+(1===e?"":"t")},mo:function(e){return"kuu"+(1===e?"":"d")},w:function(e){return"nädal"+(1===e?"":"at")},d:function(e){return"päev"+(1===e?"":"a")},h:function(e){return"tund"+(1===e?"":"i")},m:function(e){return"minut"+(1===e?"":"it")},s:function(e){return"sekund"+(1===e?"":"it")},ms:function(e){return"millisekund"+(1===e?"":"it")},decimal:","},fa:{y:"سال",mo:"ماه",w:"هفته",d:"روز",h:"ساعت",m:"دقیقه",s:"ثانیه",ms:"میلی ثانیه",decimal:"."},fi:{y:function(e){return 1===e?"vuosi":"vuotta"},mo:function(e){return 1===e?"kuukausi":"kuukautta"},w:function(e){return"viikko"+(1===e?"":"a")},d:function(e){return"päivä"+(1===e?"":"ä")},h:function(e){return"tunti"+(1===e?"":"a")},m:function(e){return"minuutti"+(1===e?"":"a")},s:function(e){return"sekunti"+(1===e?"":"a")},ms:function(e){return"millisekunti"+(1===e?"":"a")},decimal:","},fo:{y:"ár",mo:function(e){return 1===e?"mánaður":"mánaðir"},w:function(e){return 1===e?"vika":"vikur"},d:function(e){return 1===e?"dagur":"dagar"},h:function(e){return 1===e?"tími":"tímar"},m:function(e){return 1===e?"minuttur":"minuttir"},s:"sekund",ms:"millisekund",decimal:","},fr:{y:function(e){return"an"+(e>=2?"s":"")},mo:"mois",w:function(e){return"semaine"+(e>=2?"s":"")},d:function(e){return"jour"+(e>=2?"s":"")},h:function(e){return"heure"+(e>=2?"s":"")},m:function(e){return"minute"+(e>=2?"s":"")},s:function(e){return"seconde"+(e>=2?"s":"")},ms:function(e){return"milliseconde"+(e>=2?"s":"")},decimal:","},gr:o,he:{y:function(e){return 1===e?"שנה":"שנים"},mo:function(e){return 1===e?"חודש":"חודשים"},w:function(e){return 1===e?"שבוע":"שבועות"},d:function(e){return 1===e?"יום":"ימים"},h:function(e){return 1===e?"שעה":"שעות"},m:function(e){return 1===e?"דקה":"דקות"},s:function(e){return 1===e?"שניה":"שניות"},ms:function(e){return 1===e?"מילישנייה":"מילישניות"},decimal:"."},hr:{y:function(e){return e%10==2||e%10==3||e%10==4?"godine":"godina"},mo:function(e){return 1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci"},w:function(e){return e%10==1&&11!==e?"tjedan":"tjedna"},d:function(e){return 1===e?"dan":"dana"},h:function(e){return 1===e?"sat":2===e||3===e||4===e?"sata":"sati"},m:function(e){var t=e%10;return 2!==t&&3!==t&&4!==t||!(e<10||e>14)?"minuta":"minute"},s:function(e){var t=e%10;return 5===t||Math.floor(e)===e&&e>=10&&e<=19?"sekundi":1===t?"sekunda":2===t||3===t||4===t?"sekunde":"sekundi"},ms:function(e){return 1===e?"milisekunda":e%10==2||e%10==3||e%10==4?"milisekunde":"milisekundi"},decimal:","},hi:{y:"साल",mo:function(e){return 1===e?"महीना":"महीने"},w:function(e){return 1===e?"हफ़्ता":"हफ्ते"},d:"दिन",h:function(e){return 1===e?"घंटा":"घंटे"},m:"मिनट",s:"सेकंड",ms:"मिलीसेकंड",decimal:"."},hu:{y:"év",mo:"hónap",w:"hét",d:"nap",h:"óra",m:"perc",s:"másodperc",ms:"ezredmásodperc",decimal:","},id:{y:"tahun",mo:"bulan",w:"minggu",d:"hari",h:"jam",m:"menit",s:"detik",ms:"milidetik",decimal:"."},is:{y:"ár",mo:function(e){return"mánuð"+(1===e?"ur":"ir")},w:function(e){return"vik"+(1===e?"a":"ur")},d:function(e){return"dag"+(1===e?"ur":"ar")},h:function(e){return"klukkutím"+(1===e?"i":"ar")},m:function(e){return"mínút"+(1===e?"a":"ur")},s:function(e){return"sekúnd"+(1===e?"a":"ur")},ms:function(e){return"millisekúnd"+(1===e?"a":"ur")},decimal:"."},it:{y:function(e){return"ann"+(1===e?"o":"i")},mo:function(e){return"mes"+(1===e?"e":"i")},w:function(e){return"settiman"+(1===e?"a":"e")},d:function(e){return"giorn"+(1===e?"o":"i")},h:function(e){return"or"+(1===e?"a":"e")},m:function(e){return"minut"+(1===e?"o":"i")},s:function(e){return"second"+(1===e?"o":"i")},ms:function(e){return"millisecond"+(1===e?"o":"i")},decimal:","},ja:{y:"年",mo:"月",w:"週",d:"日",h:"時間",m:"分",s:"秒",ms:"ミリ秒",decimal:"."},ko:{y:"년",mo:"개월",w:"주일",d:"일",h:"시간",m:"분",s:"초",ms:"밀리 초",decimal:"."},lo:{y:"ປີ",mo:"ເດືອນ",w:"ອາທິດ",d:"ມື້",h:"ຊົ່ວໂມງ",m:"ນາທີ",s:"ວິນາທີ",ms:"ມິນລິວິນາທີ",decimal:","},lt:{y:function(e){return e%10==0||e%100>=10&&e%100<=20?"metų":"metai"},mo:function(e){return["mėnuo","mėnesiai","mėnesių"][h(e)]},w:function(e){return["savaitė","savaitės","savaičių"][h(e)]},d:function(e){return["diena","dienos","dienų"][h(e)]},h:function(e){return["valanda","valandos","valandų"][h(e)]},m:function(e){return["minutė","minutės","minučių"][h(e)]},s:function(e){return["sekundė","sekundės","sekundžių"][h(e)]},ms:function(e){return["milisekundė","milisekundės","milisekundžių"][h(e)]},decimal:","},lv:{y:function(e){return p(e)?"gads":"gadi"},mo:function(e){return p(e)?"mēnesis":"mēneši"},w:function(e){return p(e)?"nedēļa":"nedēļas"},d:function(e){return p(e)?"diena":"dienas"},h:function(e){return p(e)?"stunda":"stundas"},m:function(e){return p(e)?"minūte":"minūtes"},s:function(e){return p(e)?"sekunde":"sekundes"},ms:function(e){return p(e)?"milisekunde":"milisekundes"},decimal:","},ms:{y:"tahun",mo:"bulan",w:"minggu",d:"hari",h:"jam",m:"minit",s:"saat",ms:"milisaat",decimal:"."},nl:{y:"jaar",mo:function(e){return 1===e?"maand":"maanden"},w:function(e){return 1===e?"week":"weken"},d:function(e){return 1===e?"dag":"dagen"},h:"uur",m:function(e){return 1===e?"minuut":"minuten"},s:function(e){return 1===e?"seconde":"seconden"},ms:function(e){return 1===e?"milliseconde":"milliseconden"},decimal:","},no:{y:"år",mo:function(e){return"måned"+(1===e?"":"er")},w:function(e){return"uke"+(1===e?"":"r")},d:function(e){return"dag"+(1===e?"":"er")},h:function(e){return"time"+(1===e?"":"r")},m:function(e){return"minutt"+(1===e?"":"er")},s:function(e){return"sekund"+(1===e?"":"er")},ms:function(e){return"millisekund"+(1===e?"":"er")},decimal:","},pl:{y:function(e){return["rok","roku","lata","lat"][f(e)]},mo:function(e){return["miesiąc","miesiąca","miesiące","miesięcy"][f(e)]},w:function(e){return["tydzień","tygodnia","tygodnie","tygodni"][f(e)]},d:function(e){return["dzień","dnia","dni","dni"][f(e)]},h:function(e){return["godzina","godziny","godziny","godzin"][f(e)]},m:function(e){return["minuta","minuty","minuty","minut"][f(e)]},s:function(e){return["sekunda","sekundy","sekundy","sekund"][f(e)]},ms:function(e){return["milisekunda","milisekundy","milisekundy","milisekund"][f(e)]},decimal:","},pt:{y:function(e){return"ano"+(1===e?"":"s")},mo:function(e){return 1===e?"mês":"meses"},w:function(e){return"semana"+(1===e?"":"s")},d:function(e){return"dia"+(1===e?"":"s")},h:function(e){return"hora"+(1===e?"":"s")},m:function(e){return"minuto"+(1===e?"":"s")},s:function(e){return"segundo"+(1===e?"":"s")},ms:function(e){return"milissegundo"+(1===e?"":"s")},decimal:","},ro:{y:function(e){return 1===e?"an":"ani"},mo:function(e){return 1===e?"lună":"luni"},w:function(e){return 1===e?"săptămână":"săptămâni"},d:function(e){return 1===e?"zi":"zile"},h:function(e){return 1===e?"oră":"ore"},m:function(e){return 1===e?"minut":"minute"},s:function(e){return 1===e?"secundă":"secunde"},ms:function(e){return 1===e?"milisecundă":"milisecunde"},decimal:","},ru:{y:function(e){return["лет","год","года"][l(e)]},mo:function(e){return["месяцев","месяц","месяца"][l(e)]},w:function(e){return["недель","неделя","недели"][l(e)]},d:function(e){return["дней","день","дня"][l(e)]},h:function(e){return["часов","час","часа"][l(e)]},m:function(e){return["минут","минута","минуты"][l(e)]},s:function(e){return["секунд","секунда","секунды"][l(e)]},ms:function(e){return["миллисекунд","миллисекунда","миллисекунды"][l(e)]},decimal:","},uk:{y:function(e){return["років","рік","роки"][l(e)]},mo:function(e){return["місяців","місяць","місяці"][l(e)]},w:function(e){return["тижнів","тиждень","тижні"][l(e)]},d:function(e){return["днів","день","дні"][l(e)]},h:function(e){return["годин","година","години"][l(e)]},m:function(e){return["хвилин","хвилина","хвилини"][l(e)]},s:function(e){return["секунд","секунда","секунди"][l(e)]},ms:function(e){return["мілісекунд","мілісекунда","мілісекунди"][l(e)]},decimal:","},ur:{y:"سال",mo:function(e){return 1===e?"مہینہ":"مہینے"},w:function(e){return 1===e?"ہفتہ":"ہفتے"},d:"دن",h:function(e){return 1===e?"گھنٹہ":"گھنٹے"},m:"منٹ",s:"سیکنڈ",ms:"ملی سیکنڈ",decimal:"."},sk:{y:function(e){return["rok","roky","roky","rokov"][d(e)]},mo:function(e){return["mesiac","mesiace","mesiace","mesiacov"][d(e)]},w:function(e){return["týždeň","týždne","týždne","týždňov"][d(e)]},d:function(e){return["deň","dni","dni","dní"][d(e)]},h:function(e){return["hodina","hodiny","hodiny","hodín"][d(e)]},m:function(e){return["minúta","minúty","minúty","minút"][d(e)]},s:function(e){return["sekunda","sekundy","sekundy","sekúnd"][d(e)]},ms:function(e){return["milisekunda","milisekundy","milisekundy","milisekúnd"][d(e)]},decimal:","},sl:{y:function(e){return e%10==1?"leto":e%100==2?"leti":e%100==3||e%100==4||Math.floor(e)!==e&&e%100<=5?"leta":"let"},mo:function(e){return e%10==1?"mesec":e%100==2||Math.floor(e)!==e&&e%100<=5?"meseca":e%10==3||e%10==4?"mesece":"mesecev"},w:function(e){return e%10==1?"teden":e%10==2||Math.floor(e)!==e&&e%100<=4?"tedna":e%10==3||e%10==4?"tedne":"tednov"},d:function(e){return e%100==1?"dan":"dni"},h:function(e){return e%10==1?"ura":e%100==2?"uri":e%10==3||e%10==4||Math.floor(e)!==e?"ure":"ur"},m:function(e){return e%10==1?"minuta":e%10==2?"minuti":e%10==3||e%10==4||Math.floor(e)!==e&&e%100<=4?"minute":"minut"},s:function(e){return e%10==1?"sekunda":e%100==2?"sekundi":e%100==3||e%100==4||Math.floor(e)!==e?"sekunde":"sekund"},ms:function(e){return e%10==1?"milisekunda":e%100==2?"milisekundi":e%100==3||e%100==4||Math.floor(e)!==e?"milisekunde":"milisekund"},decimal:","},sv:{y:"år",mo:function(e){return"månad"+(1===e?"":"er")},w:function(e){return"veck"+(1===e?"a":"or")},d:function(e){return"dag"+(1===e?"":"ar")},h:function(e){return"timm"+(1===e?"e":"ar")},m:function(e){return"minut"+(1===e?"":"er")},s:function(e){return"sekund"+(1===e?"":"er")},ms:function(e){return"millisekund"+(1===e?"":"er")},decimal:","},sw:{y:function(e){return 1===e?"mwaka":"miaka"},mo:function(e){return 1===e?"mwezi":"miezi"},w:"wiki",d:function(e){return 1===e?"siku":"masiku"},h:function(e){return 1===e?"saa":"masaa"},m:"dakika",s:"sekunde",ms:"milisekunde",decimal:"."},tr:{y:"yıl",mo:"ay",w:"hafta",d:"gün",h:"saat",m:"dakika",s:"saniye",ms:"milisaniye",decimal:","},th:{y:"ปี",mo:"เดือน",w:"สัปดาห์",d:"วัน",h:"ชั่วโมง",m:"นาที",s:"วินาที",ms:"มิลลิวินาที",decimal:"."},vi:{y:"năm",mo:"tháng",w:"tuần",d:"ngày",h:"giờ",m:"phút",s:"giây",ms:"mili giây",decimal:","},zh_CN:{y:"年",mo:"个月",w:"周",d:"天",h:"小时",m:"分钟",s:"秒",ms:"毫秒",decimal:"."},zh_TW:{y:"年",mo:"個月",w:"周",d:"天",h:"小時",m:"分鐘",s:"秒",ms:"毫秒",decimal:"."}};function a(e){var t=function(e,r){return function(e,t){var r,n,o;e=Math.abs(e);var a,s,c,f=function(e){var t=[e.language];if(m(e,"fallbacks")){if(!y(e.fallbacks)||!e.fallbacks.length)throw new Error("fallbacks must be an array with at least one element");t=t.concat(e.fallbacks)}for(var r=0;r<t.length;r++){var n=t[r];if(m(e.languages,n))return e.languages[n];if(m(i,n))return i[n]}throw new Error("No language found.")}(t),l=[];for(r=0,n=t.units.length;r<n;r++){if(a=t.units[r],s=t.unitMeasures[a],r+1===n)if(m(t,"maxDecimalPoints")){var d=Math.pow(10,t.maxDecimalPoints),h=e/s;c=parseFloat((Math.floor(d*h)/d).toFixed(t.maxDecimalPoints))}else c=e/s;else c=Math.floor(e/s);l.push({unitCount:c,unitName:a}),e-=c*s}var p,b,g=0;for(r=0;r<l.length;r++)if(l[r].unitCount){g=r;break}if(t.round)for(r=l.length-1;r>=0&&((o=l[r]).unitCount=Math.round(o.unitCount),0!==r);r--)b=l[r-1],p=t.unitMeasures[b.unitName]/t.unitMeasures[o.unitName],(o.unitCount%p==0||t.largest&&t.largest-1<r-g)&&(b.unitCount+=o.unitCount/p,o.unitCount=0);var v=[];for(r=0,l.length;r<n&&((o=l[r]).unitCount&&v.push(u(o.unitCount,o.unitName,f,t)),v.length!==t.largest);r++);return v.length?t.conjunction&&1!==v.length?2===v.length?v.join(t.conjunction):v.length>2?v.slice(0,-1).join(t.delimiter)+(t.serialComma?",":"")+t.conjunction+v.slice(-1):void 0:v.join(t.delimiter):u(0,t.units[t.units.length-1],f,t)}(e,c({},t,r||{}))};return c(t,{language:"en",delimiter:", ",spacer:" ",conjunction:"",serialComma:!0,units:["y","mo","w","d","h","m","s"],languages:{},round:!1,unitMeasures:{y:315576e5,mo:26298e5,w:6048e5,d:864e5,h:36e5,m:6e4,s:1e3,ms:1}},e)}var s=a({});function u(e,t,r,n){var o;o=m(n,"decimal")?n.decimal:m(r,"decimal")?r.decimal:".";var i,a=e.toString().replace(".",o),s=r[t];return i="function"==typeof s?s(e):s,a+n.spacer+i}function c(e){for(var t,r=1;r<arguments.length;r++)for(var n in t=arguments[r])m(t,n)&&(e[n]=t[n]);return e}function f(e){return 1===e?0:Math.floor(e)!==e?1:e%10>=2&&e%10<=4&&!(e%100>10&&e%100<20)?2:3}function l(e){return Math.floor(e)!==e?2:e%100>=5&&e%100<=20||e%10>=5&&e%10<=9||e%10==0?0:e%10==1?1:e>1?2:0}function d(e){return 1===e?0:Math.floor(e)!==e?1:e%10>=2&&e%10<=4&&e%100<10?2:3}function h(e){return 1===e||e%10==1&&e%100>20?0:Math.floor(e)!==e||e%10>=2&&e%100>20||e%10>=2&&e%100<10?1:2}function p(e){return e%10==1&&e%100!=11}var y=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function m(e,t){return Object.prototype.hasOwnProperty.call(e,t)}s.getSupportedLanguages=function(){var e=[];for(var t in i)m(i,t)&&"gr"!==t&&e.push(t);return e},s.humanizer=a,void 0===(n=function(){return s}.call(t,r,t,e))||(e.exports=n)}()},251:(e,t)=>{t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,u=(1<<s)-1,c=u>>1,f=-7,l=r?o-1:0,d=r?-1:1,h=e[t+l];for(l+=d,i=h&(1<<-f)-1,h>>=-f,f+=s;f>0;i=256*i+e[t+l],l+=d,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=n;f>0;a=256*a+e[t+l],l+=d,f-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=c}return(h?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,u,c=8*i-o-1,f=(1<<c)-1,l=f>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,p=n?1:-1,y=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=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+l>=1?d/u:d*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(t*u-1)*Math.pow(2,o),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;e[r+h]=255&s,h+=p,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[r+h]=255&a,h+=p,a/=256,c-=8);e[r+h-p]|=128*y}},6698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},7244:(e,t,r)=>{var n=r(9092)(),o=r(8075)("Object.prototype.toString"),i=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===o(e)},a=function(e){return!!i(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==o(e)&&"[object Function]"===o(e.callee)},s=function(){return i(arguments)}();i.isLegacyArguments=a,e.exports=s?i:a},9600:e=>{var t,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o(function(){throw 42},null,t)}catch(e){e!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(e){try{var t=n.call(e);return i.test(t)}catch(e){return!1}},s=function(e){try{return!a(e)&&(n.call(e),!0)}catch(e){return!1}},u=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,f=!(0 in[,]),l=function(){return!1};if("object"==typeof document){var d=document.all;u.call(d)===u.call(document.all)&&(l=function(e){if((f||!e)&&(void 0===e||"object"==typeof e))try{var t=u.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=o?function(e){if(l(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{o(e,null,t)}catch(e){if(e!==r)return!1}return!a(e)&&s(e)}:function(e){if(l(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(c)return s(e);if(a(e))return!1;var t=u.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}},8184:(e,t,r)=>{var n,o=Object.prototype.toString,i=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=r(9092)(),u=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(a.test(i.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===o.call(e);if(!u)return!1;if(void 0===n){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&u(t)}return u(e)===n}},5680:(e,t,r)=>{var n=r(5767);e.exports=function(e){return!!n(e)}},5187:e=>{e.exports=function(e){return null===e}},1514:e=>{e.exports=Math.abs},8968:e=>{e.exports=Math.floor},4459:e=>{e.exports=Number.isNaN||function(e){return e!=e}},6188:e=>{e.exports=Math.max},8002:e=>{e.exports=Math.min},5880:e=>{e.exports=Math.pow},414:e=>{e.exports=Math.round},3093:(e,t,r)=>{var n=r(4459);e.exports=function(e){return n(e)||0===e?e:e<0?-1:1}},3349:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},4367:(e,t)=>{var r=t;function n(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16));else for(n=0;n<e.length;n++){var o=e.charCodeAt(n),i=o>>8,a=255&o;i?r.push(i,a):r.push(a)}return r},r.zero2=n,r.toHex=o,r.encode=function(e,t){return"hex"===t?o(e):e}},6578:e=>{e.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},5606:e=>{var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var s,u=[],c=!1,f=-1;function l(){c&&s&&(c=!1,s.length?u=s.concat(u):f=-1,u.length&&d())}function d(){if(!c){var e=a(l);c=!0;for(var t=u.length;t;){for(s=u,u=[];++f<t;)s&&s[f].run();f=-1,t=u.length}s=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new h(e,t)),1!==u.length||c||a(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},1630:e=>{function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,r,n,o){r=r||"&",n=n||"=";var i={};if("string"!=typeof e||0===e.length)return i;var a=/\+/g;e=e.split(r);var s=1e3;o&&"number"==typeof o.maxKeys&&(s=o.maxKeys);var u=e.length;s>0&&u>s&&(u=s);for(var c=0;c<u;++c){var f,l,d,h,p=e[c].replace(a,"%20"),y=p.indexOf(n);y>=0?(f=p.substr(0,y),l=p.substr(y+1)):(f=p,l=""),d=decodeURIComponent(f),h=decodeURIComponent(l),t(i,d)?Array.isArray(i[d])?i[d].push(h):i[d]=[i[d],h]:i[d]=h}return i}},9106:e=>{var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,r,n,o){return r=r||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(o){var i=encodeURIComponent(t(o))+n;return Array.isArray(e[o])?e[o].map(function(e){return i+encodeURIComponent(t(e))}).join(r):i+encodeURIComponent(t(e[o]))}).join(r):o?encodeURIComponent(t(o))+n+encodeURIComponent(t(e)):""}},7186:(e,t,r)=>{t.decode=t.parse=r(1630),t.encode=t.stringify=r(9106)},6048:e=>{var t={};function r(e,r,n){n||(n=Error);var o=function(e){var t,n;function o(t,n,o){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,o))||this}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,o}(n);o.prototype.name=n.name,o.prototype.code=e,t[e]=o}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,r){var o,i,a,s;if("string"==typeof t&&"not "===t.substr(0,4)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length)," argument"===e.substring(r-9,r)}(e))i="The ".concat(e," ").concat(o," ").concat(n(t,"type"));else{var u=("number"!=typeof s&&(s=0),s+1>(a=e).length||-1===a.indexOf(".",s)?"argument":"property");i='The "'.concat(e,'" ').concat(u," ").concat(o," ").concat(n(t,"type"))}return i+". Received type ".concat(typeof r)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},5382:(e,t,r)=>{var n=r(5606),o=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=f;var i=r(5412),a=r(6708);r(6698)(f,i);for(var s=o(a.prototype),u=0;u<s.length;u++){var c=s[u];f.prototype[c]||(f.prototype[c]=a.prototype[c])}function f(e){if(!(this instanceof f))return new f(e);i.call(this,e),a.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",l)))}function l(){this._writableState.ended||n.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(f.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(f.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},3600:(e,t,r)=>{e.exports=o;var n=r(2229);function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}r(6698)(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},5412:(e,t,r)=>{var n,o=r(5606);e.exports=E,E.ReadableState=A,r(7007).EventEmitter;var i,a=function(e,t){return e.listeners(t).length},s=r(345),u=r(8287).Buffer,c=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},f=r(9838);i=f&&f.debuglog?f.debuglog("stream"):function(){};var l,d,h,p=r(2726),y=r(5896),m=r(5291).getHighWaterMark,b=r(6048).F,g=b.ERR_INVALID_ARG_TYPE,v=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,S=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(6698)(E,s);var M=y.errorOrDestroy,_=["error","close","destroy","pause","resume"];function A(e,t,o){n=n||r(5382),e=e||{},"boolean"!=typeof o&&(o=t instanceof n),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=m(this,e,"readableHighWaterMark",o),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=r(3141).I),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function E(e){if(n=n||r(5382),!(this instanceof E))return new E(e);var t=this instanceof n;this._readableState=new A(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function O(e,t,r,n,o){i("readableAddChunk",t);var a,s=e._readableState;if(null===t)s.reading=!1,function(e,t){if(i("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?P(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,B(e)))}}(e,s);else if(o||(a=function(e,t){var r,n;return n=t,u.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new g("chunk",["string","Buffer","Uint8Array"],t)),r}(s,t)),a)M(e,a);else if(s.objectMode||t&&t.length>0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)s.endEmitted?M(e,new S):j(e,s,t,!0);else if(s.ended)M(e,new v);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?j(e,s,t,!1):R(e,s)):j(e,s,t,!1)}else n||(s.reading=!1,R(e,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function j(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&P(e)),R(e,t)}Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),E.prototype.destroy=y.destroy,E.prototype._undestroy=y.undestroy,E.prototype._destroy=function(e,t){t(e)},E.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=u.from(e,t),t=""),r=!0),O(this,e,t,!1,r)},E.prototype.unshift=function(e){return O(this,e,null,!0,!1)},E.prototype.isPaused=function(){return!1===this._readableState.flowing},E.prototype.setEncoding=function(e){l||(l=r(3141).I);var t=new l(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,o="";null!==n;)o+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==o&&this._readableState.buffer.push(o),this._readableState.length=o.length,this};var T=1073741824;function N(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=T?e=T:(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 P(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,o.nextTick(B,e))}function B(e){var t=e._readableState;i("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,H(e)}function R(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(C,e,t))}function C(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(i("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function x(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function I(e){i("readable nexttick read 0"),e.read(0)}function k(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),H(e),t.flowing&&!t.reading&&e.read(0)}function H(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function U(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function L(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,o.nextTick(D,t,e))}function D(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function V(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}E.prototype.read=function(e){i("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return i("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?L(this):P(this),null;if(0===(e=N(e,t))&&t.ended)return 0===t.length&&L(this),null;var n,o=t.needReadable;return i("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&i("length less than watermark",o=!0),t.ended||t.reading?i("reading or ended",o=!1):o&&(i("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=N(r,t))),null===(n=e>0?U(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),r!==e&&t.ended&&L(this)),null!==n&&this.emit("data",n),n},E.prototype._read=function(e){M(this,new w("_read()"))},E.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,i("pipe count=%d opts=%j",n.pipesCount,t);var s=t&&!1===t.end||e===o.stdout||e===o.stderr?y:u;function u(){i("onend"),e.end()}n.endEmitted?o.nextTick(s):r.once("end",s),e.on("unpipe",function t(o,a){i("onunpipe"),o===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,i("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",d),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",l),f=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())});var c=function(e){return function(){var t=e._readableState;i("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,H(e))}}(r);e.on("drain",c);var f=!1;function l(t){i("ondata");var o=e.write(t);i("dest.write",o),!1===o&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==V(n.pipes,e))&&!f&&(i("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(t){i("onerror",t),y(),e.removeListener("error",d),0===a(e,"error")&&M(e,t)}function h(){e.removeListener("finish",p),y()}function p(){i("onfinish"),e.removeListener("close",h),y()}function y(){i("unpipe"),r.unpipe(e)}return r.on("data",l),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",d),e.once("close",h),e.once("finish",p),e.emit("pipe",r),n.flowing||(i("pipe resume"),r.resume()),e},E.prototype.unpipe=function(e){var t=this._readableState,r={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,r)),this;if(!e){var n=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)n[i].emit("unpipe",this,{hasUnpiped:!1});return this}var a=V(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},E.prototype.on=function(e,t){var r=s.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,i("on readable",n.length,n.reading),n.length?P(this):n.reading||o.nextTick(I,this))),r},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&o.nextTick(x,this),r},E.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||o.nextTick(x,this),t},E.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(k,e,t))}(this,e)),e.paused=!1,this},E.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},E.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var o in e.on("end",function(){if(i("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){i("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o||(r.objectMode||o&&o.length)&&(t.push(o)||(n=!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 a=0;a<_.length;a++)e.on(_[a],this.emit.bind(this,_[a]));return this._read=function(t){i("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(E.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=r(2955)),d(this)}),Object.defineProperty(E.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(E.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(E.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),E._fromList=U,Object.defineProperty(E.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(E.from=function(e,t){return void 0===h&&(h=r(5157)),h(E,e,t)})},2229:(e,t,r)=>{e.exports=f;var n=r(6048).F,o=n.ERR_METHOD_NOT_IMPLEMENTED,i=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(5382);function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function f(e){if(!(this instanceof f))return new f(e);u.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",l)}function l(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush(function(t,r){d(e,t,r)})}function d(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new s;if(e._transformState.transforming)throw new a;return e.push(null)}r(6698)(f,u),f.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},f.prototype._transform=function(e,t,r){r(new o("_transform()"))},f.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var o=this._readableState;(n.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},f.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},f.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,function(e){t(e)})}},6708:(e,t,r)=>{var n,o=r(5606);function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t){var r=e.entry;for(e.entry=null;r;){var n=r.callback;t.pendingcb--,n(void 0),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=E,E.WritableState=A;var a,s={deprecate:r(4643)},u=r(345),c=r(8287).Buffer,f=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},l=r(5896),d=r(5291).getHighWaterMark,h=r(6048).F,p=h.ERR_INVALID_ARG_TYPE,y=h.ERR_METHOD_NOT_IMPLEMENTED,m=h.ERR_MULTIPLE_CALLBACK,b=h.ERR_STREAM_CANNOT_PIPE,g=h.ERR_STREAM_DESTROYED,v=h.ERR_STREAM_NULL_VALUES,w=h.ERR_STREAM_WRITE_AFTER_END,S=h.ERR_UNKNOWN_ENCODING,M=l.errorOrDestroy;function _(){}function A(e,t,a){n=n||r(5382),e=e||{},"boolean"!=typeof a&&(a=t instanceof n),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,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 r=e._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new m;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(B,e,t),e._writableState.errorEmitted=!0,M(e,n)):(i(n),e._writableState.errorEmitted=!0,M(e,n),B(e,t))}(e,r,n,t,i);else{var a=N(r)||e.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||T(e,r),n?o.nextTick(j,e,r,a,i):j(e,r,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function E(e){var t=this instanceof(n=n||r(5382));if(!t&&!a.call(E,this))return new E(e);this._writableState=new A(e,this,t),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)),u.call(this)}function O(e,t,r,n,o,i,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):r?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function j(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),B(e,t)}function T(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,o=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var s=0,u=!0;r;)o[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;o.allBuffers=u,O(e,t,!0,t.length,o,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(O(e,t,!1,t.objectMode?1:c.length,c,f,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function N(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function P(e,t){e._final(function(r){t.pendingcb--,r&&M(e,r),t.prefinished=!0,e.emit("prefinish"),B(e,t)})}function B(e,t){var r=N(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,o.nextTick(P,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(6698)(E,u),A.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(A.prototype,"buffer",{get:s.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]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(E,Symbol.hasInstance,{value:function(e){return!!a.call(this,e)||this===E&&e&&e._writableState instanceof A}})):a=function(e){return e instanceof this},E.prototype.pipe=function(){M(this,new b)},E.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=e,c.isBuffer(n)||n instanceof f);return s&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=_),i.ending?function(e,t){var r=new w;M(e,r),o.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i;return null===r?i=new v:"string"==typeof r||t.objectMode||(i=new p("chunk",["string","Buffer"],r)),!i||(M(e,i),o.nextTick(n,i),!1)}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,o,i){if(!r){var a=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,r)),t}(t,n,o);n!==a&&(r=!0,o="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var f=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:o,isBuf:r,callback:i,next:null},f?f.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else O(e,t,!1,s,n,o,i);return u}(this,i,s,e,t,r)),a},E.prototype.cork=function(){this._writableState.corked++},E.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||T(this,e))},E.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new S(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(E.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(e,t,r){r(new y("_write()"))},E.prototype._writev=null,E.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,B(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(E.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),E.prototype.destroy=l.destroy,E.prototype._undestroy=l.undestroy,E.prototype._destroy=function(e,t){t(e)}},2955:(e,t,r)=>{var n,o=r(5606);function i(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=r(6238),s=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),f=Symbol("ended"),l=Symbol("lastPromise"),d=Symbol("handlePromise"),h=Symbol("stream");function p(e,t){return{value:e,done:t}}function y(e){var t=e[s];if(null!==t){var r=e[h].read();null!==r&&(e[l]=null,e[s]=null,e[u]=null,t(p(r,!1)))}}function m(e){o.nextTick(y,e)}var b=Object.getPrototypeOf(function(){}),g=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[f])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise(function(t,r){o.nextTick(function(){e[c]?r(e[c]):t(p(void 0,!0))})});var r,n=this[l];if(n)r=new Promise(function(e,t){return function(r,n){e.then(function(){t[f]?r(p(void 0,!0)):t[d](r,n)},n)}}(n,this));else{var i=this[h].read();if(null!==i)return Promise.resolve(p(i,!1));r=new Promise(this[d])}return this[l]=r,r}},Symbol.asyncIterator,function(){return this}),i(n,"return",function(){var e=this;return new Promise(function(t,r){e[h].destroy(null,function(e){e?r(e):t(p(void 0,!0))})})}),n),b);e.exports=function(e){var t,r=Object.create(g,(i(t={},h,{value:e,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,c,{value:null,writable:!0}),i(t,f,{value:e._readableState.endEmitted,writable:!0}),i(t,d,{value:function(e,t){var n=r[h].read();n?(r[l]=null,r[s]=null,r[u]=null,e(p(n,!1))):(r[s]=e,r[u]=t)},writable:!0}),t));return r[l]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];return null!==t&&(r[l]=null,r[s]=null,r[u]=null,t(e)),void(r[c]=e)}var n=r[s];null!==n&&(r[l]=null,r[s]=null,r[u]=null,n(p(void 0,!0))),r[f]=!0}),e.on("readable",m.bind(null,r)),r}},2726:(e,t,r)=>{function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function i(e,t,r){return(t=a(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}var s=r(8287).Buffer,u=r(5340).inspect,c=u&&u.custom||"inspect";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}var t,r;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?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,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);for(var t,r,n,o=s.allocUnsafe(e>>>0),i=this.head,a=0;i;)t=i.data,r=o,n=a,s.prototype.copy.call(t,r,n),a+=i.data.length,i=i.next;return o}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var o=t.data,i=e>o.length?o.length:e;if(i===o.length?n+=o:n+=o.slice(0,e),0==(e-=i)){i===o.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=o.slice(i));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,i=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,i),0==(e-=i)){i===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(i));break}++n}return this.length-=n,t}},{key:c,value:function(e,t){return u(this,o(o({},t),{},{depth:0,customInspect:!1}))}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},5896:(e,t,r)=>{var n=r(5606);function o(e,t){a(e,t),i(e)}function i(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function a(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(a,this,e)):n.nextTick(a,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(i,r):(r._writableState.errorEmitted=!0,n.nextTick(o,r,e)):n.nextTick(o,r,e):t?(n.nextTick(i,r),t(e)):n.nextTick(i,r)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},6238:(e,t,r)=>{var n=r(6048).F.ERR_STREAM_PREMATURE_CLOSE;function o(){}e.exports=function e(t,r,i){if("function"==typeof r)return e(t,null,r);r||(r={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];e.apply(this,n)}}}(i||o);var a=r.readable||!1!==r.readable&&t.readable,s=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||f()},c=t._writableState&&t._writableState.finished,f=function(){s=!1,c=!0,a||i.call(t)},l=t._readableState&&t._readableState.endEmitted,d=function(){a=!1,l=!0,s||i.call(t)},h=function(e){i.call(t,e)},p=function(){var e;return a&&!l?(t._readableState&&t._readableState.ended||(e=new n),i.call(t,e)):s&&!c?(t._writableState&&t._writableState.ended||(e=new n),i.call(t,e)):void 0},y=function(){t.req.on("finish",f)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",f),t.on("abort",p),t.req?y():t.on("request",y)):s&&!t._writableState&&(t.on("end",u),t.on("close",u)),t.on("end",d),t.on("finish",f),!1!==r.error&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",f),t.removeListener("abort",p),t.removeListener("request",y),t.req&&t.req.removeListener("finish",f),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",f),t.removeListener("end",d),t.removeListener("error",h),t.removeListener("close",p)}}},5157:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},7758:(e,t,r)=>{var n,o=r(6048).F,i=o.ERR_MISSING_ARGS,a=o.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function u(e){e()}function c(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];var f,l=function(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new i("streams");var d=t.map(function(e,o){var i=o<t.length-1;return function(e,t,o,i){i=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(i);var s=!1;e.on("close",function(){s=!0}),void 0===n&&(n=r(6238)),n(e,{readable:t,writable:o},function(e){if(e)return i(e);s=!0,i()});var u=!1;return function(t){if(!s&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void i(t||new a("pipe"))}}(e,i,o>0,function(e){f||(f=e),e&&d.forEach(u),i||(d.forEach(u),l(f))})});return t.reduce(c)}},5291:(e,t,r)=>{var n=r(6048).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,o){var i=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,o,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new n(o?r:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384}}},345:(e,t,r)=>{e.exports=r(7007).EventEmitter},8399:(e,t,r)=>{(t=e.exports=r(5412)).Stream=t,t.Readable=t,t.Writable=r(6708),t.Duplex=r(5382),t.Transform=r(2229),t.PassThrough=r(3600),t.finished=r(6238),t.pipeline=r(7758)},2861:(e,t,r)=>{var n=r(8287),o=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=a),a.prototype=Object.create(o.prototype),i(o,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},4774:(e,t,r)=>{var n,o=r(5606),i=r(8287),a=i.Buffer,s={};for(n in i)i.hasOwnProperty(n)&&"SlowBuffer"!==n&&"Buffer"!==n&&(s[n]=i[n]);var u=s.Buffer={};for(n in a)a.hasOwnProperty(n)&&"allocUnsafe"!==n&&"allocUnsafeSlow"!==n&&(u[n]=a[n]);if(s.Buffer.prototype=a.prototype,u.from&&u.from!==Uint8Array.from||(u.from=function(e,t,r){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 a(e,t,r)}),u.alloc||(u.alloc=function(e,t,r){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 n=a(e);return t&&0!==t.length?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n}),!s.kStringMaxLength)try{s.kStringMaxLength=o.binding("buffer").kStringMaxLength}catch(e){}s.constants||(s.constants={MAX_LENGTH:s.kMaxLength},s.kStringMaxLength&&(s.constants.MAX_STRING_LENGTH=s.kStringMaxLength)),e.exports=s},6897:(e,t,r)=>{var n=r(453),o=r(41),i=r(592)(),a=r(5795),s=r(9675),u=n("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new s("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||u(t)!==t)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,c=!0;if("length"in e&&a){var f=a(e,"length");f&&!f.configurable&&(n=!1),f&&!f.writable&&(c=!1)}return(n||c||!r)&&(i?o(e,"length",t,!0,!0):o(e,"length",t)),e}},1568:(e,t,r)=>{var n=r(5537),o=r(6917),i=r(7510),a=r(6866),s=r(8835),u=t;u.request=function(e,t){e="string"==typeof e?s.parse(e):i(e);var o=-1===r.g.location.protocol.search(/^https?:$/)?"http:":"",a=e.protocol||o,u=e.hostname||e.host,c=e.port,f=e.path||"/";u&&-1!==u.indexOf(":")&&(u="["+u+"]"),e.url=(u?a+"//"+u:"")+(c?":"+c:"")+f,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var l=new n(e);return t&&l.on("response",t),l},u.get=function(e,t){var r=u.request(e,t);return r.end(),r},u.ClientRequest=n,u.IncomingMessage=o.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=a,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]},6688:(e,t,r)=>{var n;function o(){if(void 0!==n)return n;if(r.g.XMLHttpRequest){n=new r.g.XMLHttpRequest;try{n.open("GET",r.g.XDomainRequest?"/":"https://example.com")}catch(e){n=null}}else n=null;return n}function i(e){var t=o();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}function a(e){return"function"==typeof e}t.fetch=a(r.g.fetch)&&a(r.g.ReadableStream),t.writableStream=a(r.g.WritableStream),t.abortController=a(r.g.AbortController),t.arraybuffer=t.fetch||i("arraybuffer"),t.msstream=!t.fetch&&i("ms-stream"),t.mozchunkedarraybuffer=!t.fetch&&i("moz-chunked-arraybuffer"),t.overrideMimeType=t.fetch||!!o()&&a(o().overrideMimeType),n=null},5537:(e,t,r)=>{var n=r(8287).Buffer,o=r(5606),i=r(6688),a=r(6698),s=r(6917),u=r(8399),c=s.IncomingMessage,f=s.readyStates,l=e.exports=function(e){var t,r=this;u.Writable.call(r),r._opts=e,r._body=[],r._headers={},e.auth&&r.setHeader("Authorization","Basic "+n.from(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(t){r.setHeader(t,e.headers[t])});var o=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!i.abortController)o=!1,t=!0;else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!i.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");t=!0}r._mode=function(e,t){return i.fetch&&t?"fetch":i.mozchunkedarraybuffer?"moz-chunked-arraybuffer":i.msstream?"ms-stream":i.arraybuffer&&e?"arraybuffer":"text"}(t,o),r._fetchTimer=null,r._socketTimeout=null,r._socketTimer=null,r.on("finish",function(){r._onFinish()})};a(l,u.Writable),l.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===d.indexOf(r)&&(this._headers[r]={name:e,value:t})},l.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},l.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},l.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts;"timeout"in t&&0!==t.timeout&&e.setTimeout(t.timeout);var n=e._headers,a=null;"GET"!==t.method&&"HEAD"!==t.method&&(a=new Blob(e._body,{type:(n["content-type"]||{}).value||""}));var s=[];if(Object.keys(n).forEach(function(e){var t=n[e].name,r=n[e].value;Array.isArray(r)?r.forEach(function(e){s.push([t,e])}):s.push([t,r])}),"fetch"===e._mode){var u=null;if(i.abortController){var c=new AbortController;u=c.signal,e._fetchAbortController=c,"requestTimeout"in t&&0!==t.requestTimeout&&(e._fetchTimer=r.g.setTimeout(function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()},t.requestTimeout))}r.g.fetch(e._opts.url,{method:e._opts.method,headers:s,body:a||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:u}).then(function(t){e._fetchResponse=t,e._resetTimers(!1),e._connect()},function(t){e._resetTimers(!0),e._destroyed||e.emit("error",t)})}else{var l=e._xhr=new r.g.XMLHttpRequest;try{l.open(e._opts.method,e._opts.url,!0)}catch(t){return void o.nextTick(function(){e.emit("error",t)})}"responseType"in l&&(l.responseType=e._mode),"withCredentials"in l&&(l.withCredentials=!!t.withCredentials),"text"===e._mode&&"overrideMimeType"in l&&l.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in t&&(l.timeout=t.requestTimeout,l.ontimeout=function(){e.emit("requestTimeout")}),s.forEach(function(e){l.setRequestHeader(e[0],e[1])}),e._response=null,l.onreadystatechange=function(){switch(l.readyState){case f.LOADING:case f.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(l.onprogress=function(){e._onXHRProgress()}),l.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit("error",new Error("XHR error")))};try{l.send(a)}catch(t){return void o.nextTick(function(){e.emit("error",t)})}}}},l.prototype._onXHRProgress=function(){var e=this;e._resetTimers(!1),function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}}(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress(e._resetTimers.bind(e)))},l.prototype._connect=function(){var e=this;e._destroyed||(e._response=new c(e._xhr,e._fetchResponse,e._mode,e._resetTimers.bind(e)),e._response.on("error",function(t){e.emit("error",t)}),e.emit("response",e._response))},l.prototype._write=function(e,t,r){this._body.push(e),r()},l.prototype._resetTimers=function(e){var t=this;r.g.clearTimeout(t._socketTimer),t._socketTimer=null,e?(r.g.clearTimeout(t._fetchTimer),t._fetchTimer=null):t._socketTimeout&&(t._socketTimer=r.g.setTimeout(function(){t.emit("timeout")},t._socketTimeout))},l.prototype.abort=l.prototype.destroy=function(e){var t=this;t._destroyed=!0,t._resetTimers(!0),t._response&&(t._response._destroyed=!0),t._xhr?t._xhr.abort():t._fetchAbortController&&t._fetchAbortController.abort(),e&&t.emit("error",e)},l.prototype.end=function(e,t,r){"function"==typeof e&&(r=e,e=void 0),u.Writable.prototype.end.call(this,e,t,r)},l.prototype.setTimeout=function(e,t){var r=this;t&&r.once("timeout",t),r._socketTimeout=e,r._resetTimers(!1)},l.prototype.flushHeaders=function(){},l.prototype.setNoDelay=function(){},l.prototype.setSocketKeepAlive=function(){};var d=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]},6917:(e,t,r)=>{var n=r(5606),o=r(8287).Buffer,i=r(6688),a=r(6698),s=r(8399),u=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=t.IncomingMessage=function(e,t,r,a){var u=this;if(s.Readable.call(u),u._mode=r,u.headers={},u.rawHeaders=[],u.trailers={},u.rawTrailers=[],u.on("end",function(){n.nextTick(function(){u.emit("close")})}),"fetch"===r){if(u._fetchResponse=t,u.url=t.url,u.statusCode=t.status,u.statusMessage=t.statusText,t.headers.forEach(function(e,t){u.headers[t.toLowerCase()]=e,u.rawHeaders.push(t,e)}),i.writableStream){var c=new WritableStream({write:function(e){return a(!1),new Promise(function(t,r){u._destroyed?r():u.push(o.from(e))?t():u._resumeFetch=t})},close:function(){a(!0),u._destroyed||u.push(null)},abort:function(e){a(!0),u._destroyed||u.emit("error",e)}});try{return void t.body.pipeTo(c).catch(function(e){a(!0),u._destroyed||u.emit("error",e)})}catch(e){}}var f=t.body.getReader();!function e(){f.read().then(function(t){u._destroyed||(a(t.done),t.done?u.push(null):(u.push(o.from(t.value)),e()))}).catch(function(e){a(!0),u._destroyed||u.emit("error",e)})}()}else if(u._xhr=e,u._pos=0,u.url=e.responseURL,u.statusCode=e.status,u.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach(function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var r=t[1].toLowerCase();"set-cookie"===r?(void 0===u.headers[r]&&(u.headers[r]=[]),u.headers[r].push(t[2])):void 0!==u.headers[r]?u.headers[r]+=", "+t[2]:u.headers[r]=t[2],u.rawHeaders.push(t[1],t[2])}}),u._charset="x-user-defined",!i.overrideMimeType){var l=u.rawHeaders["mime-type"];if(l){var d=l.match(/;\s*charset=([^;])(;|$)/);d&&(u._charset=d[1].toLowerCase())}u._charset||(u._charset="utf-8")}};a(c,s.Readable),c.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},c.prototype._onXHRProgress=function(e){var t=this,n=t._xhr,i=null;switch(t._mode){case"text":if((i=n.responseText).length>t._pos){var a=i.substr(t._pos);if("x-user-defined"===t._charset){for(var s=o.alloc(a.length),c=0;c<a.length;c++)s[c]=255&a.charCodeAt(c);t.push(s)}else t.push(a,t._charset);t._pos=i.length}break;case"arraybuffer":if(n.readyState!==u.DONE||!n.response)break;i=n.response,t.push(o.from(new Uint8Array(i)));break;case"moz-chunked-arraybuffer":if(i=n.response,n.readyState!==u.LOADING||!i)break;t.push(o.from(new Uint8Array(i)));break;case"ms-stream":if(i=n.response,n.readyState!==u.LOADING)break;var f=new r.g.MSStreamReader;f.onprogress=function(){f.result.byteLength>t._pos&&(t.push(o.from(new Uint8Array(f.result.slice(t._pos)))),t._pos=f.result.byteLength)},f.onload=function(){e(!0),t.push(null)},f.readAsArrayBuffer(i)}t._xhr.readyState===u.DONE&&"ms-stream"!==t._mode&&(e(!0),t.push(null))}},3141:(e,t,r)=>{var n=r(2861).Buffer,o=n.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&&(n.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=l,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.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,r=function(e,t){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!==r?r: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 u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function f(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?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-r))}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 d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.I=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=a(t[n]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--n<r||-2===o?0:(o=a(t[n]))>=0?(o>0&&(e.lastNeed=o-2),o):--n<r||-2===o?0:(o=a(t[n]))>=0?(o>0&&(2===o?o=0:e.lastNeed=o-3),o):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},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}},872:(e,t)=>{var r,n,o;Object.defineProperty(t,"__esModule",{value:!0}),t.NFTTokenStandard=t.AuctionManagerEntryPoint=t.CasperNetworkName=void 0,(o=t.CasperNetworkName||(t.CasperNetworkName={})).Mainnet="casper",o.Testnet="casper-test",o.Integration="integration-test",o.DevNet="dev-net",(n=t.AuctionManagerEntryPoint||(t.AuctionManagerEntryPoint={})).delegate="delegate",n.undelegate="undelegate",n.redelegate="redelegate",n.addBid="add_bid",n.withdrawBid="withdraw_bid",n.activateBid="activate_bid",(r=t.NFTTokenStandard||(t.NFTTokenStandard={})).CEP47="CEP47",r.CEP78="CEP78",r.CEP95="CEP95"},471:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorCode=void 0,(r=t.ErrorCode||(t.ErrorCode={}))[r.NoSuchDeploy=-32e3]="NoSuchDeploy",r[r.NoSuchBlock=-32001]="NoSuchBlock",r[r.FailedToParseQueryKey=-32002]="FailedToParseQueryKey",r[r.QueryFailed=-32003]="QueryFailed",r[r.QueryFailedToExecute=-32004]="QueryFailedToExecute",r[r.FailedToParseGetBalanceURef=-32005]="FailedToParseGetBalanceURef",r[r.FailedToGetBalance=-32006]="FailedToGetBalance",r[r.GetBalanceFailedToExecute=-32007]="GetBalanceFailedToExecute",r[r.InvalidDeploy=-32008]="InvalidDeploy",r[r.NoSuchAccount=-32009]="NoSuchAccount",r[r.FailedToGetDictionaryURef=-32010]="FailedToGetDictionaryURef",r[r.FailedToGetTrie=-32011]="FailedToGetTrie",r[r.NoSuchStateRoot=-32012]="NoSuchStateRoot",r[r.NoMainPurse=-32013]="NoMainPurse",r[r.NoSuchTransaction=-32014]="NoSuchTransaction",r[r.VariantMismatch=-32015]="VariantMismatch",r[r.InvalidTransaction=-32016]="InvalidTransaction",r[r.InvalidBlock=-32017]="InvalidBlock",r[r.NodeRequestFailed=-32018]="NodeRequestFailed",r[r.FunctionIsDisabled=-32019]="FunctionIsDisabled",r[r.NoSuchAddressableEntity=-32020]="NoSuchAddressableEntity",r[r.AccountMigratedToEntity=-32021]="AccountMigratedToEntity",r[r.NoRewardsFound=-32022]="NoRewardsFound",r[r.SwitchBlockNotFound=-32023]="SwitchBlockNotFound",r[r.SwitchBlockParentNotFound=-32024]="SwitchBlockParentNotFound",r[r.UnsupportedRewardsV1Request=-32025]="UnsupportedRewardsV1Request",r[r.PurseNotFound=-32026]="PurseNotFound"},7909:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(872),t),o(r(471),t)},887:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(7545),t),o(r(8855),t),o(r(7941),t),o(r(8389),t),o(r(7909),t)},848:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7021:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpError=t.RpcError=void 0;var s=r(9592),u=function(e){function t(t,r,n){void 0===t&&(t=0),void 0===r&&(r="");var o=e.call(this,r)||this;return o.code=t,o.data=n,o}return o(t,e),t.prototype.toString=function(){return"key: ".concat(this.message,", data: ").concat(JSON.stringify(this.data))},i([(0,s.jsonMember)({constructor:Number}),a("design:type",Number)],t.prototype,"code",void 0),i([(0,s.jsonMember)({isRequired:!1,constructor:s.AnyT}),a("design:type",Object)],t.prototype,"data",void 0),i([s.jsonObject,a("design:paramtypes",[Object,Object,Object])],t)}(Error);t.RpcError=u;var c=function(e){function t(t,r){void 0===t&&(t=0);var n=e.call(this,"Code: ".concat(t,", err: ").concat(r.message))||this;return n.sourceErr=r,n.statusCode=t,n}return o(t,e),t.prototype.unwrap=function(){return this.sourceErr},t.prototype.isNotFound=function(){return 404===this.statusCode},t.isHttpError=function(e){return Boolean((null==e?void 0:e.statusCode)&&(null==e?void 0:e.sourceErr))},i([(0,s.jsonMember)({constructor:Error}),a("design:type",Object)],t.prototype,"sourceErr",void 0),i([(0,s.jsonMember)({constructor:Number}),a("design:type",Number)],t.prototype,"statusCode",void 0),i([s.jsonObject,a("design:paramtypes",[Object,Object])],t)}(Error);t.HttpError=c},440:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}u((n=n.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpHandler=t.ErrRpcResponseUnmarshal=t.ErrReadHttpResponseBody=t.ErrProcessHttpRequest=t.ErrParamsJsonStringifyHandler=void 0;var s=r(9592),u=a(r(6425)),c=r(7021),f=r(5409);t.ErrParamsJsonStringifyHandler=new Error("failed to stringify json rpc request's params"),t.ErrProcessHttpRequest=new Error("failed to send http request"),t.ErrReadHttpResponseBody=new Error("failed to read http response body"),t.ErrRpcResponseUnmarshal=new Error("failed to unmarshal rpc response");var l=function(){function e(e,t){void 0===t&&(t="axios"),this.customHeaders={},this.endpoint=e,this.client=t,"axios"===t&&(this.httpClient=u.default.create())}return e.prototype.setCustomHeaders=function(e){this.customHeaders=e},e.prototype.setReferrer=function(e){this.referrer=e},e.prototype.processCall=function(e){return o(this,void 0,void 0,function(){var r,n;return i(this,function(o){r=new s.TypedJSON(f.RpcRequest);try{n=r.stringify(e)}catch(e){throw new Error("".concat(t.ErrParamsJsonStringifyHandler.message,", details: ").concat(e.message))}return"axios"===this.client?[2,this.processAxiosRequest(n)]:[2,this.processFetchRequest(n)]})})},e.prototype.processAxiosRequest=function(e){return o(this,void 0,void 0,function(){var r,o,a;return i(this,function(i){switch(i.label){case 0:r={method:"POST",url:this.endpoint,headers:n({"Content-Type":"application/json"},this.customHeaders),data:e},i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.httpClient.request(r)];case 2:if((o=i.sent()).status<200||o.status>=300)throw new c.HttpError(o.status,new Error(o.statusText));return[2,o.data];case 3:if(a=i.sent(),u.default.isAxiosError(a)&&a.response)throw new c.HttpError(a.response.status,new Error(a.response.statusText));throw new Error("".concat(t.ErrProcessHttpRequest.message,", details: ").concat(a.message));case 4:return[2]}})})},e.prototype.processFetchRequest=function(e){return o(this,void 0,void 0,function(){var r,o;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,fetch(this.endpoint,n(n({method:"POST"},this.referrer?{referrer:this.referrer}:{}),{headers:n({"Content-Type":"application/json"},this.customHeaders),body:e}))];case 1:if((r=i.sent()).status<200||r.status>=300)throw new c.HttpError(r.status,new Error(r.statusText));return[2,r.json()];case 2:throw o=i.sent(),new Error("".concat(t.ErrProcessHttpRequest.message,", details: ").concat(o.message));case 3:return[2]}})})},e}();t.HttpHandler=l},8608:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.IDValue=void 0;var i=r(9592),a=function(){function e(e){this.intValue=null,this.strValue=null,"number"==typeof e?(this.intValue=e,this.isIntValue=!0):(this.strValue=e,this.isIntValue=!1)}var t;return t=e,e.fromString=function(e){return new t(e)},e.fromInt=function(e){return new t(e)},e.prototype.toString=function(){return this.isIntValue&&null!==this.intValue?this.intValue.toString():this.strValue||""},e.prototype.toInt=function(){if(this.isIntValue&&null!==this.intValue)return this.intValue;var e=parseInt(this.strValue||"0",10);return isNaN(e)?0:e},e.prototype.toJSON=function(){return this.toString()},e.fromJSON=function(e){if("number"==typeof e)return t.fromInt(e);if("string"==typeof e)return t.fromString(e);throw new Error("IDValue should be an int or string")},n([(0,i.jsonMember)({constructor:Number,isRequired:!1,preserveNull:!0}),o("design:type",Object)],e.prototype,"intValue",void 0),n([(0,i.jsonMember)({constructor:String,isRequired:!1,preserveNull:!0}),o("design:type",Object)],e.prototype,"strValue",void 0),n([(0,i.jsonMember)({constructor:Boolean}),o("design:type",Boolean)],e.prototype,"isIntValue",void 0),t=n([i.jsonObject,o("design:paramtypes",[Object])],e)}();t.IDValue=a},8855:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(848),t),o(r(7021),t),o(r(440),t),o(r(8608),t),o(r(5409),t),o(r(1412),t),o(r(4176),t),o(r(5060),t)},5409:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.StateGetDictionaryRequest=t.StateGetBalanceRequest=t.InfoGetRewardRequest=t.QueryBalanceDetailsRequest=t.QueryBalanceRequest=t.PurseIdentifier=t.SpeculativeExecParams=t.ParamDictionaryIdentifier=t.ParamDictionaryIdentifierContractNamedKey=t.AccountNamedKey=t.ParamDictionaryIdentifierURef=t.EraIdentifier=t.GlobalStateIdentifier=t.PutTransactionRequest=t.PutDeployRequest=t.AccountIdentifier=t.ParamGetStateEntity=t.EntityIdentifier=t.ParamGetAccountInfoBalance=t.ParamBlockIdentifier=t.ParamDeployHash=t.ParamTransactionHash=t.ParamQueryGlobalState=t.ParamQueryGlobalStateID=t.BlockIdentifier=t.ParamStateRootHash=t.RpcRequest=t.Method=t.ApiVersion=void 0;var i,a=r(9592),s=r(8608),u=r(7545);t.ApiVersion="2.0",(i=t.Method||(t.Method={})).GetDeploy="info_get_deploy",i.GetTransaction="info_get_transaction",i.GetStateItem="state_get_item",i.QueryGlobalState="query_global_state",i.GetDictionaryItem="state_get_dictionary_item",i.GetStateBalance="state_get_balance",i.GetStateAccount="state_get_account_info",i.GetStateEntity="state_get_entity",i.GetEraInfo="chain_get_era_info_by_switch_block",i.GetBlock="chain_get_block",i.GetBlockTransfers="chain_get_block_transfers",i.GetEraSummary="chain_get_era_summary",i.GetAuctionInfo="state_get_auction_info",i.GetAuctionInfoV2="state_get_auction_info_v2",i.GetValidatorChanges="info_get_validator_changes",i.GetStateRootHash="chain_get_state_root_hash",i.GetStatus="info_get_status",i.GetReward="info_get_reward",i.GetPeers="info_get_peers",i.PutDeploy="account_put_deploy",i.PutTransaction="account_put_transaction",i.SpeculativeExec="speculative_exec",i.QueryBalance="query_balance",i.QueryBalanceDetails="query_balance_details",i.InfoGetChainspec="info_get_chainspec";var c=function(){function e(e,t,r,n){this.version=e,this.method=t,this.params=r,this.id=n}var r;return r=e,e.defaultRpcRequest=function(e,n){return new r(t.ApiVersion,e,n,s.IDValue.fromString("1"))},n([(0,a.jsonMember)({constructor:String,name:"jsonrpc"}),o("design:type",String)],e.prototype,"version",void 0),n([(0,a.jsonMember)({constructor:s.IDValue,isRequired:!1,deserializer:function(e){return s.IDValue.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",s.IDValue)],e.prototype,"id",void 0),n([(0,a.jsonMember)({constructor:String}),o("design:type",String)],e.prototype,"method",void 0),n([(0,a.jsonMember)({constructor:a.AnyT}),o("design:type",Object)],e.prototype,"params",void 0),r=n([a.jsonObject,o("design:paramtypes",[String,String,Object,s.IDValue])],e)}();t.RpcRequest=c;var f=function(){function e(e,t,r){this.stateRootHash=e,this.key=t,this.path=r}return n([(0,a.jsonMember)({constructor:String,name:"state_root_hash"}),o("design:type",String)],e.prototype,"stateRootHash",void 0),n([(0,a.jsonMember)({constructor:String}),o("design:type",String)],e.prototype,"key",void 0),n([(0,a.jsonArrayMember)(String),o("design:type",Array)],e.prototype,"path",void 0),n([a.jsonObject,o("design:paramtypes",[String,String,Array])],e)}();t.ParamStateRootHash=f;var l=function(){function e(e,t){this.hash=e,this.height=t}return n([(0,a.jsonMember)({isRequired:!1,constructor:String,name:"Hash"}),o("design:type",String)],e.prototype,"hash",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:Number,name:"Height"}),o("design:type",Number)],e.prototype,"height",void 0),n([a.jsonObject,o("design:paramtypes",[String,Number])],e)}();t.BlockIdentifier=l;var d=function(){function e(e,t,r){this.stateRootHash=e,this.blockHash=t,this.blockHeight=r}return n([(0,a.jsonMember)({isRequired:!1,constructor:String,name:"StateRootHash"}),o("design:type",String)],e.prototype,"stateRootHash",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:String,name:"BlockHash"}),o("design:type",String)],e.prototype,"blockHash",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:Number,name:"BlockHeight"}),o("design:type",Number)],e.prototype,"blockHeight",void 0),n([a.jsonObject,o("design:paramtypes",[String,String,Number])],e)}();t.ParamQueryGlobalStateID=d;var h=function(){function e(e,t,r){this.stateIdentifier=e,this.key=t,this.path=r}var t;return t=e,e.newQueryGlobalStateParam=function(e,r,n){return new t(n,e,r)},n([(0,a.jsonMember)({isRequired:!1,constructor:d,name:"state_identifier"}),o("design:type",d)],e.prototype,"stateIdentifier",void 0),n([(0,a.jsonMember)({constructor:String}),o("design:type",String)],e.prototype,"key",void 0),n([(0,a.jsonArrayMember)(String),o("design:type",Array)],e.prototype,"path",void 0),t=n([a.jsonObject,o("design:paramtypes",[Object,String,Array])],e)}();t.ParamQueryGlobalState=h;var p=function(){function e(e,t){this.transactionHash=e,this.finalizedApprovals=t}return n([(0,a.jsonMember)({constructor:u.TransactionHash,isRequired:!1,name:"transaction_hash"}),o("design:type",u.TransactionHash)],e.prototype,"transactionHash",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:Boolean,name:"finalized_approvals"}),o("design:type",Boolean)],e.prototype,"finalizedApprovals",void 0),n([a.jsonObject,o("design:paramtypes",[u.TransactionHash,Boolean])],e)}();t.ParamTransactionHash=p;var y=function(){function e(e,t){this.deployHash=e,this.finalizedApprovals=t}return n([(0,a.jsonMember)({name:"deploy_hash",constructor:String}),o("design:type",String)],e.prototype,"deployHash",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:Boolean,name:"finalized_approvals"}),o("design:type",Boolean)],e.prototype,"finalizedApprovals",void 0),n([a.jsonObject,o("design:paramtypes",[String,Boolean])],e)}();t.ParamDeployHash=y;var m=function(){function e(e){this.blockIdentifier=e}var t;return t=e,e.byHeight=function(e){return new t(new l(void 0,e))},e.byHash=function(e){return new t(new l(e))},n([(0,a.jsonMember)({isRequired:!1,constructor:l,name:"block_identifier"}),o("design:type",l)],e.prototype,"blockIdentifier",void 0),t=n([a.jsonObject,o("design:paramtypes",[l])],e)}();t.ParamBlockIdentifier=m;var b=function(){function e(e,t){this.accountIdentifier=e,this.paramBlockIdentifier=t}return e.prototype.toJSON=function(){return Object.assign({account_identifier:this.accountIdentifier},this.paramBlockIdentifier?new a.TypedJSON(m).toPlainJson(this.paramBlockIdentifier):{})},n([(0,a.jsonMember)({constructor:String,name:"account_identifier"}),o("design:type",String)],e.prototype,"accountIdentifier",void 0),n([(0,a.jsonMember)({constructor:m}),o("design:type",m)],e.prototype,"paramBlockIdentifier",void 0),n([a.jsonObject,o("design:paramtypes",[String,m])],e)}();t.ParamGetAccountInfoBalance=b;var g=function(){function e(e,t,r){this.accountHash=e,this.publicKey=t,this.entityAddr=r}var t;return t=e,e.fromAccountHash=function(e){return new t(e)},e.fromPublicKey=function(e){return new t(void 0,e)},e.fromEntityAddr=function(e){return new t(void 0,void 0,e)},n([(0,a.jsonMember)({constructor:u.AccountHash,name:"AccountHash",isRequired:!1,deserializer:function(e){if(e)return u.AccountHash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.AccountHash)],e.prototype,"accountHash",void 0),n([(0,a.jsonMember)({constructor:u.PublicKey,name:"PublicKey",isRequired:!1,deserializer:function(e){if(e)return u.PublicKey.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.PublicKey)],e.prototype,"publicKey",void 0),n([(0,a.jsonMember)({constructor:u.EntityAddr,name:"EntityAddr",isRequired:!1,deserializer:function(e){if(e)return u.EntityAddr.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.EntityAddr)],e.prototype,"entityAddr",void 0),t=n([a.jsonObject,o("design:paramtypes",[u.AccountHash,u.PublicKey,u.EntityAddr])],e)}();t.EntityIdentifier=g;var v=function(){function e(e,t){this.entityIdentifier=e,this.blockIdentifier=t}return n([(0,a.jsonMember)({constructor:g,name:"entity_identifier"}),o("design:type",g)],e.prototype,"entityIdentifier",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:l,name:"block_identifier"}),o("design:type",l)],e.prototype,"blockIdentifier",void 0),n([a.jsonObject,o("design:paramtypes",[g,l])],e)}();t.ParamGetStateEntity=v;var w=function(){function e(e,t){this.accountHash=e,this.publicKey=t}return n([(0,a.jsonMember)({constructor:u.AccountHash,isRequired:!1,deserializer:function(e){if(e)return u.AccountHash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.AccountHash)],e.prototype,"accountHash",void 0),n([(0,a.jsonMember)({constructor:u.PublicKey,isRequired:!1,deserializer:function(e){if(e)return u.PublicKey.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.PublicKey)],e.prototype,"publicKey",void 0),n([a.jsonObject,o("design:paramtypes",[u.AccountHash,u.PublicKey])],e)}();t.AccountIdentifier=w;var S=function(){function e(e){this.deploy=e}return n([(0,a.jsonMember)({constructor:u.Deploy}),o("design:type",u.Deploy)],e.prototype,"deploy",void 0),n([a.jsonObject,o("design:paramtypes",[u.Deploy])],e)}();t.PutDeployRequest=S;var M=function(){function e(e){this.transaction=e}return n([(0,a.jsonMember)({constructor:u.TransactionWrapper,serializer:function(e){return u.TransactionWrapper.toJSON(e)}}),o("design:type",u.TransactionWrapper)],e.prototype,"transaction",void 0),n([a.jsonObject,o("design:paramtypes",[u.TransactionWrapper])],e)}();t.PutTransactionRequest=M;var _=function(){function e(e,t,r){this.blockHash=e,this.blockHeight=t,this.stateRoot=r}return n([(0,a.jsonMember)({isRequired:!1,constructor:String,name:"BlockHash"}),o("design:type",String)],e.prototype,"blockHash",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:Number,name:"BlockHeight"}),o("design:type",Number)],e.prototype,"blockHeight",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:String,name:"StateRootHash"}),o("design:type",String)],e.prototype,"stateRoot",void 0),n([a.jsonObject,o("design:paramtypes",[String,Number,String])],e)}();t.GlobalStateIdentifier=_;var A=function(){function e(e,t){this.block=e,this.era=t}return n([(0,a.jsonMember)({isRequired:!1,constructor:l,name:"Block"}),o("design:type",l)],e.prototype,"block",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:Number,name:"Era"}),o("design:type",Number)],e.prototype,"era",void 0),n([a.jsonObject,o("design:paramtypes",[l,Number])],e)}();t.EraIdentifier=A;var E=function(){function e(e,t){this.dictionaryItemKey=e,this.seedUref=t}return n([(0,a.jsonMember)({constructor:String,name:"dictionary_item_key"}),o("design:type",String)],e.prototype,"dictionaryItemKey",void 0),n([(0,a.jsonMember)({constructor:String,name:"seed_uref"}),o("design:type",String)],e.prototype,"seedUref",void 0),n([a.jsonObject,o("design:paramtypes",[String,String])],e)}();t.ParamDictionaryIdentifierURef=E;var O=function(){function e(e,t,r){this.key=e,this.dictionaryName=t,this.dictionaryItemKey=r}return n([(0,a.jsonMember)({constructor:String}),o("design:type",String)],e.prototype,"key",void 0),n([(0,a.jsonMember)({constructor:String,name:"dictionary_name"}),o("design:type",String)],e.prototype,"dictionaryName",void 0),n([(0,a.jsonMember)({constructor:String,name:"dictionary_item_key"}),o("design:type",String)],e.prototype,"dictionaryItemKey",void 0),n([a.jsonObject,o("design:paramtypes",[String,String,String])],e)}();t.AccountNamedKey=O;var j=function(){function e(e,t,r){this.key=e,this.dictionaryName=t,this.dictionaryItemKey=r}return n([(0,a.jsonMember)({constructor:String}),o("design:type",String)],e.prototype,"key",void 0),n([(0,a.jsonMember)({constructor:String,name:"dictionary_name"}),o("design:type",String)],e.prototype,"dictionaryName",void 0),n([(0,a.jsonMember)({constructor:String,name:"dictionary_item_key"}),o("design:type",String)],e.prototype,"dictionaryItemKey",void 0),n([a.jsonObject,o("design:paramtypes",[String,String,String])],e)}();t.ParamDictionaryIdentifierContractNamedKey=j;var T=function(){function e(e,t,r,n){this.accountNamedKey=e,this.contractNamedKey=t,this.uRef=r,this.dictionary=n}return n([(0,a.jsonMember)({isRequired:!1,constructor:O,name:"AccountNamedKey"}),o("design:type",O)],e.prototype,"accountNamedKey",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:j,name:"ContractNamedKey"}),o("design:type",j)],e.prototype,"contractNamedKey",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:E,name:"URef"}),o("design:type",E)],e.prototype,"uRef",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:String,name:"Dictionary"}),o("design:type",String)],e.prototype,"dictionary",void 0),n([a.jsonObject,o("design:paramtypes",[O,j,E,String])],e)}();t.ParamDictionaryIdentifier=T;var N=function(){function e(e,t){this.deploy=e,this.blockIdentifier=t}return n([(0,a.jsonMember)({constructor:u.Deploy}),o("design:type",u.Deploy)],e.prototype,"deploy",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:l,name:"block_identifier"}),o("design:type",l)],e.prototype,"blockIdentifier",void 0),n([a.jsonObject,o("design:paramtypes",[u.Deploy,l])],e)}();t.SpeculativeExecParams=N;var P=function(){function e(e,t,r,n){this.mainPurseUnderPublicKey=e,this.mainPurseUnderAccountHash=t,this.mainPurseUnderEntityAddr=r,this.purseUref=n}var t;return t=e,e.fromPublicKey=function(e){return new t(e)},e.fromAccountHash=function(e){return new t(void 0,e)},e.fromEntityAddr=function(e){return new t(void 0,void 0,e)},e.fromUref=function(e){return new t(void 0,void 0,void 0,e)},n([(0,a.jsonMember)({constructor:u.PublicKey,name:"main_purse_under_public_key",isRequired:!1,deserializer:function(e){if(e)return u.PublicKey.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.PublicKey)],e.prototype,"mainPurseUnderPublicKey",void 0),n([(0,a.jsonMember)({constructor:u.AccountHash,name:"main_purse_under_account_hash",isRequired:!1,deserializer:function(e){if(e)return u.AccountHash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.AccountHash)],e.prototype,"mainPurseUnderAccountHash",void 0),n([(0,a.jsonMember)({constructor:u.EntityAddr,name:"main_purse_under_entity_addr",isRequired:!1,deserializer:function(e){if(e)return u.EntityAddr.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.EntityAddr)],e.prototype,"mainPurseUnderEntityAddr",void 0),n([(0,a.jsonMember)({constructor:u.URef,isRequired:!1,name:"purse_uref",deserializer:function(e){if(e)return u.URef.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.URef)],e.prototype,"purseUref",void 0),t=n([a.jsonObject,o("design:paramtypes",[u.PublicKey,u.AccountHash,u.EntityAddr,u.URef])],e)}();t.PurseIdentifier=P;var B=function(){function e(e,t){this.purseIdentifier=e,this.stateIdentifier=t}return n([(0,a.jsonMember)({constructor:P,name:"purse_identifier"}),o("design:type",P)],e.prototype,"purseIdentifier",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:_,name:"state_identifier"}),o("design:type",_)],e.prototype,"stateIdentifier",void 0),n([a.jsonObject,o("design:paramtypes",[P,_])],e)}();t.QueryBalanceRequest=B;var R=function(){function e(e,t){this.purseIdentifier=e,this.stateIdentifier=t}return n([(0,a.jsonMember)({constructor:P,name:"purse_identifier"}),o("design:type",P)],e.prototype,"purseIdentifier",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:_,name:"state_identifier"}),o("design:type",_)],e.prototype,"stateIdentifier",void 0),n([a.jsonObject,o("design:paramtypes",[P,_])],e)}();t.QueryBalanceDetailsRequest=R;var C=function(){function e(e,t,r){this.validator=e,this.delegator=t,this.eraIdentifier=r}return n([(0,a.jsonMember)({constructor:u.PublicKey,isRequired:!1,deserializer:function(e){return u.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",u.PublicKey)],e.prototype,"validator",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:u.PublicKey,deserializer:function(e){if(e)return u.PublicKey.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.PublicKey)],e.prototype,"delegator",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:A,name:"era_identifier"}),o("design:type",A)],e.prototype,"eraIdentifier",void 0),n([a.jsonObject,o("design:paramtypes",[u.PublicKey,u.PublicKey,A])],e)}();t.InfoGetRewardRequest=C;var x=function(){function e(e,t){this.stateRootHash=e,this.purseURef=t}return n([(0,a.jsonMember)({name:"state_root_hash",constructor:String}),o("design:type",String)],e.prototype,"stateRootHash",void 0),n([(0,a.jsonMember)({name:"purse_uref",constructor:String}),o("design:type",String)],e.prototype,"purseURef",void 0),n([a.jsonObject,o("design:paramtypes",[String,String])],e)}();t.StateGetBalanceRequest=x;var I=function(){function e(e,t){this.stateRootHash=e,this.dictionaryIdentifier=t}return n([(0,a.jsonMember)({name:"state_root_hash",constructor:String}),o("design:type",String)],e.prototype,"stateRootHash",void 0),n([(0,a.jsonMember)({name:"dictionary_identifier",constructor:T}),o("design:type",T)],e.prototype,"dictionaryIdentifier",void 0),n([a.jsonObject,o("design:paramtypes",[String,T])],e)}();t.StateGetDictionaryRequest=I},1412:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.QueryGlobalStateResultV1Compatible=t.InfoGetChainspecResult=t.BalanceHoldWithProof=t.InfoGetRewardResult=t.QueryBalanceDetailsResult=t.QueryBalanceResult=t.SpeculativeExecResult=t.PutTransactionResult=t.PutDeployResult=t.InfoGetStatusResult=t.BlockSynchronizerStatus=t.BlockSyncStatus=t.NodeNextUpgrade=t.InfoGetValidatorChangesResult=t.ValidatorChanges=t.StatusChanges=t.ValidatorState=t.ChainGetStateRootHashResult=t.NodePeer=t.InfoGetPeerResult=t.QueryGlobalStateResult=t.StateGetDictionaryResult=t.StateGetItemResult=t.ChainGetEraInfoResult=t.InfoGetTransactionResultV1Compatible=t.InfoGetDeployResultV1Compatible=t.InfoGetTransactionResult=t.InfoGetDeployResult=t.ChainGetEraSummaryResult=t.ChainGetBlockTransfersResult=t.ChainGetBlockResult=t.ChainGetBlockResultV1Compatible=t.StateGetEntityResult=t.EntityOrAccount=t.RpcAddressableEntity=t.StateGetAccountInfo=t.StateGetBalanceResult=t.StateGetAuctionInfoV2Result=t.StateGetAuctionInfoV1Result=t.StateGetAuctionInfoResult=t.RpcResponse=void 0;var i=r(9592),a=r(8608),s=r(7021),u=r(7545),c=function(){function e(){}return n([(0,i.jsonMember)({name:"jsonrpc",constructor:String}),o("design:type",String)],e.prototype,"version",void 0),n([(0,i.jsonMember)({constructor:a.IDValue,name:"id",deserializer:function(e){if(e)return a.IDValue.fromJSON(e)}}),o("design:type",a.IDValue)],e.prototype,"id",void 0),n([(0,i.jsonMember)({name:"result",constructor:i.AnyT}),o("design:type",Object)],e.prototype,"result",void 0),n([(0,i.jsonMember)({name:"error",constructor:s.RpcError,preserveNull:!0}),o("design:type",s.RpcError)],e.prototype,"error",void 0),n([i.jsonObject],e)}();t.RpcResponse=c;var f=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"version",void 0),n([(0,i.jsonMember)({name:"auction_state",constructor:u.AuctionState}),o("design:type",u.AuctionState)],e.prototype,"auctionState",void 0),n([i.jsonObject],e)}();t.StateGetAuctionInfoResult=f;var l=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"version",void 0),n([(0,i.jsonMember)({name:"auction_state",constructor:u.AuctionStateV1}),o("design:type",u.AuctionStateV1)],e.prototype,"auctionState",void 0),n([i.jsonObject],e)}();t.StateGetAuctionInfoV1Result=l;var d=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"version",void 0),n([(0,i.jsonMember)({name:"auction_state",constructor:u.AuctionStateV2}),o("design:type",u.AuctionStateV2)],e.prototype,"auctionState",void 0),n([i.jsonObject],e)}();t.StateGetAuctionInfoV2Result=d;var h=function(){function e(){}return e.prototype.toQueryBalanceResult=function(){var e=new K;return e.apiVersion=this.apiVersion,e.balance=this.balanceValue,e},n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"balance_value",constructor:u.CLValueUInt512,deserializer:function(e){return u.CLValueUInt512.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",u.CLValueUInt512)],e.prototype,"balanceValue",void 0),n([i.jsonObject],e)}();t.StateGetBalanceResult=h;var p=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"account",constructor:u.Account}),o("design:type",u.Account)],e.prototype,"account",void 0),n([i.jsonObject],e)}();t.StateGetAccountInfo=p;var y=function(){function e(){}return n([(0,i.jsonMember)({name:"entity",constructor:u.AddressableEntity}),o("design:type",u.AddressableEntity)],e.prototype,"entity",void 0),n([(0,i.jsonArrayMember)(u.NamedKey,{name:"named_keys"}),o("design:type",Array)],e.prototype,"namedKeys",void 0),n([(0,i.jsonArrayMember)(u.EntryPointValue,{name:"entry_points"}),o("design:type",Array)],e.prototype,"entryPoints",void 0),n([i.jsonObject],e)}();t.RpcAddressableEntity=y;var m=function(){function e(){}return n([(0,i.jsonMember)({name:"AddressableEntity",constructor:y}),o("design:type",y)],e.prototype,"addressableEntity",void 0),n([(0,i.jsonMember)({name:"LegacyAccount",constructor:u.Account}),o("design:type",u.Account)],e.prototype,"legacyAccount",void 0),n([i.jsonObject],e)}();t.EntityOrAccount=m;var b=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"entity",constructor:m}),o("design:type",m)],e.prototype,"entity",void 0),n([(0,i.jsonMember)({name:"merkle_proof",constructor:i.AnyT}),o("design:type",Object)],e.prototype,"merkleProof",void 0),n([i.jsonObject],e)}();t.StateGetEntityResult=b;var g=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"block_with_signatures",constructor:u.BlockWithSignatures}),o("design:type",u.BlockWithSignatures)],e.prototype,"blockWithSignatures",void 0),n([(0,i.jsonMember)({name:"block",constructor:u.BlockV1}),o("design:type",u.BlockV1)],e.prototype,"blockV1",void 0),n([i.jsonObject],e)}();t.ChainGetBlockResultV1Compatible=g;var v=function(){function e(){}var t;return t=e,e.fromJSON=function(e){var r=new i.TypedJSON(t).parse(e);if(!r)throw new Error("Failed to parse ChainGetBlockResult");return r.rawJSON=e,r},e.newChainGetBlockResultFromV1Compatible=function(e,r){var n=new t;if(n.apiVersion=e.apiVersion,n.rawJSON=r,e.blockV1)n.block=u.Block.newBlockFromBlockV1(e.blockV1);else{if(!e.blockWithSignatures)throw new Error("Incorrect RPC response structure");n.block=u.Block.newBlockFromBlockWrapper(e.blockWithSignatures.block,e.blockWithSignatures.proofs)}return n},n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({constructor:u.Block}),o("design:type",u.Block)],e.prototype,"block",void 0),t=n([i.jsonObject],e)}();t.ChainGetBlockResult=v;var w=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"version",void 0),n([(0,i.jsonMember)({name:"block_hash",constructor:String}),o("design:type",String)],e.prototype,"blockHash",void 0),n([(0,i.jsonArrayMember)(u.Transfer,{name:"transfers",deserializer:function(e){return e.map(function(e){return u.Transfer.fromJSON(e)})}}),o("design:type",Array)],e.prototype,"transfers",void 0),n([i.jsonObject],e)}();t.ChainGetBlockTransfersResult=w;var S=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"version",void 0),n([(0,i.jsonMember)({name:"era_summary",constructor:u.EraSummary}),o("design:type",u.EraSummary)],e.prototype,"eraSummary",void 0),n([i.jsonObject],e)}();t.ChainGetEraSummaryResult=S;var M=function(){function e(){}return e.prototype.toInfoGetTransactionResult=function(){var e,t=void 0;return this.executionInfo?t=new u.ExecutionInfo(this.executionInfo.blockHash,this.executionInfo.blockHeight,this.executionInfo.executionResult):(null===(e=null==this?void 0:this.executionResultsV1)||void 0===e?void 0:e.length)&&(t=u.ExecutionInfo.fromV1(this.executionResultsV1)),new _(this.apiVersion,u.Deploy.newTransactionFromDeploy(this.deploy),t,this.rawJSON)},n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"deploy",constructor:u.Deploy}),o("design:type",u.Deploy)],e.prototype,"deploy",void 0),n([(0,i.jsonMember)({name:"execution_info",constructor:u.DeployExecutionInfo}),o("design:type",u.DeployExecutionInfo)],e.prototype,"executionInfo",void 0),n([(0,i.jsonArrayMember)(u.DeployExecutionResult,{name:"execution_results",preserveNull:!0}),o("design:type",Array)],e.prototype,"executionResultsV1",void 0),n([i.jsonObject],e)}();t.InfoGetDeployResult=M;var _=function(){function e(e,t,r,n){void 0===n&&(n=""),this.apiVersion=e,this.transaction=t,this.executionInfo=r,this.rawJSON=n}var t;return t=e,e.fromJSON=function(e){var r,n=new i.TypedJSON(E).parse(e);return n?E.newInfoGetTransactionResultFromV1Compatible(n,e):null!==(r=new i.TypedJSON(t).parse(e))&&void 0!==r?r:null},n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({constructor:u.Transaction,deserializer:function(e){if(e)return u.Transaction.fromJSON(e)}}),o("design:type",u.Transaction)],e.prototype,"transaction",void 0),n([(0,i.jsonMember)({name:"execution_info",constructor:u.ExecutionInfo,preserveNull:!0}),o("design:type",u.ExecutionInfo)],e.prototype,"executionInfo",void 0),t=n([i.jsonObject,o("design:paramtypes",[String,u.Transaction,u.ExecutionInfo,Object])],e)}();t.InfoGetTransactionResult=_;var A=function(){function e(){}var t;return t=e,e.fromJSON=function(e){return new i.TypedJSON(t).parse(e)},n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({constructor:u.Deploy}),o("design:type",u.Deploy)],e.prototype,"deploy",void 0),n([(0,i.jsonArrayMember)(u.DeployExecutionResult,{name:"execution_results"}),o("design:type",Array)],e.prototype,"executionResults",void 0),n([(0,i.jsonMember)({name:"block_hash",constructor:u.Hash,deserializer:function(e){if(e)return u.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.Hash)],e.prototype,"blockHash",void 0),n([(0,i.jsonMember)({name:"block_height",constructor:Number}),o("design:type",Number)],e.prototype,"blockHeight",void 0),t=n([i.jsonObject],e)}();t.InfoGetDeployResultV1Compatible=A;var E=function(){function e(){this.executionResults=[]}var t;return t=e,e.newInfoGetTransactionResultFromV1Compatible=function(e,t){if(e.transaction){if(e.transaction.transactionV1)return new _(e.apiVersion,u.Transaction.fromTransactionV1(e.transaction.transactionV1),e.executionInfo,t);if(e.transaction.deploy){var r=u.Deploy.newTransactionFromDeploy(e.transaction.deploy),n=new _(e.apiVersion,r,e.executionInfo,t);return e.executionResults.length>0&&((o=u.ExecutionInfo.fromV1(e.executionResults,e.blockHeight)).executionResult.initiator=new u.InitiatorAddr(e.deploy.header.account),n.executionInfo=o),n}}var o;if(e.deploy)return r=u.Deploy.newTransactionFromDeploy(e.deploy),n=new _(e.apiVersion,r,e.executionInfo,t),e.executionResults.length>0&&((o=u.ExecutionInfo.fromV1(e.executionResults,e.blockHeight)).executionResult.initiator=new u.InitiatorAddr(e.deploy.header.account),n.executionInfo=o),n;throw new Error("Incorrect RPC response structure")},e.fromJSON=function(e){return new i.TypedJSON(t).parse(e)},n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({constructor:u.TransactionWrapper}),o("design:type",u.TransactionWrapper)],e.prototype,"transaction",void 0),n([(0,i.jsonMember)({constructor:u.Deploy}),o("design:type",u.Deploy)],e.prototype,"deploy",void 0),n([(0,i.jsonMember)({constructor:u.ExecutionInfo,name:"execution_info"}),o("design:type",u.ExecutionInfo)],e.prototype,"executionInfo",void 0),n([(0,i.jsonArrayMember)(u.DeployExecutionResult,{name:"execution_results"}),o("design:type",Array)],e.prototype,"executionResults",void 0),n([(0,i.jsonMember)({constructor:u.Hash,name:"block_hash",deserializer:function(e){if(e)return u.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.Hash)],e.prototype,"blockHash",void 0),n([(0,i.jsonMember)({constructor:Number,name:"block_height"}),o("design:type",Number)],e.prototype,"blockHeight",void 0),t=n([i.jsonObject],e)}();t.InfoGetTransactionResultV1Compatible=E;var O=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"version",void 0),n([(0,i.jsonMember)({name:"era_summary",constructor:u.EraSummary}),o("design:type",u.EraSummary)],e.prototype,"eraSummary",void 0),n([i.jsonObject],e)}();t.ChainGetEraInfoResult=O;var j=function(){function e(){}return n([(0,i.jsonMember)({name:"stored_value",constructor:u.StoredValue}),o("design:type",u.StoredValue)],e.prototype,"storedValue",void 0),n([(0,i.jsonMember)({name:"merkle_proof",constructor:String}),o("design:type",String)],e.prototype,"merkleProof",void 0),n([i.jsonObject],e)}();t.StateGetItemResult=j;var T=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"dictionary_key",constructor:String}),o("design:type",String)],e.prototype,"dictionaryKey",void 0),n([(0,i.jsonMember)({name:"stored_value",constructor:u.StoredValue}),o("design:type",u.StoredValue)],e.prototype,"storedValue",void 0),n([(0,i.jsonMember)({name:"merkle_proof",constructor:String}),o("design:type",String)],e.prototype,"merkleProof",void 0),n([i.jsonObject],e)}();t.StateGetDictionaryResult=T;var N=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"block_header",constructor:u.BlockHeader}),o("design:type",u.BlockHeader)],e.prototype,"blockHeader",void 0),n([(0,i.jsonMember)({name:"stored_value",constructor:u.StoredValue}),o("design:type",u.StoredValue)],e.prototype,"storedValue",void 0),n([(0,i.jsonMember)({name:"merkle_proof",constructor:String}),o("design:type",String)],e.prototype,"merkleProof",void 0),n([i.jsonObject],e)}();t.QueryGlobalStateResult=N;var P=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonArrayMember)(function(){return B},{name:"peers"}),o("design:type",Array)],e.prototype,"peers",void 0),n([i.jsonObject],e)}();t.InfoGetPeerResult=P;var B=function(){function e(){}return n([(0,i.jsonMember)({name:"node_id",constructor:String}),o("design:type",String)],e.prototype,"nodeId",void 0),n([(0,i.jsonMember)({name:"address",constructor:String}),o("design:type",String)],e.prototype,"address",void 0),n([i.jsonObject],e)}();t.NodePeer=B;var R,C=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"version",void 0),n([(0,i.jsonMember)({name:"state_root_hash",constructor:u.Hash,deserializer:function(e){if(e)return u.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.Hash)],e.prototype,"stateRootHash",void 0),n([i.jsonObject],e)}();t.ChainGetStateRootHashResult=C,(R=t.ValidatorState||(t.ValidatorState={})).Added="Added",R.Removed="Removed",R.Banned="Banned",R.CannotPropose="CannotPropose",R.SeenAsFaulty="SeenAsFaulty";var x=function(){function e(){}return n([(0,i.jsonMember)({name:"era_id",constructor:Number}),o("design:type",Number)],e.prototype,"eraID",void 0),n([(0,i.jsonMember)({name:"validator_change",constructor:String}),o("design:type",String)],e.prototype,"validatorState",void 0),n([i.jsonObject],e)}();t.StatusChanges=x;var I=function(){function e(){}return n([(0,i.jsonMember)({name:"public_key",constructor:u.PublicKey,deserializer:function(e){if(e)return u.PublicKey.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.PublicKey)],e.prototype,"publicKey",void 0),n([(0,i.jsonArrayMember)(x,{name:"status_changes"}),o("design:type",Array)],e.prototype,"statusChanges",void 0),n([i.jsonObject],e)}();t.ValidatorChanges=I;var k=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonArrayMember)(I,{name:"changes"}),o("design:type",Array)],e.prototype,"changes",void 0),n([i.jsonObject],e)}();t.InfoGetValidatorChangesResult=k;var H=function(){function e(){}return n([(0,i.jsonMember)({name:"activation_point",constructor:Number}),o("design:type",Number)],e.prototype,"activationPoint",void 0),n([(0,i.jsonMember)({name:"protocol_version",constructor:String}),o("design:type",String)],e.prototype,"protocolVersion",void 0),n([i.jsonObject],e)}();t.NodeNextUpgrade=H;var U=function(){function e(){}return n([(0,i.jsonMember)({name:"block_hash",constructor:u.Hash,deserializer:function(e){if(e)return u.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()},preserveNull:!0}),o("design:type",u.Hash)],e.prototype,"blockHash",void 0),n([(0,i.jsonMember)({name:"block_height",constructor:Number,preserveNull:!0}),o("design:type",Number)],e.prototype,"blockHeight",void 0),n([(0,i.jsonMember)({name:"acquisition_state",constructor:String}),o("design:type",String)],e.prototype,"acquisitionState",void 0),n([i.jsonObject],e)}();t.BlockSyncStatus=U;var L=function(){function e(){}return n([(0,i.jsonMember)({name:"historical",constructor:U}),o("design:type",U)],e.prototype,"historical",void 0),n([(0,i.jsonMember)({name:"forward",constructor:U}),o("design:type",U)],e.prototype,"forward",void 0),n([i.jsonObject],e)}();t.BlockSynchronizerStatus=L;var D=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"protocol_version",constructor:String}),o("design:type",String)],e.prototype,"protocolVersion",void 0),n([(0,i.jsonMember)({name:"build_version",constructor:String}),o("design:type",String)],e.prototype,"buildVersion",void 0),n([(0,i.jsonMember)({name:"chainspec_name",constructor:String}),o("design:type",String)],e.prototype,"chainSpecName",void 0),n([(0,i.jsonMember)({name:"last_added_block_info",constructor:u.MinimalBlockInfo}),o("design:type",u.MinimalBlockInfo)],e.prototype,"lastAddedBlockInfo",void 0),n([(0,i.jsonMember)({name:"next_upgrade",constructor:H}),o("design:type",H)],e.prototype,"nextUpgrade",void 0),n([(0,i.jsonMember)({name:"our_public_signing_key",constructor:String}),o("design:type",String)],e.prototype,"ourPublicSigningKey",void 0),n([(0,i.jsonArrayMember)(B,{name:"peers"}),o("design:type",Array)],e.prototype,"peers",void 0),n([(0,i.jsonMember)({name:"round_length",constructor:String}),o("design:type",String)],e.prototype,"roundLength",void 0),n([(0,i.jsonMember)({name:"starting_state_root_hash",constructor:String}),o("design:type",String)],e.prototype,"startingStateRootHash",void 0),n([(0,i.jsonMember)({name:"uptime",constructor:String}),o("design:type",String)],e.prototype,"uptime",void 0),n([(0,i.jsonMember)({name:"reactor_state",constructor:String}),o("design:type",String)],e.prototype,"reactorState",void 0),n([(0,i.jsonMember)({name:"last_progress",constructor:u.Timestamp,deserializer:function(e){if(e)return u.Timestamp.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.Timestamp)],e.prototype,"lastProgress",void 0),n([(0,i.jsonMember)({name:"latest_switch_block_hash",constructor:u.Hash,deserializer:function(e){if(e)return u.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.Hash)],e.prototype,"latestSwitchBlockHash",void 0),n([(0,i.jsonMember)({name:"available_block_range",constructor:function(){return{low:(0,i.jsonMember)({name:"low",constructor:Number}),high:(0,i.jsonMember)({name:"high",constructor:Number})}}}),o("design:type",Object)],e.prototype,"availableBlockRange",void 0),n([(0,i.jsonMember)({name:"block_sync",constructor:L}),o("design:type",L)],e.prototype,"blockSync",void 0),n([i.jsonObject],e)}();t.InfoGetStatusResult=D;var V=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"deploy_hash",constructor:u.Hash,deserializer:function(e){if(e)return u.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.Hash)],e.prototype,"deployHash",void 0),n([i.jsonObject],e)}();t.PutDeployResult=V;var z=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"transaction_hash",constructor:u.TransactionHash}),o("design:type",u.TransactionHash)],e.prototype,"transactionHash",void 0),n([i.jsonObject],e)}();t.PutTransactionResult=z;var J=function(){function e(){}var t;return t=e,Object.defineProperty(e.prototype,"isV1",{get:function(){return!!this.executionResultV1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isV2",{get:function(){return!!this.executionResult},enumerable:!1,configurable:!0}),e.fromJSON=function(e){var r,n=new t;n.apiVersion=null==e?void 0:e.version;var o=null===(r=null==e?void 0:e.result)||void 0===r?void 0:r.execution_result;return n.rawJSON=e,n.blockHash=(null==o?void 0:o.block_hash)?u.Hash.fromHex(o.block_hash):void 0,o&&(o.block_hash||void 0!==o.limit||void 0!==o.consumed)?n.executionResult=new i.TypedJSON(u.SpeculativeExecutionResult).parse(o):o&&("Success"in o||"Failure"in o)?n.executionResultV1=new i.TypedJSON(u.ExecutionResultV1).parse(o):console.warn("Unknown execution_result format:",o),n},n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"block_hash",constructor:u.Hash,deserializer:function(e){if(e)return u.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.Hash)],e.prototype,"blockHash",void 0),t=n([i.jsonObject],e)}();t.SpeculativeExecResult=J;var K=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"balance",constructor:u.CLValueUInt512,deserializer:function(e){if(e)return u.CLValueUInt512.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.CLValueUInt512)],e.prototype,"balance",void 0),n([i.jsonObject],e)}();t.QueryBalanceResult=K;var F=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"total_balance",constructor:u.CLValueUInt512,deserializer:function(e){if(e)return u.CLValueUInt512.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.CLValueUInt512)],e.prototype,"totalBalance",void 0),n([(0,i.jsonMember)({name:"available_balance",constructor:u.CLValueUInt512,deserializer:function(e){if(e)return u.CLValueUInt512.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.CLValueUInt512)],e.prototype,"availableBalance",void 0),n([(0,i.jsonMember)({name:"total_balance_proof",constructor:String}),o("design:type",String)],e.prototype,"totalBalanceProof",void 0),n([(0,i.jsonArrayMember)(function(){return W},{name:"holds"}),o("design:type",Array)],e.prototype,"holds",void 0),n([i.jsonObject],e)}();t.QueryBalanceDetailsResult=F;var q=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"delegation_rate",constructor:Number}),o("design:type",Number)],e.prototype,"delegationRate",void 0),n([(0,i.jsonMember)({name:"era_id",constructor:Number}),o("design:type",Number)],e.prototype,"eraID",void 0),n([(0,i.jsonMember)({name:"reward_amount",constructor:u.CLValueUInt512,deserializer:function(e){if(e)return u.CLValueUInt512.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.CLValueUInt512)],e.prototype,"rewardAmount",void 0),n([(0,i.jsonMember)({name:"switch_block_hash",constructor:u.Hash,deserializer:function(e){if(e)return u.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.Hash)],e.prototype,"switchBlockHash",void 0),n([i.jsonObject],e)}();t.InfoGetRewardResult=q;var W=function(){function e(){}return n([(0,i.jsonMember)({name:"amount",constructor:u.CLValueUInt512,deserializer:function(e){if(e)return u.CLValueUInt512.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.CLValueUInt512)],e.prototype,"amount",void 0),n([(0,i.jsonMember)({name:"proof",constructor:String}),o("design:type",String)],e.prototype,"proof",void 0),n([i.jsonObject],e)}();t.BalanceHoldWithProof=W;var G=function(){function e(){}return n([(0,i.jsonMember)({name:"chainspec_bytes",constructor:String}),o("design:type",String)],e.prototype,"chainspecBytes",void 0),n([(0,i.jsonMember)({name:"maybe_genesis_accounts_bytes",constructor:String}),o("design:type",String)],e.prototype,"maybeGenesisAccountsBytes",void 0),n([(0,i.jsonMember)({name:"maybe_global_state_bytes",constructor:String}),o("design:type",String)],e.prototype,"maybeGlobalStateBytes",void 0),n([i.jsonObject],e)}(),Z=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"chainspec_bytes",constructor:G}),o("design:type",G)],e.prototype,"chainspecBytes",void 0),n([i.jsonObject],e)}();t.InfoGetChainspecResult=Z;var $=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"block_header",constructor:u.BlockHeaderV1}),o("design:type",u.BlockHeaderV1)],e.prototype,"blockHeader",void 0),n([(0,i.jsonMember)({name:"stored_value",constructor:u.StoredValue}),o("design:type",u.StoredValue)],e.prototype,"storedValue",void 0),n([(0,i.jsonMember)({name:"merkle_proof",constructor:String}),o("design:type",String)],e.prototype,"merkleProof",void 0),n([i.jsonObject],e)}();t.QueryGlobalStateResultV1Compatible=$},4176:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}u((n=n.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.RpcClient=void 0;var i=r(9592),a=r(1412),s=r(5409),u=r(8608),c=r(7545),f=r(7021),l=r(8389),d=function(){function e(e){this.handler=e}return e.prototype.getDeploy=function(e){return n(this,void 0,void 0,function(){var t,r,n,u;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.ParamDeployHash),r=new s.ParamDeployHash(e),[4,this.processRequest(s.Method.GetDeploy,t.toPlainJson(r))];case 1:return n=o.sent(),(u=this.parseResponse(a.InfoGetDeployResult,n.result)).rawJSON=n.result,[2,u]}})})},e.prototype.getDeployFinalizedApproval=function(e){return n(this,void 0,void 0,function(){var t,r,n,u;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.ParamDeployHash),r=new s.ParamDeployHash(e,!0),[4,this.processRequest(s.Method.GetDeploy,t.toPlainJson(r))];case 1:return n=o.sent(),(u=this.parseResponse(a.InfoGetDeployResult,n.result)).rawJSON=n.result,[2,u]}})})},e.prototype.getTransactionByTransactionHash=function(e){return n(this,void 0,void 0,function(){var t,r,n,u,f,l;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.ParamTransactionHash),r=c.Hash.fromHex(e),n=new s.ParamTransactionHash(c.TransactionHash.fromTransactionHash(r)),[4,this.processRequest(s.Method.GetTransaction,t.toPlainJson(n))];case 1:return u=o.sent(),(f=this.parseResponse(a.InfoGetTransactionResultV1Compatible,u.result)).rawJSON=u.result,(l=a.InfoGetTransactionResultV1Compatible.newInfoGetTransactionResultFromV1Compatible(f,f.rawJSON)).rawJSON=u.result,[2,l]}})})},e.prototype.getTransactionByDeployHash=function(e){return n(this,void 0,void 0,function(){var t,r,n,u,f,l;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.ParamTransactionHash),r=c.Hash.fromHex(e),n=new s.ParamTransactionHash(c.TransactionHash.fromDeployHash(r)),[4,this.processRequest(s.Method.GetTransaction,t.toPlainJson(n))];case 1:return u=o.sent(),(f=this.parseResponse(a.InfoGetTransactionResultV1Compatible,u.result)).rawJSON=u.result,(l=a.InfoGetTransactionResultV1Compatible.newInfoGetTransactionResultFromV1Compatible(f,f.rawJSON)).rawJSON=u.result,[2,l]}})})},e.prototype.getTransactionFinalizedApprovalByTransactionHash=function(e){return n(this,void 0,void 0,function(){var t,r,n,u,f,l;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.ParamTransactionHash),r=c.Hash.fromHex(e),n=new s.ParamTransactionHash(c.TransactionHash.fromTransactionHash(r),!0),[4,this.processRequest(s.Method.GetTransaction,t.toPlainJson(n))];case 1:return u=o.sent(),(f=this.parseResponse(a.InfoGetTransactionResultV1Compatible,u.result)).rawJSON=u.result,(l=a.InfoGetTransactionResultV1Compatible.newInfoGetTransactionResultFromV1Compatible(f,f.rawJSON)).rawJSON=u.result,[2,l]}})})},e.prototype.getTransactionFinalizedApprovalByDeployHash=function(e){return n(this,void 0,void 0,function(){var t,r,n,u,f,l;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.ParamTransactionHash),r=c.Hash.fromHex(e),n=new s.ParamTransactionHash(c.TransactionHash.fromDeployHash(r),!0),[4,this.processRequest(s.Method.GetTransaction,t.toPlainJson(n))];case 1:return u=o.sent(),(f=this.parseResponse(a.InfoGetTransactionResultV1Compatible,u.result)).rawJSON=u.result,(l=a.InfoGetTransactionResultV1Compatible.newInfoGetTransactionResultFromV1Compatible(f,f.rawJSON)).rawJSON=u.result,[2,l]}})})},e.prototype.getStateItem=function(e,t,r){return n(this,void 0,void 0,function(){var n,u,c,f,l,d;return o(this,function(o){switch(o.label){case 0:return(n=e)?[3,2]:[4,this.getStateRootHashLatest()];case 1:u=o.sent(),n=u.stateRootHash.toHex(),o.label=2;case 2:return c=new i.TypedJSON(s.ParamStateRootHash),f=new s.ParamStateRootHash(n,t,r),[4,this.processRequest(s.Method.GetStateItem,c.toPlainJson(f))];case 3:return l=o.sent(),(d=this.parseResponse(a.StateGetItemResult,l.result)).rawJSON=l.result,[2,d]}})})},e.prototype.queryLatestGlobalState=function(e,t){return n(this,void 0,void 0,function(){var r,n,u,c;return o(this,function(o){switch(o.label){case 0:return r=new i.TypedJSON(s.ParamQueryGlobalState),n=s.ParamQueryGlobalState.newQueryGlobalStateParam(e,t),[4,this.processRequest(s.Method.QueryGlobalState,r.toPlainJson(n))];case 1:return u=o.sent(),(c=this.parseResponse(a.QueryGlobalStateResult,u.result)).rawJSON=u.result,[2,c]}})})},e.prototype.queryGlobalStateByBlockHash=function(e,t,r){return n(this,void 0,void 0,function(){var n,u,c,f;return o(this,function(o){switch(o.label){case 0:return n=new i.TypedJSON(s.ParamQueryGlobalState),u=s.ParamQueryGlobalState.newQueryGlobalStateParam(t,r,{blockHash:e}),[4,this.processRequest(s.Method.QueryGlobalState,n.toPlainJson(u))];case 1:return c=o.sent(),(f=this.parseResponse(a.QueryGlobalStateResult,c.result)).rawJSON=c.result,[2,f]}})})},e.prototype.queryGlobalStateByBlockHeight=function(e,t,r){return n(this,void 0,void 0,function(){var n,u,c,f;return o(this,function(o){switch(o.label){case 0:return n=new i.TypedJSON(s.ParamQueryGlobalState),u=s.ParamQueryGlobalState.newQueryGlobalStateParam(t,r,{blockHeight:e}),[4,this.processRequest(s.Method.QueryGlobalState,n.toPlainJson(u))];case 1:return c=o.sent(),(f=this.parseResponse(a.QueryGlobalStateResult,c.result)).rawJSON=c.result,[2,f]}})})},e.prototype.queryGlobalStateByStateHash=function(e,t,r){return n(this,void 0,void 0,function(){var n,u,c,f,l;return o(this,function(o){switch(o.label){case 0:return n=new i.TypedJSON(s.ParamQueryGlobalState),e?[3,2]:(c=s.ParamQueryGlobalState.newQueryGlobalStateParam(t,r),[4,this.processRequest(s.Method.QueryGlobalState,n.toPlainJson(c))]);case 1:return u=o.sent(),[3,4];case 2:return f=s.ParamQueryGlobalState.newQueryGlobalStateParam(t,r,{stateRootHash:e}),[4,this.processRequest(s.Method.QueryGlobalState,n.toPlainJson(f))];case 3:u=o.sent(),o.label=4;case 4:return(l=this.parseResponse(a.QueryGlobalStateResult,u.result)).rawJSON=u.result,[2,l]}})})},e.prototype.getLatestEntity=function(e){return n(this,void 0,void 0,function(){var t,r,n,u;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.ParamGetStateEntity),r=new s.ParamGetStateEntity(e),[4,this.processRequest(s.Method.GetStateEntity,t.toPlainJson(r))];case 1:return n=o.sent(),(u=this.parseResponse(a.StateGetEntityResult,n.result)).rawJSON=n.result,[2,u]}})})},e.prototype.getEntityByBlockHash=function(e,t){return n(this,void 0,void 0,function(){var r,n,u,c;return o(this,function(o){switch(o.label){case 0:return r=new i.TypedJSON(s.ParamGetStateEntity),n=new s.ParamGetStateEntity(e,new s.BlockIdentifier(t)),[4,this.processRequest(s.Method.GetStateEntity,r.toPlainJson(n))];case 1:return u=o.sent(),(c=this.parseResponse(a.StateGetEntityResult,u.result)).rawJSON=u.result,[2,c]}})})},e.prototype.getEntityByBlockHeight=function(e,t){return n(this,void 0,void 0,function(){var r,n,u,c;return o(this,function(o){switch(o.label){case 0:return r=new i.TypedJSON(s.ParamGetStateEntity),n=new s.ParamGetStateEntity(e,new s.BlockIdentifier(void 0,t)),[4,this.processRequest(s.Method.GetStateEntity,r.toPlainJson(n))];case 1:return u=o.sent(),(c=this.parseResponse(a.StateGetEntityResult,u.result)).rawJSON=u.result,[2,c]}})})},e.prototype.getAccountInfoByBlockHash=function(e,t){return n(this,void 0,void 0,function(){var r,n,i;return o(this,function(o){switch(o.label){case 0:return r=new s.ParamGetAccountInfoBalance(t.toHex(),s.ParamBlockIdentifier.byHash(e)),[4,this.processRequest(s.Method.GetStateAccount,r.toJSON())];case 1:return n=o.sent(),(i=this.parseResponse(a.StateGetAccountInfo,n.result)).rawJSON=n.result,[2,i]}})})},e.prototype.getAccountInfoByBlockHeight=function(e,t){return n(this,void 0,void 0,function(){var r,n,i;return o(this,function(o){switch(o.label){case 0:return r=new s.ParamGetAccountInfoBalance(t.toHex(),s.ParamBlockIdentifier.byHeight(e)),[4,this.processRequest(s.Method.GetStateAccount,r.toJSON())];case 1:return n=o.sent(),(i=this.parseResponse(a.StateGetAccountInfo,n.result)).rawJSON=n.result,[2,i]}})})},e.prototype.getAccountInfo=function(e,t){return n(this,void 0,void 0,function(){var r,n,i,u,c;return o(this,function(o){switch(o.label){case 0:if((r=e)||(r=new s.ParamBlockIdentifier),t.accountHash)n=t.accountHash.toPrefixedString();else{if(!t.publicKey)throw new Error("account identifier is empty");n=t.publicKey.toHex()}return i=new s.ParamGetAccountInfoBalance(n,r),[4,this.processRequest(s.Method.GetStateAccount,i.toJSON())];case 1:return u=o.sent(),(c=this.parseResponse(a.StateGetAccountInfo,u.result)).rawJSON=u.result,[2,c]}})})},e.prototype.getDictionaryItem=function(e,t,r){return n(this,void 0,void 0,function(){return o(this,function(n){return[2,this.getDictionaryItemByIdentifier(e,new s.ParamDictionaryIdentifier(void 0,void 0,new s.ParamDictionaryIdentifierURef(r,t)))]})})},e.prototype.getDictionaryItemByIdentifier=function(e,t){return n(this,void 0,void 0,function(){var r,n,u,c,f,l;return o(this,function(o){switch(o.label){case 0:return r=new i.TypedJSON(s.StateGetDictionaryRequest),(n=e)?[3,2]:[4,this.getStateRootHashLatest()];case 1:u=o.sent(),n=u.stateRootHash.toHex(),o.label=2;case 2:return c=new s.StateGetDictionaryRequest(n,t),[4,this.processRequest(s.Method.GetDictionaryItem,r.toPlainJson(c))];case 3:return f=o.sent(),(l=this.parseResponse(a.StateGetDictionaryResult,f.result)).rawJSON=f.result,[2,l]}})})},e.prototype.getLatestBalance=function(e){return n(this,void 0,void 0,function(){var t,r,n,u,c;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.StateGetBalanceRequest),[4,this.getStateRootHashLatest()];case 1:return r=o.sent(),n=new s.StateGetBalanceRequest(r.stateRootHash.toHex(),e),[4,this.processRequest(s.Method.GetStateBalance,t.toPlainJson(n))];case 2:return u=o.sent(),(c=this.parseResponse(a.StateGetBalanceResult,u.result)).rawJSON=u.result,[2,c]}})})},e.prototype.getBalanceByStateRootHash=function(e,t){return n(this,void 0,void 0,function(){var r,n,u,c;return o(this,function(o){switch(o.label){case 0:return r=new i.TypedJSON(s.StateGetBalanceRequest),n=new s.StateGetBalanceRequest(t,e),[4,this.processRequest(s.Method.GetStateBalance,r.toPlainJson(n))];case 1:return u=o.sent(),(c=this.parseResponse(a.StateGetBalanceResult,u.result)).rawJSON=u.result,[2,c]}})})},e.prototype.getEraInfoLatest=function(){return n(this,void 0,void 0,function(){var e,t;return o(this,function(r){switch(r.label){case 0:return[4,this.processRequest(s.Method.GetEraInfo,null)];case 1:return e=r.sent(),(t=this.parseResponse(a.ChainGetEraInfoResult,e.result)).rawJSON=e.result,[2,t]}})})},e.prototype.getEraInfoByBlockHeight=function(e){return n(this,void 0,void 0,function(){var t,r,n,u;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.ParamBlockIdentifier),r=s.ParamBlockIdentifier.byHeight(e),[4,this.processRequest(s.Method.GetEraInfo,t.toPlainJson(r))];case 1:return n=o.sent(),(u=this.parseResponse(a.ChainGetEraInfoResult,n.result)).rawJSON=n.result,[2,u]}})})},e.prototype.getEraInfoByBlockHash=function(e){return n(this,void 0,void 0,function(){var t,r,n,u;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.ParamBlockIdentifier),r=s.ParamBlockIdentifier.byHash(e),[4,this.processRequest(s.Method.GetEraInfo,t.toPlainJson(r))];case 1:return n=o.sent(),(u=this.parseResponse(a.ChainGetEraInfoResult,n.result)).rawJSON=n.result,[2,u]}})})},e.prototype.getLatestBlock=function(){return n(this,void 0,void 0,function(){var e,t,r;return o(this,function(n){switch(n.label){case 0:return[4,this.processRequest(s.Method.GetBlock,null)];case 1:return e=n.sent(),(t=this.parseResponse(a.ChainGetBlockResultV1Compatible,e.result)).rawJSON=e.result,(r=a.ChainGetBlockResult.newChainGetBlockResultFromV1Compatible(t,t.rawJSON)).rawJSON=t.rawJSON,[2,r]}})})},e.prototype.getBlockByHash=function(e){return n(this,void 0,void 0,function(){var t,r,n,u,c;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.ParamBlockIdentifier),r=s.ParamBlockIdentifier.byHash(e),[4,this.processRequest(s.Method.GetBlock,t.toPlainJson(r))];case 1:return n=o.sent(),(u=this.parseResponse(a.ChainGetBlockResultV1Compatible,n.result)).rawJSON=n.result,(c=a.ChainGetBlockResult.newChainGetBlockResultFromV1Compatible(u,u.rawJSON)).rawJSON=n.result,[2,c]}})})},e.prototype.getBlockByHeight=function(e){return n(this,void 0,void 0,function(){var t,r,n,u,c;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.ParamBlockIdentifier),r=s.ParamBlockIdentifier.byHeight(e),[4,this.processRequest(s.Method.GetBlock,t.toPlainJson(r))];case 1:return n=o.sent(),(u=this.parseResponse(a.ChainGetBlockResultV1Compatible,n.result)).rawJSON=n.result,(c=a.ChainGetBlockResult.newChainGetBlockResultFromV1Compatible(u,u.rawJSON)).rawJSON=n.result,[2,c]}})})},e.prototype.getLatestBlockTransfers=function(){return n(this,void 0,void 0,function(){var e,t;return o(this,function(r){switch(r.label){case 0:return[4,this.processRequest(s.Method.GetBlockTransfers,null)];case 1:return e=r.sent(),(t=this.parseResponse(a.ChainGetBlockTransfersResult,e.result)).rawJSON=e.result,[2,t]}})})},e.prototype.getBlockTransfersByHash=function(e){return n(this,void 0,void 0,function(){var t,r,n,u;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.ParamBlockIdentifier),r=s.ParamBlockIdentifier.byHash(e),[4,this.processRequest(s.Method.GetBlockTransfers,t.toPlainJson(r))];case 1:return n=o.sent(),(u=this.parseResponse(a.ChainGetBlockTransfersResult,n.result)).rawJSON=n.result,[2,u]}})})},e.prototype.getBlockTransfersByHeight=function(e){return n(this,void 0,void 0,function(){var t,r,n,u;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.ParamBlockIdentifier),r=s.ParamBlockIdentifier.byHeight(e),[4,this.processRequest(s.Method.GetBlockTransfers,t.toPlainJson(r))];case 1:return n=o.sent(),(u=this.parseResponse(a.ChainGetBlockTransfersResult,n.result)).rawJSON=n.result,[2,u]}})})},e.prototype.getEraSummaryLatest=function(){return n(this,void 0,void 0,function(){var e,t;return o(this,function(r){switch(r.label){case 0:return[4,this.processRequest(s.Method.GetEraSummary,null)];case 1:return e=r.sent(),(t=this.parseResponse(a.ChainGetEraSummaryResult,e.result)).rawJSON=e.result,[2,t]}})})},e.prototype.getEraSummaryByHash=function(e){return n(this,void 0,void 0,function(){var t,r,n,u;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.ParamBlockIdentifier),r=s.ParamBlockIdentifier.byHash(e),[4,this.processRequest(s.Method.GetEraSummary,t.toPlainJson(r))];case 1:return n=o.sent(),(u=this.parseResponse(a.ChainGetEraSummaryResult,n.result)).rawJSON=n.result,[2,u]}})})},e.prototype.getEraSummaryByHeight=function(e){return n(this,void 0,void 0,function(){var t,r,n,u;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.ParamBlockIdentifier),r=s.ParamBlockIdentifier.byHeight(e),[4,this.processRequest(s.Method.GetEraSummary,t.toPlainJson(r))];case 1:return n=o.sent(),(u=this.parseResponse(a.ChainGetEraSummaryResult,n.result)).rawJSON=n.result,[2,u]}})})},e.prototype.getLatestAuctionInfo=function(){return n(this,void 0,void 0,function(){var e,t,r,n;return o(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,4]),[4,this.getLatestAuctionInfoV2()];case 1:return e=o.sent(),(n=new a.StateGetAuctionInfoResult).auctionState=c.AuctionState.fromV2(e.auctionState),n.version=e.version,n.rawJSON=e.rawJSON,[2,n];case 2:if(!((null==(t=o.sent())?void 0:t.message)||"").includes("Method not found"))throw t;return[4,this.getLatestAuctionInfoV1()];case 3:return r=o.sent(),(n=new a.StateGetAuctionInfoResult).auctionState=c.AuctionState.fromV1(r.auctionState),n.version=r.version,n.rawJSON=r.rawJSON,[2,n];case 4:return[2]}})})},e.prototype.getLatestAuctionInfoV1=function(){return n(this,void 0,void 0,function(){var e,t;return o(this,function(r){switch(r.label){case 0:return[4,this.processRequest(s.Method.GetAuctionInfo,null)];case 1:return e=r.sent(),(t=this.parseResponse(a.StateGetAuctionInfoV1Result,e.result)).rawJSON=e.result,[2,t]}})})},e.prototype.getLatestAuctionInfoV2=function(){return n(this,void 0,void 0,function(){var e,t;return o(this,function(r){switch(r.label){case 0:return[4,this.processRequest(s.Method.GetAuctionInfoV2,null)];case 1:return e=r.sent(),(t=this.parseResponse(a.StateGetAuctionInfoV2Result,e.result)).rawJSON=e.result,[2,t]}})})},e.prototype.getAuctionInfoByHash=function(e){return n(this,void 0,void 0,function(){var t,r,n,i;return o(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,4]),[4,this.getAuctionInfoV2ByHash(e)];case 1:return t=o.sent(),(i=new a.StateGetAuctionInfoResult).auctionState=c.AuctionState.fromV2(t.auctionState),i.version=t.version,i.rawJSON=t.rawJSON,[2,i];case 2:if(!((null==(r=o.sent())?void 0:r.message)||"").includes("Method not found"))throw r;return[4,this.getAuctionInfoV1ByHash(e)];case 3:return n=o.sent(),(i=new a.StateGetAuctionInfoResult).auctionState=c.AuctionState.fromV1(n.auctionState),i.version=n.version,i.rawJSON=n.rawJSON,[2,i];case 4:return[2]}})})},e.prototype.getAuctionInfoV1ByHash=function(e){return n(this,void 0,void 0,function(){var t,r,n,u;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.ParamBlockIdentifier),r=s.ParamBlockIdentifier.byHash(e),[4,this.processRequest(s.Method.GetAuctionInfo,t.toPlainJson(r))];case 1:return n=o.sent(),(u=this.parseResponse(a.StateGetAuctionInfoV1Result,n.result)).rawJSON=n.result,[2,u]}})})},e.prototype.getAuctionInfoV2ByHash=function(e){return n(this,void 0,void 0,function(){var t,r,n,u;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.ParamBlockIdentifier),r=s.ParamBlockIdentifier.byHash(e),[4,this.processRequest(s.Method.GetAuctionInfoV2,t.toPlainJson(r))];case 1:return n=o.sent(),(u=this.parseResponse(a.StateGetAuctionInfoV2Result,n.result)).rawJSON=n.result,[2,u]}})})},e.prototype.getAuctionInfoByHeight=function(e){return n(this,void 0,void 0,function(){var t,r,n,i;return o(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,4]),[4,this.getAuctionInfoV2ByHeight(e)];case 1:return t=o.sent(),(i=new a.StateGetAuctionInfoResult).auctionState=c.AuctionState.fromV2(t.auctionState),i.version=t.version,i.rawJSON=t.rawJSON,[2,i];case 2:if(!((null==(r=o.sent())?void 0:r.message)||"").includes("Method not found"))throw r;return[4,this.getAuctionInfoV1ByHeight(e)];case 3:return n=o.sent(),(i=new a.StateGetAuctionInfoResult).auctionState=c.AuctionState.fromV1(n.auctionState),i.version=n.version,i.rawJSON=n.rawJSON,[2,i];case 4:return[2]}})})},e.prototype.getAuctionInfoV1ByHeight=function(e){return n(this,void 0,void 0,function(){var t,r,n,u;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.ParamBlockIdentifier),r=s.ParamBlockIdentifier.byHeight(e),[4,this.processRequest(s.Method.GetAuctionInfo,t.toPlainJson(r))];case 1:return n=o.sent(),(u=this.parseResponse(a.StateGetAuctionInfoV1Result,n.result)).rawJSON=n.result,[2,u]}})})},e.prototype.getAuctionInfoV2ByHeight=function(e){return n(this,void 0,void 0,function(){var t,r,n,u;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.ParamBlockIdentifier),r=s.ParamBlockIdentifier.byHeight(e),[4,this.processRequest(s.Method.GetAuctionInfoV2,t.toPlainJson(r))];case 1:return n=o.sent(),(u=this.parseResponse(a.StateGetAuctionInfoV2Result,n.result)).rawJSON=n.result,[2,u]}})})},e.prototype.getStateRootHashLatest=function(){return n(this,void 0,void 0,function(){var e,t;return o(this,function(r){switch(r.label){case 0:return[4,this.processRequest(s.Method.GetStateRootHash,null)];case 1:return e=r.sent(),(t=this.parseResponse(a.ChainGetStateRootHashResult,e.result)).rawJSON=e.result,[2,t]}})})},e.prototype.getStateRootHashByHash=function(e){return n(this,void 0,void 0,function(){var t,r,n,u;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.ParamBlockIdentifier),r=s.ParamBlockIdentifier.byHash(e),[4,this.processRequest(s.Method.GetStateRootHash,t.toPlainJson(r))];case 1:return n=o.sent(),(u=this.parseResponse(a.ChainGetStateRootHashResult,n.result)).rawJSON=n.result,[2,u]}})})},e.prototype.getStateRootHashByHeight=function(e){return n(this,void 0,void 0,function(){var t,r,n,u;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.ParamBlockIdentifier),r=s.ParamBlockIdentifier.byHeight(e),[4,this.processRequest(s.Method.GetStateRootHash,t.toPlainJson(r))];case 1:return n=o.sent(),(u=this.parseResponse(a.ChainGetStateRootHashResult,n.result)).rawJSON=n.result,[2,u]}})})},e.prototype.getValidatorChangesInfo=function(){return n(this,void 0,void 0,function(){var e,t;return o(this,function(r){switch(r.label){case 0:return[4,this.processRequest(s.Method.GetValidatorChanges,null)];case 1:return e=r.sent(),(t=this.parseResponse(a.InfoGetValidatorChangesResult,e.result)).rawJSON=e.result,[2,t]}})})},e.prototype.getStatus=function(){return n(this,void 0,void 0,function(){var e,t;return o(this,function(r){switch(r.label){case 0:return[4,this.processRequest(s.Method.GetStatus,null)];case 1:return e=r.sent(),(t=this.parseResponse(a.InfoGetStatusResult,e.result)).rawJSON=e.result,[2,t]}})})},e.prototype.getPeers=function(){return n(this,void 0,void 0,function(){var e,t;return o(this,function(r){switch(r.label){case 0:return[4,this.processRequest(s.Method.GetPeers,null)];case 1:return e=r.sent(),(t=this.parseResponse(a.InfoGetPeerResult,e.result)).rawJSON=e.result,[2,t]}})})},e.prototype.putDeploy=function(e){return n(this,void 0,void 0,function(){var t,r,n,u;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.PutDeployRequest),r=new s.PutDeployRequest(e),[4,this.processRequest(s.Method.PutDeploy,t.toPlainJson(r))];case 1:return n=o.sent(),(u=this.parseResponse(a.PutDeployResult,n.result)).rawJSON=n.result,[2,u]}})})},e.prototype.putTransaction=function(e){return n(this,void 0,void 0,function(){var t,r,n,u;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.PutTransactionRequest),r=new s.PutTransactionRequest(e.getTransactionWrapper()),[4,this.processRequest(s.Method.PutTransaction,t.toPlainJson(r))];case 1:return n=o.sent(),(u=this.parseResponse(a.PutTransactionResult,n.result)).rawJSON=n.result,[2,u]}})})},e.prototype.queryLatestBalance=function(e){return n(this,void 0,void 0,function(){var t,r,n,u;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.QueryBalanceRequest),r=new s.QueryBalanceRequest(e),[4,this.processRequest(s.Method.QueryBalance,t.toPlainJson(r))];case 1:return n=o.sent(),(u=this.parseResponse(a.QueryBalanceResult,n.result)).rawJSON=n.result,[2,u]}})})},e.prototype.queryBalanceByBlockHeight=function(e,t){return n(this,void 0,void 0,function(){var r,n,u,c;return o(this,function(o){switch(o.label){case 0:return r=new i.TypedJSON(s.QueryBalanceRequest),n=new s.QueryBalanceRequest(e,new s.GlobalStateIdentifier(void 0,t)),[4,this.processRequest(s.Method.QueryBalance,r.toPlainJson(n))];case 1:return u=o.sent(),(c=this.parseResponse(a.QueryBalanceResult,u.result)).rawJSON=u.result,[2,c]}})})},e.prototype.queryBalanceByBlockHash=function(e,t){return n(this,void 0,void 0,function(){var r,n,u,c;return o(this,function(o){switch(o.label){case 0:return r=new i.TypedJSON(s.QueryBalanceRequest),n=new s.QueryBalanceRequest(e,new s.GlobalStateIdentifier(t)),[4,this.processRequest(s.Method.QueryBalance,r.toPlainJson(n))];case 1:return u=o.sent(),(c=this.parseResponse(a.QueryBalanceResult,u.result)).rawJSON=u.result,[2,c]}})})},e.prototype.queryBalanceByStateRootHash=function(e,t){return n(this,void 0,void 0,function(){var r,n,u,c;return o(this,function(o){switch(o.label){case 0:return r=new i.TypedJSON(s.QueryBalanceRequest),n=new s.QueryBalanceRequest(e,new s.GlobalStateIdentifier(void 0,void 0,t)),[4,this.processRequest(s.Method.QueryBalance,r.toPlainJson(n))];case 1:return u=o.sent(),(c=this.parseResponse(a.QueryBalanceResult,u.result)).rawJSON=u.result,[2,c]}})})},e.prototype.queryLatestBalanceDetails=function(e){return n(this,void 0,void 0,function(){var t,r,n,u;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.QueryBalanceDetailsRequest),r=new s.QueryBalanceDetailsRequest(e),[4,this.processRequest(s.Method.QueryBalanceDetails,t.toPlainJson(r))];case 1:return n=o.sent(),(u=this.parseResponse(a.QueryBalanceDetailsResult,n.result)).rawJSON=n.result,[2,u]}})})},e.prototype.queryBalanceDetailsByStateRootHash=function(e,t){return n(this,void 0,void 0,function(){var r,n,u,c;return o(this,function(o){switch(o.label){case 0:return r=new i.TypedJSON(s.QueryBalanceDetailsRequest),n=new s.QueryBalanceDetailsRequest(e,new s.GlobalStateIdentifier(void 0,void 0,t)),[4,this.processRequest(s.Method.QueryBalanceDetails,r.toPlainJson(n))];case 1:return u=o.sent(),(c=this.parseResponse(a.QueryBalanceDetailsResult,u.result)).rawJSON=u.result,[2,c]}})})},e.prototype.queryBalanceDetailsByBlockHeight=function(e,t){return n(this,void 0,void 0,function(){var r,n,u,c;return o(this,function(o){switch(o.label){case 0:return r=new i.TypedJSON(s.QueryBalanceDetailsRequest),n=new s.QueryBalanceDetailsRequest(e,new s.GlobalStateIdentifier(void 0,t)),[4,this.processRequest(s.Method.QueryBalanceDetails,r.toPlainJson(n))];case 1:return u=o.sent(),(c=this.parseResponse(a.QueryBalanceDetailsResult,u.result)).rawJSON=u.result,[2,c]}})})},e.prototype.queryBalanceDetailsByBlockHash=function(e,t){return n(this,void 0,void 0,function(){var r,n,u,c;return o(this,function(o){switch(o.label){case 0:return r=new i.TypedJSON(s.QueryBalanceDetailsRequest),n=new s.QueryBalanceDetailsRequest(e,new s.GlobalStateIdentifier(t)),[4,this.processRequest(s.Method.QueryBalanceDetails,r.toPlainJson(n))];case 1:return u=o.sent(),(c=this.parseResponse(a.QueryBalanceDetailsResult,u.result)).rawJSON=u.result,[2,c]}})})},e.prototype.getChainspec=function(){return n(this,void 0,void 0,function(){var e,t;return o(this,function(r){switch(r.label){case 0:return[4,this.processRequest(s.Method.InfoGetChainspec,null)];case 1:return e=r.sent(),(t=this.parseResponse(a.InfoGetChainspecResult,e.result)).rawJSON=e.result,[2,t]}})})},e.prototype.getValidatorRewardByEraID=function(e,t){return n(this,void 0,void 0,function(){var r,n,u,c;return o(this,function(o){switch(o.label){case 0:return r=new i.TypedJSON(s.InfoGetRewardRequest),n=new s.InfoGetRewardRequest(e,void 0,new s.EraIdentifier(void 0,t)),[4,this.processRequest(s.Method.GetReward,r.toPlainJson(n))];case 1:return u=o.sent(),(c=this.parseResponse(a.InfoGetRewardResult,u.result)).rawJSON=u.result,[2,c]}})})},e.prototype.getValidatorRewardByBlockHash=function(e,t){return n(this,void 0,void 0,function(){var r,n,u,c;return o(this,function(o){switch(o.label){case 0:return r=new i.TypedJSON(s.InfoGetRewardRequest),n=new s.InfoGetRewardRequest(e,void 0,new s.EraIdentifier(new s.BlockIdentifier(t))),[4,this.processRequest(s.Method.GetReward,r.toPlainJson(n))];case 1:return u=o.sent(),(c=this.parseResponse(a.InfoGetRewardResult,u.result)).rawJSON=u.result,[2,c]}})})},e.prototype.getValidatorRewardByBlockHeight=function(e,t){return n(this,void 0,void 0,function(){var r,n,u,c;return o(this,function(o){switch(o.label){case 0:return r=new i.TypedJSON(s.InfoGetRewardRequest),n=new s.InfoGetRewardRequest(e,void 0,new s.EraIdentifier(new s.BlockIdentifier(void 0,t))),[4,this.processRequest(s.Method.GetReward,r.toPlainJson(n))];case 1:return u=o.sent(),(c=this.parseResponse(a.InfoGetRewardResult,u.result)).rawJSON=u.result,[2,c]}})})},e.prototype.getDelegatorRewardByEraID=function(e,t,r){return n(this,void 0,void 0,function(){var n,u,c,f;return o(this,function(o){switch(o.label){case 0:return n=new i.TypedJSON(s.InfoGetRewardRequest),u=new s.InfoGetRewardRequest(e,t,new s.EraIdentifier(void 0,r)),[4,this.processRequest(s.Method.GetReward,n.toPlainJson(u))];case 1:return c=o.sent(),(f=this.parseResponse(a.InfoGetRewardResult,c.result)).rawJSON=c.result,[2,f]}})})},e.prototype.getDelegatorRewardByBlockHash=function(e,t,r){return n(this,void 0,void 0,function(){var n,u,c,f;return o(this,function(o){switch(o.label){case 0:return n=new i.TypedJSON(s.InfoGetRewardRequest),u=new s.InfoGetRewardRequest(e,t,new s.EraIdentifier(new s.BlockIdentifier(r))),[4,this.processRequest(s.Method.GetReward,n.toPlainJson(u))];case 1:return c=o.sent(),(f=this.parseResponse(a.InfoGetRewardResult,c.result)).rawJSON=c.result,[2,f]}})})},e.prototype.getDelegatorRewardByBlockHeight=function(e,t,r){return n(this,void 0,void 0,function(){var n,u,c,f;return o(this,function(o){switch(o.label){case 0:return n=new i.TypedJSON(s.InfoGetRewardRequest),u=new s.InfoGetRewardRequest(e,t,new s.EraIdentifier(new s.BlockIdentifier(void 0,r))),[4,this.processRequest(s.Method.GetReward,n.toPlainJson(u))];case 1:return c=o.sent(),(f=this.parseResponse(a.InfoGetRewardResult,c.result)).rawJSON=c.result,[2,f]}})})},e.prototype.getLatestValidatorReward=function(e){return n(this,void 0,void 0,function(){var t,r,n,u;return o(this,function(o){switch(o.label){case 0:return t=new i.TypedJSON(s.InfoGetRewardRequest),r=new s.InfoGetRewardRequest(e),[4,this.processRequest(s.Method.GetReward,t.toPlainJson(r))];case 1:return n=o.sent(),(u=this.parseResponse(a.InfoGetRewardResult,n.result)).rawJSON=n.result,[2,u]}})})},e.prototype.getLatestDelegatorReward=function(e,t){return n(this,void 0,void 0,function(){var r,n,u,c;return o(this,function(o){switch(o.label){case 0:return r=new i.TypedJSON(s.InfoGetRewardRequest),n=new s.InfoGetRewardRequest(e,t),[4,this.processRequest(s.Method.GetReward,r.toPlainJson(n))];case 1:return u=o.sent(),(c=this.parseResponse(a.InfoGetRewardResult,u.result)).rawJSON=u.result,[2,c]}})})},e.prototype.waitForConfirmation=function(e,t,r,i,a){var s;return void 0===i&&(i=3),void 0===a&&(a=500),n(this,void 0,void 0,function(){var n,u,c,f;return o(this,function(o){switch(o.label){case 0:n=setTimeout(function(){throw new Error("Timeout")},r),u=0,o.label=1;case 1:o.label=2;case 2:return o.trys.push([2,4,,6]),[4,e(t)];case 3:return c=o.sent(),(null===(s=null==c?void 0:c.executionInfo)||void 0===s?void 0:s.executionResult)?(clearTimeout(n),[2,c]):[3,6];case 4:if(f=o.sent(),u>=i)throw clearTimeout(n),new Error("Failed after ".concat(i," retries: ").concat(f.message));return u++,console.warn("Attempt ".concat(u," failed: ").concat(f.message,". Retrying in ").concat(a,"ms...")),[4,(0,l.sleep)(a)];case 5:return o.sent(),[3,1];case 6:return[4,(0,l.sleep)(400)];case 7:return o.sent(),[3,1];case 8:return[2]}})})},e.prototype.waitForTransaction=function(e,t){var r;return void 0===t&&(t=6e3),n(this,void 0,void 0,function(){return o(this,function(n){return[2,this.waitForConfirmation(this.getTransactionByTransactionHash.bind(this),null===(r=null==e?void 0:e.hash)||void 0===r?void 0:r.toHex(),t)]})})},e.prototype.waitForDeploy=function(e,t){var r;return void 0===t&&(t=6e4),n(this,void 0,void 0,function(){return o(this,function(n){return[2,this.waitForConfirmation(this.getDeploy.bind(this),null===(r=null==e?void 0:e.hash)||void 0===r?void 0:r.toHex(),t)]})})},e.prototype.parseResponse=function(e,t){var r=new i.TypedJSON(e).parse(t);if(!r)throw new Error("Error parsing ".concat(e.name," response data"));return r},e.prototype.processRequest=function(e,t,r){return void 0===r&&(r="0"),n(this,void 0,void 0,function(){var n,i;return o(this,function(o){switch(o.label){case 0:return n=s.RpcRequest.defaultRpcRequest(e,t),"0"!==r&&(n.id=u.IDValue.fromString(r)),[4,this.handler.processCall(n)];case 1:if((i=o.sent()).error)throw new f.HttpError(i.error.code,i.error);return[2,i]}})})},e}();t.RpcClient=d},5060:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}u((n=n.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.SpeculativeClient=void 0;var i=r(9592),a=r(5409),s=r(1412),u=r(8608),c=function(){function e(e){this.handler=e}return e.newSpeculativeClient=function(t){return new e(t)},e.prototype.speculativeExec=function(e,t,r){return n(this,void 0,void 0,function(){var n,c,f,l,d,h;return o(this,function(o){switch(o.label){case 0:return n=new i.TypedJSON(a.SpeculativeExecParams),c=new a.SpeculativeExecParams(t,r),f=a.RpcRequest.defaultRpcRequest(a.Method.SpeculativeExec,n.toPlainJson(c)),e&&"0"!==e&&(f.id=new u.IDValue(e)),[4,this.handler.processCall(f)];case 1:if(!(l=o.sent()))throw new Error("Handler response is empty");if(l.error)throw new Error("RPC call failed, details: ".concat(JSON.stringify(l.error)));try{if(d=new i.TypedJSON(s.RpcResponse),!(h=d.parse(l)))throw new Error("Error parsing JSON");return[2,s.SpeculativeExecResult.fromJSON(h)]}catch(e){throw new Error("Error parsing JSON, details: ".concat(e))}return[2]}})})},e}();t.SpeculativeClient=c},7262:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SseClient=void 0;var o=n(r(1731)),i=r(3662),a=r(3307),s=function(){function e(e){this.eventStreamUrl=e,this.subscribedTo=[],this.parser=new a.EventParser}return e.prototype.subscribe=function(e,t){return this.subscribedTo.some(function(t){return t.eventName===e})?(0,i.Err)("Already subscribed to this event"):(this.subscribedTo.push({eventName:e,eventHandlerFn:t}),(0,i.Ok)(!0))},e.prototype.unsubscribe=function(e){return this.subscribedTo.some(function(t){return t.eventName===e})?(this.subscribedTo=this.subscribedTo.filter(function(t){return t.eventName!==e}),(0,i.Ok)(!0)):(0,i.Err)("Cannot find provided subscription")},e.prototype.runEventsLoop=function(e){var t=this;this.subscribedTo.forEach(function(r){if(t.parser.shouldHandleEvent(e.data,r.eventName)){var n=t.parser.parseEvent(e.data,e.type,e.lastEventId);r.eventHandlerFn(n)}})},e.prototype.start=function(e){var t=this,r=this.eventStreamUrl.includes("?")?"&":"?",n="".concat(this.eventStreamUrl).concat(r);void 0!==e&&(n+="start_from=".concat(e)),this.eventSource=new o.default(n),this.eventSource.onmessage=function(e){return t.runEventsLoop(e)},this.eventSource.onerror=function(e){throw e}},e.prototype.stop=function(){this.eventSource&&this.eventSource.close()},e}();t.SseClient=s},4497:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.StepEvent=t.StepPayload=t.FaultEvent=t.FaultPayload=t.FinalitySignatureEvent=t.FinalitySignature=t.FinalitySignatureWrapper=t.FinalitySignatureV2=t.FinalitySignatureV1=t.TransactionProcessedEvent=t.TransactionProcessedPayload=t.TransactionExpiredEvent=t.TransactionExpiredPayload=t.TransactionAcceptedEvent=t.TransactionAcceptedPayload=t.DeployExpiredEvent=t.DeployExpiredPayload=t.DeployAcceptedEvent=t.DeployProcessedEvent=t.DeployProcessedPayload=t.BlockAddedEventWrapper=t.BlockAddedWrapper=t.BlockAddedEventV1=t.BlockAddedV1=t.BlockAddedEvent=t.BlockAdded=t.APIVersionEvent=t.RawEvent=t.EventName=void 0;var i,a=r(9592),s=r(7545);(i=t.EventName||(t.EventName={})).APIVersionEventType="ApiVersion",i.BlockAddedEventType="BlockAdded",i.DeployProcessedEventType="DeployProcessed",i.DeployAcceptedEventType="DeployAccepted",i.DeployExpiredEventType="DeployExpired",i.TransactionProcessedEventType="TransactionProcessed",i.TransactionAcceptedEventType="TransactionAccepted",i.TransactionExpiredEventType="TransactionExpired",i.EventIDEventType="EventID",i.FinalitySignatureType="FinalitySignature",i.StepEventType="Step",i.FaultEventType="Fault",i.ShutdownType="Shutdown";var u=function(){function e(e,t,r){this.eventType=e,this.data=t,this.lastEventId=r}return e.prototype.parseEvent=function(e,t){var r=new a.TypedJSON(e),n=t?t(this.data):r.parse(this.data);if(!n)throw new Error("Error parsing event data");return n},e.prototype.parseAsAPIVersionEvent=function(){return this.parseEvent(c)},e.prototype.parseAsDeployProcessedEvent=function(){return this.parseEvent(b)},e.prototype.parseAsBlockAddedEvent=function(){return this.parseEvent(l,l.fromJSON)},e.prototype.parseAsDeployAcceptedEvent=function(){return this.parseEvent(g)},e.prototype.parseAsFinalitySignatureEvent=function(){return this.parseEvent(B,B.fromJSON)},e.prototype.parseAsTransactionExpiredEvent=function(){return this.parseEvent(A,A.fromJSON)},e.prototype.parseAsTransactionProcessedEvent=function(){return this.parseEvent(O,O.fromJSON)},e.prototype.parseAsTransactionAcceptedEvent=function(){return this.parseEvent(M,M.fromJSON)},e.prototype.parseAsFaultEvent=function(){return this.parseEvent(C)},e.prototype.parseAsStepEvent=function(){return this.parseEvent(I)},n([(0,a.jsonMember)({name:"type",constructor:String}),o("design:type",String)],e.prototype,"eventType",void 0),n([(0,a.jsonMember)({name:"data",constructor:String}),o("design:type",String)],e.prototype,"data",void 0),n([(0,a.jsonMember)({name:"lastEventId",constructor:String}),o("design:type",String)],e.prototype,"lastEventId",void 0),n([a.jsonObject,o("design:paramtypes",[String,String,String])],e)}();t.RawEvent=u;var c=function(){function e(e){this.apiVersion=e}return n([(0,a.jsonMember)(String,{name:"ApiVersion"}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([a.jsonObject,o("design:paramtypes",[String])],e)}();t.APIVersionEvent=c;var f=function(){function e(e,t){this.blockHash=e,this.block=t}return n([(0,a.jsonMember)({name:"block_hash",constructor:String}),o("design:type",String)],e.prototype,"blockHash",void 0),n([(0,a.jsonMember)({name:"block",constructor:s.Block}),o("design:type",s.Block)],e.prototype,"block",void 0),n([a.jsonObject,o("design:paramtypes",[String,s.Block])],e)}();t.BlockAdded=f;var l=function(){function e(e){this.BlockAdded=e}var t;return t=e,e.fromJSON=function(e){if(!e)throw new Error("Parse JSON on null or undefined data");var r=JSON.parse(e);if(r.BlockAdded&&r.BlockAdded.block){var n=new a.TypedJSON(p).parse(r.BlockAdded);if((null==n?void 0:n.block.blockV1)||(null==n?void 0:n.block.blockV2))return new t({blockHash:n.blockHash,block:s.Block.newBlockFromBlockWrapper(n.block,[])})}var o=new a.TypedJSON(d).parse(r.BlockAdded);if(o)return new t({blockHash:o.blockHash,block:s.Block.newBlockFromBlockV1(o.block)});throw new Error("Invalid JSON structure for BlockAddedEvent")},n([(0,a.jsonMember)({name:"BlockAdded",constructor:f}),o("design:type",f)],e.prototype,"BlockAdded",void 0),t=n([a.jsonObject,o("design:paramtypes",[f])],e)}();t.BlockAddedEvent=l;var d=function(){function e(e,t){this.blockHash=e,this.block=t}return n([(0,a.jsonMember)({name:"block_hash",constructor:String}),o("design:type",String)],e.prototype,"blockHash",void 0),n([(0,a.jsonMember)({name:"block",constructor:s.BlockV1}),o("design:type",s.BlockV1)],e.prototype,"block",void 0),n([a.jsonObject,o("design:paramtypes",[String,s.BlockV1])],e)}();t.BlockAddedV1=d;var h=function(){function e(e){this.BlockAdded=e}return n([(0,a.jsonMember)({name:"BlockAdded",constructor:d}),o("design:type",d)],e.prototype,"BlockAdded",void 0),n([a.jsonObject,o("design:paramtypes",[d])],e)}();t.BlockAddedEventV1=h;var p=function(){function e(e,t){this.blockHash=e,this.block=t}return n([(0,a.jsonMember)({name:"block_hash",constructor:String}),o("design:type",String)],e.prototype,"blockHash",void 0),n([(0,a.jsonMember)({name:"block",constructor:s.BlockWrapper}),o("design:type",s.BlockWrapper)],e.prototype,"block",void 0),n([a.jsonObject,o("design:paramtypes",[String,s.BlockWrapper])],e)}();t.BlockAddedWrapper=p;var y=function(){function e(e){this.BlockAdded=e}return n([(0,a.jsonMember)({name:"BlockAdded",constructor:p}),o("design:type",p)],e.prototype,"BlockAdded",void 0),n([a.jsonObject,o("design:paramtypes",[p])],e)}();t.BlockAddedEventWrapper=y;var m=function(){function e(){}return n([(0,a.jsonMember)({name:"deploy_hash",constructor:s.Hash,deserializer:function(e){if(e)return s.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.Hash)],e.prototype,"deployHash",void 0),n([(0,a.jsonMember)({name:"account",constructor:s.PublicKey,deserializer:function(e){if(e)return s.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.PublicKey)],e.prototype,"account",void 0),n([(0,a.jsonMember)({name:"timestamp",constructor:s.Timestamp,deserializer:function(e){if(e)return s.Timestamp.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.Timestamp)],e.prototype,"timestamp",void 0),n([(0,a.jsonMember)({name:"ttl",constructor:String}),o("design:type",String)],e.prototype,"ttl",void 0),n([(0,a.jsonMember)({name:"block_hash",constructor:s.Hash,deserializer:function(e){if(e)return s.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.Hash)],e.prototype,"blockHash",void 0),n([(0,a.jsonMember)({name:"execution_result",constructor:s.ExecutionResultV1}),o("design:type",s.ExecutionResultV1)],e.prototype,"executionResult",void 0),n([a.jsonObject],e)}();t.DeployProcessedPayload=m;var b=function(){function e(){}return n([(0,a.jsonMember)({name:"DeployProcessed",constructor:m}),o("design:type",m)],e.prototype,"deployProcessed",void 0),n([a.jsonObject],e)}();t.DeployProcessedEvent=b;var g=function(){function e(){}return n([(0,a.jsonMember)({name:"DeployAccepted",constructor:s.Deploy}),o("design:type",s.Deploy)],e.prototype,"deployAccepted",void 0),n([a.jsonObject],e)}();t.DeployAcceptedEvent=g;var v=function(){function e(){}return n([(0,a.jsonMember)({name:"deploy_hash",constructor:s.Hash,deserializer:function(e){if(e)return s.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.Hash)],e.prototype,"deployHash",void 0),n([a.jsonObject],e)}();t.DeployExpiredPayload=v;var w=function(){function e(){}return n([(0,a.jsonMember)({constructor:v,name:"DeployExpired"}),o("design:type",v)],e.prototype,"deployExpired",void 0),n([a.jsonObject],e)}();t.DeployExpiredEvent=w;var S=function(){function e(){}return n([(0,a.jsonMember)({name:"transaction",constructor:s.Transaction,deserializer:function(e){if(e)return s.Transaction.fromJSON(e)}}),o("design:type",s.Transaction)],e.prototype,"transaction",void 0),n([a.jsonObject],e)}();t.TransactionAcceptedPayload=S;var M=function(){function e(){}var t;return t=e,e.fromJSON=function(e){if(!e||e.TransactionAccepted)throw new Error("Parse JSON on null or undefined data for TransactionAcceptedEvent");try{var r=JSON.parse(e),n=new t,o=a.TypedJSON.parse(r.TransactionAccepted,s.TransactionWrapper);if(null==o?void 0:o.deploy)return n.transactionAcceptedPayload={transaction:s.Deploy.newTransactionFromDeploy(o.deploy)},n;if(null==o?void 0:o.transactionV1)return n.transactionAcceptedPayload={transaction:s.Transaction.fromTransactionV1(o.transactionV1)},n;var i=a.TypedJSON.parse(r.TransactionAccepted,g);if(null==i?void 0:i.deployAccepted)return n.transactionAcceptedPayload={transaction:s.Deploy.newTransactionFromDeploy(i.deployAccepted)},n;throw new Error("Failed to match any transaction structure")}catch(e){return new Error("Error deserializing TransactionAcceptedEvent: ".concat(e))}},n([(0,a.jsonMember)({constructor:S,name:"TransactionAccepted"}),o("design:type",S)],e.prototype,"transactionAcceptedPayload",void 0),t=n([a.jsonObject],e)}();t.TransactionAcceptedEvent=M;var _=function(){function e(){}return n([(0,a.jsonMember)({name:"transaction_hash",constructor:s.TransactionHash}),o("design:type",s.TransactionHash)],e.prototype,"transactionHash",void 0),n([a.jsonObject],e)}();t.TransactionExpiredPayload=_;var A=function(){function e(){}var t;return t=e,e.fromJSON=function(e){var r,n;if(!e)throw new Error("Parse JSON on null or undefined data for TransactionExpiredEvent");try{var o=JSON.parse(e),i=new t,u=a.TypedJSON.parse(o.TransactionExpired,_);if(!u)throw new Error("transactionExpiredPayload is nil");u&&(i.transactionExpiredPayload=u);var c=null==i?void 0:i.transactionExpiredPayload;if((null===(r=null==c?void 0:c.transactionHash)||void 0===r?void 0:r.transactionV1)||(null===(n=null==c?void 0:c.transactionHash)||void 0===n?void 0:n.deploy))return i;var f=a.TypedJSON.parse(o.TransactionExpired,w);if(null==f?void 0:f.deployExpired)return i.transactionExpiredPayload={transactionHash:s.TransactionHash.fromDeployHash(f.deployExpired.deployHash)},i;throw new Error("Failed to match any transaction structure")}catch(e){return new Error("Error deserializing TransactionExpiredEvent: ".concat(e))}},n([(0,a.jsonMember)({name:"TransactionExpired",constructor:_}),o("design:type",_)],e.prototype,"transactionExpiredPayload",void 0),t=n([a.jsonObject],e)}();t.TransactionExpiredEvent=A;var E=function(){function e(){}return n([(0,a.jsonMember)({name:"block_hash",constructor:s.Hash,deserializer:function(e){if(e)return s.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.Hash)],e.prototype,"blockHash",void 0),n([(0,a.jsonMember)({name:"transaction_hash",constructor:s.TransactionHash}),o("design:type",s.TransactionHash)],e.prototype,"transactionHash",void 0),n([(0,a.jsonMember)({name:"initiator_addr",constructor:s.InitiatorAddr,deserializer:function(e){if(e)return s.InitiatorAddr.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.InitiatorAddr)],e.prototype,"initiatorAddr",void 0),n([(0,a.jsonMember)({name:"timestamp",constructor:s.Timestamp,deserializer:function(e){if(e)return s.Timestamp.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.Timestamp)],e.prototype,"timestamp",void 0),n([(0,a.jsonMember)({name:"ttl",constructor:String}),o("design:type",String)],e.prototype,"ttl",void 0),n([(0,a.jsonMember)({name:"execution_result",constructor:s.ExecutionResult,deserializer:function(e){if(e)return s.ExecutionResult.fromJSON(e)}}),o("design:type",s.ExecutionResult)],e.prototype,"executionResult",void 0),n([(0,a.jsonArrayMember)(s.Message,{name:"messages"}),o("design:type",Array)],e.prototype,"messages",void 0),n([a.jsonObject],e)}();t.TransactionProcessedPayload=E;var O=function(){function e(){}var t;return t=e,e.fromJSON=function(e){var r,n;if(!e||e.TransactionProcessed)throw new Error("Parse JSON on null or undefined data for TransactionExpiredEvent");try{var o=JSON.parse(e),i=new t,u=a.TypedJSON.parse(o.TransactionProcessed,E);u&&(i.transactionProcessedPayload=u);var c=i.transactionProcessedPayload;if((null===(r=c.transactionHash)||void 0===r?void 0:r.transactionV1)||(null===(n=c.transactionHash)||void 0===n?void 0:n.deploy))return i;var f=a.TypedJSON.parse(o.TransactionProcessed,b);if(null==f?void 0:f.deployProcessed)return i.transactionProcessedPayload={blockHash:f.deployProcessed.blockHash,transactionHash:s.TransactionHash.fromDeployHash(f.deployProcessed.deployHash),initiatorAddr:new s.InitiatorAddr(f.deployProcessed.account),timestamp:f.deployProcessed.timestamp,ttl:f.deployProcessed.ttl,executionResult:s.ExecutionResult.fromV1(f.deployProcessed.executionResult),messages:[]},i;throw new Error("Failed to match any transaction structure")}catch(e){return new Error("Error deserializing TransactionProcessedEvent: ".concat(e))}},n([(0,a.jsonMember)({name:"TransactionProcessed",constructor:E}),o("design:type",E)],e.prototype,"transactionProcessedPayload",void 0),t=n([a.jsonObject],e)}();t.TransactionProcessedEvent=O;var j=function(){function e(){}return n([(0,a.jsonMember)({name:"block_hash",constructor:s.Hash,deserializer:function(e){if(e)return s.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.Hash)],e.prototype,"blockHash",void 0),n([(0,a.jsonMember)({name:"era_id",constructor:Number}),o("design:type",Number)],e.prototype,"eraID",void 0),n([(0,a.jsonMember)({name:"signature",constructor:s.HexBytes,deserializer:function(e){if(e)return s.HexBytes.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.HexBytes)],e.prototype,"signature",void 0),n([(0,a.jsonMember)({name:"public_key",constructor:s.PublicKey,deserializer:function(e){if(e)return s.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.PublicKey)],e.prototype,"publicKey",void 0),n([a.jsonObject],e)}();t.FinalitySignatureV1=j;var T=function(){function e(){}return n([(0,a.jsonMember)({name:"block_hash",constructor:s.Hash,deserializer:function(e){if(e)return s.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.Hash)],e.prototype,"blockHash",void 0),n([(0,a.jsonMember)({isRequired:!1,name:"block_height",constructor:Number}),o("design:type",Number)],e.prototype,"blockHeight",void 0),n([(0,a.jsonMember)({isRequired:!1,name:"chain_name_hash",constructor:s.Hash,deserializer:function(e){if(e)return s.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",s.Hash)],e.prototype,"chainNameHash",void 0),n([(0,a.jsonMember)({name:"era_id",constructor:Number}),o("design:type",Number)],e.prototype,"eraID",void 0),n([(0,a.jsonMember)({name:"signature",constructor:s.HexBytes,deserializer:function(e){if(e)return s.HexBytes.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.HexBytes)],e.prototype,"signature",void 0),n([(0,a.jsonMember)({name:"public_key",constructor:s.PublicKey,deserializer:function(e){if(e)return s.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.PublicKey)],e.prototype,"publicKey",void 0),n([a.jsonObject],e)}();t.FinalitySignatureV2=T;var N=function(){function e(){}return n([(0,a.jsonMember)({isRequired:!1,name:"V1",constructor:j}),o("design:type",j)],e.prototype,"v1",void 0),n([(0,a.jsonMember)({isRequired:!1,name:"V2",constructor:T}),o("design:type",T)],e.prototype,"v2",void 0),n([a.jsonObject],e)}();t.FinalitySignatureWrapper=N;var P=function(){function e(){}return n([(0,a.jsonMember)({name:"block_hash",constructor:s.Hash,deserializer:function(e){if(e)return s.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.Hash)],e.prototype,"blockHash",void 0),n([(0,a.jsonMember)({constructor:Number,isRequired:!1,name:"block_height"}),o("design:type",Number)],e.prototype,"blockHeight",void 0),n([(0,a.jsonMember)({isRequired:!1,name:"chain_name_hash",constructor:s.Hash,deserializer:function(e){if(e)return s.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",s.Hash)],e.prototype,"chainNameHash",void 0),n([(0,a.jsonMember)({name:"era_id",constructor:Number}),o("design:type",Number)],e.prototype,"eraID",void 0),n([(0,a.jsonMember)({name:"signature",constructor:s.HexBytes,deserializer:function(e){if(e)return s.HexBytes.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.HexBytes)],e.prototype,"signature",void 0),n([(0,a.jsonMember)({name:"public_key",constructor:s.PublicKey,deserializer:function(e){if(e)return s.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.PublicKey)],e.prototype,"publicKey",void 0),n([(0,a.jsonMember)(j,{isRequired:!1}),o("design:type",j)],e.prototype,"originFinalitySignatureV1",void 0),n([a.jsonObject],e)}();t.FinalitySignature=P;var B=function(){function e(e){this.finalitySignature=e}var t;return t=e,e.fromJSON=function(e){if(!e||e.FinalitySignature)throw new Error("Parse JSON on null or undefined data for FinalitySignatureEvent");try{var r=JSON.parse(e),n=a.TypedJSON.parse(r.FinalitySignature,N);if(!n)throw new Error("FinalitySignatureWrapper is nil");var o=void 0;if(n.v1)o={blockHash:n.v1.blockHash,eraID:n.v1.eraID,signature:n.v1.signature,publicKey:n.v1.publicKey,originFinalitySignatureV1:n.v1};else if(n.v2)o={blockHash:n.v2.blockHash,blockHeight:n.v2.blockHeight,chainNameHash:n.v2.chainNameHash,eraID:n.v2.eraID,signature:n.v2.signature,publicKey:n.v2.publicKey};else{var i=a.TypedJSON.parse(r.FinalitySignature,j);if(!i)throw new Error("Failed to parse FinalitySignatureV1");o={blockHash:i.blockHash,eraID:i.eraID,signature:i.signature,publicKey:i.publicKey,originFinalitySignatureV1:i}}return new t(o)}catch(e){return new Error("Error deserializing FinalitySignatureEvent: ".concat(e))}},n([(0,a.jsonMember)({name:"FinalitySignature",constructor:P}),o("design:type",P)],e.prototype,"finalitySignature",void 0),t=n([a.jsonObject,o("design:paramtypes",[P])],e)}();t.FinalitySignatureEvent=B;var R=function(){function e(){}return n([(0,a.jsonMember)({name:"era_id",constructor:Number}),o("design:type",Number)],e.prototype,"eraID",void 0),n([(0,a.jsonMember)({name:"public_key",constructor:s.PublicKey,deserializer:function(e){if(e)return s.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.PublicKey)],e.prototype,"publicKey",void 0),n([(0,a.jsonMember)({name:"timestamp",constructor:s.Timestamp,deserializer:function(e){if(e)return s.Timestamp.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.Timestamp)],e.prototype,"timestamp",void 0),n([a.jsonObject],e)}();t.FaultPayload=R;var C=function(){function e(){}return n([(0,a.jsonMember)({name:"Fault",constructor:R}),o("design:type",R)],e.prototype,"fault",void 0),n([a.jsonObject],e)}();t.FaultEvent=C;var x=function(){function e(){}return n([(0,a.jsonMember)({name:"era_id",constructor:Number}),o("design:type",Number)],e.prototype,"eraID",void 0),n([(0,a.jsonMember)({name:"execution_effect",constructor:s.Effect}),o("design:type",s.Effect)],e.prototype,"executionEffect",void 0),n([(0,a.jsonArrayMember)(function(){return s.Transform},{name:"execution_effects"}),o("design:type",Array)],e.prototype,"executionEffects",void 0),n([a.jsonObject],e)}();t.StepPayload=x;var I=function(){function e(){}return n([(0,a.jsonMember)({name:"step",constructor:x}),o("design:type",x)],e.prototype,"step",void 0),n([a.jsonObject],e)}();t.StepEvent=I},3307:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EventParser=void 0;var n=r(4497),o=function(){function e(){}return e.prototype.shouldHandleEvent=function(e,t){try{var r=JSON.parse(e);return r&&Object.prototype.hasOwnProperty.call(r,t)}catch(e){return console.error("Error parsing JSON:",e),!1}},e.prototype.parseEvent=function(e,t,r){return new n.RawEvent(t,e,r)},e}();t.EventParser=o},7941:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(7262),t),o(r(4497),t),o(r(3307),t)},602:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Account=t.ActionThresholds=t.AssociatedKey=void 0;var i=r(9592),a=r(3401),s=r(9153),u=function(){function e(){}return n([(0,i.jsonMember)({name:"account_hash",constructor:a.AccountHash,deserializer:function(e){return a.AccountHash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.AccountHash)],e.prototype,"accountHash",void 0),n([(0,i.jsonMember)({name:"weight",constructor:Number}),o("design:type",Number)],e.prototype,"weight",void 0),n([i.jsonObject],e)}();t.AssociatedKey=u;var c=function(){function e(){}return n([(0,i.jsonMember)({name:"deployment",constructor:Number}),o("design:type",Number)],e.prototype,"deployment",void 0),n([(0,i.jsonMember)({name:"key_management",constructor:Number}),o("design:type",Number)],e.prototype,"keyManagement",void 0),n([i.jsonObject],e)}();t.ActionThresholds=c;var f=function(){function e(){}return n([(0,i.jsonMember)({name:"account_hash",deserializer:function(e){return a.AccountHash.fromJSON(e)},serializer:function(e){return e.toJSON()},constructor:a.AccountHash}),o("design:type",a.AccountHash)],e.prototype,"accountHash",void 0),n([(0,i.jsonArrayMember)(s.NamedKey,{name:"named_keys"}),o("design:type",Array)],e.prototype,"namedKeys",void 0),n([(0,i.jsonMember)({name:"main_purse",constructor:a.URef,deserializer:function(e){return a.URef.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.URef)],e.prototype,"mainPurse",void 0),n([(0,i.jsonArrayMember)(u,{name:"associated_keys"}),o("design:type",Array)],e.prototype,"associatedKeys",void 0),n([(0,i.jsonMember)({name:"action_thresholds",constructor:c}),o("design:type",c)],e.prototype,"actionThresholds",void 0),n([i.jsonObject],e)}();t.Account=f},3750:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.NamedEntryPoint=t.AddressableEntity=t.EntityActionThresholds=t.EntityKind=void 0;var i=r(9592),a=r(602),s=r(111),u=r(3401),c=r(7012),f=function(){function e(){}return n([(0,i.jsonMember)({name:"System",constructor:String}),o("design:type",String)],e.prototype,"system",void 0),n([(0,i.jsonMember)({name:"Account",constructor:u.AccountHash,deserializer:function(e){return e?u.AccountHash.fromJSON(e):void 0},serializer:function(e){return e?e.toJSON():void 0}}),o("design:type",u.AccountHash)],e.prototype,"account",void 0),n([(0,i.jsonMember)({name:"SmartContract",constructor:c.TransactionRuntime,deserializer:function(e){if(e)return c.TransactionRuntime.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",c.TransactionRuntime)],e.prototype,"smartContract",void 0),n([i.jsonObject],e)}();t.EntityKind=f;var l=function(){function e(){}return n([(0,i.jsonMember)({name:"deployment",constructor:Number}),o("design:type",Number)],e.prototype,"deployment",void 0),n([(0,i.jsonMember)({name:"upgrade_management",constructor:Number}),o("design:type",Number)],e.prototype,"upgradeManagement",void 0),n([(0,i.jsonMember)({name:"key_management",constructor:Number}),o("design:type",Number)],e.prototype,"keyManagement",void 0),n([i.jsonObject],e)}();t.EntityActionThresholds=l;var d=function(){function e(){}return n([(0,i.jsonMember)({name:"entity_kind",constructor:f}),o("design:type",f)],e.prototype,"entityKind",void 0),n([(0,i.jsonMember)({name:"package_hash",constructor:String}),o("design:type",String)],e.prototype,"packageHash",void 0),n([(0,i.jsonMember)({name:"byte_code_hash",constructor:String}),o("design:type",String)],e.prototype,"byteCodeHash",void 0),n([(0,i.jsonArrayMember)(a.AssociatedKey,{name:"associated_keys"}),o("design:type",Array)],e.prototype,"associatedKeys",void 0),n([(0,i.jsonMember)({name:"action_thresholds",constructor:l}),o("design:type",l)],e.prototype,"actionThresholds",void 0),n([(0,i.jsonMember)({name:"main_purse",constructor:u.URef,deserializer:function(e){return u.URef.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",u.URef)],e.prototype,"mainPurse",void 0),n([(0,i.jsonMember)({name:"protocol_version",constructor:String}),o("design:type",String)],e.prototype,"protocolVersion",void 0),n([i.jsonObject],e)}();t.AddressableEntity=d;var h=function(){function e(){}var t;return t=e,e.fromJSON=function(e){if(!e)throw new Error("Invalid JSON provided for NamedEntryPoint");var r=e.entry_point?e:{entry_point:e},n=new i.TypedJSON(t).parse(r);if(!n)throw new Error("Failed to parse NamedEntryPoint JSON");return n},n([(0,i.jsonMember)({name:"entry_point",constructor:s.EntryPointV1}),o("design:type",s.EntryPointV1)],e.prototype,"entryPoint",void 0),t=n([i.jsonObject],e)}();t.NamedEntryPoint=h},9960:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Args=t.NamedArg=void 0;var i=r(8905),a=r(9592),s=r(5466),u=r(678),c=function(){function e(e,t){this.name=e,this.value=t}return e.prototype.toBytes=function(){var e=(0,u.toBytesString)(this.name),t=s.CLValueParser.toBytesWithType(this.value);return(0,i.concat)([e,t])},e.toBytesWithNamedArg=function(e){var t=new ArrayBuffer(1024),r=new DataView(t),n=0,o=(new TextEncoder).encode(e.name);n+4+o.length>t.byteLength&&(t=(0,u.expandBuffer)(t,n+4+o.length),r=new DataView(t)),n=(0,u.writeInteger)(r,n,o.length),new Uint8Array(t,n).set(o),n+=o.length;var i=s.CLValueParser.toBytesWithType(e.value);return n+i.length>t.byteLength&&(t=(0,u.expandBuffer)(t,n+i.length),r=new DataView(t)),new Uint8Array(t,n).set(i),n+=i.length,new Uint8Array(t,0,n)},e.fromBytes=function(t){var r=0,n=new DataView(t.buffer).getUint32(r,!0);r+=4;var o=t.slice(r,r+n);r+=n;var i=(new TextDecoder).decode(o),a=t.slice(r);return new e(i,s.CLValueParser.fromBytesWithType(a).result)},e}();t.NamedArg=c;var f=function(e){var t=new Map(Array.from(e,function(e){var t=e[0],r=e[1];return[t,s.CLValueParser.fromJSON(r)]}));if(t.size!==Array.from(e).length)throw Error("Duplicate key exists.");return t},l=function(){function e(e){this.args=e}var t;return t=e,e.prototype.getByName=function(e){return this.args.get(e)},e.fromMap=function(e){var r=new Map(Object.keys(e).map(function(t){return[t,e[t]]}));return new t(r)},e.fromNamedArgs=function(e){var t=e.reduce(function(e,t){return e[t.name]=t.value,e},{});return this.fromMap(t)},e.prototype.insert=function(e,t){this.args.set(e,t)},e.prototype.toBytes=function(){var e=Array.from(this.args.entries()).map(function(e){return new c(e[0],e[1])}),t=e.map(function(e){return e.toBytes()});return t.splice(0,0,(0,u.toBytesU32)(e.length)),(0,i.concat)(t)},e.fromBytes=function(e){var r=0,n=new DataView(e.buffer).getUint32(r,!0);r+=4;for(var o=new Map,i=0;i<n;i++){var a=e.slice(r),u=c.fromBytes(a);r+=4+new DataView(a.buffer).getUint32(0,!0)+s.CLValueParser.toBytesWithType(u.value).length,o.set(u.name,u.value)}return new t(o)},n([(0,a.jsonMapMember)(String,s.CLValue,{serializer:function(e){return function(e){return Array.from(e,function(e){var t=e[0],r=e[1];return[t,s.CLValueParser.toJSON(r)]})}(e)},deserializer:f}),o("design:type",Map)],e.prototype,"args",void 0),t=n([a.jsonObject,o("design:paramtypes",[Map])],e)}();t.Args=l},4779:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.AuctionState=t.AuctionStateV2=t.AuctionStateV1=t.BidKindWrapper=t.EraValidators=t.PublicKeyAndBid=void 0;var i=r(9592),a=r(2142),s=r(6459),u=r(9449),c=r(4820),f=r(8389),l=function(){function e(){}return n([(0,i.jsonMember)({name:"public_key",constructor:u.PublicKey,deserializer:function(e){return u.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",u.PublicKey)],e.prototype,"publicKey",void 0),n([(0,i.jsonMember)({name:"bid",constructor:a.Bid}),o("design:type",a.Bid)],e.prototype,"bid",void 0),n([i.jsonObject],e)}();t.PublicKeyAndBid=l;var d=function(){function e(){}return n([(0,i.jsonMember)({name:"era_id",constructor:Number}),o("design:type",Number)],e.prototype,"eraID",void 0),n([(0,i.jsonArrayMember)(s.ValidatorWeightAuction,{name:"validator_weights"}),o("design:type",Array)],e.prototype,"validatorWeights",void 0),n([i.jsonObject],e)}();t.EraValidators=d;var h=function(){function e(e,t){e&&(this.publicKey=e),t&&(this.bid=t)}return n([(0,i.jsonMember)({name:"public_key",constructor:u.PublicKey,deserializer:function(e){return u.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",u.PublicKey)],e.prototype,"publicKey",void 0),n([(0,i.jsonMember)({name:"bid",constructor:c.BidKind}),o("design:type",c.BidKind)],e.prototype,"bid",void 0),n([i.jsonObject,o("design:paramtypes",[u.PublicKey,c.BidKind])],e)}();t.BidKindWrapper=h;var p=function(){function e(){}return n([(0,i.jsonArrayMember)(l,{name:"bids"}),o("design:type",Array)],e.prototype,"bids",void 0),n([(0,i.jsonMember)({name:"block_height",constructor:Number}),o("design:type",Number)],e.prototype,"blockHeight",void 0),n([(0,i.jsonArrayMember)(d,{name:"era_validators"}),o("design:type",Array)],e.prototype,"eraValidators",void 0),n([(0,i.jsonMember)({name:"state_root_hash",constructor:String}),o("design:type",String)],e.prototype,"stateRootHash",void 0),n([i.jsonObject],e)}();t.AuctionStateV1=p;var y=function(){function e(){}return n([(0,i.jsonArrayMember)(h,{name:"bids"}),o("design:type",Array)],e.prototype,"bids",void 0),n([(0,i.jsonMember)({name:"block_height",constructor:Number}),o("design:type",Number)],e.prototype,"blockHeight",void 0),n([(0,i.jsonArrayMember)(d,{name:"era_validators"}),o("design:type",Array)],e.prototype,"eraValidators",void 0),n([(0,i.jsonMember)({name:"state_root_hash",constructor:String}),o("design:type",String)],e.prototype,"stateRootHash",void 0),n([i.jsonObject],e)}();t.AuctionStateV2=y;var m=function(){function e(){}var t;return t=e,e.fromV1=function(e){for(var r,n,o,i,s,u,l=[],d=0,p=e.bids;d<p.length;d++){var y=p[d],m=new a.ValidatorBid;m.bondingPurse=null===(r=null==y?void 0:y.bid)||void 0===r?void 0:r.bondingPurse,m.delegationRate=null===(n=null==y?void 0:y.bid)||void 0===n?void 0:n.delegationRate,m.inactive=null===(o=null==y?void 0:y.bid)||void 0===o?void 0:o.inactive,m.stakedAmount=null===(i=null==y?void 0:y.bid)||void 0===i?void 0:i.stakedAmount,m.vestingSchedule=null===(s=null==y?void 0:y.bid)||void 0===s?void 0:s.vestingSchedule,m.reservedSlots=0,m.validatorPublicKey=null===(u=null==y?void 0:y.bid)||void 0===u?void 0:u.validatorPublicKey,m.maximumDelegationAmount=f.DEFAULT_MAXIMUM_DELEGATION_AMOUNT,m.minimumDelegationAmount=f.DEFAULT_MINIMUM_DELEGATION_AMOUNT;var b=new c.BidKind;b.validator=m,l.push(new h(y.publicKey,b));for(var g=0,v=y.bid.delegators;g<v.length;g++){var w=v[g];l.push(new h(y.publicKey,new c.BidKind(void 0,void 0,new a.Delegator(w.bondingPurse,w.stakedAmount,w.delegatorKind,w.validatorPublicKey,w.vestingSchedule))))}}var S=new t;return S.bids=l,S.blockHeight=e.blockHeight,S.eraValidators=e.eraValidators,S.stateRootHash=e.stateRootHash,S},e.fromV2=function(e){var r=null==e?void 0:e.bids.map(function(e){return new h(null==e?void 0:e.publicKey,null==e?void 0:e.bid)}),n=new t;return n.bids=r,n.blockHeight=null==e?void 0:e.blockHeight,n.eraValidators=null==e?void 0:e.eraValidators,n.stateRootHash=null==e?void 0:e.stateRootHash,n},n([(0,i.jsonArrayMember)(h,{name:"bids"}),o("design:type",Array)],e.prototype,"bids",void 0),n([(0,i.jsonMember)({name:"block_height",constructor:Number}),o("design:type",Number)],e.prototype,"blockHeight",void 0),n([(0,i.jsonArrayMember)(d,{name:"era_validators"}),o("design:type",Array)],e.prototype,"eraValidators",void 0),n([(0,i.jsonMember)({name:"state_root_hash",constructor:String}),o("design:type",String)],e.prototype,"stateRootHash",void 0),t=n([i.jsonObject],e)}();t.AuctionState=m},2142:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Reservation=t.Bridge=t.Credit=t.DelegatorV1=t.Bid=t.Delegator=t.ValidatorBid=t.VestingSchedule=t.DelegationKind=t.Unbond=t.UnbondKind=t.UnbondEra=void 0;var i=r(9592),a=r(9449),s=r(5466),u=r(3401),c=r(7889),f=function(){function e(){}return n([(0,i.jsonMember)({name:"amount",constructor:s.CLValueUInt512,deserializer:function(e){if(e)return s.CLValueUInt512.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.CLValueUInt512)],e.prototype,"amount",void 0),n([(0,i.jsonMember)({name:"era_of_creation",constructor:Number}),o("design:type",Number)],e.prototype,"eraOfCreation",void 0),n([(0,i.jsonMember)({name:"bonding_purse",constructor:u.URef,deserializer:function(e){if(e)return u.URef.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",u.URef)],e.prototype,"bondingPurse",void 0),n([(0,i.jsonMember)({name:"new_validator",constructor:a.PublicKey,deserializer:function(e){if(e)return a.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.PublicKey)],e.prototype,"newValidator",void 0),n([i.jsonObject],e)}();t.UnbondEra=f;var l=function(){function e(){}return n([(0,i.jsonMember)({name:"Validator",constructor:a.PublicKey,deserializer:function(e){if(e)return a.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.PublicKey)],e.prototype,"validator",void 0),n([(0,i.jsonMember)({name:"DelegatedPublicKey",constructor:a.PublicKey,deserializer:function(e){if(e)return a.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.PublicKey)],e.prototype,"delegatedPublicKey",void 0),n([(0,i.jsonMember)({name:"DelegatedPurse",constructor:String}),o("design:type",String)],e.prototype,"delegatedPurse",void 0),n([i.jsonObject],e)}();t.UnbondKind=l;var d=function(){function e(){}return n([(0,i.jsonMember)({name:"validator_public_key",constructor:a.PublicKey,deserializer:function(e){if(e)return a.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.PublicKey)],e.prototype,"validatorPublicKey",void 0),n([(0,i.jsonMember)({name:"unbond_kind",constructor:l}),o("design:type",l)],e.prototype,"unbondKind",void 0),n([(0,i.jsonArrayMember)(f,{name:"eras"}),o("design:type",Array)],e.prototype,"eras",void 0),n([i.jsonObject],e)}();t.Unbond=d;var h=function(){function e(){}var t;return t=e,e.prototype.toHex=function(){var e=void 0!==this.publicKey&&null!==this.publicKey,t=void 0!==this.purse&&null!==this.purse;if(!e&&!t)throw new Error("Invalid DelegationKind: Neither 'publicKey' nor 'purse' is set. One must be provided.");return e?this.publicKey.toHex():this.purse.toPrefixedString()},e.fromJSON=function(e){if(!e)throw new Error("Invalid JSON for DelegationKind: ".concat(e));var r=new t;if(void 0!==e.PublicKey&&null!==e.PublicKey)r.publicKey=a.PublicKey.fromJSON(e.PublicKey);else{if(void 0===e.Purse||null===e.Purse)throw new Error("unexpected DelegatorKind format");var n=c.HexBytes.fromHex(e.Purse),o=new Uint8Array(n.bytes.length+1);o.set(n.bytes,0),o[n.bytes.length]=7,r.purse=u.URef.fromBytes(o).result}return r},n([(0,i.jsonMember)({name:"PublicKey",constructor:a.PublicKey}),o("design:type",a.PublicKey)],e.prototype,"publicKey",void 0),n([(0,i.jsonMember)({name:"Purse",constructor:u.URef}),o("design:type",u.URef)],e.prototype,"purse",void 0),t=n([i.jsonObject],e)}();t.DelegationKind=h;var p=function(){function e(){}return n([(0,i.jsonMember)({name:"initial_release_timestamp_millis",constructor:Number}),o("design:type",Number)],e.prototype,"initialReleaseTimestampMillis",void 0),n([(0,i.jsonArrayMember)(s.CLValueUInt512,{name:"locked_amounts",serializer:function(e){return e.map(function(e){return e.toJSON()})},deserializer:function(e){return e.map(function(e){return s.CLValueUInt512.fromJSON(e)})}}),o("design:type",Array)],e.prototype,"lockedAmounts",void 0),n([i.jsonObject],e)}();t.VestingSchedule=p;var y=function(){function e(){}return n([(0,i.jsonMember)({name:"validator_public_key",constructor:a.PublicKey,deserializer:function(e){if(e)return a.PublicKey.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",a.PublicKey)],e.prototype,"validatorPublicKey",void 0),n([(0,i.jsonMember)({name:"bonding_purse",constructor:u.URef,deserializer:function(e){if(e)return u.URef.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",u.URef)],e.prototype,"bondingPurse",void 0),n([(0,i.jsonMember)({name:"delegation_rate",constructor:Number}),o("design:type",Number)],e.prototype,"delegationRate",void 0),n([(0,i.jsonMember)({name:"inactive",constructor:Boolean}),o("design:type",Boolean)],e.prototype,"inactive",void 0),n([(0,i.jsonMember)({name:"staked_amount",constructor:s.CLValueUInt512,deserializer:function(e){if(e)return s.CLValueUInt512.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.CLValueUInt512)],e.prototype,"stakedAmount",void 0),n([(0,i.jsonMember)({name:"minimum_delegation_amount",constructor:BigInt,deserializer:function(e){if(e)try{return BigInt(e)}catch(t){throw new Error("Could not convert minimum_delegation_amount: ".concat(e))}},serializer:function(e){return null==e?void 0:e.toString()}}),o("design:type","function"==typeof BigInt?BigInt:Object)],e.prototype,"minimumDelegationAmount",void 0),n([(0,i.jsonMember)({name:"maximum_delegation_amount",constructor:BigInt,deserializer:function(e){if(e)try{return BigInt(e)}catch(t){throw new Error("Could not convert maximum_delegation_amount: ".concat(e))}},serializer:function(e){return null==e?void 0:e.toString()}}),o("design:type","function"==typeof BigInt?BigInt:Object)],e.prototype,"maximumDelegationAmount",void 0),n([(0,i.jsonMember)({name:"reserved_slots",constructor:Number}),o("design:type",Number)],e.prototype,"reservedSlots",void 0),n([(0,i.jsonMember)({name:"vesting_schedule",constructor:p}),o("design:type",p)],e.prototype,"vestingSchedule",void 0),n([i.jsonObject],e)}();t.ValidatorBid=y;var m=function(){function e(e,t,r,n,o){this.bondingPurse=e,this.stakedAmount=t,this.delegatorKind=r,this.validatorPublicKey=n,this.vestingSchedule=o}var t;return t=e,e.newDelegatorFromDelegatorV1=function(e){var r=new h;return r.publicKey=e.publicKey,new t(e.bondingPurse,e.stakedAmount,r,e.delegatee,e.vestingSchedule)},e.fromJSON=function(e){var r=this;if(!Array.isArray(e))throw new Error("Delegators should be an array.");return e.length>0&&null!=e[0].delegator_public_key?e.map(function(e){var r=e.delegator,n=new i.TypedJSON(t).parse(r);if(!n)throw new Error("Failed to deserialize Delegator from wrapped format.");return n}):e.map(function(e){var t=new i.TypedJSON(g).parse(e);if(!t)throw new Error("Failed to deserialize DelegatorV1.");return r.newDelegatorFromDelegatorV1(t)})},n([(0,i.jsonMember)({name:"bonding_purse",constructor:u.URef,deserializer:function(e){if(e)return u.URef.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.URef)],e.prototype,"bondingPurse",void 0),n([(0,i.jsonMember)({name:"staked_amount",constructor:s.CLValueUInt512,deserializer:function(e){if(e)return s.CLValueUInt512.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",s.CLValueUInt512)],e.prototype,"stakedAmount",void 0),n([(0,i.jsonMember)({name:"delegator_kind",constructor:h,deserializer:function(e){if(e)return h.fromJSON(e)}}),o("design:type",h)],e.prototype,"delegatorKind",void 0),n([(0,i.jsonMember)({name:"validator_public_key",constructor:a.PublicKey,deserializer:function(e){if(e)return a.PublicKey.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",a.PublicKey)],e.prototype,"validatorPublicKey",void 0),n([(0,i.jsonMember)({name:"vesting_schedule",constructor:p}),o("design:type",p)],e.prototype,"vestingSchedule",void 0),t=n([i.jsonObject,o("design:paramtypes",[u.URef,s.CLValueUInt512,h,a.PublicKey,p])],e)}();t.Delegator=m;var b=function(){function e(){}return n([(0,i.jsonMember)({name:"bonding_purse",constructor:u.URef,deserializer:function(e){if(e)return u.URef.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.URef)],e.prototype,"bondingPurse",void 0),n([(0,i.jsonMember)({name:"delegation_rate",constructor:Number}),o("design:type",Number)],e.prototype,"delegationRate",void 0),n([(0,i.jsonMember)({name:"inactive",constructor:Boolean}),o("design:type",Boolean)],e.prototype,"inactive",void 0),n([(0,i.jsonMember)({name:"staked_amount",constructor:s.CLValueUInt512,deserializer:function(e){if(e)return s.CLValueUInt512.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",s.CLValueUInt512)],e.prototype,"stakedAmount",void 0),n([(0,i.jsonMember)({name:"validator_public_key",constructor:a.PublicKey,deserializer:function(e){if(e)return a.PublicKey.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",a.PublicKey)],e.prototype,"validatorPublicKey",void 0),n([(0,i.jsonArrayMember)(m,{name:"delegators",deserializer:function(e){if(e)return m.fromJSON(e)}}),o("design:type",Array)],e.prototype,"delegators",void 0),n([(0,i.jsonMember)({name:"vesting_schedule",constructor:p}),o("design:type",p)],e.prototype,"vestingSchedule",void 0),n([i.jsonObject],e)}();t.Bid=b;var g=function(){function e(){}return n([(0,i.jsonMember)({name:"bonding_purse",constructor:u.URef,deserializer:function(e){if(e)return u.URef.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",u.URef)],e.prototype,"bondingPurse",void 0),n([(0,i.jsonMember)({name:"staked_amount",constructor:s.CLValueUInt512,deserializer:function(e){if(e)return s.CLValueUInt512.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.CLValueUInt512)],e.prototype,"stakedAmount",void 0),n([(0,i.jsonMember)({name:"delegatee",constructor:a.PublicKey,deserializer:function(e){if(e)return a.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.PublicKey)],e.prototype,"delegatee",void 0),n([(0,i.jsonMember)({name:"public_key",constructor:a.PublicKey,deserializer:function(e){if(e)return a.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.PublicKey)],e.prototype,"publicKey",void 0),n([(0,i.jsonMember)({name:"vesting_schedule",constructor:p}),o("design:type",p)],e.prototype,"vestingSchedule",void 0),n([i.jsonObject],e)}();t.DelegatorV1=g;var v=function(){function e(){}return n([(0,i.jsonMember)({name:"era_id",constructor:Number}),o("design:type",Number)],e.prototype,"eraID",void 0),n([(0,i.jsonMember)({name:"validator_public_key",constructor:a.PublicKey,deserializer:function(e){if(e)return a.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.PublicKey)],e.prototype,"validatorPublicKey",void 0),n([(0,i.jsonMember)({name:"amount",constructor:s.CLValueUInt512,deserializer:function(e){if(e)return s.CLValueUInt512.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.CLValueUInt512)],e.prototype,"amount",void 0),n([i.jsonObject],e)}();t.Credit=v;var w=function(){function e(){}return n([(0,i.jsonMember)({name:"era_id",constructor:Number}),o("design:type",Number)],e.prototype,"eraID",void 0),n([(0,i.jsonMember)({name:"old_validator_public_key",constructor:a.PublicKey,deserializer:function(e){if(e)return a.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.PublicKey)],e.prototype,"oldValidatorPublicKey",void 0),n([(0,i.jsonMember)({name:"new_validator_public_key",constructor:a.PublicKey,deserializer:function(e){if(e)return a.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.PublicKey)],e.prototype,"newValidatorPublicKey",void 0),n([i.jsonObject],e)}();t.Bridge=w;var S=function(){function e(){}return n([(0,i.jsonMember)({name:"delegation_rate",constructor:Number}),o("design:type",Number)],e.prototype,"delegationRate",void 0),n([(0,i.jsonMember)({name:"validator_public_key",constructor:a.PublicKey,deserializer:function(e){if(e)return a.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.PublicKey)],e.prototype,"validatorPublicKey",void 0),n([(0,i.jsonMember)({name:"delegator_kind",constructor:h,deserializer:function(e){if(e)return h.fromJSON(e)}}),o("design:type",h)],e.prototype,"delegatorKind",void 0),n([i.jsonObject],e)}();t.Reservation=S},4820:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.BidKind=void 0;var i=r(9592),a=r(2142),s=function(){function e(e,t,r,n,o,i,a){this.unified=e,this.validator=t,this.delegator=r,this.bridge=n,this.credit=o,this.reservation=i,this.unbond=a}return n([(0,i.jsonMember)({name:"Unified",constructor:a.Bid}),o("design:type",a.Bid)],e.prototype,"unified",void 0),n([(0,i.jsonMember)({name:"Validator",constructor:a.ValidatorBid}),o("design:type",a.ValidatorBid)],e.prototype,"validator",void 0),n([(0,i.jsonMember)({name:"Delegator",constructor:a.Delegator}),o("design:type",a.Delegator)],e.prototype,"delegator",void 0),n([(0,i.jsonMember)({name:"Bridge",constructor:a.Bridge}),o("design:type",a.Bridge)],e.prototype,"bridge",void 0),n([(0,i.jsonMember)({name:"Credit",constructor:a.Credit}),o("design:type",a.Credit)],e.prototype,"credit",void 0),n([(0,i.jsonMember)({name:"Reservation",constructor:a.Reservation}),o("design:type",a.Reservation)],e.prototype,"reservation",void 0),n([(0,i.jsonMember)({name:"Unbond",constructor:a.Unbond}),o("design:type",a.Unbond)],e.prototype,"unbond",void 0),n([i.jsonObject,o("design:paramtypes",[a.Bid,a.ValidatorBid,a.Delegator,a.Bridge,a.Credit,a.Reservation,a.Unbond])],e)}();t.BidKind=s},3404:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.BlockHeader=t.BlockHeaderWrapper=t.BlockWithSignatures=t.BlockWrapper=t.BlockV2=t.BlockBodyV2=t.BlockHeaderV2=t.BlockV1=t.BlockBodyV1=t.BlockHeaderV1=t.parseBlockTransactions=t.BlockTransaction=t.Block=t.Proof=void 0;var s=r(9592),u=r(3401),c=r(6500),f=r(4924),l=r(6722),d=r(9125),h=r(9449),p=r(7889),y=r(8389),m=function(){function e(){}return o([(0,s.jsonMember)({constructor:h.PublicKey,name:"public_key",deserializer:function(e){return h.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",h.PublicKey)],e.prototype,"publicKey",void 0),o([(0,s.jsonMember)({name:"signature",constructor:p.HexBytes,deserializer:function(e){return p.HexBytes.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",p.HexBytes)],e.prototype,"signature",void 0),o([s.jsonObject],e)}();t.Proof=m;var b=function(){function e(e,t,r,n,o,i,a,s,u,c,f,l,d,h,p,y,m,b){this.hash=e,this.height=t,this.stateRootHash=r,this.lastSwitchBlockHash=n,this.parentHash=o,this.eraID=i,this.timestamp=a,this.accumulatedSeed=s,this.randomBit=u,this.currentGasPrice=c,this.proposer=f,this.protocolVersion=l,this.eraEnd=d,this.transactions=h,this.rewardedSignatures=p,this.proofs=y,this.originBlockV1=m,this.originBlockV2=b}var t;return t=e,e.prototype.getBlockV1=function(){return this.originBlockV1},e.prototype.getBlockV2=function(){return this.originBlockV2},e.newBlockFromBlockWrapper=function(e,r){var n,o;if(e.blockV1){var i=t.newBlockFromBlockV1(e.blockV1);return i.proofs=r,i}if(e.blockV2){var a=e.blockV2;return new t(a.hash,a.header.height,a.header.stateRootHash,a.header.lastSwitchBlockHash,a.header.parentHash,a.header.eraID,a.header.timestamp,a.header.accumulatedSeed,a.header.randomBit,a.header.currentGasPrice,a.header.proposer,a.header.protocolVersion,null!==(o=l.EraEnd.fromV2(null!==(n=a.header.eraEnd)&&void 0!==n?n:null))&&void 0!==o?o:void 0,a.body.transactions,a.body.rewardedSignatures,r,void 0,a)}throw new Error("BlockWrapper must contain either BlockV1 or BlockV2")},e.newBlockFromBlockV1=function(e){for(var r,n,o=[],i=0,a=e.body.transferHashes;i<a.length;i++){var s=a[i];o.push(new g(d.TransactionCategory.Mint,d.TransactionVersion.Deploy,s))}for(var u=0,c=e.body.deployHashes;u<c.length;u++){var f=c[u];o.push(new g(d.TransactionCategory.Large,d.TransactionVersion.Deploy,f))}return new t(e.hash,e.header.height,e.header.stateRootHash,null,e.header.parentHash,e.header.eraID,e.header.timestamp,e.header.accumulatedSeed,e.header.randomBit,1,e.body.proposer,e.header.protocolVersion,null!==(n=l.EraEnd.fromV1(null!==(r=e.header.eraEnd)&&void 0!==r?r:null))&&void 0!==n?n:void 0,o,[],e.proofs,e)},o([(0,s.jsonMember)({name:"hash",constructor:u.Hash,deserializer:function(e){return u.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",u.Hash)],e.prototype,"hash",void 0),o([(0,s.jsonMember)({name:"height",constructor:Number}),i("design:type",Number)],e.prototype,"height",void 0),o([(0,s.jsonMember)({name:"state_root_hash",constructor:u.Hash,deserializer:function(e){return u.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",u.Hash)],e.prototype,"stateRootHash",void 0),o([(0,s.jsonMember)({name:"last_switch_block_hash",constructor:u.Hash,deserializer:function(e){return e?u.Hash.fromJSON(e):null},serializer:function(e){return e?e.toJSON():null},preserveNull:!0}),i("design:type",Object)],e.prototype,"lastSwitchBlockHash",void 0),o([(0,s.jsonMember)({name:"parent_hash",constructor:u.Hash,deserializer:function(e){return u.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",u.Hash)],e.prototype,"parentHash",void 0),o([(0,s.jsonMember)({name:"era_id",constructor:Number}),i("design:type",Number)],e.prototype,"eraID",void 0),o([(0,s.jsonMember)({name:"timestamp",constructor:c.Timestamp,deserializer:function(e){return c.Timestamp.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",c.Timestamp)],e.prototype,"timestamp",void 0),o([(0,s.jsonMember)({name:"accumulated_seed",constructor:u.Hash,deserializer:function(e){if(e)return u.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),i("design:type",u.Hash)],e.prototype,"accumulatedSeed",void 0),o([(0,s.jsonMember)({name:"random_bit",constructor:Boolean}),i("design:type",Boolean)],e.prototype,"randomBit",void 0),o([(0,s.jsonMember)({name:"current_gas_price",constructor:Number}),i("design:type",Number)],e.prototype,"currentGasPrice",void 0),o([(0,s.jsonMember)({name:"proposer",constructor:f.Proposer,deserializer:function(e){return f.Proposer.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",f.Proposer)],e.prototype,"proposer",void 0),o([(0,s.jsonMember)({name:"protocol_version",constructor:String}),i("design:type",String)],e.prototype,"protocolVersion",void 0),o([(0,s.jsonMember)({name:"era_end",constructor:l.EraEnd}),i("design:type",l.EraEnd)],e.prototype,"eraEnd",void 0),o([(0,s.jsonArrayMember)(function(){return g},{name:"transactions",deserializer:function(e){return g.fromJSON(e)}}),i("design:type",Array)],e.prototype,"transactions",void 0),o([(0,s.jsonArrayMember)(Number,{dimensions:2,name:"rewarded_signatures"}),i("design:type",Array)],e.prototype,"rewardedSignatures",void 0),o([(0,s.jsonArrayMember)(function(){return m},{name:"proofs"}),i("design:type",Array)],e.prototype,"proofs",void 0),t=o([s.jsonObject,i("design:paramtypes",[u.Hash,Number,u.Hash,Object,u.Hash,Number,c.Timestamp,Object,Boolean,Number,f.Proposer,Object,Object,Array,Array,Array,M,E])],e)}();t.Block=b;var g=function(){function e(e,t,r){this.category=e,this.version=t,this.hash=r}return e.fromJSON=function(e){var t=new s.TypedJSON(d.TransactionHash),r={Mint:(e[0]||[]).map(function(e){return t.parse(e)}),Auction:(e[1]||[]).map(function(e){return t.parse(e)}),InstallUpgrade:(e[2]||[]).map(function(e){return t.parse(e)}),Large:(e[3]||[]).map(function(e){return t.parse(e)}),Medium:(e[4]||[]).map(function(e){return t.parse(e)}),Small:(e[5]||[]).map(function(e){return t.parse(e)})},n=[];return n.push.apply(n,a(a(a(a(a(a([],v(r.Mint,d.TransactionCategory.Mint),!1),v(r.Auction,d.TransactionCategory.Auction),!1),v(r.InstallUpgrade,d.TransactionCategory.InstallUpgrade),!1),v(r.Large,d.TransactionCategory.Large),!1),v(r.Medium,d.TransactionCategory.Medium),!1),v(r.Small,d.TransactionCategory.Small),!1)),n},e.prototype.toJSON=function(){var e,t,r;return JSON.stringify(((e={})[this.category.toString()]=[(t={},t[null!==(r=(0,y.getEnumKeyByValue)(d.TransactionVersion,this.version))&&void 0!==r?r:""]=this.hash.toJSON(),t)],e))},o([(0,s.jsonMember)({name:"Category",constructor:Number}),i("design:type",Number)],e.prototype,"category",void 0),o([(0,s.jsonMember)({name:"Version",constructor:Number}),i("design:type",Number)],e.prototype,"version",void 0),o([(0,s.jsonMember)({name:"Hash",constructor:u.Hash,deserializer:function(e){return u.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",u.Hash)],e.prototype,"hash",void 0),o([s.jsonObject,i("design:paramtypes",[Number,Number,u.Hash])],e)}();function v(e,t){return 0===e.length?[]:e.map(function(e){var r=e.transactionV1,n=e.deploy;if(r)return new g(t,d.TransactionVersion.V1,r);if(n)return new g(t,d.TransactionVersion.Deploy,n);throw new Error("Invalid TransactionHash: transactionV1 and deploy is undefined")})}t.BlockTransaction=g,t.parseBlockTransactions=function(e){var t=JSON.parse(e),r=[];return t[0]&&r.push.apply(r,v(t[0],d.TransactionCategory.Mint)),t[1]&&r.push.apply(r,v(t[1],d.TransactionCategory.Auction)),t[2]&&r.push.apply(r,v(t[2],d.TransactionCategory.InstallUpgrade)),t[3]&&r.push.apply(r,v(t[3],d.TransactionCategory.Large)),t[4]&&r.push.apply(r,v(t[4],d.TransactionCategory.Medium)),t[5]&&r.push.apply(r,v(t[5],d.TransactionCategory.Small)),r};var w=function(){function e(){}return o([(0,s.jsonMember)({name:"accumulated_seed",constructor:u.Hash,deserializer:function(e){if(e)return u.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),i("design:type",u.Hash)],e.prototype,"accumulatedSeed",void 0),o([(0,s.jsonMember)({name:"body_hash",constructor:u.Hash,deserializer:function(e){return u.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",u.Hash)],e.prototype,"bodyHash",void 0),o([(0,s.jsonMember)({name:"era_id",constructor:Number}),i("design:type",Number)],e.prototype,"eraID",void 0),o([(0,s.jsonMember)({name:"height",constructor:Number}),i("design:type",Number)],e.prototype,"height",void 0),o([(0,s.jsonMember)({name:"parent_hash",constructor:u.Hash,deserializer:function(e){return u.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",u.Hash)],e.prototype,"parentHash",void 0),o([(0,s.jsonMember)({name:"protocol_version",constructor:String}),i("design:type",String)],e.prototype,"protocolVersion",void 0),o([(0,s.jsonMember)({name:"random_bit",constructor:Boolean}),i("design:type",Boolean)],e.prototype,"randomBit",void 0),o([(0,s.jsonMember)({name:"state_root_hash",constructor:u.Hash,deserializer:function(e){return u.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",u.Hash)],e.prototype,"stateRootHash",void 0),o([(0,s.jsonMember)({name:"timestamp",constructor:c.Timestamp,deserializer:function(e){return c.Timestamp.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",c.Timestamp)],e.prototype,"timestamp",void 0),o([(0,s.jsonMember)({name:"era_end",constructor:l.EraEndV1}),i("design:type",l.EraEndV1)],e.prototype,"eraEnd",void 0),o([s.jsonObject],e)}();t.BlockHeaderV1=w;var S=function(){function e(){}return o([(0,s.jsonArrayMember)(function(){return u.Hash},{name:"deploy_hashes",serializer:function(e){return e.map(function(e){return e.toJSON()})},deserializer:function(e){return e.map(function(e){return u.Hash.fromJSON(e)})}}),i("design:type",Array)],e.prototype,"deployHashes",void 0),o([(0,s.jsonMember)({name:"proposer",constructor:f.Proposer,deserializer:function(e){return f.Proposer.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",f.Proposer)],e.prototype,"proposer",void 0),o([(0,s.jsonArrayMember)(function(){return u.Hash},{name:"transfer_hashes",serializer:function(e){return e.map(function(e){return e.toJSON()})},deserializer:function(e){return e.map(function(e){return u.Hash.fromJSON(e)})}}),i("design:type",Array)],e.prototype,"transferHashes",void 0),o([s.jsonObject],e)}();t.BlockBodyV1=S;var M=function(){function e(){}return o([(0,s.jsonMember)({name:"hash",constructor:u.Hash,deserializer:function(e){return u.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",u.Hash)],e.prototype,"hash",void 0),o([(0,s.jsonMember)({name:"header",constructor:w}),i("design:type",w)],e.prototype,"header",void 0),o([(0,s.jsonMember)({name:"body",constructor:S}),i("design:type",S)],e.prototype,"body",void 0),o([(0,s.jsonArrayMember)(m,{name:"proofs"}),i("design:type",Array)],e.prototype,"proofs",void 0),o([s.jsonObject],e)}();t.BlockV1=M;var _=function(){function e(){}return o([(0,s.jsonMember)({name:"accumulated_seed",constructor:u.Hash,deserializer:function(e){if(e)return u.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),i("design:type",u.Hash)],e.prototype,"accumulatedSeed",void 0),o([(0,s.jsonMember)({name:"body_hash",constructor:u.Hash,deserializer:function(e){return u.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",u.Hash)],e.prototype,"bodyHash",void 0),o([(0,s.jsonMember)({name:"era_id",constructor:Number}),i("design:type",Number)],e.prototype,"eraID",void 0),o([(0,s.jsonMember)({name:"current_gas_price",constructor:Number}),i("design:type",Number)],e.prototype,"currentGasPrice",void 0),o([(0,s.jsonMember)({name:"height",constructor:Number}),i("design:type",Number)],e.prototype,"height",void 0),o([(0,s.jsonMember)({name:"parent_hash",constructor:u.Hash,deserializer:function(e){return u.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",u.Hash)],e.prototype,"parentHash",void 0),o([(0,s.jsonMember)({name:"proposer",constructor:f.Proposer,deserializer:function(e){return f.Proposer.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",f.Proposer)],e.prototype,"proposer",void 0),o([(0,s.jsonMember)({name:"protocol_version",constructor:String}),i("design:type",String)],e.prototype,"protocolVersion",void 0),o([(0,s.jsonMember)({name:"random_bit",constructor:Boolean}),i("design:type",Boolean)],e.prototype,"randomBit",void 0),o([(0,s.jsonMember)({name:"state_root_hash",constructor:u.Hash,deserializer:function(e){return u.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",u.Hash)],e.prototype,"stateRootHash",void 0),o([(0,s.jsonMember)({name:"last_switch_block_hash",constructor:u.Hash,deserializer:function(e){return u.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",u.Hash)],e.prototype,"lastSwitchBlockHash",void 0),o([(0,s.jsonMember)({name:"timestamp",constructor:c.Timestamp,deserializer:function(e){return c.Timestamp.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",c.Timestamp)],e.prototype,"timestamp",void 0),o([(0,s.jsonMember)({name:"era_end",constructor:l.EraEndV2}),i("design:type",l.EraEndV2)],e.prototype,"eraEnd",void 0),o([s.jsonObject],e)}();t.BlockHeaderV2=_;var A=function(){function e(){}return o([(0,s.jsonMember)(g,{name:"transactions",deserializer:function(e){return g.fromJSON(e)},serializer:function(e){return n({},e.reduce(function(e,t){return n(n({},e),JSON.parse(t.toJSON()))},{}))}}),i("design:type",Array)],e.prototype,"transactions",void 0),o([(0,s.jsonArrayMember)(Number,{dimensions:2,name:"rewarded_signatures"}),i("design:type",Array)],e.prototype,"rewardedSignatures",void 0),o([s.jsonObject],e)}();t.BlockBodyV2=A;var E=function(){function e(){}return o([(0,s.jsonMember)({name:"hash",constructor:u.Hash,deserializer:function(e){return u.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",u.Hash)],e.prototype,"hash",void 0),o([(0,s.jsonMember)({name:"header",constructor:_}),i("design:type",_)],e.prototype,"header",void 0),o([(0,s.jsonMember)({name:"body",constructor:A}),i("design:type",A)],e.prototype,"body",void 0),o([s.jsonObject],e)}();t.BlockV2=E;var O=function(){function e(){}return o([(0,s.jsonMember)({name:"Version1",constructor:M}),i("design:type",M)],e.prototype,"blockV1",void 0),o([(0,s.jsonMember)({name:"Version2",constructor:E}),i("design:type",E)],e.prototype,"blockV2",void 0),o([s.jsonObject],e)}();t.BlockWrapper=O;var j=function(){function e(){}return o([(0,s.jsonMember)({name:"block",constructor:O}),i("design:type",O)],e.prototype,"block",void 0),o([(0,s.jsonArrayMember)(m,{name:"proofs"}),i("design:type",Array)],e.prototype,"proofs",void 0),o([s.jsonObject],e)}();t.BlockWithSignatures=j;var T=function(){function e(){}return o([(0,s.jsonMember)({name:"Version1",constructor:w}),i("design:type",w)],e.prototype,"blockHeaderV1",void 0),o([(0,s.jsonMember)({name:"Version2",constructor:_}),i("design:type",_)],e.prototype,"blockHeaderV2",void 0),o([s.jsonObject],e)}();t.BlockHeaderWrapper=T;var N=function(){function e(){}var t;return t=e,e.prototype.getBlockHeaderV1=function(){return this.originBlockHeaderV1},e.prototype.getBlockHeaderV2=function(){return this.originBlockHeaderV2},e.newBlockHeaderFromV1=function(e){var r=new t;return r.accumulatedSeed=e.accumulatedSeed,r.bodyHash=e.bodyHash,r.eraID=e.eraID,r.currentGasPrice=1,r.height=e.height,r.parentHash=e.parentHash,r.protocolVersion=e.protocolVersion,r.randomBit=e.randomBit,r.stateRootHash=e.stateRootHash,r.timestamp=e.timestamp,r.eraEnd=e.eraEnd?l.EraEnd.fromV1(e.eraEnd):void 0,r.originBlockHeaderV1=e,r},e.newBlockHeaderFromV2=function(e){var r=new t;return r.accumulatedSeed=e.accumulatedSeed,r.bodyHash=e.bodyHash,r.eraID=e.eraID,r.currentGasPrice=e.currentGasPrice,r.height=e.height,r.parentHash=e.parentHash,r.proposer=e.proposer,r.protocolVersion=e.protocolVersion,r.randomBit=e.randomBit,r.stateRootHash=e.stateRootHash,r.timestamp=e.timestamp,r.eraEnd=e.eraEnd?l.EraEnd.fromV2(e.eraEnd):void 0,r.originBlockHeaderV2=e,r},o([(0,s.jsonMember)({name:"accumulated_seed",constructor:u.Hash,deserializer:function(e){if(e)return u.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),i("design:type",u.Hash)],e.prototype,"accumulatedSeed",void 0),o([(0,s.jsonMember)({name:"body_hash",constructor:u.Hash,deserializer:function(e){return u.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",u.Hash)],e.prototype,"bodyHash",void 0),o([(0,s.jsonMember)({name:"era_id",constructor:Number}),i("design:type",Number)],e.prototype,"eraID",void 0),o([(0,s.jsonMember)({name:"current_gas_price",constructor:Number}),i("design:type",Number)],e.prototype,"currentGasPrice",void 0),o([(0,s.jsonMember)({name:"height",constructor:Number}),i("design:type",Number)],e.prototype,"height",void 0),o([(0,s.jsonMember)({name:"parent_hash",constructor:u.Hash,deserializer:function(e){return u.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",u.Hash)],e.prototype,"parentHash",void 0),o([(0,s.jsonMember)({name:"proposer",constructor:f.Proposer,deserializer:function(e){return f.Proposer.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",f.Proposer)],e.prototype,"proposer",void 0),o([(0,s.jsonMember)({name:"protocol_version",constructor:String}),i("design:type",String)],e.prototype,"protocolVersion",void 0),o([(0,s.jsonMember)({name:"random_bit",constructor:Boolean}),i("design:type",Boolean)],e.prototype,"randomBit",void 0),o([(0,s.jsonMember)({name:"state_root_hash",constructor:u.Hash,deserializer:function(e){return u.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",u.Hash)],e.prototype,"stateRootHash",void 0),o([(0,s.jsonMember)({name:"timestamp",constructor:c.Timestamp,deserializer:function(e){return c.Timestamp.fromJSON(e)},serializer:function(e){return e.toJSON()}}),i("design:type",c.Timestamp)],e.prototype,"timestamp",void 0),o([(0,s.jsonMember)({name:"era_end",constructor:l.EraEnd}),i("design:type",Object)],e.prototype,"eraEnd",void 0),t=o([s.jsonObject],e)}();t.BlockHeader=N},4924:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),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.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Proposer=void 0;var u=r(9592),c=a(r(9449)),f=function(){function e(e,t){void 0===e&&(e=!1),this.isSystem=e,this.publicKey=t}var t;return t=e,e.fromString=function(e){if("00"===e)return new t(!0);var r=c.PublicKey.fromJSON(e);return new t(!1,r)},e.prototype.isSystemProposer=function(){return this.isSystem},e.prototype.getPublicKey=function(){if(this.isSystem)throw new Error("System proposer doesn't have a public key");return this.publicKey},e.prototype.getPublicKeyOptional=function(){return this.publicKey},e.prototype.toJSON=function(){return this.isSystem?"00":null==this?void 0:this.publicKey.toJSON()},e.fromJSON=function(e){if("00"===e)return new t(!0);var r=c.PublicKey.fromJSON(e);return new t(!1,r)},i([(0,u.jsonMember)({name:"isSystem",constructor:Boolean}),s("design:type",Boolean)],e.prototype,"isSystem",void 0),i([(0,u.jsonMember)({name:"publicKey",constructor:c.PublicKey,deserializer:function(e){if(e)return c.PublicKey.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),s("design:type",c.PublicKey)],e.prototype,"publicKey",void 0),t=i([u.jsonObject,s("design:paramtypes",[Object,c.PublicKey])],e)}();t.Proposer=f},978:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.SystemByteCode=void 0;var i=r(9592),a=r(7889),s=function(){function e(e,t){this.kind=e,this.bytes=t}return e.prototype.isEmpty=function(){return"Empty"===this.kind||!this.kind},e.prototype.isV1CasperWasm=function(){return"V1CasperWasm"===this.kind},e.prototype.toString=function(){return this.kind},n([(0,i.jsonMember)({constructor:String}),o("design:type",String)],e.prototype,"kind",void 0),n([(0,i.jsonMember)({constructor:a.HexBytes,deserializer:function(e){return a.HexBytes.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.HexBytes)],e.prototype,"bytes",void 0),n([i.jsonObject,o("design:paramtypes",[String,a.HexBytes])],e)}();t.SystemByteCode=s},678:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.expandBuffer=t.writeBytes=t.writeUShort=t.writeInteger=t.fromBytesU64=t.parseU32=t.parseU16=t.byteHash=t.toBytesArrayU8=t.fromBytesString=t.toBytesString=t.toBytesU512=t.toBytesU256=t.toBytesU128=t.toBytesI64=t.toBytesU64=t.toBytesU32=t.toBytesI32=t.toBytesU16=t.toBytesU8=t.toBytesNumber=void 0;var o=r(6077),i=r(1551),a=r(8905),s=r(6719);t.toBytesNumber=function(e,t){return function(r){var n=o.BigNumber.from(r),s=i.MaxUint256.mask(e);if(t){var u=s.mask(e-1);if(n.gt(u)||n.lt(u.add(i.One).mul(i.NegativeOne)))throw new Error("value out-of-bounds, value: "+r)}else if(n.lt(i.Zero)||n.gt(s.mask(e)))throw new Error("value out-of-bounds, value: "+r);var c=n.toTwos(e).mask(e),f=(0,a.arrayify)(c);if(c.gte(0)){if(e>64)return c.eq(0)?f:(0,a.concat)([f,Uint8Array.from([f.length])]).slice().reverse();var l=e/8;return(0,a.concat)([f.slice().reverse(),new Uint8Array(l-f.length)])}return f.reverse()}},t.toBytesU8=(0,t.toBytesNumber)(8,!1),t.toBytesU16=(0,t.toBytesNumber)(16,!1),t.toBytesI32=(0,t.toBytesNumber)(32,!0),t.toBytesU32=(0,t.toBytesNumber)(32,!1),t.toBytesU64=(0,t.toBytesNumber)(64,!1),t.toBytesI64=(0,t.toBytesNumber)(64,!0),t.toBytesU128=(0,t.toBytesNumber)(128,!1),t.toBytesU256=(0,t.toBytesNumber)(256,!1),t.toBytesU512=(0,t.toBytesNumber)(512,!1),t.toBytesString=function(e){var r=Uint8Array.from(n.from(e));return(0,a.concat)([(0,t.toBytesU32)(r.byteLength),r])},t.fromBytesString=function(e){return n.from(e).toString()},t.toBytesArrayU8=function(e){return(0,a.concat)([(0,t.toBytesU32)(e.length),e])},t.byteHash=function(e){return(0,s.blake2b)(e,{dkLen:32})},t.parseU16=function(e){if(e.length<2)throw new Error("Invalid byte array for u16 parsing");return e[0]|e[1]<<8},t.parseU32=function(e){if(e.length<4)throw new Error("Invalid byte array for u32 parsing");return e[0]|e[1]<<8|e[2]<<16|e[3]<<24},t.fromBytesU64=function(e){if(8!==e.length)throw new Error("Invalid input length for u64: expected 8 bytes, got ".concat(e.length));return o.BigNumber.from(e.reverse())},t.writeInteger=function(e,t,r){return e.setInt32(t,r,!0),t+4},t.writeUShort=function(e,t,r){return e.setUint16(t,r,!0),t+2},t.writeBytes=function(e,t,r){for(var n=0;n<r.length;n++)e.setUint8(t+n,r[n]);return t+r.length},t.expandBuffer=function(e,t){for(var r=e.byteLength;r<t;)r*=2;var n=new ArrayBuffer(r);return new Uint8Array(n).set(new Uint8Array(e)),n}},9213:function(e,t,r){var n=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.CalltableSerialization=t.Field=void 0;var o=r(8905),i=r(678),a=function(){function e(e,t,r){this.index=e,this.offset=t,this.value=r}return e.serializedVecSize=function(){return 12},e}();t.Field=a;var s=function(){function e(){this.fields=[],this.currentOffset=0}return e.prototype.addField=function(e,t){if(this.fields.length!==e)throw new Error("Add fields in correct index order.");var r=new a(e,this.currentOffset,t);return this.fields.push(r),this.currentOffset+=t.length,this},e.prototype.toBytes=function(){var e=[],t=[];e.push((0,i.toBytesU32)(this.fields.length));for(var r=0,a=this.fields;r<a.length;r++){var s=a[r];e.push((0,i.toBytesU16)(s.index)),e.push((0,i.toBytesU32)(s.offset)),t.push(s.value)}return e.push((0,i.toBytesU32)(this.currentOffset)),(0,o.concat)(n(n([],e,!0),t,!0))},e.prototype.getField=function(e){var t=this.fields.find(function(t){return t.index===e});return t?t.value:void 0},e.fromBytes=function(t){var r=new e,n=0,o=(0,i.parseU32)(t.slice(n,n+4));n+=4;for(var s=[],u=0;u<o;u++){var c=(0,i.parseU16)(t.slice(n,n+2));n+=2;var f=(0,i.parseU32)(t.slice(n,n+4));n+=4,s.push(new a(c,f,new Uint8Array))}var l=(0,i.parseU32)(t.slice(n,n+4));for(n+=4,u=0;u<s.length;u++){var d=s[u].offset,h=u+1<s.length?s[u+1].offset:l;s[u].value=t.slice(n+d,n+h)}return r.fields=s,r.currentOffset=l,r},e}();t.CalltableSerialization=s},2535:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Contract=void 0;var i=r(9592),a=r(3401),s=r(3750),u=r(9153),c=function(){function e(e,t,r,n,o){this.contractPackageHash=e,this.contractWasmHash=t,this.entryPoints=r,this.namedKeys=n,this.protocolVersion=o}return n([(0,i.jsonMember)({name:"contract_package_hash",constructor:a.ContractPackageHash,deserializer:function(e){return a.ContractPackageHash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.ContractPackageHash)],e.prototype,"contractPackageHash",void 0),n([(0,i.jsonMember)({name:"contract_wasm_hash",constructor:a.ContractHash,deserializer:function(e){return a.ContractHash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.ContractHash)],e.prototype,"contractWasmHash",void 0),n([(0,i.jsonArrayMember)(s.NamedEntryPoint,{name:"entry_points",deserializer:function(e){if(e)return e.map(function(e){return s.NamedEntryPoint.fromJSON(e)})}}),o("design:type",Array)],e.prototype,"entryPoints",void 0),n([(0,i.jsonArrayMember)(u.NamedKey,{name:"named_keys"}),o("design:type",Array)],e.prototype,"namedKeys",void 0),n([(0,i.jsonMember)({name:"protocol_version",constructor:String}),o("design:type",String)],e.prototype,"protocolVersion",void 0),n([i.jsonObject,o("design:paramtypes",[a.ContractPackageHash,a.ContractHash,Array,Array,String])],e)}();t.Contract=c},8263:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.ContractPackage=t.ContractVersion=t.ContractGroup=void 0;var i=r(9592),a=r(3401),s=r(2428),u=function(){function e(){}var t;return t=e,e.fromJSON=function(e){var r=new i.TypedJSON(t).parse(e);return r&&(Array.isArray(null==e?void 0:e.keys)&&(r.groupUsers=e.keys.map(function(e){return a.URef.fromJSON(e)})),"string"==typeof(null==e?void 0:e.group)&&(r.groupName=e.group)),r},n([(0,i.jsonMember)({name:"group_name",constructor:String,preserveNull:!0}),o("design:type",String)],e.prototype,"groupName",void 0),n([(0,i.jsonArrayMember)(a.URef,{name:"group_users",serializer:function(e){return e.map(function(e){return e.toJSON()})},deserializer:function(e){if(e)return e.map(function(e){return a.URef.fromJSON(e)})}}),o("design:type",Array)],e.prototype,"groupUsers",void 0),t=n([i.jsonObject],e)}();t.ContractGroup=u;var c=function(){function e(e,t,r){this.contractHash=e,this.contractVersion=t,this.protocolVersionMajor=r}return n([(0,i.jsonMember)({name:"contract_hash",constructor:a.ContractHash,deserializer:function(e){return a.ContractHash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.ContractHash)],e.prototype,"contractHash",void 0),n([(0,i.jsonMember)({name:"contract_version",constructor:Number}),o("design:type",Number)],e.prototype,"contractVersion",void 0),n([(0,i.jsonMember)({name:"protocol_version_major",constructor:Number}),o("design:type",Number)],e.prototype,"protocolVersionMajor",void 0),n([i.jsonObject,o("design:paramtypes",[a.ContractHash,Number,Number])],e)}();t.ContractVersion=c;var f=function(){function e(e,t,r,n,o){this.accessKey=e,this.disabledVersions=t,this.groups=r,this.versions=n,this.lockStatus=o}return n([(0,i.jsonMember)({name:"access_key",constructor:a.URef,deserializer:function(e){return a.URef.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.URef)],e.prototype,"accessKey",void 0),n([(0,i.jsonArrayMember)(Number,{name:"disabled_versions",dimensions:2,deserializer:function(e){if(e)return(0,s.deserializeDisabledVersions)(e)}}),o("design:type",Array)],e.prototype,"disabledVersions",void 0),n([(0,i.jsonArrayMember)(u,{name:"groups",deserializer:function(e){if(e)return e.map(function(e){return u.fromJSON(e)})}}),o("design:type",Array)],e.prototype,"groups",void 0),n([(0,i.jsonArrayMember)(c,{name:"versions"}),o("design:type",Array)],e.prototype,"versions",void 0),n([(0,i.jsonMember)({name:"lock_status",constructor:String}),o("design:type",String)],e.prototype,"lockStatus",void 0),n([i.jsonObject,o("design:paramtypes",[a.URef,Array,Array,Array,String])],e)}();t.ContractPackage=f},5463:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.ContractWasm=void 0;var i=r(9592),a=function(){function e(e){this.bytes=e}return n([(0,i.jsonMember)({name:"bytes",constructor:String}),o("design:type",String)],e.prototype,"bytes",void 0),n([i.jsonObject,o("design:paramtypes",[String])],e)}();t.ContractWasm=a},7372:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.Conversions=void 0;var o=r(6077),i=function(){function e(){}return e.encodeBase64=function(e){return n.from(e).toString("base64")},e.decodeBase64=function(e){return new Uint8Array(n.from(e,"base64"))},e.base64to16=function(t){return e.encodeBase16(e.decodeBase64(t))},e.encodeBase16=function(e){return n.from(e).toString("hex")},e.decodeBase16=function(e){return new Uint8Array(n.from(e,"hex"))},e.csprToMotes=function(e){if("string"==typeof e&&!/^\d+(\.\d+)?$/.test(e))throw new Error("Invalid input: cspr must be a string representing a valid positive number.");var t=e.toString().split("."),r=t[0],n=t[1],i=void 0===n?"":n,a=o.BigNumber.from(r).mul(Math.pow(10,9));return i.length>0&&(i=(i+"000000000").slice(0,9),a=a.add(i)),a},e.motesToCSPR=function(e){var t=o.BigNumber.from(e);if(t.lt(0))throw new Error("Motes cannot be negative number");var r=t.toBigInt().toString(),n=r.slice(0,-9)||"0",i=r.slice(-9).padStart(9,"0");return"".concat(n,".").concat(i).replace(/\.?0+$/,"")},e}();t.Conversions=i},6694:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_DEPLOY_TTL=t.Deploy=t.DeployHeader=void 0;var i=r(9592),a=r(8905),s=r(3401),u=r(7889),c=r(9449),f=r(6500),l=r(9125),d=r(2151),h=r(3771),p=r(6200),y=r(7012),m=r(5731),b=r(2625),g=r(678),v=function(){function e(e,r,n,o,i,a,s){void 0===e&&(e=""),void 0===r&&(r=[]),void 0===n&&(n=1),void 0===o&&(o=new f.Timestamp(new Date)),void 0===i&&(i=new f.Duration(t.DEFAULT_DEPLOY_TTL)),this.chainName="",this.dependencies=[],this.gasPrice=1,this.timestamp=new f.Timestamp(new Date),this.ttl=new f.Duration(t.DEFAULT_DEPLOY_TTL),this.chainName=e,this.dependencies=r,this.gasPrice=n,this.timestamp=o,this.ttl=i,this.account=a,this.bodyHash=s}var r;return r=e,e.prototype.toBytes=function(){var e,t=this.dependencies.map(function(e){return e.toBytes()});return t.splice(0,0,(0,g.toBytesU32)(null===(e=this.dependencies)||void 0===e?void 0:e.length)),(0,a.concat)([this.account.bytes(),(0,g.toBytesU64)(Date.parse(this.timestamp.toJSON())),(0,g.toBytesU64)(this.ttl.duration),(0,g.toBytesU64)(this.gasPrice),this.bodyHash.toBytes(),(0,a.concat)(t),(0,g.toBytesString)(this.chainName)])},e.default=function(){return new r},n([(0,i.jsonMember)({constructor:c.PublicKey,deserializer:function(e){if(e)return c.PublicKey.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",c.PublicKey)],e.prototype,"account",void 0),n([(0,i.jsonMember)({name:"body_hash",constructor:s.Hash,deserializer:function(e){if(e)return s.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",s.Hash)],e.prototype,"bodyHash",void 0),n([(0,i.jsonMember)({name:"chain_name",constructor:String}),o("design:type",Object)],e.prototype,"chainName",void 0),n([(0,i.jsonArrayMember)(s.Hash,{name:"dependencies",serializer:function(e){return e.map(function(e){return e.toJSON()})},deserializer:function(e){return e.map(function(e){return s.Hash.fromJSON(e)})}}),o("design:type",Array)],e.prototype,"dependencies",void 0),n([(0,i.jsonMember)({name:"gas_price",constructor:Number}),o("design:type",Object)],e.prototype,"gasPrice",void 0),n([(0,i.jsonMember)({constructor:f.Timestamp,deserializer:function(e){return f.Timestamp.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",f.Timestamp)],e.prototype,"timestamp",void 0),n([(0,i.jsonMember)({constructor:f.Duration,deserializer:function(e){return f.Duration.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",f.Duration)],e.prototype,"ttl",void 0),r=n([i.jsonObject,o("design:paramtypes",[Object,Array,Object,f.Timestamp,f.Duration,c.PublicKey,s.Hash])],e)}();t.DeployHeader=v;var w=function(){function e(e,t,r,n,o){this.approvals=[],this.approvals=o,this.session=n,this.payment=r,this.header=t,this.hash=e}var t;return t=e,e.prototype.validate=function(){var e,t=this,r=this.payment.bytes(),n=this.session.bytes(),o=(0,a.concat)([r,n]),i=new s.Hash((0,g.byteHash)(o)),u=this.header.toBytes(),c=new s.Hash((0,g.byteHash)(u));if(!(null===(e=this.header.bodyHash)||void 0===e?void 0:e.equals(i))||!this.hash.equals(c))throw new Error("Invalid deploy hash or body hash");return this.approvals.forEach(function(e){if(!e.signer.verifySignature(t.hash.toBytes(),e.signature.bytes))throw new Error("Invalid approval signature")}),!0},e.prototype.sign=function(e){var t=e.signAndAddAlgorithmBytes(this.hash.toBytes()),r=new u.HexBytes(t);this.approvals.push(new l.Approval(e.publicKey,r))},e.prototype.toBytes=function(){return(0,a.concat)([this.header.toBytes(),this.hash.toBytes(),(0,a.concat)([this.payment.bytes(),this.session.bytes()]),l.Approval.toBytes(this.approvals)])},e.setSignature=function(e,t,r){var n=new u.HexBytes(t);return e.approvals.push(new l.Approval(r,n)),e},e.createNew=function(e,r,n,o,i){return void 0===i&&(i=[]),new t(e,r,n,o,i)},e.addArgToDeploy=function(e,r,n){if(0!==e.approvals.length)throw Error("Can not add argument to already signed deploy.");return e.session.setArg(r,n),t.makeDeploy(e.header,e.payment,e.session)},e.makeDeploy=function(e,r,n){var o=r.bytes(),i=n.bytes(),u=(0,a.concat)([o,i]);e.bodyHash=new s.Hash((0,g.byteHash)(u));var c=new s.Hash((0,g.byteHash)(e.toBytes()));return t.createNew(c,e,r,n)},e.newTransactionFromDeploy=function(e){var t,r,n,o=0;if(e.session.transfer)n=new d.TransactionEntryPoint(d.TransactionEntryPointEnum.Transfer);else if(e.session.moduleBytes)n=new d.TransactionEntryPoint(d.TransactionEntryPointEnum.Call);else{var i="";e.session.storedContractByHash?i=e.session.storedContractByHash.entryPoint:e.session.storedContractByName?i=e.session.storedContractByName.entryPoint:e.session.storedVersionedContractByHash?i=e.session.storedVersionedContractByHash.entryPoint:e.session.storedVersionedContractByName&&(i=e.session.storedVersionedContractByName.entryPoint),n=new d.TransactionEntryPoint(d.TransactionEntryPointEnum.Custom,i)}var a=e.payment.getArgs();if(a){var s=a.args.get("amount");s&&(o=parseInt(s.toString(),10)||0)}var u=0===(null===(t=e.payment.moduleBytes)||void 0===t?void 0:t.moduleBytes.length),c=new p.PricingMode,f=new p.PaymentLimitedMode;return f.gasPriceTolerance=null!==(r=e.header.gasPrice)&&void 0!==r?r:1,f.paymentAmount=o,f.standardPayment=u,c.paymentLimited=f,new l.Transaction(l.TransactionHash.fromDeployHash(e.hash),e.header.chainName,e.header.timestamp,e.header.ttl,new h.InitiatorAddr(e.header.account),c,e.session.getArgs(),y.TransactionTarget.newTransactionTargetFromSession(e.session),n,new m.TransactionScheduling({}),e.approvals,void 0,e)},e.fromJSON=function(e){var r,n,o,a,s,u,c;try{var f="string"==typeof e?JSON.parse(e):e,l=null!==(s=null!==(a=null!==(n=null!==(r=f.deploy)&&void 0!==r?r:f.Deploy)&&void 0!==n?n:null===(o=null==f?void 0:f.transaction)||void 0===o?void 0:o.Deploy)&&void 0!==a?a:f)&&void 0!==s?s:null;if(!(null==l?void 0:l.hash)||!(null===(u=null==l?void 0:l.header)||void 0===u?void 0:u.account))throw new Error("The JSON can't be parsed as a Deploy.");if(!(c=new i.TypedJSON(t).parse(l)))throw new Error("The JSON can't be parsed as a Deploy.")}catch(e){throw new Error("Serialization error: ".concat(e.message))}if(!c.validate())throw new Error("Deploy validation failed");return c},e.prototype.isTransfer=function(){return this.session.isTransfer()},e.prototype.isStandardPayment=function(){var e;return!!this.payment.isModuleBytes()&&0===(null===(e=this.payment.asModuleBytes())||void 0===e?void 0:e.moduleBytes.length)},e.toJSON=function(e){return new i.TypedJSON(t).toPlainJson(e)},e.getDeploySizeInBytes=function(e){var t=e.hash.toBytes().length,r=(0,a.concat)([e.payment.bytes(),e.session.bytes()]).length;return t+e.header.toBytes().length+r+e.approvals.map(function(e){return(e.signature.bytes.length+e.signer.bytes().length)/2}).reduce(function(e,t){return e+t},0)},n([(0,i.jsonArrayMember)(function(){return l.Approval}),o("design:type",Array)],e.prototype,"approvals",void 0),n([(0,i.jsonMember)({deserializer:function(e){return s.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.Hash)],e.prototype,"hash",void 0),n([(0,i.jsonMember)({constructor:v}),o("design:type",v)],e.prototype,"header",void 0),n([(0,i.jsonMember)({constructor:b.ExecutableDeployItem}),o("design:type",b.ExecutableDeployItem)],e.prototype,"payment",void 0),n([(0,i.jsonMember)({constructor:b.ExecutableDeployItem}),o("design:type",b.ExecutableDeployItem)],e.prototype,"session",void 0),t=n([i.jsonObject,o("design:paramtypes",[s.Hash,v,b.ExecutableDeployItem,b.ExecutableDeployItem,Array])],e)}();t.Deploy=w,t.DEFAULT_DEPLOY_TTL=18e5},402:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.DeployInfo=void 0;var i=r(9592),a=r(3401),s=function(){function e(){}return n([(0,i.jsonMember)({name:"deploy_hash",constructor:a.Hash,deserializer:function(e){return a.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.Hash)],e.prototype,"deployHash",void 0),n([(0,i.jsonMember)({name:"from",constructor:a.AccountHash,deserializer:function(e){return a.AccountHash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.AccountHash)],e.prototype,"from",void 0),n([(0,i.jsonMember)({name:"gas",constructor:String}),o("design:type",String)],e.prototype,"gas",void 0),n([(0,i.jsonMember)({name:"source",constructor:a.URef,deserializer:function(e){return a.URef.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.URef)],e.prototype,"source",void 0),n([(0,i.jsonArrayMember)(a.TransferHash,{name:"transfers",serializer:function(e){return e.map(function(e){return e.toJSON()})},deserializer:function(e){return e.map(function(e){return a.TransferHash.fromJSON(e)})}}),o("design:type",Array)],e.prototype,"transfers",void 0),n([i.jsonObject],e)}();t.DeployInfo=s},111:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.EntryPointValue=t.EntryPointV2=t.EntryPointV1=t.EntryPointArg=t.EntryPointPayment=t.EntryPointType=void 0;var i,a,s=r(9592),u=r(5466);(a=t.EntryPointType||(t.EntryPointType={})).Session="Session",a.Contract="Contract",a.Caller="Caller",a.Called="Called",a.Factory="Factory",(i=t.EntryPointPayment||(t.EntryPointPayment={})).Caller="Caller",i.DirectInvocationOnly="DirectInvocationOnly",i.SelfOnward="SelfOnward";var c=function(){function e(e,t){this.name=e,this.clType=t}return n([(0,s.jsonMember)({name:"name",constructor:String}),o("design:type",String)],e.prototype,"name",void 0),n([(0,s.jsonMember)({name:"cl_type",constructor:u.CLTypeRaw,deserializer:function(e){if(e)return u.CLTypeRaw.parseCLType(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.CLTypeRaw)],e.prototype,"clType",void 0),n([s.jsonObject,o("design:paramtypes",[String,u.CLTypeRaw])],e)}();t.EntryPointArg=c;var f=function(){function e(e,t,r,n,o,i){this.access=e,this.args=t,this.entryPointType=r,this.entryPointPayment=n,this.name=o,this.ret=i}return n([(0,s.jsonMember)({name:"access",constructor:s.AnyT}),o("design:type",Object)],e.prototype,"access",void 0),n([(0,s.jsonArrayMember)(c,{name:"args"}),o("design:type",Array)],e.prototype,"args",void 0),n([(0,s.jsonMember)({name:"entry_point_type",constructor:String}),o("design:type",String)],e.prototype,"entryPointType",void 0),n([(0,s.jsonMember)({name:"entry_point_payment",constructor:String}),o("design:type",String)],e.prototype,"entryPointPayment",void 0),n([(0,s.jsonMember)({name:"name",constructor:String}),o("design:type",String)],e.prototype,"name",void 0),n([(0,s.jsonMember)({name:"ret",constructor:u.CLTypeRaw,deserializer:function(e){if(e)return u.CLTypeRaw.parseCLType(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.CLTypeRaw)],e.prototype,"ret",void 0),n([s.jsonObject,o("design:paramtypes",[Object,Array,String,String,String,u.CLTypeRaw])],e)}();t.EntryPointV1=f;var l=function(){function e(e,t){void 0===e&&(e=0),void 0===t&&(t=0),this.flags=e,this.functionIndex=t}return n([(0,s.jsonMember)({name:"flags",constructor:Number}),o("design:type",Number)],e.prototype,"flags",void 0),n([(0,s.jsonMember)({name:"functionIndex",constructor:Number}),o("design:type",Number)],e.prototype,"functionIndex",void 0),n([s.jsonObject,o("design:paramtypes",[Object,Object])],e)}();t.EntryPointV2=l;var d=function(){function e(e,t){this.v1CasperVm=e,this.v2CasperVm=t}return n([(0,s.jsonMember)({name:"V1CasperVm",constructor:f}),o("design:type",f)],e.prototype,"v1CasperVm",void 0),n([(0,s.jsonMember)({name:"V2CasperVm",constructor:l}),o("design:type",l)],e.prototype,"v2CasperVm",void 0),n([s.jsonObject,o("design:paramtypes",[f,l])],e)}();t.EntryPointValue=d},6722:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.EraEnd=t.EraEndV1=t.EraEndV2=t.EraReport=t.EraReward=void 0;var i=r(9592),a=r(9449),s=r(6459),u=r(5466),c=r(2428),f=function(){function e(e,t){this.validator=e,this.amount=t}return n([(0,i.jsonMember)({name:"validator",constructor:a.PublicKey,deserializer:function(e){return a.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.PublicKey)],e.prototype,"validator",void 0),n([(0,i.jsonMember)({name:"amount",constructor:u.CLValueUInt512,deserializer:function(e){return u.CLValueUInt512.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",u.CLValueUInt512)],e.prototype,"amount",void 0),n([i.jsonObject,o("design:paramtypes",[a.PublicKey,u.CLValueUInt512])],e)}();t.EraReward=f;var l=function(){function e(e,t,r){void 0===e&&(e=[]),void 0===t&&(t=[]),void 0===r&&(r=[]),this.equivocators=e,this.inactiveValidators=t,this.rewards=r}return n([(0,i.jsonArrayMember)(a.PublicKey,{name:"equivocators",serializer:function(e){return e.map(function(e){return e.toJSON()})},deserializer:function(e){return e.map(function(e){return a.PublicKey.fromJSON(e)})}}),o("design:type",Array)],e.prototype,"equivocators",void 0),n([(0,i.jsonArrayMember)(a.PublicKey,{name:"inactive_validators",serializer:function(e){return e.map(function(e){return e.toJSON()})},deserializer:function(e){return e.map(function(e){return a.PublicKey.fromJSON(e)})}}),o("design:type",Array)],e.prototype,"inactiveValidators",void 0),n([(0,i.jsonArrayMember)(f,{name:"rewards"}),o("design:type",Array)],e.prototype,"rewards",void 0),n([i.jsonObject,o("design:paramtypes",[Array,Array,Array])],e)}();t.EraReport=l;var d=function(){function e(e,t,r,n,o){this.equivocators=e,this.inactiveValidators=t,this.nextEraValidatorWeights=r,this.rewards=n,this.nextEraGasPrice=o}return n([(0,i.jsonArrayMember)(a.PublicKey,{name:"equivocators",serializer:function(e){return e.map(function(e){return e.toJSON()})},deserializer:function(e){return e.map(function(e){return a.PublicKey.fromJSON(e)})}}),o("design:type",Array)],e.prototype,"equivocators",void 0),n([(0,i.jsonArrayMember)(a.PublicKey,{name:"inactive_validators",serializer:function(e){return e.map(function(e){return e.toJSON()})},deserializer:function(e){return e.map(function(e){return a.PublicKey.fromJSON(e)})}}),o("design:type",Array)],e.prototype,"inactiveValidators",void 0),n([(0,i.jsonArrayMember)(s.ValidatorWeightEraEnd,{name:"next_era_validator_weights"}),o("design:type",Array)],e.prototype,"nextEraValidatorWeights",void 0),n([(0,i.jsonMapMember)(String,Array,{name:"rewards",serializer:function(e){return(0,c.serializeRewards)(e)},deserializer:c.deserializeRewards}),o("design:type",Map)],e.prototype,"rewards",void 0),n([(0,i.jsonMember)({name:"next_era_gas_price",constructor:Number}),o("design:type",Number)],e.prototype,"nextEraGasPrice",void 0),n([i.jsonObject,o("design:paramtypes",[Array,Array,Array,Map,Number])],e)}();t.EraEndV2=d;var h=function(){function e(e,t){this.eraReport=e,this.nextEraValidatorWeights=t}return n([(0,i.jsonMember)({name:"era_report",constructor:l}),o("design:type",l)],e.prototype,"eraReport",void 0),n([(0,i.jsonArrayMember)(s.ValidatorWeightEraEnd,{name:"next_era_validator_weights"}),o("design:type",Array)],e.prototype,"nextEraValidatorWeights",void 0),n([i.jsonObject,o("design:paramtypes",[l,Array])],e)}();t.EraEndV1=h;var p=function(){function e(e,t,r,n,o){void 0===e&&(e=[]),void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===n&&(n=new Map),void 0===o&&(o=1),this.equivocators=e,this.inactiveValidators=t,this.nextEraValidatorWeights=r,this.rewards=n,this.nextEraGasPrice=o}var t;return t=e,e.fromV2=function(e){if(!e)return null;var r=new t;return r.nextEraGasPrice=e.nextEraGasPrice,r.equivocators=e.equivocators,r.inactiveValidators=e.inactiveValidators,r.nextEraValidatorWeights=e.nextEraValidatorWeights,r.rewards=e.rewards,r},e.fromV1=function(e){var r;if(!e)return null;for(var n=new Map,o=0,i=e.eraReport.rewards;o<i.length;o++){var a=i[o],s=a.validator.toHex();n.has(s)||n.set(s,[]),null===(r=n.get(s))||void 0===r||r.push(a.amount)}var u=new t;return u.nextEraGasPrice=1,u.equivocators=e.eraReport.equivocators,u.inactiveValidators=e.eraReport.inactiveValidators,u.nextEraValidatorWeights=e.nextEraValidatorWeights,u.rewards=n,u},n([(0,i.jsonArrayMember)(a.PublicKey,{name:"equivocators",serializer:function(e){return e.map(function(e){return e.toJSON()})},deserializer:function(e){return e.map(function(e){return a.PublicKey.fromJSON(e)})}}),o("design:type",Array)],e.prototype,"equivocators",void 0),n([(0,i.jsonArrayMember)(a.PublicKey,{name:"inactive_validators",serializer:function(e){return e.map(function(e){return e.toJSON()})},deserializer:function(e){return e.map(function(e){return a.PublicKey.fromJSON(e)})}}),o("design:type",Array)],e.prototype,"inactiveValidators",void 0),n([(0,i.jsonArrayMember)(s.ValidatorWeightEraEnd,{name:"next_era_validator_weights"}),o("design:type",Array)],e.prototype,"nextEraValidatorWeights",void 0),n([(0,i.jsonMapMember)(String,u.CLValueUInt512,{name:"rewards",deserializer:c.deserializeRewards,serializer:function(e){return(0,c.serializeRewards)(e)}}),o("design:type",Map)],e.prototype,"rewards",void 0),n([(0,i.jsonMember)({name:"next_era_gas_price",constructor:Number}),o("design:type",Number)],e.prototype,"nextEraGasPrice",void 0),t=n([i.jsonObject,o("design:paramtypes",[Array,Array,Array,Map,Object])],e)}();t.EraEnd=p},5495:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.EraInfo=t.SeigniorageAllocation=t.DelegatorData=t.ValidatorAllocation=t.DelegatorAllocation=void 0;var i=r(9592),a=r(9449),s=r(5466),u=r(2142),c=function(){function e(e,t,r){this.delegatorKind=e,this.validatorPublicKey=t,this.amount=r}return n([(0,i.jsonMember)({name:"delegator_kind",constructor:u.DelegationKind,deserializer:function(e){if(e)return u.DelegationKind.fromJSON(e)}}),o("design:type",u.DelegationKind)],e.prototype,"delegatorKind",void 0),n([(0,i.jsonMember)({name:"validator_public_key",constructor:a.PublicKey,deserializer:function(e){return a.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.PublicKey)],e.prototype,"validatorPublicKey",void 0),n([(0,i.jsonMember)({name:"amount",constructor:s.CLValueUInt512,deserializer:function(e){return s.CLValueUInt512.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.CLValueUInt512)],e.prototype,"amount",void 0),n([i.jsonObject,o("design:paramtypes",[u.DelegationKind,a.PublicKey,s.CLValueUInt512])],e)}();t.DelegatorAllocation=c;var f=function(){function e(e,t){this.validatorPublicKey=e,this.amount=t}return n([(0,i.jsonMember)({name:"validator_public_key",constructor:a.PublicKey,deserializer:function(e){if(e)return a.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.PublicKey)],e.prototype,"validatorPublicKey",void 0),n([(0,i.jsonMember)({name:"amount",constructor:s.CLValueUInt512,deserializer:function(e){if(e)return s.CLValueUInt512.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.CLValueUInt512)],e.prototype,"amount",void 0),n([i.jsonObject,o("design:paramtypes",[a.PublicKey,s.CLValueUInt512])],e)}();t.ValidatorAllocation=f;var l=function(){function e(){}return n([(0,i.jsonMember)({name:"delegator_public_key",constructor:a.PublicKey,deserializer:function(e){if(e)return a.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.PublicKey)],e.prototype,"delegatorPublicKey",void 0),n([(0,i.jsonMember)({name:"validator_public_key",constructor:a.PublicKey,deserializer:function(e){if(e)return a.PublicKey.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",a.PublicKey)],e.prototype,"validatorPublicKey",void 0),n([(0,i.jsonMember)({name:"amount",constructor:s.CLValueUInt512,deserializer:function(e){return s.CLValueUInt512.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.CLValueUInt512)],e.prototype,"amount",void 0),n([i.jsonObject],e)}();t.DelegatorData=l;var d=function(){function e(){}return n([(0,i.jsonMember)({name:"Validator",constructor:f}),o("design:type",f)],e.prototype,"validator",void 0),n([(0,i.jsonMember)({name:"DelegatorKind",constructor:c}),o("design:type",c)],e.prototype,"delegatorKind",void 0),n([(0,i.jsonMember)({name:"Delegator",constructor:l}),o("design:type",l)],e.prototype,"delegator",void 0),n([i.jsonObject],e)}(),h=function(){function e(e,t){this.validator=e,this.delegator=t}var t;return t=e,e.fromJSON=function(e){var r,n,o;if(!e)throw new Error("Invalid JSON for SeigniorageAllocation: ".concat(e));var a=new i.TypedJSON(d).parse(e);if(!a)throw new Error("Failed to parse JSON");var s=new t;if(null==a?void 0:a.delegator){var f=new u.DelegationKind;f.publicKey=null===(r=null==a?void 0:a.delegator)||void 0===r?void 0:r.delegatorPublicKey,s.delegator=new c(f,null===(n=null==a?void 0:a.delegator)||void 0===n?void 0:n.validatorPublicKey,null===(o=null==a?void 0:a.delegator)||void 0===o?void 0:o.amount)}else if(a.validator)s.validator=a.validator;else{if(!a.delegatorKind)throw new Error("incorrect SeigniorageAllocation format structure");s.delegator=a.delegatorKind}return s},n([(0,i.jsonMember)({name:"Validator",constructor:f}),o("design:type",f)],e.prototype,"validator",void 0),n([(0,i.jsonMember)({name:"DelegatorKind",constructor:c}),o("design:type",c)],e.prototype,"delegator",void 0),t=n([i.jsonObject,o("design:paramtypes",[f,c])],e)}();t.SeigniorageAllocation=h;var p=function(){function e(e){void 0===e&&(e=[]),this.seigniorageAllocations=e}return n([(0,i.jsonArrayMember)(h,{name:"seigniorage_allocations",deserializer:function(e){if(e)return e.map(function(e){return h.fromJSON(e)})}}),o("design:type",Array)],e.prototype,"seigniorageAllocations",void 0),n([i.jsonObject,o("design:paramtypes",[Array])],e)}();t.EraInfo=p},8179:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.EraSummary=void 0;var i=r(9592),a=r(3401),s=r(121),u=function(){function e(e,t,r,n,o){this.blockHash=e,this.eraID=t,this.storedValue=r,this.stateRootHash=n,this.merkleProof=o}return n([(0,i.jsonMember)({name:"block_hash",constructor:a.Hash,deserializer:function(e){return a.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.Hash)],e.prototype,"blockHash",void 0),n([(0,i.jsonMember)({name:"era_id",constructor:Number}),o("design:type",Number)],e.prototype,"eraID",void 0),n([(0,i.jsonMember)({name:"stored_value",constructor:s.StoredValue}),o("design:type",s.StoredValue)],e.prototype,"storedValue",void 0),n([(0,i.jsonMember)({name:"state_root_hash",constructor:a.Hash,deserializer:function(e){return a.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.Hash)],e.prototype,"stateRootHash",void 0),n([(0,i.jsonMember)({name:"merkle_proof",constructor:String}),o("design:type",String)],e.prototype,"merkleProof",void 0),n([i.jsonObject,o("design:paramtypes",[a.Hash,Number,s.StoredValue,a.Hash,String])],e)}();t.EraSummary=u},2625:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.ExecutableDeployItem=t.TransferDeployItem=t.StoredVersionedContractByName=t.StoredVersionedContractByHash=t.StoredContractByName=t.StoredContractByHash=t.ModuleBytes=void 0;var i,a=r(9592),s=r(6077),u=r(8905),c=r(9960),f=r(5466),l=r(3401),d=r(2428),h=r(9449);!function(e){e[e.ModuleBytes=0]="ModuleBytes",e[e.StoredContractByHash=1]="StoredContractByHash",e[e.StoredContractByName=2]="StoredContractByName",e[e.StoredVersionedContractByHash=3]="StoredVersionedContractByHash",e[e.StoredVersionedContractByName=4]="StoredVersionedContractByName",e[e.Transfer=5]="Transfer"}(i||(i={}));var p=function(){function e(e,t){this.moduleBytes=e,this.args=t}return e.prototype.bytes=function(){var e=f.CLValue.newCLUInt32(s.BigNumber.from(this.moduleBytes.length)).bytes(),t=f.CLValue.newCLByteArray(this.moduleBytes).bytes(),r=(0,u.concat)([e,t]);if(this.args){var n=this.args.toBytes();r=(0,u.concat)([r,n])}return r},n([(0,a.jsonMember)({name:"module_bytes",constructor:Uint8Array,serializer:function(e){return(0,d.byteArrayJsonSerializer)(e)},deserializer:d.byteArrayJsonDeserializer}),o("design:type",Uint8Array)],e.prototype,"moduleBytes",void 0),n([(0,a.jsonMember)(function(){return c.Args},{deserializer:d.deserializeArgs,serializer:function(e){return(0,d.serializeArgs)(e,!1)}}),o("design:type",c.Args)],e.prototype,"args",void 0),n([a.jsonObject,o("design:paramtypes",[Uint8Array,c.Args])],e)}();t.ModuleBytes=p;var y=function(){function e(e,t,r){this.hash=e,this.entryPoint=t,this.args=r}return e.prototype.bytes=function(){var e=this.hash.hash.toBytes(),t=f.CLValue.newCLString(this.entryPoint).bytes(),r=this.args.toBytes();return(0,u.concat)([e,t,r])},n([(0,a.jsonMember)({name:"hash",constructor:l.ContractHash,deserializer:function(e){return l.ContractHash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",l.ContractHash)],e.prototype,"hash",void 0),n([(0,a.jsonMember)({name:"entry_point",constructor:String}),o("design:type",String)],e.prototype,"entryPoint",void 0),n([(0,a.jsonMember)(function(){return c.Args},{deserializer:d.deserializeArgs,serializer:function(e){return(0,d.serializeArgs)(e,!1)}}),o("design:type",c.Args)],e.prototype,"args",void 0),n([a.jsonObject,o("design:paramtypes",[l.ContractHash,String,c.Args])],e)}();t.StoredContractByHash=y;var m=function(){function e(e,t,r){this.name=e,this.entryPoint=t,this.args=r}return e.prototype.bytes=function(){var e=f.CLValue.newCLString(this.name).bytes(),t=f.CLValue.newCLString(this.entryPoint).bytes(),r=this.args.toBytes();return(0,u.concat)([e,t,r])},n([(0,a.jsonMember)({name:"name",constructor:String}),o("design:type",String)],e.prototype,"name",void 0),n([(0,a.jsonMember)({name:"entry_point",constructor:String}),o("design:type",String)],e.prototype,"entryPoint",void 0),n([(0,a.jsonMember)(function(){return c.Args},{deserializer:d.deserializeArgs,serializer:function(e){return(0,d.serializeArgs)(e,!1)}}),o("design:type",c.Args)],e.prototype,"args",void 0),n([a.jsonObject,o("design:paramtypes",[String,String,c.Args])],e)}();t.StoredContractByName=m;var b=function(){function e(e,t,r,n){this.hash=e,this.entryPoint=t,this.version=n,this.args=r}return e.prototype.bytes=function(){var e,t=this.hash.hash.toBytes(),r=new f.CLValueOption(this.version?f.CLValue.newCLUInt32(s.BigNumber.from(this.version)):null).bytes(),n=f.CLValue.newCLString(this.entryPoint).bytes(),o=(null===(e=this.args)||void 0===e?void 0:e.toBytes())||new Uint8Array;return(0,u.concat)([t,r,n,o])},n([(0,a.jsonMember)({name:"hash",constructor:l.ContractHash,deserializer:function(e){return l.ContractHash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",l.ContractHash)],e.prototype,"hash",void 0),n([(0,a.jsonMember)({name:"entry_point",constructor:String}),o("design:type",String)],e.prototype,"entryPoint",void 0),n([(0,a.jsonMember)(function(){return c.Args},{deserializer:d.deserializeArgs,serializer:function(e){return(0,d.serializeArgs)(e,!1)}}),o("design:type",c.Args)],e.prototype,"args",void 0),n([(0,a.jsonMember)({name:"version",constructor:Number}),o("design:type",Number)],e.prototype,"version",void 0),n([a.jsonObject,o("design:paramtypes",[l.ContractHash,String,c.Args,Number])],e)}();t.StoredVersionedContractByHash=b;var g=function(){function e(e,t,r,n){this.name=e,this.entryPoint=t,this.version=n,this.args=r}return e.prototype.bytes=function(){var e,t=f.CLValue.newCLString(this.name).bytes(),r=new f.CLValueOption(this.version?f.CLValue.newCLUInt32(s.BigNumber.from(this.version)):null).bytes(),n=f.CLValue.newCLString(this.entryPoint).bytes(),o=(null===(e=this.args)||void 0===e?void 0:e.toBytes())||new Uint8Array;return(0,u.concat)([t,r,n,o])},n([(0,a.jsonMember)({name:"name",constructor:String}),o("design:type",String)],e.prototype,"name",void 0),n([(0,a.jsonMember)({name:"entry_point",constructor:String}),o("design:type",String)],e.prototype,"entryPoint",void 0),n([(0,a.jsonMember)({name:"version",constructor:Number}),o("design:type",Number)],e.prototype,"version",void 0),n([(0,a.jsonMember)(function(){return c.Args},{deserializer:d.deserializeArgs,serializer:function(e){return(0,d.serializeArgs)(e,!1)}}),o("design:type",c.Args)],e.prototype,"args",void 0),n([a.jsonObject,o("design:paramtypes",[String,String,c.Args,Number])],e)}();t.StoredVersionedContractByName=g;var v=function(){function e(e){this.args=e}var t;return t=e,e.newTransfer=function(e,r,n,o){void 0===n&&(n=null);var i=c.Args.fromMap({});if(i.insert("amount",f.CLValue.newCLUInt512(e)),n&&i.insert("source",f.CLValue.newCLUref(n)),r instanceof l.URef)i.insert("target",f.CLValue.newCLUref(r));else{if(!(r instanceof h.PublicKey))throw new Error("Please specify target");i.insert("target",f.CLValue.newCLPublicKey(r))}var a=new f.CLTypeOption(f.CLTypeUInt64),s=new f.CLValue(a);return s.option=new f.CLValueOption(null,a),i.insert("id",o?f.CLValue.newCLOption(f.CLValue.newCLUint64(o)):s),new t(i)},e.prototype.bytes=function(){return this.args.toBytes()},n([(0,a.jsonMember)(function(){return c.Args},{deserializer:d.deserializeArgs,serializer:function(e){return(0,d.serializeArgs)(e,!1)}}),o("design:type",c.Args)],e.prototype,"args",void 0),t=n([a.jsonObject,o("design:paramtypes",[c.Args])],e)}();t.TransferDeployItem=v;var w=function(){function e(){}var t;return t=e,e.prototype.getArgByName=function(e){return this.getArgs().args.get(e)},e.prototype.setArg=function(e,t){this.getArgs().insert(e,t)},e.prototype.getArgs=function(){if(this.moduleBytes)return this.moduleBytes.args;if(this.storedContractByHash)return this.storedContractByHash.args;if(this.storedContractByName)return this.storedContractByName.args;if(this.storedVersionedContractByHash)return this.storedVersionedContractByHash.args;if(this.storedVersionedContractByName)return this.storedVersionedContractByName.args;if(this.transfer)return this.transfer.args;throw new Error("failed to serialize ExecutableDeployItemJsonWrapper")},e.prototype.bytes=function(){var e;return this.moduleBytes?(e=this.moduleBytes.bytes(),(0,u.concat)([Uint8Array.of(i.ModuleBytes),e])):this.storedContractByHash?(e=this.storedContractByHash.bytes(),(0,u.concat)([Uint8Array.of(i.StoredContractByHash),e])):this.storedContractByName?(e=this.storedContractByName.bytes(),(0,u.concat)([Uint8Array.of(i.StoredContractByName),e])):this.storedVersionedContractByHash?(e=this.storedVersionedContractByHash.bytes(),(0,u.concat)([Uint8Array.of(i.StoredVersionedContractByHash),e])):this.storedVersionedContractByName?(e=this.storedVersionedContractByName.bytes(),(0,u.concat)([Uint8Array.of(i.StoredVersionedContractByName),e])):this.transfer?(e=this.transfer.bytes(),(0,u.concat)([Uint8Array.of(i.Transfer),e])):new Uint8Array},e.standardPayment=function(e){var r=new t;return r.moduleBytes=new p(Uint8Array.from([]),c.Args.fromMap({amount:f.CLValue.newCLUInt512(e)})),r},e.prototype.asModuleBytes=function(){return this.moduleBytes},e.prototype.isTransfer=function(){return!!this.transfer},e.prototype.isStoredVersionContractByHash=function(){return!!this.storedVersionedContractByHash},e.prototype.isStoredVersionContractByName=function(){return!!this.storedVersionedContractByName},e.prototype.isStoredContractByName=function(){return!!this.storedContractByName},e.prototype.isStoredContractByHash=function(){return!!this.storedContractByHash},e.prototype.isModuleBytes=function(){return!!this.moduleBytes},e.newModuleBytes=function(e,r){var n=new t;return n.moduleBytes=new p(e,r),n},n([(0,a.jsonMember)({name:"ModuleBytes",constructor:p}),o("design:type",p)],e.prototype,"moduleBytes",void 0),n([(0,a.jsonMember)({name:"StoredContractByHash",constructor:y}),o("design:type",y)],e.prototype,"storedContractByHash",void 0),n([(0,a.jsonMember)({name:"StoredContractByName",constructor:m}),o("design:type",m)],e.prototype,"storedContractByName",void 0),n([(0,a.jsonMember)({name:"StoredVersionedContractByHash",constructor:b}),o("design:type",b)],e.prototype,"storedVersionedContractByHash",void 0),n([(0,a.jsonMember)({name:"StoredVersionedContractByName",constructor:g}),o("design:type",g)],e.prototype,"storedVersionedContractByName",void 0),n([(0,a.jsonMember)({name:"Transfer",constructor:v}),o("design:type",v)],e.prototype,"transfer",void 0),t=n([a.jsonObject],e)}();t.ExecutableDeployItem=w},4410:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.DeployExecutionInfo=t.ExecutionInfo=t.SpeculativeExecutionResult=t.ExecutionResult=t.DeployExecutionResult=t.ExecutionResultV1=t.ExecutionResultV2=t.ExecutionResultStatusData=t.Effect=t.Operation=void 0;var i=r(9592),a=r(6077),s=r(3401),u=r(3771),c=r(6838),f=r(8057),l=r(9125),d=r(3903),h=function(){function e(){}return n([(0,i.jsonMember)({name:"key",constructor:s.Key,deserializer:function(e){if(e)return s.Key.newKey(e)},serializer:function(e){if(e)return e.toPrefixedString()}}),o("design:type",s.Key)],e.prototype,"key",void 0),n([(0,i.jsonMember)({name:"kind",constructor:String}),o("design:type",String)],e.prototype,"kind",void 0),n([i.jsonObject],e)}();t.Operation=h;var p=function(){function e(){this.operations=[],this.transforms=[]}return n([(0,i.jsonArrayMember)(h,{name:"operations"}),o("design:type",Array)],e.prototype,"operations",void 0),n([(0,i.jsonArrayMember)(f.TransformKey,{name:"transforms"}),o("design:type",Array)],e.prototype,"transforms",void 0),n([i.jsonObject],e)}();t.Effect=p;var y=function(){function e(){this.transfers=[]}return n([(0,i.jsonMember)({name:"effect",constructor:p}),o("design:type",p)],e.prototype,"effect",void 0),n([(0,i.jsonArrayMember)(s.TransferHash,{name:"transfers",serializer:function(e){return e.map(function(e){return e.toJSON()})},deserializer:function(e){return e.map(function(e){return s.TransferHash.fromJSON(e)})}}),o("design:type",Array)],e.prototype,"transfers",void 0),n([(0,i.jsonMember)({name:"cost",constructor:Number,deserializer:function(e){if(e)return a.BigNumber.from(e).toNumber()},serializer:function(e){return a.BigNumber.from(e).toString()}}),o("design:type",Number)],e.prototype,"cost",void 0),n([(0,i.jsonMember)({name:"error_message",constructor:String}),o("design:type",String)],e.prototype,"errorMessage",void 0),n([i.jsonObject],e)}();t.ExecutionResultStatusData=y;var m=function(){function e(){this.transfers=[],this.effects=[]}return n([(0,i.jsonMember)({name:"initiator",constructor:u.InitiatorAddr,deserializer:function(e){return u.InitiatorAddr.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",u.InitiatorAddr)],e.prototype,"initiator",void 0),n([(0,i.jsonMember)({name:"error_message",constructor:String,preserveNull:!0}),o("design:type",String)],e.prototype,"errorMessage",void 0),n([(0,i.jsonMember)({name:"limit",constructor:Number,deserializer:function(e){if(e)return a.BigNumber.from(e).toNumber()},serializer:function(e){if(e)return a.BigNumber.from(e).toString()}}),o("design:type",Number)],e.prototype,"limit",void 0),n([(0,i.jsonMember)({name:"consumed",constructor:Number,deserializer:function(e){return a.BigNumber.from(e).toNumber()},serializer:function(e){return a.BigNumber.from(e).toString()}}),o("design:type",Number)],e.prototype,"consumed",void 0),n([(0,i.jsonMember)({constructor:Number,deserializer:function(e){if(e)return a.BigNumber.from(e).toNumber()},serializer:function(e){if(e)return a.BigNumber.from(e).toString()}}),o("design:type",Number)],e.prototype,"refund",void 0),n([(0,i.jsonMember)({constructor:Number,name:"current_price"}),o("design:type",Number)],e.prototype,"currentPrice",void 0),n([(0,i.jsonMember)({name:"cost",constructor:Number,deserializer:function(e){if(e)return a.BigNumber.from(e).toNumber()},serializer:function(e){if(e)return a.BigNumber.from(e).toString()}}),o("design:type",Number)],e.prototype,"cost",void 0),n([(0,i.jsonMember)({name:"payment",constructor:i.AnyT}),o("design:type",Object)],e.prototype,"payment",void 0),n([(0,i.jsonArrayMember)(c.Transfer,{name:"transfers",deserializer:function(e){return e.map(function(e){return c.Transfer.fromJSON(e)})}}),o("design:type",Array)],e.prototype,"transfers",void 0),n([(0,i.jsonMember)({name:"size_estimate",constructor:Number}),o("design:type",Number)],e.prototype,"sizeEstimate",void 0),n([(0,i.jsonArrayMember)(f.Transform,{name:"effects"}),o("design:type",Array)],e.prototype,"effects",void 0),n([i.jsonObject],e)}();t.ExecutionResultV2=m;var b=function(){function e(){}return n([(0,i.jsonMember)({name:"Success",constructor:y}),o("design:type",y)],e.prototype,"success",void 0),n([(0,i.jsonMember)({name:"Failure",constructor:y}),o("design:type",y)],e.prototype,"failure",void 0),n([i.jsonObject],e)}();t.ExecutionResultV1=b;var g=function(){function e(){}return n([(0,i.jsonMember)({name:"block_hash",constructor:s.Hash,deserializer:function(e){return s.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.Hash)],e.prototype,"blockHash",void 0),n([(0,i.jsonMember)({name:"result",constructor:b}),o("design:type",b)],e.prototype,"result",void 0),n([i.jsonObject],e)}();t.DeployExecutionResult=g;var v=function(){function e(){this.transfers=[],this.effects=[]}var t;return t=e,e.fromJSON=function(e){if(null==e?void 0:e.Version2){var r=i.TypedJSON.parse(e.Version2,m);if(r){var n=new t;return n.initiator=r.initiator,n.errorMessage=r.errorMessage,n.limit=r.limit,n.consumed=r.consumed,n.cost=r.cost,n.payment=r.payment,n.transfers=r.transfers,n.sizeEstimate=r.sizeEstimate,n.effects=r.effects,n.currentPrice=null==r?void 0:r.currentPrice,n.refund=null==r?void 0:r.refund,n.originExecutionResultV2=r,n}}else if(null==e?void 0:e.Version1){var o=i.TypedJSON.parse(e.Version1,b);if(o)return t.fromV1(o)}throw new Error("Incorrect RPC response structure")},e.fromV1=function(e){var r=new t,n=[],o=[];if(e.success){for(var i=0,a=e.success.effect.transforms;i<a.length;i++){var s=a[i];if(n.push(new f.Transform(s.key,s.transform)),s.transform.isWriteTransfer()){var d=s.transform.parseAsWriteTransfer();if(d){var h=new c.Transfer;h.amount=d.amount,h.transactionHash=l.TransactionHash.fromDeployHash(null==d?void 0:d.deployHash),h.from=new u.InitiatorAddr(void 0,d.from),h.gas=d.gas,h.id=d.id,h.source=d.source,h.target=d.target,h.to=d.to,o.push(h)}}}return r.limit=0,r.consumed=e.success.cost,r.cost=e.success.cost,r.payment=null,r.transfers=o,r.effects=n,r.refund=0,r.currentPrice=1,r.originExecutionResultV1=e,r}if(e.failure){for(var p=0,y=e.failure.effect.transforms;p<y.length;p++)s=y[p],n.push(new f.Transform(s.key,s.transform));return r.errorMessage=e.failure.errorMessage,r.consumed=e.failure.cost,r.effects=n,r.originExecutionResultV1=e,r}throw new Error("Invalid ExecutionResultV1 structure")},e.toJSON=function(e){return new i.TypedJSON(t).toPlainJson(e)},n([(0,i.jsonMember)({constructor:u.InitiatorAddr,deserializer:function(e){if(e)return u.InitiatorAddr.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",u.InitiatorAddr)],e.prototype,"initiator",void 0),n([(0,i.jsonMember)({name:"error_message",constructor:String,preserveNull:!0}),o("design:type",String)],e.prototype,"errorMessage",void 0),n([(0,i.jsonMember)({constructor:Number,deserializer:function(e){if(e)return a.BigNumber.from(e).toNumber()},serializer:function(e){return a.BigNumber.from(e).toString()}}),o("design:type",Number)],e.prototype,"limit",void 0),n([(0,i.jsonMember)({constructor:Number,deserializer:function(e){if(e)return a.BigNumber.from(e).toNumber()},serializer:function(e){if(e)return a.BigNumber.from(e).toString()}}),o("design:type",Number)],e.prototype,"consumed",void 0),n([(0,i.jsonMember)({constructor:Number,deserializer:function(e){if(e)return a.BigNumber.from(e).toNumber()},serializer:function(e){if(e)return a.BigNumber.from(e).toString()}}),o("design:type",Number)],e.prototype,"refund",void 0),n([(0,i.jsonMember)({constructor:Number,name:"current_price"}),o("design:type",Number)],e.prototype,"currentPrice",void 0),n([(0,i.jsonMember)({constructor:Number,deserializer:function(e){if(e)return a.BigNumber.from(e).toNumber()},serializer:function(e){return a.BigNumber.from(e).toString()}}),o("design:type",Number)],e.prototype,"cost",void 0),n([(0,i.jsonMember)({constructor:i.AnyT}),o("design:type",Object)],e.prototype,"payment",void 0),n([(0,i.jsonArrayMember)(c.Transfer,{name:"transfers",deserializer:function(e){return e.map(function(e){return c.Transfer.fromJSON(e)})}}),o("design:type",Array)],e.prototype,"transfers",void 0),n([(0,i.jsonMember)({constructor:Number}),o("design:type",Number)],e.prototype,"sizeEstimate",void 0),n([(0,i.jsonArrayMember)(f.Transform,{name:"effects"}),o("design:type",Array)],e.prototype,"effects",void 0),t=n([i.jsonObject],e)}();t.ExecutionResult=v;var w=function(){function e(){this.transfers=[],this.effects=[]}return n([(0,i.jsonMember)({constructor:s.Hash,name:"block_hash",deserializer:function(e){if(e)return s.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.Hash)],e.prototype,"blockHash",void 0),n([(0,i.jsonArrayMember)(c.Transfer,{name:"transfers",deserializer:function(e){return e.map(function(e){return c.Transfer.fromJSON(e)})}}),o("design:type",Array)],e.prototype,"transfers",void 0),n([(0,i.jsonMember)({name:"limit",constructor:Number,deserializer:function(e){if(e)return a.BigNumber.from(e).toNumber()},serializer:function(e){if(e)return a.BigNumber.from(e).toString()}}),o("design:type",Number)],e.prototype,"limit",void 0),n([(0,i.jsonMember)({name:"consumed",constructor:Number,deserializer:function(e){if(e)return a.BigNumber.from(e).toNumber()},serializer:function(e){return a.BigNumber.from(e).toString()}}),o("design:type",Number)],e.prototype,"consumed",void 0),n([(0,i.jsonArrayMember)(f.Transform,{name:"effects"}),o("design:type",Array)],e.prototype,"effects",void 0),n([(0,i.jsonArrayMember)(d.Message,{name:"messages"}),o("design:type",Array)],e.prototype,"messages",void 0),n([(0,i.jsonMember)({name:"error",constructor:String,preserveNull:!0}),o("design:type",String)],e.prototype,"errorMessage",void 0),n([i.jsonObject],e)}();t.SpeculativeExecutionResult=w;var S=function(){function e(e,t,r){this.blockHash=e,this.blockHeight=t,this.executionResult=r}var t;return t=e,e.fromV1=function(e,r){if(0===e.length)throw new Error("Missing ExecutionInfo.fromV1 results");var n=e[0],o=null!=r?r:0;return new t(n.blockHash,o,v.fromV1(n.result))},n([(0,i.jsonMember)({name:"block_hash",constructor:s.Hash,deserializer:function(e){return s.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.Hash)],e.prototype,"blockHash",void 0),n([(0,i.jsonMember)({name:"block_height",constructor:Number}),o("design:type",Number)],e.prototype,"blockHeight",void 0),n([(0,i.jsonMember)({name:"execution_result",constructor:v,deserializer:function(e){if(e)return v.fromJSON(e)}}),o("design:type",v)],e.prototype,"executionResult",void 0),t=n([i.jsonObject,o("design:paramtypes",[s.Hash,Number,v])],e)}();t.ExecutionInfo=S;var M=function(){function e(){}var t;return t=e,e.fromV1=function(e,r){if(0===e.length)return new t;var n=e[0],o=null!=r?r:0,i=new t;return i.blockHash=n.blockHash,i.blockHeight=o,i.executionResult=v.fromV1(n.result),i},n([(0,i.jsonMember)({name:"block_hash",constructor:s.Hash,deserializer:function(e){return s.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.Hash)],e.prototype,"blockHash",void 0),n([(0,i.jsonMember)({name:"block_height",constructor:Number}),o("design:type",Number)],e.prototype,"blockHeight",void 0),n([(0,i.jsonMember)({name:"execution_result",constructor:v,deserializer:function(e){if(e)return v.fromJSON(e)}}),o("design:type",v)],e.prototype,"executionResult",void 0),t=n([i.jsonObject],e)}();t.DeployExecutionInfo=M},7889:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.HexBytes=void 0;var i=r(9592),a=function(){function e(e){this.bytes=e}var t;return t=e,e.prototype.toHex=function(){return Array.from(this.bytes).map(function(e){return e.toString(16).padStart(2,"0")}).join("")},e.prototype.toJSON=function(){return this.toHex()},e.fromHex=function(e){var r=new Uint8Array(e.match(/.{1,2}/g).map(function(e){return parseInt(e,16)}));return new t(r)},e.fromJSON=function(e){return t.fromHex(e)},e.prototype.toString=function(){return this.toHex()},n([(0,i.jsonMember)(Uint8Array),o("design:type",Uint8Array)],e.prototype,"bytes",void 0),t=n([i.jsonObject,o("design:paramtypes",[Uint8Array])],e)}();t.HexBytes=a},3771:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.InitiatorAddr=void 0;var i=r(9592),a=r(9449),s=r(3401),u=r(9213),c=function(){function e(e,t){this.publicKey=e,this.accountHash=t}var t;return t=e,e.prototype.toBytes=function(){var e;if(this.accountHash)return(e=new u.CalltableSerialization).addField(0,Uint8Array.of(1)),e.addField(1,this.accountHash.toBytes()),e.toBytes();if(this.publicKey)return(e=new u.CalltableSerialization).addField(0,Uint8Array.of(0)),e.addField(1,this.publicKey.bytes()),e.toBytes();throw new Error("Unable to serialize InitiatorAddr")},e.fromJSON=function(e){var r=new t,n=(null==e?void 0:e.publicKey)||(null==e?void 0:e.PublicKey),o=(null==e?void 0:e.accountHash)||(null==e?void 0:e.AccountHash);return n?r.publicKey=a.PublicKey.fromHex(n):o&&(r.accountHash=s.AccountHash.fromString(o)),r},e.prototype.toJSON=function(){return this.accountHash?{AccountHash:this.accountHash.toPrefixedString()}:this.publicKey?{PublicKey:this.publicKey.toHex()}:void 0},n([(0,i.jsonMember)({name:"PublicKey",constructor:a.PublicKey}),o("design:type",a.PublicKey)],e.prototype,"publicKey",void 0),n([(0,i.jsonMember)({name:"AccountHash",constructor:s.AccountHash}),o("design:type",s.AccountHash)],e.prototype,"accountHash",void 0),t=n([i.jsonObject,o("design:paramtypes",[a.PublicKey,s.AccountHash])],e)}();t.InitiatorAddr=c},3903:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Message=t.MessagePayload=t.MessageTopic=t.MessageTopicSummary=void 0;var i=r(9592),a=r(3401),s=r(2625),u=function(){function e(){}return n([(0,i.jsonMember)({name:"message_count",constructor:Number}),o("design:type",Number)],e.prototype,"messageCount",void 0),n([(0,i.jsonMember)({name:"blocktime",constructor:Number}),o("design:type",Number)],e.prototype,"blockTime",void 0),n([i.jsonObject],e)}();t.MessageTopicSummary=u;var c=function(){function e(){}return n([(0,i.jsonMember)({name:"topic_name",constructor:String}),o("design:type",String)],e.prototype,"topicName",void 0),n([(0,i.jsonMember)({name:"topic_name_hash",constructor:a.Hash,deserializer:function(e){return a.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.Hash)],e.prototype,"topicNameHash",void 0),n([i.jsonObject],e)}();t.MessageTopic=c;var f=function(){function e(){}return n([(0,i.jsonMember)({name:"String",constructor:String}),o("design:type",String)],e.prototype,"string",void 0),n([(0,i.jsonMember)({name:"Bytes",constructor:s.ModuleBytes}),o("design:type",s.ModuleBytes)],e.prototype,"bytes",void 0),n([i.jsonObject],e)}();t.MessagePayload=f;var l=function(){function e(){}return n([(0,i.jsonMember)({name:"message",constructor:f}),o("design:type",f)],e.prototype,"message",void 0),n([(0,i.jsonMember)({name:"topic_name",constructor:String}),o("design:type",String)],e.prototype,"topicName",void 0),n([(0,i.jsonMember)({name:"topic_name_hash",constructor:a.Hash,deserializer:function(e){return a.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.Hash)],e.prototype,"topicNameHash",void 0),n([(0,i.jsonMember)({name:"hash_addr",constructor:a.Hash,deserializer:function(e){return a.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.Hash)],e.prototype,"hashAddr",void 0),n([(0,i.jsonMember)({name:"block_index",constructor:Number}),o("design:type",Number)],e.prototype,"blockIndex",void 0),n([(0,i.jsonMember)({name:"topic_index",constructor:Number}),o("design:type",Number)],e.prototype,"topicIndex",void 0),n([i.jsonObject],e)}();t.Message=l},8765:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MinimalBlockInfo=void 0;var i=r(9592),a=r(9449),s=r(3401),u=r(6500),c=function(){function e(){}return n([(0,i.jsonMember)({name:"creator",constructor:a.PublicKey,deserializer:function(e){return a.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.PublicKey)],e.prototype,"creator",void 0),n([(0,i.jsonMember)({name:"era_id",constructor:Number}),o("design:type",Number)],e.prototype,"eraID",void 0),n([(0,i.jsonMember)({name:"hash",constructor:s.Hash,deserializer:function(e){return s.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.Hash)],e.prototype,"hash",void 0),n([(0,i.jsonMember)({name:"height",constructor:Number}),o("design:type",Number)],e.prototype,"height",void 0),n([(0,i.jsonMember)({name:"state_root_hash",constructor:s.Hash,deserializer:function(e){return s.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.Hash)],e.prototype,"stateRootHash",void 0),n([(0,i.jsonMember)({name:"timestamp",constructor:u.Timestamp,deserializer:function(e){return u.Timestamp.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",u.Timestamp)],e.prototype,"timestamp",void 0),n([i.jsonObject],e)}();t.MinimalBlockInfo=c},9153:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.NamedKeyValue=t.NamedKey=void 0;var i=r(9592),a=r(3401),s=r(5466),u=function(){function e(e,t){this.name=e,this.key=t}return n([(0,i.jsonMember)({name:"name",constructor:String}),o("design:type",String)],e.prototype,"name",void 0),n([(0,i.jsonMember)({name:"key",constructor:a.Key,deserializer:function(e){if(e)return a.Key.newKey(e)},serializer:function(e){if(e)return e.toPrefixedString()}}),o("design:type",a.Key)],e.prototype,"key",void 0),n([i.jsonObject,o("design:paramtypes",[String,a.Key])],e)}();t.NamedKey=u;var c=function(){function e(e,t){this.name=e,this.namedKey=t}return n([(0,i.jsonMember)({name:"name",constructor:s.CLValue,deserializer:function(e){if(e)return s.CLValueParser.fromJSON(e)},serializer:function(e){if(e)return s.CLValueParser.toJSON(e)}}),o("design:type",s.CLValue)],e.prototype,"name",void 0),n([(0,i.jsonMember)({name:"named_key",constructor:s.CLValue,deserializer:function(e){if(e)return s.CLValueParser.fromJSON(e)},serializer:function(e){if(e)return s.CLValueParser.toJSON(e)}}),o("design:type",s.CLValue)],e.prototype,"namedKey",void 0),n([i.jsonObject,o("design:paramtypes",[s.CLValue,s.CLValue])],e)}();t.NamedKeyValue=c},4613:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.NamedUserGroup=t.Package=t.EntityVersionAndHash=t.EntityVersionKey=void 0;var i=r(9592),a=r(3401),s=function(){function e(e,t){this.entityVersion=e,this.protocolVersionMajor=t}return n([(0,i.jsonMember)({name:"entity_version",constructor:Number}),o("design:type",Number)],e.prototype,"entityVersion",void 0),n([(0,i.jsonMember)({name:"protocol_version_major",constructor:Number}),o("design:type",Number)],e.prototype,"protocolVersionMajor",void 0),n([i.jsonObject,o("design:paramtypes",[Number,Number])],e)}();t.EntityVersionKey=s;var u=function(){function e(e,t){this.addressableEntity=e,this.entityVersionKey=t}return n([(0,i.jsonMember)({name:"entity_addr",constructor:a.EntityAddr,deserializer:function(e){return a.EntityAddr.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.EntityAddr)],e.prototype,"addressableEntity",void 0),n([(0,i.jsonMember)({name:"entity_version_key",constructor:s}),o("design:type",s)],e.prototype,"entityVersionKey",void 0),n([i.jsonObject,o("design:paramtypes",[a.EntityAddr,s])],e)}();t.EntityVersionAndHash=u;var c=function(){function e(){}return n([(0,i.jsonArrayMember)(u,{name:"versions"}),o("design:type",Array)],e.prototype,"versions",void 0),n([(0,i.jsonArrayMember)(u,{name:"disabled_versions"}),o("design:type",Array)],e.prototype,"disabledVersions",void 0),n([(0,i.jsonMember)({name:"lock_status",constructor:String}),o("design:type",String)],e.prototype,"lockStatus",void 0),n([(0,i.jsonArrayMember)(String,{name:"groups"}),o("design:type",Array)],e.prototype,"groups",void 0),n([i.jsonObject],e)}();t.Package=c;var f=function(){function e(e,t){this.groupName=e,this.groupUsers=t}return n([(0,i.jsonMember)({name:"group_name",constructor:String}),o("design:type",String)],e.prototype,"groupName",void 0),n([(0,i.jsonArrayMember)(a.URef,{name:"group_users",serializer:function(e){return e.map(function(e){return e.toJSON()})},deserializer:function(e){if(e)return e.map(function(e){return a.URef.fromJSON(e)})}}),o("design:type",Array)],e.prototype,"groupUsers",void 0),n([i.jsonObject,o("design:paramtypes",[String,Array])],e)}();t.NamedUserGroup=f},5e3:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.PrepaymentKind=void 0;var i=r(9592),a=r(7889),s=r(3401),u=function(){function e(){}return n([(0,i.jsonMember)({name:"receipt",constructor:s.Hash,deserializer:function(e){return s.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.Hash)],e.prototype,"receipt",void 0),n([(0,i.jsonMember)({name:"prepayment_data",constructor:a.HexBytes,deserializer:function(e){return a.HexBytes.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.HexBytes)],e.prototype,"prepaymentData",void 0),n([(0,i.jsonMember)({name:"prepayment_kind",constructor:Number}),o("design:type",Number)],e.prototype,"prepaymentKind",void 0),n([i.jsonObject],e)}();t.PrepaymentKind=u},6200:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.PricingMode=t.PrepaidMode=t.FixedMode=t.PaymentLimitedMode=void 0;var i=r(9592),a=r(3401),s=r(5466),u=r(9213),c=function(){function e(){}return e.prototype.toBytes=function(){var e=new u.CalltableSerialization;return e.addField(0,s.CLValue.newCLUint8(0).bytes()),e.addField(1,s.CLValue.newCLUint64(this.paymentAmount).bytes()),e.addField(2,s.CLValue.newCLUint8(this.gasPriceTolerance).bytes()),e.addField(3,s.CLValue.newCLValueBool(this.standardPayment).bytes()),e.toBytes()},n([(0,i.jsonMember)({name:"gas_price_tolerance",constructor:Number}),o("design:type",Number)],e.prototype,"gasPriceTolerance",void 0),n([(0,i.jsonMember)({name:"payment_amount",constructor:Number}),o("design:type",Number)],e.prototype,"paymentAmount",void 0),n([(0,i.jsonMember)({name:"standard_payment",constructor:Boolean}),o("design:type",Boolean)],e.prototype,"standardPayment",void 0),n([i.jsonObject],e)}();t.PaymentLimitedMode=c;var f=function(){function e(){}return e.prototype.toBytes=function(){var e=new u.CalltableSerialization;return e.addField(0,s.CLValue.newCLUint8(1).bytes()),e.addField(1,s.CLValue.newCLUint8(this.gasPriceTolerance).bytes()),e.addField(2,s.CLValue.newCLUint8(this.additionalComputationFactor).bytes()),e.toBytes()},n([(0,i.jsonMember)({name:"gas_price_tolerance",constructor:Number}),o("design:type",Number)],e.prototype,"gasPriceTolerance",void 0),n([(0,i.jsonMember)({name:"additional_computation_factor",constructor:Number}),o("design:type",Number)],e.prototype,"additionalComputationFactor",void 0),n([i.jsonObject],e)}();t.FixedMode=f;var l=function(){function e(){}return e.prototype.toBytes=function(){var e=new u.CalltableSerialization;return e.addField(0,s.CLValue.newCLUint8(2).bytes()),e.addField(1,this.receipt.toBytes()),e.toBytes()},n([(0,i.jsonMember)({name:"receipt",constructor:a.Hash,deserializer:function(e){return a.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.Hash)],e.prototype,"receipt",void 0),n([i.jsonObject],e)}();t.PrepaidMode=l;var d=function(){function e(){}return e.prototype.toBytes=function(){if(this.paymentLimited)return this.paymentLimited.toBytes();if(this.fixed)return this.fixed.toBytes();if(this.prepaid)return this.prepaid.toBytes();throw new Error("Unable to serialize PricingMode")},n([(0,i.jsonMember)({name:"PaymentLimited",constructor:c}),o("design:type",c)],e.prototype,"paymentLimited",void 0),n([(0,i.jsonMember)({name:"Fixed",constructor:f}),o("design:type",f)],e.prototype,"fixed",void 0),n([(0,i.jsonMember)({name:"Prepaid",constructor:l}),o("design:type",l)],e.prototype,"prepaid",void 0),n([i.jsonObject],e)}();t.PricingMode=d},2428:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.deserializeDisabledVersions=t.serializeRewards=t.deserializeRewards=t.serializeArgs=t.deserializeArgs=t.dehumanizerTTL=t.humanizerTTL=t.undefinedSafeByteArrayJsonDeserializer=t.byteArrayJsonDeserializer=t.undefinedSafeByteArrayJsonSerializer=t.byteArrayJsonSerializer=void 0;var o=r(9592),i=n(r(6123)),a=r(9960),s=r(7372),u=r(5466);t.byteArrayJsonSerializer=function(e){return s.Conversions.encodeBase16(e)},t.undefinedSafeByteArrayJsonSerializer=function(e){if(e)return s.Conversions.encodeBase16(e)},t.byteArrayJsonDeserializer=function(e){return s.Conversions.decodeBase16(e)},t.undefinedSafeByteArrayJsonDeserializer=function(e){if(e)return s.Conversions.decodeBase16(e)};var c=i.default.humanizer({spacer:"",serialComma:!1,conjunction:" ",delimiter:" ",language:"shortEn",languages:{shortEn:{d:function(){return"day"},h:function(){return"h"},m:function(){return"m"},s:function(){return"s"},ms:function(){return"ms"}}}});t.humanizerTTL=function(e){return c(e)},t.dehumanizerTTL=function(e){return e.split(" ").map(function(e){if(e.includes("ms"))return Number(e.replace("ms",""));if(e.includes("s")&&!e.includes("m"))return 1e3*Number(e.replace("s",""));if(e.includes("m")&&!e.includes("s"))return 60*Number(e.replace("m",""))*1e3;if(e.includes("h"))return 60*Number(e.replace("h",""))*60*1e3;if(e.includes("day"))return 24*Number(e.replace("day",""))*60*60*1e3;throw Error("Unsupported TTL unit")}).reduce(function(e,t){return e+t})},t.deserializeArgs=function(e){var t=new o.TypedJSON(a.Args);if(e.Named&&Array.isArray(e.Named))return t.parse({args:e.Named});if(Array.isArray(e))return t.parse({args:e});throw new Error("Invalid argument format for deserialization.")},t.serializeArgs=function(e,t){void 0===t&&(t=!1);var r=new o.TypedJSON(a.Args).toPlainJson(e),n=Object.values(r)[0];return t?{Named:n}:n},t.deserializeRewards=function(e){var t=new Map(Array.from(e,function(e){return[e[0],e[1].map(function(e){return u.CLValueUInt512.fromJSON(e)})]}));if(t.size!==Array.from(e).length)throw Error("Duplicate key exists.");return t},t.serializeRewards=function(e){return Array.from(e,function(e){return[e[0],e[1].map(function(e){return e.toJSON()})]})},t.deserializeDisabledVersions=function(e){return Array.isArray(e)&&Array.isArray(e[0])?e:e.map(function(e){var t=e.protocol_version_major;return[e.contract_version,t]})}},121:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.StoredValue=void 0;var i=r(9592),a=r(602),s=r(6838),u=r(402),c=r(5495),f=r(2142),l=r(8148),d=r(3750),h=r(4820),p=r(4613),y=r(3903),m=r(9153),b=r(111),g=r(5e3),v=r(2535),w=r(8263),S=r(5466),M=r(978),_=r(5463),A=function(){function e(){}return n([(0,i.jsonMember)({name:"CLValue",constructor:S.CLValue,deserializer:function(e){if(e)return S.CLValueParser.fromJSON(e)},serializer:function(e){if(e)return S.CLValueParser.toJSON(e)}}),o("design:type",S.CLValue)],e.prototype,"clValue",void 0),n([(0,i.jsonMember)({name:"Account",constructor:a.Account}),o("design:type",a.Account)],e.prototype,"account",void 0),n([(0,i.jsonMember)({name:"Contract",constructor:v.Contract}),o("design:type",v.Contract)],e.prototype,"contract",void 0),n([(0,i.jsonMember)({name:"ContractWasm",constructor:_.ContractWasm}),o("design:type",_.ContractWasm)],e.prototype,"ContractWasm",void 0),n([(0,i.jsonMember)({name:"ContractPackage",constructor:w.ContractPackage}),o("design:type",w.ContractPackage)],e.prototype,"contractPackage",void 0),n([(0,i.jsonMember)({name:"Transfer",constructor:s.Transfer,deserializer:function(e){if(e)return s.Transfer.fromJSON(e)}}),o("design:type",s.Transfer)],e.prototype,"transfer",void 0),n([(0,i.jsonMember)({name:"DeployInfo",constructor:u.DeployInfo}),o("design:type",u.DeployInfo)],e.prototype,"deployInfo",void 0),n([(0,i.jsonMember)({name:"EraInfo",constructor:c.EraInfo}),o("design:type",c.EraInfo)],e.prototype,"eraInfo",void 0),n([(0,i.jsonMember)({name:"Bid",constructor:f.Bid}),o("design:type",f.Bid)],e.prototype,"bid",void 0),n([(0,i.jsonArrayMember)(l.UnbondingPurse,{name:"Withdraw"}),o("design:type",Array)],e.prototype,"withdraw",void 0),n([(0,i.jsonMember)({name:"Unbonding",constructor:l.UnbondingPurse}),o("design:type",l.UnbondingPurse)],e.prototype,"unbonding",void 0),n([(0,i.jsonMember)({name:"AddressableEntity",constructor:d.AddressableEntity}),o("design:type",d.AddressableEntity)],e.prototype,"addressableEntity",void 0),n([(0,i.jsonMember)({name:"BidKind",constructor:h.BidKind}),o("design:type",h.BidKind)],e.prototype,"bidKind",void 0),n([(0,i.jsonMember)({name:"Package",constructor:p.Package}),o("design:type",p.Package)],e.prototype,"package",void 0),n([(0,i.jsonMember)({name:"ByteCode",constructor:M.SystemByteCode,serializer:function(e){if(e)return e.toString()}}),o("design:type",M.SystemByteCode)],e.prototype,"byteCode",void 0),n([(0,i.jsonMember)({name:"MessageTopic",constructor:y.MessageTopicSummary}),o("design:type",y.MessageTopicSummary)],e.prototype,"messageTopic",void 0),n([(0,i.jsonMember)({name:"Message",constructor:String}),o("design:type",String)],e.prototype,"message",void 0),n([(0,i.jsonMember)({name:"NamedKey",constructor:m.NamedKeyValue}),o("design:type",m.NamedKeyValue)],e.prototype,"namedKey",void 0),n([(0,i.jsonMember)({name:"Prepayment",constructor:g.PrepaymentKind}),o("design:type",g.PrepaymentKind)],e.prototype,"prepayment",void 0),n([(0,i.jsonMember)({name:"EntryPoint",constructor:b.EntryPointValue}),o("design:type",b.EntryPointValue)],e.prototype,"entryPoint",void 0),n([(0,i.jsonMember)({name:"RawBytes",constructor:String}),o("design:type",String)],e.prototype,"rawBytes",void 0),n([i.jsonObject],e)}();t.StoredValue=A},6500:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Duration=t.Timestamp=void 0;var i=r(9592),a=r(2428),s=function(){function e(e){this.date=e}var t;return t=e,e.prototype.toMilliseconds=function(){return this.date.getTime()},e.prototype.toJSON=function(){return this.date.toISOString()},e.fromJSON=function(e){return new t(new Date(e))},e.prototype.toDate=function(){return this.date},n([(0,i.jsonMember)({constructor:Date}),o("design:type",Date)],e.prototype,"date",void 0),t=n([i.jsonObject,o("design:paramtypes",[Date])],e)}();t.Timestamp=s;var u=function(){function e(e){this.duration=e}var t;return t=e,e.prototype.toJSON=function(){return(0,a.humanizerTTL)(this.duration)},e.fromJSON=function(e){var r=(0,a.dehumanizerTTL)(e);return new t(r)},e.prototype.toDurationString=function(){return new Date(this.duration).toISOString().substring(11,19)},e.parseDurationString=function(e){var t=e.match(/(\d+)([smhd])/g);if(!t)throw new Error("Invalid duration format");for(var r=0,n=0,o=t;n<o.length;n++){var i=o[n],a=parseInt(i.slice(0,-1));switch(i.slice(-1)){case"s":r+=1e3*a;break;case"m":r+=6e4*a;break;case"h":r+=36e5*a;break;case"d":r+=864e5*a}}return r},e.prototype.toMilliseconds=function(){return this.duration},n([(0,i.jsonMember)({constructor:Number}),o("design:type",Number)],e.prototype,"duration",void 0),t=n([i.jsonObject,o("design:paramtypes",[Number])],e)}();t.Duration=u},9125:function(e,t,r){var n,o=r(8287).Buffer,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionWrapper=t.Transaction=t.TransactionV1=t.Approval=t.TransactionHash=t.TransactionVersion=t.TransactionCategory=t.ErrTransactionV1FromJson=t.ErrInvalidApprovalSignature=t.ErrInvalidTransactionHash=t.TransactionError=void 0;var u,c,f=r(9592),l=r(8905),d=r(3401),h=r(6694),p=r(6500),y=r(3771),m=r(6200),b=r(7012),g=r(2151),v=r(5731),w=r(9449),S=r(7889),M=r(9960),_=r(678),A=r(5596),E=r(9213),O=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(Error);t.TransactionError=O,t.ErrInvalidTransactionHash=new O("invalid transaction hash"),t.ErrInvalidApprovalSignature=new O("invalid approval signature"),t.ErrTransactionV1FromJson=new O("The JSON can't be parsed as a TransactionV1."),(c=t.TransactionCategory||(t.TransactionCategory={}))[c.Mint=0]="Mint",c[c.Auction=1]="Auction",c[c.InstallUpgrade=2]="InstallUpgrade",c[c.Large=3]="Large",c[c.Medium=4]="Medium",c[c.Small=5]="Small",(u=t.TransactionVersion||(t.TransactionVersion={}))[u.V1=0]="V1",u[u.Deploy=1]="Deploy";var j=function(e){function t(t,r){var n=this;return t&&((n=e.call(this,t.toBytes())||this).deploy=t),r&&((n=e.call(this,r.toBytes())||this).transactionV1=r),n}var r;return i(t,e),r=t,t.fromDeployHash=function(e){return new r(e,void 0)},t.fromTransactionHash=function(e){return new r(void 0,e)},t.prototype.getHash=function(){return this.deploy||this.transactionV1},t.prototype.toHex=function(){var e;return(null===(e=this.getHash())||void 0===e?void 0:e.toHex())||""},t.prototype.toBytes=function(){var e;return(null===(e=this.getHash())||void 0===e?void 0:e.toBytes())||new Uint8Array},t.prototype.toJSON=function(){return this.toHex()},t.prototype.equals=function(e){var t,r=null===(t=this.getHash())||void 0===t?void 0:t.toBytes(),n=e.toBytes();return!(!r||r.length!==n.length)&&r.every(function(e,t){return e===n[t]})},a([(0,f.jsonMember)({name:"Deploy",constructor:d.Hash,deserializer:function(e){if(e)return d.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),s("design:type",d.Hash)],t.prototype,"deploy",void 0),a([(0,f.jsonMember)({name:"Version1",constructor:d.Hash,deserializer:function(e){if(e)return d.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),s("design:type",d.Hash)],t.prototype,"transactionV1",void 0),r=a([f.jsonObject,s("design:paramtypes",[d.Hash,d.Hash])],t)}(d.Hash);t.TransactionHash=j;var T=function(){function e(e,t){this.signer=e,this.signature=t}return e.toBytes=function(e){var t=(0,_.toBytesU32)(e.length),r=(0,l.concat)(e.map(function(e){return(0,l.concat)([Uint8Array.from(o.from(e.signer.toString(),"hex")),Uint8Array.from(o.from(e.signature.toString(),"hex"))])}));return(0,l.concat)([t,r])},a([(0,f.jsonMember)({name:"signer",constructor:w.PublicKey,deserializer:function(e){return w.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),s("design:type",w.PublicKey)],e.prototype,"signer",void 0),a([(0,f.jsonMember)({name:"signature",constructor:S.HexBytes,deserializer:function(e){return S.HexBytes.fromJSON(e)},serializer:function(e){return e.toJSON()}}),s("design:type",S.HexBytes)],e.prototype,"signature",void 0),a([f.jsonObject,s("design:paramtypes",[w.PublicKey,S.HexBytes])],e)}();t.Approval=T;var N=function(){function e(e,t,r){this.hash=e,this.payload=t,this.approvals=r}var r;return r=e,e.prototype.validate=function(){var e=this.payload.toBytes(),r=new d.Hash((0,_.byteHash)(e));if(!this.hash.equals(r))throw t.ErrInvalidTransactionHash;for(var n=0,o=this.approvals;n<o.length;n++){var i=o[n];if(!i.signer.verifySignature(this.hash.toBytes(),i.signature.bytes))throw t.ErrInvalidApprovalSignature}return!0},e.prototype.sign=function(e){var t=e.signAndAddAlgorithmBytes(this.hash.toBytes()),r=new S.HexBytes(t);this.approvals||(this.approvals=[]),this.approvals.push(new T(e.publicKey,r))},e.prototype.toBytes=function(){return(new E.CalltableSerialization).addField(r.HASH_FIELD_INDEX,this.hash.toBytes()).addField(r.PAYLOAD_FIELD_INDEX,this.payload.toBytes()).addField(r.APPROVALS_FIELD_INDEX,T.toBytes(this.approvals)).toBytes()},e.setSignature=function(e,t,r){var n=new S.HexBytes(t);return e.approvals.push(new T(r,n)),e},e.newTransactionV1=function(e,t,n){return new r(e,t,n)},e.makeTransactionV1=function(e){var t=e.toBytes(),n=new d.Hash((0,_.byteHash)(t));return new r(n,e,[])},e.fromJSON=function(e){var n,o,i,a,s,u;try{var c="string"==typeof e?JSON.parse(e):e,l=null!==(a=null!==(i=null!==(o=null===(n=null==c?void 0:c.transaction)||void 0===n?void 0:n.Version1)&&void 0!==o?o:null==c?void 0:c.Version1)&&void 0!==i?i:c)&&void 0!==a?a:null;if(!(null==l?void 0:l.hash)||!(null===(s=null==l?void 0:l.payload)||void 0===s?void 0:s.initiator_addr))throw t.ErrTransactionV1FromJson;if(!(u=new f.TypedJSON(r).parse(l)))throw t.ErrTransactionV1FromJson}catch(e){throw new Error("Serialization error: ".concat(e.message))}return u.validate(),u},e.HASH_FIELD_INDEX=0,e.PAYLOAD_FIELD_INDEX=1,e.APPROVALS_FIELD_INDEX=2,e.toJSON=function(e){return new f.TypedJSON(r).toPlainJson(e)},a([(0,f.jsonMember)({name:"hash",constructor:d.Hash,deserializer:function(e){return d.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),s("design:type",d.Hash)],e.prototype,"hash",void 0),a([(0,f.jsonMember)({name:"payload",constructor:A.TransactionV1Payload}),s("design:type",A.TransactionV1Payload)],e.prototype,"payload",void 0),a([(0,f.jsonArrayMember)(function(){return T}),s("design:type",Array)],e.prototype,"approvals",void 0),r=a([f.jsonObject,s("design:paramtypes",[d.Hash,A.TransactionV1Payload,Array])],e)}();t.TransactionV1=N;var P=function(){function e(e,t,r,n,o,i,a,s,u,c,f,l,d){if(this.hash=e,this.chainName=t,this.timestamp=r,this.ttl=n,this.initiatorAddr=o,this.pricingMode=i,this.args=a,this.target=s,this.entryPoint=u,this.scheduling=c,this.approvals=f,this.originDeployV1=d,this.originTransactionV1=l,!this.originDeployV1&&!this.originTransactionV1)throw new Error("Incorrect Transaction instance. Missing originTransactionV1 or originDeploy");if(this.originDeployV1&&this.originTransactionV1)throw new Error("Incorrect Transaction instance. Should be only one of originTransactionV1 or originDeploy")}var t;return t=e,e.prototype.getDeploy=function(){return this.originDeployV1},e.prototype.getTransactionV1=function(){return this.originTransactionV1},e.prototype.getTransactionWrapper=function(){return new B(this.originDeployV1,this.originTransactionV1)},e.prototype.validate=function(){if(this.originTransactionV1)return this.originTransactionV1.validate();if(this.originDeployV1)return this.originDeployV1.validate();throw new Error("Incorrect Transaction instance. Missing origin value")},e.prototype.sign=function(e){var t=e.signAndAddAlgorithmBytes(this.hash.toBytes());this.setSignature(t,e.publicKey)},e.prototype.setSignature=function(e,t){var r=new S.HexBytes(e),n=new T(t,r);if(this.originTransactionV1)this.originTransactionV1.approvals.push(n);else{if(!this.originDeployV1)throw new Error("Incorrect Transaction instance. Missing origin value");this.originDeployV1.approvals.push(n)}},e.prototype.toBytes=function(){if(this.originDeployV1)return(0,l.concat)([Uint8Array.of(0),this.originDeployV1.toBytes()]);if(this.originTransactionV1)return(0,l.concat)([Uint8Array.of(1),this.originTransactionV1.toBytes()]);throw new Error("Incorrect Transaction instance. Missing origin value")},e.fromTransactionV1=function(e){return new t(j.fromTransactionHash(e.hash),e.payload.chainName,e.payload.timestamp,e.payload.ttl,e.payload.initiatorAddr,e.payload.pricingMode,e.payload.fields.args,e.payload.fields.target,e.payload.fields.entryPoint,e.payload.fields.scheduling,e.approvals,e,void 0)},e.fromDeploy=function(e){return h.Deploy.newTransactionFromDeploy(e)},e.fromJSON=function(e){try{var r=N.fromJSON(e);return t.fromTransactionV1(r)}catch(e){}try{var n=h.Deploy.fromJSON(e);return t.fromDeploy(n)}catch(e){}throw new Error("The JSON can't be parsed as a Transaction.")},e.prototype.toJSON=function(){if(this.originTransactionV1)return N.toJSON(this.originTransactionV1);if(this.originDeployV1)return h.Deploy.toJSON(this.originDeployV1);throw new Error("Incorrect Transaction instance. Missing origin value")},a([(0,f.jsonMember)({name:"hash",constructor:j}),s("design:type",j)],e.prototype,"hash",void 0),a([(0,f.jsonMember)({name:"chain_name",constructor:String}),s("design:type",String)],e.prototype,"chainName",void 0),a([(0,f.jsonMember)({name:"timestamp",constructor:p.Timestamp}),s("design:type",p.Timestamp)],e.prototype,"timestamp",void 0),a([(0,f.jsonMember)({name:"ttl",constructor:p.Duration}),s("design:type",p.Duration)],e.prototype,"ttl",void 0),a([(0,f.jsonMember)({name:"initiator_addr",constructor:y.InitiatorAddr}),s("design:type",y.InitiatorAddr)],e.prototype,"initiatorAddr",void 0),a([(0,f.jsonMember)({name:"pricing_mode",constructor:m.PricingMode}),s("design:type",m.PricingMode)],e.prototype,"pricingMode",void 0),a([(0,f.jsonMember)(function(){return M.Args}),s("design:type",M.Args)],e.prototype,"args",void 0),a([(0,f.jsonMember)({name:"target",constructor:b.TransactionTarget}),s("design:type",b.TransactionTarget)],e.prototype,"target",void 0),a([(0,f.jsonMember)({name:"entry_point",constructor:g.TransactionEntryPoint}),s("design:type",g.TransactionEntryPoint)],e.prototype,"entryPoint",void 0),a([(0,f.jsonMember)({name:"scheduling",constructor:v.TransactionScheduling}),s("design:type",v.TransactionScheduling)],e.prototype,"scheduling",void 0),a([(0,f.jsonArrayMember)(T),s("design:type",Array)],e.prototype,"approvals",void 0),t=a([f.jsonObject,s("design:paramtypes",[j,String,p.Timestamp,p.Duration,y.InitiatorAddr,m.PricingMode,M.Args,b.TransactionTarget,g.TransactionEntryPoint,v.TransactionScheduling,Array,N,h.Deploy])],e)}();t.Transaction=P;var B=function(){function e(e,t){this.deploy=e,this.transactionV1=t}var t;return t=e,e.toJSON=function(e){return new f.TypedJSON(t).toPlainJson(e)},a([(0,f.jsonMember)(function(){return h.Deploy},{name:"Deploy"}),s("design:type",h.Deploy)],e.prototype,"deploy",void 0),a([(0,f.jsonMember)({name:"Version1",constructor:N,deserializer:function(e){if(e)return N.fromJSON(e)}}),s("design:type",N)],e.prototype,"transactionV1",void 0),t=a([f.jsonObject,s("design:paramtypes",[h.Deploy,N])],e)}();t.TransactionWrapper=B},6586:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.SessionBuilder=t.ContractCallBuilder=t.NativeChangeBidPublicKeyBuilder=t.NativeActivateBidBuilder=t.NativeRedelegateBuilder=t.NativeUndelegateBuilder=t.NativeDelegateBuilder=t.NativeWithdrawBidBuilder=t.NativeAddBidBuilder=t.NativeTransferBuilder=void 0;var i=r(3771),a=r(6200),s=r(7012),u=r(2151),c=r(5731),f=r(9960),l=r(3401),d=r(9125),h=r(5596),p=r(6500),y=r(5466),m=r(2625),b=r(6694),g=r(8389),v=r(7909),w=function(){function e(){this._timestamp=new p.Timestamp(new Date),this._ttl=new p.Duration(18e5),this._scheduling=new c.TransactionScheduling({})}return e.prototype.from=function(e){return this._initiatorAddr=new i.InitiatorAddr(e),this},e.prototype.fromAccountHash=function(e){return this._initiatorAddr=new i.InitiatorAddr(void 0,e),this},e.prototype.chainName=function(e){return this._chainName=e,this},e.prototype.contractHash=function(e){return this._contractHash=e,this},e.prototype.timestamp=function(e){return this._timestamp=e,this},e.prototype.ttl=function(e){return this._ttl=new p.Duration(e),this},e.prototype.payment=function(e,t){void 0===t&&(t=1);var r=new a.PricingMode,n=new a.PaymentLimitedMode;return n.standardPayment=!0,n.paymentAmount=e,n.gasPriceTolerance=t,r.paymentLimited=n,this._pricingMode=r,this},e.prototype._getDefaultDeployHeader=function(){var e,t,r=b.DeployHeader.default();return r.account=this._initiatorAddr.publicKey,r.chainName=this._chainName,r.timestamp=this._timestamp,r.ttl=this._ttl,(null===(e=this._pricingMode.paymentLimited)||void 0===e?void 0:e.gasPriceTolerance)&&(r.gasPrice=null===(t=this._pricingMode.paymentLimited)||void 0===t?void 0:t.gasPriceTolerance),r},e.prototype._getStandardPayment=function(){var e,t;if(!(null===(t=null===(e=this._pricingMode)||void 0===e?void 0:e.paymentLimited)||void 0===t?void 0:t.paymentAmount))throw new Error("PaymentAmount is not specified");return m.ExecutableDeployItem.standardPayment(this._pricingMode.paymentLimited.paymentAmount.toString())},e.prototype.build=function(){var e=h.TransactionV1Payload.build({initiatorAddr:this._initiatorAddr,timestamp:this._timestamp,ttl:this._ttl,chainName:this._chainName,pricingMode:this._pricingMode,args:this._runtimeArgs,transactionTarget:this._invocationTarget,entryPoint:this._entryPoint,scheduling:this._scheduling}),t=d.TransactionV1.makeTransactionV1(e);return d.Transaction.fromTransactionV1(t)},e}(),S=function(e){function t(){var t=e.call(this)||this;return t._amount=y.CLValue.newCLUInt512("0"),t._amountRow="0",t._invocationTarget=new s.TransactionTarget({}),t._entryPoint=new u.TransactionEntryPoint(u.TransactionEntryPointEnum.Transfer),t}return o(t,e),t.prototype.target=function(e){return this._publicKey=e,this._target=y.CLValue.newCLPublicKey(e),this},t.prototype.targetAccountHash=function(e){return this._target=y.CLValue.newCLByteArray(e.toBytes()),this},t.prototype.amount=function(e){return this._amountRow=e,this._amount=y.CLValue.newCLUInt512(e),this},t.prototype.id=function(e){return this._idTransfer=e,this},t.prototype.build=function(){var t=f.Args.fromMap({});return t.insert("target",this._target),t.insert("amount",this._amount),this._idTransfer&&t.insert("id",y.CLValue.newCLOption(y.CLValue.newCLUint64(this._idTransfer))),this._runtimeArgs=t,e.prototype.build.call(this)},t.prototype.buildFor1_5=function(){var e,t=new m.ExecutableDeployItem;t.transfer=m.TransferDeployItem.newTransfer(this._amountRow,this._publicKey,void 0,this._idTransfer);try{e=this._getStandardPayment()}catch(t){if("PaymentAmount is not specified"!==t.message)throw t;e=m.ExecutableDeployItem.standardPayment("100000000")}var r=b.Deploy.makeDeploy(this._getDefaultDeployHeader(),e,t);return d.Transaction.fromDeploy(r)},t}(w);t.NativeTransferBuilder=S;var M=function(e){function t(){var t=e.call(this)||this;return t._invocationTarget=new s.TransactionTarget({}),t._entryPoint=new u.TransactionEntryPoint(u.TransactionEntryPointEnum.AddBid),t}return o(t,e),t.prototype.validator=function(e){return this._validator=y.CLValue.newCLPublicKey(e),this},t.prototype.amount=function(e){return this._amount=y.CLValue.newCLUInt512(e),this},t.prototype.delegationRate=function(e){return this._delegationRate=y.CLValue.newCLUint8(e),this},t.prototype.minimumDelegationAmount=function(e){return this._minimumDelegationAmount=y.CLValue.newCLUint64(e),this},t.prototype.maximumDelegationAmount=function(e){return this._maximumDelegationAmount=y.CLValue.newCLUint64(e),this},t.prototype.reservedSlots=function(e){return this._reservedSlots=y.CLValue.newCLUInt32(e),this},t.prototype.build=function(){var t=f.Args.fromMap({});return t.insert("public_key",this._validator),t.insert("amount",this._amount),t.insert("delegation_rate",this._delegationRate),this._minimumDelegationAmount&&t.insert("minimum_delegation_amount",this._minimumDelegationAmount),this._maximumDelegationAmount&&t.insert("maximum_delegation_amount",this._maximumDelegationAmount),this._reservedSlots&&t.insert("reserved_slots",this._reservedSlots),this._runtimeArgs=t,e.prototype.build.call(this)},t.prototype.buildFor1_5=function(){var e,t;if(!this._initiatorAddr.publicKey)throw new Error("Initiator addr is not specified");var r=f.Args.fromMap({});r.insert("public_key",this._validator),r.insert("amount",this._amount),r.insert("delegation_rate",this._delegationRate),this._minimumDelegationAmount&&r.insert("minimum_delegation_amount",this._minimumDelegationAmount),this._maximumDelegationAmount&&r.insert("maximum_delegation_amount",this._maximumDelegationAmount),this._reservedSlots&&r.insert("reserved_slots",this._reservedSlots),this._runtimeArgs=r;var n=null!==(t=null!==(e=this._contractHash)&&void 0!==e?e:g.AuctionManagerContractHashMap[this._chainName])&&void 0!==t?t:g.AuctionManagerContractHashMap.casper;if(!n)throw new Error("Contract hash is undefined. Check _contractHash or _chainName: ".concat(this._chainName));var o=new m.ExecutableDeployItem;o.storedContractByHash=new m.StoredContractByHash(l.ContractHash.newContract(n),v.AuctionManagerEntryPoint.addBid,r);var i=b.Deploy.makeDeploy(this._getDefaultDeployHeader(),this._getStandardPayment(),o);return d.Transaction.fromDeploy(i)},t}(w);t.NativeAddBidBuilder=M;var _=function(e){function t(){var t=e.call(this)||this;return t._amount=y.CLValue.newCLUInt512("0"),t._invocationTarget=new s.TransactionTarget({}),t._entryPoint=new u.TransactionEntryPoint(u.TransactionEntryPointEnum.WithdrawBid),t}return o(t,e),t.prototype.validator=function(e){return this._validator=y.CLValue.newCLPublicKey(e),this},t.prototype.amount=function(e){return this._amount=y.CLValue.newCLUInt512(e),this},t.prototype.build=function(){return this._runtimeArgs=f.Args.fromMap({public_key:this._validator,amount:this._amount}),e.prototype.build.call(this)},t.prototype.buildFor1_5=function(){var e,t;this._runtimeArgs=f.Args.fromMap({public_key:this._validator,amount:this._amount});var r=null!==(t=null!==(e=this._contractHash)&&void 0!==e?e:g.AuctionManagerContractHashMap[this._chainName])&&void 0!==t?t:g.AuctionManagerContractHashMap.casper;if(!r)throw new Error("Contract hash is undefined. Check _contractHash or _chainName: ".concat(this._chainName));var n=new m.ExecutableDeployItem;n.storedContractByHash=new m.StoredContractByHash(l.ContractHash.newContract(r),v.AuctionManagerEntryPoint.withdrawBid,this._runtimeArgs);var o=b.Deploy.makeDeploy(this._getDefaultDeployHeader(),this._getStandardPayment(),n);return d.Transaction.fromDeploy(o)},t}(w);t.NativeWithdrawBidBuilder=_;var A=function(e){function t(){var t=e.call(this)||this;return t._amount=y.CLValue.newCLUInt512("0"),t._invocationTarget=new s.TransactionTarget({}),t._entryPoint=new u.TransactionEntryPoint(u.TransactionEntryPointEnum.Delegate),t}return o(t,e),t.prototype.validator=function(e){return this._validator=y.CLValue.newCLPublicKey(e),this},t.prototype.amount=function(e){return this._amount=y.CLValue.newCLUInt512(e),this},t.prototype.build=function(){if(!this._initiatorAddr.publicKey)throw new Error("Initiator addr is not specified");return this._runtimeArgs=f.Args.fromMap({delegator:y.CLValue.newCLPublicKey(this._initiatorAddr.publicKey),validator:this._validator,amount:this._amount}),e.prototype.build.call(this)},t.prototype.buildFor1_5=function(){var e,t;if(!this._initiatorAddr.publicKey)throw new Error("Initiator addr is not specified");var r=null!==(t=null!==(e=this._contractHash)&&void 0!==e?e:g.AuctionManagerContractHashMap[this._chainName])&&void 0!==t?t:g.AuctionManagerContractHashMap.casper;if(!r)throw new Error("Contract hash is undefined. Check _contractHash or _chainName: ".concat(this._chainName));var n=new m.ExecutableDeployItem;n.storedContractByHash=new m.StoredContractByHash(l.ContractHash.newContract(r),v.AuctionManagerEntryPoint.delegate,f.Args.fromMap({validator:this._validator,delegator:y.CLValue.newCLPublicKey(this._initiatorAddr.publicKey),amount:this._amount}));var o=b.Deploy.makeDeploy(this._getDefaultDeployHeader(),this._getStandardPayment(),n);return d.Transaction.fromDeploy(o)},t}(w);t.NativeDelegateBuilder=A;var E=function(e){function t(){var t=e.call(this)||this;return t._amount=y.CLValue.newCLUInt512("0"),t._invocationTarget=new s.TransactionTarget({}),t._entryPoint=new u.TransactionEntryPoint(u.TransactionEntryPointEnum.Undelegate),t}return o(t,e),t.prototype.validator=function(e){return this._validator=y.CLValue.newCLPublicKey(e),this},t.prototype.amount=function(e){return this._amount=y.CLValue.newCLUInt512(e),this},t.prototype.build=function(){if(!this._initiatorAddr.publicKey)throw new Error("Initiator addr is not specified");return this._runtimeArgs=f.Args.fromMap({delegator:y.CLValue.newCLPublicKey(this._initiatorAddr.publicKey),validator:this._validator,amount:this._amount}),e.prototype.build.call(this)},t.prototype.buildFor1_5=function(){var e,t;if(!this._initiatorAddr.publicKey)throw new Error("Initiator addr is not specified");var r=null!==(t=null!==(e=this._contractHash)&&void 0!==e?e:g.AuctionManagerContractHashMap[this._chainName])&&void 0!==t?t:g.AuctionManagerContractHashMap.casper;if(!r)throw new Error("Contract hash is undefined. Check _contractHash or _chainName: ".concat(this._chainName));var n=new m.ExecutableDeployItem;n.storedContractByHash=new m.StoredContractByHash(l.ContractHash.newContract(r),v.AuctionManagerEntryPoint.undelegate,f.Args.fromMap({validator:this._validator,delegator:y.CLValue.newCLPublicKey(this._initiatorAddr.publicKey),amount:this._amount}));var o=b.Deploy.makeDeploy(this._getDefaultDeployHeader(),this._getStandardPayment(),n);return d.Transaction.fromDeploy(o)},t}(w);t.NativeUndelegateBuilder=E;var O=function(e){function t(){var t=e.call(this)||this;return t._amount=y.CLValue.newCLUInt512("0"),t._invocationTarget=new s.TransactionTarget({}),t._entryPoint=new u.TransactionEntryPoint(u.TransactionEntryPointEnum.Redelegate),t}return o(t,e),t.prototype.validator=function(e){return this._validator=y.CLValue.newCLPublicKey(e),this},t.prototype.newValidator=function(e){return this._newValidator=y.CLValue.newCLPublicKey(e),this},t.prototype.amount=function(e){return this._amount=y.CLValue.newCLUInt512(e),this},t.prototype.build=function(){if(!this._initiatorAddr.publicKey)throw new Error("Initiator addr is not specified");return this._runtimeArgs=f.Args.fromMap({delegator:y.CLValue.newCLPublicKey(this._initiatorAddr.publicKey),validator:this._validator,amount:this._amount,new_validator:this._newValidator}),e.prototype.build.call(this)},t.prototype.buildFor1_5=function(){var e,t;if(!this._initiatorAddr.publicKey)throw new Error("Initiator addr is not specified");var r=null!==(t=null!==(e=this._contractHash)&&void 0!==e?e:g.AuctionManagerContractHashMap[this._chainName])&&void 0!==t?t:g.AuctionManagerContractHashMap.casper;if(!r)throw new Error("Contract hash is undefined. Check _contractHash or _chainName: ".concat(this._chainName));var n=new m.ExecutableDeployItem;n.storedContractByHash=new m.StoredContractByHash(l.ContractHash.newContract(r),v.AuctionManagerEntryPoint.redelegate,f.Args.fromMap({validator:this._validator,new_validator:this._newValidator,delegator:y.CLValue.newCLPublicKey(this._initiatorAddr.publicKey),amount:this._amount}));var o=b.Deploy.makeDeploy(this._getDefaultDeployHeader(),this._getStandardPayment(),n);return d.Transaction.fromDeploy(o)},t}(w);t.NativeRedelegateBuilder=O;var j=function(e){function t(){var t=e.call(this)||this;return t._invocationTarget=new s.TransactionTarget({}),t._entryPoint=new u.TransactionEntryPoint(u.TransactionEntryPointEnum.ActivateBid),t}return o(t,e),t.prototype.validator=function(e){return this._validator=y.CLValue.newCLPublicKey(e),this},t.prototype.build=function(){return this._runtimeArgs=f.Args.fromMap({validator:this._validator}),e.prototype.build.call(this)},t.prototype.buildFor1_5=function(){var e,t;this._runtimeArgs=f.Args.fromMap({validator:this._validator});var r=null!==(t=null!==(e=this._contractHash)&&void 0!==e?e:g.AuctionManagerContractHashMap[this._chainName])&&void 0!==t?t:g.AuctionManagerContractHashMap.casper;if(!r)throw new Error("Contract hash is undefined. Check _contractHash or _chainName: ".concat(this._chainName));var n=new m.ExecutableDeployItem;n.storedContractByHash=new m.StoredContractByHash(l.ContractHash.newContract(r),v.AuctionManagerEntryPoint.activateBid,this._runtimeArgs);var o=b.Deploy.makeDeploy(this._getDefaultDeployHeader(),this._getStandardPayment(),n);return d.Transaction.fromDeploy(o)},t}(w);t.NativeActivateBidBuilder=j;var T=function(e){function t(){var t=e.call(this)||this;return t._invocationTarget=new s.TransactionTarget({}),t._entryPoint=new u.TransactionEntryPoint(u.TransactionEntryPointEnum.ChangeBidPublicKey),t}return o(t,e),t.prototype.previousPublicKey=function(e){return this._public_key=y.CLValue.newCLPublicKey(e),this},t.prototype.newPublicKey=function(e){return this._new_public_key=y.CLValue.newCLPublicKey(e),this},t.prototype.build=function(){return this._runtimeArgs=f.Args.fromMap({public_key:this._public_key,new_public_key:this._new_public_key}),e.prototype.build.call(this)},t}(w);t.NativeChangeBidPublicKeyBuilder=T;var N=function(e){function t(){return e.call(this)||this}return o(t,e),t.prototype.byHash=function(e){var t=new s.TransactionInvocationTarget;t.byHash=l.Hash.fromHex(e),this._transactionInvocationTarget=t;var r=new s.StoredTarget;return r.id=t,r.runtime=s.TransactionRuntime.vmCasperV1(),this._invocationTarget=new s.TransactionTarget(void 0,r),this},t.prototype.byName=function(e){var t=new s.TransactionInvocationTarget;t.byName=e,this._transactionInvocationTarget=t;var r=new s.StoredTarget;return r.id=t,r.runtime=s.TransactionRuntime.vmCasperV1(),this._invocationTarget=new s.TransactionTarget(void 0,r),this},t.prototype.byPackageHash=function(e,t,r){void 0===r&&(r=null);var n=new s.ByPackageHashInvocationTarget;n.addr=l.Hash.fromHex(e),n.version=t,n.protocolVersionMajor=r;var o=new s.TransactionInvocationTarget;o.byPackageHash=n,this._transactionInvocationTarget=o;var i=new s.StoredTarget;return i.id=o,i.runtime=s.TransactionRuntime.vmCasperV1(),this._invocationTarget=new s.TransactionTarget(void 0,i),this},t.prototype.byPackageName=function(e,t,r){void 0===r&&(r=null);var n=new s.ByPackageNameInvocationTarget;n.name=e,n.version=t,n.protocolVersionMajor=r;var o=new s.TransactionInvocationTarget;o.byPackageName=n,this._transactionInvocationTarget=o;var i=new s.StoredTarget;return i.id=o,i.runtime=s.TransactionRuntime.vmCasperV1(),this._invocationTarget=new s.TransactionTarget(void 0,i),this},t.prototype.entryPoint=function(e){return this._entryPoint=new u.TransactionEntryPoint(u.TransactionEntryPointEnum.Custom,e),this},t.prototype.runtimeArgs=function(e){return this._runtimeArgs=e,this},t.prototype.buildFor1_5=function(){if(!this._entryPoint.customEntryPoint)throw new Error("EntryPoint is not specified");var e=new m.ExecutableDeployItem;this._transactionInvocationTarget.byHash?e.storedContractByHash=new m.StoredContractByHash(l.ContractHash.newContract(this._transactionInvocationTarget.byHash.toHex()),this._entryPoint.customEntryPoint,this._runtimeArgs):this._transactionInvocationTarget.byPackageHash?e.storedVersionedContractByHash=new m.StoredVersionedContractByHash(l.ContractHash.newContract(this._transactionInvocationTarget.byPackageHash.addr.toHex()),this._entryPoint.customEntryPoint,this._runtimeArgs,this._transactionInvocationTarget.byPackageHash.version):this._transactionInvocationTarget.byName?e.storedContractByName=new m.StoredContractByName(this._transactionInvocationTarget.byName,this._entryPoint.customEntryPoint,this._runtimeArgs):this._transactionInvocationTarget.byPackageName&&(e.storedVersionedContractByName=new m.StoredVersionedContractByName(this._transactionInvocationTarget.byPackageName.name,this._entryPoint.customEntryPoint,this._runtimeArgs,this._transactionInvocationTarget.byPackageName.version));var t=b.Deploy.makeDeploy(this._getDefaultDeployHeader(),this._getStandardPayment(),e);return d.Transaction.fromDeploy(t)},t}(w);t.ContractCallBuilder=N;var P=function(e){function t(){var t=e.call(this)||this;return t._isInstallOrUpgrade=!1,t._entryPoint=new u.TransactionEntryPoint(u.TransactionEntryPointEnum.Call),t}return o(t,e),t.prototype.wasm=function(e){var t=new s.SessionTarget;return t.moduleBytes=e,t.isInstallUpgrade=this._isInstallOrUpgrade,t.runtime=s.TransactionRuntime.vmCasperV1(),this._invocationTarget=new s.TransactionTarget(void 0,void 0,t),this},t.prototype.installOrUpgrade=function(){var e;return this._isInstallOrUpgrade=!0,(null===(e=this._invocationTarget)||void 0===e?void 0:e.session)&&(this._invocationTarget.session.isInstallUpgrade=!0),this},t.prototype.runtimeArgs=function(e){return this._runtimeArgs=e,this},t.prototype.buildFor1_5=function(){var e;if(!(null===(e=this._invocationTarget.session)||void 0===e?void 0:e.moduleBytes))throw new Error("EntryPoint is not specified");var t=m.ExecutableDeployItem.newModuleBytes(this._invocationTarget.session.moduleBytes,this._runtimeArgs),r=b.Deploy.makeDeploy(this._getDefaultDeployHeader(),this._getStandardPayment(),t);return d.Transaction.fromDeploy(r)},t}(w);t.SessionBuilder=P},2151:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionEntryPoint=t.TransactionEntryPointTag=t.TransactionEntryPointEnum=void 0;var i,a,s=r(9592),u=r(5466),c=r(9213);!function(e){e.Custom="Custom",e.Transfer="Transfer",e.AddBid="AddBid",e.WithdrawBid="WithdrawBid",e.Delegate="Delegate",e.Undelegate="Undelegate",e.Redelegate="Redelegate",e.ActivateBid="ActivateBid",e.ChangeBidPublicKey="ChangeBidPublicKey",e.Call="Call",e.AddReservations="AddReservations",e.CancelReservations="CancelReservations"}(i=t.TransactionEntryPointEnum||(t.TransactionEntryPointEnum={})),function(e){e[e.Call=0]="Call",e[e.Custom=1]="Custom",e[e.Transfer=2]="Transfer",e[e.AddBid=3]="AddBid",e[e.WithdrawBid=4]="WithdrawBid",e[e.Delegate=5]="Delegate",e[e.Undelegate=6]="Undelegate",e[e.Redelegate=7]="Redelegate",e[e.ActivateBid=8]="ActivateBid",e[e.ChangeBidPublicKey=9]="ChangeBidPublicKey",e[e.AddReservations=10]="AddReservations",e[e.CancelReservations=11]="CancelReservations"}(a=t.TransactionEntryPointTag||(t.TransactionEntryPointTag={}));var f=function(){function e(e,t){if(e===i.Custom&&!t)throw new Error("When specifying Custom entry point, customEntryPoint must be provided");this.type=e,this.customEntryPoint=t}var t;return t=e,e.prototype.tag=function(){switch(this.type){case i.Transfer:return a.Transfer;case i.AddBid:return a.AddBid;case i.WithdrawBid:return a.WithdrawBid;case i.Delegate:return a.Delegate;case i.Undelegate:return a.Undelegate;case i.Redelegate:return a.Redelegate;case i.ActivateBid:return a.ActivateBid;case i.ChangeBidPublicKey:return a.ChangeBidPublicKey;case i.Call:return a.Call;case i.AddReservations:return a.AddReservations;case i.CancelReservations:return a.CancelReservations;case i.Custom:return a.Custom;default:throw new Error("Unknown TransactionEntryPointTag")}},e.prototype.toBytes=function(){var e=new c.CalltableSerialization,t=this.tag();if(e.addField(0,Uint8Array.from([t])),this.type===i.Custom&&this.customEntryPoint){var r=u.CLValue.newCLString(this.customEntryPoint).bytes();e.addField(1,r)}return e.toBytes()},e.prototype.toJSON=function(){return this.type===i.Custom&&this.customEntryPoint?{Custom:this.customEntryPoint}:this.type},e.fromJSON=function(e){if(null==e?void 0:e.Custom)return new t(i.Custom,e.Custom);switch(e){case i.Transfer:return new t(i.Transfer);case i.AddBid:return new t(i.AddBid);case i.WithdrawBid:return new t(i.WithdrawBid);case i.Delegate:return new t(i.Delegate);case i.Undelegate:return new t(i.Undelegate);case i.Redelegate:return new t(i.Redelegate);case i.ActivateBid:return new t(i.ActivateBid);case i.ChangeBidPublicKey:return new t(i.ChangeBidPublicKey);case i.Call:return new t(i.Call);case i.AddReservations:return new t(i.AddReservations);case i.CancelReservations:return new t(i.CancelReservations);default:throw new Error("Unknown entry point")}},e.fromBytes=function(e){var r=c.CalltableSerialization.fromBytes(e),n=r.getField(0);if(!n||1!==n.length)throw new Error("Invalid tag bytes");var o=n[0],s=function(){switch(o){case a.Transfer:return i.Transfer;case a.AddBid:return i.AddBid;case a.WithdrawBid:return i.WithdrawBid;case a.Delegate:return i.Delegate;case a.Undelegate:return i.Undelegate;case a.Redelegate:return i.Redelegate;case a.ActivateBid:return i.ActivateBid;case a.ChangeBidPublicKey:return i.ChangeBidPublicKey;case a.Call:return i.Call;case a.AddReservations:return i.AddReservations;case a.CancelReservations:return i.CancelReservations;case a.Custom:return i.Custom;default:throw new Error("Unknown tag")}}();if(s===i.Custom){var f=r.getField(1);if(!f)throw new Error("Missing custom entry point bytes for Custom type");var l=c.CalltableSerialization.fromBytes(f),d=l.getField(0);if(!d||1!==d[0])throw new Error("Invalid flag for Custom type");var h=l.getField(1);if(!h)throw new Error("Invalid custom entry point bytes");var p=u.CLValueString.fromBytes(h).result.toString();return new t(s,p)}return new t(s)},n([(0,s.jsonMember)({constructor:String}),o("design:type",String)],e.prototype,"type",void 0),n([(0,s.jsonMember)({constructor:String}),o("design:type",String)],e.prototype,"customEntryPoint",void 0),t=n([s.jsonObject,o("design:paramtypes",[String,String])],e)}();t.TransactionEntryPoint=f},5731:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionScheduling=t.FutureTimestampScheduling=t.FutureEraScheduling=t.TransactionSchedulingTag=void 0;var i,a=r(9592),s=r(6500),u=r(5466),c=r(9213),f=r(678);!function(e){e[e.Native=0]="Native",e[e.FutureEra=1]="FutureEra",e[e.FutureTimestamp=2]="FutureTimestamp"}(i=t.TransactionSchedulingTag||(t.TransactionSchedulingTag={}));var l=function(){function e(e){this.eraID=e}return e.prototype.toBytes=function(){var e=new c.CalltableSerialization;return e.addField(0,Uint8Array.of(1)),e.addField(1,u.CLValue.newCLUint64(this.eraID).bytes()),e.toBytes()},n([(0,a.jsonMember)({constructor:Number,name:"EraID"}),o("design:type",Number)],e.prototype,"eraID",void 0),n([a.jsonObject,o("design:paramtypes",[Number])],e)}();t.FutureEraScheduling=l;var d=function(){function e(e){this.timestamp=e}return e.prototype.toBytes=function(){var e=new c.CalltableSerialization;return e.addField(0,Uint8Array.of(2)),e.addField(1,(0,f.toBytesU64)(Date.parse(this.timestamp.toJSON()))),e.toBytes()},n([(0,a.jsonMember)({name:"FutureTimestamp",constructor:s.Timestamp,deserializer:function(e){return s.Timestamp.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.Timestamp)],e.prototype,"timestamp",void 0),n([a.jsonObject,o("design:paramtypes",[s.Timestamp])],e)}();t.FutureTimestampScheduling=d;var h=function(){function e(e,t,r){this.standard=e,this.futureEra=t,this.futureTimestamp=r}var t;return t=e,e.prototype.tag=function(){return this.standard?i.Native:this.futureEra?i.FutureEra:this.futureTimestamp?i.FutureTimestamp:0},e.prototype.toBytes=function(){if(this.standard){var e=new c.CalltableSerialization;return e.addField(0,Uint8Array.of(0)),e.toBytes()}if(this.futureEra)return this.futureEra.toBytes();if(this.futureTimestamp)return this.futureTimestamp.toBytes();throw new Error("Unable to serialize TransactionScheduling")},e.fromJSON=function(e){if("Standard"===e)return new t({});if("object"==typeof e){if("FutureEra"in e)return new t(void 0,new l(e.FutureEra));if("FutureTimestamp"in e)return new t(void 0,void 0,new d(e.FutureEra))}throw new Error("Invalid JSON format for TransactionScheduling")},e.prototype.toJSON=function(){if(this.standard)return"Standard";if(this.futureTimestamp)return{FutureTimestamp:this.futureTimestamp.timestamp.date.toISOString()};if(this.futureEra)return{FutureEra:this.futureEra.eraID};throw new Error("Unknown scheduling type")},e.fromBytes=function(e){var r=c.CalltableSerialization.fromBytes(e),n=r.getField(0);if(!n||1!==n.length)throw new Error("Invalid or missing tag in serialized TransactionScheduling");var o=n[0];switch(o){case i.Native:return new t({});case i.FutureEra:var a=r.getField(1);if(!a)throw new Error("Missing eraID field for FutureEra scheduling");var u=(0,f.fromBytesU64)(a).toNumber();return new t(void 0,new l(u));case i.FutureTimestamp:var h=r.getField(1);if(!h)throw new Error("Missing timestamp field for FutureTimestamp scheduling");var p=(0,f.fromBytesU64)(h).toNumber(),y=new s.Timestamp(new Date(p));return new t(void 0,void 0,new d(y));default:throw new Error("Unknown TransactionSchedulingTag: ".concat(o))}},n([(0,a.jsonMember)({name:"Standard",constructor:Object}),o("design:type",Object)],e.prototype,"standard",void 0),n([(0,a.jsonMember)({name:"FutureEra",constructor:l}),o("design:type",l)],e.prototype,"futureEra",void 0),n([(0,a.jsonMember)({name:"FutureTimestamp",constructor:d}),o("design:type",d)],e.prototype,"futureTimestamp",void 0),t=n([a.jsonObject,o("design:paramtypes",[Object,l,d])],e)}();t.TransactionScheduling=h},7012:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionTarget=t.SessionTarget=t.StoredTarget=t.TransactionInvocationTarget=t.ByPackageNameInvocationTarget=t.ByPackageHashInvocationTarget=t.TransactionRuntime=void 0;var a=i(r(5187)),s=r(6077),u=r(8905),c=r(9592),f=r(3401),l=r(5466),d=r(9213),h=r(2428),p=function(){function e(){this._tag=t.VM_CASPER_V1_TAG}var t;return t=e,e.fromJSON=function(e){switch(e){case"VmCasperV1":return t.vmCasperV1();case"VmCasperV2":return t.vmCasperV2();default:throw new Error("Unknown TransactionRuntime '".concat(e,"'"))}},e.prototype.toJSON=function(){switch(this._tag){case t.VM_CASPER_V1_TAG:return"VmCasperV1";case t.VM_CASPER_V2_TAG:return"VmCasperV2";default:throw new Error("Unknown TransactionRuntime '".concat(this._tag,"'"))}},e.vmCasperV1=function(){var e=new t;return e._tag=t.VM_CASPER_V1_TAG,e},e.vmCasperV2=function(){var e=new t;return e._tag=t.VM_CASPER_V2_TAG,e},e.prototype.toBytes=function(){return(new d.CalltableSerialization).addField(t.TAG_FIELD_INDEX,Uint8Array.of(this._tag)).toBytes()},e.VM_CASPER_V1_TAG=0,e.VM_CASPER_V2_TAG=1,e.TAG_FIELD_INDEX=0,t=n([c.jsonObject],e)}();t.TransactionRuntime=p;var y=function(){function e(){}return e.prototype.toBytes=function(){var e=new d.CalltableSerialization,t=this.version?l.CLValue.newCLOption(l.CLValue.newCLUInt32(s.BigNumber.from(this.version))).bytes():new l.CLValueOption(null,new l.CLTypeOption(l.CLTypeUInt32)).bytes();return e.addField(0,Uint8Array.of(2)),e.addField(1,this.addr.toBytes()),e.addField(2,t),this.protocolVersionMajor&&e.addField(3,l.CLValue.newCLUInt32(s.BigNumber.from(this.protocolVersionMajor)).bytes()),e.toBytes()},n([(0,c.jsonMember)({name:"addr",constructor:f.Hash,deserializer:function(e){return f.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",f.Hash)],e.prototype,"addr",void 0),n([(0,c.jsonMember)({name:"version",isRequired:!1,constructor:Number}),o("design:type",Number)],e.prototype,"version",void 0),n([(0,c.jsonMember)({name:"protocol_version_major",constructor:Number,isRequired:!1,preserveNull:!1}),o("design:type",Object)],e.prototype,"protocolVersionMajor",void 0),n([c.jsonObject],e)}();t.ByPackageHashInvocationTarget=y;var m=function(){function e(){}return e.prototype.toBytes=function(){var e=new d.CalltableSerialization,t=this.version?l.CLValue.newCLOption(l.CLValue.newCLUInt32(s.BigNumber.from(this.version))).bytes():new l.CLValueOption(null,new l.CLTypeOption(l.CLTypeUInt32)).bytes();return e.addField(0,Uint8Array.of(3)),e.addField(1,l.CLValue.newCLString(this.name).bytes()),e.addField(2,t),this.protocolVersionMajor&&e.addField(3,l.CLValue.newCLUInt32(s.BigNumber.from(this.protocolVersionMajor)).bytes()),e.toBytes()},n([(0,c.jsonMember)({name:"name",constructor:String}),o("design:type",String)],e.prototype,"name",void 0),n([(0,c.jsonMember)({name:"version",isRequired:!1,constructor:Number}),o("design:type",Number)],e.prototype,"version",void 0),n([(0,c.jsonMember)({name:"protocol_version_major",constructor:Number,isRequired:!1,preserveNull:!1}),o("design:type",Object)],e.prototype,"protocolVersionMajor",void 0),n([c.jsonObject],e)}();t.ByPackageNameInvocationTarget=m;var b=function(){function e(){}var t;return t=e,e.prototype.toBytes=function(){var e;if(this.byHash)return(e=new d.CalltableSerialization).addField(0,Uint8Array.of(0)),e.addField(1,this.byHash.toBytes()),e.toBytes();if(this.byName)return(e=new d.CalltableSerialization).addField(0,Uint8Array.of(1)),e.addField(1,l.CLValue.newCLString(this.byName).bytes()),e.toBytes();if(this.byPackageHash)return this.byPackageHash.toBytes();if(this.byPackageName)return this.byPackageName.toBytes();throw new Error("Can not convert TransactionInvocationTarget to bytes. Missing values from initialization")},e.fromBytes=function(e){var r=d.CalltableSerialization.fromBytes(e),n=r.getField(0);if(!n||1!==n.length)throw new Error("Invalid or missing tag in serialized TransactionInvocationTarget");var o=n[0],i=new t;switch(o){case 0:var a=r.getField(1);if(!a)throw new Error("Missing hash field for ByHash target");return i.byHash=f.Hash.fromBytes(a).result,i;case 1:if(!(w=r.getField(1)))throw new Error("Missing name field for ByName target");return i.byName=l.CLValueString.fromBytes(w).result.toString(),i;case 2:var u=r.getField(1),c=r.getField(2),h=r.getField(3);if(!u||!c)throw new Error("Missing fields for ByPackageHash target");var p=null;h&&(p=l.CLValueUInt32.fromBytes(h).result.toNumber());var b=f.Hash.fromBytes(u),g=l.CLValueOption.fromBytes(c,new l.CLTypeOption(l.CLTypeUInt32)).result.toString(),v=new y;return v.addr=b.result,v.version=s.BigNumber.from(g).toNumber(),v.protocolVersionMajor=p,i.byPackageHash=v,i;case 3:var w=r.getField(1);if(c=r.getField(2),h=r.getField(3),!w||!c)throw new Error("Missing fields for ByPackageName target");p=null,h&&(p=l.CLValueUInt32.fromBytes(h).result.toNumber());var S=l.CLValueString.fromBytes(w).result.toString(),M=(g=l.CLValueOption.fromBytes(c,new l.CLTypeOption(l.CLTypeUInt32)).result.toString(),new m);return M.version=s.BigNumber.from(g).toNumber(),M.name=S,M.protocolVersionMajor=p,i.byPackageName=M,i;default:throw new Error("Unknown TransactionInvocationTarget tag: ".concat(o))}},n([(0,c.jsonMember)({name:"ByHash",isRequired:!1,constructor:f.Hash,deserializer:function(e){if(e)return f.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",f.Hash)],e.prototype,"byHash",void 0),n([(0,c.jsonMember)({name:"ByName",isRequired:!1,constructor:String}),o("design:type",String)],e.prototype,"byName",void 0),n([(0,c.jsonMember)({name:"ByPackageHash",isRequired:!1,constructor:y}),o("design:type",y)],e.prototype,"byPackageHash",void 0),n([(0,c.jsonMember)({name:"ByPackageName",isRequired:!1,constructor:m}),o("design:type",m)],e.prototype,"byPackageName",void 0),t=n([c.jsonObject],e)}();t.TransactionInvocationTarget=b;var g=function(){function e(){}return e.prototype.toBytes=function(){var e=new d.CalltableSerialization;return e.addField(0,Uint8Array.of(1)),e.addField(1,this.id.toBytes()),e.addField(2,this.runtime.toBytes()),e.toBytes()},n([(0,c.jsonMember)({name:"id",constructor:b}),o("design:type",b)],e.prototype,"id",void 0),n([(0,c.jsonMember)({name:"runtime",constructor:p,deserializer:function(e){if(e)return p.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",p)],e.prototype,"runtime",void 0),n([c.jsonObject],e)}();t.StoredTarget=g;var v=function(){function e(){}return e.prototype.toBytes=function(){var e=new Uint8Array(new Uint32Array([this.moduleBytes.length]).buffer),t=new d.CalltableSerialization;return t.addField(0,Uint8Array.of(2)),t.addField(1,new Uint8Array([this.isInstallUpgrade?1:0])),t.addField(2,this.runtime.toBytes()),t.addField(3,(0,u.concat)([e,this.moduleBytes])),t.toBytes()},n([(0,c.jsonMember)({name:"module_bytes",constructor:Uint8Array,deserializer:h.byteArrayJsonDeserializer,serializer:h.byteArrayJsonSerializer}),o("design:type",Uint8Array)],e.prototype,"moduleBytes",void 0),n([(0,c.jsonMember)({name:"runtime",constructor:p,deserializer:function(e){if(e)return p.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",p)],e.prototype,"runtime",void 0),n([(0,c.jsonMember)({name:"is_install_upgrade",constructor:Boolean}),o("design:type",Boolean)],e.prototype,"isInstallUpgrade",void 0),n([c.jsonObject],e)}();t.SessionTarget=v;var w=function(){function e(e,t,r){this.native=e,this.stored=t,this.session=r}var t;return t=e,e.prototype.toBytes=function(){if(this.native){var e=new d.CalltableSerialization;return e.addField(0,Uint8Array.of(0)),e.toBytes()}if(this.stored)return this.stored.toBytes();if(this.session)return this.session.toBytes();throw new Error("Can not convert TransactionTarget to bytes. Missing values ( native | stored | session ) from initialization")},e.fromJSON=function(e){var r=new t;if("string"==typeof e&&"Native"===e)r.native={};else if(e.Stored){var n=new c.TypedJSON(g);r.stored=n.parse(e.Stored)}else e.Session&&(n=new c.TypedJSON(v),r.session=n.parse(e.Session));return r},e.prototype.toJSON=function(){if(void 0!==this.native)return"Native";if(void 0!==this.stored)return{Stored:new c.TypedJSON(g).toPlainJson(this.stored)};if(void 0!==this.session)return{Session:new c.TypedJSON(v).toPlainJson(this.session)};throw new Error("unknown target type")},e.newTransactionTargetFromSession=function(e){var r=new t;if(void 0!==e.transfer)return r.native={},r;if(void 0!==e.moduleBytes){var n=new v;return n.moduleBytes=e.moduleBytes.moduleBytes,n.runtime=p.vmCasperV1(),r.session=n,r}if(void 0!==e.storedContractByHash){var o=new g;return(c=new b).byHash=e.storedContractByHash.hash.hash,o.runtime=p.vmCasperV1(),o.id=c,r.stored=o,r}if(void 0!==e.storedContractByName)return o=new g,(c=new b).byName=e.storedContractByName.name,o.runtime=p.vmCasperV1(),o.id=c,r.stored=o,r;if(void 0!==e.storedVersionedContractByHash){var i=void 0;if(void 0!==e.storedVersionedContractByHash.version&&!(0,a.default)(e.storedVersionedContractByHash.version)){var s=parseInt(e.storedVersionedContractByHash.version.toString(),10);isNaN(s)||(i=s)}var u=new y;return u.addr=e.storedVersionedContractByHash.hash.hash,u.version=i,u.protocolVersionMajor=null,(c=new b).byPackageHash=u,(o=new g).runtime=p.vmCasperV1(),o.id=c,r.stored=o,r}if(void 0!==e.storedVersionedContractByName){i=void 0,void 0===e.storedVersionedContractByName.version||(0,a.default)(e.storedVersionedContractByName.version)||(s=parseInt(e.storedVersionedContractByName.version.toString(),10),isNaN(s)||(i=s));var c,f=new m;return f.name=e.storedVersionedContractByName.name,f.version=i,f.protocolVersionMajor=null,(c=new b).byPackageName=f,(o=new g).runtime=p.vmCasperV1(),o.id=c,r.stored=o,r}return new t},n([(0,c.jsonMember)({constructor:Object,name:"Native"}),o("design:type",Object)],e.prototype,"native",void 0),n([(0,c.jsonMember)({name:"Stored",constructor:g}),o("design:type",g)],e.prototype,"stored",void 0),n([(0,c.jsonMember)({name:"Session",constructor:v}),o("design:type",v)],e.prototype,"session",void 0),t=n([c.jsonObject,o("design:paramtypes",[Object,g,v])],e)}();t.TransactionTarget=w},5596:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionV1Payload=t.PayloadFields=void 0;var i=r(9592),a=r(3771),s=r(6500),u=r(6200),c=r(9960),f=r(7012),l=r(2151),d=r(5731),h=r(9213),p=r(2428),y=r(5466),m=r(678),b=function(){function e(){this.fields=new Map}var t;return t=e,e.build=function(e,r,n,o){var i=[];if(e||i.push("args"),r||i.push("transactionTarget"),n||i.push("transactionEntryPoint"),o||i.push("transactionScheduling"),i.length>0)throw new Error("Failed to build PayloadFields: Missing or invalid fields: ".concat(i.join(", "),"."));var a=new t;return a.args=e,a.target=r,a.entryPoint=n,a.scheduling=o,a},e.prototype.addField=function(e,t){this.fields.set(e,t)},e.prototype.getFieldValue=function(e){return this.fields.get(e)},e.prototype.toBytes=function(){var e=new ArrayBuffer(1024),t=new DataView(e),r=0;r=(0,m.writeInteger)(t,r,this.fields.size);for(var n=0,o=Array.from(this.fields.entries());n<o.length;n++){var i=o[n],a=i[0],s=i[1];r+2>e.byteLength&&(e=(0,m.expandBuffer)(e,r+2),t=new DataView(e)),(r=(0,m.writeUShort)(t,r,a))+s.length>e.byteLength&&(e=(0,m.expandBuffer)(e,r+s.length),t=new DataView(e)),r=(0,m.writeBytes)(t,r,s)}return new Uint8Array(e,0,r)},n([(0,i.jsonMember)(function(){return c.Args},{deserializer:p.deserializeArgs,serializer:function(e){return(0,p.serializeArgs)(e,!0)}}),o("design:type",c.Args)],e.prototype,"args",void 0),n([(0,i.jsonMember)({name:"target",constructor:f.TransactionTarget,deserializer:function(e){return f.TransactionTarget.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",f.TransactionTarget)],e.prototype,"target",void 0),n([(0,i.jsonMember)({name:"entry_point",constructor:l.TransactionEntryPoint,deserializer:function(e){return l.TransactionEntryPoint.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",l.TransactionEntryPoint)],e.prototype,"entryPoint",void 0),n([(0,i.jsonMember)({name:"scheduling",constructor:d.TransactionScheduling,deserializer:function(e){return d.TransactionScheduling.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",d.TransactionScheduling)],e.prototype,"scheduling",void 0),t=n([i.jsonObject],e)}();t.PayloadFields=b;var g=function(){function e(){}var t;return t=e,e.prototype.toBytes=function(){var e=new ArrayBuffer(1024),t=new DataView(e),r=0;t.setUint8(r,0),(r+=1)+4>e.byteLength&&(e=(0,m.expandBuffer)(e,r+4),t=new DataView(e)),t.setUint32(r,this.fields.args.args.size,!0),r+=4;for(var n=0,o=Array.from(this.fields.args.args.entries());n<o.length;n++){var i=o[n],a=i[0],s=i[1],u=new c.NamedArg(a,s),f=c.NamedArg.toBytesWithNamedArg(u);r+f.length>e.byteLength&&(e=(0,m.expandBuffer)(e,r+f.length),t=new DataView(e)),new Uint8Array(e,r).set(f),r+=f.length}var l=new Uint8Array(e,0,r),d=new b,p=new Uint8Array(l.length+4);new DataView(p.buffer).setUint32(0,l.length,!0),p.set(l,4),d.addField(0,p);var g=this.fields.target.toBytes(),v=new Uint8Array(g.length+4);new DataView(v.buffer).setUint32(0,g.length,!0),v.set(g,4),d.addField(1,v);var w=this.fields.entryPoint.toBytes(),S=new Uint8Array(w.length+4);new DataView(S.buffer).setUint32(0,w.length,!0),S.set(w,4),d.addField(2,S);var M=this.fields.scheduling.toBytes(),_=new Uint8Array(M.length+4);return new DataView(_.buffer).setUint32(0,M.length,!0),_.set(M,4),d.addField(3,_),(new h.CalltableSerialization).addField(0,this.initiatorAddr.toBytes()).addField(1,y.CLValue.newCLUint64(this.timestamp.toMilliseconds()).bytes()).addField(2,y.CLValue.newCLUint64(this.ttl.duration).bytes()).addField(3,y.CLValue.newCLString(this.chainName).bytes()).addField(4,this.pricingMode.toBytes()).addField(5,d.toBytes()).toBytes()},e.build=function(e){var r=e.initiatorAddr,n=e.args,o=e.ttl,i=e.entryPoint,a=e.pricingMode,s=e.timestamp,u=e.transactionTarget,c=e.scheduling,f=e.chainName,l=b.build(n,u,i,c),d=new t;return d.initiatorAddr=r,d.ttl=o,d.pricingMode=a,d.timestamp=s,d.chainName=f,d.fields=l,d},n([(0,i.jsonMember)({name:"initiator_addr",constructor:a.InitiatorAddr,deserializer:function(e){return a.InitiatorAddr.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.InitiatorAddr)],e.prototype,"initiatorAddr",void 0),n([(0,i.jsonMember)({name:"timestamp",constructor:s.Timestamp,deserializer:function(e){return s.Timestamp.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.Timestamp)],e.prototype,"timestamp",void 0),n([(0,i.jsonMember)({name:"ttl",constructor:s.Duration,deserializer:function(e){return s.Duration.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.Duration)],e.prototype,"ttl",void 0),n([(0,i.jsonMember)({name:"pricing_mode",constructor:u.PricingMode}),o("design:type",u.PricingMode)],e.prototype,"pricingMode",void 0),n([(0,i.jsonMember)({name:"chain_name",constructor:String}),o("design:type",String)],e.prototype,"chainName",void 0),n([(0,i.jsonMember)({name:"fields",constructor:b}),o("design:type",b)],e.prototype,"fields",void 0),t=n([i.jsonObject],e)}();t.TransactionV1Payload=g},6838:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Transfer=t.TransferV2=t.TransferV1=void 0;var i=r(9592),a=r(9125),s=r(3771),u=r(3401),c=r(5466),f=r(6077),l=function(){function e(){}return n([(0,i.jsonMember)({constructor:c.CLValueUInt512,deserializer:function(e){return c.CLValueUInt512.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",c.CLValueUInt512)],e.prototype,"amount",void 0),n([(0,i.jsonMember)({name:"deploy_hash",constructor:u.Hash,deserializer:function(e){return u.Hash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",u.Hash)],e.prototype,"deployHash",void 0),n([(0,i.jsonMember)({constructor:u.AccountHash,deserializer:function(e){return u.AccountHash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",u.AccountHash)],e.prototype,"from",void 0),n([(0,i.jsonMember)({constructor:Number,deserializer:function(e){return f.BigNumber.from(e).toNumber()},serializer:function(e){return f.BigNumber.from(e).toString()}}),o("design:type",Number)],e.prototype,"gas",void 0),n([(0,i.jsonMember)({constructor:Number}),o("design:type",Number)],e.prototype,"id",void 0),n([(0,i.jsonMember)({constructor:u.URef,deserializer:function(e){return u.URef.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",u.URef)],e.prototype,"source",void 0),n([(0,i.jsonMember)({constructor:u.URef,deserializer:function(e){return u.URef.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",u.URef)],e.prototype,"target",void 0),n([(0,i.jsonMember)({constructor:u.AccountHash,deserializer:function(e){if(e)return u.AccountHash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.AccountHash)],e.prototype,"to",void 0),n([i.jsonObject],e)}();t.TransferV1=l;var d=function(){function e(){}return n([(0,i.jsonMember)({constructor:c.CLValueUInt512,deserializer:function(e){return c.CLValueUInt512.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",c.CLValueUInt512)],e.prototype,"amount",void 0),n([(0,i.jsonMember)({name:"transaction_hash",constructor:a.TransactionHash}),o("design:type",a.TransactionHash)],e.prototype,"transactionHash",void 0),n([(0,i.jsonMember)({constructor:s.InitiatorAddr,deserializer:function(e){return s.InitiatorAddr.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.InitiatorAddr)],e.prototype,"from",void 0),n([(0,i.jsonMember)({constructor:Number,deserializer:function(e){return f.BigNumber.from(e).toNumber()},serializer:function(e){return f.BigNumber.from(e).toString()}}),o("design:type",Number)],e.prototype,"gas",void 0),n([(0,i.jsonMember)({constructor:Number}),o("design:type",Number)],e.prototype,"id",void 0),n([(0,i.jsonMember)({constructor:u.URef,deserializer:function(e){return u.URef.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",u.URef)],e.prototype,"source",void 0),n([(0,i.jsonMember)({constructor:u.URef,deserializer:function(e){return u.URef.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",u.URef)],e.prototype,"target",void 0),n([(0,i.jsonMember)({constructor:u.AccountHash,deserializer:function(e){if(e)return u.AccountHash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.AccountHash)],e.prototype,"to",void 0),n([i.jsonObject],e)}();t.TransferV2=d;var h=function(){function e(){}return n([(0,i.jsonMember)({name:"Version1",constructor:l}),o("design:type",l)],e.prototype,"Version1",void 0),n([(0,i.jsonMember)({name:"Version2",constructor:d}),o("design:type",d)],e.prototype,"Version2",void 0),n([i.jsonObject],e)}(),p=function(){function e(){}var t;return t=e,e.prototype.getTransferV1=function(){return this.originTransferV1},e.prototype.getTransferV2=function(){return this.originTransferV2},e.fromJSON=function(e){var r=i.TypedJSON.parse(e,h);if(null==r?void 0:r.Version2){var n=new t;return n.amount=r.Version2.amount,n.transactionHash=r.Version2.transactionHash,n.from=r.Version2.from,n.gas=r.Version2.gas,n.id=r.Version2.id,n.source=r.Version2.source,n.target=r.Version2.target,n.to=r.Version2.to,n.originTransferV2=r.Version2,n}if(null==r?void 0:r.Version1)return t.fromTransferV1(r.Version1);var o=i.TypedJSON.parse(e,l);if(o)return t.fromTransferV1(o);throw new Error("Incorrect RPC response structure")},e.fromTransferV1=function(e){var r=new t;return r.amount=e.amount,r.transactionHash=a.TransactionHash.fromDeployHash(e.deployHash),r.from=new s.InitiatorAddr(void 0,e.from),r.gas=e.gas,r.id=e.id,r.source=e.source,r.target=e.target,r.to=e.to,r.originTransferV1=e,r},n([(0,i.jsonMember)({constructor:c.CLValueUInt512,deserializer:function(e){return c.CLValueUInt512.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",c.CLValueUInt512)],e.prototype,"amount",void 0),n([(0,i.jsonMember)({name:"transaction_hash",constructor:a.TransactionHash}),o("design:type",a.TransactionHash)],e.prototype,"transactionHash",void 0),n([(0,i.jsonMember)({constructor:s.InitiatorAddr,deserializer:function(e){return s.InitiatorAddr.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.InitiatorAddr)],e.prototype,"from",void 0),n([(0,i.jsonMember)({constructor:Number,deserializer:function(e){return f.BigNumber.from(e).toNumber()},serializer:function(e){return f.BigNumber.from(e).toString()}}),o("design:type",Number)],e.prototype,"gas",void 0),n([(0,i.jsonMember)({constructor:Number}),o("design:type",Number)],e.prototype,"id",void 0),n([(0,i.jsonMember)({constructor:u.URef,deserializer:function(e){return u.URef.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",u.URef)],e.prototype,"source",void 0),n([(0,i.jsonMember)({constructor:u.URef,deserializer:function(e){return u.URef.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",u.URef)],e.prototype,"target",void 0),n([(0,i.jsonMember)({constructor:u.AccountHash,deserializer:function(e){if(e)return u.AccountHash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",u.AccountHash)],e.prototype,"to",void 0),t=n([i.jsonObject],e)}();t.Transfer=p},8057:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.NamedKeyKind=t.TransformKey=t.Transform=t.TransformKind=void 0;var i=r(9592),a=r(3401),s=r(9960),u=r(2428),c=r(1527),f=function(){function e(e){this.data=e}var t;return t=e,Object.defineProperty(e.prototype,"transformationData",{get:function(){return this.data},enumerable:!1,configurable:!0}),e.fromJSON=function(e){if(!e)throw new Error("TransformKind: fromJSON on empty string");return new t(e)},e.prototype.toJSON=function(){return this.data},e.prototype.isWriteTransfer=function(){return this.isTransformation("WriteTransfer")},e.prototype.isWriteAccount=function(){return this.isTransformation("WriteAccount")||this.isTransformation("Write")&&this.isTransformation("Account")},e.prototype.isCLValueWrite=function(){return this.isTransformation("WriteCLValue")},e.prototype.isWriteContract=function(){var e;if(this.isTransformation("WriteContract"))return!0;var t=new i.TypedJSON(c.RawWriteContract).parse(this.data);return!!(null===(e=null==t?void 0:t.Write)||void 0===e?void 0:e.Contract)},e.prototype.isWriteWithdraw=function(){return this.isTransformation("WriteWithdraw")},e.prototype.isWriteUnbonding=function(){return this.isTransformation("WriteUnbonding")},e.prototype.isWriteCLValue=function(){return this.isTransformation("CLValue")},e.prototype.isWritePackage=function(){return this.isTransformation("Package")},e.prototype.isWriteAddressableEntity=function(){return this.isTransformation("AddressableEntity")},e.prototype.isWriteBidKind=function(){return this.isTransformation("BidKind")},e.prototype.isWriteNamedKey=function(){return this.isTransformation("NamedKey")},e.prototype.isWriteMessage=function(){return this.isTransformation("Message")},e.prototype.isWriteMessageTopic=function(){return this.isTransformation("MessageTopic")},e.prototype.isWriteBid=function(){return this.isTransformation("WriteBid")},e.prototype.isAddUint512=function(){return this.isTransformation("AddUInt512")},e.prototype.isWriteDeployInfo=function(){return this.isTransformation("WriteDeployInfo")},e.prototype.isWriteContractPackage=function(){var e;if(this.isTransformation("WriteContractPackage"))return!0;var t=new i.TypedJSON(c.RawWriteContractPackage).parse(this.data);return!!(null===(e=null==t?void 0:t.Write)||void 0===e?void 0:e.ContractPackage)},e.prototype.parseAsWriteTransfer=function(){var e=new i.TypedJSON(c.RawWriteTransferTransform).parse(this.data);if(!e||!e.WriteTransfer)throw new Error("Error parsing as WriteTransfer");return e.WriteTransfer},e.prototype.parseAsWriteWithdraws=function(){var e=new i.TypedJSON(c.RawWriteWithdrawals).parse(this.data);return e&&e.UnbondingPurses?e.UnbondingPurses:[]},e.prototype.parseAsWriteAddressableEntity=function(){var e,t=new i.TypedJSON(c.TranformAddressableEntityRawData).parse(this.data);if(!(null===(e=null==t?void 0:t.Write)||void 0===e?void 0:e.AddressableEntity))throw new Error("Error parsing as AddressableEntity");return t.Write.AddressableEntity},e.prototype.parseAsWritePackage=function(){var e,t=new i.TypedJSON(c.PackageRawData).parse(this.data);if(!(null===(e=null==t?void 0:t.Write)||void 0===e?void 0:e.Package))throw new Error("Error parsing as Package");return t.Write.Package},e.prototype.parseAsWriteBidKind=function(){var e,t=new i.TypedJSON(c.BidKindRawData).parse(this.data);if(!(null===(e=null==t?void 0:t.Write)||void 0===e?void 0:e.BidKind))throw new Error("Error parsing as BidKind");return t.Write.BidKind},e.prototype.parseAsWriteNamedKey=function(){var e=new i.TypedJSON(c.RawDataNamedKey).parse(this.data);if(!e||!e.Write||!e.Write.NamedKey)throw new Error("Error parsing as NamedKeyKind");return e.Write.NamedKey},e.prototype.parseAsWriteMessage=function(){var e=new i.TypedJSON(c.RawDataMessage).parse(this.data);if(!e||!e.Write||!e.Write.Message)throw new Error("Error parsing as MessageChecksum");return e.Write.Message},e.prototype.parseAsWriteMessageTopic=function(){var e=new i.TypedJSON(c.RawDataMessageTopic).parse(this.data);if(!e||!e.Write||!e.Write.MessageTopic)throw new Error("Error parsing as MessageTopicSummary");return e.Write.MessageTopic},e.prototype.parseAsWriteUnbondings=function(){var e=new i.TypedJSON(c.RawWriteUnbonding).parse(this.data);if(!e||!e.UnbondingPurses)throw new Error("Error parsing as UnbondingPurse array");return e.UnbondingPurses},e.prototype.parseAsUInt512=function(){var e=new i.TypedJSON(c.RawUInt512).parse(this.data);if(!e||!e.UInt512)throw new Error("Error parsing as CLValueUInt512");return e.UInt512},e.prototype.parseAsWriteAccount=function(){var e,t,r=new i.TypedJSON(c.RawWriteAccount2XTransform).parse(this.data);if((null===(t=null===(e=null==r?void 0:r.Write)||void 0===e?void 0:e.Account)||void 0===t?void 0:t.accountHash)&&"account-hash-0000000000000000000000000000000000000000000000000000000000000000"!==r.Write.Account.accountHash.toPrefixedString())return r.Write.Account.accountHash;var n=new i.TypedJSON(c.RawWriteAccount1XTransform).parse(this.data);if(!(null==n?void 0:n.WriteAccount))throw new Error("Error parsing as WriteAccount");return n.WriteAccount},e.prototype.parseAsWriteDeployInfo=function(){var e=new i.TypedJSON(c.RawWriteDeployInfo).parse(this.data);if(!e||!e.WriteDeployInfo)throw new Error("Error parsing as DeployInfo");return e.WriteDeployInfo},e.prototype.parseAsWriteCLValue=function(){var e,t=new i.TypedJSON(c.RawWriteCLValue).parse(this.data);if(t&&t.WriteCLValue)return t.WriteCLValue;var r=new i.TypedJSON(c.RawWriteCLValueV2).parse(this.data);if(!r||!r.Write||!(null==r?void 0:r.Write.CLValue))throw new Error("Error parsing as RawWriteCLValueV2");return null===(e=r.Write)||void 0===e?void 0:e.CLValue},e.prototype.parseAsWriteContract=function(){var e,t=new i.TypedJSON(c.RawWriteContract).parse(this.data);if(!t||!(null===(e=t.Write)||void 0===e?void 0:e.Contract))throw new Error("Error parsing as WriteContract");return t.Write.Contract},e.prototype.parseAsWriteContractPackage=function(){var e,t=new i.TypedJSON(c.RawWriteContractPackage).parse(this.data);if(!t||!(null===(e=t.Write)||void 0===e?void 0:e.ContractPackage))throw new Error("Error parsing as WriteContractPackage");return t.Write.ContractPackage},e.prototype.containsKeyRecursive=function(e,t){for(var r in e){if(r.includes(t))return!0;if("object"==typeof e[r]&&null!==e[r]&&this.containsKeyRecursive(e[r],t))return!0}return!1},e.prototype.isTransformation=function(e){return"string"==typeof this.data?this.data.includes(e):"object"==typeof this.data&&null!==this.data&&this.containsKeyRecursive(this.data,e)},t=n([i.jsonObject,o("design:paramtypes",[Object])],e)}();t.TransformKind=f;var l=function(){function e(e,t){this.key=e,this.kind=t}return n([(0,i.jsonMember)({name:"key",constructor:a.Key,deserializer:function(e){if(e)return a.Key.newKey(e)},serializer:function(e){if(e)return e.toPrefixedString()}}),o("design:type",a.Key)],e.prototype,"key",void 0),n([(0,i.jsonMember)({name:"kind",constructor:f,deserializer:function(e){if(e)return f.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",f)],e.prototype,"kind",void 0),n([i.jsonObject,o("design:paramtypes",[a.Key,f])],e)}();t.Transform=l;var d=function(){function e(){}return n([(0,i.jsonMember)({name:"key",constructor:a.Key,deserializer:function(e){if(e)return a.Key.newKey(e)},serializer:function(e){if(e)return e.toPrefixedString()}}),o("design:type",a.Key)],e.prototype,"key",void 0),n([(0,i.jsonMember)({name:"transform",constructor:f,deserializer:function(e){if(e)return f.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",f)],e.prototype,"transform",void 0),n([i.jsonObject],e)}();t.TransformKey=d;var h=function(){function e(){}return n([(0,i.jsonMember)(function(){return s.Args},{deserializer:u.deserializeArgs,serializer:function(e){return(0,u.serializeArgs)(e,!1)}}),o("design:type",s.Args)],e.prototype,"namedKey",void 0),n([(0,i.jsonMember)(function(){return s.Args},{deserializer:u.deserializeArgs,serializer:function(e){return(0,u.serializeArgs)(e,!1)}}),o("design:type",s.Args)],e.prototype,"name",void 0),n([i.jsonObject],e)}();t.NamedKeyKind=h},1527:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RawWriteAccount1XTransform=t.RawWriteAccount2XTransform=t.RawWriteAccount2XTransformWrite=t.RawWriteAccount2XTransformAccount=t.RawWriteContractPackage=t.WriteContractPackage=t.RawWriteContract=t.WriteContract=t.RawWriteCLValueV2=t.WriteCLValue=t.RawWriteCLValue=t.RawWriteDeployInfo=t.RawUInt512=t.RawWriteUnbonding=t.RawDataMessageTopic=t.WriteMessageTopic=t.RawDataMessage=t.WriteMessage=t.RawDataNamedKey=t.BidKindRawData=t.TranformBidKindData=t.PackageRawData=t.TranformPackageData=t.TranformAddressableEntityRawData=t.TranformAddressableEntity=t.RawWriteTransferTransform=t.RawWriteWithdrawals=t.WriteTransfer=void 0;var i=r(9592),a=r(8148),s=r(8057),u=r(3750),c=r(4613),f=r(4820),l=r(3903),d=r(5466),h=r(402),p=r(6077),y=r(3401),m=r(2535),b=r(8263),g=function(){function e(){}return n([(0,i.jsonMember)({name:"id",constructor:Number,preserveNull:!0}),o("design:type",Number)],e.prototype,"id",void 0),n([(0,i.jsonMember)({name:"to",constructor:y.AccountHash,preserveNull:!0,deserializer:function(e){if(e)return y.AccountHash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",y.AccountHash)],e.prototype,"to",void 0),n([(0,i.jsonMember)({name:"deploy_hash",constructor:y.Hash,deserializer:function(e){if(e)return y.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",y.Hash)],e.prototype,"deployHash",void 0),n([(0,i.jsonMember)({name:"from",constructor:y.AccountHash,deserializer:function(e){return y.AccountHash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",y.AccountHash)],e.prototype,"from",void 0),n([(0,i.jsonMember)({name:"amount",constructor:d.CLValueUInt512,deserializer:function(e){return d.CLValueUInt512.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",d.CLValueUInt512)],e.prototype,"amount",void 0),n([(0,i.jsonMember)({name:"source",constructor:y.URef,deserializer:function(e){return y.URef.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",y.URef)],e.prototype,"source",void 0),n([(0,i.jsonMember)({name:"target",constructor:y.URef,deserializer:function(e){return y.URef.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",y.URef)],e.prototype,"target",void 0),n([(0,i.jsonMember)({name:"gas",constructor:Number,deserializer:function(e){return p.BigNumber.from(e).toNumber()},serializer:function(e){return p.BigNumber.from(e).toString()}}),o("design:type",Number)],e.prototype,"gas",void 0),n([i.jsonObject],e)}();t.WriteTransfer=g;var v=function(){function e(){}return n([(0,i.jsonArrayMember)(a.UnbondingPurse,{name:"WriteWithdraw"}),o("design:type",Array)],e.prototype,"UnbondingPurses",void 0),n([i.jsonObject],e)}();t.RawWriteWithdrawals=v;var w=function(){function e(){}return n([(0,i.jsonMember)({name:"WriteTransfer",constructor:g}),o("design:type",g)],e.prototype,"WriteTransfer",void 0),n([i.jsonObject],e)}();t.RawWriteTransferTransform=w;var S=function(){function e(){}return n([(0,i.jsonMember)({name:"AddressableEntity",constructor:u.AddressableEntity}),o("design:type",u.AddressableEntity)],e.prototype,"AddressableEntity",void 0),n([i.jsonObject],e)}();t.TranformAddressableEntity=S;var M=function(){function e(){}return n([(0,i.jsonMember)({name:"Write",constructor:S}),o("design:type",S)],e.prototype,"Write",void 0),n([i.jsonObject],e)}();t.TranformAddressableEntityRawData=M;var _=function(){function e(){}return n([(0,i.jsonMember)({name:"Package",constructor:c.Package}),o("design:type",c.Package)],e.prototype,"Package",void 0),n([i.jsonObject],e)}();t.TranformPackageData=_;var A=function(){function e(){}return n([(0,i.jsonMember)({name:"Write",constructor:_}),o("design:type",_)],e.prototype,"Write",void 0),n([i.jsonObject],e)}();t.PackageRawData=A;var E=function(){function e(){}return n([(0,i.jsonMember)({name:"BidKind",constructor:f.BidKind}),o("design:type",f.BidKind)],e.prototype,"BidKind",void 0),n([i.jsonObject],e)}();t.TranformBidKindData=E;var O=function(){function e(){}return n([(0,i.jsonMember)({name:"Write",constructor:E}),o("design:type",E)],e.prototype,"Write",void 0),n([i.jsonObject],e)}();t.BidKindRawData=O;var j=function(){function e(){}return n([(0,i.jsonMember)(function(){return s.NamedKeyKind},{name:"NamedKey"}),o("design:type",s.NamedKeyKind)],e.prototype,"NamedKey",void 0),n([i.jsonObject],e)}(),T=function(){function e(){}return n([(0,i.jsonMember)({constructor:j,name:"Write"}),o("design:type",j)],e.prototype,"Write",void 0),n([i.jsonObject],e)}();t.RawDataNamedKey=T;var N=function(){function e(){}return n([(0,i.jsonMember)({constructor:String,name:"Message"}),o("design:type",String)],e.prototype,"Message",void 0),n([i.jsonObject],e)}();t.WriteMessage=N;var P=function(){function e(){}return n([(0,i.jsonMember)({constructor:N,name:"Write"}),o("design:type",N)],e.prototype,"Write",void 0),n([i.jsonObject],e)}();t.RawDataMessage=P;var B=function(){function e(){}return n([(0,i.jsonMember)({constructor:l.MessageTopicSummary,name:"MessageTopic"}),o("design:type",l.MessageTopicSummary)],e.prototype,"MessageTopic",void 0),n([i.jsonObject],e)}();t.WriteMessageTopic=B;var R=function(){function e(){}return n([(0,i.jsonMember)({constructor:B,name:"Write"}),o("design:type",B)],e.prototype,"Write",void 0),n([i.jsonObject],e)}();t.RawDataMessageTopic=R;var C=function(){function e(){}return n([(0,i.jsonArrayMember)(a.UnbondingPurse,{name:"WriteUnbonding"}),o("design:type",Array)],e.prototype,"UnbondingPurses",void 0),n([i.jsonObject],e)}();t.RawWriteUnbonding=C;var x=function(){function e(){}return n([(0,i.jsonMember)({name:"AddUInt512",constructor:d.CLValueUInt512,deserializer:function(e){if(e)return d.CLValueUInt512.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",d.CLValueUInt512)],e.prototype,"UInt512",void 0),n([i.jsonObject],e)}();t.RawUInt512=x;var I=function(){function e(){}return n([(0,i.jsonMember)({constructor:h.DeployInfo,name:"WriteDeployInfo"}),o("design:type",h.DeployInfo)],e.prototype,"WriteDeployInfo",void 0),n([i.jsonObject],e)}();t.RawWriteDeployInfo=I;var k=function(){function e(){}return n([(0,i.jsonMember)(function(){return d.CLValue},{deserializer:function(e){if(e)return d.CLValueParser.fromJSON(e)},serializer:function(e){if(e)return d.CLValueParser.toJSON(e)},name:"WriteCLValue"}),o("design:type",d.CLValue)],e.prototype,"WriteCLValue",void 0),n([i.jsonObject],e)}();t.RawWriteCLValue=k;var H=function(){function e(){}return n([(0,i.jsonMember)(function(){return d.CLValue},{deserializer:function(e){if(e)return d.CLValueParser.fromJSON(e)},serializer:function(e){if(e)return d.CLValueParser.toJSON(e)},name:"CLValue"}),o("design:type",d.CLValue)],e.prototype,"CLValue",void 0),n([i.jsonObject],e)}();t.WriteCLValue=H;var U=function(){function e(){}return n([(0,i.jsonMember)({name:"Write",constructor:H}),o("design:type",H)],e.prototype,"Write",void 0),n([i.jsonObject],e)}();t.RawWriteCLValueV2=U;var L=function(){function e(){}return n([(0,i.jsonMember)({name:"Contract",constructor:m.Contract}),o("design:type",m.Contract)],e.prototype,"Contract",void 0),n([i.jsonObject],e)}();t.WriteContract=L;var D=function(){function e(){}return n([(0,i.jsonMember)({name:"Write",constructor:L}),o("design:type",L)],e.prototype,"Write",void 0),n([i.jsonObject],e)}();t.RawWriteContract=D;var V=function(){function e(){}return n([(0,i.jsonMember)({name:"ContractPackage",constructor:b.ContractPackage}),o("design:type",b.ContractPackage)],e.prototype,"ContractPackage",void 0),n([i.jsonObject],e)}();t.WriteContractPackage=V;var z=function(){function e(){}return n([(0,i.jsonMember)({name:"Write",constructor:V}),o("design:type",V)],e.prototype,"Write",void 0),n([i.jsonObject],e)}();t.RawWriteContractPackage=z;var J=function(){function e(){}return n([(0,i.jsonMember)({name:"account_hash",constructor:y.AccountHash,deserializer:function(e){if(e)return y.AccountHash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",y.AccountHash)],e.prototype,"accountHash",void 0),n([i.jsonObject],e)}();t.RawWriteAccount2XTransformAccount=J;var K=function(){function e(){}return n([(0,i.jsonMember)({name:"Account",constructor:J}),o("design:type",J)],e.prototype,"Account",void 0),n([i.jsonObject],e)}();t.RawWriteAccount2XTransformWrite=K;var F=function(){function e(){}return n([(0,i.jsonMember)({name:"Write",constructor:K}),o("design:type",K)],e.prototype,"Write",void 0),n([i.jsonObject],e)}();t.RawWriteAccount2XTransform=F;var q=function(){function e(){}return n([(0,i.jsonMember)({name:"WriteAccount",constructor:y.AccountHash,deserializer:function(e){if(e)return y.AccountHash.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",y.AccountHash)],e.prototype,"WriteAccount",void 0),n([i.jsonObject],e)}();t.RawWriteAccount1XTransform=q},8148:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.UnbondingPurse=void 0;var i=r(9592),a=r(3401),s=r(9449),u=r(5466),c=function(){function e(){}return n([(0,i.jsonMember)({name:"amount",constructor:u.CLValueUInt512,deserializer:function(e){return u.CLValueUInt512.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",u.CLValueUInt512)],e.prototype,"amount",void 0),n([(0,i.jsonMember)({name:"bonding_purse",constructor:a.URef,deserializer:function(e){return a.URef.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.URef)],e.prototype,"bondingPurse",void 0),n([(0,i.jsonMember)({name:"era_of_creation",constructor:Number}),o("design:type",Number)],e.prototype,"eraOfCreation",void 0),n([(0,i.jsonMember)({name:"unbonder_public_key",constructor:s.PublicKey,deserializer:function(e){return s.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.PublicKey)],e.prototype,"unbonderPublicKey",void 0),n([(0,i.jsonMember)({name:"validator_public_key",constructor:s.PublicKey,deserializer:function(e){return s.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.PublicKey)],e.prototype,"validatorPublicKey",void 0),n([(0,i.jsonMember)({name:"new_validator",constructor:s.PublicKey,deserializer:function(e){if(e)return s.PublicKey.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",s.PublicKey)],e.prototype,"newValidator",void 0),n([i.jsonObject],e)}();t.UnbondingPurse=c},6459:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.ValidatorWeightAuction=t.ValidatorWeightEraEnd=void 0;var i=r(9592),a=r(9449),s=r(5466),u=function(){function e(){}return n([(0,i.jsonMember)({constructor:a.PublicKey,deserializer:function(e){return a.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.PublicKey)],e.prototype,"validator",void 0),n([(0,i.jsonMember)({constructor:s.CLValueUInt512,deserializer:function(e){return s.CLValueUInt512.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.CLValueUInt512)],e.prototype,"weight",void 0),n([i.jsonObject],e)}();t.ValidatorWeightEraEnd=u;var c=function(){function e(){}return n([(0,i.jsonMember)({name:"public_key",constructor:a.PublicKey,deserializer:function(e){return a.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",a.PublicKey)],e.prototype,"validator",void 0),n([(0,i.jsonMember)({constructor:s.CLValueUInt512,deserializer:function(e){return s.CLValueUInt512.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",s.CLValueUInt512)],e.prototype,"weight",void 0),n([i.jsonObject],e)}();t.ValidatorWeightAuction=c},6028:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueAny=void 0;var r=function(){function e(e){this.data=e}return e.prototype.bytes=function(){return this.data},e.prototype.toString=function(){return(new TextDecoder).decode(this.data)},e.prototype.toJSON=function(){return this.bytes()},e}();t.CLValueAny=r},7948:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueBool=void 0;var r=function(){function e(e){this.value=e}return e.prototype.bytes=function(){return new Uint8Array([this.value?1:0])},e.prototype.toString=function(){return this.value?"true":"false"},e.prototype.toJSON=function(){return this.value},e.prototype.getValue=function(){return this.value},e.fromBytes=function(t){if(0===t.length)throw new Error("Empty byte array");if(1===t[0])return{result:new e(!0),bytes:t.subarray(1)};if(0===t[0])return{result:new e(!1),bytes:t.subarray(1)};throw new Error("Invalid bool value")},e}();t.CLValueBool=r},6837:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueByteArray=void 0;var r=function(){function e(e){this.data=e}return e.prototype.bytes=function(){return this.data},e.prototype.toJSON=function(){return this.bytes()},e.prototype.toString=function(){return Array.from(this.data,function(e){return e.toString(16).padStart(2,"0")}).join("")},e.fromBytes=function(t,r){return{result:new e(t.subarray(0,r.size)),bytes:t.subarray(r.size)}},e}();t.CLValueByteArray=r},1282:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLValue=void 0;var n=r(2884),o=r(1402),i=r(7948),a=r(5334),s=r(2045),u=r(5216),c=r(6837),f=r(1501),l=r(5729),d=r(8864),h=r(8441),p=r(7992),y=r(6167),m=r(6028),b=function(){function e(e){this.type=e}return e.prototype.getType=function(){return this.type instanceof n.CLTypeDynamic?this.type.inner:this.type},e.prototype.toString=function(){return this.getValueByType().toString()},e.prototype.toJSON=function(){return this.getValueByType().toJSON()},e.prototype.bytes=function(){return this.getValueByType().bytes()},e.prototype.getValueByType=function(){switch(this.type.getTypeID()){case n.TypeID.Bool:return this.bool;case n.TypeID.I32:return this.i32;case n.TypeID.I64:return this.i64;case n.TypeID.U8:return this.ui8;case n.TypeID.U32:return this.ui32;case n.TypeID.U64:return this.ui64;case n.TypeID.U128:return this.ui128;case n.TypeID.U256:return this.ui256;case n.TypeID.U512:return this.ui512;case n.TypeID.Unit:return this.unit;case n.TypeID.String:return this.stringVal;case n.TypeID.Key:return this.key;case n.TypeID.URef:return this.uref;case n.TypeID.Option:return this.option;case n.TypeID.List:return this.list;case n.TypeID.ByteArray:return this.byteArray;case n.TypeID.Result:return this.result;case n.TypeID.Map:return this.map;case n.TypeID.Tuple1:return this.tuple1;case n.TypeID.Tuple2:return this.tuple2;case n.TypeID.Tuple3:return this.tuple3;case n.TypeID.Any:return this.any;case n.TypeID.PublicKey:return this.publicKey;default:throw new Error("Type in getValueByType method of CLValue is not implemented")}},e.prototype.getKey=function(){if(!this.key)throw new Error("Key property is empty in CLValue, type is ".concat(this.type.toString()));return this.key},e.newCLKey=function(t){var r=new e(n.CLTypeKey);return r.key=t,r},e.newCLUref=function(t){var r=new e(n.CLTypeUref);return r.uref=t,r},e.newCLPublicKey=function(t){var r=new e(n.CLTypePublicKey);return r.publicKey=t,r},e.newCLAny=function(t){var r=new e(n.CLTypeAny);return r.any=new m.CLValueAny(t),r},e.newCLValueBool=function(t){var r=new e(n.CLTypeBool);return r.bool=new i.CLValueBool(t),r},e.newCLByteArray=function(t){var r=new e(new n.CLTypeByteArray(t.length));return r.byteArray=new c.CLValueByteArray(t),r},e.newCLList=function(t,r){void 0===r&&(r=[]);var o=new n.CLTypeList(t),i=new e(o);return i.list=new u.CLValueList(o,r),i},e.newCLMap=function(t,r){var o=new n.CLTypeMap(t,r),i=new e(o);return i.map=new d.CLValueMap(o),i},e.newCLOption=function(t,r){var o=null===t?r||n.CLTypeAny:t.type,i=new n.CLTypeOption(o),a=new e(i);return a.option=new s.CLValueOption(t,i),a},e.newCLResult=function(t,r,o,i){var a=new n.CLTypeResult(t,r),s=new e(a);return s.result=new f.CLValueResult(a,i,o),s},e.newCLString=function(t){var r=new e(n.CLTypeString);return r.stringVal=new l.CLValueString(t),r},e.newCLTuple1=function(t){var r=new n.CLTypeTuple1(t.type),o=new e(r);return o.tuple1=new h.CLValueTuple1(r,t),o},e.newCLTuple2=function(t,r){var o=new n.CLTypeTuple2(t.type,r.type),i=new e(o);return i.tuple2=new p.CLValueTuple2(o,t,r),i},e.newCLTuple3=function(t,r,o){var i=new n.CLTypeTuple3(t.type,r.type,o.type),a=new e(i);return a.tuple3=new y.CLValueTuple3(i,t,r,o),a},e.newCLUnit=function(){var t=new e(n.CLTypeUnit);return t.unit=new a.CLValueUnit,t},e.newCLInt32=function(t){var r=new e(n.CLTypeInt32);return r.i32=new o.CLValueInt32(t),r},e.newCLInt64=function(t){var r=new e(n.CLTypeInt64);return r.i64=new o.CLValueInt64(t),r},e.newCLUint8=function(t){var r=new e(n.CLTypeUInt8);return r.ui8=new o.CLValueUInt8(t),r},e.newCLUInt32=function(t){var r=new e(n.CLTypeUInt32);return r.ui32=new o.CLValueUInt32(t),r},e.newCLUint64=function(t){var r=new e(n.CLTypeUInt64);return r.ui64=new o.CLValueUInt64(t),r},e.newCLUInt128=function(t){var r=new e(n.CLTypeUInt128);return r.ui128=new o.CLValueUInt128(t),r},e.newCLUInt256=function(t){var r=new e(n.CLTypeUInt256);return r.ui256=new o.CLValueUInt256(t),r},e.newCLUInt512=function(t){var r=new e(n.CLTypeUInt512);return r.ui512=new o.CLValueUInt512(t),r},e}();t.CLValue=b},5216:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueList=void 0;var n=r(8905),o=r(2884),i=r(1402),a=r(731),s=r(678),u=function(){function e(e,t){void 0===t&&(t=[]),this.type=e,this.elements=t}return e.prototype.bytes=function(){var e,t,r=this.elements.map(function(e){return e.bytes()});return(null===(t=null===(e=null==this?void 0:this.type)||void 0===e?void 0:e.elementsType)||void 0===t?void 0:t.getTypeID())!==o.TypeID.Any&&r.splice(0,0,(0,s.toBytesU32)(this.size())),(0,n.concat)(r)},e.prototype.toString=function(){var e=this.elements.map(function(e){return'"'.concat(e.toString(),'"')});return"[".concat(e.join(","),"]")},e.prototype.isEmpty=function(){return 0===this.size()},e.prototype.append=function(e){this.elements.push(e)},e.prototype.remove=function(e){this.elements.splice(e,1)},e.prototype.pop=function(){return this.elements.pop()},e.prototype.size=function(){return this.elements.length},e.prototype.set=function(e,t){if(e>=this.elements.length)throw new Error("List index out of bounds.");this.elements[e]=t},e.prototype.get=function(e){if(e>=this.elements.length)throw new Error("List index out of bounds.");return this.elements[e]},e.prototype.toJSON=function(){return this.elements.map(function(e){return e.toJSON()})},e.fromBytes=function(t,r){for(var n,s=i.CLValueUInt32.fromBytes(t),u=s.result,c=s.bytes,f=u.toNumber(),l=(null===(n=null==r?void 0:r.elementsType)||void 0===n?void 0:n.getTypeID())===o.TypeID.Any?t:c,d=[],h=0;h<f;h++)if(l.length){var p=a.CLValueParser.fromBytesByType(l,r.elementsType),y=p.result,m=p.bytes;if(!y)continue;d.push(y),l=m}return 0===d.length?{result:new e(r,[]),bytes:l}:{result:new e(r,d),bytes:l}},e}();t.CLValueList=u},8864:function(e,t,r){var n=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueMap=void 0;var o=r(8905),i=r(1282),a=r(1402),s=r(731),u=r(678),c=function(){function e(e,t,r){this.indexedData=new Map,this.type=e,this.data=null!=t?t:[],this.indexedData=null!=r?r:new Map}return e.prototype.bytes=function(){var e=Array.from(this.data).map(function(e){var t=e.inner1.bytes(),r=e.inner2.bytes();return(0,o.concat)([t,r])});return(0,o.concat)(n([(0,u.toBytesU32)(this.data.length)],e,!0))},e.prototype.getMap=function(){var e={};return this.indexedData.forEach(function(t,r){e[r]=t}),e},e.prototype.getData=function(){return n([],this.data,!0)},e.prototype.toString=function(){var e=[];return this.indexedData.forEach(function(t,r){e.push("(".concat(r,'="').concat(t.toString(),'")'))}),e.join("")},e.prototype.toJSON=function(){var e=new Map;return this.data.forEach(function(t){var r=t.value(),n=r[0],o=r[1];e.set(n,o)}),e},e.prototype.find=function(e){var t=this.indexedData.get(e);return[t,void 0!==t]},e.prototype.get=function(e){return this.indexedData.get(e)},e.prototype.findAny=function(e){for(var t=0,r=e;t<r.length;t++){var n=r[t],o=this.indexedData.get(n);if(void 0!==o)return[o,!0]}return[void 0,!1]},e.prototype.length=function(){return this.indexedData.size},e.prototype.append=function(e,t){if(e.type!==this.type.key)return new Error("invalid key type");if(t.type!==this.type.val)return new Error("invalid value type");var r=e.toString();if(this.indexedData.has(r))return new Error("map key already exists");var n=i.CLValue.newCLTuple2(e,t).tuple2;return n?(this.data.push(n),this.indexedData.set(r,t),null):new Error("no tuple")},e.fromBytes=function(t,r){var n,o,i=new e(r),u=a.CLValueUInt32.fromBytes(t),c=u.result,f=u.bytes,l=c.toNumber(),d=f;if(0===l)return{result:i,bytes:d};for(var h=0;h<l;h++)if(d.length)try{var p=s.CLValueParser.fromBytesByType(d,r.key);d=null!==(n=null==p?void 0:p.bytes)&&void 0!==n?n:[];var y=s.CLValueParser.fromBytesByType(p.bytes,r.val);d=null!==(o=null==y?void 0:y.bytes)&&void 0!==o?o:[],i.append(null==p?void 0:p.result,null==y?void 0:y.result)}catch(e){}return{result:i,bytes:d}},e}();t.CLValueMap=c},1842:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueNumeric=void 0;var n=r(6077),o=function(){function e(e,t){this.value=n.BigNumber.from(e),this.originalBytes=t}return e.prototype.toString=function(){return this.value.toString()},e.prototype.toNumber=function(){return this.value.toNumber()},e.prototype.toJSON=function(){return this.toString()},e.prototype.getValue=function(){return this.value},e}();t.CLValueNumeric=o},2462:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueInt32=void 0;var i=r(6077),a=r(2884),s=r(678),u=function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype.bytes=function(){return(0,s.toBytesI32)(this.value)},t.fromBytes=function(e){if(e.length<a.Int32ByteSize)throw new Error("buffer size is too small");var r=Uint8Array.from(e.subarray(0,4));return{result:new t(i.BigNumber.from(r.slice().reverse()).fromTwos(32)),bytes:e.subarray(4)}},t}(r(1842).CLValueNumeric);t.CLValueInt32=u},3741:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueInt64=void 0;var i=r(6077),a=r(2884),s=r(678),u=function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype.bytes=function(){return(0,s.toBytesI64)(this.value)},t.fromBytes=function(e){if(e.length<a.Int64ByteSize)throw new Error("buffer size is too small");var r=Uint8Array.from(e.subarray(0,8)),n=i.BigNumber.from(r.slice().reverse()).fromTwos(64),o=e.subarray(8);return{result:new t(n),bytes:o}},t}(r(1842).CLValueNumeric);t.CLValueInt64=u},5515:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueUInt128=void 0;var i=r(2996),a=r(678),s=r(1842),u=r(8389),c=function(e){function t(t,r){return e.call(this,t,r)||this}return o(t,e),t.prototype.bytes=function(){return this.originalBytes&&(0,u.arrayEquals)(this.originalBytes,Uint8Array.from([1,0]))?this.originalBytes:(0,a.toBytesU128)(this.value)},t.fromBytes=function(e){return(0,i.fromBytesUInt128)(e)},t}(s.CLValueNumeric);t.CLValueUInt128=c},6295:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueUInt256=void 0;var i=r(2996),a=r(678),s=r(1842),u=r(8389),c=function(e){function t(t,r){return e.call(this,t,r)||this}return o(t,e),t.prototype.bytes=function(){return this.originalBytes&&(0,u.arrayEquals)(this.originalBytes,Uint8Array.from([1,0]))?this.originalBytes:(0,a.toBytesU256)(this.value)},t.fromBytes=function(e){return(0,i.fromBytesUInt256)(e)},t}(s.CLValueNumeric);t.CLValueUInt256=c},8853:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueUInt32=void 0;var i=r(6077),a=r(2884),s=r(678),u=function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype.bytes=function(){return(0,s.toBytesU32)(this.value)},t.fromBytes=function(e){if(e.length<a.Int32ByteSize)throw new Error("Buffer size is too small for UInt32");var r=Uint8Array.from(e.subarray(0,4));return{result:new t(i.BigNumber.from(r.slice().reverse())),bytes:e.subarray(4)}},t}(r(1842).CLValueNumeric);t.CLValueUInt32=u},4958:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueUInt512=void 0;var i=r(6077),a=r(2996),s=r(678),u=r(1842),c=r(8389),f=function(e){function t(t,r){return e.call(this,t,r)||this}return o(t,e),t.prototype.bytes=function(){return this.originalBytes&&(0,c.arrayEquals)(this.originalBytes,Uint8Array.from([1,0]))?this.originalBytes:(0,s.toBytesU512)(this.value)},t.fromJSON=function(e){var r=i.BigNumber.from(e);if(!r.mod(1).isZero()||r.isNegative())throw new Error("Invalid integer string: ".concat(e));return new t(r)},t.fromBytes=function(e){return(0,a.fromBytesUInt512)(e)},t}(u.CLValueNumeric);t.CLValueUInt512=f},530:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueUInt64=void 0;var i=r(6077),a=r(2884),s=r(678),u=function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype.bytes=function(){return(0,s.toBytesU64)(this.value)},t.fromBytes=function(e){if(e.length<a.Int64ByteSize)throw new Error("buffer size is too small");var r=Uint8Array.from(e.subarray(0,8));return{result:new t(i.BigNumber.from(r.slice().reverse())),bytes:e.subarray(8)}},t}(r(1842).CLValueNumeric);t.CLValueUInt64=u},8778:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueUInt8=void 0;var i=r(678),a=function(e){function t(t){return e.call(this,t)||this}return o(t,e),t.prototype.bytes=function(){return(0,i.toBytesU8)(this.value)},t.fromBytes=function(e){if(0===e.length)throw new Error("Insufficient buffer length for UInt8");return{result:new t(e[0]),bytes:e.subarray(1)}},t}(r(1842).CLValueNumeric);t.CLValueUInt8=a},1402:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(6295),t),o(r(5515),t),o(r(4958),t),o(r(530),t),o(r(8778),t),o(r(8853),t),o(r(2462),t),o(r(3741),t)},2045:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueOption=void 0;var n=r(8905),o=r(731),i=r(1402),a=function(){function e(e,t){this.type=t,this.inner=e}return e.prototype.bytes=function(){if(this.isEmpty())return Uint8Array.from([0]);var e=this.inner.bytes();return(0,n.concat)([Uint8Array.from([1]),e])},e.prototype.toString=function(){return this.isEmpty()?"":this.inner.toString()},e.prototype.toJSON=function(){return this.isEmpty()?null:this.inner.toJSON()},e.prototype.isEmpty=function(){return null===this.inner},e.prototype.value=function(){return this.inner},e.fromBytes=function(t,r){var n=i.CLValueUInt8.fromBytes(t),a=n.result,s=n.bytes;if(0===a.toNumber())return{result:new e(null,r),bytes:s};var u=o.CLValueParser.fromBytesByType(s,r.inner);return{result:new e(u.result,r),bytes:u.bytes}},e}();t.CLValueOption=a},731:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueParser=t.ErrUnsupportedCLType=void 0;var n=r(8905),o=r(1282),i=r(3401),a=r(9449),s=r(2884),u=r(1402),c=r(7948),f=r(6028),l=r(5334),d=r(5729),h=r(2045),p=r(5216),y=r(6837),m=r(1501),b=r(8864),g=r(8441),v=r(7992),w=r(6167),S=r(7372),M=r(678);t.ErrUnsupportedCLType=new Error("buffer constructor is not found");var _=function(){function e(){}return e.fromJSON=function(t){var r=s.CLTypeParser.fromInterface(t.cl_type),n=e.fromBytesByType(S.Conversions.decodeBase16(t.bytes),r);return null==n?void 0:n.result},e.toJSON=function(e){var t=e.bytes();return{bytes:S.Conversions.encodeBase16(t),cl_type:e.type.toJSON()}},e.toBytesWithType=function(e){var t=e.getType().toBytes(),r=e.bytes();return(0,n.concat)([(0,M.toBytesArrayU8)(r),t])},e.fromBytesByType=function(e,r){var n=new o.CLValue(r);if(r instanceof s.CLTypeDynamic){var S=s.CLTypeParser.matchBytesToCLType(e);return n.type=new s.CLTypeDynamic(S.result.getTypeID(),S.result),{result:n,bytes:S.bytes}}switch(r.getTypeID()){case s.TypeID.Bool:var M=c.CLValueBool.fromBytes(e);return n.bool=null==M?void 0:M.result,{result:n,bytes:M.bytes};case s.TypeID.I32:var _=u.CLValueInt32.fromBytes(e);return n.i32=_.result,{result:n,bytes:null==_?void 0:_.bytes};case s.TypeID.I64:var A=u.CLValueInt64.fromBytes(e);return n.i64=null==A?void 0:A.result,{result:n,bytes:null==A?void 0:A.bytes};case s.TypeID.U8:var E=u.CLValueUInt8.fromBytes(e);return n.ui8=null==E?void 0:E.result,{result:n,bytes:null==E?void 0:E.bytes};case s.TypeID.U32:var O=u.CLValueUInt32.fromBytes(e);return n.ui32=null==O?void 0:O.result,{result:n,bytes:null==O?void 0:O.bytes};case s.TypeID.U64:var j=u.CLValueUInt64.fromBytes(e);return n.ui64=null==j?void 0:j.result,{result:n,bytes:null==j?void 0:j.bytes};case s.TypeID.U128:var T=u.CLValueUInt128.fromBytes(e);return n.ui128=null==T?void 0:T.result,{result:n,bytes:null==T?void 0:T.bytes};case s.TypeID.U256:var N=u.CLValueUInt256.fromBytes(e);return n.ui256=null==N?void 0:N.result,{result:n,bytes:null==N?void 0:N.bytes};case s.TypeID.U512:var P=u.CLValueUInt512.fromBytes(e);return n.ui512=null==P?void 0:P.result,{result:n,bytes:null==P?void 0:P.bytes};case s.TypeID.String:var B=d.CLValueString.fromBytes(e);return n.stringVal=B.result,{result:n,bytes:null==B?void 0:B.bytes};case s.TypeID.Unit:var R=l.CLValueUnit.fromBytes(e);return n.unit=null==R?void 0:R.result,{result:n,bytes:null==R?void 0:R.bytes};case s.TypeID.Key:var C=i.Key.fromBytes(e);return n.key=null==C?void 0:C.result,{result:n,bytes:null==C?void 0:C.bytes};case s.TypeID.URef:var x=i.URef.fromBytes(e);return n.uref=null==x?void 0:x.result,{result:n,bytes:null==x?void 0:x.bytes};case s.TypeID.Any:var I=new f.CLValueAny(e);return n.any=I,{result:n,bytes:new Uint8Array([])};case s.TypeID.PublicKey:var k=a.PublicKey.fromBytes(e);return n.publicKey=null==k?void 0:k.result,{result:n,bytes:null==k?void 0:k.bytes};case s.TypeID.Option:var H=h.CLValueOption.fromBytes(e,r);return n.option=null==H?void 0:H.result,{result:n,bytes:null==H?void 0:H.bytes};case s.TypeID.List:var U=p.CLValueList.fromBytes(e,r);return n.list=null==U?void 0:U.result,{result:n,bytes:null==U?void 0:U.bytes};case s.TypeID.ByteArray:var L=y.CLValueByteArray.fromBytes(e,r);return n.byteArray=null==L?void 0:L.result,{result:n,bytes:null==L?void 0:L.bytes};case s.TypeID.Result:var D=m.CLValueResult.fromBytes(e,r);return n.result=null==D?void 0:D.result,{result:n,bytes:null==D?void 0:D.bytes};case s.TypeID.Map:var V=b.CLValueMap.fromBytes(e,r);return n.map=null==V?void 0:V.result,{result:n,bytes:null==V?void 0:V.bytes};case s.TypeID.Tuple1:var z=g.CLValueTuple1.fromBytes(e,r);return n.tuple1=z.result,{result:n,bytes:null==z?void 0:z.bytes};case s.TypeID.Tuple2:var J=v.CLValueTuple2.fromBytes(e,r);return n.tuple2=null==J?void 0:J.result,{result:n,bytes:null==J?void 0:J.bytes};case s.TypeID.Tuple3:var K=w.CLValueTuple3.fromBytes(e,r);return n.tuple3=null==K?void 0:K.result,{result:n,bytes:null==K?void 0:K.bytes};default:throw t.ErrUnsupportedCLType}},e.fromBytesWithType=function(e){var t=u.CLValueUInt32.fromBytes(e),r=t.result.toNumber();if(!r)throw new Error("Invalid length for bytes: ".concat(r));var n=t.bytes.subarray(0,r),o=t.bytes.subarray(r),i=s.CLTypeParser.matchBytesToCLType(o);return{result:this.fromBytesByType(n,i.result).result,bytes:i.bytes}},e}();t.CLValueParser=_},1501:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueResult=void 0;var n=r(8905),o=r(731),i=r(1402),a=function(){function e(e,t,r){var n=t?e.innerOk.getName():e.innerErr.getName(),o=r.getType().getName();if(n!==o)throw new Error("Inner value's type (".concat(o,") does not match the expected type (").concat(n,") for ").concat(t?"Ok":"Error","."));this.type=e,this.isSuccess=t,this.inner=r}return e.prototype.bytes=function(){var e=Uint8Array.from([this.isSuccess?1:0]),t=this.inner.bytes();return(0,n.concat)([e,t])},e.prototype.toString=function(){return this.isSuccess?"Ok(".concat(this.inner.toString(),")"):"Err(".concat(this.inner.toString(),")")},e.prototype.toJSON=function(){return this.inner.toJSON()},e.prototype.value=function(){return this.inner},e.fromBytes=function(t,r){var n=i.CLValueUInt8.fromBytes(t),a=n.result,s=n.bytes,u=1===(null==a?void 0:a.toNumber()),c=u?r.innerOk:r.innerErr,f=o.CLValueParser.fromBytesByType(s,c);return{result:new e(r,u,null==f?void 0:f.result),bytes:null==f?void 0:f.bytes}},e}();t.CLValueResult=a},5729:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueString=void 0;var n=r(8905),o=r(1402),i=r(678),a=function(){function e(e){this.value=e}return e.prototype.bytes=function(){var e=this.sizeToBytes(this.value.length),t=(new TextEncoder).encode(this.value);return(0,n.concat)([e,t])},e.prototype.sizeToBytes=function(e){var t=new ArrayBuffer(4);return new DataView(t).setUint32(0,e,!0),new Uint8Array(t)},e.prototype.toJSON=function(){return this.toString()},e.prototype.toString=function(){return this.value},e.fromBytes=function(t){var r,n,a,s=o.CLValueUInt32.fromBytes(t),u=null===(r=null==s?void 0:s.result)||void 0===r?void 0:r.toNumber();return{result:new e((0,i.fromBytesString)(null===(n=null==s?void 0:s.bytes)||void 0===n?void 0:n.subarray(0,u))),bytes:null===(a=null==s?void 0:s.bytes)||void 0===a?void 0:a.subarray(u)}},e}();t.CLValueString=a},8441:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueTuple1=void 0;var n=r(731),o=function(){function e(e,t){this.innerType=e,this.innerVal=t}return e.prototype.bytes=function(){return this.innerVal.bytes()},e.prototype.toString=function(){return"(".concat(this.innerVal.toString(),")")},e.prototype.value=function(){return this.innerVal},e.prototype.toJSON=function(){return[this.innerVal.toJSON()]},e.fromBytes=function(t,r){var o=n.CLValueParser.fromBytesByType(t,r.inner);return{result:new e(r,null==o?void 0:o.result),bytes:null==o?void 0:o.bytes}},e}();t.CLValueTuple1=o},7992:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueTuple2=void 0;var n=r(8905),o=r(731),i=function(){function e(e,t,r){this.innerType=e,this.inner1=t,this.inner2=r}return e.prototype.bytes=function(){var e=this.inner1.bytes(),t=this.inner2.bytes();return(0,n.concat)([e,t])},e.prototype.toString=function(){return"(".concat(this.inner1.toString(),", ").concat(this.inner2.toString(),")")},e.prototype.toJSON=function(){return[this.inner1.toJSON(),this.inner2.toJSON()]},e.prototype.value=function(){return[this.inner1,this.inner2]},e.fromBytes=function(t,r){var n=o.CLValueParser.fromBytesByType(t,r.inner1),i=o.CLValueParser.fromBytesByType(n.bytes,r.inner2);return{result:new e(r,null==n?void 0:n.result,null==i?void 0:i.result),bytes:null==i?void 0:i.bytes}},e}();t.CLValueTuple2=i},6167:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueTuple3=void 0;var n=r(8905),o=r(731),i=function(){function e(e,t,r,n){this.innerType=e,this.inner1=t,this.inner2=r,this.inner3=n}return e.prototype.bytes=function(){var e=this.inner1.bytes(),t=this.inner2.bytes(),r=this.inner3.bytes();return(0,n.concat)([e,t,r])},e.prototype.toString=function(){return"(".concat(this.inner1.toString(),", ").concat(this.inner2.toString(),", ").concat(this.inner3.toString(),")")},e.prototype.toJSON=function(){return[this.inner1.toJSON(),this.inner2.toJSON(),this.inner3.toJSON()]},e.prototype.value=function(){return[this.inner1,this.inner2,this.inner3]},e.fromBytes=function(t,r){var n=o.CLValueParser.fromBytesByType(t,r.inner1),i=o.CLValueParser.fromBytesByType(n.bytes,r.inner2),a=o.CLValueParser.fromBytesByType(i.bytes,r.inner3);return{result:new e(r,n.result,i.result,a.result),bytes:a.bytes}},e}();t.CLValueTuple3=i},2996:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.fromBytesUInt512=t.fromBytesUInt256=t.fromBytesUInt128=t.bigFromBuffer=t.bigToBytes=void 0;var n=r(6077),o=r(1402);t.bigToBytes=function(e){var t=e.toHexString().slice(2);t.length%2!=0&&(t="0"+t);for(var r=new Uint8Array(t.length/2),n=0;n<t.length;n+=2)r[n/2]=parseInt(t.slice(n,n+2),16);var o=r.length,i=new Uint8Array(o+1);return i[0]=o,i.set(r,1),i},t.bigFromBuffer=function(e){for(var t=new DataView(e).getUint8(0),r=new Uint8Array(e.slice(1,t+1)),o="",i=0;i<r.length;i++){var a=r[i];o+=(a<16?"0":"")+a.toString(16)}return n.BigNumber.from("0x"+o)};var i=function(e,t){if(e.length<1)throw new Error("Early end of stream: no data to parse.");var r=t/8,o=e[0];if(o>r)throw new Error("Formatting error: byte length ".concat(o," exceeds expected size for ").concat(t,"-bit integer."));if(o+1>e.length)throw new Error("Early end of stream: insufficient data for specified byte length.");var i=0===o?[0]:e.subarray(1,1+o),a=e.subarray(1+o);return{result:n.BigNumber.from(i.slice().reverse()),bytes:a,originalBytes:e}};t.fromBytesUInt128=function(e){var t=i(e,128);return{result:new o.CLValueUInt128(null==t?void 0:t.result,null==t?void 0:t.originalBytes),bytes:null==t?void 0:t.bytes}},t.fromBytesUInt256=function(e){var t=i(e,256);return{result:new o.CLValueUInt256(null==t?void 0:t.result,null==t?void 0:t.originalBytes),bytes:null==t?void 0:t.bytes}},t.fromBytesUInt512=function(e){var t=i(e,512);return{result:new o.CLValueUInt512(null==t?void 0:t.result,null==t?void 0:t.originalBytes),bytes:null==t?void 0:t.bytes}}},5334:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueUnit=void 0;var r=function(){function e(){this.obj=null}return e.prototype.bytes=function(){return Uint8Array.from([])},e.prototype.toString=function(){return"null"},e.prototype.getValue=function(){return this.obj},e.prototype.toJSON=function(){return this.getValue()},e.fromBytes=function(t){if(t.byteLength>0)throw new Error("Byte source for Unit type should be empty");return{result:new e,bytes:t}},e}();t.CLValueUnit=r},3103:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLTypeByteArray=void 0;var n=r(8905),o=r(2393),i=r(678),a=function(){function e(e){this.size=e}return e.prototype.toBytes=function(){return(0,n.concat)([Uint8Array.from([this.getTypeID()]),(0,i.toBytesU32)(this.size)])},e.prototype.toString=function(){return"".concat(this.getName(),": ").concat(this.size)},e.prototype.getTypeID=function(){return o.TypeID.ByteArray},e.prototype.getName=function(){return o.TypeName.ByteArray},e.prototype.getSize=function(){return this.size},e.prototype.toJSON=function(){var e;return(e={})[this.getName()]=this.size,e},e.fromJSON=function(t){if("number"!=typeof t)throw new Error("Invalid JSON parsing to ByteArray type");return new e(t)},e}();t.CLTypeByteArray=a},2393:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.CLTypePublicKey=t.CLTypeAny=t.CLTypeUref=t.CLTypeKey=t.CLTypeString=t.CLTypeUnit=t.CLTypeUInt512=t.CLTypeUInt256=t.CLTypeUInt128=t.CLTypeUInt64=t.CLTypeUInt32=t.CLTypeUInt8=t.CLTypeInt64=t.CLTypeInt32=t.CLTypeBool=t.SimpleType=t.TypeName=t.TypeID=t.Int64ByteSize=t.Int32ByteSize=void 0,t.Int32ByteSize=4,t.Int64ByteSize=8,function(e){e[e.Bool=0]="Bool",e[e.I32=1]="I32",e[e.I64=2]="I64",e[e.U8=3]="U8",e[e.U32=4]="U32",e[e.U64=5]="U64",e[e.U128=6]="U128",e[e.U256=7]="U256",e[e.U512=8]="U512",e[e.Unit=9]="Unit",e[e.String=10]="String",e[e.Key=11]="Key",e[e.URef=12]="URef",e[e.Option=13]="Option",e[e.List=14]="List",e[e.ByteArray=15]="ByteArray",e[e.Result=16]="Result",e[e.Map=17]="Map",e[e.Tuple1=18]="Tuple1",e[e.Tuple2=19]="Tuple2",e[e.Tuple3=20]="Tuple3",e[e.Any=21]="Any",e[e.PublicKey=22]="PublicKey"}(r=t.TypeID||(t.TypeID={})),t.TypeName={Bool:"Bool",I32:"I32",I64:"I64",U8:"U8",U32:"U32",U64:"U64",U128:"U128",U256:"U256",U512:"U512",Unit:"Unit",String:"String",Key:"Key",URef:"URef",Option:"Option",List:"List",ByteArray:"ByteArray",Result:"Result",Map:"Map",Tuple1:"Tuple1",Tuple2:"Tuple2",Tuple3:"Tuple3",Any:"Any",PublicKey:"PublicKey"};var n=function(){function e(e,t){this.typeID=e,this.typeName=t}return e.prototype.toBytes=function(){return new Uint8Array([this.typeID])},e.prototype.toString=function(){return this.getName()},e.prototype.getTypeID=function(){return this.typeID},e.prototype.getName=function(){return this.typeName},e.prototype.toJSON=function(){return this.getName()},e}();t.SimpleType=n,t.CLTypeBool=new n(r.Bool,t.TypeName.Bool),t.CLTypeInt32=new n(r.I32,t.TypeName.I32),t.CLTypeInt64=new n(r.I64,t.TypeName.I64),t.CLTypeUInt8=new n(r.U8,t.TypeName.U8),t.CLTypeUInt32=new n(r.U32,t.TypeName.U32),t.CLTypeUInt64=new n(r.U64,t.TypeName.U64),t.CLTypeUInt128=new n(r.U128,t.TypeName.U128),t.CLTypeUInt256=new n(r.U256,t.TypeName.U256),t.CLTypeUInt512=new n(r.U512,t.TypeName.U512),t.CLTypeUnit=new n(r.Unit,t.TypeName.Unit),t.CLTypeString=new n(r.String,t.TypeName.String),t.CLTypeKey=new n(r.Key,t.TypeName.Key),t.CLTypeUref=new n(r.URef,t.TypeName.URef),t.CLTypeAny=new n(r.Any,t.TypeName.Any),t.CLTypePublicKey=new n(r.PublicKey,t.TypeName.PublicKey)},1559:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CLTypeRaw=void 0;var i=r(9592),a=r(8297),s=function(){function e(e){this.rawMessage=e}return e.parseCLType=function(e){try{return a.CLTypeParser.fromRawJson(e)}catch(e){throw new Error("Error parsing CLType: ".concat(e.message))}},e.prototype.toJSON=function(){var e,t;return(null===(e=this.rawMessage)||void 0===e?void 0:e.toString())||(null===(t=null==this?void 0:this.rawMessage)||void 0===t?void 0:t.toJSON())},n([i.jsonObject,o("design:paramtypes",[Object])],e)}();t.CLTypeRaw=s},7389:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLTypeDynamic=void 0;var r=function(){function e(e,t){this.typeID=e,this.inner=t}return e.prototype.toBytes=function(){return this.inner.toBytes()},e.prototype.toString=function(){return this.inner.toString()},e.prototype.getTypeID=function(){return this.typeID},e.prototype.getName=function(){return this.inner.getName()},e.prototype.toJSON=function(){return this.inner.toJSON()},e}();t.CLTypeDynamic=r},4854:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLTypeList=void 0;var n=r(8905),o=r(2393),i=r(8297),a=function(){function e(e){this.elementsType=e}return e.prototype.toBytes=function(){return(0,n.concat)([Uint8Array.from([this.getTypeID()]),this.elementsType.toBytes()])},e.prototype.toString=function(){return"(".concat(this.getName()," of ").concat(this.elementsType.toString(),")")},e.prototype.getTypeID=function(){return o.TypeID.List},e.prototype.getName=function(){return o.TypeName.List},e.prototype.toJSON=function(){var e;return(e={})[this.getName()]=this.elementsType.toJSON(),e},e.fromJSON=function(t){return new e(i.CLTypeParser.fromInterface(t))},e}();t.CLTypeList=a},6590:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLTypeMap=t.MapJsonParsingError=void 0;var n=r(8905),o=r(2393),i=r(8297);t.MapJsonParsingError=new Error("map type parsing error");var a=function(){function e(e,t){this.key=e,this.val=t}return e.prototype.toBytes=function(){return(0,n.concat)([Uint8Array.from([this.getTypeID()]),this.key.toBytes(),this.val.toBytes()])},e.prototype.toString=function(){return"".concat(o.TypeName.Map," (").concat(this.key.toString(),": ").concat(this.val.toString(),")")},e.prototype.getTypeID=function(){return o.TypeID.Map},e.prototype.getName=function(){return o.TypeName.Map},e.prototype.toJSON=function(){return{Map:{key:this.key.toJSON(),value:this.val.toJSON()}}},e.fromJSON=function(r){if("object"!=typeof r||null===r)throw t.MapJsonParsingError;var n=r.key;if(void 0===n)throw t.MapJsonParsingError;var o=i.CLTypeParser.fromInterface(n),a=r.value;if(void 0===a)throw t.MapJsonParsingError;return new e(o,i.CLTypeParser.fromInterface(a))},e}();t.CLTypeMap=a},9643:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLTypeOption=void 0;var n=r(8905),o=r(2393),i=r(8297),a=function(){function e(e){this.inner=e}return e.prototype.toBytes=function(){return(0,n.concat)([Uint8Array.from([this.getTypeID()]),this.inner.toBytes()])},e.prototype.toString=function(){return"(".concat(this.getName(),": ").concat(this.inner.getName(),")")},e.prototype.getTypeID=function(){return o.TypeID.Option},e.prototype.getName=function(){return o.TypeName.Option},e.prototype.toJSON=function(){var e;return(e={})[this.getName()]=this.inner.toJSON(),e},e.fromJSON=function(t){return new e(i.CLTypeParser.fromInterface(t))},e}();t.CLTypeOption=a},8297:(e,t,r)=>{var n,o;Object.defineProperty(t,"__esModule",{value:!0}),t.CLTypeParser=void 0;var i=r(2393),a=r(9643),s=r(4854),u=r(3103),c=r(9303),f=r(6590),l=r(9299),d=r(5630),h=r(2853),p=r(1402),y=function(){function e(){}return e.getSimpleTypeByName=function(t){var r=e.simpleTypeByName[t];if(!r)throw new Error("type name is not registered, source: ".concat(t));return r},e.fromRawJson=function(t){try{return e.fromInterface(t)}catch(r){return e.getSimpleTypeByName(t)}},e.matchBytesToCLType=function(t){var r=t[0],n=t.subarray(1);switch(r){case i.TypeID.Bool:case i.TypeID.I32:case i.TypeID.I64:case i.TypeID.U8:case i.TypeID.U32:case i.TypeID.U64:case i.TypeID.U128:case i.TypeID.U256:case i.TypeID.U512:case i.TypeID.Unit:case i.TypeID.String:case i.TypeID.Key:case i.TypeID.URef:case i.TypeID.Any:case i.TypeID.PublicKey:return{result:e.simpleTypeByID[r],bytes:n};case i.TypeID.Option:var o=e.matchBytesToCLType(n),y=o.result,m=o.bytes;return{result:new a.CLTypeOption(y),bytes:m};case i.TypeID.List:var b=e.matchBytesToCLType(n),g=b.result,v=b.bytes;return{result:new s.CLTypeList(g),bytes:v};case i.TypeID.ByteArray:var w=p.CLValueUInt32.fromBytes(n),S=w.result,M=w.bytes;return{result:new u.CLTypeByteArray(S.toNumber()),bytes:M};case i.TypeID.Result:var _=e.matchBytesToCLType(n),A=_.result,E=_.bytes;if(!E)throw new Error("Missing Error type bytes in Result");var O=e.matchBytesToCLType(E),j=O.result,T=O.bytes;return{result:new c.CLTypeResult(A,j),bytes:T};case i.TypeID.Map:var N=e.matchBytesToCLType(n),P=N.result,B=N.bytes;if(!B)throw new Error("Missing Key type bytes in Map");var R=e.matchBytesToCLType(B),C=R.result,x=R.bytes;return{result:new f.CLTypeMap(P,C),bytes:x};case i.TypeID.Tuple1:var I=e.matchBytesToCLType(n),k=I.result,H=I.bytes;return{result:new l.CLTypeTuple1(k),bytes:H};case i.TypeID.Tuple2:var U=e.matchBytesToCLType(n),L=U.result,D=U.bytes;if(!D)throw new Error("Missing second tuple type bytes in CLTuple2Type");var V=e.matchBytesToCLType(D),z=V.result,J=V.bytes;return{result:new d.CLTypeTuple2(L,z),bytes:J};case i.TypeID.Tuple3:var K=e.matchBytesToCLType(n),F=K.result,q=K.bytes;if(!q)throw new Error("Missing second tuple type bytes in CLTuple3Type");var W=e.matchBytesToCLType(q),G=W.result,Z=W.bytes;if(!Z)throw new Error("Missing third tuple type bytes in CLTuple3Type");var $=e.matchBytesToCLType(Z),X=$.result,Q=$.bytes;return{result:new h.CLTypeTuple3(F,G,X),bytes:Q};default:throw e.BufferConstructorNotDetectedError}},e.fromInterface=function(t){return"string"==typeof t?e.getSimpleTypeByName(t):e.fromComplexStruct(t)},e.fromComplexStruct=function(t){if("object"==typeof t&&null!==t){var r=Object.keys(t);if(r.length>1)throw e.ComplexTypeFormatInvalidError;var n=r[0],o=t[n];switch(n){case i.TypeName.Option:return a.CLTypeOption.fromJSON(o);case i.TypeName.List:return s.CLTypeList.fromJSON(o);case i.TypeName.ByteArray:return u.CLTypeByteArray.fromJSON(o);case i.TypeName.Result:return c.CLTypeResult.fromJSON(o);case i.TypeName.Map:return f.CLTypeMap.fromJSON(o);case i.TypeName.Tuple1:return l.CLTypeTuple1.fromJSON(o);case i.TypeName.Tuple2:return d.CLTypeTuple2.fromJSON(o);case i.TypeName.Tuple3:return h.CLTypeTuple3.fromJSON(o);default:throw e.ErrJsonConstructorNotFound}}throw e.ErrComplexTypeFormatNotDetected},e.BufferConstructorNotDetectedError=new Error("buffer constructor not detected"),e.ComplexTypeFormatInvalidError=new Error("complex type format is invalid"),e.ErrComplexTypeFormatNotDetected=new Error("complex type format is not detected"),e.ErrJsonConstructorNotFound=new Error("json type constructor is not found"),e.simpleTypeByName=((n={})[i.TypeName.Bool]=i.CLTypeBool,n[i.TypeName.I32]=i.CLTypeInt32,n[i.TypeName.I64]=i.CLTypeInt64,n[i.TypeName.U8]=i.CLTypeUInt8,n[i.TypeName.U32]=i.CLTypeUInt32,n[i.TypeName.U64]=i.CLTypeUInt64,n[i.TypeName.U128]=i.CLTypeUInt128,n[i.TypeName.U256]=i.CLTypeUInt256,n[i.TypeName.U512]=i.CLTypeUInt512,n[i.TypeName.Unit]=i.CLTypeUnit,n[i.TypeName.String]=i.CLTypeString,n[i.TypeName.Key]=i.CLTypeKey,n[i.TypeName.URef]=i.CLTypeUref,n[i.TypeName.Any]=i.CLTypeAny,n[i.TypeName.PublicKey]=i.CLTypePublicKey,n),e.simpleTypeByID=((o={})[i.TypeID.Bool]=i.CLTypeBool,o[i.TypeID.I32]=i.CLTypeInt32,o[i.TypeID.I64]=i.CLTypeInt64,o[i.TypeID.U8]=i.CLTypeUInt8,o[i.TypeID.U32]=i.CLTypeUInt32,o[i.TypeID.U64]=i.CLTypeUInt64,o[i.TypeID.U128]=i.CLTypeUInt128,o[i.TypeID.U256]=i.CLTypeUInt256,o[i.TypeID.U512]=i.CLTypeUInt512,o[i.TypeID.Unit]=i.CLTypeUnit,o[i.TypeID.String]=i.CLTypeString,o[i.TypeID.Key]=i.CLTypeKey,o[i.TypeID.URef]=i.CLTypeUref,o[i.TypeID.Any]=i.CLTypeAny,o[i.TypeID.PublicKey]=i.CLTypePublicKey,o),e}();t.CLTypeParser=y},9303:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLTypeResult=t.ErrInvalidResultJsonFormat=void 0;var n=r(8905),o=r(2393),i=r(8297);t.ErrInvalidResultJsonFormat=new Error("invalid json format for Result type");var a=function(){function e(e,t){this.innerOk=e,this.innerErr=t}return e.prototype.toBytes=function(){return(0,n.concat)([Uint8Array.from([this.getTypeID()]),this.innerOk.toBytes(),this.innerErr.toBytes()])},e.prototype.toString=function(){return"(".concat(this.getName(),": Ok(").concat(this.innerOk.getName(),"), Err(").concat(this.innerErr.getName(),"))")},e.prototype.getTypeID=function(){return o.TypeID.Result},e.prototype.getName=function(){return o.TypeName.Result},e.prototype.toJSON=function(){var e;return(e={})[this.getName()]={ok:this.innerOk.toJSON(),err:this.innerErr.toJSON()},e},e.fromJSON=function(r){if("object"!=typeof r||null===r)throw t.ErrInvalidResultJsonFormat;var n=r.ok;if(void 0===n)throw t.ErrInvalidResultJsonFormat;var o=i.CLTypeParser.fromInterface(n),a=r.err;if(void 0===a)throw t.ErrInvalidResultJsonFormat;return new e(o,i.CLTypeParser.fromInterface(a))},e}();t.CLTypeResult=a},9299:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLTypeTuple1=void 0;var n=r(8905),o=r(2393),i=r(8297),a=function(){function e(e){this.inner=e}return e.prototype.toBytes=function(){return(0,n.concat)([Uint8Array.from([this.getTypeID()]),this.inner.toBytes()])},e.prototype.toString=function(){return"".concat(this.getName()," (").concat(this.inner.toString(),")")},e.prototype.getTypeID=function(){return o.TypeID.Tuple1},e.prototype.getName=function(){return o.TypeName.Tuple1},e.prototype.toJSON=function(){var e;return(e={})[this.getName()]=[this.inner.toJSON()],e},e.fromJSON=function(t){if(!Array.isArray(t)||1!==t.length)throw new Error("invalid tuple1 type format, should be array of 1 element");var r=i.CLTypeParser.fromInterface(t[0]);if(!r)throw new Error("Invalid inner type in Tuple1 JSON format");return new e(r)},e}();t.CLTypeTuple1=a},5630:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLTypeTuple2=void 0;var n=r(8905),o=r(2393),i=r(8297),a=function(){function e(e,t){this.inner1=e,this.inner2=t}return e.prototype.toBytes=function(){return(0,n.concat)([Uint8Array.from([this.getTypeID()]),this.inner1.toBytes(),this.inner2.toBytes()])},e.prototype.toString=function(){return"".concat(this.getName()," (").concat(this.inner1.toString(),", ").concat(this.inner2.toString(),")")},e.prototype.getTypeID=function(){return o.TypeID.Tuple2},e.prototype.getName=function(){return o.TypeName.Tuple2},e.prototype.toJSON=function(){var e;return(e={})[this.getName()]=[this.inner1.toJSON(),this.inner2.toJSON()],e},e.fromJSON=function(t){if(!Array.isArray(t)||2!==t.length)throw new Error("invalid tuple2 type format, should be array of 2 elements");var r=i.CLTypeParser.fromInterface(t[0]),n=i.CLTypeParser.fromInterface(t[1]);if(!r||!n)throw new Error("Invalid inner types in Tuple2 JSON format");return new e(r,n)},e}();t.CLTypeTuple2=a},2853:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLTypeTuple3=void 0;var n=r(8905),o=r(2393),i=r(8297),a=function(){function e(e,t,r){this.inner1=e,this.inner2=t,this.inner3=r}return e.prototype.toBytes=function(){return(0,n.concat)([Uint8Array.from([this.getTypeID()]),this.inner1.toBytes(),this.inner2.toBytes(),this.inner3.toBytes()])},e.prototype.toString=function(){return"".concat(this.getName()," (").concat(this.inner1.toString(),", ").concat(this.inner2.toString(),", ").concat(this.inner3.toString(),")")},e.prototype.getTypeID=function(){return o.TypeID.Tuple3},e.prototype.getName=function(){return o.TypeName.Tuple3},e.prototype.toJSON=function(){var e;return(e={})[this.getName()]=[this.inner1.toJSON(),this.inner2.toJSON(),this.inner3.toJSON()],e},e.fromJSON=function(t){if(!Array.isArray(t)||3!==t.length)throw new Error("invalid tuple3 type format, should be array of 3 elements");var r=i.CLTypeParser.fromInterface(t[0]),n=i.CLTypeParser.fromInterface(t[1]),o=i.CLTypeParser.fromInterface(t[2]);if(!r||!n||!o)throw new Error("Invalid inner types in Tuple3 JSON format");return new e(r,n,o)},e}();t.CLTypeTuple3=a},2884:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(3103),t),o(r(2393),t),o(r(6590),t),o(r(7389),t),o(r(4854),t),o(r(9643),t),o(r(8297),t),o(r(9303),t),o(r(9299),t),o(r(5630),t),o(r(2853),t),o(r(1559),t)},5466:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(6028),t),o(r(7948),t),o(r(6837),t),o(r(1282),t),o(r(1402),t),o(r(5216),t),o(r(8864),t),o(r(2045),t),o(r(731),t),o(r(1501),t),o(r(5729),t),o(r(8441),t),o(r(7992),t),o(r(6167),t),o(r(2996),t),o(r(5334),t),o(r(2884),t)},7545:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(602),t),o(r(3750),t),o(r(9960),t),o(r(4779),t),o(r(2142),t),o(r(4820),t),o(r(3404),t),o(r(4924),t),o(r(2535),t),o(r(8263),t),o(r(6694),t),o(r(402),t),o(r(111),t),o(r(6722),t),o(r(5495),t),o(r(8179),t),o(r(2625),t),o(r(4410),t),o(r(7889),t),o(r(3771),t),o(r(3903),t),o(r(8765),t),o(r(9153),t),o(r(4613),t),o(r(6200),t),o(r(5e3),t),o(r(121),t),o(r(6500),t),o(r(9125),t),o(r(5596),t),o(r(2151),t),o(r(5731),t),o(r(7012),t),o(r(6838),t),o(r(8057),t),o(r(8148),t),o(r(6459),t),o(r(7372),t),o(r(3401),t),o(r(5466),t),o(r(9449),t),o(r(5463),t),o(r(6586),t),o(r(678),t),o(r(2428),t)},9002:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.AccountHash=void 0;var s=r(9592),u=r(5869),c=r(5010),f=function(e){function t(t,r){void 0===r&&(r="");var n=e.call(this,t.toBytes())||this;return n.originPrefix=r,n}var r;return o(t,e),r=t,t.fromString=function(e){var t="";66===e.length&&e.startsWith("00")?t="00":e.startsWith(c.PrefixName.Account)&&(t=c.PrefixName.Account);var n=e.slice(t.length),o=u.Hash.fromHex(n);return new r(o,t)},t.prototype.toPrefixedString=function(){return c.PrefixName.Account+this.toHex()},t.prototype.toJSON=function(){return this.originPrefix+this.toHex()},t.fromJSON=function(e){return r.fromString(e)},r=i([s.jsonObject,a("design:paramtypes",[u.Hash,Object])],t)}(u.Hash);t.AccountHash=f},438:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.AddressableEntityHash=void 0;var s=r(9592),u=r(5869),c=r(5010),f=function(e){function t(t,r){void 0===r&&(r=c.PrefixName.AddressableEntity);var n=e.call(this,t)||this;return n.originPrefix=r,n}var r;return o(t,e),r=t,t.fromHex=function(e){var t=e.startsWith(c.PrefixName.AddressableEntity)?c.PrefixName.AddressableEntity:"",n=u.Hash.fromHex(e.replace(t,""));return new r(n.toBytes(),t)},t.prototype.toPrefixedString=function(){return"".concat(c.PrefixName.AddressableEntity).concat(this.toHex())},t.prototype.toJSON=function(){return"".concat(this.originPrefix).concat(this.toHex())},t.fromJSON=function(e){return r.fromHex(e)},i([(0,s.jsonMember)({constructor:String}),a("design:type",String)],t.prototype,"originPrefix",void 0),r=i([s.jsonObject,a("design:paramtypes",[Uint8Array,String])],t)}(u.Hash);t.AddressableEntityHash=f},2403:function(e,t,r){var n,o=r(8287).Buffer,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.BalanceHoldAddr=t.Hold=t.getBalanceHoldAddrTag=t.BalanceHoldAddrTagError=t.BalanceHoldAddrTag=void 0;var u,c=r(9592),f=r(7372),l=r(5010);!function(e){e[e.Gas=0]="Gas",e[e.Processing=1]="Processing"}(u=t.BalanceHoldAddrTag||(t.BalanceHoldAddrTag={}));var d=function(e){function t(t){var r=e.call(this,t)||this;return r.name="BalanceHoldAddrTagError",r}return i(t,e),t}(Error);function h(e){if(e===u.Gas||e===u.Processing)return e;throw new d("Invalid BalanceHoldAddrTag")}t.BalanceHoldAddrTagError=d,t.getBalanceHoldAddrTag=h;var p=function(){function e(e,t){this.purseAddr=e,this.blockTime=t}return a([(0,c.jsonMember)({name:"PurseAddr",constructor:Uint8Array}),s("design:type",Object)],e.prototype,"purseAddr",void 0),a([(0,c.jsonMember)({name:"BlockTime",constructor:Date,serializer:function(e){return new Date(e).toISOString()},deserializer:function(e){return Date.parse(e)}}),s("design:type",Date)],e.prototype,"blockTime",void 0),a([c.jsonObject,s("design:paramtypes",[Object,Date])],e)}();t.Hold=p;var y=function(){function e(e,t){this.gas=e,this.processing=t}var t;return t=e,e.fromString=function(e){var r,n,o=new Uint8Array((null===(r=e.match(/.{1,2}/g))||void 0===r?void 0:r.map(function(e){return parseInt(e,16)}))||[]);return null===(n=t.fromBytes(o))||void 0===n?void 0:n.result},e.prototype.toPrefixedString=function(){var e=this.toBytes();return l.PrefixName.BalanceHold+f.Conversions.encodeBase16(e)},e.prototype.toBytes=function(){var e=this.gas,t=u.Gas;this.processing&&(t=u.Processing,e=this.processing);var r=new Uint8Array(41);r[0]=t,r.set(e.purseAddr,1);var n=e.blockTime.getTime(),i=o.alloc(8);return i.writeBigUInt64LE(BigInt(n)),r.set(i,33),r},e.fromBytes=function(e){if(e.length<41)throw new Error("Invalid BalanceHoldAddr format");var r=h(e[0]),n=e.slice(1,33),o=new DataView(e.buffer,33).getBigUint64(0,!0),i=new Date(Number(o)),a=new p(n,i);if(r===u.Gas)return{result:new t(a,void 0),bytes:n};if(r===u.Processing)return{result:new t(void 0,a),bytes:n};throw new d("Unexpected BalanceHoldAddr type")},e.fromJSON=function(e){return this.fromString(e)},e.prototype.toJSON=function(){return this.toPrefixedString()},a([(0,c.jsonMember)({name:"Gas",constructor:p}),s("design:type",p)],e.prototype,"gas",void 0),a([(0,c.jsonMember)({name:"Processing",constructor:p}),s("design:type",p)],e.prototype,"processing",void 0),t=a([c.jsonObject,s("design:paramtypes",[p,p])],e)}();t.BalanceHoldAddr=y},4561:function(e,t,r){var n=r(8287).Buffer,o=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.BidAddr=t.ErrInvalidBidAddrFormat=t.ErrUnexpectedBidAddrTagInBidAddr=t.ErrInvalidBidAddrTag=t.BidAddrTag=void 0;var s,u=r(6077),c=r(9592),f=r(5869),l=r(7889);!function(e){e[e.UnifiedTag=0]="UnifiedTag",e[e.ValidatorTag=1]="ValidatorTag",e[e.DelegatedAccountTag=2]="DelegatedAccountTag",e[e.DelegatedPurseTag=3]="DelegatedPurseTag",e[e.CreditTag=4]="CreditTag",e[e.ReservedDelegationAccountTag=5]="ReservedDelegationAccountTag",e[e.ReservedDelegationPurseTag=6]="ReservedDelegationPurseTag",e[e.UnbondAccountTag=7]="UnbondAccountTag",e[e.UnbondPurseTag=8]="UnbondPurseTag"}(s=t.BidAddrTag||(t.BidAddrTag={})),t.ErrInvalidBidAddrTag=new Error("Invalid BidAddrTag"),t.ErrUnexpectedBidAddrTagInBidAddr=new Error("Unexpected BidAddrTag in BidAddr"),t.ErrInvalidBidAddrFormat=new Error("Invalid BidAddr format");var d=function(){function e(){}var r;return r=e,e.bidAddrTag=function(e){var r=e;if(!Object.values(s).includes(r))throw t.ErrInvalidBidAddrTag;return r},e.prototype.getTag=function(){return this.tag},e.fromHex=function(e){var t,o,i,a,u,c=n.from(e,"hex");if(0===c.length)throw new Error("Wrong key length.");var d=r.bidAddrTag(c[0]),h=new r;switch(h.tag=d,d){case s.UnifiedTag:case s.ValidatorTag:if(33!==c.length)throw new Error("Wrong key length for ".concat(s[d]," BidAddr. Expected 33 bytes."));h[d===s.UnifiedTag?"unified":"validator"]=null===(t=f.Hash.fromBytes(c.slice(1,33)))||void 0===t?void 0:t.result;break;case s.DelegatedAccountTag:case s.ReservedDelegationAccountTag:case s.UnbondAccountTag:if(65!==c.length)throw new Error("Wrong key length for ".concat(s[d]," BidAddr. Expected 65 bytes."));h.validator=null===(o=f.Hash.fromBytes(c.slice(1,33)))||void 0===o?void 0:o.result,h.delegatorAccount=null===(i=f.Hash.fromBytes(c.slice(33)))||void 0===i?void 0:i.result;break;case s.DelegatedPurseTag:case s.ReservedDelegationPurseTag:case s.UnbondPurseTag:if(65!==c.length)throw new Error("Wrong key length for ".concat(s[d]," BidAddr. Expected 65 bytes."));h.validator=null===(a=f.Hash.fromBytes(c.slice(1,33)))||void 0===a?void 0:a.result,h.delegatorPurseAddress=new l.HexBytes(c.slice(33)).toHex();break;case s.CreditTag:if(41!==c.length)throw new Error("Wrong key length for Credit BidAddr. Expected 41 bytes.");h.validator=null===(u=f.Hash.fromBytes(c.slice(1,33)))||void 0===u?void 0:u.result,h.eraId=c.readUInt32LE(33);break;default:throw new Error("Wrong BidAddr tag ".concat(d,"."))}return h},e.fromBytes=function(e){if(e.length<33)throw t.ErrInvalidBidAddrFormat;var n=e[0],o=e.subarray(1),i=r.bidAddrTag(n),a=new r;a.tag=i;var c=function(e){var t=f.Hash.fromBytes(e),r=t.result,n=t.bytes,o=f.Hash.fromBytes(n);return{validator:r,delegator:o.result,bytes:o.bytes}},d=function(e){var t=f.Hash.fromBytes(e),r=t.result,n=t.bytes,o=new l.HexBytes(n);return{validator:r,delegator:o.toHex(),bytes:o.bytes}};switch(i){case s.UnifiedTag:var h=f.Hash.fromBytes(o),p=h.result,y=h.bytes;return a.unified=p,{result:a,bytes:y};case s.ValidatorTag:var m=f.Hash.fromBytes(o),b=m.result,g=m.bytes;return a.validator=b,{result:a,bytes:g};case s.DelegatedAccountTag:var v=c(o),w=v.validator,S=v.delegator,M=v.bytes;return a.delegatorAccount=S,a.validator=w,{result:a,bytes:M};case s.CreditTag:var _=f.Hash.fromBytes(o),A=(w=_.result,_.bytes),E=Uint8Array.from(A.subarray(0,8));return a.eraId=u.BigNumber.from(E.slice().reverse()).toNumber(),a.validator=w,{result:a,bytes:A};case s.DelegatedPurseTag:var O=d(o),j=(w=O.validator,S=O.delegator,O.bytes);return a.validator=w,a.delegatorPurseAddress=S,{result:a,bytes:j};case s.ReservedDelegationAccountTag:var T=c(o),N=(w=T.validator,S=T.delegator,T.bytes);return a.validator=w,a.delegatorAccount=S,{result:a,bytes:N};case s.ReservedDelegationPurseTag:var P=d(o),B=(w=P.validator,S=P.delegator,P.bytes);return a.validator=w,a.delegatorPurseAddress=S,{result:a,bytes:B};case s.UnbondAccountTag:var R=c(o),C=(w=R.validator,S=R.delegator,R.bytes);return a.validator=w,a.delegatorAccount=S,{result:a,bytes:C};case s.UnbondPurseTag:var x=d(o),I=(w=x.validator,S=x.delegator,x.bytes);return a.validator=w,a.delegatorPurseAddress=S,{result:a,bytes:I};default:throw t.ErrInvalidBidAddrFormat}},e.prototype.toPrefixedString=function(){return"bid-addr-".concat(this.toHex())},e.prototype.toHex=function(){var e=this.tag.toString(16).padStart(2,"0");switch(this.tag){case s.UnifiedTag:if(!this.unified)throw new Error("Missing 'unified' field for tag ".concat(s.UnifiedTag));return"".concat(e).concat(this.unified.toHex());case s.ValidatorTag:if(!this.validator)throw new Error("Missing 'validator' field for tag ".concat(s.ValidatorTag));return"".concat(e).concat(this.validator.toHex());case s.DelegatedAccountTag:if(!this.validator||!this.delegatorAccount)throw new Error("Missing 'validator' or 'delegatorAccount' field for tag ".concat(s.DelegatedAccountTag));return"".concat(e).concat(this.validator.toHex()).concat(this.delegatorAccount.toHex());case s.DelegatedPurseTag:if(!this.validator||!this.delegatorPurseAddress)throw new Error("Missing 'validator' or 'delegatorPurseAddress' field for tag ".concat(s.DelegatedPurseTag));return"".concat(e).concat(this.validator.toHex()).concat(this.delegatorPurseAddress);case s.CreditTag:if(!this.validator||void 0===this.eraId)throw new Error("Missing 'validator' or 'eraId' field for tag ".concat(s.CreditTag));var t=n.alloc(8);return t.writeUInt32LE(this.eraId,0),"".concat(e).concat(this.validator.toHex()).concat(t.toString("hex"));case s.ReservedDelegationAccountTag:if(!this.validator||!this.delegatorAccount)throw new Error("Missing 'validator' or 'delegatorAccount' field for tag ".concat(s.ReservedDelegationAccountTag));return"".concat(e).concat(this.validator.toHex()).concat(this.delegatorAccount.toHex());case s.ReservedDelegationPurseTag:if(!this.validator||!this.delegatorPurseAddress)throw new Error("Missing 'validator' or 'delegatorPurseAddress' field for tag ".concat(s.ReservedDelegationPurseTag));return"".concat(e).concat(this.validator.toHex()).concat(this.delegatorPurseAddress);case s.UnbondAccountTag:if(!this.validator||!this.delegatorAccount)throw new Error("Missing 'validator' or 'delegatorAccount' field for tag ".concat(s.UnbondAccountTag));return"".concat(e).concat(this.validator.toHex()).concat(this.delegatorAccount.toHex());case s.UnbondPurseTag:if(!this.validator||!this.delegatorPurseAddress)throw new Error("Missing 'validator' or 'delegatorPurseAddress' field for tag ".concat(s.UnbondPurseTag));return"".concat(e).concat(this.validator.toHex()).concat(this.delegatorPurseAddress);default:throw new Error("Unexpected BidAddr type: ".concat(this.tag))}},e.prototype.toBytes=function(){var e=this.getTag(),t=function(e){for(var t,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];return t=a([n.from([e])],r.map(n.from),!0),n.concat(t)};switch(e){case s.UnifiedTag:return new Uint8Array(t(e,this.unified.toBytes()));case s.ValidatorTag:return new Uint8Array(t(e,this.validator.toBytes()));case s.DelegatedAccountTag:if(this.delegatorAccount&&this.validator)return new Uint8Array(t(e,this.validator.toBytes(),this.delegatorAccount.toBytes()));break;case s.DelegatedPurseTag:if(this.delegatorPurseAddress&&this.validator)return new Uint8Array(t(e,this.validator.toBytes(),l.HexBytes.fromHex(this.delegatorPurseAddress).bytes));break;case s.CreditTag:if(this.validator&&this.eraId){var r=n.alloc(8);return r.writeBigUInt64LE(BigInt(this.eraId),0),new Uint8Array(t(e,this.validator.toBytes(),new Uint8Array(r)))}break;case s.ReservedDelegationAccountTag:if(this.validator&&this.delegatorAccount)return new Uint8Array(t(e,this.validator.toBytes(),this.delegatorAccount.toBytes()));break;case s.ReservedDelegationPurseTag:if(this.delegatorPurseAddress&&this.validator)return new Uint8Array(t(e,this.validator.toBytes(),l.HexBytes.fromHex(this.delegatorPurseAddress).bytes));break;case s.UnbondAccountTag:if(this.validator&&this.delegatorAccount)return new Uint8Array(t(e,this.validator.toBytes(),this.delegatorAccount.toBytes()));break;case s.UnbondPurseTag:if(this.delegatorPurseAddress&&this.validator)return new Uint8Array(t(e,this.validator.toBytes(),l.HexBytes.fromHex(this.delegatorPurseAddress).bytes));break;default:throw new Error("Unexpected BidAddr type: Unknown type byte ".concat(e))}throw new Error("Unexpected BidAddr type: Missing required fields for type byte ".concat(e))},e.fromJSON=function(e){return this.fromHex(e)},e.prototype.toJSON=function(){return this.toPrefixedString()},o([(0,c.jsonMember)({name:"Unified",constructor:f.Hash}),i("design:type",f.Hash)],e.prototype,"unified",void 0),o([(0,c.jsonMember)({name:"Validator",constructor:f.Hash}),i("design:type",f.Hash)],e.prototype,"validator",void 0),o([(0,c.jsonMember)({name:"DelegatorAccount",constructor:f.Hash}),i("design:type",f.Hash)],e.prototype,"delegatorAccount",void 0),o([(0,c.jsonMember)({name:"DelegatorPurseAddress",constructor:String}),i("design:type",String)],e.prototype,"delegatorPurseAddress",void 0),o([(0,c.jsonMember)({name:"EraId",constructor:Number}),i("design:type",Number)],e.prototype,"eraId",void 0),r=o([c.jsonObject],e)}();t.BidAddr=d},1636:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.BlockGlobalAddr=t.getBlockGlobalAddrTag=t.BlockGlobalAddrTagError=t.BlockGlobalAddrTag=void 0;var s,u=r(9592);!function(e){e[e.BlockTime=0]="BlockTime",e[e.MessageCount=1]="MessageCount"}(s=t.BlockGlobalAddrTag||(t.BlockGlobalAddrTag={}));var c=function(e){function t(t){var r=e.call(this,t)||this;return r.name="BlockGlobalAddrTagError",r}return o(t,e),t}(Error);function f(e){if(e===s.BlockTime||e===s.MessageCount)return e;throw new c("Invalid BlockGlobalAddrTag")}t.BlockGlobalAddrTagError=c,t.getBlockGlobalAddrTag=f;var l="time-",d="message-count-",h=function(){function e(e,t){this.blockTime=e,this.messageCount=t}var t;return t=e,e.fromString=function(e){if(e.startsWith(l))return new t({},void 0);if(e.startsWith(d))return new t(void 0,{});throw new Error("Invalid BlockGlobalAddr format")},e.prototype.toPrefixedString=function(){var e=this.blockTime?l:d,t="0".repeat(64);return"".concat("block-global-").concat(e).concat(t)},e.fromBytes=function(e){var r=f(e[0]);if(r===s.BlockTime)return{result:new t({},void 0),bytes:e};if(r===s.MessageCount)return{result:new t(void 0,{}),bytes:e};throw new Error("Unexpected BlockGlobalAddr type")},e.prototype.toBytes=function(){var e=this.messageCount?s.MessageCount:s.BlockTime;return Uint8Array.of(e)},e.fromJSON=function(e){return this.fromString(e)},e.prototype.toJSON=function(){return this.toPrefixedString()},i([(0,u.jsonMember)({name:"BlockTime",constructor:Object}),a("design:type",Object)],e.prototype,"blockTime",void 0),i([(0,u.jsonMember)({name:"MessageCount",constructor:Object}),a("design:type",Object)],e.prototype,"messageCount",void 0),t=i([u.jsonObject,a("design:paramtypes",[Object,Object])],e)}();t.BlockGlobalAddr=h},9682:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ByteCode=void 0;var i,a=r(8905),s=r(5869),u=r(5010);!function(e){e[e.EmptyKind=0]="EmptyKind",e[e.V1CasperWasmKind=1]="V1CasperWasmKind"}(i||(i={}));var c="empty-",f="v1-wasm-",l=function(e){function t(t){var r=e.call(this,t)||this;return r.name="ByteCodeError",r}return o(t,e),t.ErrInvalidByteCodeFormat=new t("Invalid ByteCode format"),t.ErrInvalidByteCodeKind=new t("Invalid ByteCodeKind"),t}(Error),d=function(){function e(e,t){void 0===t&&(t=!1),this.V1CasperWasm=e,this.isEmpty=t}return e.fromJSON=function(t){if(t.startsWith(f))return new e(s.Hash.fromHex(t.replace(f,"")));if(t.startsWith(c))return new e(void 0,!0);throw l.ErrInvalidByteCodeFormat},e.prototype.toJSON=function(){return this.toPrefixedString()},e.prototype.isEmptyCode=function(){return this.isEmpty},e.prototype.toPrefixedString=function(){var e;if(this.V1CasperWasm)return u.PrefixName.ByteCode+f+this.V1CasperWasm.toHex();if(this.isEmpty){var t=null===(e=s.Hash.fromBytes(new Uint8Array(s.Hash.ByteHashLen).fill(0)))||void 0===e?void 0:e.result;return u.PrefixName.ByteCode+c+t.toHex()}throw new Error("Unexpected ByteCode type")},e.fromBytes=function(t){var r=t[0];switch(this.newByteCodeKindFromByte(r)){case i.EmptyKind:return{result:new e(void 0,!0),bytes:t};case i.V1CasperWasmKind:var n=s.Hash.fromBytes(t.subarray(1,s.Hash.ByteHashLen+1));return{result:new e(null==n?void 0:n.result),bytes:null==n?void 0:n.bytes};default:throw l.ErrInvalidByteCodeFormat}},e.newByteCodeKindFromByte=function(e){if(e in i)return e;throw l.ErrInvalidByteCodeKind},e.prototype.toBytes=function(){if(this.V1CasperWasm){var e=new Uint8Array([i.V1CasperWasmKind]),t=this.V1CasperWasm.toBytes();return(0,a.concat)([e,t])}if(this.isEmpty)return new Uint8Array([i.EmptyKind]);throw new Error("Unexpected ByteCode type")},e}();t.ByteCode=d},9975:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.ContractHash=void 0;var i=r(9592),a=r(5869),s=r(5010),u=function(){function e(e,t){this.hash=e,this.originPrefix=t}var t;return t=e,e.prototype.toJSON=function(){return this.originPrefix+this.hash.toHex()},e.prototype.toPrefixedWasmString=function(){return s.PrefixName.ContractWasm+this.hash.toHex()},e.prototype.toPrefixedString=function(){return s.PrefixName.Contract+this.hash.toHex()},e.fromJSON=function(e){return t.newContract(e)},e.newContract=function(e){var r="";e.startsWith(s.PrefixName.Hash)?r=s.PrefixName.Hash:e.startsWith(s.PrefixName.ContractWasm)?r=s.PrefixName.ContractWasm:e.startsWith(s.PrefixName.Contract)?r=s.PrefixName.Contract:e.startsWith(s.PrefixName.EntityContract)&&(r=s.PrefixName.EntityContract);var n=a.Hash.fromHex(e.slice(r.length));return new t(n,r)},n([(0,i.jsonMember)({name:"Hash",constructor:a.Hash}),o("design:type",a.Hash)],e.prototype,"hash",void 0),n([(0,i.jsonMember)({name:"originPrefix",constructor:String}),o("design:type",String)],e.prototype,"originPrefix",void 0),t=n([i.jsonObject,o("design:paramtypes",[a.Hash,String])],e)}();t.ContractHash=u},6199:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.ContractPackageHash=void 0;var i=r(9592),a=r(5869),s=r(5010),u=function(){function e(e,t){this.hash=e,this.originPrefix=t}var t;return t=e,e.prototype.toJSON=function(){return this.originPrefix+this.hash.toHex()},e.prototype.toPrefixedString=function(){return s.PrefixName.ContractPackage+this.hash.toHex()},e.fromJSON=function(e){return t.newContractPackage(e)},e.newContractPackage=function(e){var r="";e.startsWith(s.PrefixName.Hash)?r=s.PrefixName.Hash:e.startsWith(s.PrefixName.ContractPackageWasm)?r=s.PrefixName.ContractPackageWasm:e.startsWith(s.PrefixName.ContractPackage)&&(r=s.PrefixName.ContractPackage);var n=a.Hash.fromHex(e.slice(r.length));return new t(n,r)},n([(0,i.jsonMember)({name:"Hash",constructor:a.Hash}),o("design:type",a.Hash)],e.prototype,"hash",void 0),n([(0,i.jsonMember)({name:"originPrefix",constructor:String}),o("design:type",String)],e.prototype,"originPrefix",void 0),t=n([i.jsonObject,o("design:paramtypes",[a.Hash,String])],e)}();t.ContractPackageHash=u},5793:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.EntityAddr=t.ErrInvalidEntityKind=t.ErrInvalidEntityAddrFormat=t.EntityKindType=void 0;var i,a=r(9592),s=r(8905),u=r(5869),c=r(5010);!function(e){e[e.SystemKind=0]="SystemKind",e[e.AccountKind=1]="AccountKind",e[e.SmartContractKind=2]="SmartContractKind"}(i=t.EntityKindType||(t.EntityKindType={})),t.ErrInvalidEntityAddrFormat=new Error("invalid EntityAddr format"),t.ErrInvalidEntityKind=new Error("invalid EntityKind");var f=function(){function e(e,t,r){this.system=e,this.account=t,this.smartContract=r}var r;return r=e,e.prototype.toPrefixedString=function(){return this.system?"".concat(c.PrefixName.Entity,"system-").concat(this.system.toHex()):this.account?"".concat(c.PrefixName.Entity,"account-").concat(this.account.toHex()):this.smartContract?"".concat(c.PrefixName.Entity,"contract-").concat(this.smartContract.toHex()):""},e.fromPrefixedString=function(e){if((e=e.replace(c.PrefixName.Entity,"")).startsWith("system-")){var n=u.Hash.fromHex(e.replace("system-",""));return new r(n,void 0,void 0)}if(e.startsWith("account-"))return n=u.Hash.fromHex(e.replace("account-","")),new r(void 0,n,void 0);if(e.startsWith("contract-"))return n=u.Hash.fromHex(e.replace("contract-","")),new r(void 0,void 0,n);throw t.ErrInvalidEntityAddrFormat},e.prototype.toBytes=function(){var e,t;if(this.system)e=i.SystemKind,t=this.system.toBytes();else if(this.account)e=i.AccountKind,t=this.account.toBytes();else{if(!this.smartContract)throw new Error("Unexpected EntityAddr type");e=i.SmartContractKind,t=this.smartContract.toBytes()}return(0,s.concat)([Uint8Array.from([e]),t])},e.fromBytes=function(e){if(0===e.length)throw new Error("Buffer is empty, cannot create EntityAddr.");var t=e[0],n=e.subarray(1),o=r.getEntityKindFromByte(t),a=u.Hash.fromBytes(n),s=a.result,c=a.bytes;switch(o){case i.SystemKind:return{result:new r(s,void 0,void 0),bytes:c};case i.AccountKind:return{result:new r(void 0,s,void 0),bytes:c};case i.SmartContractKind:return{result:new r(void 0,void 0,s),bytes:c};default:throw new Error("Invalid EntityAddr format.")}},e.getEntityKindFromByte=function(e){if(e in i)return e;throw new Error("Invalid entity kind tag.")},e.fromJSON=function(e){return this.fromPrefixedString(e)},e.prototype.toJSON=function(){return this.toPrefixedString()},n([(0,a.jsonMember)({constructor:u.Hash,name:"System"}),o("design:type",u.Hash)],e.prototype,"system",void 0),n([(0,a.jsonMember)({constructor:u.Hash,name:"Account"}),o("design:type",u.Hash)],e.prototype,"account",void 0),n([(0,a.jsonMember)({constructor:u.Hash,name:"SmartContract"}),o("design:type",u.Hash)],e.prototype,"smartContract",void 0),r=n([a.jsonObject,o("design:paramtypes",[u.Hash,u.Hash,u.Hash])],e)}();t.EntityAddr=f},4172:function(e,t,r){var n,o=r(8287).Buffer,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.EntryPointAddr=t.getEntryPointTag=t.EntryPointError=t.EntryPointTag=void 0;var u,c=r(9592),f=r(8905),l=r(5793),d=r(5869),h=r(7372);!function(e){e[e.V1EntryPoint=0]="V1EntryPoint",e[e.V2EntryPoint=1]="V2EntryPoint"}(u=t.EntryPointTag||(t.EntryPointTag={}));var p=function(e){function t(t){var r=e.call(this,t)||this;return r.name="EntryPointError",r}return i(t,e),t}(Error);function y(e){if(e===u.V1EntryPoint||e===u.V2EntryPoint)return e;throw new p("Invalid EntryPointTag")}t.EntryPointError=p,t.getEntryPointTag=y;var m="v1-",b="v2-",g=function(){function e(e,t){this.entityAddr=e,this.nameBytes=t}return a([(0,c.jsonMember)({name:"EntityAddr",constructor:l.EntityAddr,deserializer:function(e){return l.EntityAddr.fromJSON(e)},serializer:function(e){return e.toJSON()}}),s("design:type",l.EntityAddr)],e.prototype,"entityAddr",void 0),a([(0,c.jsonMember)(Uint8Array,{name:"NameBytes"}),s("design:type",Uint8Array)],e.prototype,"nameBytes",void 0),a([c.jsonObject,s("design:paramtypes",[l.EntityAddr,Uint8Array])],e)}(),v=function(){function e(e,t){this.entityAddr=e,this.selector=t}return a([(0,c.jsonMember)({name:"EntityAddr",constructor:l.EntityAddr,deserializer:function(e){return l.EntityAddr.fromJSON(e)},serializer:function(e){return e.toJSON()}}),s("design:type",l.EntityAddr)],e.prototype,"entityAddr",void 0),a([(0,c.jsonMember)({name:"Selector",constructor:Number}),s("design:type",Number)],e.prototype,"selector",void 0),a([c.jsonObject,s("design:paramtypes",[l.EntityAddr,Number])],e)}(),w=function(){function e(e,t){this.vmCasperV1=e,this.vmCasperV2=t}var t;return t=e,e.fromString=function(e){var r=e.lastIndexOf("-");if(-1===r)throw new p("Invalid EntryPoint format");var n=e.substring(0,r),i=e.substring(r+1),a=o.from(i,"hex");if(n.startsWith(m)){var s=l.EntityAddr.fromPrefixedString(n.replace(m,"")),u=new Uint8Array(a);return new t(new g(s,u))}if(n.startsWith(b)){s=l.EntityAddr.fromPrefixedString(n.replace(b,""));var c=a.readUInt32LE(0);return new t(void 0,new v(s,c))}throw new p("Invalid EntryPoint format")},e.prototype.toPrefixedString=function(){if(this.vmCasperV1)return m+this.vmCasperV1.entityAddr.toPrefixedString()+"-"+h.Conversions.encodeBase16(this.vmCasperV1.nameBytes);if(this.vmCasperV2){var e=o.alloc(4);return e.writeUInt32LE(this.vmCasperV2.selector,0),b+this.vmCasperV2.entityAddr.toPrefixedString()+"-"+e.toString("hex")}throw new p("Unexpected EntryPointAddr type")},e.prototype.toBytes=function(){var e;if(this.vmCasperV1){var t=new Uint8Array([u.V1EntryPoint]),r=this.vmCasperV1.entityAddr.toBytes(),n=this.vmCasperV1.nameBytes;e=(0,f.concat)([t,r,n])}else{if(!this.vmCasperV2)throw new p("Unexpected EntryPointAddr type");t=new Uint8Array([u.V2EntryPoint]),r=this.vmCasperV2.entityAddr.toBytes();var i=o.alloc(4);i.writeUInt32LE(this.vmCasperV2.selector,0);var a=new Uint8Array(i);e=(0,f.concat)([t,r,a])}return e},e.fromBytes=function(e){var r=y(e[0]),n=l.EntityAddr.fromBytes(e.slice(1));if(r===u.V1EntryPoint){var o=e.slice(1+d.Hash.ByteHashLen,1+d.Hash.ByteHashLen+32);return{result:new t(new g(null==n?void 0:n.result,o)),bytes:o}}if(r===u.V2EntryPoint){var i=new DataView(e.buffer,1+d.Hash.ByteHashLen).getUint32(0,!0);return{result:new t(void 0,new v(null==n?void 0:n.result,i)),bytes:e.subarray(d.Hash.ByteHashLen)}}throw new p("Unexpected EntryPointAddr type")},e.fromJSON=function(e){return this.fromString(e)},e.prototype.toJSON=function(){return this.toPrefixedString()},a([(0,c.jsonMember)({name:"VmCasperV1",constructor:g}),s("design:type",g)],e.prototype,"vmCasperV1",void 0),a([(0,c.jsonMember)({name:"VmCasperV2",constructor:v}),s("design:type",v)],e.prototype,"vmCasperV2",void 0),t=a([c.jsonObject,s("design:paramtypes",[g,v])],e)}();t.EntryPointAddr=w},4055:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Era=void 0;var i=r(9592),a=r(678),s=function(){function e(e){this.value=e}var t;return t=e,e.prototype.toJSON=function(){return this.value.toString()},e.fromJSON=function(e){var r=parseInt(e,10);if(isNaN(r))throw new Error("Invalid Era value: ".concat(e));return new t(r)},e.fromBytes=function(e){var r=new DataView(e.buffer).getUint32(0,!0);return new t(r)},e.prototype.toBytes=function(){return(0,a.toBytesNumber)(64,!1)(this.value)},n([(0,i.jsonMember)({constructor:Number}),o("design:type",Number)],e.prototype,"value",void 0),t=n([i.jsonObject,o("design:paramtypes",[Number])],e)}();t.Era=s},5869:function(e,t,r){var n=r(8287).Buffer,o=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=void 0;var a=r(9592),s=function(){function e(e){if(e.length!==t.ByteHashLen)throw new Error("Invalid hash length, expected ".concat(t.ByteHashLen," bytes."));this.hashBytes=e}var t;return t=e,e.fromHex=function(e){if(e.length!==t.StringHashLen)throw new Error("Invalid string length, expected ".concat(t.StringHashLen," characters."));var r=Uint8Array.from(n.from(e,"hex"));return new t(r)},e.prototype.toHex=function(){return n.from(this.hashBytes).toString("hex")},e.prototype.toBytes=function(){return this.hashBytes},e.prototype.toJSON=function(){return this.toHex()},e.fromJSON=function(e){return t.fromHex(e)},e.fromBytes=function(e){if(e.length<t.ByteHashLen)throw new Error("Key length is less than 32 bytes.");var r=e.subarray(0,t.ByteHashLen);return{result:new t(r),bytes:e.subarray(t.ByteHashLen)}},e.fromBuffer=function(e){if(e.length<t.ByteHashLen)throw new Error("Key length is not equal to 32 bytes.");return new t(new Uint8Array(e.slice(0,t.ByteHashLen)))},e.createHashArray=function(e){if(e.length%t.ByteHashLen!=0)throw new Error("Byte array length must be a multiple of ".concat(t.ByteHashLen,"."));for(var r=[],n=0;n<e.length;n+=t.ByteHashLen){var o=e.subarray(n,n+t.ByteHashLen);r.push(new t(o))}return r},e.prototype.equals=function(e){return this.hashBytes.length===e.hashBytes.length&&this.hashBytes.every(function(t,r){return t===e.hashBytes[r]})},e.ByteHashLen=32,e.StringHashLen=64,t=o([a.jsonObject,i("design:paramtypes",[Uint8Array])],e)}();t.Hash=s},5010:function(e,t,r){var n=r(8287).Buffer,o=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.splitAt=t.Key=t.KEY_DEFAULT_BYTE_LENGTH=t.keyIDbyPrefix=t.typeIDbyNames=t.KeyTypeName=t.KeyTypeID=t.PrefixName=void 0;var a,s,u,c=r(9592),f=r(9002),l=r(5869),d=r(5302),h=r(4055),p=r(5793),y=r(4561),m=r(9682),b=r(4277),g=r(3932),v=r(1636),w=r(2403),S=r(4172),M=r(53);!function(e){e.Account="account-hash-",e.AddressableEntity="addressable-entity-",e.Hash="hash-",e.ContractPackageWasm="contract-package-wasm",e.ContractPackage="contract-package-",e.ContractWasm="contract-wasm-",e.Contract="contract-",e.URef="uref-",e.Transfer="transfer-",e.DeployInfo="deploy-",e.EraId="era-",e.Bid="bid-",e.Balance="balance-",e.Withdraw="withdraw-",e.Dictionary="dictionary-",e.SystemContractRegistry="system-contract-registry-",e.EraSummary="era-summary-",e.Unbond="unbond-",e.ChainspecRegistry="chainspec-registry-",e.EntityContract="entity-contract-",e.ChecksumRegistry="checksum-registry-",e.BidAddr="bid-addr-",e.Package="package-",e.Entity="entity-",e.ByteCode="byte-code-",e.Message="message-",e.NamedKey="named-key-",e.BlockGlobal="block-",e.BalanceHold="balance-hold-",e.EntryPoint="entry-point-"}(a=t.PrefixName||(t.PrefixName={})),function(e){e[e.Account=0]="Account",e[e.Hash=1]="Hash",e[e.URef=2]="URef",e[e.Transfer=3]="Transfer",e[e.DeployInfo=4]="DeployInfo",e[e.EraId=5]="EraId",e[e.Balance=6]="Balance",e[e.Bid=7]="Bid",e[e.Withdraw=8]="Withdraw",e[e.Dictionary=9]="Dictionary",e[e.SystemContractRegistry=10]="SystemContractRegistry",e[e.EraSummary=11]="EraSummary",e[e.Unbond=12]="Unbond",e[e.ChainspecRegistry=13]="ChainspecRegistry",e[e.ChecksumRegistry=14]="ChecksumRegistry",e[e.BidAddr=15]="BidAddr",e[e.Package=16]="Package",e[e.AddressableEntity=17]="AddressableEntity",e[e.ByteCode=18]="ByteCode",e[e.Message=19]="Message",e[e.NamedKey=20]="NamedKey",e[e.BlockGlobal=21]="BlockGlobal",e[e.BalanceHold=22]="BalanceHold",e[e.EntryPoint=23]="EntryPoint"}(s=t.KeyTypeID||(t.KeyTypeID={})),function(e){e.Account="Account",e.Hash="Hash",e.URef="URef",e.Transfer="Transfer",e.Deploy="Deploy",e.Era="Era",e.Bid="Bid",e.Balance="Balance",e.Withdraw="Withdraw",e.Dictionary="Dictionary",e.SystemContractRegistry="SystemContractRegistry",e.EraSummary="EraSummary",e.Unbond="Unbond",e.ChainspecRegistry="ChainspecRegistry",e.ChecksumRegistry="ChecksumRegistry"}(u=t.KeyTypeName||(t.KeyTypeName={})),t.typeIDbyNames=new Map([[u.Account,s.Account],[u.Hash,s.Hash],[u.URef,s.URef],[u.Transfer,s.Transfer],[u.Deploy,s.DeployInfo],[u.Era,s.EraId],[u.Bid,s.Bid],[u.Balance,s.Balance],[u.Withdraw,s.Withdraw],[u.Dictionary,s.Dictionary],[u.SystemContractRegistry,s.SystemContractRegistry],[u.EraSummary,s.EraSummary],[u.Unbond,s.Unbond],[u.ChainspecRegistry,s.ChainspecRegistry],[u.ChecksumRegistry,s.ChecksumRegistry]]),t.keyIDbyPrefix=new Map([[a.Account,s.Account],[a.Hash,s.Hash],[a.Transfer,s.Transfer],[a.URef,s.URef],[a.DeployInfo,s.DeployInfo],[a.EraId,s.EraId],[a.Bid,s.Bid],[a.Balance,s.Balance],[a.Withdraw,s.Withdraw],[a.Dictionary,s.Dictionary],[a.SystemContractRegistry,s.SystemContractRegistry],[a.EraSummary,s.EraSummary],[a.Unbond,s.Unbond],[a.ChainspecRegistry,s.ChainspecRegistry],[a.ChecksumRegistry,s.ChecksumRegistry],[a.BidAddr,s.BidAddr],[a.Package,s.Package],[a.Entity,s.AddressableEntity],[a.ByteCode,s.ByteCode],[a.Message,s.Message],[a.NamedKey,s.NamedKey],[a.BlockGlobal,s.BlockGlobal],[a.BalanceHold,s.BalanceHold],[a.EntryPoint,s.EntryPoint]]),t.KEY_DEFAULT_BYTE_LENGTH=32;var _=function(){function e(){}var r;return r=e,e.prototype.bytes=function(e){var t,n,o,i,a,u,c,f,l,d,h,p,y,m,b,g,v,w,S,M,_,A,E,O;void 0===e&&(e=!0);var j=e?Uint8Array.from([this.type]):void 0;switch(this.type){case s.Balance:return r.concatBytes(null===(t=this.balance)||void 0===t?void 0:t.toBytes(),j);case s.Bid:return r.concatBytes(null===(n=this.bid)||void 0===n?void 0:n.toBytes(),j);case s.Withdraw:return r.concatBytes(null===(o=this.withdraw)||void 0===o?void 0:o.toBytes(),j);case s.SystemContractRegistry:return r.concatBytes(null===(i=this.systemContactRegistry)||void 0===i?void 0:i.toBytes(),j);case s.Unbond:return r.concatBytes(null===(a=this.unbond)||void 0===a?void 0:a.toBytes(),j);case s.ChainspecRegistry:return r.concatBytes(null===(u=this.chainspecRegistry)||void 0===u?void 0:u.toBytes(),j);case s.ChecksumRegistry:return r.concatBytes(null===(c=this.checksumRegistry)||void 0===c?void 0:c.toBytes(),j);case s.EraSummary:return r.concatBytes(null===(f=this.eraSummary)||void 0===f?void 0:f.toBytes(),j);case s.Account:return r.concatBytes(null===(l=this.account)||void 0===l?void 0:l.toBytes(),j);case s.Hash:return r.concatBytes(null===(d=this.hash)||void 0===d?void 0:d.toBytes(),j);case s.EraId:return r.concatBytes(null===(h=this.era)||void 0===h?void 0:h.toBytes(),j);case s.URef:return r.concatBytes(null===(p=this.uRef)||void 0===p?void 0:p.bytes(),j);case s.Transfer:return r.concatBytes(null===(y=this.transfer)||void 0===y?void 0:y.toBytes(),j);case s.DeployInfo:return r.concatBytes(null===(m=this.deploy)||void 0===m?void 0:m.toBytes(),j);case s.Dictionary:return r.concatBytes(null===(b=this.dictionary)||void 0===b?void 0:b.toBytes(),j);case s.BidAddr:return r.concatBytes(null===(g=this.bidAddr)||void 0===g?void 0:g.toBytes(),j);case s.Package:return r.concatBytes(null===(v=this.package)||void 0===v?void 0:v.toBytes(),j);case s.AddressableEntity:return r.concatBytes(null===(w=this.addressableEntity)||void 0===w?void 0:w.toBytes(),j);case s.ByteCode:return r.concatBytes(null===(S=this.byteCode)||void 0===S?void 0:S.toBytes(),j);case s.Message:return r.concatBytes(null===(M=this.message)||void 0===M?void 0:M.toBytes(),j);case s.NamedKey:return r.concatBytes(null===(_=this.namedKey)||void 0===_?void 0:_.toBytes(),j);case s.BlockGlobal:return r.concatBytes(null===(A=this.blockGlobal)||void 0===A?void 0:A.toBytes(),j);case s.BalanceHold:return r.concatBytes(null===(E=this.balanceHold)||void 0===E?void 0:E.toBytes(),j);case s.EntryPoint:return r.concatBytes(null===(O=this.entryPoint)||void 0===O?void 0:O.toBytes(),j);default:return new Uint8Array}},e.concatBytes=function(e,t){if(void 0===e&&(e=Uint8Array.from([])),t){var r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}return e},e.prototype.toJSON=function(){return n.from(this.bytes(!1)).toString("hex")},e.prototype.toPrefixedString=function(){var e,t;switch(this.type){case s.Account:return this.account.toPrefixedString();case s.Hash:return"".concat(a.Hash).concat(null===(e=this.hash)||void 0===e?void 0:e.toHex());case s.EraId:return"".concat(a.EraId).concat(null===(t=this.era)||void 0===t?void 0:t.toJSON());case s.URef:return this.uRef.toPrefixedString();case s.Transfer:return this.transfer.toPrefixedString();case s.DeployInfo:return"".concat(a.DeployInfo).concat(this.deploy.toHex());case s.Dictionary:return"".concat(a.Dictionary).concat(this.dictionary.toHex());case s.Balance:return"".concat(a.Balance).concat(this.balance.toHex());case s.Bid:return"".concat(a.Bid).concat(this.bid.toHex());case s.Withdraw:return"".concat(a.Withdraw).concat(this.withdraw.toHex());case s.SystemContractRegistry:return"".concat(a.SystemContractRegistry).concat(this.systemContactRegistry.toHex());case s.EraSummary:return"".concat(a.EraSummary).concat(this.eraSummary.toHex());case s.Unbond:return"".concat(a.Unbond).concat(this.unbond.toHex());case s.ChainspecRegistry:return"".concat(a.ChainspecRegistry).concat(this.chainspecRegistry.toHex());case s.ChecksumRegistry:return"".concat(a.ChecksumRegistry).concat(this.checksumRegistry.toHex());case s.BidAddr:return this.bidAddr.toPrefixedString();case s.Package:return"".concat(a.Package).concat(this.package.toHex());case s.AddressableEntity:return this.addressableEntity.toPrefixedString();case s.ByteCode:return this.byteCode.toPrefixedString();case s.Message:return this.message.toPrefixedString();case s.NamedKey:return this.namedKey.toPrefixedString();case s.BlockGlobal:return this.blockGlobal.toPrefixedString();case s.BalanceHold:return this.balanceHold.toPrefixedString();case s.EntryPoint:return this.entryPoint.toPrefixedString();default:return""}},e.prototype.toString=function(){return this.toPrefixedString()},e.fromBytes=function(e){var n,o=e[0],i=e.subarray(1),a=new r;switch(a.type=o,o){case s.Account:var u=l.Hash.fromBytes(i);return a.account=new f.AccountHash(null==u?void 0:u.result),{result:a,bytes:null==u?void 0:u.bytes};case s.Hash:var c=l.Hash.fromBytes(i);return a.hash=null==c?void 0:c.result,{result:a,bytes:null==c?void 0:c.bytes};case s.URef:var _=M.URef.fromBytes(i);return a.uRef=null==_?void 0:_.result,{result:a,bytes:null==_?void 0:_.bytes};case s.Transfer:var A=l.Hash.fromBytes(i);return a.transfer=new d.TransferHash(null==A?void 0:A.result.toHex()),{result:a,bytes:null==A?void 0:A.bytes};case s.DeployInfo:var E=l.Hash.fromBytes(i);return a.deploy=null==E?void 0:E.result,{result:a,bytes:null==E?void 0:E.bytes};case s.EraId:var O=(0,t.splitAt)(1,i),j=O[0],T=O[1];return a.era=h.Era.fromBytes(j),{result:a,bytes:T};case s.Balance:var N=l.Hash.fromBytes(i);return a.balance=null==N?void 0:N.result,{result:a,bytes:null==N?void 0:N.bytes};case s.Bid:var P=l.Hash.fromBytes(i);return a.bid=new f.AccountHash(P.result),{result:a,bytes:null==P?void 0:P.bytes};case s.Withdraw:var B=l.Hash.fromBytes(i),R=null==B?void 0:B.result;return a.withdraw=new f.AccountHash(R),{result:a,bytes:null==B?void 0:B.bytes};case s.Dictionary:var C=l.Hash.fromBytes(i);return a.dictionary=null==C?void 0:C.result,{result:a,bytes:null==C?void 0:C.bytes};case s.SystemContractRegistry:var x=l.Hash.fromBytes(i);return a.systemContactRegistry=null==x?void 0:x.result,{result:a,bytes:null==x?void 0:x.bytes};case s.EraSummary:var I=l.Hash.fromBytes(i);return a.eraSummary=null==I?void 0:I.result,{result:a,bytes:null==I?void 0:I.bytes};case s.Unbond:var k=l.Hash.fromBytes(i),H=k.result,U=k.bytes;return a.unbond=new f.AccountHash(H),{result:a,bytes:U};case s.ChainspecRegistry:var L=(0,t.splitAt)(t.KEY_DEFAULT_BYTE_LENGTH,i),D=L[0],V=L[1];return a.chainspecRegistry=null===(n=l.Hash.fromBytes(D))||void 0===n?void 0:n.result,{result:a,bytes:V};case s.ChecksumRegistry:var z=l.Hash.fromBytes(i);return a.checksumRegistry=null==z?void 0:z.result,{result:a,bytes:null==z?void 0:z.bytes};case s.BidAddr:var J=y.BidAddr.fromBytes(i),K=J.result,F=J.bytes;return a.bidAddr=K,{result:a,bytes:F};case s.Package:var q=l.Hash.fromBytes(i);return a.package=null==q?void 0:q.result,{result:a,bytes:null==q?void 0:q.bytes};case s.AddressableEntity:var W=p.EntityAddr.fromBytes(i),G=W.result,Z=W.bytes;return a.addressableEntity=G,{result:a,bytes:Z};case s.ByteCode:var $=m.ByteCode.fromBytes(i),X=$.result,Q=$.bytes;return a.byteCode=X,{result:a,bytes:Q};case s.Message:var Y=b.MessageAddr.fromBytes(i),ee=Y.result,te=Y.bytes;return a.message=ee,{result:a,bytes:te};case s.NamedKey:var re=g.NamedKeyAddr.fromBytes(i),ne=re.result,oe=re.bytes;return a.namedKey=ne,{result:a,bytes:oe};case s.BlockGlobal:var ie=v.BlockGlobalAddr.fromBytes(i),ae=ie.result,se=ie.bytes;return a.blockGlobal=ae,{result:a,bytes:se};case s.BalanceHold:var ue=w.BalanceHoldAddr.fromBytes(i),ce=ue.result,fe=ue.bytes;return a.balanceHold=ce,{result:a,bytes:fe};case s.EntryPoint:var le=S.EntryPointAddr.fromBytes(i),de=le.result,he=le.bytes;return a.entryPoint=de,{result:a,bytes:he};default:throw new Error("Missing key type")}},e.findPrefixByMap=function(e,t){var r="";return t.forEach(function(t,n){e.startsWith(n)&&(r=n===a.EraId&&e.startsWith(a.EraSummary)?a.EraSummary:n===a.Bid&&e.startsWith(a.BidAddr)?a.BidAddr:n===a.Balance&&e.startsWith(a.BalanceHold)?a.BalanceHold:n)}),r},e.createByType=function(e,t){var n=new r;switch(n.type=t,n.type){case s.EraId:n.era=h.Era.fromJSON(e.replace(a.EraId,""));break;case s.Hash:n.hash=l.Hash.fromHex(e.replace(a.Hash,""));break;case s.URef:n.uRef=M.URef.fromString(e);break;case s.Account:n.account=f.AccountHash.fromString(e);break;case s.Transfer:n.transfer=d.TransferHash.fromJSON(e);break;case s.DeployInfo:n.deploy=l.Hash.fromHex(e.replace(a.DeployInfo,""));break;case s.Balance:n.balance=l.Hash.fromHex(e.replace(a.Balance,""));break;case s.Bid:n.bid=f.AccountHash.fromString(e.replace(a.Bid,""));break;case s.Withdraw:n.withdraw=f.AccountHash.fromString(e.replace(a.Withdraw,""));break;case s.Dictionary:n.dictionary=l.Hash.fromHex(e.replace(a.Dictionary,""));break;case s.SystemContractRegistry:n.systemContactRegistry=l.Hash.fromHex(e.replace(a.SystemContractRegistry,""));break;case s.EraSummary:n.eraSummary=l.Hash.fromHex(e.replace(a.EraSummary,""));break;case s.Unbond:n.unbond=f.AccountHash.fromString(e.replace(a.Unbond,""));break;case s.ChainspecRegistry:n.chainspecRegistry=l.Hash.fromHex(e.replace(a.ChainspecRegistry,""));break;case s.ChecksumRegistry:n.checksumRegistry=l.Hash.fromHex(e.replace(a.ChecksumRegistry,""));break;case s.BidAddr:n.bidAddr=y.BidAddr.fromHex(e.replace(a.BidAddr,""));break;case s.Package:n.package=l.Hash.fromHex(e.replace(a.Package,""));break;case s.AddressableEntity:n.addressableEntity=p.EntityAddr.fromPrefixedString(e.replace(a.AddressableEntity,""));break;case s.ByteCode:n.byteCode=m.ByteCode.fromJSON(e.replace(a.ByteCode,""));break;case s.Message:n.message=b.MessageAddr.fromString(e);break;case s.NamedKey:n.namedKey=g.NamedKeyAddr.fromString(e.replace(a.NamedKey,""));break;case s.BlockGlobal:n.blockGlobal=v.BlockGlobalAddr.fromString(e.replace(a.BlockGlobal,""));break;case s.BalanceHold:n.balanceHold=w.BalanceHoldAddr.fromString(e.replace(a.BalanceHold,""));break;case s.EntryPoint:n.entryPoint=S.EntryPointAddr.fromString(e.replace(a.EntryPoint,""));break;default:throw new Error("type is not found -> source: ".concat(e))}return n},e.parseTypeByString=function(e){var n=e.indexOf("(");if(-1===n)throw new Error("invalid key format");var o=e.slice(5,n),i=e.slice(n+1,-1),a=t.typeIDbyNames.get(o);if(void 0===a)throw new Error("unexpected KeyType");return r.createByType(i,a)},e.newKey=function(e){if(e.length===l.Hash.StringHashLen){var n=l.Hash.fromHex(e),o=new r;return o.type=s.Hash,o.hash=n,o}if(e.startsWith("Key::"))return r.parseTypeByString(e);if(e.startsWith("00")&&e.length===l.Hash.StringHashLen+2)return r.createByType(e.slice(2),s.Account);var i=r.findPrefixByMap(e,t.keyIDbyPrefix);if(!i)throw new Error("prefix is not found, source: ".concat(e));return r.createByType(e,t.keyIDbyPrefix.get(i))},o([(0,c.jsonMember)({name:"Type",constructor:Number}),i("design:type",Number)],e.prototype,"type",void 0),o([(0,c.jsonMember)(function(){return f.AccountHash},{name:"Account"}),i("design:type",f.AccountHash)],e.prototype,"account",void 0),o([(0,c.jsonMember)({name:"Hash",constructor:l.Hash}),i("design:type",l.Hash)],e.prototype,"hash",void 0),o([(0,c.jsonMember)({name:"URef",constructor:M.URef}),i("design:type",M.URef)],e.prototype,"uRef",void 0),o([(0,c.jsonMember)({name:"Transfer",constructor:d.TransferHash}),i("design:type",d.TransferHash)],e.prototype,"transfer",void 0),o([(0,c.jsonMember)({name:"Deploy",constructor:l.Hash}),i("design:type",l.Hash)],e.prototype,"deploy",void 0),o([(0,c.jsonMember)({name:"Era",constructor:h.Era}),i("design:type",h.Era)],e.prototype,"era",void 0),o([(0,c.jsonMember)({name:"Balance",constructor:l.Hash}),i("design:type",l.Hash)],e.prototype,"balance",void 0),o([(0,c.jsonMember)(function(){return f.AccountHash},{name:"Bid"}),i("design:type",f.AccountHash)],e.prototype,"bid",void 0),o([(0,c.jsonMember)(function(){return f.AccountHash},{name:"Withdraw"}),i("design:type",f.AccountHash)],e.prototype,"withdraw",void 0),o([(0,c.jsonMember)({name:"Dictionary",constructor:l.Hash}),i("design:type",l.Hash)],e.prototype,"dictionary",void 0),o([(0,c.jsonMember)({name:"SystemContactRegistry",constructor:l.Hash}),i("design:type",l.Hash)],e.prototype,"systemContactRegistry",void 0),o([(0,c.jsonMember)({name:"EraSummary",constructor:l.Hash}),i("design:type",l.Hash)],e.prototype,"eraSummary",void 0),o([(0,c.jsonMember)(function(){return f.AccountHash},{name:"Unbond"}),i("design:type",f.AccountHash)],e.prototype,"unbond",void 0),o([(0,c.jsonMember)({name:"ChainspecRegistry",constructor:l.Hash}),i("design:type",l.Hash)],e.prototype,"chainspecRegistry",void 0),o([(0,c.jsonMember)({name:"ChecksumRegistry",constructor:l.Hash}),i("design:type",l.Hash)],e.prototype,"checksumRegistry",void 0),o([(0,c.jsonMember)({name:"BidAddr",constructor:y.BidAddr}),i("design:type",y.BidAddr)],e.prototype,"bidAddr",void 0),o([(0,c.jsonMember)({name:"Package",constructor:l.Hash}),i("design:type",l.Hash)],e.prototype,"package",void 0),o([(0,c.jsonMember)({name:"AddressableEntity",constructor:p.EntityAddr}),i("design:type",p.EntityAddr)],e.prototype,"addressableEntity",void 0),o([(0,c.jsonMember)({name:"ByteCode",constructor:m.ByteCode}),i("design:type",m.ByteCode)],e.prototype,"byteCode",void 0),o([(0,c.jsonMember)({name:"Message",constructor:b.MessageAddr}),i("design:type",b.MessageAddr)],e.prototype,"message",void 0),o([(0,c.jsonMember)({name:"NamedKey",constructor:g.NamedKeyAddr}),i("design:type",g.NamedKeyAddr)],e.prototype,"namedKey",void 0),o([(0,c.jsonMember)({name:"BlockGlobal",constructor:v.BlockGlobalAddr}),i("design:type",v.BlockGlobalAddr)],e.prototype,"blockGlobal",void 0),o([(0,c.jsonMember)({name:"BalanceHold",constructor:w.BalanceHoldAddr}),i("design:type",w.BalanceHoldAddr)],e.prototype,"balanceHold",void 0),o([(0,c.jsonMember)({name:"EntryPoint",constructor:S.EntryPointAddr}),i("design:type",S.EntryPointAddr)],e.prototype,"entryPoint",void 0),r=o([c.jsonObject],e)}();t.Key=_,t.splitAt=function(e,t){if(e>t.length-1)throw new Error("Early end of stream when deserializing data.");var r=new Uint8Array(t);return[r.subarray(0,e),r.subarray(e)]}},4277:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MessageAddr=void 0;var i=r(8905),a=r(9592),s=r(5869),u=r(5793),c="topic-",f="message-",l=function(){function e(e,t,r){this.entityAddr=e,this.topicNameHash=t,this.messageIndex=r}var t;return t=e,e.fromString=function(e){if(!e.startsWith(f))throw new Error("Key not valid. It should start with '".concat(f,"'."));var r,n,o;if((e=e.substring(8)).startsWith(c)){if(4!==(i=(e=e.substring(6)).split("-")).length)throw new Error("Key not valid. It should have a hash address and a topic hash.");r="".concat(i[0],"-").concat(i[1],"-").concat(i[2]),n=i[3]}else{var i;if(5!==(i=e.split("-")).length)throw new Error("Key not valid. It should have a hash address, a topic hash, and a message index.");if(r="".concat(i[0],"-").concat(i[1],"-").concat(i[2]),n=i[3],0===i[4].length)throw new Error("Key not valid. Expected a non-empty message index.");o=parseInt(i[4],16)}return new t(u.EntityAddr.fromPrefixedString(r),s.Hash.fromHex(n),o)},e.prototype.toPrefixedString=function(){var e=f;return this.messageIndex||(e+=c),e+=this.entityAddr.toPrefixedString(),e+="-"+this.topicNameHash.toHex(),void 0!==this.messageIndex&&(e+="-".concat(this.messageIndex)),e},e.prototype.toJSON=function(){return this.toPrefixedString()},e.fromBytes=function(e){var r,n=u.EntityAddr.fromBytes(e),o=s.Hash.fromBytes(e);if(e.length>0){var a=e.slice(e.length-4);r=new DataView(a.buffer).getUint32(0,!0)}return{result:new t(null==n?void 0:n.result,null==o?void 0:o.result,r),bytes:(0,i.concat)([n.bytes,o.bytes])}},e.prototype.toBytes=function(){var e=this.entityAddr.toBytes(),t=this.topicNameHash.toBytes(),r=new Uint8Array(e.length+t.length+(void 0!==this.messageIndex?4:0));if(r.set(e),r.set(t,e.length),void 0!==this.messageIndex){var n=new Uint8Array(4);new DataView(n.buffer).setUint32(0,this.messageIndex,!0),r.set(n,e.length+t.length)}return r},n([(0,a.jsonMember)({name:"EntityAddr",constructor:u.EntityAddr,deserializer:function(e){if(e)return u.EntityAddr.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",u.EntityAddr)],e.prototype,"entityAddr",void 0),n([(0,a.jsonMember)({name:"TopicNameHash",constructor:s.Hash}),o("design:type",s.Hash)],e.prototype,"topicNameHash",void 0),n([(0,a.jsonMember)({name:"MessageIndex",constructor:Number}),o("design:type",Number)],e.prototype,"messageIndex",void 0),t=n([a.jsonObject,o("design:paramtypes",[u.EntityAddr,s.Hash,Number])],e)}();t.MessageAddr=l},3932:function(e,t,r){var n=r(8287).Buffer,o=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.NamedKeyAddr=void 0;var a=r(9592),s=r(5793),u=r(5010),c=function(){function e(e,t){this.baseAddr=e,this.nameBytes=t}var t;return t=e,e.fromString=function(e){var r=e.substring(e.lastIndexOf("-")+1),o=e.substring(0,e.lastIndexOf("-")).replace(u.PrefixName.AddressableEntity,""),i=n.from(r,"hex");if(32!==i.length)throw new Error("Invalid NameBytes length, expected 32 bytes.");var a=s.EntityAddr.fromPrefixedString(o);return new t(a,i)},e.prototype.toPrefixedString=function(){return"".concat(u.PrefixName.NamedKey).concat(this.baseAddr.toPrefixedString(),"-").concat(n.from(this.nameBytes).toString("hex"))},e.prototype.toJSON=function(){return this.toPrefixedString()},e.fromBytes=function(e){var r=s.EntityAddr.fromBytes(e);if(e.length<32)throw new Error("Insufficient bytes for NameBytes; expected 32 bytes.");var n=e.slice(0,32);return{result:new t(null==r?void 0:r.result,n),bytes:null==r?void 0:r.bytes}},e.prototype.toBytes=function(){return n.concat([this.baseAddr.toBytes(),this.nameBytes])},o([(0,a.jsonMember)({name:"BaseAddr",constructor:s.EntityAddr}),i("design:type",s.EntityAddr)],e.prototype,"baseAddr",void 0),o([(0,a.jsonMember)({name:"NameBytes",constructor:Uint8Array}),i("design:type",Uint8Array)],e.prototype,"nameBytes",void 0),t=o([a.jsonObject,i("design:paramtypes",[s.EntityAddr,Uint8Array])],e)}();t.NamedKeyAddr=c},5302:function(e,t,r){var n,o=r(8287).Buffer,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.TransferHash=t.PrefixNameTransfer=void 0;var u=r(9592),c=r(5869);t.PrefixNameTransfer="transfer-";var f=function(e){function r(r){var o=this;if(o.originPrefix=t.PrefixNameTransfer,"string"==typeof r){var i=n.initializeFromSource(r),a=i.hashBytes,s=i.originPrefix;(o=e.call(this,a)||this).originPrefix=s}else o=e.call(this,r)||this;return o}var n;return i(r,e),n=r,r.initializeFromSource=function(e){var r=e.startsWith(t.PrefixNameTransfer)?t.PrefixNameTransfer:"",n=e.replace(r,"");return{hashBytes:Uint8Array.from(o.from(n,"hex")),originPrefix:r}},r.prototype.toPrefixedString=function(){return"".concat(this.originPrefix).concat(this.toHex())},r.prototype.toJSON=function(){return this.toPrefixedString()},r.fromJSON=function(e){return new n(e)},a([(0,u.jsonMember)({name:"originPrefix",constructor:String}),s("design:type",String)],r.prototype,"originPrefix",void 0),n=a([u.jsonObject,s("design:paramtypes",[Object])],r)}(c.Hash);t.TransferHash=f},53:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.URef=t.ByteHashLen=t.PrefixNameURef=t.ErrIncorrectUrefFormat=t.UrefAccess=void 0;var i,a=r(9592),s=r(7372),u=r(8905);!function(e){e[e.None=0]="None",e[e.Read=1]="Read",e[e.Write=2]="Write",e[e.Add=3]="Add",e[e.ReadWrite=4]="ReadWrite",e[e.ReadAdd=5]="ReadAdd",e[e.AddWrite=6]="AddWrite",e[e.ReadAddWrite=7]="ReadAddWrite"}(i=t.UrefAccess||(t.UrefAccess={})),t.ErrIncorrectUrefFormat=new Error("incorrect uref format"),t.PrefixNameURef="uref-",t.ByteHashLen=32;var c=function(){function e(e,r){if(e.length!==t.ByteHashLen)throw new Error("Invalid URef data length; expected ".concat(t.ByteHashLen));if(!Object.values(i).includes(r))throw new Error("Unsupported AccessRights");this.data=e,this.access=r}var r;return r=e,e.prototype.bytes=function(){var e=new Uint8Array([this.access]);return(0,u.concat)([this.data,e])},e.prototype.toPrefixedString=function(){return[t.PrefixNameURef.replace("-",""),this.toString()].join("-")},e.prototype.toString=function(){return[s.Conversions.encodeBase16(this.data),new Array(3).join("0").slice(-3)+this.access.toString(8)].join("-")},e.prototype.setAccess=function(e){this.access=e},e.prototype.toJSON=function(){return this.toPrefixedString()},e.fromJSON=function(e){return r.fromString(e)},e.fromString=function(e){if(!e.startsWith("".concat(t.PrefixNameURef)))throw new Error("Prefix is not 'uref-'");var n=e.substring("".concat(t.PrefixNameURef).length).split("-",2);if(2!==n.length)throw t.ErrIncorrectUrefFormat;var o=s.Conversions.decodeBase16(n[0]),i=parseInt(n[1],8);return new r(o,i)},e.fromBytes=function(e){if(e.length!==t.ByteHashLen+1)throw new Error("Invalid URef bytes length");var n=e.subarray(0,t.ByteHashLen),o=e[t.ByteHashLen];return{result:new r(n,o),bytes:e.subarray(t.ByteHashLen+1)}},e.prototype.toDriverValue=function(){return this.bytes()},e.fromBuffer=function(e){var n=new DataView(e);if(n.byteLength<t.ByteHashLen+1)throw new Error("ArrayBuffer size is too small");var o=new Uint8Array(e.slice(0,t.ByteHashLen)),i=n.getUint8(t.ByteHashLen);return new r(o,i)},n([(0,a.jsonMember)(Uint8Array),o("design:type",Uint8Array)],e.prototype,"data",void 0),n([(0,a.jsonMember)({constructor:Number}),o("design:type",Number)],e.prototype,"access",void 0),r=n([a.jsonObject,o("design:paramtypes",[Uint8Array,Number])],e)}();t.URef=c},3401:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(9002),t),o(r(438),t),o(r(2403),t),o(r(4561),t),o(r(1636),t),o(r(5793),t),o(r(4172),t),o(r(4055),t),o(r(5869),t),o(r(5010),t),o(r(4277),t),o(r(3932),t),o(r(5302),t),o(r(53),t),o(r(9682),t),o(r(9975),t),o(r(6199),t)},2048:(e,t)=>{var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.KeyAlgorithmUtils=t.KeySettings=t.KeyAlgorithm=void 0,function(e){e[e.ED25519=1]="ED25519",e[e.SECP256K1=2]="SECP256K1"}(n=t.KeyAlgorithm||(t.KeyAlgorithm={})),t.KeySettings=((r={})[n.ED25519]={name:"ED25519"},r[n.SECP256K1]={name:"SECP256K1"},r);var o=function(){function e(e){this.algorithm=e}return e.prototype.toString=function(){return t.KeySettings[this.algorithm].name},e.prototype.toByte=function(){return this.algorithm},e}();t.KeyAlgorithmUtils=o},4359:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}u((n=n.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.PrivateKey=void 0;var i=r(8905),a=r(2261),s=r(8385),u=r(7846),c=r(2048),f=function(){function e(e,t,r){this.alg=e,this.pub=t,this.priv=r}return e.prototype.toBytes=function(){return this.priv.toBytes()},Object.defineProperty(e.prototype,"publicKey",{get:function(){return this.pub},enumerable:!1,configurable:!0}),e.prototype.toPem=function(){return this.priv.toPem()},e.prototype.sign=function(e){return this.priv.sign(e)},e.prototype.signAndAddAlgorithmBytes=function(e){var t=this.priv.sign(e),r=Uint8Array.of(this.alg);return(0,i.concat)([r,t])},e.prototype.rawSign=function(e){return n(this,void 0,void 0,function(){return o(this,function(t){return[2,this.priv.sign(e)]})})},e.generate=function(t){var r=l.createPrivateKey(t),n=r.publicKeyBytes(),o=Uint8Array.of(t);return new e(t,a.PublicKey.fromBuffer((0,i.concat)([o,n])),r)},e.fromPem=function(t,r){var n=l.createPrivateKeyFromPem(t,r),o=n.publicKeyBytes(),s=Uint8Array.of(r);return new e(r,a.PublicKey.fromBuffer((0,i.concat)([s,o])),n)},e.fromHex=function(t,r){var n=l.createPrivateKeyFromHex(t,r),o=n.publicKeyBytes(),s=Uint8Array.of(r);return new e(r,a.PublicKey.fromBuffer((0,i.concat)([s,o])),n)},e}();t.PrivateKey=f;var l=function(){function e(){}return e.createPrivateKey=function(e){switch(e){case c.KeyAlgorithm.ED25519:return s.PrivateKey.generate();case c.KeyAlgorithm.SECP256K1:return u.PrivateKey.generate();default:throw new Error("Unsupported key algorithm: ".concat(e))}},e.createPrivateKeyFromPem=function(e,t){switch(t){case c.KeyAlgorithm.ED25519:return s.PrivateKey.fromPem(e);case c.KeyAlgorithm.SECP256K1:return u.PrivateKey.fromPem(e);default:throw new Error("Unsupported key algorithm: ".concat(t))}},e.createPrivateKeyFromHex=function(e,t){switch(t){case c.KeyAlgorithm.ED25519:return s.PrivateKey.fromHex(e);case c.KeyAlgorithm.SECP256K1:return u.PrivateKey.fromHex(e);default:throw new Error("Unsupported key algorithm: ".concat(t))}},e}()},2261:function(e,t,r){var n=r(8287).Buffer,o=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.isValidPublicKey=t.isSameCase=t.PublicKeyList=t.PublicKey=void 0;var a,s=r(9592),u=r(8905),c=r(2019),f=r(4570),l=r(3401),d=r(7372),h=r(678),p=new Error("empty signature"),y=new Error("invalid public key algorithm"),m=new Error("invalid signature"),b=new Error("empty public key");!function(e){e[e.ED25519=1]="ED25519",e[e.SECP256K1=2]="SECP256K1"}(a||(a={}));var g=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","A","B","C","D","E","F"],v=function(){function e(e,t){this.cryptoAlg=e,this.key=t}var t;return t=e,e.prototype.bytes=function(){if(!this.key)return new Uint8Array;var e=new Uint8Array([this.cryptoAlg]),t=this.key.bytes();return(0,u.concat)([e,t])},e.prototype.toHex=function(e){if(void 0===e&&(e=!1),!this.key)throw new Error("Public key initialised incorrectly. Missing key");var r="0".concat(this.cryptoAlg).concat(d.Conversions.encodeBase16(this.key.bytes()));if(e){var n=d.Conversions.decodeBase16(r);return t.encode(n.slice(0,1))+t.encode(n.slice(1))}return r},e.prototype.toJSON=function(){return this.toHex()},e.prototype.toString=function(){return this.toHex()},e.fromJSON=function(e){return t.fromHex(e)},e.fromHex=function(e,r){if(void 0===r&&(r=!1),e.length<2)throw new Error("Public key error: too short");if(!/^0(1[0-9a-fA-F]{64}|2[0-9a-fA-F]{66})$/.test(e))throw new Error("Invalid public key");if(r&&!t.isChecksummed(e))throw Error("Provided public key is not checksummed.");return t.fromBuffer(d.Conversions.decodeBase16(e))},e.fromBuffer=function(e){var r,n=new Uint8Array(e),o=n[0],i=n.slice(1);switch(o){case a.ED25519:r=new c.PublicKey(i);break;case a.SECP256K1:r=new f.PublicKey(i);break;default:throw y}return new t(o,r)},e.prototype.accountHash=function(){if(!this.key)return new l.AccountHash(new l.Hash(new Uint8Array(0)));var e=a[this.cryptoAlg].toLowerCase(),t=(new TextEncoder).encode(e),r=new Uint8Array([0]),o=this.key.bytes(),i=(0,u.concat)([t,r,o]),s=(0,h.byteHash)(i),c=l.Hash.fromBuffer(n.from(s));return new l.AccountHash(c,"account-hash")},e.prototype.verifySignature=function(e,t){if(t.length<=1)throw p;if(!this.key)throw b;var r=t.slice(1),n=this.key.verifySignature(e,r);if(!n)throw m;return n},e.prototype.toPem=function(){return this.key.toPem()},e.fromPem=function(e,r){var n=null;switch(r){case a.ED25519:n=c.PublicKey.fromPem(e);break;case a.SECP256K1:n=f.PublicKey.fromPem(e);break;default:throw y}return new t(r,n)},e.prototype.equals=function(e){return this.toHex()===e.toHex()},e.newPublicKey=function(e){var t,r=n.from(e,"hex");return null===(t=this.fromBytes(r))||void 0===t?void 0:t.result},e.fromBytes=function(e){var r,n=e[0],o=null;switch(n){case a.ED25519:r=32,o=new c.PublicKey(e.subarray(1,r+1));break;case a.SECP256K1:r=33,o=new f.PublicKey(e.subarray(1,r+1));break;default:throw y}return{result:new t(n,o),bytes:e.subarray(r+1)}},e.isChecksummed=function(e){var r=new Uint8Array(n.from(e,"hex"));return!!(r.length>75||S(e))||(M(e)?e===t.encode(r.slice(0,1))+t.encode(r.slice(1)):e===t.encode(r))},e.encode=function(e){var t=e.reduce(function(e,t){return(0,u.concat)([e,Uint8Array.of(t>>>4,15&t)])},new Uint8Array),r=function(e){for(var t=[],r=0,n=0;r<e.length;r++)for(var o=0;o<8;o++)t[n++]=1==(e[r]>>>o&1);return t}((0,h.byteHash)(e)).values();return t.reduce(function(e,t){var n=g[t];return/^[a-zA-Z()]+$/.test(n)&&r.next().value?e+n.toUpperCase():e+n.toLowerCase()},"")},o([(0,s.jsonMember)({constructor:Number}),i("design:type",Number)],e.prototype,"cryptoAlg",void 0),t=o([s.jsonObject,i("design:paramtypes",[Number,Object])],e)}();t.PublicKey=v;var w=function(){function e(e){void 0===e&&(e=[]),this.keys=e}return e.prototype.contains=function(e){return this.keys.some(function(t){return t.equals(e)})},e}();function S(e){return/^[a-z0-9]+$|^[A-Z0-9]+$/.test(e)}function M(e){return/^0(1[0-9a-fA-F]{64}|2[0-9a-fA-F]{66})$/.test(e)}t.PublicKeyList=w,t.isSameCase=S,t.isValidPublicKey=M},8385:function(e,t,r){var n=r(8287).Buffer,o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&o(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.PrivateKey=void 0;var s=a(r(5111)),u=r(102),c=r(7372),f=r(8032);s.utils.sha512Sync=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return(0,u.sha512)((e=s.utils).concatBytes.apply(e,t))};var l="PRIVATE KEY",d=function(){function e(e){this.key=e}return e.generate=function(){return new e(s.utils.randomPrivateKey())},e.prototype.publicKeyBytes=function(){return s.sync.getPublicKey(this.key)},e.prototype.toBytes=function(){return this.key},e.prototype.sign=function(e){return s.sync.sign(e,this.key)},e.fromBytes=function(t){if(32!==t.length)throw new Error("Invalid key size: expected 64 bytes, got ".concat(t.length));return new e(t)},e.fromHex=function(t){if(64!==t.length)throw new Error("Invalid hex string length: expected 64 characters, got ".concat(t.length));var r=n.from(t,"hex");return e.fromBytes(r)},e.prototype.toPem=function(){var e=n.from([48,46,2,1,0,48,5,6,3,43,101,112,4,34,4,32]),t=c.Conversions.encodeBase64(n.concat([e,n.from(this.key)]));return"-----BEGIN ".concat(l,"-----\n")+"".concat(t,"\n")+"-----END ".concat(l,"-----\n")},e.fromPem=function(t){var r=(0,f.readBase64WithPEM)(t);return new e(new Uint8Array(n.from((0,f.parseKey)(r,0,32))))},e.PemFramePrivateKeyPrefixSize=16,e}();t.PrivateKey=d},2019:function(e,t,r){var n=r(8287).Buffer,o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&o(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.PublicKey=void 0;var s=a(r(5111)),u=r(7372),c=r(8032),f="PUBLIC KEY",l=function(){function e(e){this.key=e}return e.prototype.bytes=function(){return this.key},e.prototype.toPem=function(){var e=n.from([48,42,48,5,6,3,43,101,112,3,33,0]),t=u.Conversions.encodeBase64(n.concat([e,n.from(this.key)]));return"-----BEGIN ".concat(f,"-----\n")+"".concat(t,"\n")+"-----END ".concat(f,"-----\n")},e.fromPem=function(t){var r=(0,c.readBase64WithPEM)(t);return new e(new Uint8Array(n.from((0,c.parseKey)(r,32,64))))},e.prototype.verifySignature=function(e,t){return s.sync.verify(t,e,this.key)},e.fromBytes=function(t){if(32!==t.length)throw new Error("Can't parse wrong size of public key: ".concat(t.length));return new e(t)},e}();t.PublicKey=l},9449:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(2261),t),o(r(4359),t),o(r(2048),t)},7846:function(e,t,r){var n=r(8287).Buffer,o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&o(t,e,r);return i(t,e),t},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}u((n=n.apply(e,t||[])).next())})},u=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.PrivateKey=void 0;var c=a(r(9598)),f=r(2623),l=r(9615),d=r(7372),h=r(8032),p=r(3073);c.utils.hmacSha256Sync=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return(0,l.hmac)(f.sha256,e,(t=c.utils).concatBytes.apply(t,r))};var y=function(){function e(e){this.key=e}return e.generate=function(){return new e(c.utils.randomPrivateKey())},e.prototype.publicKeyBytes=function(){return c.getPublicKey(this.key,!0)},e.prototype.getPublicKeyBytes=function(){return s(this,void 0,void 0,function(){return u(this,function(e){return[2,c.getPublicKey(this.key,!0)]})})},e.prototype.toBytes=function(){return this.key},e.prototype.sign=function(e){var t=(0,f.sha256)(e);return c.signSync(t,this.key,{der:!1})},e.fromBytes=function(t){if(32!==t.length)throw new Error("Invalid private key length: expected 32 bytes, got ".concat(t.length));return new e(t)},e.fromHex=function(t){if(64!==t.length)throw new Error("Invalid private key hex length: expected 64 characters, got ".concat(t.length));var r;try{r=c.utils.hexToBytes(t)}catch(e){throw new Error("Failed to decode hex: ".concat(e))}return e.fromBytes(r)},e.prototype.toPem=function(){return(0,p.encodePrivate)(d.Conversions.encodeBase16(this.key),"raw","pem")},e.fromPem=function(t){var r=(0,h.readBase64WithPEM)(t),o=(0,p.encodePrivate)(n.from(r),"der","raw");return new e(new Uint8Array(n.from(o,"hex")))},e}();t.PrivateKey=y},4570:function(e,t,r){var n=r(8287).Buffer,o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&o(t,e,r);return i(t,e),t},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}u((n=n.apply(e,t||[])).next())})},u=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.PublicKey=void 0;var c=a(r(9598)),f=r(2623),l=r(7372),d=r(8032),h=r(3073),p=function(){function e(e){this.key=e}return e.prototype.bytes=function(){return this.key},e.prototype.toPem=function(){return(0,h.encodePublic)(l.Conversions.encodeBase16(this.key),"raw","pem")},e.prototype.verifySignature=function(e,t){var r;if(64===t.length)r=t;else try{r=c.Signature.fromDER(t).toCompactRawBytes()}catch(e){return console.error("Failed to parse DER signature:",e),!1}var n=(0,f.sha256)(e);return c.verify(r,n,this.key)},e.fromPem=function(t){var r=(0,d.readBase64WithPEM)(t),o=(0,h.encodePublic)(n.from(r),"der","raw");return new e(new Uint8Array(n.from(o,"hex")))},e.fromBytes=function(t){return s(this,void 0,void 0,function(){var r,n,o;return u(this,function(i){if(33!==t.length)throw new Error("Can't parse public key with wrong size: ".concat(t.length));try{n=c.Point.fromHex(t),o=n.toRawBytes(!0),r=o}catch(e){throw new Error("Invalid public key")}return[2,new e(r)]})})},e}();t.PublicKey=p},3073:function(e,t,r){var n=r(8287).Buffer,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.encodePublic=t.encodePrivate=void 0;var i=o(r(6729)),a=o(r(9404)),s=o(r(7568)),u={curveParameters:[1,3,132,0,10],privatePEMOptions:{label:"EC PRIVATE KEY"},publicPEMOptions:{label:"PUBLIC KEY"},curve:new i.default.ec("secp256k1")},c=[1,2,840,10045,2,1],f=s.default.define("ECPrivateKey",function(){var e=this;e.seq().obj(e.key("version").int(),e.key("privateKey").octstr(),e.key("parameters").explicit(0).objid().optional(),e.key("publicKey").explicit(1).bitstr().optional())}),l=s.default.define("SubjectPublicKeyInfo",function(){var e=this;e.seq().obj(e.key("algorithm").seq().obj(e.key("id").objid(),e.key("curve").objid()),e.key("pub").bitstr())});t.encodePrivate=function(e,t,r){var o;if("raw"===t){if("string"!=typeof e)throw"private key must be a string";o=function(e,t){var r={version:new a.default(1),privateKey:n.from(e,"hex"),parameters:u.curveParameters};return t&&(r.publicKey={unused:0,data:n.from(t,"hex")}),r}(e,u.curve.keyFromPrivate(e,"hex").getPublic("hex"))}else if("der"===t){if("string"!=typeof e);else{if("string"!=typeof e)throw"private key must be a buffer or a string";e=n.from(e,"hex")}o=f.decode(e,"der")}else{if("pem"!==t)throw"invalid private key format";if("string"!=typeof e)throw"private key must be a string";o=f.decode(e,"pem",u.privatePEMOptions)}if("raw"===r)return o.privateKey.toString("hex");if("der"===r)return f.encode(o,"der").toString("hex");if("pem"===r)return f.encode(o,"pem",u.privatePEMOptions);throw"invalid destination format for private key"},t.encodePublic=function(e,t,r){var o,i;if("raw"===t){if("string"!=typeof e)throw"public key must be a string";i=e,o={algorithm:{id:c,curve:u.curveParameters},pub:{unused:0,data:n.from(i,"hex")}}}else if("der"===t){if("string"!=typeof e);else{if("string"!=typeof e)throw"public key must be a buffer or a string";e=n.from(e,"hex")}o=l.decode(e,"der")}else{if("pem"!==t)throw"invalid public key format";if("string"!=typeof e)throw"public key must be a string";o=l.decode(e,"pem",u.publicPEMOptions)}if("raw"===r)return o.pub.data.toString("hex");if("der"===r)return l.encode(o,"der").toString("hex");if("pem"===r)return l.encode(o,"pem",u.publicPEMOptions);throw"invalid destination format for public key"}},8032:(e,t,r)=>{var n=r(8287).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.parseKey=t.readBase64WithPEM=void 0;var o=r(7372);t.readBase64WithPEM=function(e){var t=e.split(/\r?\n/).filter(function(e){return!e.startsWith("---")}).join("").trim();return o.Conversions.decodeBase64(t)},t.parseKey=function(e,t,r){var o=e.length,i=32===o?e:64===o?n.from(e).slice(t,r):o>32&&o<64?n.from(e).slice(o%32):null;if(null==i||32!==i.length)throw Error("Unexpected key length: ".concat(o));return i}},1246:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.makeAuctionManagerTransaction=t.makeAuctionManagerDeploy=void 0;var o=r(7545),i=r(7909),a=r(580);t.makeAuctionManagerDeploy=function(e){var t=e.delegatorPublicKeyHex,r=e.validatorPublicKeyHex,s=e.contractEntryPoint,u=e.amount,c=e.paymentAmount,f=void 0===c?"2500000000":c,l=e.chainName,d=void 0===l?i.CasperNetworkName.Mainnet:l,h=e.newValidatorPublicKeyHex,p=e.ttl,y=void 0===p?o.DEFAULT_DEPLOY_TTL:p,m=e.contractHash,b=e.timestamp,g=e.gasPrice,v=void 0===g?1:g,w=o.PublicKey.newPublicKey(t),S=o.PublicKey.newPublicKey(r),M=h?o.PublicKey.newPublicKey(h):null,_=null!=m?m:a.AuctionManagerContractHashMap[d];if(!_)throw new Error("Auction contract hash is undefined for chain: ".concat(d));var A=new o.ExecutableDeployItem;A.storedContractByHash=new o.StoredContractByHash(o.ContractHash.newContract(_),s,o.Args.fromMap(n({validator:o.CLValue.newCLPublicKey(S),delegator:o.CLValue.newCLPublicKey(w),amount:o.CLValue.newCLUInt512(u)},M?{new_validator:o.CLValue.newCLPublicKey(M)}:{})));var E=o.ExecutableDeployItem.standardPayment(f),O=o.DeployHeader.default();return O.account=w,O.chainName=d,O.ttl=new o.Duration(y),O.gasPrice=v,b&&(O.timestamp=o.Timestamp.fromJSON(b)),o.Deploy.makeDeploy(O,E,A)},t.makeAuctionManagerTransaction=function(e){var r=e.delegatorPublicKeyHex,n=e.validatorPublicKeyHex,a=e.contractEntryPoint,s=e.amount,u=e.paymentAmount,c=void 0===u?"2500000000":u,f=e.chainName,l=void 0===f?i.CasperNetworkName.Mainnet:f,d=e.newValidatorPublicKeyHex,h=e.ttl,p=void 0===h?o.DEFAULT_DEPLOY_TTL:h,y=e.contractHash,m=e.timestamp,b=e.casperNetworkApiVersion,g=e.gasPrice,v=void 0===g?1:g;if(!b.startsWith("2."))return o.Transaction.fromDeploy((0,t.makeAuctionManagerDeploy)({delegatorPublicKeyHex:r,validatorPublicKeyHex:n,contractEntryPoint:a,amount:s,paymentAmount:c,chainName:l,newValidatorPublicKeyHex:d,ttl:p,contractHash:y,timestamp:m}));switch(a){case i.AuctionManagerEntryPoint.delegate:var w=(new o.NativeDelegateBuilder).validator(o.PublicKey.fromHex(n)).from(o.PublicKey.fromHex(r)).amount(s).chainName(l).payment(Number(c),v).ttl(p);return m&&(w=w.timestamp(o.Timestamp.fromJSON(m))),w.build();case i.AuctionManagerEntryPoint.undelegate:return w=(new o.NativeUndelegateBuilder).validator(o.PublicKey.fromHex(n)).from(o.PublicKey.fromHex(r)).amount(s).chainName(l).payment(Number(c),v).ttl(p),m&&(w=w.timestamp(o.Timestamp.fromJSON(m))),w.build();case i.AuctionManagerEntryPoint.redelegate:if(!d)throw new Error("Missing newValidatorPublicKeyHex param");return w=(new o.NativeRedelegateBuilder).validator(o.PublicKey.fromHex(n)).newValidator(o.PublicKey.fromHex(d)).from(o.PublicKey.fromHex(r)).amount(s).chainName(l).payment(Number(c),v).ttl(p),m&&(w=w.timestamp(o.Timestamp.fromJSON(m))),w.build()}}},6510:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}u((n=n.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.CasperNetwork=void 0;var a=r(7545),s=r(7909),u=function(){function e(e,t){this.rpcClient=e,this.apiVersion=t}return e.create=function(t,r){return o(this,void 0,void 0,function(){var n;return i(this,function(o){switch(o.label){case 0:return r?[3,2]:[4,t.getStatus()];case 1:n=o.sent(),r=n.apiVersion.startsWith("2.")?2:1,o.label=2;case 2:return[2,new e(t,r)]}})})},e.prototype.createDelegateTransaction=function(e,t,r,n,o,i,s,u){if(2===this.apiVersion)return(new a.NativeDelegateBuilder).validator(t).from(e).amount(n).chainName(r).payment(o,u).ttl(i).build();if(s)return(new a.ContractCallBuilder).from(e).byHash(s).entryPoint("delegate").payment(o,u).chainName(r).runtimeArgs(a.Args.fromMap({validator:a.CLValue.newCLPublicKey(t),delegator:a.CLValue.newCLPublicKey(e),amount:a.CLValue.newCLUInt512(n)})).ttl(i).buildFor1_5();throw new Error("Auction contract hash is required when creating a transaction on Casper Network 1.5.x")},e.prototype.createUndelegateTransaction=function(e,t,r,n,o,i,s,u){if(2===this.apiVersion)return(new a.NativeUndelegateBuilder).validator(t).from(e).amount(n).chainName(r).payment(o,u).ttl(i).build();if(s)return(new a.ContractCallBuilder).from(e).byHash(s).entryPoint("undelegate").chainName(r).payment(o,u).ttl(i).runtimeArgs(a.Args.fromMap({validator:a.CLValue.newCLPublicKey(t),delegator:a.CLValue.newCLPublicKey(e),amount:a.CLValue.newCLUInt512(n)})).buildFor1_5();throw new Error("Auction contract hash is required when creating a transaction on Casper Network 1.5.x")},e.prototype.createRedelegateTransaction=function(e,t,r,o,i,s,u,c,f){if(2===this.apiVersion)return(new a.NativeRedelegateBuilder).validator(t).newValidator(r).from(e).amount(i).chainName(o).payment(s,f).ttl(u).build();if(c)return(new a.ContractCallBuilder).from(e).byHash(c).entryPoint("redelegate").chainName(o).payment(s,f).runtimeArgs(a.Args.fromMap(n({validator:a.CLValue.newCLPublicKey(t),delegator:a.CLValue.newCLPublicKey(e),amount:a.CLValue.newCLUInt512(i)},r?{new_validator:a.CLValue.newCLPublicKey(r)}:{}))).ttl(u).buildFor1_5();throw new Error("Auction contract hash is required when creating a transaction on Casper Network 1.5.x")},e.prototype.createTransferTransaction=function(e,t,r,n,o,i,s,u){var c=(new a.NativeTransferBuilder).from(e).target(t).amount(n).chainName(r).payment(o,u).ttl(i).id(s);return 2===this.apiVersion?c.build():c.buildFor1_5()},e.prototype.createContractCallTransaction=function(e,t,r,n,o,i,s,u){var c=(new a.ContractCallBuilder).byHash(t).from(e).entryPoint(r).chainName(n).runtimeArgs(s).ttl(i).payment(o,u);return 2===this.apiVersion?c.build():c.buildFor1_5()},e.prototype.createContractPackageCallTransaction=function(e,t,r,n,o,i,s,u,c){var f=(new a.ContractCallBuilder).byPackageHash(t,u).from(e).entryPoint(r).chainName(n).runtimeArgs(i).ttl(s).payment(o,c);return 2===this.apiVersion?f.build():f.buildFor1_5()},e.prototype.createSessionWasmTransaction=function(e,t,r,n,o,i,s){var u=(new a.SessionBuilder).from(e).chainName(t).payment(r,s).ttl(n).wasm(o).runtimeArgs(i);return 2===this.apiVersion?u.build():u.buildFor1_5()},e.prototype.putTransaction=function(e){return o(this,void 0,void 0,function(){var t;return i(this,function(r){switch(r.label){case 0:return 2!=this.apiVersion?[3,2]:[4,this.rpcClient.putTransaction(e)];case 1:case 3:return[2,r.sent()];case 2:return(t=e.getDeploy())?[4,this.rpcClient.putDeploy(t)]:[3,4];case 4:return[2,Promise.reject("Legacy deploy transaction is required when submitting to Casper Network 1.5")]}})})},e.prototype.getTransaction=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return"string"==typeof e&&(e=a.Hash.fromHex(e)),2!==this.apiVersion?[3,2]:[4,this.getTransactionOnCasper2x(e)];case 1:case 3:return[2,t.sent()];case 2:return[4,this.getTransactionOnCasper1x(e)]}})})},e.prototype.getTransactionOnCasper2x=function(e){return o(this,void 0,void 0,function(){var t;return i(this,function(r){switch(r.label){case 0:return e instanceof a.TransactionHash?e.transactionV1?[4,this.rpcClient.getTransactionByTransactionHash(e.transactionV1.toHex())]:[3,2]:[3,4];case 1:case 3:case 5:case 7:return[2,r.sent()];case 2:return e.deploy?[4,this.rpcClient.getTransactionByDeployHash(e.deploy.toHex())]:[3,4];case 4:return r.trys.push([4,6,,9]),[4,this.rpcClient.getTransactionByTransactionHash(e.toHex())];case 6:return(null==(t=r.sent())?void 0:t.statusCode)!==s.ErrorCode.NoSuchTransaction?[3,8]:[4,this.rpcClient.getTransactionByDeployHash(e.toHex())];case 8:throw t;case 9:return[2]}})})},e.prototype.getTransactionOnCasper1x=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this.rpcClient.getDeploy(e.toHex())];case 1:return[2,t.sent().toInfoGetTransactionResult()]}})})},e.prototype.queryLatestBalance=function(e){return o(this,void 0,void 0,function(){var t,r;return i(this,function(n){switch(n.label){case 0:return 2===this.apiVersion?[2,this.rpcClient.queryLatestBalance(e)]:(t=null==e?void 0:e.purseUref)?[4,this.rpcClient.getLatestBalance(t.toPrefixedString())]:[2];case 1:return[2,null==(r=n.sent())?void 0:r.toQueryBalanceResult()]}})})},e}();t.CasperNetwork=u},5447:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.makeCep18TransferTransaction=t.makeCep18TransferDeploy=void 0;var n=r(7545),o=r(7909);t.makeCep18TransferDeploy=function(e){var t=e.contractPackageHash,r=e.senderPublicKeyHex,i=e.recipientPublicKeyHex,a=e.transferAmount,s=e.paymentAmount,u=e.chainName,c=void 0===u?o.CasperNetworkName.Mainnet:u,f=e.ttl,l=void 0===f?n.DEFAULT_DEPLOY_TTL:f,d=e.timestamp,h=e.gasPrice,p=void 0===h?1:h,y=n.PublicKey.newPublicKey(r),m=n.PublicKey.newPublicKey(i),b=new n.ExecutableDeployItem;b.storedVersionedContractByHash=new n.StoredVersionedContractByHash(n.ContractHash.newContract(t),"transfer",n.Args.fromMap({recipient:n.CLValue.newCLKey(n.Key.createByType(m.accountHash().toPrefixedString(),n.KeyTypeID.Account)),amount:n.CLValue.newCLUInt256(a)}));var g=n.ExecutableDeployItem.standardPayment(s),v=n.DeployHeader.default();return v.account=y,v.chainName=c,v.ttl=new n.Duration(l),v.gasPrice=p,d&&(v.timestamp=n.Timestamp.fromJSON(d)),n.Deploy.makeDeploy(v,g,b)},t.makeCep18TransferTransaction=function(e){var r=e.contractPackageHash,i=e.senderPublicKeyHex,a=e.recipientPublicKeyHex,s=e.transferAmount,u=e.paymentAmount,c=e.chainName,f=void 0===c?o.CasperNetworkName.Mainnet:c,l=e.ttl,d=void 0===l?n.DEFAULT_DEPLOY_TTL:l,h=e.timestamp,p=e.casperNetworkApiVersion,y=e.gasPrice,m=void 0===y?1:y;if(p.startsWith("2.")){var b=(new n.ContractCallBuilder).byPackageHash(r).entryPoint("transfer").from(n.PublicKey.fromHex(i)).chainName(f).payment(Number(u),m).ttl(d).runtimeArgs(n.Args.fromMap({recipient:n.CLValue.newCLKey(n.Key.createByType(n.PublicKey.fromHex(a).accountHash().toPrefixedString(),n.KeyTypeID.Account)),amount:n.CLValue.newCLUInt256(s)}));return h&&(b=b.timestamp(n.Timestamp.fromJSON(h))),b.build()}return n.Transaction.fromDeploy((0,t.makeCep18TransferDeploy)({contractPackageHash:r,senderPublicKeyHex:i,recipientPublicKeyHex:a,transferAmount:s,paymentAmount:u,chainName:f,ttl:d,timestamp:h}))}},8826:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRuntimeArgsForCep95Transfer=t.getRuntimeArgsForCep47Transfer=t.getRuntimeArgsForCep78Transfer=t.getRuntimeArgsForNftTransfer=t.makeNftTransferTransaction=t.makeNftTransferDeploy=void 0;var n=r(7545),o=r(7909);function i(e){var t=e.tokenId,r=e.recipientPublicKeyHex;return n.Args.fromMap({recipient:n.CLValue.newCLKey(n.Key.createByType(n.PublicKey.fromHex(r).accountHash().toPrefixedString(),n.KeyTypeID.Account)),token_ids:n.CLValue.newCLList(n.CLTypeUInt256,[n.CLValue.newCLUInt256(t)])})}function a(e){var t=e.tokenId,r=e.recipientPublicKeyHex,o=e.senderPublicKeyHex;return n.Args.fromMap({from:n.CLValue.newCLKey(n.Key.createByType(n.PublicKey.fromHex(o).accountHash().toPrefixedString(),n.KeyTypeID.Account)),to:n.CLValue.newCLKey(n.Key.createByType(n.PublicKey.fromHex(r).accountHash().toPrefixedString(),n.KeyTypeID.Account)),token_id:n.CLValue.newCLUInt256(t),data:n.CLValue.newCLOption(null,n.CLTypeUInt8)})}t.makeNftTransferDeploy=function(e){var r=e.nftStandard,i=e.contractPackageHash,a=e.senderPublicKeyHex,s=e.recipientPublicKeyHex,u=e.paymentAmount,c=e.chainName,f=void 0===c?o.CasperNetworkName.Mainnet:c,l=e.ttl,d=void 0===l?n.DEFAULT_DEPLOY_TTL:l,h=e.tokenId,p=e.tokenHash,y=e.timestamp,m=e.gasPrice,b=void 0===m?1:m,g=n.PublicKey.newPublicKey(a),v=(0,t.getRuntimeArgsForNftTransfer)({nftStandard:r,recipientPublicKeyHex:s,senderPublicKeyHex:a,tokenHash:p,tokenId:h}),w=new n.ExecutableDeployItem;w.storedVersionedContractByHash=new n.StoredVersionedContractByHash(n.ContractHash.newContract(i),"transfer",v);var S=n.ExecutableDeployItem.standardPayment(u),M=n.DeployHeader.default();return M.account=g,M.chainName=f,M.ttl=new n.Duration(d),M.gasPrice=b,y&&(M.timestamp=n.Timestamp.fromJSON(y)),n.Deploy.makeDeploy(M,S,w)},t.makeNftTransferTransaction=function(e){var r=e.nftStandard,i=e.contractPackageHash,a=e.senderPublicKeyHex,s=e.recipientPublicKeyHex,u=e.paymentAmount,c=e.chainName,f=void 0===c?o.CasperNetworkName.Mainnet:c,l=e.ttl,d=void 0===l?n.DEFAULT_DEPLOY_TTL:l,h=e.tokenId,p=e.tokenHash,y=e.timestamp,m=e.casperNetworkApiVersion,b=e.gasPrice,g=void 0===b?1:b;if(m.startsWith("2.")){var v=(new n.ContractCallBuilder).byPackageHash(i).entryPoint(r===o.NFTTokenStandard.CEP95?"transfer_from":"transfer").from(n.PublicKey.fromHex(a)).chainName(f).ttl(d).payment(Number(u),g).runtimeArgs((0,t.getRuntimeArgsForNftTransfer)({nftStandard:r,recipientPublicKeyHex:s,senderPublicKeyHex:a,tokenHash:p,tokenId:h}));return y&&(v=v.timestamp(n.Timestamp.fromJSON(y))),v.build()}return n.Transaction.fromDeploy((0,t.makeNftTransferDeploy)({nftStandard:r,contractPackageHash:i,senderPublicKeyHex:a,recipientPublicKeyHex:s,paymentAmount:u,chainName:f,ttl:d,tokenId:h,tokenHash:p,timestamp:y}))},t.getRuntimeArgsForNftTransfer=function(e){var r=e.nftStandard,n=e.senderPublicKeyHex,s=e.recipientPublicKeyHex,u=e.tokenId,c=e.tokenHash;if(!u&&!c)throw new Error("Specify either tokenId or tokenHash to make a transfer");var f=null;if(r===o.NFTTokenStandard.CEP47){if(!u)throw new Error("TokenId is required for CEP-47 transfer");f=i({tokenId:u,recipientPublicKeyHex:s})}if(r===o.NFTTokenStandard.CEP78&&(f=(0,t.getRuntimeArgsForCep78Transfer)({tokenId:u,tokenHash:c,senderPublicKeyHex:n,recipientPublicKeyHex:s})),r===o.NFTTokenStandard.CEP95){if(!u)throw new Error("TokenId is required for CEP-95 transfer");f=a({tokenId:u,recipientPublicKeyHex:s,senderPublicKeyHex:n})}if(!f)throw new Error("Arguments error. Check provided token data");return f},t.getRuntimeArgsForCep78Transfer=function(e){var t=e.tokenHash,r=e.tokenId,o=e.recipientPublicKeyHex,i=e.senderPublicKeyHex,a=n.Args.fromMap({target_key:n.CLValue.newCLKey(n.Key.createByType(n.PublicKey.fromHex(o).accountHash().toPrefixedString(),n.KeyTypeID.Account)),source_key:n.CLValue.newCLKey(n.Key.createByType(n.PublicKey.fromHex(i).accountHash().toPrefixedString(),n.KeyTypeID.Account))});if(r)try{a.insert("is_hash_identifier_mode",n.CLValue.newCLValueBool(!1)),a.insert("token_id",n.CLValue.newCLUint64(r))}catch(e){throw new Error('Invalid "tokenId" value. It should be uint64. Consider to use "tokenHash" param')}return t&&(a.insert("is_hash_identifier_mode",n.CLValue.newCLValueBool(!0)),a.insert("token_hash",n.CLValue.newCLString(t))),a},t.getRuntimeArgsForCep47Transfer=i,t.getRuntimeArgsForCep95Transfer=a},9704:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sleep=t.arrayEquals=t.getEnumKeyByValue=void 0,t.getEnumKeyByValue=function(e,t){return Object.keys(e).find(function(r){return e[r]===t})},t.arrayEquals=function(e,t){return e.length===t.length&&e.every(function(e,r){return e===t[r]})},t.sleep=function(e){return new Promise(function(t){return setTimeout(t,e)})}},580:(e,t,r)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_MAXIMUM_DELEGATION_AMOUNT=t.DEFAULT_MINIMUM_DELEGATION_AMOUNT=t.AuctionManagerContractHashMap=void 0;var o=r(7909);t.AuctionManagerContractHashMap=((n={})[o.CasperNetworkName.Mainnet]="ccb576d6ce6dec84a551e48f0d0b7af89ddba44c7390b690036257a04a3ae9ea",n[o.CasperNetworkName.Testnet]="93d923e336b20a4c4ca14d592b60e5bd3fe330775618290104f9beb326db7ae2",n[o.CasperNetworkName.Integration]="e22d38bcf3454a93face78a353feaccbf1d637d1ef9ef2e061a655728ff59bbe",n[o.CasperNetworkName.DevNet]="93d923e336b20a4c4ca14d592b60e5bd3fe330775618290104f9beb326db7ae2",n),t.DEFAULT_MINIMUM_DELEGATION_AMOUNT=BigInt(500)*BigInt(1e9),t.DEFAULT_MAXIMUM_DELEGATION_AMOUNT=BigInt(1e9)*BigInt(1e9)},8717:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.makeCsprTransferTransaction=t.makeCsprTransferDeploy=void 0;var n=r(7545),o=r(7909);t.makeCsprTransferDeploy=function(e){var t=e.senderPublicKeyHex,r=e.recipientPublicKeyHex,i=e.transferAmount,a=e.chainName,s=void 0===a?o.CasperNetworkName.Mainnet:a,u=e.memo,c=e.ttl,f=void 0===c?n.DEFAULT_DEPLOY_TTL:c,l=e.timestamp,d=e.gasPrice,h=void 0===d?1:d,p=e.paymentAmount,y=void 0===p?"100000000":p,m=n.PublicKey.newPublicKey(r),b=n.PublicKey.newPublicKey(t),g=new n.ExecutableDeployItem;g.transfer=n.TransferDeployItem.newTransfer(i,m,void 0,u);var v=n.ExecutableDeployItem.standardPayment(y),w=n.DeployHeader.default();return w.account=b,w.chainName=s,w.ttl=new n.Duration(f),w.gasPrice=h,l&&(w.timestamp=n.Timestamp.fromJSON(l)),n.Deploy.makeDeploy(w,v,g)},t.makeCsprTransferTransaction=function(e){var r=e.senderPublicKeyHex,i=e.recipientPublicKeyHex,a=e.transferAmount,s=e.chainName,u=void 0===s?o.CasperNetworkName.Mainnet:s,c=e.memo,f=e.ttl,l=void 0===f?n.DEFAULT_DEPLOY_TTL:f,d=e.timestamp,h=e.casperNetworkApiVersion,p=e.gasPrice,y=void 0===p?1:p,m=e.paymentAmount,b=void 0===m?"100000000":m;if(h.startsWith("2")){var g=(new n.NativeTransferBuilder).from(n.PublicKey.fromHex(r)).target(n.PublicKey.fromHex(i)).amount(a).chainName(u).payment(Number(b),y).ttl(l);return d&&(g=g.timestamp(n.Timestamp.fromJSON(d))),c&&(g=g.id(Number(c))),g.build()}return n.Transaction.fromDeploy((0,t.makeCsprTransferDeploy)({senderPublicKeyHex:r,recipientPublicKeyHex:i,transferAmount:a,chainName:u,memo:c,ttl:l,timestamp:d}))}},8389:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(8717),t),o(r(6510),t),o(r(1246),t),o(r(580),t),o(r(5447),t),o(r(8826),t),o(r(9704),t)},3662:(e,t,r)=>{function n(e){var t=String(e);if("[object Object]"===t)try{t=JSON.stringify(e)}catch(e){}return t}r.r(t),r.d(t,{Err:()=>a,ErrImpl:()=>i,None:()=>c,Ok:()=>u,OkImpl:()=>s,Option:()=>f,Result:()=>o,Some:()=>l});var o,i=function(){function e(t){if(!(this instanceof e))return new e(t);this.ok=!1,this.err=!0,this.val=t}return e.prototype[Symbol.iterator]=function(){return{next:function(){return{done:!0,value:void 0}}}},e.prototype.else=function(e){return e},e.prototype.unwrapOr=function(e){return e},e.prototype.expect=function(e){throw new Error(e+" - Error: "+n(this.val))},e.prototype.unwrap=function(){throw new Error("Tried to unwrap Error: "+n(this.val))},e.prototype.map=function(e){return this},e.prototype.andThen=function(e){return this},e.prototype.mapErr=function(e){return new a(e(this.val))},e.prototype.toString=function(){return"Err("+n(this.val)+")"},e.EMPTY=new e(void 0),e}(),a=i,s=function(){function e(t){if(!(this instanceof e))return new e(t);this.ok=!0,this.err=!1,this.val=t}return e.prototype[Symbol.iterator]=function(){var e=Object(this.val);return Symbol.iterator in e?e[Symbol.iterator]():{next:function(){return{done:!0,value:void 0}}}},e.prototype.else=function(e){return this.val},e.prototype.unwrapOr=function(e){return this.val},e.prototype.expect=function(e){return this.val},e.prototype.unwrap=function(){return this.val},e.prototype.map=function(e){return new u(e(this.val))},e.prototype.andThen=function(e){return e(this.val)},e.prototype.mapErr=function(e){return this},e.prototype.safeUnwrap=function(){return this.val},e.prototype.toString=function(){return"Ok("+n(this.val)+")"},e.EMPTY=new e(void 0),e}(),u=s;!function(e){e.all=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=[],n=0,o=e;n<o.length;n++){var i=o[n];if(!i.ok)return i;r.push(i.val)}return new u(r)},e.any=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=[],n=0,o=e;n<o.length;n++){var i=o[n];if(i.ok)return i;r.push(i.val)}return new a(r)},e.wrap=function(e){try{return new u(e())}catch(e){return new a(e)}},e.wrapAsync=function(e){try{return e().then(function(e){return new u(e)}).catch(function(e){return new a(e)})}catch(e){return Promise.resolve(new a(e))}},e.isResult=function(e){return e instanceof a||e instanceof u}}(o||(o={}));var c=new(function(){function e(){this.some=!1,this.none=!0}return e.prototype[Symbol.iterator]=function(){return{next:function(){return{done:!0,value:void 0}}}},e.prototype.unwrapOr=function(e){return e},e.prototype.expect=function(e){throw new Error(""+e)},e.prototype.unwrap=function(){throw new Error("Tried to unwrap None")},e.prototype.map=function(e){return this},e.prototype.andThen=function(e){return this},e.prototype.toString=function(){return"None"},e}());Object.freeze(c);var f,l=function(){function e(t){if(!(this instanceof e))return new e(t);this.some=!0,this.none=!1,this.val=t}return e.prototype[Symbol.iterator]=function(){var e=Object(this.val);return Symbol.iterator in e?e[Symbol.iterator]():{next:function(){return{done:!0,value:void 0}}}},e.prototype.unwrapOr=function(e){return this.val},e.prototype.expect=function(e){return this.val},e.prototype.unwrap=function(){return this.val},e.prototype.map=function(e){return l(e(this.val))},e.prototype.andThen=function(e){return e(this.val)},e.prototype.safeUnwrap=function(){return this.val},e.prototype.toString=function(){return"Some("+n(this.val)+")"},e.EMPTY=new e(void 0),e}();!function(e){e.all=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=[],n=0,o=e;n<o.length;n++){var i=o[n];if(!i.some)return i;r.push(i.val)}return l(r)},e.any=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=0,n=e;r<n.length;r++){var o=n[r];return o.some,o}return c},e.isOption=function(e){return e instanceof l||e===c}}(f||(f={}))},1745:(e,t,r)=>{r.d(t,{c:()=>s,g:()=>u});var n=r(4661),o=r(9695),i=r(3766),a=r(6290);function s(e,t){if(null!=e.__type)return t.get(e.__type)}var u=function(){function e(){this.typeResolver=s,this.errorHandler=n.vV,this.deserializationStrategy=new Map([[a.v6.ctor,n.D_],[Number,d],[String,d],[Boolean,d],[Date,m],[ArrayBuffer,b],[DataView,g],[Array,h],[Set,p],[Map,y],[Float32Array,w],[Float64Array,w],[Uint8Array,S],[Uint8ClampedArray,S],[Uint16Array,S],[Uint32Array,S]])}return e.prototype.setDeserializationStrategy=function(e,t){this.deserializationStrategy.set(e,t)},e.prototype.setNameResolver=function(e){this.nameResolver=e},e.prototype.setTypeResolver=function(e){if("function"!=typeof e)throw new TypeError("'typeResolverCallback' is not a function.");this.typeResolver=e},e.prototype.getTypeResolver=function(){return this.typeResolver},e.prototype.setErrorHandler=function(e){if("function"!=typeof e)throw new TypeError("'errorHandlerCallback' is not a function.");this.errorHandler=e},e.prototype.getErrorHandler=function(){return this.errorHandler},e.prototype.convertSingleValue=function(e,t,r,s,u){if(void 0===s&&(s="object"),this.retrievePreserveNull(u)&&null===e)return null;if((0,n.J5)(e)){var c=this.deserializationStrategy.get(t.ctor);if(void 0!==c)return c(e,t,r,s,this,u);if("object"==typeof e)return function(e,t,r,s,u){if("object"==typeof e&&null!==e){var c=t.ctor,f=o.zv.getFromConstructor(c),l=r,d=u.getTypeResolver();void 0!==f&&(f.processDeferredKnownTypes(),l=u.mergeKnownTypes(l,u.createKnownTypesMap(f.knownTypes)),null!=f.typeResolver&&(d=f.typeResolver));var h=d(e,l);if(null!=h&&(0,n.yK)(h,c)&&(c=h,void 0!==(f=o.zv.getFromConstructor(h))&&(l=u.mergeKnownTypes(l,u.createKnownTypesMap(f.knownTypes)))),!0===(null==f?void 0:f.isExplicitlyMarked)){var p=f,y={},m=(0,i.lL)(u.options,p.options);p.dataMembers.forEach(function(t,r){var o,a=e[r],s=(0,n.bM)(p.classType)+"."+r,c=(0,i.lL)(m,t.options);if(null!=t.deserializer)o=t.deserializer(a);else{if(null==t.type)throw new TypeError("Cannot deserialize "+s+" there is no constructor nor deserialization function to use.");o=u.convertSingleValue(a,t.type(),l,s,c)}(0,n.J5)(o)||u.retrievePreserveNull(c)&&null===o?y[t.key]=o:!0===t.isRequired&&u.getErrorHandler()(new TypeError("Missing required member '"+s+"'."))});var b=void 0;if("function"==typeof f.initializerCallback)try{if(null==(b=f.initializerCallback(y,e)))throw new TypeError("Cannot deserialize "+s+": 'initializer' function returned undefined/null, but '"+(0,n.bM)(f.classType)+"' was expected.");if(!(b instanceof f.classType))throw new TypeError("Cannot deserialize "+s+":'initializer' returned '"+(0,n.bM)(b.constructor)+"', but '"+(0,n.bM)(f.classType)+"' was expected, and '"+(0,n.bM)(b.constructor)+"' is not a subtype of '"+(0,n.bM)(f.classType)+"'")}catch(e){return void u.getErrorHandler()(e)}else b=u.instantiateType(c);Object.assign(b,y);var g=f.onDeserializedMethodName;return null!=g&&("function"==typeof b[g]?b[g]():"function"==typeof b.constructor[g]?b.constructor[g]():u.getErrorHandler()(new TypeError("onDeserialized callback'"+(0,n.bM)(f.classType)+"."+g+"' is not a method."))),b}var v={};return Object.keys(e).forEach(function(t){v[t]=u.convertSingleValue(e[t],new a.bS(e[t].constructor),r,t)}),v}u.getErrorHandler()(new TypeError("Cannot deserialize "+s+": 'sourceObject' must be a defined object."))}(e,t,r,s,this);var f="Could not deserialize '"+s+"'; don't know how to deserialize type";t.hasFriendlyName()&&(f+=" '"+t.ctor.name+"'"),this.errorHandler(new TypeError(f+"."))}},e.prototype.instantiateType=function(e){return new e},e.prototype.mergeKnownTypes=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=new Map;return t.forEach(function(t){t.forEach(function(t,r){void 0===e.nameResolver?n.set(r,t):n.set(e.nameResolver(t),t)})}),n},e.prototype.createKnownTypesMap=function(e){var t=this,r=new Map;return e.forEach(function(e){if(void 0===t.nameResolver){var n=o.zv.getFromConstructor(e),i=!0===(null==n?void 0:n.isExplicitlyMarked)?n.name:null;r.set(null!=i?i:e.name,e)}else r.set(t.nameResolver(e),e)}),r},e.prototype.retrievePreserveNull=function(e){return(0,i.nE)("preserveNull",(0,i.lL)(this.options,e))},e}();function c(e,t,r,n){throw new TypeError("Could not deserialize "+n+" as "+e+": expected "+t+", got "+r+".")}function f(e,t,r){return"Could not deserialize "+r+": expected '"+("function"==typeof e?(0,n.bM)(e):e)+"', got '"+("function"==typeof t?(0,n.bM)(t):t)+"'."}function l(e){return null==e?"undefined":(0,n.bM)(e.constructor)}function d(e,t,r,o){if(e.constructor!==t.ctor)throw new TypeError(f((0,n.bM)(t.ctor),e.constructor,o));return e}function h(e,t,r,n,o,i){if(!(t instanceof a.ZD))throw new TypeError("Could not deserialize "+n+" as Array: incorrect TypeDescriptor detected, please use proper annotation or function for this type");return Array.isArray(e)?null==t.elementType?(o.getErrorHandler()(new TypeError("Could not deserialize "+n+" as Array: missing constructor reference of Array elements.")),[]):e.map(function(e,a){try{return o.convertSingleValue(e,t.elementType,r,n+"["+a+"]",i)}catch(e){return void o.getErrorHandler()(e)}}):(o.getErrorHandler()(new TypeError(f(Array,e.constructor,n))),[])}function p(e,t,r,n,o,i){if(!(t instanceof a.oy))throw new TypeError("Could not deserialize "+n+" as Set: incorrect TypeDescriptor detected, please use proper annotation or function for this type");if(!Array.isArray(e))return o.getErrorHandler()(new TypeError(f(Array,e.constructor,n))),new Set;if(null==t.elementType)return o.getErrorHandler()(new TypeError("Could not deserialize "+n+" as Set: missing constructor reference of Set elements.")),new Set;var s=new Set;return e.forEach(function(e,a){try{s.add(o.convertSingleValue(e,t.elementType,r,n+"["+a+"]",i))}catch(e){o.getErrorHandler()(e)}}),s}function y(e,t,r,o,i,s){if(!(t instanceof a.Ws))throw new TypeError("Could not deserialize "+o+" as Map: incorrect TypeDescriptor detected,please use proper annotation or function for this type");var u=t.getCompleteOptions().shape;if(!function(e,t){return 0===t&&Array.isArray(e)||1===t&&"object"==typeof e}(e,u)){var c=0===u?Array:Object;return i.getErrorHandler()(new TypeError(f(c,e.constructor,o))),new Map}if(null==t.keyType)return i.getErrorHandler()(new TypeError("Could not deserialize "+o+" as Map: missing key constructor.")),new Map;if(null==t.valueType)return i.getErrorHandler()(new TypeError("Could not deserialize "+o+" as Map: missing value constructor.")),new Map;var l=o+"[].key",d=o+"[].value",h=new Map;return 1===u?Object.keys(e).forEach(function(o){try{var a=i.convertSingleValue(o,t.keyType,r,l,s);(0,n.J5)(a)&&h.set(a,i.convertSingleValue(e[o],t.valueType,r,d,s))}catch(e){i.getErrorHandler()(e)}}):e.forEach(function(e){try{var o=i.convertSingleValue(e.key,t.keyType,r,l,s);(0,n.J5)(o)&&h.set(o,i.convertSingleValue(e.value,t.valueType,r,d,s))}catch(e){i.getErrorHandler()(e)}}),h}function m(e,t,r,n){if("number"==typeof e){if(e%1!=0)throw new TypeError("Could not deserialize "+n+" as Date: expected an integer, got a number with decimal places.");return new Date(e)}return"string"==typeof e?new Date(e):e instanceof Date?e:void c("Date","an ISO-8601 string",l(e),n)}function b(e,t,r,n){return"string"!=typeof e&&c("ArrayBuffer","a string source",l(e),n),v(e)}function g(e,t,r,n){return"string"!=typeof e&&c("DataView","a string source",l(e),n),new DataView(v(e))}function v(e){for(var t=new ArrayBuffer(2*e.length),r=new Uint16Array(t),n=0,o=e.length;n<o;n++)r[n]=e.charCodeAt(n);return t}function w(e,t,r,n){var o=t.ctor;return Array.isArray(e)&&e.every(function(e){return!isNaN(e)})?new o(e):c(o.name,"a numeric source array",l(e),n)}function S(e,t,r,n){var o=t.ctor;return Array.isArray(e)&&e.every(function(e){return!isNaN(e)})?new o(e.map(function(e){return~~e})):c(t.ctor.name,"a numeric source array",l(e),n)}},4661:(e,t,r)=>{r.d(t,{D_:()=>b,FF:()=>d,Ib:()=>u,J5:()=>h,V_:()=>c,b8:()=>s,bM:()=>m,ih:()=>a,tH:()=>p,uY:()=>i,vV:()=>l,yK:()=>f,zm:()=>y});var n=r(3635),o=r(6290),i="If the type is not yet defined, for example due to circular references, add '() => ' before it. E.g. @jsonMember(() => Foo)",a='Make sure that you have both "experimentalDecorators" and "emitDecoratorMetadata" enabled in your tsconfig.json';function s(e){return-1!==[Date,Number,String,Boolean].indexOf(e)}function u(e){return-1!==[Float32Array,Float64Array,Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array].indexOf(e)}function c(e,t){return"string"!=typeof e||function(e,t){var r=t===String||t===ArrayBuffer||t===DataView,n=e.length>=2&&'"'===e[0]&&'"'===e[e.length-1];if(t===Date){var o=!isNaN(Number(e.trim()));return!n&&!o}return r&&!n}(e,t)?e:JSON.parse(e)}function f(e,t){return e===t||e.prototype instanceof t}function l(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];"object"==typeof console&&"function"==typeof console.error?console.error.apply(console,(0,n.aN)([e],t)):"object"==typeof console&&"function"==typeof console.log&&console.log.apply(console,(0,n.aN)(["ERROR: "+e],t))}function d(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];"object"==typeof console&&"function"==typeof console.warn?console.warn.apply(console,(0,n.aN)([e],t)):"object"==typeof console&&"function"==typeof console.log&&console.log.apply(console,(0,n.aN)(["WARNING: "+e],t))}function h(e){return!(null==e)}function p(e,t){return t===o.v6.ctor||("number"==typeof e?t===Number:"string"==typeof e?t===String:"boolean"==typeof e?t===Boolean:!!function(e){return"object"==typeof e}(e)&&e instanceof t)}var y="object"==typeof Reflect&&"function"==typeof Reflect.getMetadata;function m(e){return"string"==typeof e.name?e.name:"undefined"}function b(e){return e}},9592:(e,t,r)=>{r.r(t),r.d(t,{AnyT:()=>h.v6,ArrayT:()=>h.Yq,ArrayTypeDescriptor:()=>h.ZD,JsonObjectMetadata:()=>a.zv,MapT:()=>h.P_,MapTypeDescriptor:()=>h.Ws,SetT:()=>h.jH,SetTypeDescriptor:()=>h.oy,TypedJSON:()=>n.n1,defaultTypeEmitter:()=>i.s,defaultTypeResolver:()=>o.c,jsonArrayMember:()=>c.e,jsonMapMember:()=>l.f,jsonMember:()=>u.Z,jsonObject:()=>s.o,jsonSetMember:()=>f.v,toJson:()=>d.a});var n=r(605),o=r(1745),i=r(4610),a=r(9695),s=r(3690),u=r(7171),c=r(3427),f=r(8008),l=r(58),d=r(3034),h=r(6290),p=r(1149),y={};for(const e in p)["default","TypedJSON","defaultTypeResolver","defaultTypeEmitter","JsonObjectMetadata","jsonObject","jsonMember","jsonArrayMember","jsonSetMember","jsonMapMember","toJson","ArrayT","AnyT","SetT","MapT","SetTypeDescriptor","ArrayTypeDescriptor","MapTypeDescriptor"].indexOf(e)<0&&(y[e]=()=>p[e]);r.d(t,y)},3427:(e,t,r)=>{r.d(t,{A:()=>u,e:()=>s});var n=r(4661),o=r(9695),i=r(3766),a=r(6290);function s(e,t){return void 0===t&&(t={}),function(r,s){var c,f="@jsonArrayMember on "+(0,n.bM)(r.constructor)+"."+String(s),l=(0,a.tI)(e,f),d=null==t.dimensions?1:t.dimensions;if(!isNaN(d)&&d<1)(0,n.vV)(f+": 'dimensions' option must be at least 1.");else{var h=n.zm?Reflect.getMetadata("design:type",r,s):null;null==h||h===Array||h===Object?(0,o.fT)(r,s,{type:function(){return u((0,a.A4)(l()),d)},emitDefaultValue:t.emitDefaultValue,isRequired:t.isRequired,options:(0,i.sS)(t),key:s.toString(),name:null!==(c=t.name)&&void 0!==c?c:s.toString(),deserializer:t.deserializer,serializer:t.serializer}):(0,n.vV)(f+": property is not an Array. "+n.ih)}}}function u(e,t){for(var r=new a.ZD(e),n=1;n<t;++n)r=new a.ZD(r);return r}},58:(e,t,r)=>{r.d(t,{f:()=>s});var n=r(4661),o=r(9695),i=r(3766),a=r(6290);function s(e,t,r){return void 0===r&&(r={}),function(s,u){var c,f="@jsonMapMember on "+(0,n.bM)(s.constructor)+"."+String(u),l=(0,a.tI)(e,f),d=(0,a.tI)(t,f),h=n.zm?Reflect.getMetadata("design:type",s,u):null;null==h||h===Map||h===Object?(0,o.fT)(s,u,{type:function(){return(0,a.P_)(l(),d(),{shape:r.shape})},emitDefaultValue:r.emitDefaultValue,isRequired:r.isRequired,options:(0,i.sS)(r),key:u.toString(),name:null!==(c=r.name)&&void 0!==c?c:u.toString(),deserializer:r.deserializer,serializer:r.serializer}):(0,n.vV)(f+": property is not a Map. "+n.ih)}}},7171:(e,t,r)=>{r.d(t,{Z:()=>s});var n=r(4661),o=r(9695),i=r(3766),a=r(6290);function s(e,t){var r,s;if("string"!=typeof t&&"symbol"!=typeof t)return r=e,s=t,function(e,t){var u,f,l="@jsonMember on "+(0,n.bM)(e.constructor)+"."+String(t);if((0,a.Im)(r)||(0,a.D4)(r)?f=(0,a.tI)(r,l):s=r,s=null!=s?s:{},Object.prototype.hasOwnProperty.call(s,"constructor")){if(void 0!==f)throw new Error("Cannot both define constructor option and type. Only one allowed.");if(!(0,n.J5)(s.constructor))return void(0,n.vV)(l+": cannot resolve specified property constructor at runtime. "+n.uY);var d=(0,a.A4)(s.constructor);f=function(){return d},n.zm&&!(0,n.yK)(d.ctor,Reflect.getMetadata("design:type",e,t))&&(0,n.FF)(l+": detected property type does not match 'constructor' option.")}else if(void 0!==f);else if(n.zm){var h=Reflect.getMetadata("design:type",e,t);if(null==h)return void(0,n.vV)(l+": cannot resolve detected property constructor at runtime. "+n.uY);f=function(){return(0,a.A4)(h)}}else if(void 0===s.deserializer)return void(0,n.vV)(l+": Cannot determine type");var p=null==f?void 0:f();void 0!==p&&c(l,p)||(0,o.fT)(e,t,{type:void 0===f?void 0:function(){return(0,a.A4)(f())},emitDefaultValue:s.emitDefaultValue,isRequired:s.isRequired,options:(0,i.sS)(s),key:t.toString(),name:null!==(u=s.name)&&void 0!==u?u:t.toString(),deserializer:s.deserializer,serializer:s.serializer})};var u=t,f=e,l="@jsonMember on "+(0,n.bM)(f.constructor)+"."+String(u);if(n.zm){var d=Reflect.getMetadata("design:type",f,u);if(null!=d){var h=(0,a.A4)(d);c(l,h)||(0,o.fT)(f,u,{type:function(){return h},key:t.toString(),name:t.toString()})}else(0,n.vV)(l+": could not resolve detected property constructor at runtime. Potential solutions:\n - "+n.uY+"\n - "+n.ih)}else(0,n.vV)(l+": ReflectDecorators is required if the type is not explicitly provided with e.g. @jsonMember(Number)")}function u(e,t){return e instanceof a.e2?e.ctor===t:e===t}function c(e,t){return t instanceof a.ZD||!u(t,Array)?t instanceof a.oy||!u(t,Set)?!(t instanceof a.Ws||!u(t,Map)||((0,n.vV)(e+": property is a Map. Use the jsonMapMember decorator to serialize this property."),0)):((0,n.vV)(e+": property is a Set. Use the jsonSetMember decorator to serialize this property."),!0):((0,n.vV)(e+": property is an Array. Use the jsonArrayMember decorator to serialize this property."),!0)}},3690:(e,t,r)=>{r.d(t,{o:()=>i});var n=r(9695),o=r(3766);function i(e){var t;function r(e){var r=n.zv.ensurePresentInPrototype(e.prototype);r.isExplicitlyMarked=!0,r.onDeserializedMethodName=t.onDeserialized,r.beforeSerializationMethodName=t.beforeSerialization,null!=t.typeResolver&&(r.typeResolver=t.typeResolver),null!=t.typeHintEmitter&&(r.typeHintEmitter=t.typeHintEmitter),r.initializerCallback=t.initializer,null!=t.name&&(r.name=t.name);var i=(0,o.sS)(t);void 0!==i&&(r.options=i),null!=t.knownTypes&&t.knownTypes.filter(function(e){return Boolean(e)}).forEach(function(e){return r.knownTypes.add(e)})}if(t="function"==typeof e?{}:null!=e?e:{},"function"!=typeof e)return r;r(e)}},8008:(e,t,r)=>{r.d(t,{v:()=>s});var n=r(4661),o=r(9695),i=r(3766),a=r(6290);function s(e,t){return void 0===t&&(t={}),function(r,s){var u,c="@jsonSetMember on "+(0,n.bM)(r.constructor)+"."+String(s),f=(0,a.tI)(e,c),l=n.zm?Reflect.getMetadata("design:type",r,s):null;null==l||l===Set||l===Object?(0,o.fT)(r,s,{type:function(){return(0,a.jH)(f())},emitDefaultValue:t.emitDefaultValue,isRequired:t.isRequired,options:(0,i.sS)(t),key:s.toString(),name:null!==(u=t.name)&&void 0!==u?u:s.toString(),deserializer:t.deserializer,serializer:t.serializer}):(0,n.vV)(c+": property is not a Set. "+n.ih)}}},9695:(e,t,r)=>{r.d(t,{fT:()=>a,zv:()=>i});var n=r(4661),o="__typedJsonJsonObjectMetadataInformation__",i=function(){function e(e){this.dataMembers=new Map,this.knownTypes=new Set,this.knownTypesDeferred=[],this.isExplicitlyMarked=!1,this.isHandledWithoutAnnotation=!1,this.classType=e}return e.getJsonObjectName=function(t){var r=e.getFromConstructor(t);return void 0===r?(0,n.bM)(t):(0,n.bM)(r.classType)},e.getFromConstructor=function(t){var r=t.prototype;if(null!=r){var n;if(Object.prototype.hasOwnProperty.call(r,o)&&(n=r[o]),!0===(null==n?void 0:n.isExplicitlyMarked))return n;if(e.doesHandleWithoutAnnotation(t)){var i=new e(t);return i.isExplicitlyMarked=!0,i}}},e.ensurePresentInPrototype=function(t){if(Object.prototype.hasOwnProperty.call(t,o))return t[o];var r=new e(t.constructor),n=t[o];return void 0!==n&&(n.dataMembers.forEach(function(e,t){r.dataMembers.set(t,e)}),n.knownTypes.forEach(function(e){r.knownTypes.add(e)}),r.typeResolver=n.typeResolver,r.typeHintEmitter=n.typeHintEmitter),Object.defineProperty(t,o,{enumerable:!1,configurable:!1,writable:!1,value:r}),r},e.getKnownTypeNameFromType=function(t){var r=e.getFromConstructor(t);return void 0===r?(0,n.bM)(t):(0,n.bM)(r.classType)},e.doesHandleWithoutAnnotation=function(e){return(0,n.b8)(e)||(0,n.Ib)(e)||e===DataView||e===ArrayBuffer},e.prototype.processDeferredKnownTypes=function(){var e=this;this.knownTypesDeferred.forEach(function(t){t().getTypes().forEach(function(t){return e.knownTypes.add(t)})}),this.knownTypesDeferred=[]},e}();function a(e,t,r){var o="@jsonMember on "+(0,n.bM)(e.constructor)+"."+String(t);if("function"!=typeof e)if("function"!=typeof e[t])if(null==r||void 0===r.type&&void 0===r.deserializer)(0,n.vV)(o+": JsonMemberMetadata has unknown type.");else{var a=i.ensurePresentInPrototype(e);void 0===r.deserializer&&a.knownTypesDeferred.push(r.type),Object.keys(r).forEach(function(e){return void 0===r[e]&&delete r[e]}),a.dataMembers.set(r.name,r)}else(0,n.vV)(o+": cannot use a method property.");else(0,n.vV)(o+": cannot use a static property.")}},3766:(e,t,r)=>{r.d(t,{lL:()=>s,nE:()=>a,sS:()=>i});var n=r(3635),o=["preserveNull"];function i(e){var t=Object.keys(e).filter(function(e){return o.indexOf(e)>-1}).reduce(function(t,r){return t[r]=e[r],t},{});return Object.keys(t).length>0?t:void 0}function a(e,t){return null!=t&&null!=t[e]?t[e]:function(e){return"preserveNull"!==e&&null}(e)}function s(e,t){return null==t?e:(0,n.Cl)((0,n.Cl)({},e),t)}},605:(e,t,r)=>{r.d(t,{n1:()=>l});var n=r(3635),o=r(1745),i=r(4661),a=r(3427),s=r(9695),u=r(3766),c=r(4610),f=r(6290),l=function(){function e(e,t){this.serializer=new c.h,this.deserializer=new o.g,this.globalKnownTypes=[],this.indent=0;var r=s.zv.getFromConstructor(e);if(void 0===r||!r.isExplicitlyMarked&&!r.isHandledWithoutAnnotation)throw new TypeError("The TypedJSON root data type must have the @jsonObject decorator used.");this.nameResolver=function(e){return(0,i.bM)(e)},this.rootConstructor=e,this.errorHandler=function(e){return(0,i.vV)(e)},this.config(t)}return e.parse=function(t,r,n){return new e(r,n).parse(t)},e.parseAsArray=function(t,r,n,o){return new e(r,n).parseAsArray(t,o)},e.parseAsSet=function(t,r,n){return new e(r,n).parseAsSet(t)},e.parseAsMap=function(t,r,n,o){return new e(n,o).parseAsMap(t,r)},e.toPlainJson=function(t,r,n){return new e(r,n).toPlainJson(t)},e.toPlainArray=function(t,r,n,o){return new e(r,o).toPlainArray(t,n)},e.toPlainSet=function(t,r,n){return new e(r,n).toPlainSet(t)},e.toPlainMap=function(t,r,n,o){return new e(n,o).toPlainMap(t,r)},e.stringify=function(t,r,n){return new e(r,n).stringify(t)},e.stringifyAsArray=function(t,r,n,o){return new e(r,o).stringifyAsArray(t,n)},e.stringifyAsSet=function(t,r,n){return new e(r,n).stringifyAsSet(t)},e.stringifyAsMap=function(t,r,n,o){return new e(n,o).stringifyAsMap(t,r)},e.setGlobalConfig=function(e){Object.assign(this._globalConfig,e)},e.mapType=function(e,t){null==this._globalConfig.mappedTypes&&(this._globalConfig.mappedTypes=new Map),this._globalConfig.mappedTypes.set(e,t)},e.prototype.config=function(t){var r=this;null!=(t=(0,n.Cl)((0,n.Cl)({},e._globalConfig),t)).knownTypes&&null!=e._globalConfig.knownTypes&&(t.knownTypes=Array.from(new Set(t.knownTypes.concat(e._globalConfig.knownTypes))));var o=(0,u.sS)(t);this.serializer.options=o,this.deserializer.options=o,null!=t.errorHandler&&(this.errorHandler=t.errorHandler,this.deserializer.setErrorHandler(t.errorHandler),this.serializer.setErrorHandler(t.errorHandler)),null!=t.replacer&&(this.replacer=t.replacer),null!=t.typeResolver&&this.deserializer.setTypeResolver(t.typeResolver),null!=t.typeHintEmitter&&this.serializer.setTypeHintEmitter(t.typeHintEmitter),null!=t.indent&&(this.indent=t.indent),null!=t.mappedTypes&&t.mappedTypes.forEach(function(e,t){r.setSerializationStrategies(t,e)}),null!=t.nameResolver&&(this.nameResolver=t.nameResolver,this.deserializer.setNameResolver(t.nameResolver)),null!=t.knownTypes&&(t.knownTypes.forEach(function(e,t){null==e&&(0,i.FF)("TypedJSON.config: 'knownTypes' contains an undefined/null value (element "+t+").")}),this.globalKnownTypes=t.knownTypes)},e.prototype.mapType=function(e,t){this.setSerializationStrategies(e,t)},e.prototype.parse=function(e){var t,r=this,n=(0,i.V_)(e,this.rootConstructor),o=s.zv.getFromConstructor(this.rootConstructor),a=new Map;this.globalKnownTypes.filter(function(e){return e}).forEach(function(e){a.set(r.nameResolver(e),e)}),void 0!==o&&(o.processDeferredKnownTypes(),o.knownTypes.forEach(function(e){a.set(r.nameResolver(e),e)}));try{t=this.deserializer.convertSingleValue(n,(0,f.A4)(this.rootConstructor),a)}catch(e){this.errorHandler(e)}return t},e.prototype.parseAsArray=function(e,t){void 0===t&&(t=1);var r=(0,i.V_)(e,Array);return this.deserializer.convertSingleValue(r,(0,a.A)((0,f.A4)(this.rootConstructor),t),this._mapKnownTypes(this.globalKnownTypes))},e.prototype.parseAsSet=function(e){var t=(0,i.V_)(e,Set);return this.deserializer.convertSingleValue(t,(0,f.jH)(this.rootConstructor),this._mapKnownTypes(this.globalKnownTypes))},e.prototype.parseAsMap=function(e,t){var r=(0,i.V_)(e,Map);return this.deserializer.convertSingleValue(r,(0,f.P_)(t,this.rootConstructor),this._mapKnownTypes(this.globalKnownTypes))},e.prototype.toPlainJson=function(e){try{return this.serializer.convertSingleValue(e,(0,f.A4)(this.rootConstructor))}catch(e){this.errorHandler(e)}},e.prototype.toPlainArray=function(e,t){void 0===t&&(t=1);try{return this.serializer.convertSingleValue(e,(0,a.A)((0,f.A4)(this.rootConstructor),t))}catch(e){this.errorHandler(e)}},e.prototype.toPlainSet=function(e){try{return this.serializer.convertSingleValue(e,(0,f.jH)(this.rootConstructor))}catch(e){this.errorHandler(e)}},e.prototype.toPlainMap=function(e,t){try{return this.serializer.convertSingleValue(e,(0,f.P_)(t,this.rootConstructor))}catch(e){this.errorHandler(e)}},e.prototype.stringify=function(e){var t=this.toPlainJson(e);return void 0===t?"":JSON.stringify(t,this.replacer,this.indent)},e.prototype.stringifyAsArray=function(e,t){return JSON.stringify(this.toPlainArray(e,t),this.replacer,this.indent)},e.prototype.stringifyAsSet=function(e){return JSON.stringify(this.toPlainSet(e),this.replacer,this.indent)},e.prototype.stringifyAsMap=function(e,t){return JSON.stringify(this.toPlainMap(e,t),this.replacer,this.indent)},e.prototype._mapKnownTypes=function(e){var t=this,r=new Map;return e.filter(function(e){return e}).forEach(function(e){return r.set(t.nameResolver(e),e)}),r},e.prototype.setSerializationStrategies=function(e,t){null!=t.deserializer&&this.deserializer.setDeserializationStrategy(e,function(e){return t.deserializer(e)}),null!=t.serializer&&this.serializer.setSerializationStrategy(e,function(e){return t.serializer(e)})},e._globalConfig={},e}()},4610:(e,t,r)=>{r.d(t,{h:()=>c,s:()=>u});var n=r(3635),o=r(4661),i=r(9695),a=r(3766),s=r(6290);function u(e,t,r,n){var i;t.constructor!==r&&(e.__type=null!==(i=null==n?void 0:n.name)&&void 0!==i?i:(0,o.bM)(t.constructor))}var c=function(){function e(){this.typeHintEmitter=u,this.errorHandler=o.vV,this.serializationStrategy=new Map([[s.v6.ctor,o.D_],[Date,o.D_],[Number,o.D_],[String,o.D_],[Boolean,o.D_],[ArrayBuffer,p],[DataView,y],[Array,f],[Set,l],[Map,d],[Float32Array,h],[Float64Array,h],[Int8Array,h],[Uint8Array,h],[Uint8ClampedArray,h],[Int16Array,h],[Uint16Array,h],[Int32Array,h],[Uint32Array,h]])}return e.prototype.setSerializationStrategy=function(e,t){this.serializationStrategy.set(e,t)},e.prototype.setTypeHintEmitter=function(e){if("function"!=typeof e)throw new TypeError("'typeEmitterCallback' is not a function.");this.typeHintEmitter=e},e.prototype.getTypeHintEmitter=function(){return this.typeHintEmitter},e.prototype.setErrorHandler=function(e){if("function"!=typeof e)throw new TypeError("'errorHandlerCallback' is not a function.");this.errorHandler=e},e.prototype.getErrorHandler=function(){return this.errorHandler},e.prototype.retrievePreserveNull=function(e){return(0,a.nE)("preserveNull",(0,a.lL)(this.options,e))},e.prototype.convertSingleValue=function(e,t,r,s){if(void 0===r&&(r="object"),this.retrievePreserveNull(s)&&null===e)return null;if((0,o.J5)(e))if((0,o.tH)(e,t.ctor)){var u=this.serializationStrategy.get(t.ctor);if(void 0!==u)return u(e,t,r,this,s);if("object"==typeof e)return function(e,t,r,s){var u,c,f=s.getTypeHintEmitter();if(void 0===(u=e.constructor!==t.ctor&&e instanceof t.ctor?i.zv.getFromConstructor(e.constructor):i.zv.getFromConstructor(t.ctor)))c=(0,n.Cl)({},e);else{var l=u.beforeSerializationMethodName;null!=l&&("function"==typeof e[l]?e[l]():"function"==typeof e.constructor[l]?e.constructor[l]():s.getErrorHandler()(new TypeError("beforeSerialization callback '"+(0,o.bM)(u.classType)+"."+l+"' is not a method.")));var d=u;c={};var h=(0,a.lL)(s.options,d.options);null!=d.typeHintEmitter&&(f=d.typeHintEmitter),d.dataMembers.forEach(function(t){var r,n=(0,a.lL)(h,t.options);if(null!=t.serializer)r=t.serializer(e[t.key]);else{if(null==t.type)throw new TypeError("Could not serialize "+t.name+", there is no constructor nor serialization function to use.");r=s.convertSingleValue(e[t.key],t.type(),(0,o.bM)(d.classType)+"."+t.key,n)}(s.retrievePreserveNull(n)&&null===r||(0,o.J5)(r))&&(c[t.name]=r)})}return f(c,e,t.ctor,u),c}(e,t,0,this);var c="Could not serialize '"+r+"'; don't know how to serialize type";t.hasFriendlyName()&&(c+=" '"+t.ctor.name+"'"),this.errorHandler(new TypeError(c+"."))}else{var f=(0,o.bM)(t.ctor),l=(0,o.bM)(e.constructor);this.errorHandler(new TypeError("Could not serialize '"+r+"': expected '"+f+"', got '"+l+"'."))}},e}();function f(e,t,r,n,i){if(!(t instanceof s.ZD))throw new TypeError("Could not serialize "+r+" as Array: incorrect TypeDescriptor detected, please use proper annotation or function for this type");if(null==t.elementType)throw new TypeError("Could not serialize "+r+" as Array: missing element type definition.");return e.forEach(function(e,a){if(!(n.retrievePreserveNull(i)&&null===e||(0,o.tH)(e,t.elementType.ctor))){var s=(0,o.bM)(t.elementType.ctor),u=e&&(0,o.bM)(e.constructor);throw new TypeError("Could not serialize "+r+"["+a+"]: expected '"+s+"', got '"+u+"'.")}}),e.map(function(e,o){return n.convertSingleValue(e,t.elementType,r+"["+o+"]",i)})}function l(e,t,r,n,i){if(!(t instanceof s.oy))throw new TypeError("Could not serialize "+r+" as Set: incorrect TypeDescriptor detected, please use proper annotation or function for this type");if(null==t.elementType)throw new TypeError("Could not serialize "+r+" as Set: missing element type definition.");r+="[]";var a=[];return e.forEach(function(e){var s=n.convertSingleValue(e,t.elementType,r,i);(0,o.J5)(e)&&!(0,o.J5)(s)||a.push(s)}),a}function d(e,t,r,n,i){if(!(t instanceof s.Ws))throw new TypeError("Could not serialize "+r+" as Map: incorrect TypeDescriptor detected, please use proper annotation or function for this type");if(null==t.valueType)throw new TypeError("Could not serialize "+r+" as Map: missing value type definition.");if(null==t.keyType)throw new TypeError("Could not serialize "+r+" as Map: missing key type definition.");var a=r+"[].key",u=r+"[].value",c=t.getCompleteOptions().shape,f=1===c?{}:[],l=n.retrievePreserveNull(i);return e.forEach(function(e,r){var s={key:n.convertSingleValue(r,t.keyType,a,i),value:n.convertSingleValue(e,t.valueType,u,i)},d=(0,o.J5)(s.key),h=null===s.value&&l||(0,o.J5)(s.value);d&&h&&(1===c?f[s.key]=s.value:f.push(s))}),f}function h(e){return Array.from(e)}function p(e){return Array.from(new Uint16Array(e)).map(function(e){return String.fromCharCode(e)}).join("")}function y(e){return p(e.buffer)}},3034:(e,t,r)=>{r.d(t,{a:()=>o});var n=r(605);function o(e){if("function"!=typeof e)return function(t){i(t,e)};i(e,{})}function i(e,t){if(!0!==t.overwrite&&void 0!==e.prototype.toJSON)throw new Error(e.name+" already has toJSON defined!");e.prototype.toJSON=function(){return n.n1.toPlainJson(this,Object.getPrototypeOf(this).constructor)}}},6290:(e,t,r)=>{r.d(t,{A4:()=>b,D4:()=>m,Im:()=>y,P_:()=>h,Ws:()=>d,Yq:()=>c,ZD:()=>u,bS:()=>a,e2:()=>i,jH:()=>l,oy:()=>f,tI:()=>g,v6:()=>p});var n=r(3635),o=r(4661),i=function(){function e(e){this.ctor=e}return e.prototype.getTypes=function(){return[this.ctor]},e.prototype.hasFriendlyName=function(){return"Object"!==this.ctor.name},e}(),a=function(e){function t(t){return e.call(this,t)||this}return(0,n.C6)(t,e),t}(i),s=function(e){function t(t){return e.call(this,t)||this}return(0,n.C6)(t,e),t}(i),u=function(e){function t(t){var r=e.call(this,Array)||this;return r.elementType=t,r}return(0,n.C6)(t,e),t.prototype.getTypes=function(){return e.prototype.getTypes.call(this).concat(this.elementType.getTypes())},t}(s);function c(e){return new u(b(e))}var f=function(e){function t(t){var r=e.call(this,Set)||this;return r.elementType=t,r}return(0,n.C6)(t,e),t.prototype.getTypes=function(){return e.prototype.getTypes.call(this).concat(this.elementType.getTypes())},t}(s);function l(e){return new f(b(e))}var d=function(e){function t(t,r,n){var o=e.call(this,Map)||this;return o.keyType=t,o.valueType=r,o.options=n,o}return(0,n.C6)(t,e),t.prototype.getTypes=function(){return e.prototype.getTypes.call(this).concat(this.keyType.getTypes(),this.valueType.getTypes())},t.prototype.getCompleteOptions=function(){var e,t;return{shape:null!==(t=null===(e=this.options)||void 0===e?void 0:e.shape)&&void 0!==t?t:0}},t}(s);function h(e,t,r){return new d(b(e),b(t),r)}var p=new a(function(){});function y(e){return null!=e&&("function"==typeof e||e instanceof i)}function m(e){return"function"==typeof e&&""===e.name}function b(e){return e instanceof i?e:new a(e)}function g(e,t){if(null==e)throw new Error("No type given on "+t+". "+o.uY);return m(e)?e:function(){return e}}},1149:()=>{},3635:(e,t,r)=>{r.d(t,{C6:()=>o,Cl:()=>i,aN:()=>a});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var i=function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};function a(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n}},1270:function(e,t,r){var n;e=r.nmd(e),function(){t&&t.nodeType,e&&e.nodeType;var o="object"==typeof r.g&&r.g;o.global!==o&&o.window!==o&&o.self;var i,a=2147483647,s=36,u=/^xn--/,c=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,l={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,h=String.fromCharCode;function p(e){throw RangeError(l[e])}function y(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function m(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+y((e=e.replace(f,".")).split("."),t).join(".")}function b(e){for(var t,r,n=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(r=e.charCodeAt(o++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--):n.push(t);return n}function g(e){return y(e,function(e){var t="";return e>65535&&(t+=h((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+h(e)}).join("")}function v(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function w(e,t,r){var n=0;for(e=r?d(e/700):e>>1,e+=d(e/t);e>455;n+=s)e=d(e/35);return d(n+36*e/(e+38))}function S(e){var t,r,n,o,i,u,c,f,l,h,y,m=[],b=e.length,v=0,S=128,M=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&p("not-basic"),m.push(e.charCodeAt(n));for(o=r>0?r+1:0;o<b;){for(i=v,u=1,c=s;o>=b&&p("invalid-input"),((f=(y=e.charCodeAt(o++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:s)>=s||f>d((a-v)/u))&&p("overflow"),v+=f*u,!(f<(l=c<=M?1:c>=M+26?26:c-M));c+=s)u>d(a/(h=s-l))&&p("overflow"),u*=h;M=w(v-i,t=m.length+1,0==i),d(v/t)>a-S&&p("overflow"),S+=d(v/t),v%=t,m.splice(v++,0,S)}return g(m)}function M(e){var t,r,n,o,i,u,c,f,l,y,m,g,S,M,_,A=[];for(g=(e=b(e)).length,t=128,r=0,i=72,u=0;u<g;++u)(m=e[u])<128&&A.push(h(m));for(n=o=A.length,o&&A.push("-");n<g;){for(c=a,u=0;u<g;++u)(m=e[u])>=t&&m<c&&(c=m);for(c-t>d((a-r)/(S=n+1))&&p("overflow"),r+=(c-t)*S,t=c,u=0;u<g;++u)if((m=e[u])<t&&++r>a&&p("overflow"),m==t){for(f=r,l=s;!(f<(y=l<=i?1:l>=i+26?26:l-i));l+=s)_=f-y,M=s-y,A.push(h(v(y+_%M,0))),f=d(_/M);A.push(h(v(f,0))),i=w(r,S,n==o),r=0,++n}++r,++t}return A.join("")}i={version:"1.3.2",ucs2:{decode:b,encode:g},decode:S,encode:M,toASCII:function(e){return m(e,function(e){return c.test(e)?"xn--"+M(e):e})},toUnicode:function(e){return m(e,function(e){return u.test(e)?S(e.slice(4).toLowerCase()):e})}},void 0===(n=function(){return i}.call(t,r,t,e))||(e.exports=n)}()},8835:(e,t,r)=>{var n=r(1270),o=r(2268);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=v,t.resolve=function(e,t){return v(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?v(e,!1,!0).resolveObject(t):t},t.format=function(e){return o.isString(e)&&(e=v(e)),e instanceof i?e.format():i.prototype.format.call(e)},t.Url=i;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),f=["'"].concat(c),l=["%","/","?",";","#"].concat(f),d=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=r(7186);function v(e,t,r){if(e&&o.isObject(e)&&e instanceof i)return e;var n=new i;return n.parse(e,t,r),n}i.prototype.parse=function(e,t,r){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),s=-1!==i&&i<e.indexOf("#")?"?":"#",c=e.split(s);c[0]=c[0].replace(/\\/g,"/");var v=e=c.join(s);if(v=v.trim(),!r&&1===e.split("#").length){var w=u.exec(v);if(w)return this.path=v,this.href=v,this.pathname=w[1],w[2]?(this.search=w[2],this.query=t?g.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var S=a.exec(v);if(S){var M=(S=S[0]).toLowerCase();this.protocol=M,v=v.substr(S.length)}if(r||S||v.match(/^\/\/[^@\/]+@[^@\/]+/)){var _="//"===v.substr(0,2);!_||S&&m[S]||(v=v.substr(2),this.slashes=!0)}if(!m[S]&&(_||S&&!b[S])){for(var A,E,O=-1,j=0;j<d.length;j++)-1!==(T=v.indexOf(d[j]))&&(-1===O||T<O)&&(O=T);for(-1!==(E=-1===O?v.lastIndexOf("@"):v.lastIndexOf("@",O))&&(A=v.slice(0,E),v=v.slice(E+1),this.auth=decodeURIComponent(A)),O=-1,j=0;j<l.length;j++){var T;-1!==(T=v.indexOf(l[j]))&&(-1===O||T<O)&&(O=T)}-1===O&&(O=v.length),this.host=v.slice(0,O),v=v.slice(O),this.parseHost(),this.hostname=this.hostname||"";var N="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!N)for(var P=this.hostname.split(/\./),B=(j=0,P.length);j<B;j++){var R=P[j];if(R&&!R.match(h)){for(var C="",x=0,I=R.length;x<I;x++)R.charCodeAt(x)>127?C+="x":C+=R[x];if(!C.match(h)){var k=P.slice(0,j),H=P.slice(j+1),U=R.match(p);U&&(k.push(U[1]),H.unshift(U[2])),H.length&&(v="/"+H.join(".")+v),this.hostname=k.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),N||(this.hostname=n.toASCII(this.hostname));var L=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+L,this.href+=this.host,N&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!y[M])for(j=0,B=f.length;j<B;j++){var V=f[j];if(-1!==v.indexOf(V)){var z=encodeURIComponent(V);z===V&&(z=escape(V)),v=v.split(V).join(z)}}var J=v.indexOf("#");-1!==J&&(this.hash=v.substr(J),v=v.slice(0,J));var K=v.indexOf("?");if(-1!==K?(this.search=v.substr(K),this.query=v.substr(K+1),t&&(this.query=g.parse(this.query)),v=v.slice(0,K)):t&&(this.search="",this.query={}),v&&(this.pathname=v),b[M]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){L=this.pathname||"";var F=this.search||"";this.path=L+F}return this.href=this.format(),this},i.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,a="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&o.isObject(this.query)&&Object.keys(this.query).length&&(a=g.stringify(this.query));var s=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||b[t])&&!1!==i?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+i+(r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+n},i.prototype.resolve=function(e){return this.resolveObject(v(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if(o.isString(e)){var t=new i;t.parse(e,!1,!0),e=t}for(var r=new i,n=Object.keys(this),a=0;a<n.length;a++){var s=n[a];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var u=Object.keys(e),c=0;c<u.length;c++){var f=u[c];"protocol"!==f&&(r[f]=e[f])}return b[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!b[e.protocol]){for(var l=Object.keys(e),d=0;d<l.length;d++){var h=l[d];r[h]=e[h]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||m[e.protocol])r.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var y=r.pathname||"",g=r.search||"";r.path=y+g}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var v=r.pathname&&"/"===r.pathname.charAt(0),w=e.host||e.pathname&&"/"===e.pathname.charAt(0),S=w||v||r.host&&e.pathname,M=S,_=r.pathname&&r.pathname.split("/")||[],A=(p=e.pathname&&e.pathname.split("/")||[],r.protocol&&!b[r.protocol]);if(A&&(r.hostname="",r.port=null,r.host&&(""===_[0]?_[0]=r.host:_.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),S=S&&(""===p[0]||""===_[0])),w)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,_=p;else if(p.length)_||(_=[]),_.pop(),_=_.concat(p),r.search=e.search,r.query=e.query;else if(!o.isNullOrUndefined(e.search))return A&&(r.hostname=r.host=_.shift(),(N=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=N.shift(),r.host=r.hostname=N.shift())),r.search=e.search,r.query=e.query,o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!_.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var E=_.slice(-1)[0],O=(r.host||e.host||_.length>1)&&("."===E||".."===E)||""===E,j=0,T=_.length;T>=0;T--)"."===(E=_[T])?_.splice(T,1):".."===E?(_.splice(T,1),j++):j&&(_.splice(T,1),j--);if(!S&&!M)for(;j--;j)_.unshift("..");!S||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),O&&"/"!==_.join("/").substr(-1)&&_.push("");var N,P=""===_[0]||_[0]&&"/"===_[0].charAt(0);return A&&(r.hostname=r.host=P?"":_.length?_.shift():"",(N=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=N.shift(),r.host=r.hostname=N.shift())),(S=S||r.host&&_.length)&&!P&&_.unshift(""),_.length?r.pathname=_.join("/"):(r.pathname=null,r.path=null),o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},2268:e=>{e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},4643:(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).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)}}},1135:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},9032:(e,t,r)=>{var n=r(7244),o=r(8184),i=r(5767),a=r(5680);function s(e){return e.call.bind(e)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,f=s(Object.prototype.toString),l=s(Number.prototype.valueOf),d=s(String.prototype.valueOf),h=s(Boolean.prototype.valueOf);if(u)var p=s(BigInt.prototype.valueOf);if(c)var y=s(Symbol.prototype.valueOf);function m(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function b(e){return"[object Map]"===f(e)}function g(e){return"[object Set]"===f(e)}function v(e){return"[object WeakMap]"===f(e)}function w(e){return"[object WeakSet]"===f(e)}function S(e){return"[object ArrayBuffer]"===f(e)}function M(e){return"undefined"!=typeof ArrayBuffer&&(S.working?S(e):e instanceof ArrayBuffer)}function _(e){return"[object DataView]"===f(e)}function A(e){return"undefined"!=typeof DataView&&(_.working?_(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=o,t.isTypedArray=a,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):a(e)||A(e)},t.isUint8Array=function(e){return"Uint8Array"===i(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===i(e)},t.isUint16Array=function(e){return"Uint16Array"===i(e)},t.isUint32Array=function(e){return"Uint32Array"===i(e)},t.isInt8Array=function(e){return"Int8Array"===i(e)},t.isInt16Array=function(e){return"Int16Array"===i(e)},t.isInt32Array=function(e){return"Int32Array"===i(e)},t.isFloat32Array=function(e){return"Float32Array"===i(e)},t.isFloat64Array=function(e){return"Float64Array"===i(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===i(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===i(e)},b.working="undefined"!=typeof Map&&b(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(b.working?b(e):e instanceof Map)},g.working="undefined"!=typeof Set&&g(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(g.working?g(e):e instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(v.working?v(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},S.working="undefined"!=typeof ArrayBuffer&&S(new ArrayBuffer),t.isArrayBuffer=M,_.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&_(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=A;var E="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function O(e){return"[object SharedArrayBuffer]"===f(e)}function j(e){return void 0!==E&&(void 0===O.working&&(O.working=O(new E)),O.working?O(e):e instanceof E)}function T(e){return m(e,l)}function N(e){return m(e,d)}function P(e){return m(e,h)}function B(e){return u&&m(e,p)}function R(e){return c&&m(e,y)}t.isSharedArrayBuffer=j,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===f(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===f(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===f(e)},t.isGeneratorObject=function(e){return"[object Generator]"===f(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===f(e)},t.isNumberObject=T,t.isStringObject=N,t.isBooleanObject=P,t.isBigIntObject=B,t.isSymbolObject=R,t.isBoxedPrimitive=function(e){return T(e)||N(e)||P(e)||B(e)||R(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(M(e)||j(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})})},537:(e,t,r)=>{var n=r(5606),o=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},i=/%[sdj%]/g;t.format=function(e){if(!v(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(c(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,o=n.length,a=String(e).replace(i,function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),s=n[r];r<o;s=n[++r])b(s)||!M(s)?a+=" "+s:a+=" "+c(s);return a},t.deprecate=function(e,r){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return t.deprecate(e,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?console.trace(r):console.error(r),o=!0}return e.apply(this,arguments)}};var a={},s=/^$/;if(n.env.NODE_DEBUG){var u=n.env.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),s=new RegExp("^"+u+"$","i")}function c(e,r){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(r)?n.showHidden=r:r&&t._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),d(n,e,n.depth)}function f(e,t){var r=c.styles[t];return r?"["+c.colors[r][0]+"m"+e+"["+c.colors[r][1]+"m":e}function l(e,t){return e}function d(e,r,n){if(e.customInspect&&r&&E(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,e);return v(o)||(o=d(e,o,n)),o}var i=function(e,t){if(w(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return g(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):b(t)?e.stylize("null","null"):void 0}(e,r);if(i)return i;var a=Object.keys(r),s=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),A(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return h(r);if(0===a.length){if(E(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(S(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return e.stylize(Date.prototype.toString.call(r),"date");if(A(r))return h(r)}var c,f="",l=!1,M=["{","}"];return y(r)&&(l=!0,M=["[","]"]),E(r)&&(f=" [Function"+(r.name?": "+r.name:"")+"]"),S(r)&&(f=" "+RegExp.prototype.toString.call(r)),_(r)&&(f=" "+Date.prototype.toUTCString.call(r)),A(r)&&(f=" "+h(r)),0!==a.length||l&&0!=r.length?n<0?S(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=l?function(e,t,r,n,o){for(var i=[],a=0,s=t.length;a<s;++a)N(t,String(a))?i.push(p(e,t,r,n,String(a),!0)):i.push("");return o.forEach(function(o){o.match(/^\d+$/)||i.push(p(e,t,r,n,o,!0))}),i}(e,r,n,s,a):a.map(function(t){return p(e,r,n,s,t,l)}),e.seen.pop(),function(e,t,r){return e.reduce(function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,f,M)):M[0]+f+M[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,o,i){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),N(n,o)||(a="["+o+"]"),s||(e.seen.indexOf(u.value)<0?(s=b(r)?d(e,u.value,null):d(e,u.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map(function(e){return" "+e}).join("\n").slice(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),w(a)){if(i&&o.match(/^\d+$/))return s;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function y(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function b(e){return null===e}function g(e){return"number"==typeof e}function v(e){return"string"==typeof e}function w(e){return void 0===e}function S(e){return M(e)&&"[object RegExp]"===O(e)}function M(e){return"object"==typeof e&&null!==e}function _(e){return M(e)&&"[object Date]"===O(e)}function A(e){return M(e)&&("[object Error]"===O(e)||e instanceof Error)}function E(e){return"function"==typeof e}function O(e){return Object.prototype.toString.call(e)}function j(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!a[e])if(s.test(e)){var r=n.pid;a[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else a[e]=function(){};return a[e]},t.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(9032),t.isArray=y,t.isBoolean=m,t.isNull=b,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=v,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=w,t.isRegExp=S,t.types.isRegExp=S,t.isObject=M,t.isDate=_,t.types.isDate=_,t.isError=A,t.types.isNativeError=A,t.isFunction=E,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(1135);var T=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function N(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(r=[j((e=new Date).getHours()),j(e.getMinutes()),j(e.getSeconds())].join(":"),[e.getDate(),T[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(6698),t._extend=function(e,t){if(!t||!M(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var P="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function B(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(P&&e[P]){var t;if("function"!=typeof(t=e[P]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise(function(e,n){t=e,r=n}),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push(function(e,n){e?r(e):t(n)});try{e.apply(this,o)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),P&&Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,o(e))},t.promisify.custom=P,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var o=t.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return o.apply(i,arguments)};e.apply(this,t).then(function(e){n.nextTick(a.bind(null,null,e))},function(e){n.nextTick(B.bind(null,e,a))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,o(e)),t}},5767:(e,t,r)=>{var n=r(2682),o=r(9209),i=r(487),a=r(6556),s=r(5795),u=r(3628),c=a("Object.prototype.toString"),f=r(9092)(),l="undefined"==typeof globalThis?r.g:globalThis,d=o(),h=a("String.prototype.slice"),p=a("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},y={__proto__:null};n(d,f&&s&&u?function(e){var t=new l[e];if(Symbol.toStringTag in t&&u){var r=u(t),n=s(r,Symbol.toStringTag);if(!n&&r){var o=u(r);n=s(o,Symbol.toStringTag)}y["$"+e]=i(n.get)}}:function(e){var t=new l[e],r=t.slice||t.set;r&&(y["$"+e]=i(r))}),e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!f){var t=h(c(e),8,-1);return p(d,t)>-1?t:"Object"===t&&function(e){var t=!1;return n(y,function(r,n){if(!t)try{r(e),t=h(n,1)}catch(e){}}),t}(e)}return s?function(e){var t=!1;return n(y,function(r,n){if(!t)try{"$"+r(e)===n&&(t=h(n,1))}catch(e){}}),t}(e):null}},7510:e=>{e.exports=function(){for(var e={},r=0;r<arguments.length;r++){var n=arguments[r];for(var o in n)t.call(n,o)&&(e[o]=n[o])}return e};var t=Object.prototype.hasOwnProperty},3086:()=>{},4923:()=>{},8982:()=>{},7790:()=>{},3776:()=>{},9368:()=>{},5340:()=>{},9838:()=>{},9209:(e,t,r)=>{var n=r(6578),o="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof o[n[t]]&&(e[e.length]=n[t]);return e}},6425:(e,t,r)=>{var n=r(5606),o=r(8287).Buffer;function i(e,t){return function(){return e.apply(t,arguments)}}const{toString:a}=Object.prototype,{getPrototypeOf:s}=Object,{iterator:u,toStringTag:c}=Symbol,f=(l=Object.create(null),e=>{const t=a.call(e);return l[t]||(l[t]=t.slice(8,-1).toLowerCase())});var l;const d=e=>(e=e.toLowerCase(),t=>f(t)===e),h=e=>t=>typeof t===e,{isArray:p}=Array,y=h("undefined");function m(e){return null!==e&&!y(e)&&null!==e.constructor&&!y(e.constructor)&&v(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const b=d("ArrayBuffer"),g=h("string"),v=h("function"),w=h("number"),S=e=>null!==e&&"object"==typeof e,M=e=>{if("object"!==f(e))return!1;const t=s(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||c in e||u in e)},_=d("Date"),A=d("File"),E=d("Blob"),O=d("FileList"),j=d("URLSearchParams"),[T,N,P,B]=["ReadableStream","Request","Response","Headers"].map(d);function R(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,o;if("object"!=typeof e&&(e=[e]),p(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(m(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(n=0;n<i;n++)a=o[n],t.call(null,e[a],a,e)}}function C(e,t){if(m(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n,o=r.length;for(;o-- >0;)if(n=r[o],t===n.toLowerCase())return n;return null}const x="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r.g,I=e=>!y(e)&&e!==x,k=(H="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>H&&e instanceof H);var H;const U=d("HTMLFormElement"),L=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),D=d("RegExp"),V=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};R(r,(r,o)=>{let i;!1!==(i=t(r,o,e))&&(n[o]=i||r)}),Object.defineProperties(e,n)},z=d("AsyncFunction"),J=(K="function"==typeof setImmediate,F=v(x.postMessage),K?setImmediate:F?(q=`axios@${Math.random()}`,W=[],x.addEventListener("message",({source:e,data:t})=>{e===x&&t===q&&W.length&&W.shift()()},!1),e=>{W.push(e),x.postMessage(q,"*")}):e=>setTimeout(e));var K,F,q,W;const G="undefined"!=typeof queueMicrotask?queueMicrotask.bind(x):void 0!==n&&n.nextTick||J;var Z={isArray:p,isArrayBuffer:b,isBuffer:m,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||v(e.append)&&("formdata"===(t=f(e))||"object"===t&&v(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&b(e.buffer),t},isString:g,isNumber:w,isBoolean:e=>!0===e||!1===e,isObject:S,isPlainObject:M,isEmptyObject:e=>{if(!S(e)||m(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:T,isRequest:N,isResponse:P,isHeaders:B,isUndefined:y,isDate:_,isFile:A,isBlob:E,isRegExp:D,isFunction:v,isStream:e=>S(e)&&v(e.pipe),isURLSearchParams:j,isTypedArray:k,isFileList:O,forEach:R,merge:function e(){const{caseless:t,skipUndefined:r}=I(this)&&this||{},n={},o=(o,i)=>{const a=t&&C(n,i)||i;M(n[a])&&M(o)?n[a]=e(n[a],o):M(o)?n[a]=e({},o):p(o)?n[a]=o.slice():r&&y(o)||(n[a]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&R(arguments[e],o);return n},extend:(e,t,r,{allOwnKeys:n}={})=>(R(t,(t,n)=>{r&&v(t)?e[n]=i(t,r):e[n]=t},{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let o,i,a;const u={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],n&&!n(a,e,t)||u[a]||(t[a]=e[a],u[a]=!0);e=!1!==r&&s(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:f,kindOfTest:d,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(p(e))return e;let t=e.length;if(!w(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[u]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:U,hasOwnProperty:L,hasOwnProp:L,reduceDescriptors:V,freezeMethods:e=>{V(e,(t,r)=>{if(v(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];v(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach(e=>{r[e]=!0})};return p(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:C,global:x,isContextDefined:I,isSpecCompliantForm:function(e){return!!(e&&v(e.append)&&"FormData"===e[c]&&e[u])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(S(e)){if(t.indexOf(e)>=0)return;if(m(e))return e;if(!("toJSON"in e)){t[n]=e;const o=p(e)?[]:{};return R(e,(e,t)=>{const i=r(e,n+1);!y(i)&&(o[t]=i)}),t[n]=void 0,o}}return e};return r(e,0)},isAsyncFn:z,isThenable:e=>e&&(S(e)||v(e))&&v(e.then)&&v(e.catch),setImmediate:J,asap:G,isIterable:e=>null!=e&&v(e[u])};function $(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}Z.inherits($,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Z.toJSONObject(this.config),code:this.code,status:this.status}}});const X=$.prototype,Q={};function Y(e){return Z.isPlainObject(e)||Z.isArray(e)}function ee(e){return Z.endsWith(e,"[]")?e.slice(0,-2):e}function te(e,t,r){return e?e.concat(t).map(function(e,t){return e=ee(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Q[e]={value:e}}),Object.defineProperties($,Q),Object.defineProperty(X,"isAxiosError",{value:!0}),$.from=(e,t,r,n,o,i)=>{const a=Object.create(X);Z.toFlatObject(e,a,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const s=e&&e.message?e.message:"Error",u=null==t&&e?e.code:t;return $.call(a,s,u,r,n,o),e&&null==a.cause&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",i&&Object.assign(a,i),a};const re=Z.toFlatObject(Z,{},null,function(e){return/^is[A-Z]/.test(e)});function ne(e,t,r){if(!Z.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=Z.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Z.isUndefined(t[e])})).metaTokens,i=r.visitor||f,a=r.dots,s=r.indexes,u=(r.Blob||"undefined"!=typeof Blob&&Blob)&&Z.isSpecCompliantForm(t);if(!Z.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Z.isDate(e))return e.toISOString();if(Z.isBoolean(e))return e.toString();if(!u&&Z.isBlob(e))throw new $("Blob is not supported. Use a Buffer instead.");return Z.isArrayBuffer(e)||Z.isTypedArray(e)?u&&"function"==typeof Blob?new Blob([e]):o.from(e):e}function f(e,r,o){let i=e;if(e&&!o&&"object"==typeof e)if(Z.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(Z.isArray(e)&&function(e){return Z.isArray(e)&&!e.some(Y)}(e)||(Z.isFileList(e)||Z.endsWith(r,"[]"))&&(i=Z.toArray(e)))return r=ee(r),i.forEach(function(e,n){!Z.isUndefined(e)&&null!==e&&t.append(!0===s?te([r],n,a):null===s?r:r+"[]",c(e))}),!1;return!!Y(e)||(t.append(te(o,r,a),c(e)),!1)}const l=[],d=Object.assign(re,{defaultVisitor:f,convertValue:c,isVisitable:Y});if(!Z.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!Z.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),Z.forEach(r,function(r,o){!0===(!(Z.isUndefined(r)||null===r)&&i.call(t,r,Z.isString(o)?o.trim():o,n,d))&&e(r,n?n.concat(o):[o])}),l.pop()}}(e),t}function oe(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function ie(e,t){this._pairs=[],e&&ne(e,this,t)}const ae=ie.prototype;function se(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ue(e,t,r){if(!t)return e;const n=r&&r.encode||se;Z.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(i=o?o(t,r):Z.isURLSearchParams(t)?t.toString():new ie(t,r).toString(n),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}ae.append=function(e,t){this._pairs.push([e,t])},ae.toString=function(e){const t=e?function(t){return e.call(this,t,oe)}:oe;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};var ce=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Z.forEach(this.handlers,function(t){null!==t&&e(t)})}},fe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},le={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ie,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const de="undefined"!=typeof window&&"undefined"!=typeof document,he="object"==typeof navigator&&navigator||void 0,pe=de&&(!he||["ReactNative","NativeScript","NS"].indexOf(he.product)<0),ye="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,me=de&&window.location.href||"http://localhost";var be={...Object.freeze({__proto__:null,hasBrowserEnv:de,hasStandardBrowserWebWorkerEnv:ye,hasStandardBrowserEnv:pe,navigator:he,origin:me}),...le};function ge(e){function t(e,r,n,o){let i=e[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=e.length;return i=!i&&Z.isArray(n)?n.length:i,s?(Z.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!a):(n[i]&&Z.isObject(n[i])||(n[i]=[]),t(e,r,n[i],o)&&Z.isArray(n[i])&&(n[i]=function(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}(n[i])),!a)}if(Z.isFormData(e)&&Z.isFunction(e.entries)){const r={};return Z.forEachEntry(e,(e,n)=>{t(function(e){return Z.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),n,r,0)}),r}return null}const ve={transitional:fe,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=Z.isObject(e);if(o&&Z.isHTMLForm(e)&&(e=new FormData(e)),Z.isFormData(e))return n?JSON.stringify(ge(e)):e;if(Z.isArrayBuffer(e)||Z.isBuffer(e)||Z.isStream(e)||Z.isFile(e)||Z.isBlob(e)||Z.isReadableStream(e))return e;if(Z.isArrayBufferView(e))return e.buffer;if(Z.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ne(e,new be.classes.URLSearchParams,{visitor:function(e,t,r,n){return be.isNode&&Z.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=Z.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return ne(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),function(e){if(Z.isString(e))try{return(0,JSON.parse)(e),Z.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ve.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(Z.isResponse(e)||Z.isReadableStream(e))return e;if(e&&Z.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(e){if(r){if("SyntaxError"===e.name)throw $.from(e,$.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:be.classes.FormData,Blob:be.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Z.forEach(["delete","get","head","post","put","patch"],e=>{ve.headers[e]={}});var we=ve;const Se=Z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Me=Symbol("internals");function _e(e){return e&&String(e).trim().toLowerCase()}function Ae(e){return!1===e||null==e?e:Z.isArray(e)?e.map(Ae):String(e)}function Ee(e,t,r,n,o){return Z.isFunction(n)?n.call(this,t,r):(o&&(t=r),Z.isString(t)?Z.isString(n)?-1!==t.indexOf(n):Z.isRegExp(n)?n.test(t):void 0:void 0)}class Oe{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function o(e,t,r){const o=_e(t);if(!o)throw new Error("header name must be a non-empty string");const i=Z.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||t]=Ae(e))}const i=(e,t)=>Z.forEach(e,(e,r)=>o(e,r,t));if(Z.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Z.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let r,n,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),n=e.substring(o+1).trim(),!r||t[r]&&Se[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t})(e),t);else if(Z.isObject(e)&&Z.isIterable(e)){let r,n,o={};for(const t of e){if(!Z.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[n=t[0]]=(r=o[n])?Z.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,r);return this}get(e,t){if(e=_e(e)){const r=Z.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(Z.isFunction(t))return t.call(this,e,r);if(Z.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=_e(e)){const r=Z.findKey(this,e);return!(!r||void 0===this[r]||t&&!Ee(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function o(e){if(e=_e(e)){const o=Z.findKey(r,e);!o||t&&!Ee(0,r[o],o,t)||(delete r[o],n=!0)}}return Z.isArray(e)?e.forEach(o):o(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const o=t[r];e&&!Ee(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}normalize(e){const t=this,r={};return Z.forEach(this,(n,o)=>{const i=Z.findKey(r,o);if(i)return t[i]=Ae(n),void delete t[o];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(o):String(o).trim();a!==o&&delete t[o],t[a]=Ae(n),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Z.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&Z.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){const t=(this[Me]=this[Me]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=_e(e);t[n]||(function(e,t){const r=Z.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})})}(r,e),t[n]=!0)}return Z.isArray(e)?e.forEach(n):n(e),this}}Oe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Z.reduceDescriptors(Oe.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),Z.freezeMethods(Oe);var je=Oe;function Te(e,t){const r=this||we,n=t||r,o=je.from(n.headers);let i=n.data;return Z.forEach(e,function(e){i=e.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Ne(e){return!(!e||!e.__CANCEL__)}function Pe(e,t,r){$.call(this,null==e?"canceled":e,$.ERR_CANCELED,t,r),this.name="CanceledError"}function Be(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new $("Request failed with status code "+r.status,[$.ERR_BAD_REQUEST,$.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}Z.inherits(Pe,$,{__CANCEL__:!0});const Re=(e,t,r=3)=>{let n=0;const o=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const u=Date.now(),c=n[a];o||(o=u),r[i]=s,n[i]=u;let f=a,l=0;for(;f!==i;)l+=r[f++],f%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),u-o<t)return;const d=c&&u-c;return d?Math.round(1e3*l/d):void 0}}(50,250);return function(r,i){let a,s,u=0,c=1e3/i;const f=(r,i=Date.now())=>{u=i,a=null,s&&(clearTimeout(s),s=null),(r=>{const i=r.loaded,a=r.lengthComputable?r.total:void 0,s=i-n,u=o(s);n=i,e({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:u||void 0,estimated:u&&a&&i<=a?(a-i)/u:void 0,event:r,lengthComputable:null!=a,[t?"download":"upload"]:!0})})(...r)};return[(...e)=>{const t=Date.now(),r=t-u;r>=c?f(e,t):(a=e,s||(s=setTimeout(()=>{s=null,f(a)},c-r)))},()=>a&&f(a)]}(0,r)},Ce=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},xe=e=>(...t)=>Z.asap(()=>e(...t));var Ie=be.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,be.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(be.origin),be.navigator&&/(msie|trident)/i.test(be.navigator.userAgent)):()=>!0,ke=be.hasStandardBrowserEnv?{write(e,t,r,n,o,i,a){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];Z.isNumber(r)&&s.push(`expires=${new Date(r).toUTCString()}`),Z.isString(n)&&s.push(`path=${n}`),Z.isString(o)&&s.push(`domain=${o}`),!0===i&&s.push("secure"),Z.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function He(e,t,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Ue=e=>e instanceof je?{...e}:e;function Le(e,t){t=t||{};const r={};function n(e,t,r,n){return Z.isPlainObject(e)&&Z.isPlainObject(t)?Z.merge.call({caseless:n},e,t):Z.isPlainObject(t)?Z.merge({},t):Z.isArray(t)?t.slice():t}function o(e,t,r,o){return Z.isUndefined(t)?Z.isUndefined(e)?void 0:n(void 0,e,0,o):n(e,t,0,o)}function i(e,t){if(!Z.isUndefined(t))return n(void 0,t)}function a(e,t){return Z.isUndefined(t)?Z.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,o,i){return i in t?n(r,o):i in e?n(void 0,r):void 0}const u={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t,r)=>o(Ue(e),Ue(t),0,!0)};return Z.forEach(Object.keys({...e,...t}),function(n){const i=u[n]||o,a=i(e[n],t[n],n);Z.isUndefined(a)&&i!==s||(r[n]=a)}),r}var De=e=>{const t=Le({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=t;if(t.headers=a=je.from(a),t.url=ue(He(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),Z.isFormData(r))if(be.hasStandardBrowserEnv||be.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(Z.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&a.set(e,r)})}if(be.hasStandardBrowserEnv&&(n&&Z.isFunction(n)&&(n=n(t)),n||!1!==n&&Ie(t.url))){const e=o&&i&&ke.read(i);e&&a.set(o,e)}return t},Ve="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const n=De(e);let o=n.data;const i=je.from(n.headers).normalize();let a,s,u,c,f,{responseType:l,onUploadProgress:d,onDownloadProgress:h}=n;function p(){c&&c(),f&&f(),n.cancelToken&&n.cancelToken.unsubscribe(a),n.signal&&n.signal.removeEventListener("abort",a)}let y=new XMLHttpRequest;function m(){if(!y)return;const n=je.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());Be(function(e){t(e),p()},function(e){r(e),p()},{data:l&&"text"!==l&&"json"!==l?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:n,config:e,request:y}),y=null}y.open(n.method.toUpperCase(),n.url,!0),y.timeout=n.timeout,"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(m)},y.onabort=function(){y&&(r(new $("Request aborted",$.ECONNABORTED,e,y)),y=null)},y.onerror=function(t){const n=new $(t&&t.message?t.message:"Network Error",$.ERR_NETWORK,e,y);n.event=t||null,r(n),y=null},y.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const o=n.transitional||fe;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new $(t,o.clarifyTimeoutError?$.ETIMEDOUT:$.ECONNABORTED,e,y)),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&Z.forEach(i.toJSON(),function(e,t){y.setRequestHeader(t,e)}),Z.isUndefined(n.withCredentials)||(y.withCredentials=!!n.withCredentials),l&&"json"!==l&&(y.responseType=n.responseType),h&&([u,f]=Re(h,!0),y.addEventListener("progress",u)),d&&y.upload&&([s,c]=Re(d),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",c)),(n.cancelToken||n.signal)&&(a=t=>{y&&(r(!t||t.type?new Pe(null,e,y):t),y.abort(),y=null)},n.cancelToken&&n.cancelToken.subscribe(a),n.signal&&(n.signal.aborted?a():n.signal.addEventListener("abort",a)));const b=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);b&&-1===be.protocols.indexOf(b)?r(new $("Unsupported protocol "+b+":",$.ERR_BAD_REQUEST,e)):y.send(o||null)})},ze=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const o=function(e){if(!r){r=!0,a();const t=e instanceof Error?e:this.reason;n.abort(t instanceof $?t:new Pe(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new $(`timeout ${t} of ms exceeded`,$.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:s}=n;return s.unsubscribe=()=>Z.asap(a),s}};const Je=function*(e,t){let r=e.byteLength;if(r<t)return void(yield e);let n,o=0;for(;o<r;)n=o+t,yield e.slice(o,n),o=n},Ke=(e,t,r,n)=>{const o=async function*(e,t){for await(const r of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}}(e))yield*Je(r,t)}(e,t);let i,a=0,s=e=>{i||(i=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await o.next();if(t)return s(),void e.close();let i=n.byteLength;if(r){let e=a+=i;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw s(e),e}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},{isFunction:Fe}=Z,qe=(({Request:e,Response:t})=>({Request:e,Response:t}))(Z.global),{ReadableStream:We,TextEncoder:Ge}=Z.global,Ze=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},$e=e=>{e=Z.merge.call({skipUndefined:!0},qe,e);const{fetch:t,Request:r,Response:n}=e,o=t?Fe(t):"function"==typeof fetch,i=Fe(r),a=Fe(n);if(!o)return!1;const s=o&&Fe(We),u=o&&("function"==typeof Ge?(c=new Ge,e=>c.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var c;const f=i&&s&&Ze(()=>{let e=!1;const t=new r(be.origin,{body:new We,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),l=a&&s&&Ze(()=>Z.isReadableStream(new n("").body)),d={stream:l&&(e=>e.body)};return o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new $(`Response type '${e}' is not supported`,$.ERR_NOT_SUPPORT,r)})}),async e=>{let{url:o,method:a,data:s,signal:c,cancelToken:h,timeout:p,onDownloadProgress:y,onUploadProgress:m,responseType:b,headers:g,withCredentials:v="same-origin",fetchOptions:w}=De(e),S=t||fetch;b=b?(b+"").toLowerCase():"text";let M=ze([c,h&&h.toAbortSignal()],p),_=null;const A=M&&M.unsubscribe&&(()=>{M.unsubscribe()});let E;try{if(m&&f&&"get"!==a&&"head"!==a&&0!==(E=await(async(e,t)=>{const n=Z.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(Z.isBlob(e))return e.size;if(Z.isSpecCompliantForm(e)){const t=new r(be.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Z.isArrayBufferView(e)||Z.isArrayBuffer(e)?e.byteLength:(Z.isURLSearchParams(e)&&(e+=""),Z.isString(e)?(await u(e)).byteLength:void 0)})(t):n})(g,s))){let e,t=new r(o,{method:"POST",body:s,duplex:"half"});if(Z.isFormData(s)&&(e=t.headers.get("content-type"))&&g.setContentType(e),t.body){const[e,r]=Ce(E,Re(xe(m)));s=Ke(t.body,65536,e,r)}}Z.isString(v)||(v=v?"include":"omit");const t=i&&"credentials"in r.prototype,c={...w,signal:M,method:a.toUpperCase(),headers:g.normalize().toJSON(),body:s,duplex:"half",credentials:t?v:void 0};_=i&&new r(o,c);let h=await(i?S(_,w):S(o,c));const p=l&&("stream"===b||"response"===b);if(l&&(y||p&&A)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=h[t]});const t=Z.toFiniteNumber(h.headers.get("content-length")),[r,o]=y&&Ce(t,Re(xe(y),!0))||[];h=new n(Ke(h.body,65536,r,()=>{o&&o(),A&&A()}),e)}b=b||"text";let O=await d[Z.findKey(d,b)||"text"](h,e);return!p&&A&&A(),await new Promise((t,r)=>{Be(t,r,{data:O,headers:je.from(h.headers),status:h.status,statusText:h.statusText,config:e,request:_})})}catch(t){if(A&&A(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new $("Network Error",$.ERR_NETWORK,e,_),{cause:t.cause||t});throw $.from(t,t&&t.code,e,_)}}},Xe=new Map,Qe=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let a,s,u=i.length,c=Xe;for(;u--;)a=i[u],s=c.get(a),void 0===s&&c.set(a,s=u?new Map:$e(t)),c=s;return s};Qe();const Ye={http:null,xhr:Ve,fetch:{get:Qe}};Z.forEach(Ye,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const et=e=>`- ${e}`,tt=e=>Z.isFunction(e)||null===e||!1===e;var rt=function(e,t){e=Z.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let a=0;a<r;a++){let r;if(n=e[a],o=n,!tt(n)&&(o=Ye[(r=String(n)).toLowerCase()],void 0===o))throw new $(`Unknown adapter '${r}'`);if(o&&(Z.isFunction(o)||(o=o.get(t))))break;i[r||"#"+a]=o}if(!o){const e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new $("There is no suitable adapter to dispatch the request "+(r?e.length>1?"since :\n"+e.map(et).join("\n"):" "+et(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function nt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Pe(null,e)}function ot(e){return nt(e),e.headers=je.from(e.headers),e.data=Te.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),rt(e.adapter||we.adapter,e)(e).then(function(t){return nt(e),t.data=Te.call(e,e.transformResponse,t),t.headers=je.from(t.headers),t},function(t){return Ne(t)||(nt(e),t&&t.response&&(t.response.data=Te.call(e,e.transformResponse,t.response),t.response.headers=je.from(t.response.headers))),Promise.reject(t)})}const it="1.13.2",at={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{at[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const st={};at.transitional=function(e,t,r){function n(e,t){return"[Axios v"+it+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,i)=>{if(!1===e)throw new $(n(o," has been removed"+(t?" in "+t:"")),$.ERR_DEPRECATED);return t&&!st[o]&&(st[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,i)}},at.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};var ut={assertOptions:function(e,t,r){if("object"!=typeof e)throw new $("options must be an object",$.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],a=t[i];if(a){const t=e[i],r=void 0===t||a(t,i,e);if(!0!==r)throw new $("option "+i+" must be "+r,$.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new $("Unknown option "+i,$.ERR_BAD_OPTION)}},validators:at};const ct=ut.validators;class ft{constructor(e){this.defaults=e||{},this.interceptors={request:new ce,response:new ce}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Le(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:o}=t;void 0!==r&&ut.assertOptions(r,{silentJSONParsing:ct.transitional(ct.boolean),forcedJSONParsing:ct.transitional(ct.boolean),clarifyTimeoutError:ct.transitional(ct.boolean)},!1),null!=n&&(Z.isFunction(n)?t.paramsSerializer={serialize:n}:ut.assertOptions(n,{encode:ct.function,serialize:ct.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),ut.assertOptions(t,{baseUrl:ct.spelling("baseURL"),withXsrfToken:ct.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&Z.merge(o.common,o[t.method]);o&&Z.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=je.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))});const u=[];let c;this.interceptors.response.forEach(function(e){u.push(e.fulfilled,e.rejected)});let f,l=0;if(!s){const e=[ot.bind(this),void 0];for(e.unshift(...a),e.push(...u),f=e.length,c=Promise.resolve(t);l<f;)c=c.then(e[l++],e[l++]);return c}f=a.length;let d=t;for(;l<f;){const t=a[l++],r=a[l++];try{d=t(d)}catch(e){r.call(this,e);break}}try{c=ot.call(this,d)}catch(e){return Promise.reject(e)}for(l=0,f=u.length;l<f;)c=c.then(u[l++],u[l++]);return c}getUri(e){return ue(He((e=Le(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}Z.forEach(["delete","get","head","options"],function(e){ft.prototype[e]=function(t,r){return this.request(Le(r||{},{method:e,url:t,data:(r||{}).data}))}}),Z.forEach(["post","put","patch"],function(e){function t(t){return function(r,n,o){return this.request(Le(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}ft.prototype[e]=t(),ft.prototype[e+"Form"]=t(!0)});var lt=ft;class dt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const r=this;this.promise.then(e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,o){r.reason||(r.reason=new Pe(e,n,o),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new dt(function(t){e=t}),cancel:e}}}var ht=dt;const pt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(pt).forEach(([e,t])=>{pt[t]=e});var yt=pt;const mt=function e(t){const r=new lt(t),n=i(lt.prototype.request,r);return Z.extend(n,lt.prototype,r,{allOwnKeys:!0}),Z.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(Le(t,r))},n}(we);mt.Axios=lt,mt.CanceledError=Pe,mt.CancelToken=ht,mt.isCancel=Ne,mt.VERSION=it,mt.toFormData=ne,mt.AxiosError=$,mt.Cancel=mt.CanceledError,mt.all=function(e){return Promise.all(e)},mt.spread=function(e){return function(t){return e.apply(null,t)}},mt.isAxiosError=function(e){return Z.isObject(e)&&!0===e.isAxiosError},mt.mergeConfig=Le,mt.AxiosHeaders=je,mt.formToJSON=e=>ge(Z.isHTMLForm(e)?new FormData(e):e),mt.getAdapter=rt,mt.HttpStatusCode=yt,mt.default=mt,e.exports=mt},9255:e=>{e.exports={rE:"6.6.1"}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}return r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r(887)})(),e.exports=t()}(r);var n=r.exports;class o{constructor(e,t){this.wallet=e,this.apiBaseUrl=t}async execute(e){const t=await this.wallet.getAddress();if(!t){throw{code:"WALLET_NOT_FOUND",message:"Please connect your wallet first."}}const r=this.wallet.getProvider();if(!r){throw{code:"WALLET_NOT_FOUND",message:"Wallet provider not available."}}const o=Math.floor(1e9*e.amount).toString(),i=this.wallet.getNetwork(),a=Date.now();try{const s=n.PublicKey.fromHex(t),u=n.PublicKey.fromHex(e.recipientAddress),c=new n.ExecutableDeployItem;c.transfer=n.TransferDeployItem.newTransfer(o,u,void 0,a);const f=n.ExecutableDeployItem.standardPayment("100000000"),l=n.DeployHeader.default();l.account=s,l.chainName=i;const d=n.Deploy.makeDeploy(l,f,c),h=n.Deploy.toJSON(d),p=await r.sign(JSON.stringify(h),t);if(p.cancelled){throw{code:"TRANSFER_REJECTED",message:"Transfer was cancelled by the user."}}const y=t.substring(0,2),m=y+("string"==typeof p.signature?p.signature:Array.from(p.signature).map(e=>e.toString(16).padStart(2,"0")).join("")),b=n.Deploy.toJSON(d);b.approvals=[{signer:t,signature:m}];const g="casper"===i,v=`${this.apiBaseUrl}/rpc`,w=await fetch(v,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deploy:b,network:g?"mainnet":"testnet"})}),S=await w.json();if(!w.ok||S.error)throw new Error(S.error||"RPC request failed");return{deployHash:S.deploy_hash,senderAddress:t,recipientAddress:e.recipientAddress,amount:e.amount}}catch(e){if("TRANSFER_REJECTED"===e.code)throw e;if(e.cancelled||2===e.code||e.message?.includes("rejected")||e.message?.includes("cancel")){throw{code:"TRANSFER_REJECTED",message:"Transfer was cancelled by the user."}}throw{code:"NETWORK_ERROR",message:e.message||"Failed to execute transfer."}}}}class i{constructor(e){this.wallet=null,this.transfer=null,this.client=e}setWallet(e,t){this.wallet=e,this.transfer=t}async recordPayment(e){if(!e.senderAddress)throw{error:"senderAddress is required",code:"INVALID_PARAMS",status:400};if(!e.amount||e.amount<=0)throw{error:"amount must be greater than 0",code:"INVALID_PARAMS",status:400};if(!e.productId&&!e.subscriptionPlanId)throw{error:"Either productId or subscriptionPlanId is required",code:"INVALID_PARAMS",status:400};const t={merchant_id:this.client.getMerchantId(),sender_address:e.senderAddress,transaction_hash:e.transactionHash||`mock_tx_${Date.now()}`,product_id:e.productId,subscription_plan_id:e.subscriptionPlanId,amount:e.amount,currency:e.currency||"USD"};return this.client.request("POST","/v1/payments/record",t)}async recordSubscription(e){if(!e.subscriptionPlanId)throw{error:"subscriptionPlanId is required for subscription recording",code:"INVALID_PARAMS",status:400};return this.recordPayment(e)}async makePayment(e){if(!this.wallet||!this.transfer)throw{error:"Wallet not initialized. Make sure to use the SDK in browser environment.",code:"WALLET_NOT_INITIALIZED",status:500};if(!e.amount||e.amount<=0)throw{error:"amount must be greater than 0",code:"INVALID_PARAMS",status:400};if(!e.productId&&!e.subscriptionPlanId)throw{error:"Either productId or subscriptionPlanId is required",code:"INVALID_PARAMS",status:400};try{await this.wallet.isConnected()||await this.wallet.connect();const t=await this.wallet.getAddress();if(!t)throw{error:"Failed to get wallet address",code:"WALLET_ERROR",status:500};const r=this.wallet.getMerchantWalletAddress(),n=await this.transfer.execute({recipientAddress:r,amount:e.amount});try{const r=await this.recordPayment({senderAddress:t,transactionHash:n.deployHash,productId:e.productId,subscriptionPlanId:e.subscriptionPlanId,amount:e.amount,currency:e.currency||"CSPR"});return{success:!0,transactionHash:n.deployHash,payment:r}}catch(e){return{success:!0,transactionHash:n.deployHash,error:`Payment transferred but recording failed: ${e.error||e.message}`}}}catch(e){return{success:!1,transactionHash:"",error:e.message||e.error||"Payment failed"}}}}class a{constructor(e){this.client=e}async checkStatus(e){if(!e.subscriberAddress)throw{error:"subscriberAddress is required",code:"INVALID_PARAMS",status:400};let t=`/v1/subscriptions/check/?merchant_id=${this.client.getMerchantId()}&subscriber=${e.subscriberAddress}`;return e.planId&&(t+=`&plan_id=${e.planId}`),this.client.request("GET",t)}}const s="https://www.casperwallet.io/";class u{constructor(e){this.provider=null,this.connected=!1,this.activeAddress=null,this.config=e,this.initProvider()}initProvider(){if("undefined"==typeof window)return;const e=window.CasperWalletProvider;e&&(this.provider=e({timeout:18e5}),this.setupEventListeners())}setupEventListeners(){"undefined"!=typeof window&&(window.addEventListener("casper-wallet:connected",e=>{try{const t=JSON.parse(e.detail);this.connected=!0,this.activeAddress=t.activeKey||null}catch(e){}}),window.addEventListener("casper-wallet:disconnected",()=>{this.connected=!1,this.activeAddress=null}),window.addEventListener("casper-wallet:activeKeyChanged",e=>{try{const t=JSON.parse(e.detail);this.activeAddress=t.activeKey||null}catch(e){}}),window.addEventListener("casper-wallet:locked",()=>{this.connected=!1}),window.addEventListener("casper-wallet:unlocked",async()=>{if(this.provider)try{const e=await this.provider.isConnected();this.connected=e,e&&(this.activeAddress=await this.provider.getActivePublicKey())}catch(e){}}))}isAvailable(){return"undefined"!=typeof window&&!!window.CasperWalletProvider}async isConnected(){if(!this.provider)return this.connected=!1,!1;try{const e=await this.provider.isConnected();return this.connected=e,e}catch(e){return this.connected=!1,e.code,!1}}async connect(){if(!this.isAvailable()){throw{code:"WALLET_NOT_FOUND",message:"Casper Wallet extension not found. Please install it first.",installUrl:s}}if(this.provider||this.initProvider(),!this.provider){throw{code:"WALLET_NOT_FOUND",message:"Failed to initialize Casper Wallet provider.",installUrl:s}}try{if(!await this.provider.requestConnection()){throw{code:"CONNECTION_REJECTED",message:"Wallet connection was rejected by the user."}}if(this.connected=!0,this.activeAddress=await this.provider.getActivePublicKey(),!this.activeAddress){throw{code:"UNKNOWN_ERROR",message:"Failed to get wallet address after connection."}}return this.activeAddress}catch(e){if("CONNECTION_REJECTED"===e.code)throw e;if(1===e.code){throw{code:"WALLET_LOCKED",message:"Wallet is locked. Please unlock your Casper Wallet and try again."}}throw{code:"UNKNOWN_ERROR",message:e.message||"Failed to connect to wallet."}}}async disconnect(){if(this.provider)try{await this.provider.disconnectFromSite()}catch(e){}this.connected=!1,this.activeAddress=null}async getAddress(){if(!this.provider)return null;try{return await this.isConnected()?(this.activeAddress=await this.provider.getActivePublicKey(),this.activeAddress):null}catch(e){return null}}getInfo(){return{isConnected:this.connected,address:this.activeAddress}}async getState(){const e=await this.isConnected();return{connected:e,address:e?await this.getAddress():null,locked:!e&&this.isAvailable()}}getProvider(){return this.provider}getMerchantWalletAddress(){return this.config.walletAddress}getNetwork(){return"mainnet"===this.config.network?"casper":"casper-test"}async signDeploy(e){if(!this.provider){throw{code:"WALLET_NOT_FOUND",message:"Casper Wallet not available.",installUrl:s}}await this.isConnected()||await this.connect();try{const t=JSON.stringify(e);return await this.provider.sign(t,this.activeAddress)}catch(e){if(2===e.code||e.message?.includes("rejected")||e.message?.includes("cancelled")){throw{code:"TRANSFER_REJECTED",message:"Transaction was rejected by the user."}}throw{code:"UNKNOWN_ERROR",message:e.message||"Failed to sign deploy."}}}}class c{constructor(e){if(!e.walletAddress)throw new Error("CasPay SDK: walletAddress is required");this.config=e,this.client=new t(e),this.wallet=new u(e);const r=this.client.getBaseUrl();this.transfer=new o(this.wallet,r),this.payments=new i(this.client),this.payments.setWallet(this.wallet,this.transfer),this.subscriptions=new a(this.client)}static get version(){return e}getConfig(){return{...this.config}}}return"undefined"!=typeof window&&(window.CasPay=c),c});
|